// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built require({cache:{"esri/core/accessorSupport/overrideDefaultsFrom":function(){define(["exports","../Accessor","./PropertyOrigin","./utils"],function(a,b,q,l){function p(k,h){var f=l.getProperties(k),c=l.getProperties(h);f=f.store;h=c.store;c=c.metadata;for(const d in c){var e=c[d],g=f.originOf(d);const t=h.originOf(d);e.readOnly||t===q.OriginId.DEFAULTS||(g!==q.OriginId.DEFAULTS?(e=f.get(d),g=h.get(d),e&&g&&g instanceof b&&e instanceof b&&e instanceof g.constructor&&p(e,g)):k.set(d,h.get(d)))}}a.overrideDefaultsFrom= p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectBoundingRect":function(){define(["exports","../../core/libs/gl-matrix-2/factories/vec3f64","./projectBuffer","../support/aaBoundingRect","../support/spatialReferenceUtils"],function(a,b,q,l,p){const k=b.create();a.projectBoundingRect=function(h,f,c,e){if(null==h)return!1;if(p.equals(f,e))return l.copy(c,h),!0;k[0]=h[0];k[1]=h[1];k[2]=0;if(!q.projectBuffer(k,f,0,k,e,0,1))return!1;c[0]=k[0];c[1]=k[1]; k[0]=h[2];k[1]=h[3];k[2]=0;if(!q.projectBuffer(k,f,0,k,e,0,1))return!1;c[2]=k[0];c[3]=k[1];return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectPointToVector":function(){define(["exports","../../core/libs/gl-matrix-2/factories/vec3f64","../projection","./projectBuffer"],function(a,b,q,l){function p(h,f,c,e){if(q.canProjectWithoutEngine(h.spatialReference,c))return k[0]=h.x,k[1]=h.y,k[2]=h.z??e??0,l.projectBuffer(k,h.spatialReference,0,f,c,0,1); h=q.tryProjectWithZConversion(h,c);if(!h)return!1;f[0]=h?.x;f[1]=h?.y;f[2]=h?.z??e??0;return!0}const k=b.create();a.projectPointToVector=p;a.projectPointToVectorAsync=async function(h,f,c,e,g){await q.initializeProjection(h.spatialReference,c,null,g);return p(h,f,c,e)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/boundedPlane":function(){define("exports ../core/has ../core/Logger ../core/mathUtils ../core/ObjectStack ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/support/Axis ../geometry/support/lineSegment ../geometry/support/plane ../geometry/support/ray ../geometry/support/vector ../geometry/support/vectorStacks".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(X=U){return{plane:d.create(X.plane),origin:c.clone(X.origin),basis1:c.clone(X.basis1),basis2:c.clone(X.basis2)}}function r(X,ja,la){const na=da.get();na.origin=X;na.basis1=ja;na.basis2=la;na.plane=d.wrap(0,0,0,0);y(na);return na}function n(X,ja=m()){return x(X.origin,X.basis1,X.basis2,ja)}function u(X,ja){f.copy(ja.origin,X.origin);f.copy(ja.basis1,X.basis1);f.copy(ja.basis2,X.basis2);d.copy(ja.plane,X.plane)}function x(X,ja,la,na=m()){f.copy(na.origin, X);f.copy(na.basis1,ja);f.copy(na.basis2,la);y(na);1E-6la&&(la=na)}return Math.sqrt(la)}function L(X,ja){return d.isPointInside(X.plane,ja)&&S(X,ja)}function P(X,ja,la,na){switch(la){case e.Axis.X:f.copy(na,X.basis1);f.normalize(na,na);break;case e.Axis.Y:f.copy(na,X.basis2);f.normalize(na,na);break;case e.Axis.Z:f.copy(na,W(X))}return na}function M(X,ja){const la= -X.plane[3];return w.projectPointSignedLength(W(X),ja)-la}function K(X,ja,la,na){const va=M(X,ja);X=f.scale(ea,W(X),la-va);f.add(na,ja,X);return na}function J(X,ja){return f.exactEquals(X.basis1,ja.basis1)&&f.exactEquals(X.basis2,ja.basis2)&&f.exactEquals(X.origin,ja.origin)}function R(X,ja,la){X!==la&&n(X,la);k.invert(ka,ja);k.transpose(ka,ka);f.transformMat4(la.basis1,X.basis1,ka);f.transformMat4(la.basis2,X.basis2,ka);f.transformMat4(d.getNormal(la.plane),d.getNormal(X.plane),ka);f.transformMat4(la.origin, X.origin,ja);d.setOffsetFromPoint(la.plane,la.plane,la.origin);return la}function Q(X,ja,la,na){X!==na&&n(X,na);k.fromRotation(fa,ja,la);f.transformMat4(na.basis1,X.basis1,fa);f.transformMat4(na.basis2,X.basis2,fa);y(na);return na}function W(X){return d.getNormal(X.plane)}function S(X,ja){const la=f.subtract(v.sv3d.get(),ja,X.origin);ja=f.squaredLength(X.basis1);const na=f.squaredLength(X.basis2),va=f.dot(X.basis1,la);X=f.dot(X.basis2,la);return 0>-va-ja&&0>va-ja&&0>-X-na&&0>X-na}function V(X,ja){const la= ca.get();f.copy(la.origin,X.origin);f.copy(la.vector,ja);return la}function T(X,ja,la){const {basis1:na,basis2:va,origin:za}=X;X=f.scale(v.sv3d.get(),na,ja.origin[0]);const ya=f.scale(v.sv3d.get(),va,ja.origin[1]);f.add(la.origin,X,ya);f.add(la.origin,la.origin,za);X=f.scale(v.sv3d.get(),na,ja.direction[0]);ja=f.scale(v.sv3d.get(),va,ja.direction[1]);f.scale(la.vector,f.add(X,X,ja),2);return la}function Y(X,ja,la,na){X=W(X);d.fromVectorsAndPoint(X,ja.direction,ja.origin,la);d.fromVectorsAndPoint(d.getNormal(la), X,ja.origin,na)}const ha=()=>q.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class ba{constructor(){this.plane=d.create();this.origin=c.create();this.basis1=c.create();this.basis2=c.create()}}b=ba;const U={plane:d.create(),origin:c.fromValues(0,0,0),basis1:c.fromValues(1,0,0),basis2:c.fromValues(0,1,0)},Z=new p.ObjectStack(d.create),ca=new p.ObjectStack(g.create),ea=c.create(),da=new p.ObjectStack(()=>m()),ia=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1, 1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],ka=h.create(),fa=h.create();p=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:b,altitudeAt:M,axisAt:P,closestPoint:H,closestPointOnSilhouette:F,copy:n,copyWithoutVerify:u,create:m,distance:I,distance2:G,distanceToSilhouette:O,elevate:z,equals:J,extrusionContainsPoint:L,fromAABoundingRect:B,fromValues:x,intersectRay:C,intersectRayClosestSilhouette:D,normal:W,projectPoint:N,projectPointLocal:E,rotate:Q,setAltitudeAt:K,setExtent:A, transform:R,up:U,updateUnboundedPlane:y,wrap:r},Symbol.toStringTag,{value:"Module"}));a.BoundedPlaneClass=b;a.altitudeAt=M;a.axisAt=P;a.boundedPlane=p;a.closestPoint=H;a.closestPointOnSilhouette=F;a.copy=n;a.copyWithoutVerify=u;a.create=m;a.distance=I;a.distance2=G;a.distanceToSilhouette=O;a.elevate=z;a.equals=J;a.extrusionContainsPoint=L;a.fromAABoundingRect=B;a.fromValues=x;a.intersectRay=C;a.intersectRayClosestSilhouette=D;a.normal=W;a.projectPoint=N;a.projectPointLocal=E;a.rotate=Q;a.setAltitudeAt= K;a.setExtent=A;a.transform=R;a.up=U;a.updateUnboundedPlane=y;a.wrap=r})},"esri/core/ObjectStack":function(){define(["exports","./nextTick"],function(a,b){class q{constructor(l){this._allocator=l;this._items=[];this._itemsPtr=0;this._grow()}get(){0===this._itemsPtr&&b.nextTick(()=>this._reset());this._itemsPtr===this._items.length&&this._grow();return this._items[this._itemsPtr++]}_reset(){this._items.length=Math.min(Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3072),this._items.length);this._itemsPtr= 0}_grow(){for(let l=0;lMath.abs(v[0])&&1E-6>Math.abs(v[1])&&1E-6>Math.abs(v[2]))return!1;x=k.sv3d.get();x[0]=u[0]-n[0];x[1]=u[1]-n[1];x[2]=u[2]-n[2];if(1E-6>Math.abs(x[0])&&1E-6>Math.abs(x[1])&&1E-6>Math.abs(x[2]))return!1;u=y[0]*v[0]+y[1]*v[1]+y[2]*v[2];var z=v[0]*x[0]+v[1]*x[1]+v[2]*x[2];const A=v[0]*v[0]+v[1]*v[1]+v[2]*v[2],B=(x[0]*x[0]+x[1]*x[1]+x[2]*x[2])*A-z*z;if(1E-6>Math.abs(B))return!1;y=(u*z-(y[0]*x[0]+y[1]*x[1]+y[2]*x[2])*A)/B;u=(u+z*y)/A;m&& (y=b.clamp(y,0,1),u=b.clamp(u,0,1));m=k.sv3d.get();z=k.sv3d.get();m[0]=n[0]+y*x[0];m[1]=n[1]+y*x[1];m[2]=n[2]+y*x[2];z[0]=w[0]+u*v[0];z[1]=w[1]+u*v[1];z[2]=w[2]+u*v[2];r.tA=y;r.tB=u;r.pA=m;r.pB=z;r.distance2=l.squaredDistance(m,z);return!0}const d={tA:0,tB:0,pA:p.create(),pB:p.create(),distance2:0},t=new q.ObjectStack(()=>h());a.closestLineSegmentPoint=function(w,v,m){return g(w,v,!0,d)?(l.copy(m,d.pA),!0):!1};a.closestRayDistance2=function(w,v){if(g(w,f(v.origin,v.direction),!1,d)){const {tA:m,pB:r, distance2:n}=d;if(0<=m&&1>=m)return n;if(0>m)return l.squaredDistance(w.origin,r);if(1this._reset());this._itemsPtr>=this._items.length&&this._items.push(this._create());return this._items[this._itemsPtr++]}_reset(){const g=2*this._itemsPtr;this._items.length>g&&(this._items.length=g);this._itemsPtr=0}static createVec2f64(){return new e(h.create)}static createVec3f64(){return new e(f.create)}static createVec4f64(){return new e(c.create)}static createMat3f64(){return new e(l.create)}static createMat4f64(){return new e(p.create)}static createQuatf64(){return new e(k.create)}get test(){}} a.VectorStack=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/vec2f64":function(){define(["exports"],function(a){function b(){return[0,0]}function q(m){return[m[0],m[1]]}function l(m,r){return[m,r]}function p(m,r=[0,0]){const n=Math.min(2,m.length);for(let u=0;uE)return!1;N(u,G);let L=I,P=!1;for(;LMath.abs(q.dot(z,A));if(!P)return 0=== G&&1===I&&2===O?!1:w(H,N,E,0,1,2);t(u,x,y,H);return!0}function v(H,N,E){H=q.scale(h.sv3d.get(),H,q.dot(H,N));q.subtract(E,N,H);return E}function m(H,N){return q.dot(H,N)+H[3]}function r(H,N,E,G,I){const O=q.dot(H,E);if(0===O)return!1;H=-(q.dot(H,N)+H[3])/O;G&C.CLAMP&&(H=b.clamp(H,0,1));if(!(G&C.INFINITE_MIN)&&0>H||!(G&C.INFINITE_MAX)&&1H&&0<=E)return!1;if(-1E-6E)return 0H||0>E)&&!(0>H&&0>E))return!0;H/=E;0N.c0&&(N.c0=H);return N.c0<=N.c1};a.clipInfinite=function(H,N){const E=q.dot(H,N.ray.direction);H=-m(H,N.ray.origin); if(-1E-6E)return 0N.c0&&(N.c0=H);return N.c0<=N.c1};a.copy=e;a.create=c;a.distance=function(H,N){return Math.abs(m(H,N))};a.equals=p;a.exactEquals=n;a.fromArray=function(H,N,E=!0){const G=N.length/3;return w(H,(I,O)=>q.set(I,N[3*O],N[3*O+1],N[3*O+2]),E?G-1:G)};a.fromManyPoints=w;a.fromNormalAndOffset=function(H,N,E){q.copy(E,H);E[3]=N;return E};a.fromPoints=t;a.fromPositionAndNormal=d;a.fromValues=g;a.fromVectorsAndPoint=function(H,N,E,G){q.cross(y,N,H);return d(E, y,G)};a.getNormal=function(H){return H};a.intersectLine=function(H,N,E,G){E=q.subtract(h.sv3d.get(),E,N);return r(H,N,E,D,G)};a.intersectLineSegment=function(H,N,E){return r(H,N.origin,N.vector,C.NONE,E)};a.intersectLineSegmentClamp=function(H,N,E){return r(H,N.origin,N.vector,C.CLAMP,E)};a.intersectRay=function(H,N,E){return null!=N?r(H,N.origin,N.direction,F,E):!1};a.isPointInside=function(H,N){return 0<=m(H,N)};a.negate=function(H,N){N[0]=-H[0];N[1]=-H[1];N[2]=-H[2];N[3]=-H[3];return N};a.projectPoint= function(H,N,E){const G=q.scale(h.sv3d.get(),H,-H[3]);N=q.subtract(h.sv3d.get(),N,G);H=v(H,N,h.sv3d.get());q.add(E,H,G);return E};a.projectPointLocal=function(H,N,E,G){var I=h.sv3d.get(),O=h.sv3d.get();f.tangentFrame(H,I,O);N=q.subtract(h.sv3d.get(),E,N);I=k.projectPointSignedLength(I,N);O=k.projectPointSignedLength(O,N);H=k.projectPointSignedLength(H,N);return q.set(G,I,O,H)};a.projectVector=v;a.setOffsetFromPoint=function(H,N,E){N!==H&&e(H,N);H[3]=-q.dot(H,E);return H};a.signedDistance=m;a.up=B; a.wrap=function(H=B[0],N=B[1],E=B[2],G=B[3]){return g(H,N,E,G,h.sv4d.get())};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/vector":function(){define(["exports","../../core/mathUtils","../../chunks/vec32","../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q,l){const p=l.create(),k=l.create();a.angle=function(h,f){h=q.dot(h,f)/(q.length(h)*q.length(f));return-b.acosClamped(h)};a.angleAroundAxis=function(h,f,c){q.normalize(p,h);q.normalize(k,f);h=q.dot(p, k);h=b.acosClamped(h);f=q.cross(p,p,k);return 0>q.dot(f,c)?2*Math.PI-h:h};a.projectPoint=function(h,f,c){f=q.dot(h,f)/q.dot(h,h);return q.scale(c,h,f)};a.projectPointSignedLength=function(h,f){return q.dot(h,f)/q.length(h)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/mathUtils":function(){define(["exports","../../../core/mathUtils","../../../chunks/vec32","../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q,l){const p=l.create(),k=l.create(), h=l.create(),f=l.create(),c=l.create();a.angle=function(e,g,d){e=q.normalize(f,e);g=q.normalize(c,g);const t=b.acosClamped(q.dot(e,g));return d&&(e=q.cross(h,e,g),0>q.dot(e,d))?-t:t};a.bilerp=function(e,g,d,t,w,v){e+=(g-e)*w;return e+(d+(t-d)*w-e)*v};a.cosCapped=function(e,g){return e>g?Math.cos(g):Math.cos(e)};a.fovx2fovy=function(e,g,d){return 2*Math.atan(d*Math.tan(.5*e)/g)};a.fovy2fovx=function(e,g,d){return 2*Math.atan(g*Math.tan(.5*e)/d)};a.makeOrthonormal=function(e,g,d){d=d||e;const t=q.dot(e, g);q.set(d,e[0]-t*g[0],e[1]-t*g[1],e[2]-t*g[2]);q.normalize(d,d)};a.makePiecewiseLinearFunction=function(e){const g=e.length;return d=>{if(d<=e[0][0])return e[0][1];if(d>=e[g-1][0])return e[g-1][1];let t=1;for(;d>e[t][0];)t++;const w=e[t][0];d=(w-d)/(w-e[t-1][0]);return d*e[t-1][1]+(1-d)*e[t][1]}};a.maxScale=function(e){return Math.sqrt(Math.max(e[0]*e[0]+e[4]*e[4]+e[8]*e[8],e[1]*e[1]+e[5]*e[5]+e[9]*e[9],e[2]*e[2]+e[6]*e[6]+e[10]*e[10]))};a.midpoint3d=function(e,g){q.set(g,0,0,0);if(0m){m=Math.acos(m);const r=((1- d)*w+d*v)/Math.sin(m);v=r/v*Math.sin(d*m);q.scale(f,e,r/w*Math.sin((1-d)*m));q.scale(c,g,v);return q.add(t,f,c)}return q.lerp(t,e,g,d)};a.slerpTangent=function(e,g,d,t=l.create(),w=l.create()){const v=q.length(e),m=q.length(g);var r=q.dot(e,g)/(v*m);if(.9999999999999999>r){r=Math.acos(r);const n=Math.sin(r),u=Math.sin(d*r),x=Math.sin((1-d)*r),y=(1-d)*v+d*m,z=y/n,A=z/m*u;q.scale(f,e,z/v*x);q.scale(c,g,A);q.add(t,f,c);q.scale(f,e,1/v*(-Math.cos((1-d)*r)*r*y+x*(-v+m)));q.scale(c,g,1/m*(Math.cos(d*r)* r*y+u*(-v+m)));q.add(w,f,c);q.scale(w,w,1/n);return w}q.lerp(t,e,g,d);q.subtract(w,g,e);q.normalize(w,w);return w};a.tangentFrame=function(e,g,d){Math.abs(e[0])>Math.abs(e[1])?q.set(g,0,1,0):q.set(g,1,0,0);q.cross(d,e,g);q.cross(g,d,e);q.normalize(d,d);q.normalize(g,g)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/ray":function(){define("exports ../../core/arrayUtils ../../core/ObjectStack ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ./vectorStacks".split(" "), function(a,b,q,l,p,k){function h(d){return d?f(p.clone(d.origin),p.clone(d.direction)):f(p.create(),p.create())}function f(d,t){return{origin:d,direction:t}}function c(d,t,w=h()){l.copy(w.origin,d);l.copy(w.direction,t);return w}const e=new q.ObjectStack(()=>h()),g=p.create();a.closestPoint=function(d,t,w){t=l.dot(d.direction,l.subtract(w,t,d.origin));l.add(w,d.origin,l.scale(w,d.direction,t));return w};a.closestPoints=function(d,t,w,v){const m=d.direction,r=t.direction;var n=l.sub(g,t.origin,d.origin); const u=l.dot(m,r),x=l.dot(r,n);n=l.dot(m,n);const y=l.dot(m,m),z=l.dot(r,r),A=(u*n-x*y)/(y*z-u*u);l.add(w,d.origin,l.scale(g,m,(u*x+n*z)/(y*z-u*u)));l.add(v,t.origin,l.scale(g,r,A));return[w,v]};a.copy=function(d,t=h()){return c(d.origin,d.direction,t)};a.create=h;a.distance2=function(d,t){d=l.cross(k.sv3d.get(),l.normalize(k.sv3d.get(),d.direction),l.subtract(k.sv3d.get(),t,d.origin));return l.dot(d,d)};a.equals=function(d,t){return b.equals(d.origin,t.origin)&&b.equals(d.direction,t.direction)}; a.fromPoints=function(d,t,w=h()){l.copy(w.origin,d);l.subtract(w.direction,t,d);return w};a.fromValues=c;a.wrap=function(d,t){const w=e.get();w.origin=d;w.direction=t;return w};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/coordinateSystem":function(){define("exports ../../core/libs/gl-matrix-2/math/mat4 ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../ellipsoidUtils ../SpatialReference ../spatialReferenceEllipsoidUtils ./Axis ../../chunks/boundedPlane ../../chunks/sphere".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(r){return{operations:r,value:r.create()}}function d(r,n,u=g(r)){u.operations=r;r.copy(n,u.value);return u}function t(r,n,u,x){return r.operations.setAltitudeAt(r.value,n,u,x)}const w=2**50,v=l.create(),m=l.create();a.altitudeAt=function(r,n){return r.operations.altitudeAt(r.value,n)};a.axisAt=function(r,n,u,x){return r.operations.axisAt(r.value,n,u,x)};a.closestPoint=function(r,n,u){return r.operations.closestPoint(r.value,n,u)};a.closestPointOnSilhouette= function(r,n,u){return r.operations.closestPointOnSilhouette(r.value,n,u)};a.coordinateSystemFromOneAxisAndNormalVector=function(r,n,u,x,y){q.copy(u,r);q.copy(m,n);q.normalize(m,m);q.cross(x,m,u);q.cross(y,x,u)};a.create=function(r){const {value:n,operations:u}=r;return{operations:u,value:u.create(n)}};a.createFromOperations=g;a.createGlobal=function(r){return d(e.sphere,e.fromValues(0,0,0,p.getReferenceEllipsoid(r).radius))};a.createLocal=function(){return d(c.boundedPlane,c.fromValues([0,0,0],[w, 0,0],[0,w,0]))};a.distanceToSilhouette=function(r,n){return r.operations.distanceToSilhouette(r.value,n)};a.elevate=function(r,n,u){return r.operations.elevate(r.value,n,u.value)};a.fromValues=d;a.intersectRay=function(r,n,u){return r.operations.intersectRay(r.value,n,u)};a.intersectRayClosestSilhouette=function(r,n,u){return r.operations.intersectRayClosestSilhouette(r.value,n,u)};a.normalAt=function(r,n,u){return r.operations.axisAt(r.value,n,f.Axis.Z,u)};a.renderSRFromViewSR=function(r,n){return r? h.getSphericalPCPF(n):n.isGeographic?k.PlateCarree:n};a.setAltitudeAt=t;a.setAltitudeOfTransformation=function(r,n,u,x){n!==x&&b.copy(x,n);q.set(v,x[12],x[13],x[14]);t(r,v,u,v);x[12]=v[0];x[13]=v[1];x[14]=v[2];return x};a.setExtent=function(r,n,u){r.operations.setExtent(r.value,n,u.value);return u};a.vectorCoordinates=function(r,n,u,x,y){y[0]=q.dot(r,n);y[1]=q.dot(r,u);y[2]=q.dot(r,x);return y};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/spatialReferenceEllipsoidUtils":function(){define(["exports", "./ellipsoidUtils","./SpatialReference","./support/spatialReferenceUtils"],function(a,b,q,l){const p=new q(b.SphericalECEFSpatialReferenceLike),k=new q(b.SphericalPCPFMarsLike),h=new q(b.SphericalPCPFMoonLike);b=new q(b.WGS84ECEFSpatialReferenceLike);const f=new Map,c=k.wkt.toUpperCase(),e=h.wkt.toUpperCase();a.SphericalECEFSpatialReference=p;a.SphericalPCPFMars=k;a.SphericalPCPFMoon=h;a.WGS84ECEFSpatialReference=b;a.getSphericalPCPF=function(g){var d=f.get(g);if(d)return d;d=p;if(g)if(g===k)d=k; else if(g===h)d=h;else{var t=g.wkid;const w=g.latestWkid;if(null!=t||null!=w)if(l.isWKIDFromMars(t)||l.isWKIDFromMars(w))d=k;else{if(l.isWKIDFromMoon(t)||l.isWKIDFromMoon(w))d=h}else if(t=g.wkt2??g.wkt)t=t.toUpperCase(),t===c?d=k:t===e&&(d=h)}f.set(g,d);return d};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/sphere":function(){define("exports ../core/has ../core/Logger ../core/mathUtils ../core/libs/gl-matrix-2/math/mat4 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ./vec42 ../core/libs/gl-matrix-2/factories/vec4f64 ../core/libs/gl-matrix-2/math/common ../geometry/support/Axis ../geometry/support/ray ../geometry/support/vector ../geometry/support/vectorStacks".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(){return c.create()}function m(U,Z){return f.copy(Z,U)}function r(U,Z){return c.fromValues(U[0],U[1],U[2],Z)}function n(U){return U}function u(U){U[0]=U[1]=U[2]=U[3]=0}function x(U,Z){U[0]=U[1]=U[2]=0;U[3]=Z;return U}function y(U){return U[3]}function z(U){return U}function A(U,Z,ca,ea){return c.fromValues(U,Z,ca,ea)}function B(U,Z,ca){U!==ca&&(ca[0]=U[0],ca[1]=U[1],ca[2]=U[2]);ca[3]=U[3]+Z;return ca}function C(U,Z,ca){U!==ca&&m(U,ca);return ca}function D(U, Z,ca){if(null==Z||!H(U,Z,S))return!1;let {t0:ea,t1:da}=S;if(0>ea||daea)return!1;if(ca){const {origin:ia,direction:ka}=Z;ca[0]=ia[0]+ka[0]*ea;ca[1]=ia[1]+ka[1]*ea;ca[2]=ia[2]+ka[2]*ea}return!0}function F(U,Z,ca){Z=d.fromPoints(Z,ca);if(!H(U,Z,S))return[];const {origin:ea,direction:da}=Z,{t0:ia,t1:ka}=S;Z=fa=>{const X=h.create();k.scaleAndAdd(X,ea,da,fa);return O(U,X,X)};return Math.abs(ia-ka)U)return!1;U=Math.sqrt(U);ca.t0=(-ka-U)/(2*Z);ca.t1=(-ka+U)/(2*Z);return!0}function N(U,Z){return D(U,Z,null)}function E(U,Z,ca){if(D(U,Z,ca))return ca;U=G(U,Z,w.sv3d.get());k.add(ca,Z.origin,k.scale(w.sv3d.get(),Z.direction,k.distance(Z.origin,U)/k.length(Z.direction)));return ca} function G(U,Z,ca){const ea=w.sv3d.get(),da=w.sm4d.get();k.cross(ea,Z.origin,Z.direction);const ia=U[3];k.cross(ca,ea,Z.origin);k.scale(ca,ca,1/k.length(ca)*ia);U=P(U,Z.origin);Z=t.angle(Z.origin,ca);p.fromRotation(da,Z+U,ea);k.transformMat4(ca,ca,da);return ca}function I(U,Z,ca){if(D(U,Z,ca))return ca;d.closestPoint(Z,U,ca);return O(U,ca,ca)}function O(U,Z,ca){Z=k.subtract(w.sv3d.get(),Z,U);Z=k.scale(w.sv3d.get(),Z,U[3]/k.length(Z));return k.add(ca,Z,U)}function L(U,Z){Z=k.subtract(w.sv3d.get(), Z,U);Z=k.squaredLength(Z);return Math.sqrt(Math.abs(Z-U[3]*U[3]))}function P(U,Z){Z=k.subtract(w.sv3d.get(),Z,U);Z=k.length(Z);U=U[3];return l.acosClamped(U/(U+Math.abs(U-Z)))}function M(U,Z,ca,ea){U=k.subtract(T,Z,U);switch(ca){case g.Axis.X:return ca=l.cartesianToSpherical(U,T)[2],k.set(ea,-Math.sin(ca),Math.cos(ca),0);case g.Axis.Y:return U=l.cartesianToSpherical(U,T),ca=U[1],U=U[2],Z=Math.sin(ca),k.set(ea,-Z*Math.cos(U),-Z*Math.sin(U),Math.cos(ca));case g.Axis.Z:return k.normalize(ea,U)}}function K(U, Z){Z=k.subtract(Y,Z,U);return k.length(Z)-U[3]}function J(U,Z,ca,ea){const da=K(U,Z);U=M(U,Z,g.Axis.Z,Y);ca=k.scale(Y,U,ca-da);return k.add(ea,Z,ca)}function R(U,Z){Z=k.squaredDistance(U,Z);U=U[3];return Z<=U*U}function Q(U,Z,ca=c.create()){const ea=k.distance(U,Z),da=U[3],ia=Z[3];if(ea+iah;return k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/BreakpointsOwner":function(){define("exports ../chunks/tslib.es6 ../core/ArrayPool ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f,c){function e(t,w){return w?g[t].valueToClassName[w].split(" "):[]}const g={widthBreakpoint:{getValue(t){const w=t.viewSize[0];t=t.breakpoints;const v=this.values;return w<=t.xsmall?v.xsmall:w<=t.small?v.small:w<=t.medium?v.medium:w<=t.large?v.large:v.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge", small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge", xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(t){const w=t.viewSize[1];t=t.breakpoints;const v=this.values;return w<=t.xsmall?v.xsmall:w<=t.small?v.small:w<=t.medium?v.medium:w<=t.large?v.large:v.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge", small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge", xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(t){t=t.viewSize;const w=this.values;return t[1]>=t[0]?w.portrait:w.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},d={xsmall:544,small:768,medium:992,large:1200};a.BreakpointsOwner= t=>{t=class extends t{constructor(...w){super(...w);this.heightBreakpoint=this.widthBreakpoint=this.orientation=null;this.breakpoints=d}initialize(){this.addHandles(l.watch(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),l.initial))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(w){var v=this._get("breakpoints");w!==v&&(v=w,v&&v.xsmallv.push(x)),e(r,u).forEach(x=>w.push(x)))}m&&(this._applyClassNameChanges(w,v),q.release(w),q.release(v))}}_applyClassNameChanges(w,v){const m=this.container;m&&(v.forEach(r=>m.classList.remove(r)),w.forEach(r=>m.classList.add(r)))}_removeActiveClassNames(){const w= this.container;if(w)for(var v in g)e(v,this[v]).forEach(m=>w.classList.remove(m))}};b.__decorate([p.property()],t.prototype,"breakpoints",null);b.__decorate([p.property()],t.prototype,"orientation",void 0);b.__decorate([p.property()],t.prototype,"widthBreakpoint",void 0);b.__decorate([p.property()],t.prototype,"heightBreakpoint",void 0);return t=b.__decorate([c.subclass("esri.views.BreakpointsOwner")],t)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/DOMContainer":function(){define("exports ../chunks/tslib.es6 ../core/domUtils ../core/events ../core/Logger ../core/maybe ../core/reactiveUtils ../core/scheduling ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./overlay/ViewOverlay".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(m){m&&(q.empty(m),m.parentNode&&m.parentNode.removeChild(m))}const v=[0,0];a.DOMContainer=m=>{m=class extends m{constructor(...r){super(...r);this._freqInfo={freq:16,time:750};this._overlayRenderTaskHandle=null;this.height=0;this.position=this.overlay=this.messagesCommon=null;this.resizing=!1;this.surface=this.root=null;this.suspended=!0;this.userContent=this.ui=null;this.width=0;this.widthBreakpoint=null;this.addHandles([h.watch(()=>this.cursor,n=>{const {surface:u}= this;u&&u.setAttribute("data-cursor",n)}),h.watch(()=>this.navigating,n=>{const {surface:u}=this;u&&u.setAttribute("data-navigating",n.toString())})])}initialize(){this.addHandles([h.watch(()=>this.ui,(r,n)=>this._handleUIChange(r,n),h.initial),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=k.destroyMaybe(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(r){var n= this._get("container");const u=q.byId(r);u||"string"!==typeof r||p.getLogger(this).error("#container",`element with id '${r}' not found`);if(n!==u)if(this._stopMeasuring(),n&&(n.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(w(this.root),this._set("root",null)),this.userContent&&(q.reparent(this.userContent,n),w(this.userContent),this._set("userContent", null))),u){u.classList.add("esri-view");r=document.createElement("div");r.className="esri-view-user-storage";q.reparent(u,r);u.appendChild(r);this._set("userContent",r);r=document.createElement("div");r.className="esri-view-root";u.insertBefore(r,u.firstChild);this._set("root",r);n=document.createElement("div");n.className="esri-view-surface";n.setAttribute("role","application");n.tabIndex=0;r.appendChild(n);this._set("surface",n);var x=new t;r.appendChild(x.surface);this._set("overlay",x);this.addHandles(h.watch(()=> x.needsRender,y=>{this._overlayRenderTaskHandle=y&&!this._overlayRenderTaskHandle?f.addFrameTask({render:()=>this.overlay?.render()}):k.removeMaybe(this._overlayRenderTaskHandle)}));this.forceDOMReadyCycle();this._set("container",u);this._startMeasuring()}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)}get focused(){const r=document.activeElement===this.surface;return document.hasFocus()&&r}get size(){return[this.width, this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(r,n,u){const x=this.position;r-=x?x[0]:0;n-=x?x[1]:0;u?(u[0]=r,u[1]=n):u=[r,n];return u}containerToPage(r,n,u){const x=this.position;r+=x?x[0]:0;n+=x?x[1]:0;u?(u[0]=r,u[1]=n):u=[r,n];return u}_handleUIChange(r,n){this.removeHandles("ui");n&&n!==r&&n.destroy();r&&(r.view=this,this.addHandles(h.watch(()=>this.root,u=>{if(u){const x=document.createElement("div");u.appendChild(x);u=x}else u=null;r.container=u},h.initial), "ui"));this._set("ui",r)}_stopMeasuring(){this.removeHandles("measuring");this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const r=this._freqInfo;r.freq=16;r.time=750;this.addHandles([l.on(window,"resize",()=>{r.freq=16;r.time=750}),f.addFrameTask({prepare:n=>{const u=this._measure(),x=this._freqInfo;x.time+=n.deltaTime;u&&(x.freq=16,this._get("resizing")||this._set("resizing",!0));x.timethis.items,t=>{for(const w of t.added){const v=()=>w.render();this._callbacks.set(w,v);this._projector.append(this.surface,v)}for(const w of t.removed)t=this._projector.detach(this._callbacks.get(w)),this.surface.removeChild(t.domNode),this._callbacks.delete(w)})}addItem(d){this.items.add(d)}removeItem(d){this.items.remove(d)}destroy(){this.items.removeAll(); this._callbacks.forEach(d=>this._projector.detach(d));this._projector=this._callbacks=null;this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(d){const t=this._hiddenSurface,w=this._hiddenProjector;let v;const m=()=>v=d.render();w.append(t,m);w.renderNow();const r={left:0,top:0,right:0,bottom:0};if(v?.domNode){const n=v.domNode.getBoundingClientRect();r.left=n.left;r.top=n.top;r.right=n.right;r.bottom=n.bottom}for(w.detach(m);t.firstChild;)t.removeChild(t.firstChild); return r}overlaps(d,t){d=this.computeBoundingRect(d);t=this.computeBoundingRect(t);return Math.max(d.left,t.left)<=Math.min(d.right,t.right)&&Math.max(d.top,t.top)<=Math.min(d.bottom,t.bottom)}get hasVisibleItems(){return this.items.some(d=>d.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(d,t){const w=!!t?.disableDecorations;if(this.items.some(m=>m.visible&&!(w&&m.isDecoration))){var v=d.getContext("2d");v.save();v.font=this._fontString();this.items.forEach(m=> {w&&m.isDecoration||(v.save(),m.renderCanvas(v),v.restore())});v.restore()}}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};a.__decorate([l.property({readOnly:!0})],b.prototype,"surface",void 0);a.__decorate([l.property({readOnly:!0})],b.prototype,"items",void 0);a.__decorate([l.property({readOnly:!0})],b.prototype,"needsRender",null);a.__decorate([l.property({readOnly:!0})],b.prototype,"_watchUpdatingTracking",void 0);a.__decorate([l.property({readOnly:!0})],b.prototype, "updating",null);return b=a.__decorate([f.subclass("esri.views.overlay.ViewOverlay")],b)})},"esri/views/GroundView":function(){define("../chunks/tslib.es6 ../core/Accessor ../core/Collection ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./3d/support/cameraUtils ./support/GroundViewElevationSampler".split(" "),function(a,b,q,l,p,k,h,f,c,e,g){b=class extends b{constructor(d){super(d);this.view= null;this.layerViews=new q}initialize(){this.addHandles(l.when(()=>this.view?.map?.ground,d=>d.load()));this.addHandles(this.layerViews.on("after-changes",()=>this._layerViewsAfterChangesHandler()))}destroy(){this._set("view",null);for(const d of this.layerViews)d.destroy();this.layerViews.length=0}get elevationSampler(){return this.view&&"2d"!==this.view.type&&this.view.ready&&this.view.basemapTerrain&&this.view.basemapTerrain.ready?new g({view:this.view}):null}get extent(){const d=this.view;return d&& "2d"!==d.type&&d.ready?e.toExtent(d,d.state.camera,d.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return this.suspended?!1:this.layerViews.some(d=>d.updating)}get suspended(){return!this.view||this.view.suspended}_layerViewsAfterChangesHandler(){this.removeHandles("updating");this.addHandles(this.layerViews.map(d=>l.watch(()=>d.updating,()=>this._updateUpdating(),l.sync)).toArray(),"updating");this._updateUpdating()}_updateUpdating(){this.notifyChange("updating")}}; a.__decorate([p.property({readOnly:!0})],b.prototype,"elevationSampler",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"extent",null);a.__decorate([p.property({type:Boolean,readOnly:!0})],b.prototype,"updating",null);a.__decorate([p.property({constructOnly:!0})],b.prototype,"view",void 0);a.__decorate([p.property({type:q,readOnly:!0})],b.prototype,"layerViews",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"suspended",null);return b=a.__decorate([c.subclass("esri.views.GroundView")], b)})},"esri/views/3d/support/cameraUtils":function(){define("exports ../../../Camera ../../../core/Cyclical ../../../core/Logger ../../../core/mathUtils ../../../core/promiseUtils ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/Point ../../../geometry/projection ../../../geometry/SpatialReference ../../../geometry/projection/projectPointToVector ../../../geometry/projection/projectVectorToPoint ../../../geometry/projection/projectVectorToVector ../../../geometry/support/planetGCSUtils ../../ViewingMode ../camera/intersectionUtils ../../../chunks/cameraUtilsPlanar ../../../chunks/cameraUtilsSpherical ./earthUtils ./ElevationProvider ../../support/spatialReferenceSupport".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(da){return da.spatialReference??d.WGS84}function C(da){return"global"===da.viewingMode?x.cameraUtilsSpherical:u.cameraUtilsPlanar}function D(da,ia,ka){const fa=da.state.camera,X=fa.width/2/fa.pixelRatio;da.renderCoordsHelper.viewingMode===r.ViewingMode.Global&&null!=ka&&(ia*=Math.cos(p.deg2rad(ka)));ia/=da.renderCoordsHelper.unitInMeters;return X/(96*39.37/ia)/Math.tan(fa.fovX/2)}function F(da,ia,ka){const fa=da.state.camera;ia=96* 39.37/(fa.width/2/fa.pixelRatio/(ia*Math.tan(fa.fovX/2)));da.renderCoordsHelper.viewingMode===r.ViewingMode.Global&&null!=ka&&(ia/=Math.cos(p.deg2rad(ka)));return ia*da.renderCoordsHelper.unitInMeters}async function H(da,ia,ka,fa,X,ja){ia=await P(da,fa.heading,fa.tilt,ia,ka,X,ja);k.throwIfAborted(ja);return T(da,ia,fa.fov,ja)}function N(da,ia,ka,fa,X){return C(da).directionToHeadingTilt(ia,ka,fa,X)}function E(da,ia){return!!(da.basemapTerrain&&da.renderCoordsHelper.fromRenderCoords(ia,U,da.spatialReference)&& da.elevationProvider&&(z.getElevationAtPoint(da.elevationProvider,U)??0)>U[2]-1)}async function G(da,ia,ka){if(E(da,ia))return!0;const {elevationProvider:fa,spatialReference:X,renderCoordsHelper:ja}=da;if(null==fa||!ja.fromRenderCoords(ia,U,X))return!1;const [la,na,va]=U;da=await fa.queryElevation(la,na,va,X,"ground",ka)??0;k.throwIfAborted(ka);return da>va-1}async function I(da,ia,ka){const fa=f.create();if(null==ia)return h.copy(fa,da.state.camera.center);if(ia instanceof e){const {renderSpatialReference:X, basemapTerrain:ja,elevationProvider:la}=da,na=ia.spatialReference;await t.projectPointToVectorAsync(ia,fa,X,0,{signal:ka});k.throwIfAborted(ka);null==ia.z&&null!=ja&&null!=la&&(ia=await la.queryElevation(ia.x,ia.y,ia.z??0,na,"ground",ka),k.throwIfAborted(ka),null!=ia&&da.renderCoordsHelper.setAltitude(fa,ia));return fa}return h.copy(fa,ia)}function O(da,ia){const ka=f.create();if(null==ia)return h.copy(ka,da.state.camera.center);if(ia instanceof e){if(!t.projectPointToVector(ia,ka,da.renderSpatialReference))return null; const {basemapTerrain:fa,elevationProvider:X}=da;null==ia.z&&null!=fa&&null!=X&&(ia=z.getElevationAtPoint(X,ia),null!=ia&&da.renderCoordsHelper.setAltitude(ka,ia));return ka}return h.copy(ka,ia)}function L(da,ia,ka,fa,X,ja){const la=fa instanceof e?fa:null;fa=O(da,fa);return M(da,ia,ka,la,fa,X,ja)}async function P(da,ia,ka,fa,X,ja,la){const na=fa instanceof e?fa:null;fa=await I(da,fa,la);k.throwIfAborted(la);return K(da,ia,ka,na,fa,X,ja,la)}function M(da,ia,ka,fa,X,ja,la){if(null==X||!fa&&(fa=new e({spatialReference:B(da)}), !w.projectVectorToPoint(X,da.renderSpatialReference,fa)))return null;const na=J(da,ia,ka,X,ja,la);if(R(da,ka,la)&&E(da,na.eye)){const {tilt:va,mode:za}=Q(da,ka,X,ja);return M(da,ia,va,fa,X,ja,za)}return{...na,center:f.clone(X)}}async function K(da,ia,ka,fa,X,ja,la,na){fa||(fa=new e({spatialReference:B(da)}),await w.projectVectorToPointAsync(X,da.renderSpatialReference,fa,{signal:na})||(fa=null));k.throwIfAborted(na);const va=J(da,ia,ka,X,ja,la);if(R(da,ka,la)&&await G(da,va.eye,na)){k.throwIfAborted(na); const {tilt:za,mode:ya}=Q(da,ka,X,ja);return K(da,ia,za,fa,X,ja,ya,na)}return{...va,center:f.clone(X)}}function J(da,ia,ka,fa,X,ja){X=Math.max(X,da.state.constraints.minimumPoiDistance);var la=ka;ka=X;let na=0;if(ja=ja===a.OrientationMode.ADJUST)ja=da.pointsOfInterest.centerOnSurfaceFrequent.distance,ja=8ia-da?a.OrientationMode.LOCKED:a.OrientationMode.ADJUST}}function W(da,ia){const {state:ka,spatialReference:fa}=da;da=ia.spatialReference;return ka.isGlobal&&A.isSpatialReferenceSupported(da,r.ViewingMode.Global)||ka.isLocal&&fa.equals(da)}function S(da,ia){let ka;if(da.state.isGlobal){const ja= new e(ia.xmin,ia.ymin,ia.spatialReference),la=new e(ia.xmax,ia.ymax,ia.spatialReference),na=ia.spatialReference.isGeographic?ca:Z;var fa=new e({x:na.center(ja.x,la.x),y:(la.y+ja.y)/2,z:null!=ia.zmax&&null!=ia.zmin?(ia.zmax+ia.zmin)/2:void 0,spatialReference:ia.spatialReference});const va=c.getReferenceEllipsoid(ia.spatialReference);var X=y.getGreatCircleSpanAt(fa,ja,la);ka=X.lon;X=X.lat;na.diff(ja.x,la.x)>na.range/2&&(ka+=va.halfCircumference);ka=Math.min(ka,va.halfCircumference);X=Math.min(X,va.halfCircumference)}else fa= da.renderSpatialReference??ia.spatialReference,fa.equals(ia.spatialReference)||(ia=g.project(ia,fa)),ka=ia.xmax-ia.xmin,X=ia.ymax-ia.ymin,fa=new e({x:ia.xmin+.5*ka,y:ia.ymin+.5*X,z:null!=ia.zmax&&null!=ia.zmin?(ia.zmax+ia.zmin)/2:void 0,spatialReference:fa});da=da.state.camera;return{center:fa,distance:Math.max(1/Math.tan(da.fovX/2)*ka*.5,1/Math.tan(da.fovY/2)*X*.5,1/Math.tan(da.fov/2)*(null!=ia.zmax&&null!=ia.zmin?ia.zmax-ia.zmin:0)*.5)/1}}function V(da,ia,ka,fa){if(null==ia)return null;const X= da.renderSpatialReference;da=new e({spatialReference:B(da)});if(!w.projectVectorToPoint(ia.eye,X,da))return null;fa??=new b;fa.position=da;fa.heading=ia.heading;fa.tilt=ia.tilt;fa.fov=ka;return fa}async function T(da,ia,ka,fa){const X=da.renderSpatialReference;da=new e({spatialReference:B(da)});await w.projectVectorToPointAsync(ia.eye,X,da,{signal:fa});k.throwIfAborted(fa);return new b(da,ia.heading,ia.tilt,ka)}const Y=()=>l.getLogger("esri.views.3d.support.cameraUtils"),ha=f.create(),ba={heading:0, tilt:0},U=f.create(),Z=new q.Cyclical(-2.0037508342788905E7,2.0037508342788905E7),ca=new q.Cyclical(-180,180);a.OrientationMode=void 0;(function(da){da[da.LOCKED=0]="LOCKED";da[da.ADJUST=1]="ADJUST"})(a.OrientationMode||(a.OrientationMode={}));const ea=f.create();a.computeScale=function(da,ia){const {renderSpatialReference:ka}=da,fa=m.getCGSForPlanet(ka);let X=null;try{v.projectVectorToVector(ia.center,ka,ha,fa)&&(X=ha[1])}catch{}return F(da,ia.distance,X)};a.directionToHeadingTilt=N;a.distanceToScale= F;a.externalToInternal=function(da,ia){if(null==ia)return null;var ka=da.renderSpatialReference;const fa=C(da).headingTiltToDirectionUp,X=f.create();if(!t.projectPointToVector(ia.position,X,ka))return null;ka=fa(X,ia.heading,ia.tilt);h.scale(ka.direction,ka.direction,da.state.camera.distance);h.add(ka.direction,ka.direction,X);da=n.cameraOnContentAlongViewDirection(da,X,ka.direction,ka.up);da.fov=p.deg2rad(ia.fov);da.row=ia.layout.row;da.rows=ia.layout.rows;da.column=ia.layout.column;da.columns=ia.layout.columns; return da};a.fromCenterDistanceAsync=H;a.fromCenterDistanceSync=function(da,ia,ka,fa,X,ja){ia=L(da,fa.heading,fa.tilt,ia,ka,X);return V(da,ia,fa.fov,ja)};a.fromCenterScale=async function(da,ia,ka,fa,X,ja){ka=D(da,ka,ia.latitude);return H(da,ia,ka,fa,X,ja)};a.fromExtentAsync=async function(da,ia,ka,fa,X,ja){ia=W(da,ia)?ia:await g.projectWithZConversion(ia,da.spatialReference,{signal:ja});k.throwIfAborted(ja);const {center:la,distance:na}=S(da,ia);ka=await P(da,ka,fa,la,na,X,ja);k.throwIfAborted(ja); return T(da,ka,da.camera.fov,ja)};a.fromExtentSync=function(da,ia,ka,fa,X,ja){let la;try{la=W(da,ia)?ia:g.project(ia,da.spatialReference)}catch(za){return null}const {center:na,distance:va}=S(da,la);ia=L(da,ka,fa,na,va,X);return null==ia?null:V(da,ia,da.camera.fov,ja)};a.getObserverForPointAtDistanceAsync=P;a.getObserverForPointAtDistanceSync=L;a.getViewSR=B;a.headingTiltToDirectionUp=function(da,ia,ka,fa,X){return C(da).headingTiltToDirectionUp(ia,ka,fa,X)};a.internalToExternal=function(da,ia,ka){const fa= da.renderSpatialReference,X=N(da,ia.eye,ia.viewForward,ia.up,ba);da=B(da);v.projectVectorToVector(ia.eye,fa,ea,da)||(da=d.WGS84,v.projectVectorToVector(ia.eye,fa,ea,da));null==ka?ka=new b(new e(ea,da),X.heading,X.tilt,p.rad2deg(ia.fov)):(ka.position.x=ea[0],ka.position.y=ea[1],ka.position.z=ea[2],ka.position.spatialReference=da,ka.heading=X.heading,ka.tilt=X.tilt,ka.fov=p.rad2deg(ia.fov));ka.layout.row=ia.row;ka.layout.rows=ia.rows;ka.layout.column=ia.column;ka.layout.columns=ia.columns;return ka}; a.scaleToDistance=D;a.scaleToZoom=function(da,ia){if(da=da.basemapTerrain?.tilingScheme)return da.levelAtScale(ia);Y().error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")};a.toExtent=function(da,ia,ka){var fa=da.renderSpatialReference;const X=new e({spatialReference:B(da)});if(!w.projectVectorToPoint(ka,fa,X))return null;const ja=Math.tan(ia.fovX/2);fa=Math.tan(ia.fovY/2);ia=h.dist(ia.eye,ka);ka=2*ia*ja;fa*=2*ia;return"global"===da.viewingMode?x.toExtent(da,X,ka,fa):u.toExtent(da, X,ka,fa)};a.zoomToScale=function(da,ia){if(da=da.basemapTerrain?.tilingScheme)return da.scaleAtLevel(ia);Y().error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectVectorToPoint":function(){define(["exports","../../core/libs/gl-matrix-2/factories/vec3f64","../projection","./projectVectorToVector"],function(a,b,q,l){function p(h,f,c){if(!l.projectVectorToVector(h,f,k,c.spatialReference))return!1; c.x=k[0];c.y=k[1];c.z=k[2];return!0}const k=b.create();a.projectVectorToPoint=p;a.projectVectorToPointAsync=async function(h,f,c,e){await q.initializeProjection(f,c.spatialReference,null,e);return p(h,f,c)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectVectorToVector":function(){define(["exports","../projection","../SpatialReference","./projectPointToVector","../../layers/graphics/dehydratedPoint"],function(a,b,q,l,p){function k(f,c,e,g,d){if(null== c||null==g||2>f.length)return!1;h.x=f[0];h.y=f[1];h.z=f[2];h.spatialReference=c;return l.projectPointToVector(h,e,g,d)}const h=p.makeDehydratedPoint(0,0,0,q.WGS84);a.projectVectorToVector=k;a.projectVectorToVectorAsync=async function(f,c,e,g,d,t){await b.initializeProjection(c,g,null,t);return k(f,c,e,g,d)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/dehydratedPoint":function(){define(["exports"],function(a){a.makeDehydratedPoint=function(b,q,l,p){return{x:b, y:q,z:l,hasZ:null!=l,hasM:!1,spatialReference:p,type:"point"}};a.setDehydratedPoint=function(b,q,l,p,k){b.x=q;b.y=l;b.z=p;b.hasZ=null!=p;b.spatialReference=k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/planetGCSUtils":function(){define(["exports","../SpatialReference","../spatialReferenceEllipsoidUtils","./spatialReferenceUtils","./SupportedGCSWkids"],function(a,b,q,l,p){a.getCGSForPlanet=function(k){return l.equals(k,q.SphericalPCPFMars)||l.isMars(k)?{wkid:p.SupportedGCSWkids.GCSMARS2000}: l.equals(k,q.SphericalPCPFMoon)||l.isMoon(k)?{wkid:p.SupportedGCSWkids.GCSMOON2000}:b.WGS84};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/intersectionUtils":function(){define("exports ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/support/aaBoundingRect ../webgl-engine/lib/Intersector".split(" "),function(a,b,q,l,p,k){function h(w,v){return w.elevationProvider?w.elevationProvider.getElevation(v[0], v[1],v[2],w.renderCoordsHelper.spatialReference,"ground")??0:0}function f(w,v,m){if(!w.state.isGlobal||!w.stateManager.constraintsManager)return!1;const r=h(w,v);({far:w}=w.stateManager.constraintsManager.nearFarHeuristic.compute(v,m,w.renderDataExtent,r,t));w*=w;return b.squaredDistance(v,m)>w}const c={},e=q.create(),g=q.create(),d=q.create(),t={near:0,far:0};a.cameraOnContentAlongViewDirection=function(w,v,m,r){const n=w.state.camera.clone();v&&m&&r&&(n.eye=v,n.center=m,n.up=r);v=n.ray;m=c[w.viewingMode]; m||(m=k.newIntersector(w.state.viewingMode),m.options.backfacesTerrain=!w.state.isGlobal,m.options.invisibleTerrain=!0,c[w.viewingMode]=m);({isGlobal:r}=w.state);w.sceneIntersectionHelper.intersectRay(v,m,g)&&!f(w,v.origin,g)?v=!0:!w.renderCoordsHelper.intersectManifold(v,0,g)||f(w,v.origin,g)?r?(m=l.getReferenceEllipsoid(w.spatialReference).radius,m=b.dot(v.origin,v.origin)-m*m,b.scale(g,v.direction,(0{B(D)&&this.intersectObject(D)}:D=>{this.intersectObject(D)};for(const D of x)x=D.getSpatialQueryAccelerator?.(),null!=x?(null!=y?x.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,C,y):x.forEachAlongRay(this._ray.origin,this._ray.direction,C),this.options.selectionMode&&this.options.hud&&x.forEachDegenerateObject(C)):D.objects.forAll(F=>C(F))}this.sortResults()}intersectObject(x){const y=x.geometries;if(y){var z=x.effectiveTransformation,A=t.getVerticalOffsetObject3D(this.verticalOffset); for(const B of y){if(!B.visible)continue;const {material:C,id:D}=B;this.transform.setAndInvalidateLazyTransforms(z,B.transformation);l.transformMat4(this._rayBeginTransformed,this.rayBegin,this.transform.inverse);l.transformMat4(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const F=this.transform.transform;null!=A&&(A.objectTransform=this.transform);C.intersect(B,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(H,N,E,G,I,O)=>{if(0<=H&&(null==this.filterPredicate|| this.filterPredicate(this._ray.origin,this._rayEnd,H))){var L=G?this._results.hud:this._results,P=G?M=>{const K=new g.HudTarget(x,D,E,O);M.set(e.IntersectorType.HUD,K,H,N,q.IDENTITY,I)}:M=>M.set(e.IntersectorType.OBJECT,{object:x,geometryId:D,triangleNr:E},H,N,F,I);(null==L.min.drapedLayerOrder||I>=L.min.drapedLayerOrder)&&(null==L.min.dist||HL.max.dist)&& P(L.max);this.options.store===e.StoreResults.ALL&&(G?(G=new r(this._ray),P(G),this._results.hud.all.push(G)):(G=new m(this._ray),P(G),this._results.all.push(G)))}})}}}sortResults(x=this._results.all){x.sort((y,z)=>y.dist!==z.dist?(y.dist??0)-(z.dist??0):y.drapedLayerOrder!==z.drapedLayerOrder?(z.drapedLayerOrder??-Number.MAX_VALUE)-(y.drapedLayerOrder??-Number.MAX_VALUE):(z.drapedLayerGraphicOrder??-Number.MAX_VALUE)-(y.drapedLayerGraphicOrder??-Number.MAX_VALUE))}}class v{constructor(){this.min= new m(f.create());this.max=new m(f.create());this.hud={min:new r(f.create()),max:new r(f.create()),all:[]};this.ground=new m(f.create());this.all=[]}init(x){this.min.init(x);this.max.init(x);this.ground.init(x);this.all.length=0;this.hud.min.init(x);this.hud.max.init(x);this.hud.all.length=0}}class m{get ray(){return this._ray}get distanceInRenderSpace(){return null!=this.dist?(l.scale(n,this.ray.direction,this.dist),l.length(n)):null}getIntersectionPoint(x){if(!d.isValidIntersectorResult(this))return!1; l.scale(n,this.ray.direction,this.dist);l.add(x,this.ray.origin,n);return!0}getTransformedNormal(x){l.copy(u,this.normal);u[3]=0;k.transformMat4(u,u,this.transformation);l.copy(x,u);return l.normalize(x,x)}constructor(x){this.intersector=e.IntersectorType.OBJECT;this.normal=p.create();this.transformation=q.create();this._ray=f.create();this.init(x)}init(x){this.drapedLayerGraphicOrder=this.drapedLayerOrder=this.target=this.dist=null;this.intersector=e.IntersectorType.OBJECT;f.copy(x,this._ray)}set(x, y,z,A,B,C,D){this.intersector=x;this.dist=z;l.copy(this.normal,A??p.UNIT_Z);b.copy(this.transformation,B??q.IDENTITY);this.target=y;this.drapedLayerOrder=C;this.drapedLayerGraphicOrder=D}copy(x){f.copy(x.ray,this._ray);this.intersector=x.intersector;this.dist=x.dist;this.target=x.target;this.drapedLayerOrder=x.drapedLayerOrder;this.drapedLayerGraphicOrder=x.drapedLayerGraphicOrder;l.copy(this.normal,x.normal);b.copy(this.transformation,x.transformation)}}class r extends m{constructor(){super(...arguments); this.intersector=e.IntersectorType.HUD}}const n=p.create(),u=h.create();a.defaultTolerance=1E-5;a.newIntersector=function(x){return new w(x)};a.newIntersectorResult=function(x){return new m(x)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/IntersectorInterfaces":function(){define(["exports"],function(a){a.IntersectorType=void 0;(function(q){q[q.OBJECT=0]="OBJECT";q[q.HUD=1]="HUD";q[q.TERRAIN=2]="TERRAIN";q[q.OVERLAY=3]="OVERLAY";q[q.I3S=4]="I3S";q[q.PCL= 5]="PCL";q[q.LOD=6]="LOD";q[q.VOXEL=7]="VOXEL";q[q.TILES3D=8]="TILES3D"})(a.IntersectorType||(a.IntersectorType={}));class b{constructor(){this.verticalOffset=0;this.selectionMode=!1;this.selectOpaqueTerrainOnly=this.hud=!0;this.invisibleTerrain=!1;this.backfacesTerrain=!0;this.isFiltered=!1;this.filteredLayerUids=[];this.store=a.StoreResults.ALL;this.normalRequired=!0}}a.StoreResults=void 0;(function(q){q[q.MIN=0]="MIN";q[q.MINMAX=1]="MINMAX";q[q.ALL=2]="ALL"})(a.StoreResults||(a.StoreResults={})); a.IntersectorOptions=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/IntersectorTarget":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b){class q{constructor(f,c,e){this.object=f;this.geometryId=c;this.triangleNr=e}}class l extends q{constructor(f,c,e,g){super(f,c,e);this.center=null!=g?b.clone(g):null}}class p extends l{}class k{constructor(f){this.layerUid=f}}class h extends k{constructor(f,c){super(f); this.graphicUid=c}}a.Graphic3DTarget=h;a.HudTarget=l;a.LayerTarget=k;a.ObjectTarget=q;a.ValidHudTarget=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/intersectorUtils":function(){define(["exports","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../chunks/boundedPlane","./IntersectorInterfaces"],function(a,b,q,l,p){function k(f){return null!=f?.dist}const h=q.create();a.isHudIntersectorResult=function(f){return k(f)&& f.intersector===p.IntersectorType.HUD&&!!f.target&&"center"in f.target&&null!=f.target.center};a.isObjectIntersectorResult=function(f){return k(f)&&f.intersector===p.IntersectorType.OBJECT&&!!f.target};a.isValidIntersectorResult=k;a.sliceFilterPredicate=function(f){return(c,e,g)=>{b.lerp(h,c,e,g);return!l.extrusionContainsPoint(f,h)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/verticalOffsetUtils":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/sphere ../../../ViewingMode ../../support/orientedBoundingBox".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g{constructor(){this._transform=p.create();this._transformInverse=new d({value:this._transform},l.invert,p.create);this._transformInverseTranspose=new d(this._transformInverse,l.transpose,p.create);this._transformTranspose=new d({value:this._transform},l.transpose,p.create);this._transformInverseRotation=new d({value:this._transform},b.normalFromMat4Legacy,q.create)}_invalidateLazyTransforms(){this._transformInverse.invalidate();this._transformInverseTranspose.invalidate(); this._transformTranspose.invalidate();this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(B){l.copy(this._transform,B)}multiplyTransform(B){l.multiply(this._transform,this._transform,B)}set(B){l.copy(this._transform, B);this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(B,C){this.setTransformMatrix(B);this.multiplyTransform(C);this._invalidateLazyTransforms()}}class d{constructor(B,C,D){this._original=B;this._update=C;this._dirty=!0;this._transform=D()}invalidate(){this._dirty=!0}get value(){this._dirty&&(this._update(this._transform,this._original.value),this._dirty=!1);return this._transform}}class t{constructor(B=0){this.offset=B;this.tmpVertex=h.create()}applyToVertex(B,C,D){B=k.set(u,B,C,D); C=k.add(x,B,this.localOrigin);D=this.offset/k.length(C);k.scaleAndAdd(this.tmpVertex,B,C,D);return this.tmpVertex}applyToAabb(B){var C=y;const D=z,F=A;for(var H=0;3>H;++H)C[H]=B[0+H]+this.localOrigin[H],D[H]=B[3+H]+this.localOrigin[H],F[H]=C[H];H=this.applyToVertex(C[0],C[1],C[2]);for(var N=0;3>N;++N)B[N]=H[N],B[N+3]=H[N];H=G=>{G=this.applyToVertex(G[0],G[1],G[2]);for(let I=0;3>I;++I)B[I]=Math.min(B[I],G[I]),B[I+3]=Math.max(B[I+3],G[I])};for(N=1;8>N;++N){for(var E=0;3>E;++E)F[E]=0===(N&1<E;++E)0>C[E]*D[E]&&(N|=1<E;++E)if(0===(N&E)){for(let G=0;3>G;++G)F[G]=0!==(N&1<C;++C)B[C]-=this.localOrigin[C],B[C+3]-=this.localOrigin[C];return B}}class w{constructor(B=0){this._offset=this._totalOffset=this.componentLocalOriginLength=0;this._tmpVertex=h.create();this._tmpMbs=f.create();this._tmpObb=new e.Obb;this._resetOffset(B)}_resetOffset(B){this._totalOffset=this._offset=B}set offset(B){this._resetOffset(B)}get offset(){return this._offset}set componentOffset(B){this._totalOffset= this._offset+B}set localOrigin(B){this.componentLocalOriginLength=k.length(B)}applyToVertex(B,C,D){const F=k.set(u,B,C,D);B=k.set(x,B,C,D+this.componentLocalOriginLength);C=this._totalOffset/k.length(B);k.scaleAndAdd(this._tmpVertex,F,B,C);return this._tmpVertex}applyToAabb(B){var C=this.componentLocalOriginLength;const D=B[0],F=B[1],H=B[2]+C,N=B[3],E=B[4];C=B[5]+C;var G=Math.abs(D),I=Math.abs(F),O=Math.abs(H),L=Math.abs(N),P=Math.abs(E),M=Math.abs(C),K=.5*(1+Math.sign(D*N))*Math.min(G,L),J=.5*(1+ Math.sign(F*E))*Math.min(I,P);const R=.5*(1+Math.sign(H*C))*Math.min(O,M);var Q=Math.max(G,L),W=Math.max(I,P),S=Math.max(O,M);K=Math.sqrt(K*K+J*J+R*R);G=Math.sign(G+D);I=Math.sign(I+F);O=Math.sign(O+H);L=Math.sign(L+N);P=Math.sign(P+E);M=Math.sign(M+C);J=this._totalOffset;if(Kfa;++fa){for(var ka=0;3>ka;++ka)K[ka]=Z[ka]*(0!==(fa&1<ka;++ka){let X=ca[ka];for(let ja=0;3>ja;++ja)X+=K[ja]*ia[3*ja+ka];P[3*fa+ka]=X}}w.projectBuffer(P,U,0,P,ea,0,8);z(M,da)}function B(U,Z,ca,ea,da=d.getSphericalPCPF(ca),ia=v.getProjector(ca,da)){U.getCorners(V);U.getCenter(K); K[2]+=ea;t.computeTranslationToOriginAndRotation(ca,K,S,da);Z.setCenter(S[12],S[13],S[14]);ca=2*Math.sqrt(1+S[0]+S[5]+S[10]);F[0]=(S[6]-S[9])/ca;F[1]=(S[8]-S[2])/ca;F[2]=(S[1]-S[4])/ca;F[3]=.25*ca;U=U.getQuaternion(H);Z.quaternion=p.multiply(F,F,U);p.conjugate(F,F);h.set(Y,0,0,0);U=Z.getCenter(R);for(const ka of V)ka[2]+=ea,ia(ka,0,ka,0),h.sub(T,ka,U),h.transformQuat(T,T,F),h.abs(T,T),h.max(Y,Y,T);Z.halfSize=Y}function C(U,Z,ca,ea,da=d.getSphericalPCPF(ca)){const ia=g.getReferenceEllipsoid(ca),ka= 1+Math.max(0,ea)/(ia.radius+U.centerZ);U.getCenter(K);K[2]+=ea;w.projectBuffer(K,ca,0,K,da,0,1);Z.center=K;ca=U.getQuaternion(H);Z.quaternion=ca;p.conjugate(F,ca);h.set(T,0,0,1);h.transformQuat(T,T,F);U=U.getHalfSize(Q);h.set(T,U[0]*Math.abs(T[0]),U[1]*Math.abs(T[1]),U[2]*Math.abs(T[2]));h.scale(T,T,ia.inverseFlattening);h.add(T,U,T);Z.halfSize=h.scale(T,T,ka)}class D{constructor(U=f.ZEROS,Z=ba,ca=k.IDENTITY){this._data=[U[0],U[1],U[2],Z[0],Z[1],Z[2],ca[0],ca[1],ca[2],ca[3]]}clone(){const U=new D; U._data=this._data.slice();return U}invalidate(){this._data[3]=-1}get isValid(){return 0<=this._data[3]}static fromData(U){const Z=new D;Z._data=U.slice();return Z}static fromJSON(U){return new D(U.center,U.halfSize,U.quaternion)}copy(U){this._data=U.data.slice()}get center(){return h.set(n.sv3d.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(U){U[0]=this._data[0];U[1]=this._data[1]; U[2]=this._data[2];return U}set center(U){this._data[0]=U[0];this._data[1]=U[1];this._data[2]=U[2]}setCenter(U,Z,ca){this._data[0]=U;this._data[1]=Z;this._data[2]=ca}get halfSize(){return h.set(n.sv3d.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(U){U[0]=this._data[3];U[1]=this._data[4];U[2]=this._data[5];return U}set halfSize(U){this._data[3]=U[0];this._data[4]=U[1];this._data[5]= U[2]}get quaternion(){return p.set(n.sq4d.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(U){U[0]=this._data[6];U[1]=this._data[7];U[2]=this._data[8];U[3]=this._data[9];return U}set quaternion(U){this._data[6]=U[0];this._data[7]=U[1];this._data[8]=U[2];this._data[9]=U[3]}get data(){return this._data}getCorners(U){const Z=F,ca=this._data;Z[0]=ca[6];Z[1]=ca[7];Z[2]=ca[8];Z[3]=ca[9];for(let ea=0;8>ea;++ea){const da=U[ea];da[0]=(ea&1?-1:1)*ca[3];da[1]=(ea&2?-1:1)*ca[4];da[2]= (ea&4?-1:1)*ca[5];h.transformQuat(da,da,Z);da[0]+=ca[0];da[1]+=ca[1];da[2]+=ca[2]}}doesIntersectFrustumConservativeApproximation(U){return 0>=this.intersectPlane(U[0])&&0>=this.intersectPlane(U[1])&&0>=this.intersectPlane(U[2])&&0>=this.intersectPlane(U[3])&&0>=this.intersectPlane(U[4])&&0>=this.intersectPlane(U[5])}get radius(){const U=this._data[3],Z=this._data[4],ca=this._data[5];return Math.sqrt(U*U+Z*Z+ca*ca)}intersectSphere(U){E[0]=this._data[0]-U[0];E[1]=this._data[1]-U[1];E[2]=this._data[2]- U[2];const Z=this.getQuaternion(H);p.conjugate(F,Z);h.transformQuat(E,E,F);h.abs(E,E);G[0]=Math.min(E[0],this._data[3]);G[1]=Math.min(E[1],this._data[4]);G[2]=Math.min(E[2],this._data[5]);return h.sqrDist(G,E)Z*Z)return!1;F[0]=-ca[6];F[1]=-ca[7];F[2]=-ca[8];F[3]=ca[9];h.transformQuat(E,E,F);h.abs(E,E);G[0]=Math.min(E[0],ca[3]);G[1]=Math.min(E[1], ca[4]);G[2]=Math.min(E[2],ca[5]);return h.sqrDist(G,E)U?1:Z<-U?-1:0}intersectRay(U,Z,ca=0){var ea=this._data,da=F;da[0]=-ea[6];da[1]=-ea[7];da[2]=-ea[8];da[3]=ea[9];E[0]=U[0]-ea[0];E[1]=U[1]-ea[1];E[2]=U[2]-ea[2];U=h.transformQuat(E,E,F);Z=h.transformQuat(G,Z,F);ea=-Infinity;da=Infinity;const ia=this.getHalfSize(Q);for(let fa=0;3>fa;fa++){var ka=U[fa];const X= Z[fa],ja=ia[fa]+ca;if(1E-6ja||ka<-ja)return!1}return ea<=da}projectedArea(U,Z,ca,ea){var da=this.getQuaternion(H);p.conjugate(F,da);E[0]=U[0]-this._data[0];E[1]=U[1]-this._data[1];E[2]=U[2]-this._data[2];h.transformQuat(E,E,F);var ia=this.getHalfSize(Q),ka=E[0]<-ia[0]?-1:E[0]>ia[0]?1:0,fa=E[1]<-ia[1]?-1:E[1]>ia[1]?1:0;const X=E[2]<-ia[2]?-1:E[2]>ia[2]?1:0;U=Math.abs(ka)+Math.abs(fa)+ Math.abs(X);if(0===U)return Infinity;U=1===U?4:6;ka=6*(ka+3*fa+9*X+13);b.fromQuat(W,da);b.scale(W,W,ia);da=this.getCenter(J);for(ia=0;ia>1)-1),h.transformMat3(E,E,W),h.add(I,da,E),I[3]=1,c.transformMat4(I,I,Z),fa=1/Math.max(1E-6,I[3]),O[2*ia]=I[0]*fa,O[2*ia+1]=I[1]*fa;Z=2*U-2;U=O[0]*(O[3]-O[Z+1])+O[Z]*(O[1]-O[Z-1]);for(da=2;da{const U=new Int8Array(162);let Z=0;const ca=ea=>{for(let da=0;daia[0]*ia[0]+ia[1]*ia[1]+ia[2]*ia[2]))for(r(I,ka,ia),r(O,fa,ia),r(L,X,ia),c(da,ia,G),M[1]=G[0],P[1]=G[1],K[1]=P[1]-M[1],ka=[ka,fa,X],fa=[I,O,L],X=0;3>X;++X){c(da,ka[X],G);M[0]=G[0];P[0]=G[1];c(da,fa[X],G);M[2]=G[0];P[2]=G[1];K[0]=P[0]-M[0];K[2]=P[2]-M[2];const la=d(K);lava[0]&&(za=1);va[8]>va[3*za+za]&&(za=2);const ya=(za+1)%3,Da=(za+2)%3;let ra=Math.sqrt(va[3*za+za]-va[3*ya+ya]-va[3*Da+Da]+1);na[za]=.5*ra;ra=.5/ra;na[3]=(va[3*ya+Da]-va[3*Da+ya])*ra;na[ya]=(va[3*ya+za]+va[3*za+ya])*ra;na[Da]=(va[3*Da+za]+va[3*za+Da])*ra}la.quaternion=na;t(Y,fa,X);v(Y,Y,.5);v(ha,da,Y[0]);v(ba,ia,Y[1]);t(ha,ha,ba);v(ba,ka,Y[2]);la.center=p.add(ha,ha,ba);la.halfSize=p.scale(Y,ja,.5)}function d(da){return da[0]*da[1]+da[0]*da[2]+da[1]* da[2]}function t(da,ia,ka){da[0]=ia[0]+ka[0];da[1]=ia[1]+ka[1];da[2]=ia[2]+ka[2]}function w(da,ia,ka){da[0]=ia[0]-ka[0];da[1]=ia[1]-ka[1];da[2]=ia[2]-ka[2]}function v(da,ia,ka){da[0]=ia[0]*ka;da[1]=ia[1]*ka;da[2]=ia[2]*ka}function m(da,ia,ka=0){da[0]=ia[ka];da[1]=ia[ka+1];da[2]=ia[ka+2]}function r(da,ia,ka){const fa=ia[0],X=ia[1];ia=ia[2];const ja=ka[0],la=ka[1];ka=ka[2];da[0]=X*ka-ia*la;da[1]=ia*ja-fa*ka;da[2]=fa*la-X*ja}function n(da,ia){var ka=ia[0]*ia[0]+ia[1]*ia[1]+ia[2]*ia[2];0ka;++ka)this.minVert[ka]=new Float64Array(this.buffer,ia,3),ia+=24;for(ka=0;7>ka;++ka)this.maxVert[ka]=new Float64Array(this.buffer,ia,3),ia+=24;for(ia=0;7>ia;++ia)this.minProj[ia]=Number.POSITIVE_INFINITY,this.maxProj[ia]= Number.NEGATIVE_INFINITY;ia=Array(7);ka=Array(7);const {data:fa,size:X}=da;for(da=0;dathis.maxProj[0]&&(this.maxProj[0]=ja,ka[0]=da);ja=fa[da+1];jathis.maxProj[1]&&(this.maxProj[1]=ja,ka[1]=da);ja=fa[da+2];jathis.maxProj[2]&&(this.maxProj[2]=ja,ka[2]=da);ja=fa[da]+fa[da+1]+fa[da+2];jathis.maxProj[3]&&(this.maxProj[3]=ja,ka[3]=da);ja=fa[da]+fa[da+1]-fa[da+2];jathis.maxProj[4]&&(this.maxProj[4]=ja,ka[4]=da);ja=fa[da]-fa[da+1]+fa[da+2];jathis.maxProj[5]&&(this.maxProj[5]=ja,ka[5]=da);ja=fa[da]-fa[da+1]-fa[da+2];jathis.maxProj[6]&&(this.maxProj[6]=ja,ka[6]=da)}for(da=0;7>da;++da)ja=ia[da],m(this.minVert[da],fa,ja), ja=ka[da],m(this.maxVert[da],fa,ja)}}class ea{constructor(){this.b0=k.fromValues(1,0,0);this.b1=k.fromValues(0,1,0);this.b2=k.fromValues(0,0,1);this.quality=0}}a.computeOBB=function(da,ia){const {data:ka,size:fa}=da;var X=ka.length/fa;if(!(0>=X)){var ja=new ca(da);t(x,ja.minProj,ja.maxProj);v(x,x,.5);w(y,ja.maxProj,ja.minProj);var la=d(y),na=new ea;na.quality=la;14>X&&(da=new h.Vertices(new Float64Array(ja.buffer,112,42),3));var va=k.create(),za=k.create(),ya=k.create();X=k.create();var Da=k.create(), ra=k.create(),xa=k.create();var Ma=da;var Ga=u(ja.maxVert[0],ja.minVert[0]),Pa=0;for(var Qa=1;7>Qa;++Qa){const Na=u(ja.maxVert[Qa],ja.minVert[Qa]);Na>Ga&&(Ga=Na,Pa=Qa)}m(va,ja.minVert[Pa]);m(za,ja.maxVert[Pa]);if(1E-6>u(va,za))Ma=1;else{w(X,va,za);n(X,X);const {data:Na,size:Ua}=Ma;ja=Number.NEGATIVE_INFINITY;Ga=0;for(Pa=0;Paja&&(ja=Qa,Ga=Pa);m(ya,Na,Ga);1E-6>ja?Ma=2:(w(Da,za,ya),n(Da,Da),w(ra,ya,va),n(ra,ra),r(xa,Da,X),n(xa,xa),f(Ma,xa,X,Da,ra,na),Ma=0)}switch(Ma){case 1:ia.center=x;ia.halfSize=p.scale(y,y,.5);ia.quaternion=q.IDENTITY;return;case 2:la=da;m(R,X);Math.abs(X[0])>Math.abs(X[1])&&Math.abs(X[0])>Math.abs(X[2])?R[0]=0:Math.abs(X[1])>Math.abs(X[2])?R[1]=0:R[2]=0;1E-6>R[0]*R[0]+R[1]*R[1]+R[2]*R[2]&&(R[0]=R[1]=R[2]=1);r(Q,X,R);n(Q,Q);r(W,X,Q);n(W,W);e(la,X,Q,W,S,V);w(T,V,S);g(X,Q,W,S,V,T,ia);return}Ma=da;ja= G;const {data:Ea,size:ua}=Ma;m(A,Ea);m(z,A);ja[0]=J[0]*xa[0]+J[1]*xa[1]+J[2]*xa[2];ja[1]=ja[0];for(Ga=ua;Gaja[1]&&(ja[1]=Pa,m(z,Ea,Ga));xa=va[0]*xa[0]+va[1]*xa[1]+va[2]*xa[2];G[1]-1E-6<=xa&&(z[0]=void 0);G[0]+1E-6>=xa&&(A[0]=void 0);void 0!==z[0]&&(w(B,z,va),n(B,B),w(C,z,za),n(C,C),w(D,z,ya),n(D,D),r(F,C,X),n(F,F),r(H,D,Da),n(H,H),r(N,B,ra),n(N,N),f(Ma,F,X,C,B,na),f(Ma,H,Da,D,C,na),f(Ma,N,ra,B,D,na)); void 0!==A[0]&&(w(B,A,va),n(B,B),w(C,A,za),n(C,C),w(D,A,ya),n(D,D),r(F,C,X),n(F,F),r(H,D,Da),n(H,H),r(N,B,ra),n(N,N),f(Ma,F,X,C,B,na),f(Ma,H,Da,D,C,na),f(Ma,N,ra,B,D,na));e(da,na.b0,na.b1,na.b2,S,V);da=k.create();w(da,V,S);na.quality=d(da);na.qualityt?(q.copy(d,f),w&&q.scale(d,d,-1)):d=null);f=0;d&&(q.scale(k,e,q.dot(e,d)),q.subtract(d,d,k),f=q.dot(d,g)/(q.length(d)*q.length(g)),q.cross(k,d,g),f=(0Math.abs(L))L=N+K;else{var J=K/P,R=q.asinClamped(N/J);L=J*Math.sin(Math.PI-L-R)}M*=N;J=N*N*P*P;R=E*E*J;const Q=L-M,W=Q*Q;var S=R*(R+W-O[1]*O[1]);if(0>S)return k.scale(I.eye,O,L/K),I.tilt=0,n(I,H);var V=Math.sqrt(S);const T=O[1]*Q;S=R+W;V=0Math.abs(S))return 1E-8>K?(I.eye[0]= 0,I.eye[1]=0,I.eye[2]=N):k.scale(I.eye,O,L/K),I.tilt=0,r(I.eye),n(I,H);I.eye[1]=V/S;N*=P;V=I.eye[1]*I.eye[1];P=1-V;S=Math.sqrt(P);J=R*V+G*G*J-2*E*N*I.eye[1]*S*Q+P*W;if(1E-8>Math.abs(J))return k.scale(I.eye,O,L/K),I.tilt=0,r(I.eye),n(I,H);I.eye[0]=(P*(L*O[0]-M*O[0])-N*S*(O[0]*I.eye[1]*E+O[2]*G))/J;I.eye[2]=(P*(L*O[2]-M*O[2])-N*S*(O[2]*I.eye[1]*E-O[0]*G))/J;k.scale(I.eye,I.eye,L);r(I.eye);return n(I,H)}function r(H){const N=H[1];H[1]=-H[2];H[2]=N}function n(H,N){N=w(N,H.heading,H.tilt);H.up=N.up;return H} function u(H,N,E){N=k.length(N);E=q.asinClamped(E/(Math.sqrt(E*E+N*N-2*E*N*Math.cos(Math.PI-H))/Math.sin(H)));return q.rad2deg(H-E)}function x(H,N,E){H=q.deg2rad(H);N=k.length(N);return q.asinClamped(E/(N/Math.sin(H)))+H}function y(H,N,E,G,I){function O(K){const J=Math.PI/2;K=b.cyclical2PI.normalize(K,-J);K>J&&(K=Math.PI-K);return K}var L=N.latitude;var P=f.getReferenceEllipsoid(H.spatialReference).radius;N=N.longitude;var M=t.getLonDeltaForDistance(L,E,P)/2;E=N-M;N+=M;L=q.deg2rad(L);L=(1+Math.sin(L))/ (1-Math.sin(L));M=(L+1)*Math.tan(G/P/2);L=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*L+M*M)));G=L+G/P;L=O(L);G=O(G);Gthis.emit("changed",{}))}get extent(){const t=this.view.basemapTerrain;if(null==t?.extent||null==t.spatialReference)return null;const w=c.toExtent(t.extent,t.spatialReference);w.zmin=t.visibleElevationBounds.min;w.zmax=t.visibleElevationBounds.max;return w}get spatialReference(){return this.view.basemapTerrain?.spatialReference?? f.WGS84}elevationAt(t,w){if(null==this.extent||!e.extentContainsXYZ(this.extent,t,w)){const v=null!=this.extent?`${this.extent.xmin}, ${this.extent.ymin}, ${this.extent.xmax}, ${this.extent.ymax}`:null;q.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${t}, ${w}) is outside of the sampler extent (${v})`);return this.noDataValue}return this.view.elevationProvider?.getElevation(t,w,0,this.spatialReference,"ground")??this.noDataValue}queryElevation(t){return g.updateGeometryElevation(t.clone(), this)}};a.__decorate([l.property({readOnly:!0})],b.prototype,"demResolution",void 0);a.__decorate([l.property({readOnly:!0})],b.prototype,"extent",null);a.__decorate([l.property({readOnly:!0})],b.prototype,"noDataValue",void 0);a.__decorate([l.property()],b.prototype,"spatialReference",null);a.__decorate([l.property({constructOnly:!0})],b.prototype,"view",void 0);return b=a.__decorate([h.subclass("esri.views.support.GroundViewElevationSampler")],b)})},"esri/layers/support/ElevationSampler":function(){define("exports ../../geometry ../../core/has ../../core/handleUtils ../../core/Logger ../../core/unitUtils ../../geometry/support/aaBoundingRect ../../geometry/support/webMercatorUtils ../../geometry/Point".split(" "), function(a,b,q,l,p,k,h,f,c){function e(r,n){const u=g(r,n.spatialReference);if(!u)return null;switch(r.type){case "point":r.z=n.elevationAt(u.x,u.y);break;case "polyline":m.spatialReference=u.spatialReference;var x=r.hasM&&!r.hasZ;for(var y=0;yp.getLogger("esri.layers.support.ElevationSampler");class t{queryElevation(r){return e(r.clone(),this)}on(){return l.makeHandle()}projectIfRequired(r, n){return g(r,n)}}class w extends t{get spatialReference(){return this.extent.spatialReference}constructor(r,n,u){super();this.tile=r;this.noDataValue=u;u=r.tile.extent;this.extent=h.toExtent(u,n.spatialReference);this.extent.zmin=r.zmin;this.extent.zmax=r.zmax;this._aaExtent=u;u=k.getMetersPerUnitForSR(n.spatialReference);r=n.lodAt(r.tile.level).resolution*u;this.demResolution={min:r,max:r}}contains(r){r=this.projectIfRequired(r,this.spatialReference);return null==r?!1:this.containsAt(r.x,r.y)}containsAt(r, n){return h.containsXY(this._aaExtent,r,n)}elevationAt(r,n){if(!this.containsAt(r,n)){var u=this.extent;u=`${u.xmin}, ${u.ymin}, ${u.xmax}, ${u.ymax}`;d().warn("#elevationAt()",`Point used to sample elevation (${r}, ${n}) is outside of the sampler extent (${u})`);return this.noDataValue}return this.tile.sample(r,n)??this.noDataValue}}class v extends t{get spatialReference(){return this.extent.spatialReference}constructor(r,n,u){super();let x;"number"===typeof n?(this.noDataValue=n,x=null):(x=n,this.noDataValue= u);this.samplers=x?r.map(y=>new w(y,x,this.noDataValue)):r;if(r=this.samplers[0]){this.extent=r.extent.clone();const {min:y,max:z}=r.demResolution;this.demResolution={min:y,max:z};for(r=1;r{B.levelnew d({level:u,scale:n.scale,resolution:n.resolution}))})}getExtent(n,u,x,y){var z=this.levels[n];n=z.tileSize[0];z=z.tileSize[1];y[0]=this.origin[0]+x*n;y[2]=this.origin[0]+(x+1)*n;y[3]=this.origin[1]-u*z;y[1]=this.origin[1]-(u+1)*z}convertExtentToRadians(n,u){this._isWebMercator?(u[0]=g.x2lon(n[0]),u[1]=g.y2lat(n[1]),u[2]=g.x2lon(n[2]),u[3]=g.y2lat(n[3])):this._isGCS&&(u[0]=p.deg2rad(n[0]),u[1]=p.deg2rad(n[1]),u[2]=p.deg2rad(n[2]),u[3]=p.deg2rad(n[3]))}getExtentGeometry(n, u,x,y=new h){this.getExtent(n,u,x,r);y.spatialReference=this.spatialReference;y.xmin=r[0];y.ymin=r[1];y.xmax=r[2];y.ymax=r[3];y.zmin=void 0;y.zmax=void 0;return y}ensureMaxLod(n){if(null==n)return!1;for(var u=!1;this.levels.length<=n;){const {resolution:x,scale:y}=this.levels[this.levels.length-1];u=x/2*this.pixelSize;this.levels.push({resolution:x/2,scale:y/2,tileSize:[u,u]});u=!0}return u}capMaxLod(n){this.levels.length>n+1&&(this.levels.length=n+1)}getMaxLod(){return this.levels.length-1}scaleAtLevel(n){return this.levels[0].scale/ 2**n}levelAtScale(n){const u=this.levels[0].scale;return n>=u?0:Math.log(u/n)*Math.LOG2E}resolutionAtLevel(n){return this.levels[0].resolution/2**n}compatibleWith(n,u=Infinity){if(m.checkUnsupported(n))return!1;n=new m(n);if(!n.spatialReference.equals(this.spatialReference)||n.pixelSize!==this.pixelSize)return!1;u=Math.min(this.levels.length-1,n.levels.length-1,u);const x=this.levels[u].resolution;let y=.5*x;if(!p.floatEqualAbsolute(n.origin[0],this.origin[0],y)||!p.floatEqualAbsolute(n.origin[1], this.origin[1],y))return!1;y=.5*x/2**u/this.pixelSize*12;return p.floatEqualAbsolute(x,n.levels[u].resolution,y)}rootTilesInExtent(n,u=null,x=Infinity){const y=[],z=this.levels[0].tileSize;if(null==n||0===z[0]||0===z[1])return y;m.computeRowColExtent(n,z,this.origin,r);n=r[1];let A=r[3],B=r[0],C=r[2];var D=C-B;const F=A-n;D*F>x&&(x=Math.floor(Math.sqrt(x)),F>x&&(n=n+Math.floor(.5*F)-Math.floor(.5*x),A=n+x),D>x&&(B=B+Math.floor(.5*D)-Math.floor(.5*x),C=B+x));for(x=n;x!p.floatEqualRelative(x.resolution, u/2**x.level))}static hasGapInLevels(n){n=n.lods.map(u=>u.level);n.sort((u,x)=>u-x);for(let u=1;u=u}static hasOriginPerLODs(n){const u=n.origin;return n.lods.some(x=>null!=x.origin&&(x.origin[0]!==u.x||x.origin[1]!==u.y))}static getMissingTileInfoError(){return new q("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}static checkUnsupported(n){return null== n?v():1>n.lods.length?new q("tilingscheme:generic","Tiling scheme must have at least one level"):m.isPowerOfTwo(n)?m.hasGapInLevels(n)?new q("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):m.tileSizeSupported(n)?m.hasOriginPerLODs(n)?new q("tilingscheme:multiple-origin","Tiling scheme levels must not have their own origin"):null:new q("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]"):new q("tilingscheme:power-of-two", "Tiling scheme must be power of two")}static fromExtent(n,u){const x=n[2]-n[0],y=n[3]-n[1];var z=k.getMetersPerUnitForSR(u);const A=1.2*Math.max(x,y),B=A/256;z=96/.0254*z*B;n=new m(new t({size:[256,256],origin:new w({x:n[0]-.5*(A-x),y:n[3]+.5*(A-y)}),lods:[new d({level:0,resolution:B,scale:z})],spatialReference:u}));n.ensureMaxLod(20);return n}static makeWebMercatorAuxiliarySphere(n){const u=new m(m.WebMercatorAuxiliarySphereTileInfo);u.ensureMaxLod(n);return u}static makeGCSWithTileSize(n,u=256, x=16){const y=256/u;n=new m(new t({size:[u,u],origin:new w({x:-180,y:90,spatialReference:n}),spatialReference:n,lods:[new d({level:0,resolution:.703125*y,scale:2.95497598570834E8*y})]}));n.ensureMaxLod(x);return n}get test(){}}m.WebMercatorAuxiliarySphereTileInfo=new t({size:[256,256],origin:new w({x:-2.0037508342787E7,y:2.0037508342787E7,spatialReference:f.WebMercator}),spatialReference:f.WebMercator,lods:[new d({level:0,resolution:156543.03392800014,scale:5.91657527591555E8})]});m.WebMercatorAuxiliarySphere= m.makeWebMercatorAuxiliarySphere(19);const r=c.create();a.TilingScheme=m;a.getMissingTileInfoError=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/LOD":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h){var f;b=f=class extends b.JSONSupport{constructor(c){super(c); this.cols=null;this.level=0;this.origin=this.levelValue=null;this.resolution=0;this.rows=null;this.scale=0}clone(){return new f({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};a.__decorate([q.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],b.prototype,"cols",void 0);a.__decorate([q.property({type:l.Integer,json:{write:!0}})],b.prototype,"level",void 0);a.__decorate([q.property({type:String, json:{write:!0}})],b.prototype,"levelValue",void 0);a.__decorate([q.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],b.prototype,"origin",void 0);a.__decorate([q.property({type:Number,json:{write:!0}})],b.prototype,"resolution",void 0);a.__decorate([q.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],b.prototype,"rows",void 0);a.__decorate([q.property({type:Number,json:{write:!0}})],b.prototype, "scale",void 0);return b=f=a.__decorate([h.subclass("esri.layers.support.LOD")],b)})},"esri/layers/support/TileInfo":function(){define("../../chunks/tslib.es6 ../../core/jsonMap ../../core/JSONSupport ../../core/unitUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/aaBoundingRect ../../geometry/support/spatialReferenceUtils ../../geometry/support/webMercatorUtils ./LOD ./TileKey".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){var u;b=new b.JSONMap({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});q=u=class extends q.JSONSupport{static create(x={}){const {resolutionFactor:y=1,scales:z,size:A=256,spatialReference:B=t.WebMercator,numLODs:C=24}=x;if(!v.isValid(B)){x=[];if(z)for(var D=0;D{y.push(A.scale);z[A.level]=A});this._set("scales",y);this._set("lods",x);this._initializeUpsampleLevels()}readSize(x,y){return[y.cols,y.rows]}writeSize(x,y){y.cols=x[0];y.rows=x[1]}zoomToScale(x){const y=this.scales;if(0>=x)return y[0];if(x>=y.length-1)return y[y.length-1];const z=Math.floor(x);return y[z]/(y[z]/y[z+ 1])**(x-z)}scaleToZoom(x){const y=this.scales,z=y.length-1;let A=0;for(;Ax&&CArray.isArray(x)?x:"number"===typeof x?[x,x]:[256,256]})],q.prototype,"size",void 0);a.__decorate([c.reader("size",["rows","cols"])],q.prototype,"readSize",null);a.__decorate([g.writer("size",{cols:{type:k.Integer},rows:{type:k.Integer}})],q.prototype,"writeSize",null);a.__decorate([p.property({type:t,json:{write:!0}})],q.prototype,"spatialReference", void 0);q=u=a.__decorate([e.subclass("esri.layers.support.TileInfo")],q);(function(x){x=x.ExtrapolateOptions||(x.ExtrapolateOptions={});x[x.NONE=0]="NONE";x[x.POWER_OF_TWO=1]="POWER_OF_TWO"})(q||={});return q})},"esri/layers/support/TileKey":function(){define(["exports"],function(a){class b{constructor(q,l,p,k,h){this.id=q;this.level=l;this.row=p;this.col=k;this.extent=h}}a.TileKey=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/PopupView":function(){define("require exports ../chunks/tslib.es6 ../core/asyncUtils ../core/deprecate ../core/Error ../core/has ../core/Logger ../core/promiseUtils ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./input/InputManager".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(u){return null!=u&&"open"in u&&"declaredClass"in u}function m(u){return null!=u&&"declaredClass"in u&&"dockOptions"in u}const r=u=>Object.freeze(Object.defineProperty({__proto__:null,default:u},Symbol.toStringTag,{value:"Module"}));class n{constructor(u){this.layerView=u;this._resolver=c.createResolver();this.graphics=[]}get promise(){return this._resolver.promise}resolve(u){const {layerView:x,graphics:y,_resolver:z}=this;if(!x)return z.resolve(y), z.promise;let A;x.fetchPopupFeaturesFromGraphics(y,u).catch(B=>{A=B;return null}).then(B=>{B?z.resolve(B):z.reject(A)});return z.promise}}b.PopupView=u=>{u=class extends u{constructor(){super(...arguments);this._popupSetupTask=null;this.popup={};this.popupEnabled=!0}initialize(){this.addHandles([e.watch(()=>[this.ui,this.popup],([x,y],z)=>{if(z){const [A,B]=z;A&&v(B)&&(B.view=null,m(B)&&A.remove(B,"popup"))}x&&v(y)&&(y.view=this,m(y)&&x.add(y,{key:"popup",position:"manual",internal:!0}))},e.initial), this.on("click",x=>{this.popup&&this.popupEnabled&&("mouse"!==x.pointerType||0===x.button)&&(v(this.popup)?this.popup.viewModel.handleViewClick(x):x.async(async()=>{await this.setupPopup();v(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(x)}))},w.ViewEventPriorities.WIDGET)]);e.whenOnce(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{new Promise((x,y)=>a(["../widgets/Popup"],z=>x(r(z)),y))})}destroy(){this.destroyed||this.closePopup()}async openPopup(x){if(v(this.popup))return this.popup.open(x); try{await this.setupPopup(),this.popup?this.popup.open(x):f.getLogger(this).error(new k("view:null-popup","Popup is null and can't be opened"))}catch{}}closePopup(){this._popupSetupTask?.abort();v(this.popup)&&this.popup.close()}async fetchPopupFeatures(x,y){await this.when();return this._popupHitsToFeatures(await this._getPopupHits(x,y),y)}async setupPopup(){this._popupSetupTask?.abort();if(this.popup&&!v(this.popup))return this._popupSetupTask=l.createTask(async x=>{const {default:y}=await new Promise((z, A)=>a(["../widgets/Popup"],B=>z(r(B)),A));c.throwIfAborted(x);this.popup&&!v(this.popup)&&(x=this.popup,delete x.open,delete x.close,this.popup=new y(x))}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:x,hits:y},z){const A=[],B=[];let C=!1;const D=c.wrapAbortWithTimeout(z,h("popup-view-fetch-timeout")??5E3);z=F=>{const H=B.at(-1);H&&H.layerView===F&&!C?F=H:(F=new n(F),B.push(F),A.push(F.promise));return F};for(const F of y)"graphic"in F?(z(F.layerView).graphics.push(F.graphic), C=!1):(A.push(F.layerView.fetchPopupFeaturesAtLocation(F.mapPoint,D)),C=!0);B.map(F=>F.resolve(D));y=c.allSettledValues(A).then(F=>F.filter(H=>!!H).flat());return{pendingFeatures:A,allGraphicsPromise:y,location:x}}async _getPopupHits(x,y){const {hits:z,location:A}=await this.popupHitTest(x);c.throwIfAborted(y);x=[];for(const B of z)if("graphic"in B){if(this._isValidPopupGraphic(B.graphic,y)){const C=this._isValidPopupGraphicsLayerView(B.layerView)?B.layerView:void 0;x.push({graphic:B.graphic,layerView:C})}}else this._isValidPopupLocationLayerView(B.layerView)&& x.push({mapPoint:B.mapPoint,layerView:B.layerView});return{hits:x,location:A}}_isValidPopupGraphic(x,y){return x&&!!x.getEffectivePopupTemplate(y?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(x){return!x||(!("layer"in x)||!x.suspended)&&"fetchPopupFeaturesFromGraphics"in x}_isValidPopupLocationLayerView(x){return(!("layer"in x)||!x.suspended)&&"fetchPopupFeaturesAtLocation"in x}};q.__decorate([g.property({cast(x){if(!x||v(x))return x;"object"===typeof x&&(x.open=y=>{p.deprecated(f.getLogger(this), "view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"});return this.openPopup(y)},x.close=()=>{p.deprecated(f.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"});return this.closePopup()});return x}})],u.prototype,"popup",void 0);q.__decorate([g.property()], u.prototype,"popupEnabled",void 0);return u=q.__decorate([t.subclass("esri.views.PopupView")],u)};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layerViewModuleImportUtils":function(){define(["require","exports","../../core/Error"],function(a,b,q){const l=f=>Object.freeze(Object.defineProperty({__proto__:null,default:f},Symbol.toStringTag,{value:"Module"})),p=()=>new Promise((f,c)=>a(["./layers/TileLayerView3D"],e=>f(l(e)),c)),k=()=>new Promise((f,c)=>a(["./layers/ElevationLayerView3D"], e=>f(l(e)),c)),h={"base-dynamic":()=>new Promise((f,c)=>a(["./layers/BaseDynamicLayerView3D"],e=>f(l(e)),c)),"base-elevation":k,"base-tile":p,"bing-maps":p,"building-scene":()=>new Promise((f,c)=>a(["./layers/BuildingSceneLayerView3D"],e=>f(l(e)),c)),catalog:()=>new Promise((f,c)=>a(["./layers/CatalogLayerView3D"],e=>f(l(e)),c)),"catalog-dynamic-group":()=>new Promise((f,c)=>a(["./layers/CatalogDynamicGroupLayerView3D"],e=>f(l(e)),c)),"catalog-footprint":()=>new Promise((f,c)=>a(["./layers/CatalogFootprintLayerView3D"], e=>f(l(e)),c)),csv:()=>new Promise((f,c)=>a(["./layers/CSVLayerView3D"],e=>f(l(e)),c)),dimension:()=>new Promise((f,c)=>a(["./layers/DimensionLayerView3D"],e=>f(l(e)),c)),elevation:k,feature:()=>new Promise((f,c)=>a(["./layers/FeatureLayerView3D"],e=>f(l(e)),c)),geojson:()=>new Promise((f,c)=>a(["./layers/GeoJSONLayerView3D"],e=>f(l(e)),c)),graphics:()=>new Promise((f,c)=>a(["./layers/GraphicsLayerView3D"],e=>f(l(e)),c)),group:()=>new Promise((f,c)=>a(["../layers/GroupLayerView"],e=>f(l(e)),c)),imagery:()=> new Promise((f,c)=>a(["./layers/ImageryLayerView3D"],e=>f(l(e)),c)),"integrated-mesh":()=>new Promise((f,c)=>a(["./layers/IntegratedMeshLayerView3D"],e=>f(l(e)),c)),"integrated-mesh-3dtiles":()=>new Promise((f,c)=>a(["./layers/IntegratedMesh3DTilesLayerView3D"],e=>f(l(e)),c)),"line-of-sight":()=>new Promise((f,c)=>a(["./layers/LineOfSightLayerView3D"],e=>f(l(e)),c)),"map-image":()=>new Promise((f,c)=>a(["./layers/MapImageLayerView3D"],e=>f(l(e)),c)),media:()=>new Promise((f,c)=>a(["./layers/MediaLayerView3D"], e=>f(l(e)),c)),"ogc-feature":()=>new Promise((f,c)=>a(["./layers/OGCFeatureLayerView3D"],e=>f(l(e)),c)),"open-street-map":p,"oriented-imagery":()=>new Promise((f,c)=>a(["./layers/FeatureLayerView3D"],e=>f(l(e)),c)),"point-cloud":()=>new Promise((f,c)=>a(["./layers/PointCloudLayerView3D"],e=>f(l(e)),c)),voxel:()=>new Promise((f,c)=>a(["./layers/VoxelLayerView3D"],e=>f(l(e)),c)),route:()=>new Promise((f,c)=>a(["./layers/RouteLayerView3D"],e=>f(l(e)),c)),scene:f=>null==f.profile||"mesh-pyramids"===f.profile? new Promise((c,e)=>a(["./layers/SceneLayerView3D"],g=>c(l(g)),e)):new Promise((c,e)=>a(["./layers/SceneLayerGraphicsView3D"],g=>c(l(g)),e)),stream:()=>new Promise((f,c)=>a(["./layers/StreamLayerView3D"],e=>f(l(e)),c)),tile:p,"imagery-tile":()=>new Promise((f,c)=>a(["./layers/ImageryTileLayerView3D"],e=>f(l(e)),c)),"vector-tile":()=>new Promise((f,c)=>a(["./layers/VectorTileLayerView3D"],e=>f(l(e)),c)),wcs:()=>new Promise((f,c)=>a(["./layers/ImageryTileLayerView3D"],e=>f(l(e)),c)),"web-tile":p,wfs:()=> new Promise((f,c)=>a(["./layers/WFSLayerView3D"],e=>f(l(e)),c)),wms:()=>new Promise((f,c)=>a(["./layers/WMSLayerView3D"],e=>f(l(e)),c)),wmts:()=>new Promise((f,c)=>a(["./layers/WMTSLayerView3D"],e=>f(l(e)),c)),"geo-rss":null,kml:null,"knowledge-graph":null,"link-chart":null,"knowledge-graph-sublayer":null,"map-notes":null,"subtype-group":null,unknown:null,unsupported:null,video:null};b.layerView3DImporter={hasLayerViewModule:f=>null!=h[f.type],importLayerView:f=>{var c=h[f.type];if(null==c)throw f= f.declaredClass?f.declaredClass.slice(f.declaredClass.lastIndexOf(".")+1):"Unknown",c=f.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),new q(`${c}:view-not-supported`,`${f} is not supported in 3D`);return c(f)}};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/analysis/AnalysisViewManager3D":function(){define("require ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/asyncUtils ../../../core/Collection ../../../core/Error ../../../core/handleUtils ../../../core/has ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/scheduling ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(){const u=g.createResolver();u.promise.catch(()=>{});return u}const m=u=>Object.freeze(Object.defineProperty({__proto__:null,default:u},Symbol.toStringTag,{value:"Module"}));var r;(function(u){u[u.PENDING=0]="PENDING";u[u.CREATED=1]="CREATED"})(r||={});var n;(function(u){u[u.ADDED=0]="ADDED";u[u.REMOVED=1]="REMOVED"})(n||={});q=class extends q{constructor(u){super(u);this._allAnalysisViews=new p;this._creatingViewCount=0;this._items=new Map;this._scheduledUpdateHandle= null;this._attachedToViewResolver=v();this._analysisModules={"area-measurement":{module:null},dimension:{module:null},"direct-line-measurement":{module:null},"line-of-sight":{module:null},slice:{module:null},viewshed:{module:null}}}destroy(){this._disconnectOwners();this._attachedToViewResolver.reject(g.createAbortError("AnalysisViewManager was destroyed"))}attach(){this._connectOwners();this._attachedToViewResolver.resolve()}detach(){this._disconnectOwners();this._attachedToViewResolver.reject(g.createAbortError()); this._attachedToViewResolver=v()}get updating(){return!this.view.ready||0!==this._creatingViewCount||this._allAnalysisViews.some(u=>u.updating)}get testInfo(){}async whenAnalysisView(u){await this._attachedToViewResolver.promise;const x=this._items.get(u);if(null==x||x.state.list===n.REMOVED)throw new k("AnalysisViewManager:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:u});return x.createAnalysisViewTask.promise}_connectOwners(){this.addHandles(this._connectAnalysesCollection(this.view.analyses), "analyses-owner-handles")}_disconnectOwners(){this.removeHandles("analyses-owner-handles");this._update();this._creatingViewCount=0}_connectAnalysesCollection(u){for(const z of u)this._addAnalysis(z);const x=u.on("after-add",z=>this._addAnalysis(z.item)),y=u.on("after-remove",z=>this._removeAnalysis(z.item));return h.makeHandle(()=>{x.remove();y.remove();for(const z of u)this._removeAnalysis(z)})}_addAnalysis(u){const x=this._items.get(u);if(null==x){const y={state:{view:r.PENDING,list:n.ADDED},analysis:u, view:null,createAnalysisViewTask:null};this._items.set(u,y);y.createAnalysisViewTask=l.createTask(z=>this._createAnalysisViewPromise(y,z))}else x.state.list=n.ADDED}_removeAnalysis(u){u=this._items.get(u);null==u?c.getLogger(this).error("Trying to remove analysis which was not added"):(u.state.list=n.REMOVED,this._scheduleUpdate())}_scheduleUpdate(){null==this._scheduledUpdateHandle&&(this._scheduledUpdateHandle=d.schedule(()=>this._update()))}_update(){this._scheduledUpdateHandle=e.removeMaybe(this._scheduledUpdateHandle); this._items.forEach(u=>{if(u.state.list===n.REMOVED)switch(this._items.delete(u.analysis),u.state.view){case r.PENDING:u.createAnalysisViewTask=e.abortMaybe(u.createAnalysisViewTask);break;case r.CREATED:null!=u.view&&(this._allAnalysisViews.remove(u.view),u.view=e.destroyMaybe(u.view),u.createAnalysisViewTask=null)}})}async _createAnalysisViewPromise(u,x){var y=u.analysis;const z=y.type,A=this._analysisModules[z];this._creatingViewCount+=1;if(null==A.module)try{A.module=await this._loadAnalysisModule(z)}catch(B){throw--this._creatingViewCount, B;}if(g.isAborted(x))throw--this._creatingViewCount,g.createAbortError("AnalysisView creation aborted");y=new A.module.default({analysis:y,view:this.view});try{await y.when()}catch(B){throw--this._creatingViewCount,B;}if(g.isAborted(x))throw--this._creatingViewCount,y.destroy(),g.createAbortError("AnalysisView creation aborted");u.view=y;u.state.view=r.CREATED;this._allAnalysisViews.add(y);--this._creatingViewCount;return y}_loadAnalysisModule(u){switch(u){case "area-measurement":return new Promise((x, y)=>a(["./AreaMeasurementAnalysisView3D"],z=>x(m(z)),y));case "dimension":return new Promise((x,y)=>a(["./DimensionAnalysisView3D"],z=>x(m(z)),y));case "direct-line-measurement":return new Promise((x,y)=>a(["./DirectLineMeasurementAnalysisView3D"],z=>x(m(z)),y));case "line-of-sight":return new Promise((x,y)=>a(["./LineOfSightAnalysisView3D"],z=>x(m(z)),y));case "slice":return new Promise((x,y)=>a(["./SliceAnalysisView3D"],z=>x(m(z)),y));case "viewshed":return new Promise((x,y)=>a(["./ViewshedAnalysisView3D"], z=>x(m(z)),y))}}};b.__decorate([t.property()],q.prototype,"updating",null);b.__decorate([t.property({constructOnly:!0})],q.prototype,"view",void 0);b.__decorate([t.property()],q.prototype,"_allAnalysisViews",void 0);b.__decorate([t.property()],q.prototype,"_creatingViewCount",void 0);return q=b.__decorate([w.subclass("esri.views.3d.analysis.AnalysisViewManager3D")],q)})},"esri/views/3d/constraints/Constraints":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./AltitudeConstraint ./ClipDistanceConstraint ./TiltConstraint".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){a.Constraints=class extends q.Clonable{constructor(){super(...arguments);this.tilt=new g.TiltConstraint;this.altitude=new c.AltitudeConstraint;this.clipDistance=new e.ClipDistanceConstraint}};b.__decorate([l.property({type:g.TiltConstraint})],a.Constraints.prototype,"tilt",void 0);b.__decorate([l.property({type:c.AltitudeConstraint})],a.Constraints.prototype,"altitude",void 0);b.__decorate([l.property({type:e.ClipDistanceConstraint})],a.Constraints.prototype,"clipDistance", void 0);a.Constraints=b.__decorate([f.subclass("esri.views.3d.constraints.Constraints")],a.Constraints);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/constraints/AltitudeConstraint":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../state/Constraints".split(" "),function(a,b,q, l,p,k,h,f,c){a.AltitudeConstraint=class extends q.Clonable{constructor(){super(...arguments);this.min=c.earthAltitudeConstraint.min;this.max=c.earthAltitudeConstraint.max}};b.__decorate([l.property({type:Number})],a.AltitudeConstraint.prototype,"min",void 0);b.__decorate([l.property({type:Number})],a.AltitudeConstraint.prototype,"max",void 0);a.AltitudeConstraint=b.__decorate([f.subclass("esri.views.3d.constraints.AltitudeConstraint")],a.AltitudeConstraint);Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/state/Constraints":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Logger ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/Ellipsoid ../../ViewingMode ../support/mathUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d){a.Constraints=class extends q{constructor(m){super(m);this.collision= new v;this.distance=Infinity;this.minimumPoiDistance=4;this.tilt=null}get altitude(){return this.mode===g.ViewingMode.Local?null:this._get("altitude")||null}set altitude(m){this.mode===g.ViewingMode.Local?l.getLogger(this).warn("Altitude constraint is ignored in local scenes"):this._set("altitude",m)}clampAltitude(m){return this.altitude?p.clamp(m,this.altitude.min,this.altitude.max):m}clampTilt(m,r){if(!this.tilt)return r;m=this.tilt(m);return p.clamp(r,m.min,m.max)}clampDistance(m){return Math.min(m, this.distance)}createDefaultTilt(){return this.mode===g.ViewingMode.Local?this._createDefaultTiltLocal():this._createDefaultTiltGlobal()}createConstantMaxTilt(m){return(r,n=w)=>{n.min=t.min;n.max=m;return n}}_createDefaultTiltLocal(){const m=this.collision.enabled?d.makePiecewiseLinearFunction([[4E3,t.max],[1E4,p.deg2rad(88)],[6E6,p.deg2rad(88)]]):()=>t.max;return(r,n=w)=>{n.min=t.min;n.max=m(r);return n}}_createDefaultTiltGlobal(){const m=this.collision.enabled?d.makePiecewiseLinearFunction([[4E3, t.max],[5E4,p.deg2rad(88)],[6E6,p.deg2rad(88)],[2E7,t.min]]):d.makePiecewiseLinearFunction([[3E5,t.max],[3E6,p.deg2rad(88)],[6E6,p.deg2rad(88)],[2E7,t.min]]);return(r,n=w)=>{n.min=t.min;n.max=m(r);return n}}};b.__decorate([k.property()],a.Constraints.prototype,"altitude",null);b.__decorate([k.property({readOnly:!0})],a.Constraints.prototype,"collision",void 0);b.__decorate([k.property()],a.Constraints.prototype,"distance",void 0);b.__decorate([k.property({readOnly:!0})],a.Constraints.prototype,"minimumPoiDistance", void 0);b.__decorate([k.property()],a.Constraints.prototype,"tilt",void 0);b.__decorate([k.property({constructOnly:!0})],a.Constraints.prototype,"mode",void 0);a.Constraints=b.__decorate([c.subclass("esri.views.3d.state.Constraints")],a.Constraints);h={min:-2E5,max:4*e.earth.radius};const t={min:p.deg2rad(.5),max:p.deg2rad(179.5)},w={min:0,max:0};let v=class extends q{constructor(){super(...arguments);this.enabled=!0;this.elevationMargin=5}};b.__decorate([k.property({type:Boolean})],v.prototype,"enabled", void 0);b.__decorate([k.property({type:Number})],v.prototype,"elevationMargin",void 0);v=b.__decorate([c.subclass("esri.views.3d.state.Constraints.CollisionConstraint")],v);a.TiltRange=t;a.earthAltitudeConstraint=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/constraints/ClipDistanceConstraint":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/RandomLCG ../../../core/has ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){a.ClipDistanceConstraint=class extends q.Clonable{constructor(){super(...arguments);this.mode="auto"}get near(){return this._get("near")}set near(c){this._set("near",c);c>=this._get("far")&&(this.far=c+1E-9);this.mode="manual"}castNear(c){return Math.max(1E-8,c)}get far(){return this._get("far")}set far(c){this._set("far",c);c<=this._get("near")&&(this.near=c-1E-9);this.mode="manual"}castFar(c){return Math.max(1E-8,c)}autoUpdate(c,e){"auto"===this.mode&&(this._get("near")!== c&&this._set("near",c),this._get("far")!==e&&this._set("far",e))}};b.__decorate([l.property({type:Number,value:1E-8})],a.ClipDistanceConstraint.prototype,"near",null);b.__decorate([p.cast("near")],a.ClipDistanceConstraint.prototype,"castNear",null);b.__decorate([l.property({type:Number,value:1E-8})],a.ClipDistanceConstraint.prototype,"far",null);b.__decorate([p.cast("far")],a.ClipDistanceConstraint.prototype,"castFar",null);b.__decorate([l.property({type:["auto","manual"]})],a.ClipDistanceConstraint.prototype, "mode",void 0);a.ClipDistanceConstraint=b.__decorate([f.subclass("esri.views.3d.constraints.ClipDistanceConstraint")],a.ClipDistanceConstraint);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/constraints/TiltConstraint":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/RandomLCG ../../../core/has ../../../core/accessorSupport/decorators/subclass ../state/Constraints".split(" "), function(a,b,q,l,p,k,h,f,c,e){var g=l.rad2deg(e.TiltRange.min),d=l.rad2deg(e.TiltRange.max);a.TiltConstraint=class extends q.Clonable{constructor(t){super(t);this.mode="auto"}get max(){return this._get("max")}set max(t){this._set("max",t);this.mode="manual"}castMax(t){return l.clamp(t,g,d)}autoUpdate(t){"auto"===this.mode&&this._get("max")!==t&&this._set("max",t)}};b.__decorate([p.property({type:["auto","manual"]})],a.TiltConstraint.prototype,"mode",void 0);b.__decorate([p.property({type:Number,value:d})], a.TiltConstraint.prototype,"max",null);b.__decorate([k.cast("max")],a.TiltConstraint.prototype,"castMax",null);a.TiltConstraint=b.__decorate([c.subclass("esri.views.3d.constraints.TiltConstraint")],a.TiltConstraint);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/SceneViewEnvironment":function(){define("../../../chunks/tslib.es6 ../../../core/compilerUtils ../../../core/handleUtils ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/ensureType ./lightingUtils ./SceneViewAtmosphere ./SunLighting ./VirtualLighting ../../../webscene/Environment ../../../webscene/SunLighting ../../../webscene/VirtualLighting".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){var m;t=m=class extends t{constructor(r){super(r);this.atmosphere=new e.SceneViewAtmosphere;this.lighting=this.castLighting();this.cachedCameraTrackingEnabled=null}destroy(){this.atmosphere.destroy()}static fromWebsceneEnvironment(r){r=r.cloneConstructProperties();return new m({...r,lighting:r.lighting?"virtual"===r.lighting.type?d.fromWebsceneLighting(r.lighting):g.fromWebsceneLighting(r.lighting):void 0})}castLighting(r){return this._convertLightingWithDestroy(r)}applyLighting(r){this.lighting= this._convertLightingWithDestroy(r)}_convertLightingWithDestroy(r){const n=this._convertLighting(r);n!==r&&this.addHandles(q.destroyHandle(n));return n}_convertLighting(r){return r?r instanceof g||r instanceof d?r:r instanceof w?this.lighting&&"virtual"!==this.lighting.type?this.lighting.cloneWithWebsceneLighting(r):new g({...r.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):r instanceof v?this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(r): new d({...r.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):f.ensureOneOfType(c.lightingTypes,r):new g}clone(){return new m({lighting:this.lighting.clone(),atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:l.clone(this.background)})}cloneWithWebsceneEnvironment(r){return new m({atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled, starsEnabled:this.starsEnabled,background:l.clone(this.background),...r.cloneConstructProperties(),lighting:this._getLighting(r)})}_getLighting(r){switch(r.lighting.type){case "sun":return this.lighting&&"sun"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(r.lighting):g.fromWebsceneLighting(r.lighting);case "virtual":return this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(r.lighting):d.fromWebsceneLighting(r.lighting);default:return b.neverReached(r.lighting), g.fromWebsceneLighting(r.lighting)}}};a.__decorate([p.property({type:e.SceneViewAtmosphere,json:{read:!1},nonNullable:!0})],t.prototype,"atmosphere",void 0);a.__decorate([p.property({nonNullable:!0})],t.prototype,"lighting",void 0);a.__decorate([k.cast("lighting")],t.prototype,"castLighting",null);return t=m=a.__decorate([h.subclass("esri.views.3d.environment.SceneViewEnvironment")],t)})},"esri/views/3d/environment/lightingUtils":function(){define(["exports","./SunLighting","./VirtualLighting"],function(a, b,q){a.lightingTypes={key:"type",defaultKeyValue:"sun",base:null,typeMap:{sun:b,virtual:q}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/SunLighting":function(){define("../../../chunks/tslib.es6 ../../../core/Evented ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../webscene/SunLighting".split(" "),function(a,b,q,l,p,k,h,f){var c;b= c=class extends b.EventedMixin(f){constructor(g){super(g);this.cameraTrackingEnabled=!0;this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0};g=(new Date).getFullYear();g=new Date("March 15, "+g+" 12:00:00 UTC");this._set("defaultDate",g);this._set("date",g)}get defaultDate(){return new Date(this._get("defaultDate").getTime())}static fromWebsceneLighting(g){return new c(g.cloneConstructProperties())}set defaultDate(g){const d=this._get("date")===this._get("defaultDate");g=new Date(g.getTime()); this._set("defaultDate",g);d&&this._set("date",g)}set date(g){null!=g&&(this.positionTimezoneInfo.autoUpdated=!1,this._set("date",new Date(g.getTime())))}autoUpdate(g,d){const t=c.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=d.hours;this.positionTimezoneInfo.minutes=d.minutes;this.positionTimezoneInfo.seconds=d.seconds;d=null;null!=g&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(g.getTime())?(d=this.defaultDate.getTime(),this._set("date",this.defaultDate)): (d=this.date&&this.date.getTime(),this._set("date",new Date(g.getTime()))));const w=c.calculateTimezoneOffset(this.positionTimezoneInfo);t!==w&&(e.target=this,e.timezoneOffset=w,this.emit("timezone-will-change",e),e.target=null);if(null!=g)return isNaN(g.getTime())||d!==g.getTime()}clone(){const g=this._get("date")===this._get("defaultDate"),d=new c({...this.cloneConstructProperties(),defaultDate:this.defaultDate,cameraTrackingEnabled:this.cameraTrackingEnabled});g&&d._set("date",d._get("defaultDate")); d.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated;d.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours;d.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes;d.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds;return d}cloneWithWebsceneLighting(g){const d=this.clone();null!=g.date&&(d.date=g.date);d.directShadowsEnabled=g.directShadowsEnabled;d.displayUTCOffset=g.displayUTCOffset;return d}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled}}}; a.__decorate([q.property({type:Boolean})],b.prototype,"cameraTrackingEnabled",void 0);a.__decorate([q.property({type:Date})],b.prototype,"defaultDate",null);a.__decorate([q.property({type:Date})],b.prototype,"date",null);b=c=a.__decorate([h.subclass("esri.views.3d.environment.SunLighting")],b);(function(g){g.calculateTimezoneOffset=function({hours:d,minutes:t,seconds:w}){return Math.round(d+t/60+w/3600)}})(b||={});const e={target:null,timezoneOffset:0};return b})},"esri/webscene/SunLighting":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/reader ../core/accessorSupport/decorators/subclass ../core/accessorSupport/decorators/writer".split(" "), function(a,b,q,l,p,k,h,f,c){var e;b=e=class extends b.JSONSupport{constructor(g){super(g);this.type="sun";this.date=null;this.directShadowsEnabled=!1;this.displayUTCOffset=null}readDate(g,d){return null!=d.datetime&&new Date(d.datetime)||null}writeDate(g,d,t){d[t]=g.getTime()}readDirectShadowsEnabled(g,d){return!!d.directShadows}writedirectShadowsEnabled(g,d,t){g&&(d[t]=g)}writeDisplayUTCOffset(g,d){null!=g&&(d.displayUTCOffset=g)}clone(){return new e(this.cloneConstructProperties())}cloneConstructProperties(){const g= {directShadowsEnabled:this.directShadowsEnabled,displayUTCOffset:null!=this.displayUTCOffset?this.displayUTCOffset:null};null!=this.date&&(g.date=new Date(this.date.getTime()));return g}};a.__decorate([q.property({readOnly:!0,type:["sun"],json:{write:!0}})],b.prototype,"type",void 0);a.__decorate([q.property({type:Date,json:{type:Number,write:{target:"datetime"}}})],b.prototype,"date",void 0);a.__decorate([h.reader("date",["datetime"])],b.prototype,"readDate",null);a.__decorate([c.writer("date")], b.prototype,"writeDate",null);a.__decorate([q.property({type:Boolean,json:{default:!1,write:{target:"directShadows"}}})],b.prototype,"directShadowsEnabled",void 0);a.__decorate([h.reader("directShadowsEnabled",["directShadows"])],b.prototype,"readDirectShadowsEnabled",null);a.__decorate([c.writer("directShadowsEnabled")],b.prototype,"writedirectShadowsEnabled",null);a.__decorate([q.property({type:Number,json:{write:!0}})],b.prototype,"displayUTCOffset",void 0);a.__decorate([c.writer("displayUTCOffset")], b.prototype,"writeDisplayUTCOffset",null);return b=e=a.__decorate([f.subclass("esri.webscene.SunLighting")],b)})},"esri/views/3d/environment/VirtualLighting":function(){define("../../../chunks/tslib.es6 ../../../core/Evented ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../webscene/VirtualLighting".split(" "),function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.EventedMixin(f){constructor(e){super(e); this.cameraTrackingEnabled=!0}clone(){return new c({...this.cloneConstructProperties(),cameraTrackingEnabled:this.cameraTrackingEnabled})}static fromWebsceneLighting(e){return new c(e.cloneConstructProperties())}cloneWithWebsceneLighting(e){const g=this.clone();g.directShadowsEnabled=e.directShadowsEnabled;return g}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled}}};a.__decorate([q.property({type:Boolean})],b.prototype,"cameraTrackingEnabled",void 0); return b=c=a.__decorate([h.subclass("esri.views.3d.environment.VirtualLighting")],b)})},"esri/webscene/VirtualLighting":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h){var f;b=f=class extends b.JSONSupport{constructor(c){super(c);this.type="virtual";this.directShadowsEnabled=!1}clone(){return new f(this.cloneConstructProperties())}cloneConstructProperties(){return{directShadowsEnabled:this.directShadowsEnabled}}}; a.__decorate([q.property({readOnly:!0,type:["virtual"],json:{write:!0}})],b.prototype,"type",void 0);a.__decorate([q.property({type:Boolean,json:{default:!1,name:"directShadows",write:!0}})],b.prototype,"directShadowsEnabled",void 0);return b=f=a.__decorate([h.subclass("esri.webscene.VirtualLighting")],b)})},"esri/views/3d/environment/SceneViewAtmosphere":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){var c;a.SceneViewAtmosphere=c=class extends q{set quality(e){["low","high"].includes(e)&&this._set("quality",e)}clone(){return new c({quality:this.quality})}};b.__decorate([l.property({type:["low","high"],value:"low"})],a.SceneViewAtmosphere.prototype,"quality",null);a.SceneViewAtmosphere=c=b.__decorate([f.subclass("esri.views.3d.environment.SceneViewAtmosphere")],a.SceneViewAtmosphere);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webscene/Environment":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/lang ../core/Logger ../core/accessorSupport/decorators/property ../core/has ../core/accessorSupport/decorators/subclass ../views/3d/environment/SunnyWeather ../views/3d/environment/weather ./lightingTypes ./SunLighting ./VirtualLighting ./background/utils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){var w;k=(v,m,r)=>({enabled:!r?.isPresentation});b=w=class extends b.JSONSupport{constructor(v){super(v);this.lighting=new g;this.background=null;this.starsEnabled=this.atmosphereEnabled=!0}set weather(v){c.validateWeatherType(v?.type,l.getLogger(this))&&this._set("weather",v)}clone(){return new w(this.cloneConstructProperties())}cloneConstructProperties(){return{lighting:this.lighting&&"virtual"===this.lighting.type?d.prototype.clone.call(this.lighting):g.prototype.clone.call(this.lighting), background:q.clone(this.background),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,weather:this.weather.clone()}}};a.__decorate([p.property({types:e.lightingTypes,nonNullable:!0,json:{write:!0}})],b.prototype,"lighting",void 0);a.__decorate([p.property(t.backgroundProperty)],b.prototype,"background",void 0);a.__decorate([p.property({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:k}}})],b.prototype,"atmosphereEnabled",void 0);a.__decorate([p.property({type:Boolean, nonNullable:!0,json:{write:{overridePolicy:k}}})],b.prototype,"starsEnabled",void 0);a.__decorate([p.property({types:c.weatherTypes,nonNullable:!0,json:{write:!0},value:new f})],b.prototype,"weather",null);return b=w=a.__decorate([h.subclass("esri.webscene.Environment")],b)})},"esri/views/3d/environment/SunnyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="sunny";this.cloudCover=.5}clone(){return new c({cloudCover:this.cloudCover})}};a.__decorate([h.enumeration({sunny:"sunny"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"cloudCover",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.SunnyWeather")],b)})},"esri/views/3d/environment/weather":function(){define("exports ./CloudyWeather ./FoggyWeather ./RainyWeather ./SnowyWeather ./SunnyWeather".split(" "), function(a,b,q,l,p,k){b={key:"type",base:k,typeMap:{sunny:k,cloudy:b,rainy:l,snowy:p,foggy:q}};const h=Object.keys(b.typeMap);a.cloudsHeight=1E5;a.validateWeatherType=function(f,c){return h.includes(f)?!0:(c.error(`"${f}" is not a valid weather type`),!1)};a.weatherHeightLimit=1E4;a.weatherTypes=b;a.weatherTypesArray=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="cloudy";this.cloudCover=.5}clone(){return new c({cloudCover:this.cloudCover})}};a.__decorate([h.enumeration({cloudy:"cloudy"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"cloudCover",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.CloudyWeather")],b)})},"esri/views/3d/environment/FoggyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="foggy";this.fogStrength=.5}clone(){return new c({fogStrength:this.fogStrength})}};a.__decorate([h.enumeration({foggy:"foggy"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"fogStrength",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.FoggyWeather")],b)})},"esri/views/3d/environment/RainyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="rainy";this.precipitation=this.cloudCover=.5}clone(){return new c({cloudCover:this.cloudCover,precipitation:this.precipitation})}};a.__decorate([h.enumeration({rainy:"rainy"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"cloudCover",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1}, json:{write:!0}})],b.prototype,"precipitation",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.RainyWeather")],b)})},"esri/views/3d/environment/SnowyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k, h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="snowy";this.precipitation=this.cloudCover=.5;this.snowCover="disabled"}clone(){return new c({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}};a.__decorate([h.enumeration({snowy:"snowy"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"cloudCover",void 0);a.__decorate([q.property({type:Number,nonNullable:!0, range:{min:0,max:1},json:{write:!0}})],b.prototype,"precipitation",void 0);a.__decorate([q.property({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],b.prototype,"snowCover",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.SnowyWeather")],b)})},"esri/webscene/lightingTypes":function(){define(["exports","./SunLighting","./VirtualLighting"],function(a,b,q){a.lightingTypes={key:"type",defaultKeyValue:"sun",base:null,typeMap:{sun:b,virtual:q}};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/webscene/background/utils":function(){define(["exports","./Background","./ColorBackground"],function(a,b,q){b={base:b,key:"type",typeMap:{color:q}};b={types:b,json:{read:function(l){return(p,k,h)=>{if(!p)return p;for(const f in l.typeMap)if(p.type===f)return k=new l.typeMap[f],k.read(p,h),k}}(b),write:{overridePolicy:(l,p,k)=>({enabled:!k?.isPresentation})}}};a.backgroundProperty=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webscene/background/Background":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h){b=class extends b.JSONSupport{constructor(f){super(f)}clone(){throw Error("Subclasses of Background should implement their own clone method.");}};a.__decorate([q.property({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0);return b=a.__decorate([h.subclass("esri.webscene.background.Background")],b)})},"esri/webscene/background/ColorBackground":function(){define("../../chunks/tslib.es6 ../../Color ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/enumeration ../../core/accessorSupport/decorators/subclass ../../symbols/support/materialUtils ./Background".split(" "), function(a,b,q,l,p,k,h,f,c,e){var g;l={...c.colorAndTransparencyProperty,nonNullable:!0};e=g=class extends e{constructor(d){super(d);this.type="color";this.color=new b([0,0,0,1])}clone(){return new g(this.cloneProperties())}cloneProperties(){return{color:this.color.clone()}}};a.__decorate([h.enumeration({color:"color"},{readOnly:!0})],e.prototype,"type",void 0);a.__decorate([q.property(l)],e.prototype,"color",void 0);return e=g=a.__decorate([f.subclass("esri.webscene.background.ColorBackground")], e)})},"esri/views/3d/environment/SceneViewEnvironmentManager":function(){define("exports ../../../chunks/tslib.es6 ../../../geometry ../../../core/Evented ../../../core/has ../../../core/maybe ../../../core/promiseUtils ../../../core/quantityUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection ../../../geometry/projection/projectPointToVector ../../../geometry/support/spatialReferenceUtils ../../ViewingMode ./EnvironmentRenderer ../support/earthUtils ../support/sunUtils ../webgl-engine/lib/Update ../webgl-engine/lighting/Lightsources ../../support/euclideanLengthMeasurementUtils ../../../geometry/SpatialReference".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D){a.SceneViewEnvironmentManager=class extends l.EventedAccessor{constructor(){super();this._referencePointUpdateDelay=200;this._referencePointUpdateInterval=3E3;this._referencePointUpdateDistThreshold=1E6;this._referencePosMapCoordsRequested=this._referencePosUpdateQuery=null;this._viewHandlesKey="viewHandles";this._referencePosResetPreserveAbsoluteTime=this._trackingEnabled=this._preserveAbsoluteDateTime=!1;this._referencePosMapCoords=this._referencePosUpdateTimer= null;this._mainLight=new B.MainLight;this._ambientLight=new B.AmbientLight;this._moonLight=new B.FillLight;this._disableWeather=this.disableQueries=!1;this._referencePositionGeographic=this._renderer=null;this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!((this.disableQueries||!this._referencePosUpdateQuery&&!this._referencePosMapCoordsRequested)&&!this._renderer?.updating)}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&& !this._disableWeather&&this._view?.state?.viewingMode===u.ViewingMode.Global&&n.isEarth(this._view.spatialReference)}get weatherVisible(){return this.weatherEnabled&&this._renderer?.weatherVisible}get referencePositionGeographic(){return this._referencePositionGeographic}connectView(O){if(!this._renderer){this._renderer=new x.EnvironmentRenderer({view:O});var L=()=>this._updateRenderParameters(),P=()=>this._cameraHandler();this.addHandles([c.watch(()=>O.environment.lighting,M=>this._updateLightingHandler(M), c.sync),c.watch(()=>"virtual"!==O.environment.lighting.type?O.environment.lighting.date:null,M=>this._lightingDateHandler(M),c.sync),c.watch(()=>O.stationary,()=>this._interactingStationaryHandler()),c.watch(()=>O.environment.lighting.directShadowsEnabled,L,c.sync),c.watch(()=>O.qualitySettings.ambientOcclusion,L,c.sync),c.watch(()=>O.qualitySettings.reflections,L,c.sync),c.watch(()=>O.spatialReference,()=>this._resetReferencePosition(!0),c.sync),c.watch(()=>O.environment.weather.type,()=>this._updateLighting(null, A.Update.Faded),c.sync),c.watch(()=>this.weatherEnabled,()=>this._updateLighting(null,A.Update.Faded),c.sync),c.watch(()=>O.viewingMode,()=>this._resetReferencePosition(!0),c.syncAndInitial),c.watch(()=>"virtual"!==O.environment.lighting.type?O.environment.lighting.cameraTrackingEnabled:!1,M=>this._updateCameraTracking(M),c.syncAndInitial),c.watch(()=>O.state.camera,P,c.syncAndInitial),c.watch(()=>this.disableQueries,P)],this._viewHandlesKey);this._updateRenderParameters();this._updateLighting(); this._cameraHandler();this.notifyChange("updating")}}disconnectView(){this.removeHandles(this._viewHandlesKey);this._resetReferencePosition();this._renderer=k.destroyMaybe(this._renderer)}_updateLightingHandler(O){this._updateCameraTracking("virtual"!==O.type?O.cameraTrackingEnabled:!1);this._lightingDateHandler("virtual"!==O.type?O.date:null);this._updateRenderParameters()}_updateCameraTracking(O){(this._trackingEnabled=O)?this._cameraHandler():(O=this._view.environment.lighting,"virtual"!==O?.type&& (O.positionTimezoneInfo.autoUpdated=!1))}_lightingDateHandler(O){const L=this._view.environment.lighting;if("virtual"===L?.type)this._updateLighting();else if(O){if(!L.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;if(!m.canProjectWithoutEngine(this._view.spatialReference,D.WGS84)){var P=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(P)){this._requestReferencePositionUpdate(P);return}}this._preupdateTracking(O);null!=this._referencePositionGeographic&& (P=y.positionToTimezoneInfo(this._referencePositionGeographic,E),null!=P&&(L.autoUpdate(null,P),this._trackingEnabled&&(L.positionTimezoneInfo.autoUpdated=!0)))}this._updateLighting(O)}}_preupdateTracking(O){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(O)}_cameraHandler(O=null){var L=this._view;L.ready&&(L=L.stateManager.camera)&&(this._cameraHandlerClientSide(L,O)||this._cameraHandlerServerSide(L))}_cameraHandlerClientSide(O, L){const P=n.isEarth(this._view.spatialReference);if(P&&!m.canProjectWithoutEngine(this._view.spatialReference,D.WGS84))return"virtual"===this._view.environment.lighting.type&&this._updateLighting(),!1;O=O.position;this._referencePositionGeographic??(this._referencePositionGeographic=v.create());P?r.projectPointToVector(O,this._referencePositionGeographic,D.WGS84):w.set(this._referencePositionGeographic,O.longitude??0,O.latitude??0,O.z??0);this.notifyChange("referencePositionGeographic");this._autoUpdateTimezone(this._referencePositionGeographic, L)||this._updateLighting(L);return!0}_cameraHandlerServerSide(O){O=O.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(O))&&this._requestReferencePositionUpdate(O,!0);this._view.mapCoordsHelper&&this._referencePositionGeographic&&(this._referencePositionGeographic[2]=(O.z??0)*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLighting(O, L=A.Update.Immediate){var P=this._view;O=O||("virtual"===P.environment.lighting.type?null:P.environment.lighting.date);var M=this._referencePositionGeographic;const K=M?F:H;var J=this.weatherVisible?P.environment.weather.type:"disabled";null!=M?z.computeColorAndIntensity(O,M,P.state.viewingMode,J,P.state.camera,K):"virtual"===P.environment.lighting.type&&z.computeVirtualLightDirection(P.state.camera,P.state.viewingMode,K.direct.directionToLightSource);O=this._mainLight;P=K.direct;w.scale(O.intensity, P.color,P.intensity*Math.PI);w.copy(O.direction,P.directionToLightSource);O.specularStrength=K.specularStrength;O.environmentStrength=K.environmentStrength;M=this._ambientLight;w.scale(M.intensity,K.ambient.color,K.ambient.intensity);J=this._moonLight;w.lerp(J.intensity,G,I,K.globalFactor);w.scale(J.intensity,J.intensity,(1-.5*K.globalFactor)*(1-.4*K.noonFactor*(1-K.globalFactor)));w.copy(J.direction,P.directionToLightSource);this._renderer.updateLightSources([O,M,J],K.noonFactor,K.globalFactor,L); this._updateRenderParameters()}_autoUpdateTimezone(O,L=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==O)return!1;const P=N;P.setTime((L||this._view.environment.lighting.date).getTime());O=y.positionToTimezoneInfo(O,E);if(null==O)return!1;var M=this._view.environment.lighting.positionTimezoneInfo;if(!M.autoUpdated)M=O;else if(M.hours===O.hours&&M.minutes===O.minutes&&M.seconds===O.seconds)return!1;const K=P.getUTCHours()-(O.hours- M.hours),J=P.getUTCMinutes()-(O.minutes-M.minutes);M=P.getUTCSeconds()-(O.seconds-M.seconds);P.setUTCHours(K);P.setUTCMinutes(J);P.setUTCSeconds(M);return L?!1:this._view.environment.lighting.autoUpdate(P,O)}_updateRenderParameters(){const O=this._view._stage;if(O){var L=null==this._referencePositionGeographic||z.computeShadowsEnabled(this._referencePositionGeographic[2],this._view.state.viewingMode);O.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&L,environment:this._view.environment, weatherVisible:this._view.environmentManager.weatherVisible,qualitySettings:this._view.qualitySettings})}}_resetReferencePosition(O=!1){this._cancelReferencePosUpdates();this._referencePositionGeographic=this._referencePosResetPreserveAbsoluteTime=this._referencePosMapCoordsRequested=this._referencePosMapCoords=null;this.notifyChange("updating");O&&this._cameraHandler()}_requestReferencePositionUpdate(O,L=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(O): this._referencePosMapCoordsRequested=O.clone(),this._referencePosResetPreserveAbsoluteTime=!!L,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const P=this._referencePosUpdateQuery=h.after(this._referencePointUpdateDelay).then(()=>{if(this._referencePosUpdateQuery===P)return this._doReferencePositionUpdateQuery(()=>this._referencePosUpdateQuery!==P)}).catch(K=>{"mapcoordshelper:missing-geometry-service"===K.name&&(this.disableQueries=!0)}).then(()=>{this._referencePosUpdateQuery=== P&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))}),M=this._referencePosUpdateTimer=h.after(this._referencePointUpdateInterval).then(()=>{this._referencePosUpdateTimer===M&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())});this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(O){this._referencePosResetPreserveAbsoluteTime&& (this._preserveAbsoluteDateTime=!1);this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone();this._referencePosMapCoordsRequested=this._referencePosResetPreserveAbsoluteTime=null;const L=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);O()||isNaN(L[0])||isNaN(L[1])||(O=(this._referencePosMapCoords.z??0)*this._view.mapCoordsHelper.unitInMeters,this._referencePositionGeographic? w.set(this._referencePositionGeographic,L[0],L[1],O):this._referencePositionGeographic=v.fromValues(L[0],L[1],O),this._referencePosChanged())}_executePendingReferencePositionUpdate(){const O=this._referencePosMapCoordsRequested;O&&this._requestReferencePositionUpdate(O,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLighting():this._autoUpdateTimezone(this._referencePositionGeographic)||this._updateLighting();this.notifyChange("referencePositionGeographic")}_exceedsReferencePosDistThreshold(O){const L= this._referencePosMapCoords;if(null==L)return!0;O=C.euclideanDirectDistanceBetweenPoints(L,O);return null==O?!0:f.toUnit(O,"meters").value>this._referencePointUpdateDistThreshold}_cancelReferencePosUpdates(){const O=!!this._referencePosUpdateQuery;this._referencePosUpdateTimer=this._referencePosUpdateQuery=null;return O}get test(){}};b.__decorate([e.property({type:Boolean,readOnly:!0})],a.SceneViewEnvironmentManager.prototype,"updating",null);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype, "disableQueries",void 0);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"_disableWeather",void 0);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"weatherEnabled",null);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"weatherVisible",null);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"referencePositionGeographic",null);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"_renderer",void 0);b.__decorate([e.property()], a.SceneViewEnvironmentManager.prototype,"_referencePositionGeographic",void 0);a.SceneViewEnvironmentManager=b.__decorate([t.subclass("esri.views.3d.environment.SceneViewEnvironmentManager")],a.SceneViewEnvironmentManager);const F=new z.ColorAndIntensity,H=new z.ColorAndIntensity,N=new Date,E={hours:0,minutes:0,seconds:0},G=v.fromValues(.22,.22,.33),I=v.fromValues(.22,.22,.22);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/quantityUtils":function(){define(["exports","./unitUtils"], function(a,b){function q(w,v){return{type:b.unitType(v),value:w,unit:v}}function l(w,v){return{type:b.unitType(v),value:w,unit:v}}function p(w,v){return{type:b.unitType(v),value:w,unit:v}}function k(w,v,m="arithmetic"){return{type:b.unitType(v),value:w,unit:v,rotationType:m}}function h(w,v){const m=f(w,v);return"angle"===w.type?k(m,v,w.rotationType):q(m,v)}function f(w,v){return b.convertUnit(w.value,w.unit,v)}const c=l(0,"meters"),e=p(0,"square-meters"),g=k(0,"radians"),d=k(0,"degrees"),t=k(0,"degrees", "geographic");a.convertRotationType=function(w,v,m){if(v===m)return w;switch(m){case "arithmetic":case "geographic":return-w+90}};a.createAngle=k;a.createArea=p;a.createLength=l;a.createQuantity=q;a.createScalar=function(w){return{value:w}};a.isBaseUnit=function(w){return b.isBaseUnit(w.unit)};a.max=function(w,v){return null==w?v:null==v?w:w.value>b.convertUnit(v.value,v.unit,w.unit)?w:v};a.min=function(w,v){return null==w?v:null==v?w:w.value!(null===this._atmosphere&&null===this._stars)],[E.RenderSlot.TRANSPARENT_ENVIRONMENT,()=>null!==this._atmosphere]]);this._atmosphere=this._context=null;this._oldWeatherParameters=new I;this._newWeatherParameters=new I;this._fadedWeatherParameters=new I;this._weatherParameters=this._newWeatherParameters}initialize(){this.view._stage.addRenderPlugin(this)}destroy(){this.removeHandles(); this.uninitializeRenderContext();null!=this.view?._stage&&this.view._stage.removeRenderPlugin(this);this._set("view",null)}get atmosphere(){return this._atmosphere}get _atmosphereType(){return null!=this.atmosphere?this.atmosphere.type:m.AtmosphereType.None}consumes(){return this._atmosphereType===m.AtmosphereType.Realistic?N.ConsumesDepth:N.ConsumesNone}updateAnimation(P){return null!=this._precipitation?this._precipitation.update(P):!1}get updating(){return null!=this._stars&&this._stars.updating|| null!=this._clouds&&this._clouds.running}get weatherVisible(){return g.length(this.view.state.camera.eye)-t.getReferenceEllipsoid(this.view.spatialReference).radius<=H.weatherHeightLimit}get usedMemory(){return this._clouds?.usedMemory??0}get _stars(){const P=this.view,M=P.environment?.starsEnabled??!1,K=this._get("_stars");return M&&null!=this._context?null!=K?K:new F.Stars({view:P,requestRender:()=>this._setNeedsRender()}):(p.destroyMaybe(K),null)}get _precipitation(){const P=this._get("_precipitation"); if(!this._precipitationEnabled||null==this._context)return p.destroyMaybe(P),null;const M=this.view,K=this._context;if(null!=P&&P.context===K)return P;p.destroyMaybe(P);return new D.Precipitation({context:K,view:M})}get _clouds(){const P=this._get("_clouds");if(!this.weatherEnabled||null==this._context)return p.destroyMaybe(P),null;if(null!=P)return P;const M=this.view,K=this._context;p.destroyMaybe(P);return new x.CloudsGenerator({context:K,view:M,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const P= this._get("_cloudsComposition");if(!this.weatherEnabled||null==this._context)return p.destroyMaybe(P),null;const M=this.view.state.viewingMode,K=this._context.renderContext.rctx,J=t.getReferenceEllipsoid(this.view.spatialReference).radius;if(null!=P&&P.viewingMode===M&&P.planetRadius===J)return P;p.destroyMaybe(P);return new n.CloudsComposition({rctx:K,viewingMode:M,planetRadius:J,requestRender:()=>this._setNeedsRender()})}get _fog(){const P=this._get("_fog");return this.weatherEnabled&&null!=this._context? null!=P?P:new A.Fog({context:this._context,view:this.view,rctx:this._context.renderContext.rctx,viewingMode:this.view.state.viewingMode}):(p.destroyMaybe(P),null)}get weatherEnabled(){return!!this.view?.environmentManager?.weatherEnabled}get _precipitationEnabled(){return this.weatherEnabled&&("rainy"===this.view.environment.weather.type||"snowy"===this.view.environment.weather.type)}initializeRenderContext(P=null){this._context=P;P=()=>this._setNeedsRender();this.addHandles([k.watch(()=>({viewingMode:this.view.state.viewingMode, enabled:this.view.environment.atmosphereEnabled}),M=>this._updateAtmosphere(M),k.syncAndInitial),k.watch(()=>this._stars,P),k.watch(()=>this._precipitation,P),k.watch(()=>this._clouds,()=>this._updateWeather(),k.initial),k.watch(()=>this._fog,()=>this._updateFogHaze(),k.initial),k.watch(()=>this.view.state.mode,()=>this._setNeedsRender(),k.sync),k.watch(()=>this._weatherUpdateParameters,()=>{this._updateWeather();this._updateFogHaze()},k.syncAndInitial)])}uninitializeRenderContext(){this._context= null;this._atmosphere=p.destroyMaybe(this._atmosphere);this._set("_stars",p.destroyMaybe(this._stars));this._set("_precipitation",p.destroyMaybe(this._precipitation));this._set("_clouds",p.destroyMaybe(this._clouds));this._set("_cloudsComposition",p.destroyMaybe(this._cloudsComposition));this._set("_fog",p.destroyMaybe(this._fog))}prepareRender(P){P.bindParameters.cloudsFade.data=u.isReadyCloudsData(this._clouds)?this._clouds:null;"local"!==this.view.viewingMode&&null!=P.bindParameters.cloudsFade.data?.cubeMap&& (this._updateWeatherFading(P.bindParameters,P.time),P.bindParameters.cloudsFade.renderingStage===u.CloudsRenderingStages.FINISHED&&null!=this._clouds&&0===this._clouds.coverage&&!1===this._clouds.running&&(this._clouds.destroyFrameBufferCube(),P.bindParameters.cloudsFade.data=null))}renderNode(P){switch(P.bindParameters.slot){case E.RenderSlot.OPAQUE_ENVIRONMENT:this._stars?.render(P);null!=this.atmosphere&&(this.atmosphere.render(P,this.view?._stage?.renderer?.fullResolutionAtmosphere),this._cloudsComposition&& null!=P.bindParameters.cloudsFade.data&&(this.weatherVisible&&null!=this._clouds&&this._clouds.updateWeatherTile(),this._cloudsComposition.render(P)),P.bindParameters.cloudsFade.isFading&&this._context&&null!=P.bindParameters.cloudsFade.data?.cubeMap&&this._context.requestRender());break;case E.RenderSlot.TRANSPARENT_ENVIRONMENT:if(null!=this.atmosphere&&(this.atmosphere.renderHaze(P,this._weatherParameters.hazeAmount,this.view?._stage?.renderer?.fullResolutionAtmosphere),0 this._view?.basemapTerrain?.rootTileElevationBounds,()=>this._view?.basemapTerrain?this._updateRootTileElevationBounds():null),p.watch(()=>this._view?.basemapTerrain?.visibleElevationBounds,()=>this._view?.basemapTerrain?this._updateVisibleElevationBounds():null),p.watch(()=>this._view?.environment.background,D=>{D=D instanceof z?b.unitRGBAFromColor(D.color):c.ZEROS;h.set(this._passParameters.backgroundColor,D[0]*D[3],D[1]*D[3],D[2]*D[3])},p.syncAndInitial)]);C=new w.ChapmanAtmosphereTechniqueConfiguration; C.haze=!1;this._atmosphereTechnique=this._context.techniques.acquire(t.ChapmanAtmosphereTechnique,C);this._compositingTechnique=this._context.techniques.acquire(x.AtmosphereCompositingTechnique,C);C.haze=!0;this._atmosphereHazeTechnique=this._context.techniques.acquire(t.ChapmanAtmosphereTechnique,C);this._compositingHazeTechnique=this._context.techniques.acquire(x.AtmosphereCompositingTechnique,C);C.reduced=!0;C.haze=!1;this._atmosphereReducedTechnique=this._context.techniques.acquire(t.ChapmanAtmosphereTechnique, C);C.haze=!0;this._atmosphereHazeReducedTechnique=this._context.techniques.acquire(t.ChapmanAtmosphereTechnique,C);this._vao=r.createQuadVAO(B,m.Pos2Tex)}destroy(){this._handles.destroy();this._compositingTechnique.release();this._compositingHazeTechnique.release();this._atmosphereTechnique.release();this._atmosphereHazeTechnique.release();this._atmosphereReducedTechnique.release();this._atmosphereHazeReducedTechnique.release();this._vao.dispose()}render(B,C){this._render(B,C?this._atmosphereTechnique: this._atmosphereReducedTechnique,C,!1)}renderHaze(B,C,D){this._fadeHaze=C;this._render(B,D?this._atmosphereHazeTechnique:this._atmosphereHazeReducedTechnique,D,!0)}_render(B,C,D,F){const H=B.bindParameters.mainDepth;if(H){this._update(B.bindParameters.camera);this._passParameters.depthTexture=H;var N=B.rctx.bindTechnique(C,B.bindParameters,this._passParameters);C=B.offscreenRenderingHelper;if(D)C.renderDepthDetached(()=>this._renderCommon(N,B));else{D=B.rctx.getViewport();var E=h.length(B.bindParameters.camera.eye)- e.earth.radius;if(Ethis._renderCommon(N, B),[0,0,0,1],v.ColorFormat.RGBA,null,E,G);B.rctx.setViewport(D.x,D.y,D.width,D.height);this._compositingPassParameters.color=E.getTexture();this._compositingPassParameters.depth=H;B.rctx.bindTechnique(F?this._compositingHazeTechnique:this._compositingTechnique,B.bindParameters,this._compositingPassParameters);C.renderDepthDetached(()=>B.rctx.screen.draw());E.release()}}}_renderCommon(B,C){null!=this._vao&&(C.rctx.bindVAO(this._vao),B.assertCompatibleVertexAttributeLocations(this._vao),C.rctx.drawArrays(y.PrimitiveType.TRIANGLE_STRIP, 0,4))}_updateRootTileElevationBounds(){const B=this._view.basemapTerrain.rootTileElevationBounds.min;B!==this._rootTileElevationMin&&(this._rootTileElevationMin=B,this._lowerBoundEarthRadius=e.earth.radius,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const B=(e.earth.radius+this._view.basemapTerrain.visibleElevationBounds.min)*Math.cos(Math.PI/16/16);BQ?Math.PI:Math.acos(Q)}function O(J){return"vec2("+J[0]+", "+J[1]+")"}function L(J, R){return J[0]===R[0]&&J[1]===R[1]}function P(J,R){const Q=J[0];J=J[1];const W=R[0];R=R[1];const S=b.getEpsilon();return Math.abs(Q-W)<=S*Math.max(1,Math.abs(Q),Math.abs(W))&&Math.abs(J-R)<=S*Math.max(1,Math.abs(J),Math.abs(R))}function M(J,R,Q,W,S){let V=R[0]-Q[0];Q=R[1]-Q[1];S=(W[0]*V+W[1]*Q)*(S-1);V=W[0]*S;Q=W[1]*S;J[0]=R[0]+V;J[1]=R[1]+Q;return J}const K=Object.freeze(Object.defineProperty({__proto__:null,add:p,angle:I,ceil:c,copy:q,cross:B,dist:m,distance:m,div:f,divide:f,dot:A,equals:P,exactEquals:L, floor:e,inverse:y,len:n,length:n,lerp:C,max:d,min:g,mul:h,multiply:h,negate:x,normalize:z,projectAndScale:M,random:D,rotate:G,round:t,scale:w,scaleAndAdd:v,set:l,sqrDist:r,sqrLen:u,squaredDistance:r,squaredLength:u,str:O,sub:k,subtract:k,transformMat2:F,transformMat2d:H,transformMat3:N,transformMat4:E},Symbol.toStringTag,{value:"Module"}));a.add=p;a.angle=I;a.ceil=c;a.copy=q;a.cross=B;a.dist=m;a.distance=m;a.div=f;a.divide=f;a.dot=A;a.equals=P;a.exactEquals=L;a.floor=e;a.inverse=y;a.len=n;a.length= n;a.lerp=C;a.max=d;a.min=g;a.mul=h;a.multiply=h;a.negate=x;a.normalize=z;a.projectAndScale=M;a.random=D;a.rotate=G;a.round=t;a.scale=w;a.scaleAndAdd=v;a.set=l;a.sqrDist=r;a.sqrLen=u;a.squaredDistance=r;a.squaredLength=u;a.str=O;a.sub=k;a.subtract=k;a.transformMat2=F;a.transformMat2d=H;a.transformMat3=N;a.transformMat4=E;a.vec2=K;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/atmosphereUtils":function(){define(["exports","../../../core/mathUtils"],function(a, b){a.atmosphereHeight=1E5;a.computeInnerAltitudeFade=function(q){return b.clamp((q-1E5)/9E5,0,1)};a.innerAtmosphereDepth=1E4;a.rayLeighScaleHeight=.085;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/ChapmanAtmosphereTechnique":function(){define("require exports ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../chunks/ChapmanAtmosphere.glsl ../webgl-engine/core/shaderModules/interfaces ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w extends h.NoParameters{constructor(){super(...arguments);this.heightParameters=p.create();this.radii=q.create();this.altitudeFade=this.innerFadeDistance=0;this.hazeStrength=1;this.renderScale=q.create();this.backgroundColor=l.create()}}class v extends c.ShaderTechnique{initializeProgram(m){return new g.Program(m.rctx,v.shader.get().build(this.configuration),e.Default3D)}initializePipeline(){return this.configuration.reduced?t.makePipelineState({blending:t.simpleBlendingParams(d.BlendFactor.ONE, d.BlendFactor.ZERO),depthTest:{func:d.CompareFunction.ALWAYS},colorWrite:t.defaultColorWriteParams}):this.configuration.haze?t.makePipelineState({blending:t.separateBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ZERO,d.BlendFactor.ONE_MINUS_SRC_COLOR,d.BlendFactor.ONE),colorWrite:t.defaultColorWriteParams}):t.makePipelineState({blending:t.simpleBlendingParams(d.BlendFactor.SRC_ALPHA,d.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:{func:d.CompareFunction.LEQUAL},colorWrite:t.defaultColorWriteParams})}} v.shader=new f.ReloadableShaderModule(k.ChapmanAtmosphere,()=>new Promise((m,r)=>a(["./ChapmanAtmosphere.glsl"],m,r)));b.ChapmanAtmospherePassParameters=w;b.ChapmanAtmosphereTechnique=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ChapmanAtmosphere.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/environment/atmosphereUtils ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(B){const C=new m.ShaderBuilder;C.attributes.add(n.VertexAttribute.POSITION,"vec2");C.include(k.TextureCoordinateAttribute,{textureCoordinateType:k.TextureCoordinateAttributeType.Default});C.varyings.add("worldRay","vec3");C.varyings.add("eyeDir","vec3");const {vertex:D,fragment:F}=C;D.uniforms.add(new v.Matrix4PassUniform("inverseProjectionMatrix",(H,N)=>N.camera.inverseProjectionMatrix),new v.Matrix4PassUniform("inverseViewMatrix",(H,N)=>b.invertOrIdentity(A, N.camera.viewMatrix)));D.code.add(w.glsl`void main(void) { vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1, 1)).xyz; eyeDir = posViewNear; worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz; forwardTextureCoordinates(); gl_Position = vec4(position, 1, 1); }`);F.uniforms.add(new g.Float3PassUniform("backgroundColor",H=>H.backgroundColor),new e.Float2PassUniform("radii",H=>H.radii),new g.Float3PassUniform("cameraPosition",(H,N)=>N.camera.eye),new d.Float4PassUniform("heightParameters",H=>H.heightParameters),new t.FloatPassUniform("innerFadeDistance",H=>H.innerFadeDistance),new t.FloatPassUniform("altitudeFade",H=>H.altitudeFade),new r.Texture2DPassUniform("depthTexture",H=>H.depthTexture),new t.FloatPassUniform("hazeStrength",H=>H.hazeStrength));F.constants.add("betaRayleigh", "vec3",x);F.constants.add("betaCombined","vec3",z);F.constants.add("betaMie","float",3.996E-6);F.constants.add("scaleHeight","float",p.rayLeighScaleHeight*p.atmosphereHeight);c.addMainLightDirection(F);C.include(f.Gamma);B.haze&&F.include(h.ReadDepth);F.code.add(w.glsl`vec2 sphereIntersect(vec3 start, vec3 dir, float radius, bool planet) { float a = dot(dir, dir); float b = 2.0 * dot(dir, start); float c = planet ? heightParameters[1] - radius * radius : heightParameters[2]; float d = (b * b) - 4.0 * a * c; if (d < 0.0) { return vec2(1e5, -1e5); } return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a)); }`);F.code.add(w.glsl`float chapmanApproximation(float X, float h, float cosZenith) { float c = sqrt(X + h); float cExpH = c * exp(-h); if (cosZenith >= 0.0) { return cExpH / (c * cosZenith + 1.0); } else { float x0 = sqrt(1.0 - cosZenith * cosZenith) * (X + h); float c0 = sqrt(x0); return 2.0 * c0 * exp(X - x0) - cExpH / (1.0 - c * cosZenith); } }`);F.code.add(w.glsl`float getOpticalDepth(vec3 position, vec3 dir, float h) { return scaleHeight * chapmanApproximation(radii[0] / scaleHeight, h, dot(normalize(position), dir)); }`);F.code.add(w.glsl` const int STEPS = 6; vec3 getAtmosphereColour(vec3 cameraPos, vec3 rayDir, vec3 lightDir, float terrainDepth) { float reducedPlanetRadius = radii[0] - 20000.0; vec2 rayPlanetIntersect = sphereIntersect(cameraPos, rayDir, reducedPlanetRadius, true); vec2 rayAtmosphereIntersect = sphereIntersect(cameraPos, rayDir, radii[1], false); bool hitsAtmosphere = (rayAtmosphereIntersect.x <= rayAtmosphereIntersect.y) && rayAtmosphereIntersect.x > 0.0; bool insideAtmosphere = heightParameters[0] < radii[1]; if (!(hitsAtmosphere || insideAtmosphere)) { return vec3(0); } bool hitsPlanet = (rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.x > 0.0; float start = insideAtmosphere ? 0.0 : rayAtmosphereIntersect.x; if (heightParameters[0] < reducedPlanetRadius) { // Long light rays from the night side of the planet lead to numerical instability // Do not render the atmosphere in such cases if (dot(rayDir, normalize(cameraPos)) < -0.025) { return vec3(0); } start = rayPlanetIntersect.y; } float end = hitsPlanet ? rayPlanetIntersect.x : rayAtmosphereIntersect.y; float maxEnd = end; ${B.haze?w.glsl`if (terrainDepth != -1.0) { end = terrainDepth; }`:""} vec3 samplePoint = cameraPos + rayDir * end; float multiplier = hitsPlanet ? -1.0 : 1.0; vec3 scattering = vec3(0); float scaleFract = (length(samplePoint) - radii[0]) / scaleHeight; float lastOpticalDepth = getOpticalDepth(samplePoint, rayDir, scaleFract); float stepSize = (end - start) / float(STEPS); for (int i = 0; i < STEPS; i++) { samplePoint -= stepSize * rayDir; scaleFract = (length(samplePoint) - radii[0]) / scaleHeight; float opticalDepth = multiplier * getOpticalDepth(samplePoint, rayDir * multiplier, scaleFract); if (i > 0) { scattering *= ${B.haze?"":w.glsl`mix(2.5, 1.0, clamp((length(cameraPos) - radii[0]) / 50e3, 0.0, 1.0)) * `} exp(-(mix(betaCombined, betaRayleigh, 0.5) + betaMie) * max(0.0, (opticalDepth - lastOpticalDepth))); } if (dot(normalize(samplePoint), lightDir) > -0.3) { float scale = exp(-scaleFract); float lightDepth = getOpticalDepth(samplePoint, lightDir, scaleFract); scattering += scale * exp(-(betaCombined + betaMie) * lightDepth); ${B.haze?"":w.glsl`scattering += scale * exp(-(0.25 * betaCombined ) * lightDepth);`} } lastOpticalDepth = opticalDepth; } float mu = dot(rayDir, lightDir); float mumu = 1.0 + mu * mu; float phaseRayleigh = 0.0596831 * mumu; ${B.haze?w.glsl`return 3.0 * scattering * stepSize * phaseRayleigh * betaRayleigh;`:w.glsl` const float g = 0.8; const float gg = g * g; float phaseMie = end == maxEnd ? 0.1193662 * ((1.0 - gg) * mumu) / (pow(1.0 + gg - 2.0 * mu * g, 1.5) * (2.0 + gg)) : 0.0; phaseMie = clamp(phaseMie, 0.0, 128.0); return 3.0 * scattering * stepSize * (phaseRayleigh * betaRayleigh + 0.025 * phaseMie * betaMie);`} } ${B.haze?"":w.glsl` vec4 applyUndergroundAtmosphere(vec3 rayDir, vec3 lightDirection, vec4 fragColor) { vec2 rayPlanetIntersect = sphereIntersect(cameraPosition, rayDir, radii[0], true); if (!((rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.y > 0.0)) { return fragColor; } float lightAngle = dot(lightDirection, normalize(cameraPosition + rayDir * max(0.0, rayPlanetIntersect.x))); vec4 surfaceColor = vec4(vec3(max(0.0, (smoothstep(-1.0, 0.8, 2.0 * lightAngle)))), 1.0 - altitudeFade); float relDist = (rayPlanetIntersect.y - max(0.0, rayPlanetIntersect.x)) / innerFadeDistance; if (relDist > 1.0) { return surfaceColor; } return mix(fragColor, surfaceColor, smoothstep(0.0, 1.0, relDist * relDist)); } float getGlow(float dist, float radius, float intensity) { return pow(radius / max(dist, 1e-6), intensity); } vec3 getSun(vec3 cameraPos, vec3 rayDir, vec3 lightDir){ // Get the amount of atmosphere between camera and the Sun along the view ray float scaleFract = (length(cameraPos) - radii[0]) / scaleHeight; float sunOpticalDepth = getOpticalDepth(cameraPos, rayDir, max(scaleFract, 0.0)); // Find the amount of light that remains after travelling through the atmosphere from the Sun along the view ray // This will make the colour of the Sun reddish on the horizon and white from space vec3 sunTransmittance = exp(-(mix(betaCombined, betaRayleigh, 0.5)) * max(0.0, sunOpticalDepth)); // Alignment of light direction and view ray float mu = clamp(dot(rayDir, lightDir), 0.0, 1.0); // Draw the Sun as a bright disc float sunDisc = 256.0 * smoothstep(0.0, 128.0, clamp(getGlow(1.0 - mu, 3e-5, 3.0), 0.0, 128.0)); return normalize(sunTransmittance) * sunDisc; }`} ${B.haze&&B.reduced?w.glsl` float getDepth(vec2 uv){ return linearDepthFromTexture(depthTexture, uv); } float textureBilinear(vec2 uv) { // Information about the high-resolution depth texture vec2 depthTextureSize = vec2(textureSize(depthTexture, 0)); vec2 texelSize = 1.0 / depthTextureSize; // The uv inside the upper right pixel - of the tile of 4 pixels - // that the atmosphere uv maps to in the depth texture vec2 depthUV = (uv * depthTextureSize) - vec2(0.5); // Relative distance of the uv coordinates inside the depth texture pixel vec2 f = fract(depthUV); // Snap to the centre of the depth texture pixel vec2 snapUV = (floor(depthUV) + vec2(0.5)) / depthTextureSize; // Read the depth texture pixel and its three neighbours float d0 = getDepth(snapUV); float d1 = getDepth(snapUV + vec2(texelSize.x, 0.0)); float d2 = getDepth(snapUV + vec2(0.0, texelSize.y)); float d3 = getDepth(snapUV + texelSize); // Return the bilinearly interpolated value of the neighbouring pixels based // on the sample position in the depth texture pixel return mix(mix(d0, d1, f.x), mix(d2, d3, f.x), f.y); } `:""} vec3 tonemapACES(vec3 x) { return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); } void main() { vec3 rayDir = normalize(worldRay); float terrainDepth = -1.0; ${B.haze?w.glsl` float depthSample = texture(depthTexture, vuv0).r; if (depthSample != 1.0) { vec3 cameraSpaceRay = normalize(eyeDir); cameraSpaceRay /= cameraSpaceRay.z; ${B.reduced?w.glsl`cameraSpaceRay *= -textureBilinear(vuv0);`:w.glsl`cameraSpaceRay *= -linearDepthFromTexture(depthTexture, vuv0);`} terrainDepth = max(0.0, length(cameraSpaceRay)); }else{ discard; } `:w.glsl`${B.reduced?"":w.glsl` float depthSample = texture(depthTexture, vuv0).r; if (depthSample != 1.0) { fragColor = vec4(0); return; }`}`} ${B.haze?w.glsl` vec3 col = vec3(0); float fadeOut = smoothstep(-10000.0, -15000.0, heightParameters[0] - radii[0]); if(depthSample != 1.0){ col = (1.0 - fadeOut) * hazeStrength * getAtmosphereColour(cameraPosition, rayDir, mainLightDirection, terrainDepth); } // Alpha is ignored for haze blending float alpha = 1.0; `:w.glsl` vec3 col = linearizeGamma(backgroundColor); col += getAtmosphereColour(cameraPosition, rayDir, mainLightDirection, terrainDepth); col += getSun(cameraPosition, rayDir, mainLightDirection); float alpha = smoothstep(0.0, mix(0.15, 0.01, heightParameters[3]), length(col));`} col = tonemapACES(col); fragColor = delinearizeGamma(vec4(col, alpha)); ${B.haze?"":w.glsl`fragColor = applyUndergroundAtmosphere(rayDir, mainLightDirection, fragColor);`} } `);return C}const x=l.fromValues(parseFloat(Number(5.802E-6).toFixed(6)),parseFloat(Number(1.3558E-5).toFixed(6)),parseFloat(Number(3.31E-5).toFixed(6))),y=l.fromValues(3*parseFloat(Number(6.5E-7).toFixed(6)),3*parseFloat(Number(1.881E-6).toFixed(6)),3*parseFloat(Number(8.5E-8).toFixed(6))),z=l.fromValues(parseFloat(Number(x[0]+y[0]).toFixed(6)),parseFloat(Number(x[1]+y[1]).toFixed(6)),parseFloat(Number(x[2]+y[2]).toFixed(6))),A=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,betaRayleigh:x, build:u},Symbol.toStringTag,{value:"Module"}));a.ChapmanAtmosphere=q;a.betaRayleigh=x;a.build=u})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl":function(){define(["exports","../../../../../../core/compilerUtils","../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q,l){a.TextureCoordinateAttributeType=void 0;(function(p){p[p.None=0]="None";p[p.Default=1]="Default";p[p.Atlas=2]="Atlas";p[p.Compressed=3]="Compressed";p[p.COUNT=4]= "COUNT"})(a.TextureCoordinateAttributeType||(a.TextureCoordinateAttributeType={}));a.TextureCoordinateAttribute=function(p,k){switch(k.textureCoordinateType){case a.TextureCoordinateAttributeType.Default:p.attributes.add(l.VertexAttribute.UV0,"vec2");p.varyings.add("vuv0","vec2");p.vertex.code.add(q.glsl`void forwardTextureCoordinates() { vuv0 = uv0; }`);break;case a.TextureCoordinateAttributeType.Compressed:p.attributes.add(l.VertexAttribute.UV0,"vec2");p.varyings.add("vuv0","vec2");p.vertex.code.add(q.glsl`vec2 getUV0() { return uv0 / 16384.0; } void forwardTextureCoordinates() { vuv0 = getUV0(); }`);break;case a.TextureCoordinateAttributeType.Atlas:p.attributes.add(l.VertexAttribute.UV0,"vec2");p.varyings.add("vuv0","vec2");p.attributes.add(l.VertexAttribute.UVREGION,"vec4");p.varyings.add("vuvRegion","vec4");p.vertex.code.add(q.glsl`void forwardTextureCoordinates() { vuv0 = uv0; vuvRegion = uvRegion; }`);break;default:b.neverReached(k.textureCoordinateType);case a.TextureCoordinateAttributeType.None:p.vertex.code.add(q.glsl`void forwardTextureCoordinates() {}`);case a.TextureCoordinateAttributeType.COUNT:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/interfaces":function(){define(["exports"],function(a){function b(p,...k){let h="";for(let f=0;f{c=e.camera.projectionMatrix;return b.set(h,c[14],c[10])}));f.code.add(k.glsl`float linearizeDepth(float depth) { float depthNdc = depth * 2.0 - 1.0; float c1 = zProjectionMap[0]; float c2 = zProjectionMap[1]; return -(c1 / (depthNdc + c2 + 1e-7)); }`);f.code.add(k.glsl`float depthFromTexture(sampler2D depthTexture, vec2 uv) { ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0))); float depth = texelFetch(depthTexture, iuv, 0).r; return depth; }`);f.code.add(k.glsl`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) { return linearizeDepth(depthFromTexture(depthTexture, uv)); }`)};a.ReadLinearDepth=function(f){f.include(l.RgbaFloatEncoding);f.code.add(k.glsl`float linearDepthFromFloat(float depth, vec2 nearFar) { return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]); } float linearDepthFromRGBA(vec4 depth, vec2 nearFar) { return linearDepthFromFloat(rgba2float(depth), nearFar); } float linearDepthFromTexture(sampler2D depthTexture, vec2 uv, vec2 nearFar) { ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0))); return linearDepthFromRGBA(texelFetch(depthTexture, iuv, 0), nearFar); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.RgbaFloatEncoding=function(q){q.code.add(b.glsl`const float MAX_RGBA_FLOAT = 255.0 / 256.0 + 255.0 / 256.0 / 256.0 + 255.0 / 256.0 / 256.0 / 256.0 + 255.0 / 256.0 / 256.0 / 256.0 / 256.0; const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); vec4 float2rgba(const float value) { float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); const float toU8AsFloat = 1.0 / 255.0; return fixedPointU8 * toU8AsFloat; } const vec4 RGBA_2_FLOAT_FACTORS = vec4( 255.0 / (256.0), 255.0 / (256.0 * 256.0), 255.0 / (256.0 * 256.0 * 256.0), 255.0 / (256.0 * 256.0 * 256.0 * 256.0) ); float rgba2float(vec4 rgba) { return dot(rgba, RGBA_2_FLOAT_FACTORS); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float2PassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec2",q.BindType.Pass,(h,f,c)=>h.setUniform2fv(p,k(f,c)))}}a.Float2PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Uniform":function(){define(["exports", "../shaderTechnique/BindType"],function(a,b){class q{constructor(l,p,k,h,f=null){this.name=l;this.type=p;this.arraySize=f;this.bind={[b.BindType.Pass]:null,[b.BindType.Draw]:null};if(h)switch(k){case b.BindType.Pass:this.bind[b.BindType.Pass]=h;break;case b.BindType.Draw:this.bind[b.BindType.Draw]=h}}equals(l){return this.type===l.type&&this.name===l.name&&this.arraySize===l.arraySize}}a.Uniform=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/BindType":function(){define(["exports"], function(a){a.BindType=void 0;var b=a.BindType||(a.BindType={});b[b.Pass=0]="Pass";b[b.Draw=1]="Draw";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.Gamma=function(q){q.fragment.code.add(b.glsl`const float GAMMA = 2.2; const float INV_GAMMA = 0.4545454545; vec4 delinearizeGamma(vec4 color) { return vec4(pow(color.rgb, vec3(INV_GAMMA)), color.w); } vec3 linearizeGamma(vec3 color) { return pow(color, vec3(GAMMA)); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl":function(){define(["exports","../../shaderModules/Float3PassUniform","../../shaderModules/interfaces"],function(a,b,q){function l(k){k.uniforms.add(new b.Float3PassUniform("mainLightDirection",(h,f)=>f.lighting.mainLight.direction))}function p(k){k.uniforms.add(new b.Float3PassUniform("mainLightIntensity",(h,f)=>f.lighting.mainLight.intensity))}a.MainLighting= function(k){l(k.fragment);p(k.fragment);k.fragment.code.add(q.glsl`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) { float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0); return mainLightIntensity * ((1.0 - shadowing) * dotVal); }`)};a.addMainLightDirection=l;a.addMainLightIntensity=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float3PassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec3",q.BindType.Pass,(h,f,c)=>h.setUniform3fv(p,k(f,c)))}}a.Float3PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float4PassUniform":function(){define(["exports", "./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec4",q.BindType.Pass,(h,f,c)=>h.setUniform4fv(p,k(f,c)))}}a.Float4PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/FloatPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"float",q.BindType.Pass,(h,f,c)=>h.setUniform1f(p, k(f,c)))}}a.FloatPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"mat4",q.BindType.Pass,(h,f,c)=>h.setUniformMatrix4fv(p,k(f,c)))}}a.Matrix4PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/ShaderBuilder":function(){define("exports ../../../../../core/Error ../../../../../core/has ../../../../../core/Logger ../shaderTechnique/BindType ../../lib/Util".split(" "), function(a,b,q,l,p,k){class h{constructor(){this._includedModules=new Map}include(r,n){this._includedModules.has(r)?this._includedModules.get(r):(this._includedModules.set(r,n),r(this.builder,n))}}class f extends h{constructor(){super(...arguments);this.vertex=new g;this.fragment=new g;this.attributes=new d;this.varyings=new t;this.extensions=new w;this.constants=new m;this.outputs=new v}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(r){const n=this.extensions.generateSource(r), u=this.attributes.generateSource(r),x=this.varyings.generateSource(r);var y="vertex"===r?this.vertex:this.fragment;const z=y.uniforms.generateSource(),A=y.code.generateSource(),B="vertex"===r?"precision highp float;\nprecision highp sampler2D;":"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif";y=this.constants.generateSource().concat(y.constants.generateSource());r=this.outputs.generateSource(r); return`#version 300 es\n${n.join("\n")}\n\n${B}\n\n${y.join("\n")}\n\n${z.join("\n")}\n\n${u.join("\n")}\n\n${x.join("\n")}\n\n${r.join("\n")}\n\n${A.join("\n")}`}generateBindPass(r){const n=new Map;this.vertex.uniforms.entries.forEach(y=>{const z=y.bind[p.BindType.Pass];z&&n.set(y.name,z)});this.fragment.uniforms.entries.forEach(y=>{const z=y.bind[p.BindType.Pass];z&&n.set(y.name,z)});const u=Array.from(n.values()),x=u.length;return(y,z)=>{for(let A=0;A{const z=y.bind[p.BindType.Draw];z&&n.set(y.name,z)});this.fragment.uniforms.entries.forEach(y=>{const z=y.bind[p.BindType.Draw];z&&n.set(y.name,z)});const u=Array.from(n.values()),x=u.length;return(y,z,A)=>{for(let B=0;Bnull!=r.arraySize?`uniform ${r.type} ${r.name}[${r.arraySize}];`:`uniform ${r.type} ${r.name};`)}get entries(){return Array.from(this._entries.values())}}class e{constructor(r){this._stage=r;this._entries=[]}add(r){this._entries.push(r);return this._stage}generateSource(){return this._entries}} class g extends h{constructor(){super(...arguments);this.uniforms=new c(this);this.code=new e(this);this.constants=new m}get builder(){return this}}class d{constructor(){this._entries=[]}add(r,n){this._entries.push([r,n])}generateSource(r){return"fragment"===r?[]:this._entries.map(n=>`in ${n[1]} ${n[0]};`)}}class t{constructor(){this._entries=new Map}add(r,n){this._entries.has(r)&&k.assert(this._entries.get(r)===n);this._entries.set(r,n)}generateSource(r){const n=[];this._entries.forEach((u,x)=>n.push("vertex"=== r?`out ${u} ${x};`:`in ${u} ${x};`));return n}}class w{constructor(){this._entries=new Set}add(r){this._entries.add(r)}generateSource(r){const n="vertex"===r?w.ALLOWLIST_VERTEX:w.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(u=>n.includes(u)).map(u=>`#extension ${u} : enable`)}}w.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"];w.ALLOWLIST_VERTEX=[];class v{constructor(){this._entries=new Map}add(r,n,u=0){const x=this._entries.get(u);x?k.assert(x.name=== r&&x.type===n,`Fragment shader output location ${u} occupied`):this._entries.set(u,{name:r,type:n})}generateSource(r){if("vertex"===r)return[];0===this._entries.size&&this._entries.set(0,{name:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const n=[];this._entries.forEach((u,x)=>n.push(`layout(location = ${x}) out ${u.type} ${u.name};`));return n}}v.DEFAULT_TYPE="vec4";v.DEFAULT_NAME="fragColor";class m{constructor(){this._entries=new Set}add(r,n,u){let x="ERROR_CONSTRUCTOR_STRING";switch(n){case "float":x= m._numberToFloatStr(u);break;case "int":x=m._numberToIntStr(u);break;case "bool":x=u.toString();break;case "vec2":x=`vec2(${m._numberToFloatStr(u[0])}, ${m._numberToFloatStr(u[1])})`;break;case "vec3":x=`vec3(${m._numberToFloatStr(u[0])}, ${m._numberToFloatStr(u[1])}, ${m._numberToFloatStr(u[2])})`;break;case "vec4":x=`vec4(${m._numberToFloatStr(u[0])}, ${m._numberToFloatStr(u[1])}, ${m._numberToFloatStr(u[2])}, ${m._numberToFloatStr(u[3])})`; break;case "ivec2":x=`ivec2(${m._numberToIntStr(u[0])}, ${m._numberToIntStr(u[1])})`;break;case "ivec3":x=`ivec3(${m._numberToIntStr(u[0])}, ${m._numberToIntStr(u[1])}, ${m._numberToIntStr(u[2])})`;break;case "ivec4":x=`ivec4(${m._numberToIntStr(u[0])}, ${m._numberToIntStr(u[1])}, ${m._numberToIntStr(u[2])}, ${m._numberToIntStr(u[3])})`; break;case "mat2":case "mat3":case "mat4":x=`${n}(${Array.prototype.map.call(u,y=>m._numberToFloatStr(y)).join(", ")})`}this._entries.add(`const ${n} ${r} = ${x};`);return this}static _numberToIntStr(r){return r.toFixed(0)}static _numberToFloatStr(r){return Number.isInteger(r)?r.toFixed(1):r.toString()}generateSource(){return Array.from(this._entries)}}a.Code=e;a.Includes=h;a.ShaderBuilder=f;a.Stage=g;a.Uniforms=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Util":function(){define(["exports", "../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../chunks/vec42","../../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a,b,q,l){function p(f,c){if(!f)throw c=c||"Assertion",new h(`${c} at ${Error(c).stack}`);}const k=l.create();class h{constructor(f){this.message=f}toString(){return`AssertException: ${this.message}`}}a.assert=p;a.isTranslationMatrix=function(f){return 1===f[0]&&0===f[1]&&0===f[2]&&0===f[3]&&0===f[4]&&1===f[5]&&0===f[6]&&0===f[7]&&0===f[8]&&0===f[9]&&1=== f[10]&&0===f[11]&&1===f[15]};a.logWithBase=function(f,c){return Math.log(f)/Math.log(c)};a.project=function(f,c,e,g,d){k[0]=f[0];k[1]=f[1];k[2]=f[2];k[3]=1;q.transformMat4(k,k,c);2w&&(d=t,t=w,w=d);let v=(e[1]-f[1])/c[1],m=(g[1]-f[1])/c[1];v>m&&(d=v,v=m,m=d);if(t> m||v>w)return!1;v>t&&(t=v);mf&&(d=e,e=f,f=d);if(t>f||e>w)return!1;fw?!1:!0};a.rayRay2D=function(f,c,e,g,d,t=b.create()){const w=(g[d]-e[d])*(c[0]-f[0])-(g[0]-e[0])*(c[d]-f[d]);if(0===w)return!1;e=((g[0]-e[0])*(f[d]-e[d])-(g[d]-e[d])*(f[0]-e[0]))/w;t[0]=f[0]+e*(c[0]-f[0]);t[1]=f[d]+e*(c[d]-f[d]);return!0};a.setMatrixTranslation3=function(f,c,e,g){f[12]=c;f[13]=e;f[14]=g};a.verify=function(f,c){f||console.warn("Verify failed: "+(c|| "")+"\n"+Error("verify").stack)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"sampler2D",q.BindType.Pass,(h,f,c)=>h.bindTexture(p,k(f,c)))}}a.Texture2DPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule":function(){define(["exports"], function(a){class b{constructor(q,l){this._module=q;this._loadModule=l}get(){return this._module}async reload(){return this._module=await this._loadModule()}}a.ReloadableShaderModule=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique":function(){define(["exports","../../../../../core/maybe","../../../../webgl/enums"],function(a,b,q){class l{constructor(p,k,h){this.release=h;this.initializeConfiguration(p,k);this._configuration= k.snapshot();this._program=this.initializeProgram(p);this._pipeline=this.initializePipeline(p)}destroy(){this._program=b.disposeMaybe(this._program);this._pipeline=this._configuration=null}reload(p){b.disposeMaybe(this._program);this._program=this.initializeProgram(p);this._pipeline=this.initializePipeline(p)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(p){this.program.assertCompatibleVertexAttributeLocations(p)}get primitiveType(){return q.PrimitiveType.TRIANGLES}getPipeline(p, k,h){return this._pipeline}initializeConfiguration(p,k){}}a.ShaderTechnique=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/enums":function(){define(["exports"],function(a){a.ClearBufferBit=void 0;(function(b){b[b.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT";b[b.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT";b[b.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(a.ClearBufferBit||(a.ClearBufferBit={}));a.PrimitiveType=void 0;(function(b){b[b.POINTS=0]="POINTS";b[b.LINES=1]= "LINES";b[b.LINE_LOOP=2]="LINE_LOOP";b[b.LINE_STRIP=3]="LINE_STRIP";b[b.TRIANGLES=4]="TRIANGLES";b[b.TRIANGLE_STRIP=5]="TRIANGLE_STRIP";b[b.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(a.PrimitiveType||(a.PrimitiveType={}));a.BlendFactor=void 0;(function(b){b[b.ZERO=0]="ZERO";b[b.ONE=1]="ONE";b[b.SRC_COLOR=768]="SRC_COLOR";b[b.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR";b[b.SRC_ALPHA=770]="SRC_ALPHA";b[b.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA";b[b.DST_ALPHA=772]="DST_ALPHA";b[b.ONE_MINUS_DST_ALPHA= 773]="ONE_MINUS_DST_ALPHA";b[b.DST_COLOR=774]="DST_COLOR";b[b.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR";b[b.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE";b[b.CONSTANT_COLOR=32769]="CONSTANT_COLOR";b[b.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR";b[b.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA";b[b.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"})(a.BlendFactor||(a.BlendFactor={}));a.BlendOperation=void 0;(function(b){b[b.ADD=32774]="ADD";b[b.MIN=32775]="MIN";b[b.MAX=32776]= "MAX";b[b.SUBTRACT=32778]="SUBTRACT";b[b.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"})(a.BlendOperation||(a.BlendOperation={}));a.BufferType=void 0;(function(b){b[b.ARRAY_BUFFER=34962]="ARRAY_BUFFER";b[b.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER";b[b.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER";b[b.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER";b[b.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER";b[b.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER";b[b.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER";b[b.TRANSFORM_FEEDBACK_BUFFER= 35982]="TRANSFORM_FEEDBACK_BUFFER"})(a.BufferType||(a.BufferType={}));a.Face=void 0;(function(b){b[b.FRONT=1028]="FRONT";b[b.BACK=1029]="BACK";b[b.FRONT_AND_BACK=1032]="FRONT_AND_BACK"})(a.Face||(a.Face={}));a.CullMode=void 0;(function(b){b[b.CW=2304]="CW";b[b.CCW=2305]="CCW"})(a.CullMode||(a.CullMode={}));a.DataType=void 0;(function(b){b[b.BYTE=5120]="BYTE";b[b.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE";b[b.SHORT=5122]="SHORT";b[b.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT";b[b.INT=5124]="INT";b[b.UNSIGNED_INT= 5125]="UNSIGNED_INT";b[b.FLOAT=5126]="FLOAT";b[b.HALF_FLOAT=5131]="HALF_FLOAT"})(a.DataType||(a.DataType={}));a.CompareFunction=void 0;(function(b){b[b.NEVER=512]="NEVER";b[b.LESS=513]="LESS";b[b.EQUAL=514]="EQUAL";b[b.LEQUAL=515]="LEQUAL";b[b.GREATER=516]="GREATER";b[b.NOTEQUAL=517]="NOTEQUAL";b[b.GEQUAL=518]="GEQUAL";b[b.ALWAYS=519]="ALWAYS"})(a.CompareFunction||(a.CompareFunction={}));a.StencilOperation=void 0;(function(b){b[b.ZERO=0]="ZERO";b[b.KEEP=7680]="KEEP";b[b.REPLACE=7681]="REPLACE";b[b.INCR= 7682]="INCR";b[b.DECR=7683]="DECR";b[b.INVERT=5386]="INVERT";b[b.INCR_WRAP=34055]="INCR_WRAP";b[b.DECR_WRAP=34056]="DECR_WRAP"})(a.StencilOperation||(a.StencilOperation={}));a.TextureSamplingMode=void 0;(function(b){b[b.NEAREST=9728]="NEAREST";b[b.LINEAR=9729]="LINEAR";b[b.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST";b[b.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST";b[b.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR";b[b.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"})(a.TextureSamplingMode|| (a.TextureSamplingMode={}));a.TextureWrapMode=void 0;(function(b){b[b.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE";b[b.REPEAT=10497]="REPEAT";b[b.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(a.TextureWrapMode||(a.TextureWrapMode={}));a.TextureType=void 0;(function(b){b[b.TEXTURE_2D=3553]="TEXTURE_2D";b[b.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP";b[b.TEXTURE_3D=32879]="TEXTURE_3D";b[b.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X";b[b.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X"; b[b.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y";b[b.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y";b[b.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z";b[b.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z";b[b.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"})(a.TextureType||(a.TextureType={}));a.PixelFormat=void 0;(function(b){b[b.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT";b[b.DEPTH_STENCIL=34041]="DEPTH_STENCIL";b[b.DEPTH24_STENCIL8=35056]= "DEPTH24_STENCIL8";b[b.ALPHA=6406]="ALPHA";b[b.RGB=6407]="RGB";b[b.RGBA=6408]="RGBA";b[b.LUMINANCE=6409]="LUMINANCE";b[b.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA";b[b.RED=6403]="RED";b[b.RG=33319]="RG";b[b.RED_INTEGER=36244]="RED_INTEGER";b[b.RG_INTEGER=33320]="RG_INTEGER";b[b.RGB_INTEGER=36248]="RGB_INTEGER";b[b.RGBA_INTEGER=36249]="RGBA_INTEGER"})(a.PixelFormat||(a.PixelFormat={}));a.SizedPixelFormat=void 0;(function(b){b[b.RGBA4=32854]="RGBA4";b[b.R16F=33325]="R16F";b[b.RG16F=33327]="RG16F";b[b.RGB32F= 34837]="RGB32F";b[b.RGBA16F=34842]="RGBA16F";b[b.R32F=33326]="R32F";b[b.RG32F=33328]="RG32F";b[b.RGBA32F=34836]="RGBA32F";b[b.R11F_G11F_B10F=35898]="R11F_G11F_B10F";b[b.RGB8=32849]="RGB8";b[b.RGBA8=32856]="RGBA8";b[b.RGB5_A1=32855]="RGB5_A1";b[b.R8=33321]="R8";b[b.RG8=33323]="RG8";b[b.R8I=33329]="R8I";b[b.R8UI=33330]="R8UI";b[b.R16I=33331]="R16I";b[b.R16UI=33332]="R16UI";b[b.R32I=33333]="R32I";b[b.R32UI=33334]="R32UI";b[b.RG8I=33335]="RG8I";b[b.RG8UI=33336]="RG8UI";b[b.RG16I=33337]="RG16I";b[b.RG16UI= 33338]="RG16UI";b[b.RG32I=33339]="RG32I";b[b.RG32UI=33340]="RG32UI";b[b.RGB16F=34843]="RGB16F";b[b.RGB9_E5=35901]="RGB9_E5";b[b.SRGB8=35905]="SRGB8";b[b.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8";b[b.RGB565=36194]="RGB565";b[b.RGBA32UI=36208]="RGBA32UI";b[b.RGB32UI=36209]="RGB32UI";b[b.RGBA16UI=36214]="RGBA16UI";b[b.RGB16UI=36215]="RGB16UI";b[b.RGBA8UI=36220]="RGBA8UI";b[b.RGB8UI=36221]="RGB8UI";b[b.RGBA32I=36226]="RGBA32I";b[b.RGB32I=36227]="RGB32I";b[b.RGBA16I=36232]="RGBA16I";b[b.RGB16I=36233]="RGB16I"; b[b.RGBA8I=36238]="RGBA8I";b[b.RGB8I=36239]="RGB8I";b[b.R8_SNORM=36756]="R8_SNORM";b[b.RG8_SNORM=36757]="RG8_SNORM";b[b.RGB8_SNORM=36758]="RGB8_SNORM";b[b.RGBA8_SNORM=36759]="RGBA8_SNORM";b[b.RGB10_A2=32857]="RGB10_A2";b[b.RGB10_A2UI=36975]="RGB10_A2UI"})(a.SizedPixelFormat||(a.SizedPixelFormat={}));a.PixelType=void 0;(function(b){b[b.FLOAT=5126]="FLOAT";b[b.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE";b[b.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8";b[b.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4"; b[b.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1";b[b.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5";b[b.BYTE=5120]="BYTE";b[b.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT";b[b.SHORT=5122]="SHORT";b[b.UNSIGNED_INT=5125]="UNSIGNED_INT";b[b.INT=5124]="INT";b[b.HALF_FLOAT=5131]="HALF_FLOAT";b[b.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV";b[b.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV";b[b.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV";b[b.FLOAT_32_UNSIGNED_INT_24_8_REV= 36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"})(a.PixelType||(a.PixelType={}));a.RenderbufferFormat=void 0;(function(b){b[b.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16";b[b.STENCIL_INDEX8=36168]="STENCIL_INDEX8";b[b.DEPTH_STENCIL=34041]="DEPTH_STENCIL";b[b.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24";b[b.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F";b[b.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8";b[b.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"})(a.RenderbufferFormat||(a.RenderbufferFormat={}));a.Usage= void 0;(function(b){b[b.STATIC_DRAW=35044]="STATIC_DRAW";b[b.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW";b[b.STREAM_DRAW=35040]="STREAM_DRAW";b[b.STATIC_READ=35045]="STATIC_READ";b[b.DYNAMIC_READ=35049]="DYNAMIC_READ";b[b.STREAM_READ=35041]="STREAM_READ";b[b.STATIC_COPY=35046]="STATIC_COPY";b[b.DYNAMIC_COPY=35050]="DYNAMIC_COPY";b[b.STREAM_COPY=35042]="STREAM_COPY"})(a.Usage||(a.Usage={}));a.ShaderType=void 0;(function(b){b[b.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER";b[b.VERTEX_SHADER=35633]="VERTEX_SHADER"})(a.ShaderType|| (a.ShaderType={}));a.FramebufferTarget=void 0;(function(b){b[b.FRAMEBUFFER=36160]="FRAMEBUFFER";b[b.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER";b[b.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"})(a.FramebufferTarget||(a.FramebufferTarget={}));a.ResourceType=void 0;(function(b){b[b.Texture=0]="Texture";b[b.BufferObject=1]="BufferObject";b[b.VertexArrayObject=2]="VertexArrayObject";b[b.Shader=3]="Shader";b[b.Program=4]="Program";b[b.FramebufferObject=5]="FramebufferObject";b[b.Renderbuffer=6]="Renderbuffer"; b[b.TransformFeedback=7]="TransformFeedback";b[b.Sync=8]="Sync";b[b.UNCOUNTED=9]="UNCOUNTED";b[b.LinesOfCode=9]="LinesOfCode";b[b.Uniform=10]="Uniform";b[b.COUNT=11]="COUNT"})(a.ResourceType||(a.ResourceType={}));a.ColorAttachment=void 0;(function(b){b[b.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0";b[b.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1";b[b.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2";b[b.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3";b[b.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4";b[b.COLOR_ATTACHMENT5= 36069]="COLOR_ATTACHMENT5";b[b.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6";b[b.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7";b[b.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8";b[b.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9";b[b.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10";b[b.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11";b[b.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12";b[b.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13";b[b.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14";b[b.COLOR_ATTACHMENT15= 36079]="COLOR_ATTACHMENT15"})(a.ColorAttachment||(a.ColorAttachment={}));a.SpecialDrawBuffers=void 0;(function(b){b[b.NONE=0]="NONE";b[b.BACK=1029]="BACK"})(a.SpecialDrawBuffers||(a.SpecialDrawBuffers={}));a.CompressedTextureFormat=void 0;(function(b){b[b.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT";b[b.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT";b[b.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT";b[b.COMPRESSED_RGBA_S3TC_DXT5_EXT= 33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT";b[b.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC";b[b.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC";b[b.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC";b[b.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC";b[b.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2";b[b.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2";b[b.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2";b[b.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2= 37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2";b[b.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC";b[b.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(a.CompressedTextureFormat||(a.CompressedTextureFormat={}));a.UniformType=void 0;(function(b){b[b.FLOAT=5126]="FLOAT";b[b.FLOAT_VEC2=35664]="FLOAT_VEC2";b[b.FLOAT_VEC3=35665]="FLOAT_VEC3";b[b.FLOAT_VEC4=35666]="FLOAT_VEC4";b[b.INT=5124]="INT";b[b.INT_VEC2=35667]="INT_VEC2";b[b.INT_VEC3=35668]="INT_VEC3"; b[b.INT_VEC4=35669]="INT_VEC4";b[b.BOOL=35670]="BOOL";b[b.BOOL_VEC2=35671]="BOOL_VEC2";b[b.BOOL_VEC3=35672]="BOOL_VEC3";b[b.BOOL_VEC4=35673]="BOOL_VEC4";b[b.FLOAT_MAT2=35674]="FLOAT_MAT2";b[b.FLOAT_MAT3=35675]="FLOAT_MAT3";b[b.FLOAT_MAT4=35676]="FLOAT_MAT4";b[b.SAMPLER_2D=35678]="SAMPLER_2D";b[b.SAMPLER_CUBE=35680]="SAMPLER_CUBE";b[b.UNSIGNED_INT=5125]="UNSIGNED_INT";b[b.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2";b[b.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3";b[b.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4"; b[b.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3";b[b.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4";b[b.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2";b[b.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4";b[b.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2";b[b.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3";b[b.SAMPLER_3D=35679]="SAMPLER_3D";b[b.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW";b[b.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY";b[b.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW";b[b.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW";b[b.INT_SAMPLER_2D=36298]= "INT_SAMPLER_2D";b[b.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D";b[b.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE";b[b.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY";b[b.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D";b[b.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D";b[b.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE";b[b.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"})(a.UniformType||(a.UniformType={}));a.SyncParameter=void 0;(function(b){b[b.OBJECT_TYPE= 37138]="OBJECT_TYPE";b[b.SYNC_CONDITION=37139]="SYNC_CONDITION";b[b.SYNC_STATUS=37140]="SYNC_STATUS";b[b.SYNC_FLAGS=37141]="SYNC_FLAGS"})(a.SyncParameter||(a.SyncParameter={}));a.SyncStatus=void 0;(function(b){b[b.UNSIGNALED=37144]="UNSIGNALED";b[b.SIGNALED=37145]="SIGNALED"})(a.SyncStatus||(a.SyncStatus={}));a.ClientWaitSyncStatus=void 0;(function(b){b[b.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED";b[b.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED";b[b.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED";b[b.WAIT_FAILED= 37149]="WAIT_FAILED"})(a.ClientWaitSyncStatus||(a.ClientWaitSyncStatus={}));a.SyncCondition=void 0;(function(b){b[b.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"})(a.SyncCondition||(a.SyncCondition={}));a.SyncFlag=void 0;(function(b){b[b.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"})(a.SyncFlag||(a.SyncFlag={}));a.DepthStencilAttachment=33306;a.baseTextureUnit=33984;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations":function(){define(["exports", "./VertexAttribute"],function(a,b){b=new Map([[b.VertexAttribute.POSITION,0],[b.VertexAttribute.NORMAL,1],[b.VertexAttribute.NORMALCOMPRESSED,1],[b.VertexAttribute.UV0,2],[b.VertexAttribute.COLOR,3],[b.VertexAttribute.COLORFEATUREATTRIBUTE,3],[b.VertexAttribute.SIZE,4],[b.VertexAttribute.TANGENT,4],[b.VertexAttribute.CENTEROFFSETANDDISTANCE,5],[b.VertexAttribute.SYMBOLCOLOR,5],[b.VertexAttribute.FEATUREATTRIBUTE,6],[b.VertexAttribute.INSTANCEFEATUREATTRIBUTE,6],[b.VertexAttribute.INSTANCECOLOR,7], [b.VertexAttribute.OBJECTANDLAYERIDCOLOR,7],[b.VertexAttribute.INSTANCEOBJECTANDLAYERIDCOLOR,7],[b.VertexAttribute.INSTANCEMODEL,8],[b.VertexAttribute.INSTANCEMODELNORMAL,12],[b.VertexAttribute.INSTANCEMODELORIGINHI,11],[b.VertexAttribute.INSTANCEMODELORIGINLO,15]]);a.Default3D=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Program":function(){define(["exports","../../../../core/PooledArray","../../../webgl/checkWebGLError"],function(a,b,q){class l{constructor(p, k,h){this._context=p;this._locations=h;this._textures=new Map;this._freeTextureUnits=new b({deallocator:null});this._glProgram=p.programCache.acquire(k.generate("vertex"),k.generate("fragment"),h);this._glProgram.stop=()=>{throw Error("Wrapped _glProgram used directly");};this.bindPass=k.generateBindPass(this);this.bindDraw=k.generateBindDraw(this);this._fragmentUniforms=q.webglDebugEnabled()?k.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(p, k){this._glProgram.setUniform1i(p,k?1:0)}setUniform1i(p,k){this._glProgram.setUniform1i(p,k)}setUniform1f(p,k){this._glProgram.setUniform1f(p,k)}setUniform2fv(p,k){this._glProgram.setUniform2fv(p,k)}setUniform3fv(p,k){this._glProgram.setUniform3fv(p,k)}setUniform4fv(p,k){this._glProgram.setUniform4fv(p,k)}setUniformMatrix3fv(p,k){this._glProgram.setUniformMatrix3fv(p,k)}setUniformMatrix4fv(p,k){this._glProgram.setUniformMatrix4fv(p,k)}setUniform1fv(p,k){this._glProgram.setUniform1fv(p,k)}setUniform1iv(p, k){this._glProgram.setUniform1iv(p,k)}setUniform2iv(p,k){this._glProgram.setUniform3iv(p,k)}setUniform3iv(p,k){this._glProgram.setUniform3iv(p,k)}setUniform4iv(p,k){this._glProgram.setUniform4iv(p,k)}assertCompatibleVertexAttributeLocations(p){p.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear();this._freeTextureUnits.clear()}bindTexture(p,k){if(null==k?.glName){if(k=this._textures.get(p))this._context.bindTexture(null,k.unit),this._freeTextureUnit(k), this._textures.delete(p);return null}let h=this._textures.get(p);null==h?(h=this._allocTextureUnit(k),this._textures.set(p,h)):h.texture=k;this._context.useProgram(this);this.setUniform1i(p,h.unit);this._context.bindTexture(k,h.unit);return h.unit}rebindTextures(){this._context.useProgram(this);this._textures.forEach((p,k)=>{this._context.bindTexture(p.texture,p.unit);this.setUniform1i(k,p.unit)});this._fragmentUniforms?.forEach(p=>{"sampler2D"!==p.type&&"samplerCube"!==p.type||this._textures.has(p.name)|| console.error(`Texture sampler ${p.name} has no bound texture`)})}_allocTextureUnit(p){return{texture:p,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(p){this._freeTextureUnits.push(p.unit)}}a.Program=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/checkWebGLError":function(){define(["exports","../../core/Error","../../core/has","../../core/Logger"],function(a,b,q,l){function p(h,f){switch(f){case h.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument."; case h.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case h.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case h.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case h.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case h.CONTEXT_LOST_WEBGL:return"WebGL context has been lost"; default:return"Unknown error"}}const k=!!q("enable-feature:webgl-debug");a.checkWebGLError=function(h){if(k){var f=h.getError();f&&(h=p(h,f),f=Error().stack,l.getLogger("esri.views.webgl.checkWebGLError").error(new b("webgl-error","WebGL error occurred",{message:h,stack:f})))}};a.hasFeatureFlagWebGLDebug=k;a.webglDebugEnabled=function(){return k};a.webglValidateShadersEnabled=function(){return k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/renderState":function(){define(["exports", "../3d/webgl-engine/lib/basicInterfaces","./enums"],function(a,b,q){function l(K){return D.intern(K)}function p(K){return F.intern(K)}function k(K){return H.intern(K)}function h(K){return N.intern(K)}function f(K){return E.intern(K)}function c(K){return G.intern(K)}function e(K){return I.intern(K)}function g(K){return O.intern(K)}function d(K){return L.intern(K)}function t(K){return"["+K.join(",")+"]"}function w(K){return K?t([K.srcRgb,K.srcAlpha,K.dstRgb,K.dstAlpha,K.opRgb,K.opAlpha,K.color.r,K.color.g, K.color.b,K.color.a]):null}function v(K){return K?t([K.face,K.mode]):null}function m(K){return K?t([K.factor,K.units]):null}function r(K){return K?t([K.func]):null}function n(K){return K?t([K.function.func,K.function.ref,K.function.mask,K.operation.fail,K.operation.zFail,K.operation.zPass]):null}function u(K){return K?t([K.zNear,K.zFar]):null}function x(K){return K?t([K.r,K.g,K.b,K.a]):null}function y(K){return K?t([K.mask]):null}function z(K){return K?t(K.buffers):null}const A={face:q.Face.BACK, mode:q.CullMode.CCW},B={face:q.Face.FRONT,mode:q.CullMode.CCW};class C{constructor(K,J){this._makeKey=K;this._makeRef=J;this._interns=new Map}intern(K){if(!K)return null;const J=this._makeKey(K),R=this._interns;R.has(J)||R.set(J,this._makeRef(K));return R.get(J)??null}}const D=new C(w,K=>({__tag:"Blending",...K})),F=new C(v,K=>({__tag:"Culling",...K})),H=new C(m,K=>({__tag:"PolygonOffset",...K})),N=new C(r,K=>({__tag:"DepthTest",...K})),E=new C(n,K=>({__tag:"StencilTest",...K})),G=new C(u,K=>({__tag:"DepthWrite", ...K})),I=new C(x,K=>({__tag:"ColorWrite",...K})),O=new C(y,K=>({__tag:"StencilWrite",...K})),L=new C(z,K=>({__tag:"DrawBuffers",...K})),P=new C(function(K){return K?t([w(K.blending),v(K.culling),m(K.polygonOffset),r(K.depthTest),n(K.stencilTest),u(K.depthWrite),x(K.colorWrite),y(K.stencilWrite),z(K.drawBuffers)]):null},K=>({blending:l(K.blending),culling:p(K.culling),polygonOffset:k(K.polygonOffset),depthTest:h(K.depthTest),stencilTest:f(K.stencilTest),depthWrite:c(K.depthWrite),colorWrite:e(K.colorWrite), stencilWrite:g(K.stencilWrite),drawBuffers:d(K.drawBuffers)}));class M{constructor(K){this._drawBuffersInvalid=this._stencilWriteInvalid=this._colorWriteInvalid=this._depthWriteInvalid=this._stencilTestInvalid=this._depthTestInvalid=this._polygonOffsetInvalid=this._cullingInvalid=this._blendingInvalid=this._pipelineInvalid=!0;this._stateSetters=K}setPipeline(K){if(this._pipelineInvalid||K!==this._pipeline)this._setBlending(K.blending),this._setCulling(K.culling),this._setPolygonOffset(K.polygonOffset), this._setDepthTest(K.depthTest),this._setStencilTest(K.stencilTest),this._setDepthWrite(K.depthWrite),this._setColorWrite(K.colorWrite),this._setStencilWrite(K.stencilWrite),this._setDrawBuffers(K.drawBuffers),this._pipeline=K;this._pipelineInvalid=!1}invalidateBlending(){this._pipelineInvalid=this._blendingInvalid=!0}invalidateCulling(){this._pipelineInvalid=this._cullingInvalid=!0}invalidatePolygonOffset(){this._pipelineInvalid=this._polygonOffsetInvalid=!0}invalidateDepthTest(){this._pipelineInvalid= this._depthTestInvalid=!0}invalidateStencilTest(){this._pipelineInvalid=this._stencilTestInvalid=!0}invalidateDepthWrite(){this._pipelineInvalid=this._depthWriteInvalid=!0}invalidateColorWrite(){this._pipelineInvalid=this._colorWriteInvalid=!0}invalidateStencilWrite(){this._pipelineInvalid=this._stencilTestInvalid=!0}invalidateDrawBuffers(){this._pipelineInvalid=this._drawBuffersInvalid=!0}_setBlending(K){this._blending=this._setSubState(K,this._blending,this._blendingInvalid,this._stateSetters.setBlending); this._blendingInvalid=!1}_setCulling(K){this._culling=this._setSubState(K,this._culling,this._cullingInvalid,this._stateSetters.setCulling);this._cullingInvalid=!1}_setPolygonOffset(K){this._polygonOffset=this._setSubState(K,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset);this._polygonOffsetInvalid=!1}_setDepthTest(K){this._depthTest=this._setSubState(K,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest);this._depthTestInvalid=!1}_setStencilTest(K){this._stencilTest= this._setSubState(K,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest);this._stencilTestInvalid=!1}_setDepthWrite(K){this._depthWrite=this._setSubState(K,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite);this._depthWriteInvalid=!1}_setColorWrite(K){this._colorWrite=this._setSubState(K,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite);this._colorWriteInvalid=!1}_setStencilWrite(K){this._stencilWrite=this._setSubState(K,this._stencilWrite, this._stencilWriteInvalid,this._stateSetters.setStencilWrite);this._stencilTestInvalid=!1}_setDrawBuffers(K){this._drawBuffers=this._setSubState(K,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers);this._drawBuffersInvalid=!1}_setSubState(K,J,R,Q){if(R||K!==J)Q(K),this._pipelineInvalid=!0;return K}}a.StateTracker=M;a.backFaceCullingParams=A;a.cullingParams=K=>K===b.CullFaceOptions.Back?A:K===b.CullFaceOptions.Front?B:null;a.defaultColorWriteParams={r:!0,g:!0,b:!0,a:!0}; a.defaultDepthWriteParams={zNear:0,zFar:1};a.frontFaceCullingParams=B;a.makeBlending=l;a.makeColorWrite=e;a.makeCulling=p;a.makeDepthTest=h;a.makeDepthWrite=c;a.makeDrawBuffers=d;a.makePipelineState=function(K){return P.intern(K)};a.makePolygonOffset=k;a.makeStencilTest=f;a.makeStencilWrite=g;a.separateBlendingParams=function(K,J,R,Q,W=q.BlendOperation.ADD,S=q.BlendOperation.ADD,V=[0,0,0,0]){return{srcRgb:K,srcAlpha:J,dstRgb:R,dstAlpha:Q,opRgb:W,opAlpha:S,color:{r:V[0],g:V[1],b:V[2],a:V[3]}}};a.simpleBlendingParams= function(K,J,R=q.BlendOperation.ADD,Q=[0,0,0,0]){return{srcRgb:K,srcAlpha:K,dstRgb:J,dstAlpha:J,opRgb:R,opAlpha:R,color:{r:Q[0],g:Q[1],b:Q[2],a:Q[3]}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/basicInterfaces":function(){define(["exports"],function(a){a.CullFaceOptions=void 0;(function(b){b[b.None=0]="None";b[b.Front=1]="Front";b[b.Back=2]="Back";b[b.COUNT=3]="COUNT"})(a.CullFaceOptions||(a.CullFaceOptions={}));a.DepthTestFunction=void 0;(function(b){b[b.Less= 0]="Less";b[b.Lequal=1]="Lequal";b[b.COUNT=2]="COUNT"})(a.DepthTestFunction||(a.DepthTestFunction={}));a.RenderRequestType=void 0;(function(b){b[b.BACKGROUND=0]="BACKGROUND";b[b.UPDATE=1]="UPDATE"})(a.RenderRequestType||(a.RenderRequestType={}));a.ResourceState=void 0;(function(b){b[b.NOT_LOADED=0]="NOT_LOADED";b[b.LOADING=1]="LOADING";b[b.LOADED=2]="LOADED"})(a.ResourceState||(a.ResourceState={}));a.StencilBits=void 0;(function(b){b[b.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded";b[b.OutlineVisualElementMask= 2]="OutlineVisualElementMask"})(a.StencilBits||(a.StencilBits={}));a.Object3DState=void 0;(function(b){b[b.Highlight=0]="Highlight";b[b.MaskOccludee=1]="MaskOccludee";b[b.COUNT=2]="COUNT"})(a.Object3DState||(a.Object3DState={}));a.AlphaDiscardMode=void 0;(function(b){b[b.Blend=0]="Blend";b[b.Opaque=1]="Opaque";b[b.Mask=2]="Mask";b[b.MaskBlend=3]="MaskBlend";b[b.COUNT=4]="COUNT"})(a.AlphaDiscardMode||(a.AlphaDiscardMode={}));a.Decorations=void 0;(function(b){b[b.OFF=0]="OFF";b[b.ON=1]="ON"})(a.Decorations|| (a.Decorations={}));a.TextureEncodingMimeType=void 0;(function(b){b.DDS_ENCODING="image/vnd-ms.dds";b.KTX2_ENCODING="image/ktx2";b.BASIS_ENCODING="image/x.basis"})(a.TextureEncodingMimeType||(a.TextureEncodingMimeType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments); this.haze=!1}}b.__decorate([q.parameter()],l.prototype,"haze",void 0);class p extends l{constructor(){super(...arguments);this.reduced=!1}}b.__decorate([q.parameter()],p.prototype,"reduced",void 0);a.AtmosphereCompositingTechniqueConfiguration=l;a.ChapmanAtmosphereTechniqueConfiguration=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration":function(){define(["exports","../shaderModules/interfaces"],function(a, b){class q extends b.NoParameters{constructor(){super();this._key="";this._keyDirty=!1;this._parameterBits=this._parameterBits?this._parameterBits.map(()=>0):[];this._parameterNames||(this._parameterNames=[])}get key(){this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits));return this._key}snapshot(){const l=this._parameterNames,p={key:this.key};for(const k of l)p[k]=this[k];return p}}a.ShaderTechniqueConfiguration=q;a.parameter=function(l={}){return(p, k)=>{p._parameterNames=p._parameterNames??[];p._parameterNames.push(k);if(null!=l.constValue)Object.defineProperty(p,k,{get(){return l.constValue}});else{const h=p._parameterNames.length-1,f=Math.ceil(Math.log2(l.count||2)),c=p._parameterBits??[0];let e=0;for(;16=c.length&&c.push(0);p._parameterBits=c;const g=c[e],d=(1<b.getLogger("esri.views.webgl.VertexArrayObject");a.VertexArrayObject=class{constructor(f,c,e,g,d=null){this._context=f;this._locations=c;this._layout=e;this._buffers=g;this._indexBuffer= d;this._glName=null;this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((f,c)=>f+this._buffers[c].usedMemory,null!=this._indexBuffer?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer? 1:0))*l.typedArrayStaticSize}dispose(){if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const f in this._buffers)this._buffers[f]?.dispose(),delete this._buffers[f];this._indexBuffer=q.disposeMaybe(this._indexBuffer);this.disposeVAOOnly()}else(this._glName||0=v.count)t.vertexAttribPointer(g,v.count,v.type,v.normalized,v.stride,v.offset+e),t.enableVertexAttribArray(g),0w;w++)t.vertexAttribPointer(g+w,3,v.type,v.normalized,v.stride,v.offset+12*w+e),t.enableVertexAttribArray(g+w),0w;w++)t.vertexAttribPointer(g+w,4,v.type,v.normalized,v.stride,v.offset+16*w+e),t.enableVertexAttribArray(g+w),0=t.count)d.disableVertexAttribArray(e),t.divisor&&0g;g++)d.disableVertexAttribArray(e+g),t.divisor&&0g;g++)d.disableVertexAttribArray(e+g),t.divisor&&0g||0>d)){var t=b.isArrayLike(c)?c.BYTES_PER_ELEMENT:1;t*((g??0)+(d??0))>c.byteLength||(e+t*(d??0)>this.usedMemory&&l.getLogger("esri.views.webgl.BufferObject").warn("Potential problem getting subdata: requested data exceeds buffer size!"),t=this._context.gl,this.bufferType===h.BufferType.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,h.BufferType.TRANSFORM_FEEDBACK_BUFFER),t.getBufferSubData(h.BufferType.TRANSFORM_FEEDBACK_BUFFER, e,c,g,d),this._context.unbindBuffer(h.BufferType.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,h.BufferType.COPY_READ_BUFFER),t.getBufferSubData(h.BufferType.COPY_READ_BUFFER,e,c,g,d),this._context.unbindBuffer(h.BufferType.COPY_READ_BUFFER)))}}async getSubDataAsync(c,e=0,g,d){await this._context.clientWaitAsync();this.getSubData(c,e,g,d)}}a.BufferObject=f;a.tracer=null;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Texture":function(){define("exports ../../core/Error ../../core/has ./checkWebGLError ./enums ./GLObjectType ./TextureDescriptor ./ValidatedTextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f){function c(r){(null!=r.width&&0>r.width||null!=r.height&&0>r.height||null!=r.depth&&0>r.depth)&&console.error("Negative dimension parameters are not allowed!")}function e(r,n){let u=n.samplingMode,x=n.samplingMode;if(u===p.TextureSamplingMode.LINEAR_MIPMAP_NEAREST||u===p.TextureSamplingMode.LINEAR_MIPMAP_LINEAR)u=p.TextureSamplingMode.LINEAR,n.hasMipmap||(x=p.TextureSamplingMode.LINEAR);else if(u===p.TextureSamplingMode.NEAREST_MIPMAP_NEAREST||u===p.TextureSamplingMode.NEAREST_MIPMAP_LINEAR)u= p.TextureSamplingMode.NEAREST,n.hasMipmap||(x=p.TextureSamplingMode.NEAREST);r.texParameteri(n.target,r.TEXTURE_MAG_FILTER,u);r.texParameteri(n.target,r.TEXTURE_MIN_FILTER,x)}function g(r,n){"number"===typeof n.wrapMode?(r.texParameteri(n.target,r.TEXTURE_WRAP_S,n.wrapMode),r.texParameteri(n.target,r.TEXTURE_WRAP_T,n.wrapMode)):(r.texParameteri(n.target,r.TEXTURE_WRAP_S,n.wrapMode.s),r.texParameteri(n.target,r.TEXTURE_WRAP_T,n.wrapMode.t))}function d(r,n){const u=r.capabilities.textureFilterAnisotropic; u&&r.gl.texParameterf(n.target,u.TEXTURE_MAX_ANISOTROPY,n.maxAnisotropy??1)}function t(r){return null!=r&&"type"in r&&"compressed"===r.type}function w(r){return null!=r&&!t(r)&&!(null!=r&&"byteLength"in r)}function v(r){return r===p.TextureType.TEXTURE_3D||r===p.TextureType.TEXTURE_2D_ARRAY}function m(r,n,u,x=1){n=Math.max(n,u);r===p.TextureType.TEXTURE_3D&&(n=Math.max(n,x));return Math.round(Math.log(n)/Math.LN2)+1}q=class r{constructor(n,u=null,x=null){this.type=k.GLObjectType.Texture;this._glName= null;this._wasImmutablyAllocated=this._wrapModeDirty=this._samplingModeDirty=!1;if("context"in n)this._descriptor=n,x=u;else{n=f.ValidatedTextureDescriptor.validate(n,u);if(!n)throw new b("Texture descriptor invalid");this._descriptor=n}this._descriptor.target===p.TextureType.TEXTURE_CUBE_MAP?this._setDataCubeMap(x):this.setData(x)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return h.estimateMemory(this._descriptor)}get isDirty(){return this._samplingModeDirty|| this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(p.ResourceType.Texture,this);this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(n,u){const x=this._descriptor;if(x.width!==n||x.height!==u){if(this._wasImmutablyAllocated)throw new b("Immutable textures can't be resized!");x.width=n;x.height=u;this._descriptor.target=== p.TextureType.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(n=null){for(let u=p.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X;u<=p.TextureType.TEXTURE_CUBE_MAP_NEGATIVE_Z;u++)this._setData(n,u)}setData(n){this._setData(n)}_setData(n,u){if(this._descriptor.context?.gl){var x=this._descriptor.context.gl;l.checkWebGLError(x);this._glName||(this._glName=x.createTexture())&&this._descriptor.context.instanceCounter.increment(p.ResourceType.Texture,this);void 0===n&&(n=null); var y=this._descriptor,z=u??y.target,A=v(z);null===n&&(y.width=y.width||4,y.height=y.height||4,A&&(y.depth=y.depth??1));u=this._descriptor.context.bindTexture(this,r.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(r.TEXTURE_UNIT_FOR_UPDATES);c(y);this._configurePixelStorage();l.checkWebGLError(x);var B=this._deriveInternalFormat();if(w(n)){let C="width"in n?n.width:n.codedWidth,D="height"in n?n.height:n.codedHeight;n instanceof HTMLVideoElement&&(C=n.videoWidth,D=n.videoHeight); y.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(z,B,y.hasMipmap,C,D,1);this._texImage(z,0,B,C,D,1,n);l.checkWebGLError(x);y.hasMipmap&&this.generateMipmap();y.width||(y.width=C);y.height||(y.height=D);A&&!y.depth&&(y.depth=1)}else{const {width:C,height:D,depth:F}=y;if(null==C||null==D)throw new b("Width and height must be specified!");if(A&&null==F)throw new b("Depth must be specified!");y.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(z,B,y.hasMipmap,C,D,F);if(t(n)){const H= n.levels;n=m(z,C,D,F);n=Math.min(n-1,H.length-1);x.texParameteri(y.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,n);if(!(B in p.CompressedTextureFormat))throw new b("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((N,E,G,I)=>{this._compressedTexImage(z,N,B,E,G,I,H[Math.min(N,H.length-1)])},n)}else this._texImage(z,0,B,C,D,F,n),l.checkWebGLError(x),y.hasMipmap&&this.generateMipmap()}e(x,this._descriptor);g(x,this._descriptor);d(this._descriptor.context, this._descriptor);l.checkWebGLError(x);this._descriptor.context.bindTexture(u,r.TEXTURE_UNIT_FOR_UPDATES)}}updateData(n,u,x,y,z,A,B=0){A||console.error("An attempt to use uninitialized data!");this._glName||console.error("An attempt to update uninitialized texture!");var C=this._descriptor;const D=this._deriveInternalFormat(),{context:F,pixelFormat:H,dataType:N,target:E,isImmutable:G}=C;if(G&&!this._wasImmutablyAllocated)throw new b("Cannot update immutable texture before allocation!");const I=F.bindTexture(this, r.TEXTURE_UNIT_FOR_UPDATES,!0);(0>u||0>x||u+y>C.width||x+z>C.height)&&console.error("An attempt to update out of bounds of the texture!");this._configurePixelStorage();({gl:C}=F);B&&C.pixelStorei(C.UNPACK_SKIP_ROWS,B);w(A)?C.texSubImage2D(E,n,u,x,y,z,H,N,A):t(A)?C.compressedTexSubImage2D(E,n,u,x,y,z,D,A.levels[n]):C.texSubImage2D(E,n,u,x,y,z,H,N,A);B&&C.pixelStorei(C.UNPACK_SKIP_ROWS,0);F.bindTexture(I,r.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(n,u,x,y,z,A,B,C){C||console.error("An attempt to use uninitialized data!"); this._glName||console.error("An attempt to update uninitialized texture!");var D=this._descriptor;const F=this._deriveInternalFormat(),{context:H,pixelFormat:N,dataType:E,isImmutable:G,target:I}=D;if(G&&!this._wasImmutablyAllocated)throw new b("Cannot update immutable texture before allocation!");v(I)||console.warn("Attempting to set 3D texture data on a non-3D texture");const O=H.bindTexture(this,r.TEXTURE_UNIT_FOR_UPDATES);H.setActiveTexture(r.TEXTURE_UNIT_FOR_UPDATES);(0>u||0>x||0>y||u+z>D.width|| x+A>D.height||y+B>D.depth)&&console.error("An attempt to update out of bounds of the texture!");this._configurePixelStorage();({gl:D}=H);t(C)?(C=C.levels[n],D.compressedTexSubImage3D(I,n,u,x,y,z,A,B,F,C)):D.texSubImage3D(I,n,u,x,y,z,A,B,N,E,C);H.bindTexture(O,r.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const n=this._descriptor;if(!n.hasMipmap){if(this._wasImmutablyAllocated)throw new b("Cannot add mipmaps to immutable texture after allocation");this._samplingModeDirty=n.hasMipmap=!0;c(n)}n.samplingMode=== p.TextureSamplingMode.LINEAR?(this._samplingModeDirty=!0,n.samplingMode=p.TextureSamplingMode.LINEAR_MIPMAP_NEAREST):n.samplingMode===p.TextureSamplingMode.NEAREST&&(this._samplingModeDirty=!0,n.samplingMode=p.TextureSamplingMode.NEAREST_MIPMAP_NEAREST);const u=this._descriptor.context.bindTexture(this,r.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(r.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.gl.generateMipmap(n.target);this._descriptor.context.bindTexture(u,r.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const n= this._descriptor;if(n.hasMipmap){if(this._wasImmutablyAllocated)throw new b("Cannot delete mipmaps to immutable texture after allocation");n.hasMipmap=!1;this._samplingModeDirty=!0;c(n)}n.samplingMode===p.TextureSamplingMode.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,n.samplingMode=p.TextureSamplingMode.LINEAR):n.samplingMode===p.TextureSamplingMode.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,n.samplingMode=p.TextureSamplingMode.NEAREST)}setSamplingMode(n){n!==this._descriptor.samplingMode&& (this._descriptor.samplingMode=n,this._samplingModeDirty=!0)}setWrapMode(n){n!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=n,c(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const n=this._descriptor,u=n.context.gl;this._samplingModeDirty&&(e(u,n),this._samplingModeDirty=!1);this._wrapModeDirty&&(g(u,n),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===p.PixelFormat.DEPTH_STENCIL&&(this._descriptor.internalFormat= p.PixelFormat.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case p.PixelType.FLOAT:switch(this._descriptor.pixelFormat){case p.PixelFormat.RGBA:return this._descriptor.internalFormat=p.SizedPixelFormat.RGBA32F;case p.PixelFormat.RGB:return this._descriptor.internalFormat=p.SizedPixelFormat.RGB32F;default:throw new b("Unable to derive format");}case p.PixelType.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case p.PixelFormat.RGBA:return this._descriptor.internalFormat= p.SizedPixelFormat.RGBA8;case p.PixelFormat.RGB:return this._descriptor.internalFormat=p.SizedPixelFormat.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===p.PixelFormat.DEPTH_STENCIL?p.PixelFormat.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const n=this._descriptor.context.gl,{unpackAlignment:u,flipped:x,preMultiplyAlpha:y}=this._descriptor;n.pixelStorei(n.UNPACK_ALIGNMENT,u);n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,x?1:0);n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, y?1:0)}_texStorage(n,u,x,y,z,A){const {gl:B}=this._descriptor.context;if(!(u in p.SizedPixelFormat))throw new b("Immutable textures must have a sized internal format");if(this._descriptor.isImmutable){x=x?m(n,y,z,A):1;if(v(n)){if(null==A)throw new b("Missing depth dimension for 3D texture upload");B.texStorage3D(n,x,u,y,z,A)}else B.texStorage2D(n,x,u,y,z);this._wasImmutablyAllocated=!0}}_texImage(n,u,x,y,z,A,B){const C=this._descriptor.context.gl,D=v(n),{isImmutable:F,pixelFormat:H,dataType:N}=this._descriptor; if(F){if(null!=B)if(D){if(null==A)throw new b("Missing depth dimension for 3D texture upload");C.texSubImage3D(n,u,0,0,0,y,z,A,H,N,B)}else C.texSubImage2D(n,u,0,0,y,z,H,N,B)}else if(D){if(null==A)throw new b("Missing depth dimension for 3D texture upload");C.texImage3D(n,u,x,y,z,A,0,H,N,B)}else C.texImage2D(n,u,x,y,z,0,H,N,B)}_compressedTexImage(n,u,x,y,z,A,B){const C=this._descriptor.context.gl,D=v(n);if(this._descriptor.isImmutable){if(null!=B)if(D){if(null==A)throw new b("Missing depth dimension for 3D texture upload"); C.compressedTexSubImage3D(n,u,0,0,0,y,z,A,x,B)}else C.compressedTexSubImage2D(n,u,0,0,y,z,x,B)}else if(D){if(null==A)throw new b("Missing depth dimension for 3D texture upload");C.compressedTexImage3D(n,u,x,y,z,A,0,B)}else C.compressedTexImage2D(n,u,x,y,z,0,B)}_forEachMipmapLevel(n,u=Infinity){let {width:x,height:y,depth:z,hasMipmap:A,target:B}=this._descriptor;const C=B===p.TextureType.TEXTURE_3D;if(null==x||null==y||C&&null==z)throw new b("Missing texture dimensions for mipmap calculation");for(let D= 0;;++D){n(D,x,y,z);if(!A||1===x&&1===y&&(!C||1===z)||D>=u)break;x=Math.max(1,x>>1);y=Math.max(1,y>>1);C&&(z=Math.max(1,z>>1))}}};q.TEXTURE_UNIT_FOR_UPDATES=0;a.Texture=q;a.tracer=null;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/GLObjectType":function(){define(["exports"],function(a){a.GLObjectType=void 0;var b=a.GLObjectType||(a.GLObjectType={});b[b.Texture=0]="Texture";b[b.RenderBuffer=1]="RenderBuffer";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/webgl/TextureDescriptor":function(){define(["exports","./enums","./Util"],function(a,b,q){class l{constructor(p=0,k=p){this.width=p;this.height=k;this.target=b.TextureType.TEXTURE_2D;this.pixelFormat=b.PixelFormat.RGBA;this.dataType=b.PixelType.UNSIGNED_BYTE;this.samplingMode=b.TextureSamplingMode.LINEAR;this.wrapMode=b.TextureWrapMode.REPEAT;this.maxAnisotropy=1;this.isOpaque=this.hasMipmap=this.flipped=!1;this.unpackAlignment=4;this.preMultiplyAlpha=!1;this.depth=1;this.isImmutable= !1}}a.TextureDescriptor=l;a.estimateMemory=function(p){return 0>=p.width||0>=p.height?0:Math.round(p.width*p.height*(p.hasMipmap?4/3:1)*(null==p.internalFormat?4:q.getBytesPerElementFormat(p.internalFormat)))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ValidatedTextureDescriptor":function(){define(["exports","./enums","./TextureDescriptor"],function(a,b,q){class l extends q.TextureDescriptor{constructor(p,k){super();this.context=p;Object.assign(this,k);switch(this.internalFormat){case b.SizedPixelFormat.R16F:case b.SizedPixelFormat.R16I:case b.SizedPixelFormat.R16UI:case b.SizedPixelFormat.R32F:case b.SizedPixelFormat.R32I:case b.SizedPixelFormat.R32UI:case b.SizedPixelFormat.R8_SNORM:case b.SizedPixelFormat.R8:case b.SizedPixelFormat.R8I:case b.SizedPixelFormat.R8UI:this.pixelFormat= b.PixelFormat.RED}}static validate(p,k){return new l(p,k)}}a.ValidatedTextureDescriptor=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/textureUtils":function(){define(["exports","../../../../core/Error"],function(a,b){function q(p,k,h){if(p instanceof ImageData)return q(l(p),k,h);const f=document.createElement("canvas");f.width=k;f.height=h;f.getContext("2d").drawImage(p,0,0,f.width,f.height);return f}function l(p){const k=document.createElement("canvas"); k.width=p.width;k.height=p.height;const h=k.getContext("2d");if(null==h)throw new b("Failed to create 2d context from HTMLCanvasElement");h.putImageData(p,0,0);return k}a.applyTextureResizeFloorModulo=function(p){return 16*Math.floor(p/16)};a.applyTextureResizeModulo=function(p){return 16*Math.ceil(p/16)};a.downsampleImage=function(p,k){let h=p.width*p.height;if(4096>h)return p instanceof ImageData?l(p):p;let f=p.width,c=p.height;do f=Math.ceil(f/2),c=Math.ceil(c/2),h=f*c;while(1048576k||c>k));return q(p,f,c)};a.ensureImageMaxSize=function(p,k){const h=Math.max(p.width,p.height);if(h<=k)return p;k/=h;return q(p,Math.round(p.width*k),Math.round(p.height*k))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/AtmosphereCompositing.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"], function(a,b,q,l,p){function k(c){const e=new l.ShaderBuilder;e.include(b.ScreenSpacePass);e.fragment.uniforms.add(new p.Texture2DPassUniform("colorTexture",g=>g.color),new p.Texture2DPassUniform("depthTexture",g=>g.depth));e.fragment.code.add(q.glsl` void main() { float depthSample = texture(depthTexture, uv).r; if (depthSample ${c.haze?q.glsl`== 1.0`:q.glsl`!= 1.0`} ) { fragColor = vec4(0); return; } fragColor = texture(colorTexture, uv); } `);return e}class h extends q.NoParameters{}const f=Object.freeze(Object.defineProperty({__proto__:null,AtmosphereCompositingPassParameters:h,build:k},Symbol.toStringTag,{value:"Module"}));a.AtmosphereCompositing=f;a.AtmosphereCompositingPassParameters=h;a.build=k})},"esri/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl":function(){define(["exports","../shaderModules/interfaces","../../lib/VertexAttribute"],function(a,b,q){a.ScreenSpacePass=function(l,p=!0){l.attributes.add(q.VertexAttribute.POSITION, "vec2");p&&l.varyings.add("uv","vec2");l.vertex.code.add(b.glsl` void main(void) { gl_Position = vec4(position, 0.0, 1.0); ${p?b.glsl`uv = position * 0.5 + vec2(0.5);`:""} } `)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/AtmosphereCompositing.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx, e.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){return this.configuration.haze?c.makePipelineState({blending:c.separateBlendingParams(f.BlendFactor.ONE,f.BlendFactor.ZERO,f.BlendFactor.ONE_MINUS_SRC_COLOR,f.BlendFactor.ONE),depthTest:{func:f.CompareFunction.ALWAYS},colorWrite:c.defaultColorWriteParams}):c.makePipelineState({blending:c.simpleBlendingParams(f.BlendFactor.SRC_ALPHA,f.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:{func:f.CompareFunction.ALWAYS},colorWrite:c.defaultColorWriteParams})}} e.shader=new q.ReloadableShaderModule(h.AtmosphereCompositing,()=>new Promise((g,d)=>a(["./AtmosphereCompositing.glsl"],g,d)));b.AtmosphereCompositingTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsComposition":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/maybe ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./CloudsCompositionTechnique ../webgl-engine/core/shaderModules/interfaces ../webgl-engine/lib/glUtil3D ../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.CloudsComposition=class extends q{constructor(v){super(v);this._technique=new e.CloudsCompositionTechnique(v);this._vao=d.createQuadVAO(v.rctx)}destroy(){this._technique=l.releaseMaybe(this._technique);this._vao=l.disposeMaybe(this._vao)}render(v){if(this._technique.compiled){var m=v.bindParameters.cloudsFade;null!=this._vao&&null!=m.data&&(m=v.rctx.bindTechnique(this._technique,v.bindParameters,w),v.rctx.bindVAO(this._vao),m.assertCompatibleVertexAttributeLocations(this._vao), v.rctx.drawArrays(t.PrimitiveType.TRIANGLE_STRIP,0,4))}else this.requestRender()}};b.__decorate([p.property({constructOnly:!0})],a.CloudsComposition.prototype,"rctx",void 0);b.__decorate([p.property({constructOnly:!0})],a.CloudsComposition.prototype,"viewingMode",void 0);b.__decorate([p.property({constructOnly:!0})],a.CloudsComposition.prototype,"planetRadius",void 0);b.__decorate([p.property({constructOnly:!0})],a.CloudsComposition.prototype,"requestRender",void 0);a.CloudsComposition=b.__decorate([c.subclass("esri.views.3d.environment.CloudsComposition")], a.CloudsComposition);const w=new g.NoParameters;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsCompositionTechnique":function(){define("require exports ../../../chunks/CloudsComposition.glsl ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g extends p.ShaderTechnique{constructor(d){super(d,new k.ShaderTechniqueConfiguration,()=>this.destroy())}initializeProgram(d){return new f.Program(d.rctx,g.shader.get().build(),h.Default3D)}initializePipeline(){return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ZERO,c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE),depthTest:{func:c.CompareFunction.LEQUAL},colorWrite:e.defaultColorWriteParams})}}g.shader=new l.ReloadableShaderModule(q.CloudsCompositionShader, ()=>new Promise((d,t)=>a(["./CloudsComposition.glsl"],d,t)));b.CloudsCompositionTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/CloudsComposition.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(){const u=new v.ShaderBuilder,{attributes:x,varyings:y,vertex:z,fragment:A}=u;x.add(m.VertexAttribute.POSITION,"vec2");y.add("worldRay","vec3");z.uniforms.add(new w.Matrix4PassUniform("inverseProjectionMatrix",(B,C)=>C.camera.inverseProjectionMatrix),new w.Matrix4PassUniform("inverseViewMatrix",(B,C)=>b.invertOrIdentity(n,C.camera.viewMatrix)));z.code.add(t.glsl`void main(void) { vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1.0, 1.0)).xyz; worldRay = (inverseViewMatrix * vec4(posViewNear, 0.0)).xyz; gl_Position = vec4(position, 1.0, 1.0); }`);A.include(e.ColorConversion);A.include(g.RgbaFloatEncoding);u.include(l.EvaluateAmbientLighting,{pbrMode:h.PBRMode.Disabled,lightingSphericalHarmonicsOrder:2});u.include(f.PiUtils);u.include(p.Gamma);u.include(k.MainLighting);u.include(c.CloudsParallaxShading);A.uniforms.add(new d.Float3PassUniform("cameraPosition",(B,C)=>C.camera.eye));A.code.add(t.glsl`void main() { vec4 cloudsColor = renderClouds(normalize(worldRay), cameraPosition); fragColor = vec4((1.0 - totalFadeInOut) * cloudsColor.rgb, cloudsColor.a); }`);return u}const n=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:r},Symbol.toStringTag,{value:"Module"}));a.CloudsCompositionShader=q;a.build=r})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl":function(){define("exports ../../../../../../chunks/vec32 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ./PhysicallyBasedRenderingParameters.glsl ../../shaderModules/Float3PassUniform ../../shaderModules/Float4PassUniform ../../shaderModules/interfaces".split(" "), function(a,b,q,l,p,k,h,f,c){const e=q.create(),g=p.create();a.EvaluateAmbientLighting=function(d,t){d=d.fragment;const w=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===w?(d.uniforms.add(new h.Float3PassUniform("lightingAmbientSH0",(v,m)=>b.set(e,m.lighting.sh.r[0],m.lighting.sh.g[0],m.lighting.sh.b[0]))),d.code.add(c.glsl`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { vec3 ambientLight = 0.282095 * lightingAmbientSH0; return ambientLight * (1.0 - ambientOcclusion); }`)):1===w?(d.uniforms.add(new f.Float4PassUniform("lightingAmbientSH_R",(v,m)=>l.set(g,m.lighting.sh.r[0],m.lighting.sh.r[1],m.lighting.sh.r[2],m.lighting.sh.r[3])),new f.Float4PassUniform("lightingAmbientSH_G",(v,m)=>l.set(g,m.lighting.sh.g[0],m.lighting.sh.g[1],m.lighting.sh.g[2],m.lighting.sh.g[3])),new f.Float4PassUniform("lightingAmbientSH_B",(v,m)=>l.set(g,m.lighting.sh.b[0],m.lighting.sh.b[1],m.lighting.sh.b[2],m.lighting.sh.b[3]))),d.code.add(c.glsl`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { vec4 sh0 = vec4( 0.282095, 0.488603 * normal.x, 0.488603 * normal.z, 0.488603 * normal.y ); vec3 ambientLight = vec3( dot(lightingAmbientSH_R, sh0), dot(lightingAmbientSH_G, sh0), dot(lightingAmbientSH_B, sh0) ); return ambientLight * (1.0 - ambientOcclusion); }`)):2===w&&(d.uniforms.add(new h.Float3PassUniform("lightingAmbientSH0",(v,m)=>b.set(e,m.lighting.sh.r[0],m.lighting.sh.g[0],m.lighting.sh.b[0])),new f.Float4PassUniform("lightingAmbientSH_R1",(v,m)=>l.set(g,m.lighting.sh.r[1],m.lighting.sh.r[2],m.lighting.sh.r[3],m.lighting.sh.r[4])),new f.Float4PassUniform("lightingAmbientSH_G1",(v,m)=>l.set(g,m.lighting.sh.g[1],m.lighting.sh.g[2],m.lighting.sh.g[3],m.lighting.sh.g[4])),new f.Float4PassUniform("lightingAmbientSH_B1",(v,m)=>l.set(g,m.lighting.sh.b[1], m.lighting.sh.b[2],m.lighting.sh.b[3],m.lighting.sh.b[4])),new f.Float4PassUniform("lightingAmbientSH_R2",(v,m)=>l.set(g,m.lighting.sh.r[5],m.lighting.sh.r[6],m.lighting.sh.r[7],m.lighting.sh.r[8])),new f.Float4PassUniform("lightingAmbientSH_G2",(v,m)=>l.set(g,m.lighting.sh.g[5],m.lighting.sh.g[6],m.lighting.sh.g[7],m.lighting.sh.g[8])),new f.Float4PassUniform("lightingAmbientSH_B2",(v,m)=>l.set(g,m.lighting.sh.b[5],m.lighting.sh.b[6],m.lighting.sh.b[7],m.lighting.sh.b[8]))),d.code.add(c.glsl`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { vec3 ambientLight = 0.282095 * lightingAmbientSH0; vec4 sh1 = vec4( 0.488603 * normal.x, 0.488603 * normal.z, 0.488603 * normal.y, 1.092548 * normal.x * normal.y ); vec4 sh2 = vec4( 1.092548 * normal.y * normal.z, 0.315392 * (3.0 * normal.z * normal.z - 1.0), 1.092548 * normal.x * normal.z, 0.546274 * (normal.x * normal.x - normal.y * normal.y) ); ambientLight += vec3( dot(lightingAmbientSH_R1, sh1), dot(lightingAmbientSH_G1, sh1), dot(lightingAmbientSH_B1, sh1) ); ambientLight += vec3( dot(lightingAmbientSH_R2, sh2), dot(lightingAmbientSH_G2, sh2), dot(lightingAmbientSH_B2, sh2) ); return ambientLight * (1.0 - ambientOcclusion); }`),t.pbrMode!==k.PBRMode.Normal&&t.pbrMode!==k.PBRMode.Schematic||d.code.add(c.glsl`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0); vec3 calculateAmbientRadiance(float ambientOcclusion) { vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2; return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance; }`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl":function(){define("exports ../attributes/VertexTextureCoordinates.glsl ../../shaderModules/Float3DrawUniform ../../shaderModules/Float3PassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DDrawUniform ../../shaderModules/Texture2DPassUniform ../../shaderTechnique/BindType ../../../lib/GLTextureMaterial".split(" "),function(a, b,q,l,p,k,h,f,c){a.PBRMode=void 0;(function(g){g[g.Disabled=0]="Disabled";g[g.Normal=1]="Normal";g[g.Schematic=2]="Schematic";g[g.Water=3]="Water";g[g.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh";g[g.Simplified=5]="Simplified";g[g.TerrainWithWater=6]="TerrainWithWater";g[g.COUNT=7]="COUNT"})(a.PBRMode||(a.PBRMode={}));class e extends c.GLTextureMaterialBindParameters{}a.PBRBindParameters=e;a.PhysicallyBasedRenderingParameters=function(g,d){const t=g.fragment,w=d.hasMetallicRoughnessTexture||d.hasEmissionTexture|| d.hasOcclusionTexture;d.pbrMode===a.PBRMode.Normal&&w&&g.include(b.VertexTextureCoordinates,d);d.pbrMode===a.PBRMode.Schematic?t.code.add(p.glsl`vec3 mrr = vec3(0.0, 0.6, 0.2); vec3 emission = vec3(0.0); float occlusion = 1.0; void applyPBRFactors() {} float getBakedOcclusion() { return 1.0; }`):d.pbrMode===a.PBRMode.Disabled?t.code.add(p.glsl`float getBakedOcclusion() { return 1.0; }`):d.pbrMode===a.PBRMode.Normal&&(t.code.add(p.glsl`vec3 mrr; vec3 emission; float occlusion;`),g=d.pbrTextureBindType,d.hasMetallicRoughnessTexture&&(t.uniforms.add(g===f.BindType.Pass?new h.Texture2DPassUniform("texMetallicRoughness",v=>v.textureMetallicRoughness):new k.Texture2DDrawUniform("texMetallicRoughness",v=>v.textureMetallicRoughness)),t.code.add(p.glsl`void applyMetallnessAndRoughness(vec2 uv) { vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb; mrr[0] *= metallicRoughness.b; mrr[1] *= metallicRoughness.g; }`)),d.hasEmissionTexture&&(t.uniforms.add(g===f.BindType.Pass?new h.Texture2DPassUniform("texEmission",v=>v.textureEmissive):new k.Texture2DDrawUniform("texEmission",v=>v.textureEmissive)),t.code.add(p.glsl`void applyEmission(vec2 uv) { emission *= textureLookup(texEmission, uv).rgb; }`)),d.hasOcclusionTexture?(t.uniforms.add(g===f.BindType.Pass?new h.Texture2DPassUniform("texOcclusion",v=>v.textureOcclusion):new k.Texture2DDrawUniform("texOcclusion",v=>v.textureOcclusion)),t.code.add(p.glsl`void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; } float getBakedOcclusion() { return occlusion; }`)):t.code.add(p.glsl`float getBakedOcclusion() { return 1.0; }`),g===f.BindType.Pass?t.uniforms.add(new l.Float3PassUniform("emissionFactor",v=>v.emissiveFactor),new l.Float3PassUniform("mrrFactors",v=>v.mrrFactors)):t.uniforms.add(new q.Float3DrawUniform("emissionFactor",v=>v.emissiveFactor),new q.Float3DrawUniform("mrrFactors",v=>v.mrrFactors)),t.code.add(p.glsl` void applyPBRFactors() { mrr = mrrFactors; emission = emissionFactor; occlusion = 1.0; ${d.hasMetallicRoughnessTexture?p.glsl`applyMetallnessAndRoughness(${d.hasMetallicRoughnessTextureTransform?p.glsl`metallicRoughnessUV`:"vuv0"});`:""} ${d.hasEmissionTexture?p.glsl`applyEmission(${d.hasEmissiveTextureTransform?p.glsl`emissiveUV`:"vuv0"});`:""} ${d.hasOcclusionTexture?p.glsl`applyOcclusion(${d.hasOcclusionTextureTransform?p.glsl`occlusionUV`:"vuv0"});`:""} } `))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl":function(){define(["exports","../../../../../../core/compilerUtils","./TextureCoordinateAttribute.glsl","../util/TextureAtlasLookup.glsl","../../shaderModules/interfaces"],function(a,b,q,l,p){a.VertexTextureCoordinates=function(k,h){k.include(q.TextureCoordinateAttribute,h);switch(h.textureCoordinateType){case q.TextureCoordinateAttributeType.Default:case q.TextureCoordinateAttributeType.Compressed:k.fragment.code.add(p.glsl`vec4 textureLookup(sampler2D tex, vec2 uv) { return texture(tex, uv); }`);break;case q.TextureCoordinateAttributeType.Atlas:k.include(l.TextureAtlasLookup);k.fragment.code.add(p.glsl`vec4 textureLookup(sampler2D tex, vec2 uv) { return textureAtlasLookup(tex, uv, vuvRegion); }`);break;default:b.neverReached(h.textureCoordinateType);case q.TextureCoordinateAttributeType.None:case q.TextureCoordinateAttributeType.COUNT:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.TextureAtlasLookup=function(q){q.fragment.code.add(b.glsl`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) { vec2 atlasScale = atlasRegion.zw - atlasRegion.xy; vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy; float maxdUV = 0.125; vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale; vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale; return textureGrad(tex, uvAtlas, dUVdx, dUVdy); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec3",q.BindType.Draw,(h,f,c,e)=>h.setUniform3fv(p,k(f,c,e)))}}a.Float3DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform":function(){define(["exports", "./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"sampler2D",q.BindType.Draw,(h,f,c)=>h.bindTexture(p,k(f,c)))}}a.Texture2DDrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GLTextureMaterial":function(){define("exports ../../../../core/maybe ../../../../core/promiseUtils ../core/shaderModules/interfaces ./basicInterfaces ./GLMaterial".split(" "),function(a,b,q,l,p,k){class h extends k{constructor(c){super(c); this._numLoading=0;this._disposed=!1;this._textures=c.textures;this._textureId=c.textureId;this._acquire(c.textureId,e=>this._texture=e);this._acquire(c.normalTextureId,e=>this._textureNormal=e);this._acquire(c.emissiveTextureId,e=>this._textureEmissive=e);this._acquire(c.occlusionTextureId,e=>this._textureOcclusion=e);this._acquire(c.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){this._texture=b.releaseMaybe(this._texture);this._textureNormal=b.releaseMaybe(this._textureNormal); this._textureEmissive=b.releaseMaybe(this._textureEmissive);this._textureOcclusion=b.releaseMaybe(this._textureOcclusion);this._textureMetallicRoughness=b.releaseMaybe(this._textureMetallicRoughness);this._disposed=!0}ensureResources(c){return 0===this._numLoading?p.ResourceState.LOADED:p.ResourceState.LOADING}get textureBindParameters(){return new f(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture: null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(c){if(null==this._texture||c!==this._texture.id)this._texture=b.releaseMaybe(this._texture),this._textureId=c,this._acquire(this._textureId,e=>this._texture=e)}_acquire(c,e){null==c?e(null):(c=this._textures.acquire(c),q.isPromiseLike(c)?(++this._numLoading,c.then(g=>{this._disposed?(b.releaseMaybe(g),e(null)):e(g)}).finally(()=> --this._numLoading)):e(c))}}class f extends l.NoParameters{constructor(c=null,e=null,g=null,d=null,t=null,w,v){super();this.texture=c;this.textureNormal=e;this.textureEmissive=g;this.textureOcclusion=d;this.textureMetallicRoughness=t;this.scale=w;this.normalTextureTransformMatrix=v}}a.GLTextureMaterial=h;a.GLTextureMaterialBindParameters=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GLMaterial":function(){define(["./basicInterfaces"],function(a){class b{constructor(q){this._material= q.material;this._techniques=q.techniques;this._output=q.output}dispose(){this._techniques.release(this._technique)}get technique(){return this._technique}get _stippleTextures(){return this._techniques.constructionContext.stippleTextures}get _markerTextures(){return this._techniques.constructionContext.markerTextures}ensureTechnique(q,l){return this._technique=this._techniques.releaseAndAcquire(q,this._material.getConfiguration(this._output,l),this._technique)}ensureResources(q){return a.ResourceState.LOADED}} return b})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.PiUtils=function(q){q.vertex.code.add(b.glsl`const float PI = 3.141592653589793;`);q.fragment.code.add(b.glsl`const float PI = 3.141592653589793; const float LIGHT_NORMALIZATION = 1.0 / PI; const float INV_PI = 0.3183098861837907; const float HALF_PI = 1.570796326794897;`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl":function(){define("exports ../../../../../../core/mathUtils ../../../../../../geometry/support/Ellipsoid ../../../../environment/CloudsData ../../../../environment/CloudsParameters ../../../../environment/weather ../shading/MainLighting.glsl ../../shaderModules/BooleanPassUniform ../../shaderModules/Float3PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix4PassUniform ../../shaderModules/TextureCubePassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.CloudsParallaxShading=function(w){w=w.fragment;w.uniforms.add(new d.Matrix4PassUniform("rotationMatrixClouds",(v,m)=>m.cloudsFade.parallax.transform),new d.Matrix4PassUniform("rotationMatrixCloudsCrossFade",(v,m)=>m.cloudsFade.parallaxNew.transform),new c.Float3PassUniform("anchorPosition",(v,m)=>m.cloudsFade.parallax.anchorPointClouds),new c.Float3PassUniform("anchorPositionCrossFade",(v,m)=>m.cloudsFade.parallaxNew.anchorPointClouds),new e.FloatPassUniform("cloudsHeight", ()=>k.cloudsHeight),new e.FloatPassUniform("radiusCurvatureCorrectionFactor",(v,m)=>m.cloudsFade.parallax.radiusCurvatureCorrectionFactor),new e.FloatPassUniform("totalFadeInOut",(v,m)=>1-m.cloudsFade.opacity),new e.FloatPassUniform("crossFadeAnchorFactor",(v,m)=>b.clamp(m.cloudsFade.fadeFactor,0,1)),new t.TextureCubePassUniform("cubeMap",(v,m)=>m.cloudsFade.data?.cubeMap?.colorTexture??null),new f.BooleanPassUniform("crossFade",(v,m)=>m.cloudsFade.fadeMode===p.FadeMode.CROSS_FADE),new f.BooleanPassUniform("readChannelsRG", (v,m)=>m.cloudsFade.readChannels===l.CloudsTextureChannels.RG),new f.BooleanPassUniform("fadeTextureChannels",(v,m)=>m.cloudsFade.renderingStage===l.CloudsRenderingStages.FADING));w.constants.add("planetRadius","float",q.earth.radius);w.code.add(g.glsl`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos) { float radiusClouds = planetRadius + cloudsHeight; float B = 2.0 * dot(cameraPosition, dir); float C = dot(cameraPosition, cameraPosition) - radiusClouds * radiusClouds; float det = B * B - 4.0 * C; float pointIntDist = max(0.0, 0.5 *(-B + sqrt(det))); vec3 intersectionPont = cameraPosition + dir * pointIntDist; intersectionPont = intersectionPont - spherePos; return intersectionPont; }`);w.code.add(g.glsl`vec3 correctForPlanetCurvature(vec3 dir) { dir.z = dir.z*(1.-radiusCurvatureCorrectionFactor) + radiusCurvatureCorrectionFactor; return dir; }`);w.code.add(g.glsl`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec) { return (rotMat * vec4(inVec, 0.0)).xyz; }`);h.addMainLightDirection(w);h.addMainLightIntensity(w);w.code.add(g.glsl`const float SUNSET_TRANSITION_FACTOR = 0.3; const vec3 RIM_COLOR = vec3(0.28, 0.175, 0.035); const float RIM_SCATTERING_FACTOR = 140.0; const float BACKLIGHT_FACTOR = 0.2; const float BACKLIGHT_SCATTERING_FACTOR = 10.0; const float BACKLIGHT_TRANSITION_FACTOR = 0.3; vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds) { float upDotLight = dot(normalize(cameraPosition), normalize(mainLightDirection)); float dirDotLight = max(dot(normalize(-worldSpaceRay), normalize(mainLightDirection)), 0.0); float sunsetTransition = clamp(pow(max(upDotLight, 0.0), SUNSET_TRANSITION_FACTOR), 0.0, 1.0); vec3 ambientLight = calculateAmbientIrradiance(normalize(cameraPosition), 0.0); vec3 mainLight = evaluateMainLighting(normalize(cameraPosition), 0.0); vec3 combinedLight = clamp((mainLightIntensity + ambientLight )/PI, vec3(0.0), vec3(1.0)); vec3 baseCloudColor = pow(combinedLight * pow(clouds.xyz, vec3(GAMMA)), vec3(INV_GAMMA)); float scatteringMod = max(clouds.a < 0.5 ? clouds.a / 0.5 : - clouds.a / 0.5 + 2.0, 0.0); float rimLightIntensity = 0.5 + 0.5 *pow(max(upDotLight, 0.0), 0.35); vec3 directSunScattering = RIM_COLOR * rimLightIntensity * (pow(dirDotLight, RIM_SCATTERING_FACTOR)) * scatteringMod; float additionalLight = BACKLIGHT_FACTOR * pow(dirDotLight, BACKLIGHT_SCATTERING_FACTOR) * (1. - pow(sunsetTransition, BACKLIGHT_TRANSITION_FACTOR)) ; return vec3(baseCloudColor * (1. + additionalLight) + directSunScattering); }`);w.code.add(g.glsl`vec4 getCloudData(vec3 rayDir, bool readOtherChannel) { vec4 cloudData = texture(cubeMap, rayDir); float mu = dot(rayDir, vec3(0, 0, 1)); bool readChannels = readChannelsRG ^^ readOtherChannel; if (readChannels) { cloudData = vec4(vec3(cloudData.r), cloudData.g); } else { cloudData = vec4(vec3(cloudData.b), cloudData.a); } if (length(cloudData) == 0.0) { return vec4(cloudData.rgb, 1.0); } return cloudData; }`);w.code.add(g.glsl`vec4 renderCloudsNoFade(vec3 worldRay, vec3 cameraPosition) { vec3 intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPosition); vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixClouds, normalize(intersectionPoint)); vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); vec4 cloudData = getCloudData(worldRayRotatedCorrected, false); float totalTransmittance = clamp(cloudData.a * (1.0 - totalFadeInOut) + totalFadeInOut, 0.0 , 1.0); if (length(cloudData.rgb) == 0.0) { totalTransmittance = 1.0; } return vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), totalTransmittance); }`);w.code.add(g.glsl`vec4 renderCloudsCrossFade(vec3 worldRay, vec3 cameraPosition) { vec3 intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPosition); vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixClouds, normalize(intersectionPoint)); vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); vec4 cloudData = getCloudData(worldRayRotatedCorrected, false); vec4 cloudColor = vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), cloudData.a); intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPositionCrossFade); worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixCloudsCrossFade, normalize(intersectionPoint)); worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); cloudData = getCloudData(worldRayRotatedCorrected, fadeTextureChannels); vec4 cloudColorCrossFade = vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), cloudData.a); cloudColor = mix(cloudColor, cloudColorCrossFade, crossFadeAnchorFactor); float totalTransmittance = clamp(cloudColor.a * (1.0 - totalFadeInOut) + totalFadeInOut, 0.0 , 1.0); if (length(cloudColor.rgb) == 0.0) { totalTransmittance = 1.0; } return vec4(cloudColor.rgb, totalTransmittance); }`);w.code.add(g.glsl`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition) { return crossFade ? renderCloudsCrossFade(worldRay, cameraPosition) : renderCloudsNoFade(worldRay, cameraPosition); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsData":function(){define(["exports"],function(a){a.CloudsRenderingStages=void 0;(function(b){b[b.RENDERING=0]="RENDERING";b[b.FADING=1]="FADING";b[b.FINISHED=2]="FINISHED"})(a.CloudsRenderingStages||(a.CloudsRenderingStages={}));a.CloudsTextureChannels=void 0;(function(b){b[b.RG=0]="RG";b[b.BA=1]="BA"})(a.CloudsTextureChannels||(a.CloudsTextureChannels={}));a.ensureClouds=function(b){return null!= b&&!b.running};a.isReadyCloudsData=function(b){return null!=b?.cubeMap};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsParameters":function(){define("exports ../../../core/mathUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/support/axisAngleDegrees ../../../geometry/support/Ellipsoid ./CloudsData ./weather ../../support/RenderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){class d{constructor(){this.readChannels=c.CloudsTextureChannels.RG;this.renderingStage=c.CloudsRenderingStages.FINISHED;this.startTimeHeightFade=this.startTime=0;this.cameraPositionLastFrame=k.create();this.parallax=new t;this.parallaxNew=new t;this.pointOnGround=k.create();this.fadeMode=a.FadeMode.HIDE;this.opacity=this.fadeFactor=0}updateParallax(r){var n=this.parallax;r=p.length(r.eye);n.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(r*r-f.earth.radius*f.earth.radius, 0))/r;h.fromPoints(w,n.anchorPointClouds,v);q.rotate(n.transform,l.IDENTITY,v[3],h.axis(v));this.fadeMode===a.FadeMode.CROSS_FADE&&(n=this.parallaxNew,h.fromPoints(w,n.anchorPointClouds,v),q.rotate(n.transform,l.IDENTITY,v[3],h.axis(v)))}updateFading(r,n,u,x){this.isFading&&this._advanceFading(u,x);this._evaluateFading(r,n,u)}_evaluateFading(r,n,u){const x=r.relativeElevation;r=this._calculateDistanceToAnchorPoint(r);(x>1.7*e.weatherHeightLimit||x<-e.weatherHeightLimit||2E5e.weatherHeightLimit||x<-.35*e.weatherHeightLimit||64E3=-.35*e.weatherHeightLimit&&n===g.RenderState.IDLE&&c.ensureClouds(this.data)&&(0===this.opacity?this._setFade(a.FadeMode.FADE_IN,u):(34E3this.fadeFactor?(this.fadeFactor=n?b.clamp((r-this.startTime)/(1.25*n),0,1):1,this.fadeMode===a.FadeMode.FADE_OUT&&(this.opacity=1-this.fadeFactor),this.fadeMode===a.FadeMode.FADE_IN&&(this.opacity=this.fadeFactor),this.fadeMode===a.FadeMode.CROSS_FADE&&(this.opacity=1)):(this.fadeFactor=0,this.fadeMode===a.FadeMode.FADE_OUT&&(this.opacity=0),this.fadeMode===a.FadeMode.FADE_IN&&(this.opacity=1),this.fadeMode===a.FadeMode.CROSS_FADE&&(this.opacity=1),this.fadeMode= a.FadeMode.NONE)}_switchReadChannels(){const r=this.fadeMode===a.FadeMode.CROSS_FADE&&1===this.fadeFactor,n=this.fadeMode===a.FadeMode.FADE_IN&&0===this.fadeFactor;this.renderingStage===c.CloudsRenderingStages.FADING&&(r||n)&&(this.readChannels=1-this.readChannels,this.renderingStage=c.CloudsRenderingStages.FINISHED)}_calculateDistanceToAnchorPoint(r){p.normalize(this.pointOnGround,r.eye);p.scale(this.pointOnGround,this.pointOnGround,f.earth.radius);return p.length(p.subtract(m,this.parallax.anchorPointClouds, this.pointOnGround))}_updateAnchorPoint(){this.fadeMode===a.FadeMode.CROSS_FADE&&(0===this.fadeFactor&&p.copy(this.parallaxNew.anchorPointClouds,this.pointOnGround),1===this.fadeFactor&&p.copy(this.parallax.anchorPointClouds,this.parallaxNew.anchorPointClouds));this.fadeMode===a.FadeMode.FADE_IN&&0===this.fadeFactor&&p.copy(this.parallax.anchorPointClouds,this.pointOnGround)}_setFade(r,n){switch(r){case a.FadeMode.HIDE:this.opacity=0;break;case a.FadeMode.FADE_OUT:this.opacity=1;break;case a.FadeMode.FADE_IN:this.opacity= 0;break;case a.FadeMode.CROSS_FADE:this.opacity=1}this.fadeMode=r;this.fadeFactor=0;this.startTime=n}get isFading(){return this.fadeMode===a.FadeMode.FADE_OUT||this.fadeMode===a.FadeMode.FADE_IN||this.fadeMode===a.FadeMode.CROSS_FADE}}a.FadeMode=void 0;(function(r){r[r.NONE=0]="NONE";r[r.HIDE=1]="HIDE";r[r.FADE_OUT=2]="FADE_OUT";r[r.FADE_IN=3]="FADE_IN";r[r.CROSS_FADE=4]="CROSS_FADE"})(a.FadeMode||(a.FadeMode={}));class t{constructor(){this.anchorPointClouds=k.create();this.radiusCurvatureCorrectionFactor= 0;this.transform=l.create()}}const w=k.fromValues(0,0,1),v=h.create(),m=k.create();a.CloudsParameters=d;a.crossFadeDistanceThreshold=34E3;a.fadeOutDistanceThreshold=64E3;a.hideDistanceThreshold=2E5;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/RenderState":function(){define(["exports"],function(a){a.RenderState=void 0;var b=a.RenderState||(a.RenderState={});b[b.ANIMATING=0]="ANIMATING";b[b.INTERACTING=1]="INTERACTING";b[b.IDLE=2]="IDLE";Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"bool",q.BindType.Pass,(h,f,c)=>h.setUniform1b(p,k(f,c)))}}a.BooleanPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/TextureCubePassUniform":function(){define(["exports","./Uniform", "../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"samplerCube",q.BindType.Pass,(h,f,c)=>h.bindTexture(p,k(f,c)))}}a.TextureCubePassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.ColorConversion=function(q){q.code.add(b.glsl`vec4 premultiplyAlpha(vec4 v) { return vec4(v.rgb * v.a, v.a); } vec3 rgb2hsv(vec3 c) { vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); float d = q.x - min(q.w, q.y); float e = 1.0e-10; return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); } vec3 hsv2rgb(vec3 c) { vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); } float rgb2v(vec3 c) { return max(c.x, max(c.y, c.z)); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsGenerator":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../core/libs/gl-matrix-2/factories/vec3f32 ../../../geometry/ellipsoidUtils ../../../chunks/Clouds.glsl ./CloudsData ./CloudsParameters ./CloudsPresets ./CloudsTechnique ./CloudsTechniqueConfiguration ./NoiseTextureAtlas ../webgl-engine/lib/BindParameters ../webgl-engine/lib/glUtil3D ../../support/Scheduler ../../support/Yield ../../webgl/enums ../../webgl/FramebufferObject ../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I){a.CloudsGenerator=class extends q{constructor(M){super(M);this._techniques=[];this._techniqueConfiguration=new B.CloudsTechniqueConfiguration;this._bindParameters=new D.BindParameters(null,null);this._passParameters=new u.CloudsPassParameters;this._weatherTile=m.create();this._weatherTileCount=128;this._tileIndex=this._faceIndex=0;this.coverage=l.lerp(z.cloudPresets.default.coverage[0],z.cloudPresets.default.coverage[1],.5); this.density=l.lerp(z.cloudPresets.default.density[0],z.cloudPresets.default.density[1],.5);this.absorption=l.lerp(z.cloudPresets.default.absorption[0],z.cloudPresets.default.absorption[1],.5);this.cloudSize=l.lerp(z.cloudPresets.default.cloudSize[0],z.cloudPresets.default.cloudSize[1],.5);this.detailSize=l.lerp(z.cloudPresets.default.detailSize[0],z.cloudPresets.default.detailSize[1],.5);this.smoothness=l.lerp(z.cloudPresets.default.smoothness[0],z.cloudPresets.default.smoothness[1],.5);this.cloudHeight= l.lerp(z.cloudPresets.default.cloudHeight[0],z.cloudPresets.default.cloudHeight[1],.5);this.raymarchingSteps=z.cloudPresets.default.raymarchingSteps;this._viewMatrix=w.create();this.running=this._dirty=!1;this._vao=F.createQuadVAO(M.context.renderContext.rctx)}_getTechnique(M){const K=1-this.context.renderContext.bindParameters.cloudsFade.readChannels,J=K===x.CloudsTextureChannels.RG?2*M:2*M+1,R=this._techniques[J];if(R)return R;this._techniqueConfiguration.writeTextureChannels=K;this._techniqueConfiguration.steps= M;this._techniques[J]=new A.CloudsTechnique({rctx:this.context.renderContext.rctx,viewingMode:this.view.state.viewingMode},this._techniqueConfiguration);return this._techniques[J]}updateWeatherTile(){var M=this.view.camera.position.latitude,K=this.view.camera.position.longitude;null!=M&&null!=K&&(v.set(this._weatherTile,(M+90)/180,(K+180)/360),M=Math.floor(this._weatherTileCount*Math.abs(2*this._weatherTile[0]-1)),this._weatherTile[0]=Math.floor(2*this._weatherTileCount*this._weatherTile[0]),this._weatherTile[1]= Math.floor(4*(this._weatherTileCount-M)*this._weatherTile[1]),K=M=0,null!=this.view.environment&&"virtual"!==this.view.environment.lighting.type&&null!=this.view.environment.lighting.date&&(K=new Date(this.view.environment.lighting.date),K.setUTCHours(this.view.environment.lighting.date.getUTCHours()+(this.view.environment.lighting.displayUTCOffset??0)),M=31*K.getUTCMonth()+K.getUTCDate(),K=K.getUTCFullYear()),this._weatherTile[0]=(this._weatherTile[0]+M)%(2*this._weatherTileCount),this._weatherTile[1]= (this._weatherTile[1]+K%100)%(4*this._weatherTileCount),v.equals(this._passParameters.weatherTile,this._weatherTile)||this.setDirty())}initialize(){const M=n.getReferenceEllipsoid(this.view.spatialReference);this._passParameters.cloudRadius=.5*M.radius;this.setDirty();this.updateWeatherTile();this.addHandles([this.view.resourceController.scheduler.registerTask(H.TaskPriority.CLOUDS_GENERATOR,this),k.watch(()=>[this.coverage,this.density,this.absorption,this.cloudSize,this.detailSize,this.smoothness, this.cloudHeight,this.raymarchingSteps],()=>this.setDirty(),k.initial)])}destroy(){this._techniques.forEach(M=>p.releaseMaybe(M));this._frameBufferCube=p.disposeMaybe(this._frameBufferCube);this._techniques.length=0;this._vao.dispose();this._passParameters.noiseTexture=p.destroyMaybe(this._passParameters.noiseTexture)}get _tilesPerFace(){switch(this._techniqueConfiguration.steps){case B.RayMarchingSteps.SIXTEEN:return 1;case B.RayMarchingSteps.HUNDRED:return 4;case B.RayMarchingSteps.COUNT:case B.RayMarchingSteps.TWOHUNDRED:return 8}}get usedMemory(){return(this._frameBufferCube?.usedMemory?? 0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){let M;(M=this._passParameters).noiseTexture??(M.noiseTexture=new C.NoiseTextureAtlas({context:this.context}));this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile);return null!=this._passParameters.noiseTexture.textureAtlas}_ensureFrameBufferCube(M){null==this._frameBufferCube&&(M=new I.TextureDescriptor(M),M.target=E.TextureType.TEXTURE_CUBE_MAP,M.wrapMode=E.TextureWrapMode.CLAMP_TO_EDGE, this._frameBufferCube=new G.FramebufferObject(this.context.renderContext.rctx,M));return this._frameBufferCube}get cubeMap(){return this._frameBufferCube}destroyFrameBufferCube(){this._frameBufferCube=p.disposeMaybe(this._frameBufferCube)}applyPreset(M,K){const J=M.median,R=Q=>{const W=l.lerp(Q[0],Q[1],J);return.5>K?l.lerp(Q[0],W,2*K):l.lerp(W,Q[1],2*(K-.5))};this.coverage=R(M.coverage);this.density=R(M.density);this.absorption=R(M.absorption);this.cloudSize=R(M.cloudSize);this.detailSize=R(M.detailSize); this.smoothness=R(M.smoothness);this.cloudHeight=R(M.cloudHeight);this.raymarchingSteps=M.raymarchingSteps}setDirty(){this._dirty=this.running=!0}runTask(M){0===this._faceIndex&&0===this._tileIndex&&(this._passParameters.raymarchingSteps=this.raymarchingSteps,this.updateWeatherTile(),v.copy(this._passParameters.weatherTile,this._weatherTile));var K=this._getTechnique(this._passParameters.raymarchingSteps);if(!K.compiled||this.context.renderContext.bindParameters.cloudsFade.fadeMode===y.FadeMode.CROSS_FADE|| !this._ensureNoiseTexture())return N.Yield;0===this._faceIndex&&0===this._tileIndex&&(this.context.renderContext.bindParameters.cloudsFade.renderingStage=x.CloudsRenderingStages.RENDERING,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage, this._dirty=!1);t.targetTo(this._viewMatrix,P,O[this._faceIndex],L[this._faceIndex]);d.fromMat4(this._passParameters.viewMatrix,this._viewMatrix);const J=this.context.renderContext.rctx;var R=J.bindTechnique(K,this._bindParameters,this._passParameters);J.bindVAO(this._vao);R.assertCompatibleVertexAttributeLocations(this._vao);R=J.getViewport();K=K.configuration.cubeMapSize;const Q=K/this._tilesPerFace;J.setViewport(0,this._tileIndex*Q,K,Q);K=this._ensureFrameBufferCube(K);J.bindFramebuffer(K);K.setColorTextureTarget(E.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X+ this._faceIndex);J.gl.drawArrays(J.gl.TRIANGLE_STRIP,0,4);J.gl.flush();J.setViewport(R.x,R.y,R.width,R.height);this.requestRender();++this._tileIndex;4===this._faceIndex&&this._tileIndex===this._tilesPerFace?(this.running=this._dirty,this._tileIndex=this._faceIndex=0,this.running||(this.context.renderContext.bindParameters.cloudsFade.renderingStage=x.CloudsRenderingStages.FADING)):this._tileIndex===this._tilesPerFace&&(++this._faceIndex,this._tileIndex=0);M.madeProgress();return N.Yield}};b.__decorate([h.property({constructOnly:!0})], a.CloudsGenerator.prototype,"context",void 0);b.__decorate([h.property({constructOnly:!0})],a.CloudsGenerator.prototype,"view",void 0);b.__decorate([h.property({constructOnly:!0})],a.CloudsGenerator.prototype,"requestRender",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"coverage",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"density",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"absorption",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype, "cloudSize",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"detailSize",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"smoothness",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"cloudHeight",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"raymarchingSteps",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"running",void 0);a.CloudsGenerator=b.__decorate([g.subclass("esri.views.3d.environment.CloudsGenerator")],a.CloudsGenerator); const O=[r.fromValues(1,0,0),r.fromValues(-1,0,0),r.fromValues(0,1,0),r.fromValues(0,-1,0),r.fromValues(0,0,1)],L=[r.fromValues(0,1,0),r.fromValues(0,1,0),r.fromValues(0,0,-1),r.fromValues(0,0,1),r.fromValues(0,1,0)],P=r.zeros();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/vec3f32":function(){define(["exports"],function(a){function b(){return new Float32Array(3)}function q(r){const n=new Float32Array(3);n[0]=r[0];n[1]=r[1];n[2]=r[2];return n} function l(r,n,u){const x=new Float32Array(3);x[0]=r;x[1]=n;x[2]=u;return x}function p(r,n){return new Float32Array(r,n,3)}function k(){return b()}function h(){return l(1,1,1)}function f(){return l(1,0,0)}function c(){return l(0,1,0)}function e(){return l(0,0,1)}const g=b(),d=h(),t=f(),w=c(),v=e(),m=Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:t,UNIT_Y:w,UNIT_Z:v,ZEROS:g,clone:q,create:b,createView:p,fromValues:l,ones:h,unitX:f,unitY:c,unitZ:e,zeros:k},Symbol.toStringTag,{value:"Module"})); a.ONES=d;a.UNIT_X=t;a.UNIT_Y=w;a.UNIT_Z=v;a.ZEROS=g;a.clone=q;a.create=b;a.createView=p;a.fromValues=l;a.ones=h;a.unitX=f;a.unitY=c;a.unitZ=e;a.vec3f32=m;a.zeros=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Clouds.glsl":function(){define("exports ../core/mathUtils ../core/libs/gl-matrix-2/factories/mat3f64 ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ../views/3d/environment/CloudsPresets ../views/3d/environment/CloudsTechniqueConfiguration ../views/3d/environment/NoiseTextureAtlasDimensions ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(x){const y=new w.ShaderBuilder;y.include(c.ScreenSpacePass,!1);const z=y.fragment;z.uniforms.add(new g.FloatPassUniform("cloudRadius",A=>A.cloudRadius),new g.FloatPassUniform("power",A=>b.lerp(35,120,A.absorption)),new g.FloatPassUniform("sigmaE",A=>1+A.absorption),new g.FloatPassUniform("density",A=>b.lerp(0,.3,A.density)),new g.FloatPassUniform("cloudSize",A=>b.lerp(0,.02,Math.max(.01,1-A.cloudSize))),new g.FloatPassUniform("detailSize",A=>b.lerp(0, .2,Math.max(.01,1-A.detailSize))),new g.FloatPassUniform("smoothness",A=>b.lerp(0,.5,1-A.smoothness)),new g.FloatPassUniform("cloudHeight",A=>b.lerp(0,1500,A.cloudHeight)),new g.FloatPassUniform("coverage",A=>A.coverage),new t.Matrix3PassUniform("view",A=>A.viewMatrix),new v.Texture2DPassUniform("cloudShapeTexture",A=>null!=A.noiseTexture?A.noiseTexture.textureAtlas:null),new e.Float2PassUniform("cloudVariables",A=>l.set(n,A.coverage,A.absorption)));z.constants.add("halfCubeMapSize","float",.5*x.cubeMapSize); z.code.add(d.glsl` const int STEPS = ${x.steps===h.RayMarchingSteps.SIXTEEN?d.glsl`16`:x.steps===h.RayMarchingSteps.HUNDRED?d.glsl`100`:d.glsl`200`}; const int STEPS_LIGHT = 6; const float stepL = 300.0 / float(STEPS_LIGHT); const float cloudStart = 1500.0; vec3 rayDirection(vec2 fragCoord) { vec2 xy = fragCoord - halfCubeMapSize; return normalize(vec3(-xy, -halfCubeMapSize)); } float remap(float x, float low1, float high1, float low2, float high2) { return low2 + (x - low1) * (high2 - low2) / (high1 - low1); } float saturate(float x) { return clamp(x, 0.0, 1.0); }`);z.code.add(d.glsl` float getCloudShape(vec3 pos, float pOffset) { const float textureWidth = ${d.glsl.float(f.atlasSize)}; const float dataWidth = ${d.glsl.float(f.atlasSize)}; const float tileRows = ${d.glsl.float(f.tileRows)}; const vec3 atlasDimensions = vec3(${d.glsl.float(f.tileSize)}, ${d.glsl.float(f.tileSize)}, tileRows * tileRows); //Change from Y being height to Z being height vec3 p = float(${d.glsl.float(f.textureScale)}) * pos.xzy; //Pixel coordinates of point in the 3D data vec3 coord = vec3(mod(p - pOffset * atlasDimensions, atlasDimensions)); float f = fract(coord.z); float level = floor(coord.z); float tileY = floor(level / tileRows); float tileX = level - tileY * tileRows; //The data coordinates are offset by the x and y tile, the two boundary cells between each tile pair and the initial boundary cell on the first row/column vec2 offset = atlasDimensions.x * vec2(tileX, tileY) + 2.0 * vec2(tileX, tileY) + 1.0; vec2 pixel = coord.xy + offset; vec2 data = texture(cloudShapeTexture, mod(pixel, dataWidth) / textureWidth).xy; return 1.0 - mix(data.x, data.y, f); } float getCloudMap(vec2 p){ // Shift the texture center to origin to avoid seam artifacts vec2 uv = (${d.glsl.float(f.weatherMapScale)} * p) / ${d.glsl.float(f.atlasSize)} + 0.5; return texture(cloudShapeTexture, uv).a; } `);z.code.add(d.glsl`float clouds(vec3 p) { float cloud = saturate(0.5 * mix(0.0, 1.0, min(2.0 * coverage, 1.0))); if (cloud <= 0.0) { return 0.0; } float cloudMap = getCloudMap(cloudSize * p.xy); cloud = mix(cloud, min(2.0 * (coverage), 1.0) * cloudMap, min(2.0 * (1.0 - coverage), 1.0)); if (cloud <= 0.0) { return 0.0; } float shape = getCloudShape(8.0 * cloudSize * p, 0.0); cloud = saturate(remap(cloud, smoothness * shape, 1.0, 0.0, 1.0)); if (cloud <= 0.0) { return 0.0; } float heightFraction = saturate((length(p) - cloudRadius - cloudStart) / cloudHeight); cloud *= saturate(remap(heightFraction, 0.0, 0.25, 0.0, 1.0)) * smoothstep(1.0, 0.25, heightFraction); if (cloud <= 0.0) { return 0.0; } return density * saturate(remap(cloud, 0.35 * smoothness * getCloudShape(detailSize * p, 0.0), 1.0, 0.0, 1.0)); }`);z.code.add(d.glsl`vec2 sphereIntersections(vec3 start, vec3 dir, float radius) { float a = dot(dir, dir); float b = 2.0 * dot(dir, start); float c = dot(start, start) - (radius * radius); float d = (b * b) - 4.0 * a * c; if (d < 0.0) { return vec2(1e5, -1e5); } return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a)); } float HenyeyGreenstein(float g, float costh) { return (1.0 / (4.0 * 3.1415)) * ((1.0 - g * g) / pow(1.0 + g * g - 2.0 * g * costh, 1.5)); }`);z.code.add("\n float multipleOctaves(float extinction, float mu, float stepL) {\n float attenuation \x3d 1.0;\n float contribution \x3d 1.0;\n float phaseAttenuation \x3d 1.0;\n float luminance \x3d 0.0;\n\n for (int i \x3d 0; i \x3c 4; i++) {\n float phase \x3d mix(HenyeyGreenstein(0.0, mu), HenyeyGreenstein(0.3 * phaseAttenuation, mu), 0.7);\n luminance +\x3d contribution * phase * exp(-stepL * extinction * sigmaE * attenuation);\n attenuation *\x3d 0.2;\n contribution *\x3d 0.6;\n phaseAttenuation *\x3d 0.5;\n }\n\n return luminance;\n }"); z.code.add(d.glsl`float lightRay(vec3 org, vec3 p, float phaseFunction, float mu, vec3 sunDirection) { float lightRayDensity = clouds(p); lightRayDensity += clouds(p + sunDirection * 1.0 * stepL); lightRayDensity += clouds(p + sunDirection * 2.0 * stepL); lightRayDensity += clouds(p + sunDirection * 3.0 * stepL); lightRayDensity += clouds(p + sunDirection * 4.0 * stepL); lightRayDensity += clouds(p + sunDirection * 5.0 * stepL); float beersLaw = multipleOctaves(lightRayDensity, mu, stepL); return mix(beersLaw * 2.0 * (1.0 - (exp(-stepL * lightRayDensity * 2.0 * sigmaE ))), beersLaw, 0.5 + 0.5 * mu); }`);z.code.add(d.glsl`float mainRay(vec3 org, vec3 dir, vec3 sunDirection, float distToStart, float totalDistance, out float totalTransmittance) { if (dir.z < 0.0) { return 0.0; } totalTransmittance = 1.0; float stepS = totalDistance / float(STEPS); float cameraHeight = length(org); float mu = 0.5 + 0.5 * dot(sunDirection, dir); float phaseFunction = mix(HenyeyGreenstein(-0.3, mu), HenyeyGreenstein(0.3, mu), 0.7); vec3 p = org + distToStart * dir; float dist = distToStart; float shading = 0.0; for (int i = 0; i < STEPS; i++) { float sampleDensity = clouds(p); float sampleSigmaE = sampleDensity * sigmaE; if (sampleDensity > 0.0 ) { float ambient = mix((1.2), (1.6), saturate((length(p) - cloudRadius - cloudStart) / cloudHeight)); float luminance = sampleDensity * (ambient + power * phaseFunction * lightRay(org, p, phaseFunction, mu, sunDirection)); float transmittance = exp(-sampleSigmaE * stepS); shading += totalTransmittance * (luminance - luminance * transmittance) / sampleSigmaE; totalTransmittance *= transmittance; if (totalTransmittance <= 0.001) { totalTransmittance = 0.0; break; } } dist += stepS; p = org + dir * dist; } return shading; }`);z.code.add(d.glsl`void main() { if (coverage == 0.0) { fragColor = vec4(0.0, 1.0, 0.0, 1.0); return; } vec3 rayDir = rayDirection(gl_FragCoord.xy); rayDir = normalize(view * rayDir); vec3 viewPos = vec3(0, 0, cloudRadius + 1.0); bool hitsPlanet = rayDir.z < 0.0; float hazeFactor = smoothstep(-0.01, mix(0.0, 0.075, cloudVariables.x), abs(dot(rayDir, vec3(0, 0, 1)))); float totalTransmittance = 1.0; float shading = 0.0; if (hitsPlanet) { shading = clamp(1.0 - cloudVariables.y, 0.6, 1.0) * (1.0 - hazeFactor); totalTransmittance = hazeFactor; fragColor = vec4(shading, totalTransmittance, shading, totalTransmittance); return; } vec2 rayStartIntersect = sphereIntersections(viewPos, rayDir, cloudRadius + cloudStart); vec2 rayEndIntersect = sphereIntersections(viewPos, rayDir, cloudRadius + cloudStart + cloudHeight); float distToStart = rayStartIntersect.y; float totalDistance = rayEndIntersect.y - distToStart; vec3 sunDirection = normalize(vec3(0, 0, 1)); shading = 0.5 * mainRay(viewPos, rayDir, sunDirection, distToStart, totalDistance, totalTransmittance); shading = mix(clamp(1.0 - cloudVariables.y, 0.6, 1.0), shading, hazeFactor); totalTransmittance = mix(0.0, totalTransmittance, hazeFactor); fragColor = vec4(shading, totalTransmittance, shading, totalTransmittance); }`);return y}class r extends d.NoParameters{constructor(){super(...arguments);this.coverage=this.cloudHeight=this.smoothness=this.density=this.absorption=this.detailSize=this.cloudSize=this.cloudRadius=0;this.raymarchingSteps=k.cloudPresets.default.raymarchingSteps;this.weatherTile=p.create();this.viewMatrix=q.create()}}const n=p.create(),u=Object.freeze(Object.defineProperty({__proto__:null,CloudsPassParameters:r,build:m},Symbol.toStringTag,{value:"Module"}));a.Clouds=u;a.CloudsPassParameters=r; a.build=m})},"esri/views/3d/environment/CloudsPresets":function(){define(["exports","./CloudsTechniqueConfiguration"],function(a,b){class q{constructor(p,k,h,f,c,e,g,d,t=.5){this.coverage=p;this.density=k;this.absorption=h;this.cloudSize=f;this.detailSize=c;this.smoothness=e;this.cloudHeight=g;this.raymarchingSteps=d;this.median=t}}const l=new q([0,.6],[.03,.03],[0,0],[.9,.9],[.8,.8],[.7,.7],[.05,.05],b.RayMarchingSteps.SIXTEEN);b={sunny:l,cloudy:new q([.3,.65],[.2,.4],[0,0],[.85,.85],[.75,.75],[.3, .4],[1,1],b.RayMarchingSteps.TWOHUNDRED,.6),rainy:new q([.6,.8],[.5,.8],[.1,.5],[.9,.9],[.75,.75],[.5,.5],[1,1],b.RayMarchingSteps.TWOHUNDRED,.4),snowy:new q([.25,.75],[.3,.3],[0,0],[.95,.95],[.7,.7],[.69,.75],[.3,1],b.RayMarchingSteps.HUNDRED,.65),foggy:new q([.8,.8],[.5,.5],[0,0],[.95,.95],[.9,.9],[.55,.55],[.3,.3],b.RayMarchingSteps.SIXTEEN),default:l};a.CloudPresets=q;a.cloudPresets=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsTechniqueConfiguration":function(){define(["exports", "../../../chunks/tslib.es6","../../../core/has","./CloudsData","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q,l,p){a.RayMarchingSteps=void 0;(function(h){h[h.SIXTEEN=0]="SIXTEEN";h[h.HUNDRED=1]="HUNDRED";h[h.TWOHUNDRED=2]="TWOHUNDRED";h[h.COUNT=3]="COUNT"})(a.RayMarchingSteps||(a.RayMarchingSteps={}));class k extends p.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.steps=a.RayMarchingSteps.SIXTEEN;this.writeTextureChannels=l.CloudsTextureChannels.RG}} b.__decorate([p.parameter({count:a.RayMarchingSteps.COUNT})],k.prototype,"steps",void 0);b.__decorate([p.parameter({constValue:q("esri-mobile")?1024:2048})],k.prototype,"cubeMapSize",void 0);b.__decorate([p.parameter()],k.prototype,"writeTextureChannels",void 0);a.CloudsTechniqueConfiguration=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/NoiseTextureAtlasDimensions":function(){define(["exports","../../../core/has"],function(a,b){b=b("esri-mobile")?64: 128;const q=Math.ceil(Math.sqrt(b)),l=(b+2)*q;a.atlasSize=l;a.textureScale=b/128;a.tileRows=q;a.tileSize=b;a.weatherMapScale=l/1560;a.weatherMapSize=1E5;a.weatherTileSize=128;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"mat3",q.BindType.Pass,(h,f,c)=>h.setUniformMatrix3fv(p, k(f,c)))}}a.Matrix3PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsTechnique":function(){define("require exports ../../../chunks/Clouds.glsl ./CloudsData ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends k.ShaderTechnique{constructor(d, t){super(d,t,()=>this.destroy())}initializeProgram(d){return new f.Program(d.rctx,g.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return e.makePipelineState({blending:e.simpleBlendingParams(c.BlendFactor.CONSTANT_COLOR,c.BlendFactor.ONE_MINUS_CONSTANT_COLOR,c.BlendOperation.ADD,this.configuration.writeTextureChannels===l.CloudsTextureChannels.RG?[1,1,0,0]:[0,0,1,1]),depthTest:{func:c.CompareFunction.LEQUAL},colorWrite:e.defaultColorWriteParams})}}g.shader=new p.ReloadableShaderModule(q.Clouds, ()=>new Promise((d,t)=>a(["./Clouds.glsl"],d,t)));b.CloudsTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/NoiseTextureAtlas":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/maybe ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/vec2 ../../../chunks/NoiseTextureAtlas.glsl ./NoiseTextureAtlasConfiguration ./NoiseTextureAtlasDimensions ./NoiseTextureAtlasTechnique ../webgl-engine/lib/glUtil3D ../../webgl/FramebufferObject ../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){a.NoiseTextureAtlas=class extends q{constructor(n){super(n);this._needsRender=!0;this._passParameters=new g.NoiseTextureAtlasPassParameters;this._fbo=new m.FramebufferObject(n.context.renderContext.rctx,new r.TextureDescriptor(t.atlasSize));this._vao=v.createQuadVAO(n.context.renderContext.rctx)}get _techniques(){return this.context.techniques}get textureAtlas(){null!=this._texture?null!=this._weatherMapTechnique&&this._weatherMapTechnique.compiled&&this._needsRender&& (this._texture=this._render(d.NoiseTextureRenderMode.WeatherMap)):null!=this._fullTechnique&&this._fullTechnique.compiled&&(this._texture=this._render(d.NoiseTextureRenderMode.Full));return this._texture}_setDirty(){this._needsRender=!0}updateWeatherMap(n){if(this._passParameters.weatherTile[0]!==n[0]||this._passParameters.weatherTile[1]!==n[1])e.copy(this._passParameters.weatherTile,n),this._setDirty()}destroy(){this._fullTechniqueCached=l.releaseMaybe(this._fullTechniqueCached);this._weatherMapTechniqueCached= l.releaseMaybe(this._weatherMapTechniqueCached);this._fbo=l.disposeMaybe(this._fbo);this._vao=l.disposeMaybe(this._vao)}get _fullTechnique(){if(null==this._fullTechniqueCached){const n=new d.NoiseTextureAtlasTechniqueConfiguration;n.mode=d.NoiseTextureRenderMode.Full;this._fullTechniqueCached=this._techniques.acquire(w.NoiseTextureAtlasTechnique,n)}return this._fullTechniqueCached}get _weatherMapTechnique(){if(null==this._weatherMapTechniqueCached){const n=new d.NoiseTextureAtlasTechniqueConfiguration; n.mode=d.NoiseTextureRenderMode.WeatherMap;this._weatherMapTechniqueCached=this._techniques.acquire(w.NoiseTextureAtlasTechnique,n)}return this._weatherMapTechniqueCached}_render(n){if(null==this._vao||null==this._fbo)return null;var u=n===d.NoiseTextureRenderMode.Full?this._fullTechnique:this._weatherMapTechnique;n=this.context.renderContext.rctx;const x=n.getViewport();n.setViewport(0,0,t.atlasSize,t.atlasSize);n.bindFramebuffer(this._fbo);u=n.bindTechnique(u,null,this._passParameters);n.bindVAO(this._vao); u.assertCompatibleVertexAttributeLocations(this._vao);n.gl.drawArrays(n.gl.TRIANGLE_STRIP,0,4);n.setViewport(x.x,x.y,x.width,x.height);this._needsRender=!1;return this._fbo.colorTexture}};b.__decorate([p.property({constructOnly:!0})],a.NoiseTextureAtlas.prototype,"context",void 0);b.__decorate([p.property({readOnly:!0})],a.NoiseTextureAtlas.prototype,"_techniques",null);a.NoiseTextureAtlas=b.__decorate([c.subclass("esri.views.3d.environment.NoiseTextureAtlas")],a.NoiseTextureAtlas);Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/chunks/NoiseTextureAtlas.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec2f64 ../views/3d/environment/NoiseTextureAtlasConfiguration ../views/3d/environment/NoiseTextureAtlasDimensions ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder".split(" "), function(a,b,q,l,p,k,h,f){function c(d){const t=new f.ShaderBuilder;t.include(p.ScreenSpacePass,!1);t.fragment.code.add(h.glsl`float remap(float x, float low1, float high1, float low2, float high2) { return low2 + (x - low1) * (high2 - low2) / (high1 - low1); }`);d.mode===q.NoiseTextureRenderMode.Full&&t.fragment.code.add(h.glsl` float saturate(float x) { return clamp(x, 0.0, 1.0); } // Safer modulo for positive and negative values vec3 modulo(vec3 m, float n){ return mod(mod(m, n) + n, n); } vec3 hash(vec3 p3, float frequency){ p3 = modulo(p3, frequency); p3 = fract(p3 * vec3(0.1031, 0.1030, 0.0973)); p3 += dot(p3, p3.yxz + 33.33); return -1.0 + 2.0 * fract((p3.xxy + p3.yxx) * p3.zyx); } // 5th order polynomial interpolation vec3 fade(vec3 t){ return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0); } float gradientNoise(vec3 p, float frequency){ // Cell point is in vec3 i = floor(p); // Position in the cell in [0, 1] vec3 f = fract(p); // Interpolation value for gradient mixing vec3 u = fade(f); // Trilinear interpolation of gradients at cube vertices around point return mix( mix( mix( dot( hash( i + vec3(0.0,0.0,0.0), frequency), f - vec3(0.0,0.0,0.0) ), dot( hash( i + vec3(1.0,0.0,0.0), frequency), f - vec3(1.0,0.0,0.0) ), u.x), mix( dot( hash( i + vec3(0.0,1.0,0.0), frequency), f - vec3(0.0,1.0,0.0) ), dot( hash( i + vec3(1.0,1.0,0.0), frequency), f - vec3(1.0,1.0,0.0) ), u.x), u.y), mix( mix( dot( hash( i + vec3(0.0,0.0,1.0), frequency), f - vec3(0.0,0.0,1.0) ), dot( hash( i + vec3(1.0,0.0,1.0), frequency), f - vec3(1.0,0.0,1.0) ), u.x), mix( dot( hash( i + vec3(0.0,1.0,1.0), frequency), f - vec3(0.0,1.0,1.0) ), dot( hash( i + vec3(1.0,1.0,1.0), frequency), f - vec3(1.0,1.0,1.0) ), u.x), u.y), u.z ); } float getPerlinNoise(vec3 pos, float frequency) { float octaveFrequencyFactor = 2.0; float sum = 0.0; float weightSum = 0.0; float weight = 1.0; for (int oct = 0; oct < 3; oct++) { vec3 p = pos * frequency; float val = 0.5 + 0.5 * gradientNoise(p, frequency); sum += val * weight; weightSum += weight; weight *= 0.5; frequency *= octaveFrequencyFactor; } float noise = (sum / weightSum); noise = saturate(noise); return noise; } float worley(vec3 pos, float numCells) { vec3 p = pos * numCells; float d = 1.0e10; for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { vec3 tp = floor(p) + vec3(x, y, z); tp = p - tp - (hash(tp, numCells) * 0.5 + 0.5); d = min(d, dot(tp, tp)); } } } return 1.0 - clamp(d, 0.0, 1.0); } vec3 get3Dfrom2D(vec2 uv) { vec2 tile = floor(uv); float z = floor(${h.glsl.float(l.tileRows)} * tile.y + tile.x); return vec3(fract(uv), z); } float getTextureForPointPerlinWorley(vec3 p) { float perlinNoise = getPerlinNoise(p, ${h.glsl.float(8)}); float worley0 = worley(p, ${h.glsl.float(2)} * 2.0); float worley1 = worley(p, ${h.glsl.float(2)} * 8.0); float worley2 = worley(p, ${h.glsl.float(2)} * 14.0); float worleyFBM = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125; return remap(perlinNoise, 0.0, 1.0, worleyFBM, 1.0); } float getTextureForPointWorley(vec3 p) { float worley0 = worley(p, ${h.glsl.float(2)}); float worley1 = worley(p, ${h.glsl.float(2)} * 2.0); float worley2 = worley(p, ${h.glsl.float(2)} * 4.0); float worley3 = worley(p, ${h.glsl.float(2)} * 8.0); float FBM0 = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125; float FBM1 = worley1 * 0.625 + worley2 * 0.25 + worley3 * 0.125; float FBM2 = worley2 * 0.75 + worley3 * 0.25; return FBM0 * 0.625 + FBM1 * 0.25 + FBM2 * 0.125; } `);t.fragment.uniforms.add(new k.Float2PassUniform("weatherTile",w=>w.weatherTile));t.fragment.code.add(h.glsl` vec2 modulo(vec2 m, float n){ return mod(mod(m, n) + n, n); } vec2 hash(vec2 p){ // Get position of p in weather tile p = modulo(p, ${h.glsl.float(l.weatherTileSize)}); // Get global coordinates of p p += weatherTile * ${h.glsl.float(l.weatherTileSize)}; // Limit position to avoid numerical instability p = modulo(p, ${h.glsl.float(l.weatherMapSize)}); vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973)); p3 += dot(p3, p3.yzx + 33.33); return 2.0 * fract((p3.xx + p3.yz) * p3.zy) - 1.0; } vec2 fade(vec2 t){ return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0); } float gradientNoise(vec2 p){ vec2 i = floor( p ); vec2 f = fract( p ); vec2 u = fade(f); // Bilinear interpolation of gradients at cell vertices around point return mix( mix(dot( hash( i + vec2(0.0,0.0) ), f - vec2(0.0,0.0) ), dot( hash( i + vec2(1.0,0.0) ), f - vec2(1.0,0.0) ), u.x), mix(dot( hash( i + vec2(0.0,1.0) ), f - vec2(0.0,1.0) ), dot( hash( i + vec2(1.0,1.0) ), f - vec2(1.0,1.0) ), u.x), u.y); } float worley(vec2 p){ float d = 1.0e10; for (int x = -1; x <= 1; x++){ for (int y = -1; y <= 1; y++){ vec2 tp = floor(p) + vec2(x, y); tp = p - tp - (0.5 + 0.5 * hash(tp)); d = min(d, dot(tp, tp)); } } return 1.0 - clamp(d, 0.0, 1.0); } `);t.fragment.code.add(h.glsl`void main() {`);d.mode===q.NoiseTextureRenderMode.Full&&t.fragment.code.add(h.glsl` float padWidth = 1.0; float paddedSize = ${h.glsl.float(l.tileSize)} + 2.0 * padWidth; float tileCount = ${h.glsl.float(l.tileRows)} * ${h.glsl.float(l.tileRows)}; vec2 tile = floor((gl_FragCoord.xy - 0.5) / paddedSize); bool padCell = false; if (mod(gl_FragCoord.x, paddedSize) == 0.5 || mod(gl_FragCoord.x, paddedSize) == paddedSize - 0.5) { padCell = true; } if (mod(gl_FragCoord.y, paddedSize) == 0.5 || mod(gl_FragCoord.y, paddedSize) == paddedSize - 0.5) { padCell = true; } bool startPadX = false; bool startPadY = false; bool endPadX = false; bool endPadY = false; if (gl_FragCoord.x == tile.x * paddedSize + 0.5) { startPadX = true; } if (gl_FragCoord.y == tile.y * paddedSize + 0.5) { startPadY = true; } if (gl_FragCoord.x == (tile.x + 1.0) * paddedSize - 0.5) { endPadX = true; } if (gl_FragCoord.y == (tile.y + 1.0) * paddedSize - 0.5) { endPadY = true; } vec2 padding = vec2(2.0 * padWidth) * tile; vec2 uv; if (padCell) { vec2 pixel = gl_FragCoord.xy - padWidth - padding; if (startPadX) { pixel.x += ${h.glsl.float(l.tileSize)}; } if (startPadY) { pixel.y += ${h.glsl.float(l.tileSize)}; } if (endPadX) { pixel.x -= ${h.glsl.float(l.tileSize)}; } if (endPadY) { pixel.y -= ${h.glsl.float(l.tileSize)}; } uv = vec2(pixel.xy / ${h.glsl.float(l.tileSize)}); } else { vec2 pixel = gl_FragCoord.xy - padWidth - padding; uv = vec2(pixel.xy / ${h.glsl.float(l.tileSize)}); } vec3 p_ = get3Dfrom2D(uv); vec3 p = p_; p.z /= (${h.glsl.float(l.tileRows)} * ${h.glsl.float(l.tileRows)}); float worleyPerlinNoise = getTextureForPointPerlinWorley(p); float worleyNoise = getTextureForPointWorley(p); fragColor.r = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0)); p_ = mod(p_ + 1.0, ${h.glsl.float(l.tileRows)} * ${h.glsl.float(l.tileRows)}); p = p_; p.z /= (${h.glsl.float(l.tileRows)} * ${h.glsl.float(l.tileRows)}); worleyPerlinNoise = getTextureForPointPerlinWorley(p); worleyNoise = getTextureForPointWorley(p); fragColor.g = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0)); `);t.fragment.code.add(h.glsl` vec2 mapUV = ${h.glsl.float(l.weatherTileSize)} * (gl_FragCoord.xy / ${h.glsl.float(l.atlasSize)}); float map = abs(gradientNoise(mapUV)); map = remap(map, 0.25 * (1.0 - worley(8.0 * mapUV)), 1.0, 0.0, 1.0); ${d.mode===q.NoiseTextureRenderMode.Full?h.glsl`fragColor.ba = vec2(0.0, map);`:h.glsl`fragColor = vec4(map);`}; } `);return t}class e extends h.NoParameters{constructor(){super(...arguments);this.weatherTile=b.fromValues(0,0)}}const g=Object.freeze(Object.defineProperty({__proto__:null,NoiseTextureAtlasPassParameters:e,build:c},Symbol.toStringTag,{value:"Module"}));a.NoiseTextureAtlas=g;a.NoiseTextureAtlasPassParameters=e;a.build=c})},"esri/views/3d/environment/NoiseTextureAtlasConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"], function(a,b,q){a.NoiseTextureRenderMode=void 0;(function(p){p[p.Full=0]="Full";p[p.WeatherMap=1]="WeatherMap";p[p.COUNT=2]="COUNT"})(a.NoiseTextureRenderMode||(a.NoiseTextureRenderMode={}));class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.mode=a.NoiseTextureRenderMode.Full}}b.__decorate([q.parameter({count:a.NoiseTextureRenderMode.COUNT})],l.prototype,"mode",void 0);a.NoiseTextureAtlasTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/environment/NoiseTextureAtlasTechnique":function(){define("require exports ../../../chunks/NoiseTextureAtlas.glsl ./NoiseTextureAtlasConfiguration ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends k.ShaderTechnique{initializeProgram(d){return new f.Program(d.rctx, g.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return e.makePipelineState({blending:this.configuration.mode===l.NoiseTextureRenderMode.Full?e.simpleBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ZERO):e.separateBlendingParams(c.BlendFactor.ZERO,c.BlendFactor.ONE,c.BlendFactor.ONE,c.BlendFactor.ZERO),depthTest:{func:c.CompareFunction.ALWAYS},colorWrite:e.defaultColorWriteParams})}}g.shader=new p.ReloadableShaderModule(q.NoiseTextureAtlas,()=>new Promise((d,t)=>a(["./NoiseTextureAtlas.glsl"], d,t)));b.NoiseTextureAtlasTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/FramebufferObject":function(){define("exports ../../core/has ../../core/Logger ../../core/maybe ./BufferObject ./checkWebGLError ./enums ./GLObjectType ./Renderbuffer ./Texture".split(" "),function(a,b,q,l,p,k,h,f,c,e){function g(v){return null!=v&&"type"in v&&v.type===f.GLObjectType.Texture}function d(v,m){const r=Math.max(v.width,v.height);return r>m?(q.getLogger("esri.views.webgl.FramebufferObject").warn(`Resizing FBO attachment size ${v.width}x${v.height} to device limit ${m}`), m/=r,v.width=Math.round(v.width*m),v.height=Math.round(v.height*m),!1):!0}function t(v){return v.descriptor.target===h.TextureType.TEXTURE_CUBE_MAP?h.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X:h.TextureType.TEXTURE_2D}class w{constructor(v,m,r=null){this._context=v;this._glName=null;this._colorAttachments=new Map;this._depthStencilTexture=this._depthStencilBuffer=null;this._initialized=!1;v.instanceCounter.increment(h.ResourceType.FramebufferObject,this);v=g(m)?m:new e.Texture(this._context,m);this._colorAttachments.set(h.ColorAttachment.COLOR_ATTACHMENT0, v);this._validateTextureDescriptor(v.descriptor);this._validateColorAttachmentPoint(h.ColorAttachment.COLOR_ATTACHMENT0);null!=r&&(g(r)||null!=r&&"pixelFormat"in r?(this._depthStencilTexture=g(r)?r:new e.Texture(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor)):(this._depthStencilBuffer=r=null!=r&&"type"in r&&r.type===f.GLObjectType.RenderBuffer?r:new c.Renderbuffer(this._context,r),this._validateRenderBufferDescriptor(r.descriptor)))}dispose(){if(0!==this._colorAttachments.size|| this._glName){var v=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((m,r)=>this.detachColorTexture(r)?.dispose());this.detachDepthStencilBuffer()?.dispose();this.detachDepthStencilTexture()?.dispose();this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null);this._context.bindFramebuffer(v);this._context.instanceCounter.decrement(h.ResourceType.FramebufferObject,this)}}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture|| this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((v,[,m])=>v+m.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(v){return(v=this._colorAttachments.get(v))&&g(v)?v:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(v, m=h.ColorAttachment.COLOR_ATTACHMENT0){v&&(this._validateColorAttachmentPoint(m),this._validateTextureDescriptor(v.descriptor),this.detachColorTexture(m)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(v.glName,m)),this._colorAttachments.set(m,v))}detachColorTexture(v=h.ColorAttachment.COLOR_ATTACHMENT0){const m=this._colorAttachments.get(v);if(m){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this); this._framebufferTexture2D(null,v);this._context.bindFramebuffer(r)}this._colorAttachments.delete(v);return m}}setColorTextureTarget(v,m=h.ColorAttachment.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(m);r&&this._framebufferTexture2D(r.glName,m,v)}attachDepthStencil(v){if(v)switch(v.type){case f.GLObjectType.Texture:return this._attachDepthStencilTexture(v);case f.GLObjectType.RenderBuffer:return this._attachDepthStencilBuffer(v)}}_attachDepthStencilTexture(v){if(null!=v){var m=v.descriptor; m.pixelFormat!==h.PixelFormat.DEPTH_STENCIL&&m.pixelFormat!==h.PixelFormat.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!");m.dataType!==h.PixelType.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!");this._validateTextureDescriptor(m);this._disposeDepthStencilAttachments();this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(v.glName,h.DepthStencilAttachment));this._depthStencilTexture?.dispose(); this._depthStencilTexture=v}}detachDepthStencilTexture(){const v=this._depthStencilTexture;if(v&&this._initialized){const m=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);this._framebufferTexture2D(null,h.DepthStencilAttachment);this._context.bindFramebuffer(m)}this._depthStencilTexture=null;return v}_attachDepthStencilBuffer(v){if(null!=v){var m=v.descriptor;this._validateRenderBufferDescriptor(m);this._disposeDepthStencilAttachments();if(this._initialized){this._context.bindFramebuffer(this); const r=this._context.gl;m=this._getGLAttachmentPoint(m);r.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,m,r.RENDERBUFFER,v.glName)}this._depthStencilBuffer=v}}detachDepthStencilBuffer(){const v=this._depthStencilBuffer;if(v&&this._initialized){const m=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(v.descriptor);r.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,n,r.RENDERBUFFER,null);this._context.bindFramebuffer(m)}this._depthStencilBuffer= null;return v}copyToTexture(v,m,r,n,u,x,y){(0>v||0>m||0>u||0>x)&&console.error("Offsets cannot be negative!");(0>=r||0>=n)&&console.error("Copy width and height must be greater than zero!");var z=y.descriptor;y.descriptor.target!==h.TextureType.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!");(null==z?.width||null==z?.height||v+r>this.width||m+n>this.height||u+r>z.width||x+n>z.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!"); z=this._context;y=z.bindTexture(y,e.Texture.TEXTURE_UNIT_FOR_UPDATES);z.setActiveTexture(e.Texture.TEXTURE_UNIT_FOR_UPDATES);z.bindFramebuffer(this);z.gl.copyTexSubImage2D(h.TextureType.TEXTURE_2D,0,u,x,v,m,r,n);z.bindTexture(y,e.Texture.TEXTURE_UNIT_FOR_UPDATES)}readPixels(v,m,r,n,u,x,y){(0>=r||0>=n)&&console.error("Copy width and height must be greater than zero!");y||console.error("Target memory is not initialized!");this._context.bindFramebuffer(this);this._context.gl.readPixels(v,m,r,n,u,x,y)}async readPixelsAsync(v, m,r,n,u,x,y){const {gl:z}=this._context,A=p.BufferObject.createPixelPack(this._context,h.Usage.STREAM_READ,y.byteLength);this._context.bindBuffer(A);this._context.bindFramebuffer(this);z.readPixels(v,m,r,n,u,x,0);this._context.unbindBuffer(h.BufferType.PIXEL_PACK_BUFFER);await A.getSubDataAsync(y);A.dispose()}resize(v,m){if(this.width!==v||this.height!==m){var r={width:v,height:m};d(r,this._context.parameters.maxTextureSize);this._colorAttachments.forEach(n=>n.resize(r.width,r.height));this._depthStencilTexture?.resize(r.width, r.height);this._initialized&&(d(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}}initializeAndBind(v=h.FramebufferTarget.FRAMEBUFFER){const m=this._context.gl;if(this._initialized)m.bindFramebuffer(v,this.glName);else{this._glName&&m.deleteFramebuffer(this._glName);var r=m.createFramebuffer();m.bindFramebuffer(v,r);this._colorAttachments.forEach((n, u)=>this._framebufferTexture2D(n.glName,u,t(n),v));if(this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);m.framebufferRenderbuffer(v,n,m.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,m.DEPTH_STENCIL_ATTACHMENT,t(this._depthStencilTexture),v);k.webglDebugEnabled()&&m.checkFramebufferStatus(v)!==m.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"); this._glName=r;this._initialized=!0}}_framebufferTexture2D(v,m=h.ColorAttachment.COLOR_ATTACHMENT0,r=h.TextureType.TEXTURE_2D,n=h.FramebufferTarget.FRAMEBUFFER,u=0){this._context.gl.framebufferTexture2D(n,m,r,v,u)}_disposeDepthStencilAttachments(){const v=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const m=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);v.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,m,v.RENDERBUFFER, null)}this._depthStencilBuffer=l.disposeMaybe(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,v.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=l.disposeMaybe(this._depthStencilTexture))}_validateTextureDescriptor(v){v.target!==h.TextureType.TEXTURE_2D&&v.target!==h.TextureType.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!");d(v,this._context.parameters.maxTextureSize); this._validateBufferDimensions(v)}_validateRenderBufferDescriptor(v){d(v,this._context.parameters.maxRenderbufferSize);this._validateBufferDimensions(v)}_validateBufferDimensions(v){0>=v.width&&(v.width=this.width);0>=v.height&&(v.height=this.height);0w._MAX_COLOR_ATTACHMENTS&&q.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject", `illegal attachment point for color attachment: ${v+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}w._MAX_COLOR_ATTACHMENTS=-1;a.FramebufferObject=w;a.ensureAttachmentMaxSize=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Renderbuffer":function(){define(["exports","./enums","./GLObjectType","./RenderbufferDescriptor"],function(a,b,q,l){class p{constructor(k,h){this._context=k;this._descriptor=h;this.type=q.GLObjectType.RenderBuffer; this._context.instanceCounter.increment(b.ResourceType.Renderbuffer,this);k=this._context.gl;this.glName=k.createRenderbuffer();this._context.bindRenderbuffer(this);const {width:f,height:c,internalFormat:e,multisampled:g}=h;g?k.renderbufferStorageMultisample(k.RENDERBUFFER,this.samples,e,f,c):k.renderbufferStorage(k.RENDERBUFFER,e,f,c);this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const k=this._descriptor.samples,h=this._context.parameters.maxSamples; return k?Math.min(k,h):h}get usedMemory(){return l.estimateMemory(this._descriptor)}resize(k,h){const f=this._descriptor;if(f.width!==k||f.height!==h)f.width=k,f.height=h,k=this._context.gl,this._context.bindRenderbuffer(this),f.multisampled?k.renderbufferStorageMultisample(k.RENDERBUFFER,this.samples,f.internalFormat,f.width,f.height):k.renderbufferStorage(k.RENDERBUFFER,f.internalFormat,f.width,f.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName), this._context.instanceCounter.decrement(b.ResourceType.Renderbuffer,this),this._context=null)}}a.Renderbuffer=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/RenderbufferDescriptor":function(){define(["exports","./Util"],function(a,b){class q{constructor(l,p,k=p){this.internalFormat=l;this.width=p;this.height=k;this.multisampled=!1;this.samples=1}}a.RenderbufferDescriptor=q;a.estimateMemory=function(l){return 0>=l.width||0>=l.height||null==l.internalFormat?0:l.width* l.height*b.getBytesPerElementFormat(l.internalFormat)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/BindParameters":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../environment/CloudsParameters ../../webgl/RenderCamera ../core/shaderLibrary/hud/HUDRenderStyle ../core/shaderLibrary/shading/MultipassGeometryTest.glsl ../core/shaderLibrary/shading/MultipassTerrainTest.glsl ./basicInterfaces ./RenderSlot ./TransparencyPassType ../lighting/SceneLighting".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(v,m){this.shadowMap=v;this.slicePlane=m;this.slot=e.RenderSlot.OPAQUE_MATERIAL;this.hasOccludees=!1;this.enableFillLights=!0;this.transparencyPassType=g.TransparencyPassType.NONE;this.alignPixelEnabled=!1;this.decorations=c.Decorations.ON;this.overlayStretch=1;this.viewshedEnabled=!1;this._camera=new p;this._inverseViewport=q.create();this.oldLighting=new d.SceneLighting;this.newLighting=new d.SceneLighting;this._fadedLighting=new d.SceneLighting; this._lighting=this.newLighting;this.ssr=new w;this.multipassEnabled=!1;this.multipassTerrain=new f.MultipassTerrainUniforms;this.multipassGeometry=new h.MultipassGeometryUniforms;this.hudRenderStyle=k.HUDRenderStyle.Occluded;this.cloudsFade=new l.CloudsParameters;this.shadowHighlightsVisible=!1}get camera(){return this._camera}set camera(v){this._camera=v;this._inverseViewport[0]=1/v.fullViewport[2];this._inverseViewport[1]=1/v.fullViewport[3]}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}get weatherFading(){return this._lighting=== this._fadedLighting}fadeLighting(v){const {oldLighting:m,newLighting:r}=this;1<=v?this._lighting=r:(this._fadedLighting.lerpLighting(m,r,v),this._lighting=this._fadedLighting)}}class w{constructor(){this.fadeFactor=1;this.reprojectionMatrix=b.create()}}a.BindParameters=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/RenderCamera":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Logger ../../../core/mathUtils ../../../core/screenUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/support/frustum ../../../geometry/support/ray ../../../geometry/support/vector ../../ViewingMode ../webgl-engine/lib/fov ../webgl-engine/lib/rendererUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){var B;b=B=class extends b{constructor(E){super(E);this._ray=u.create();this._viewport=r.fromValues(0,0,1,1);this._padding=r.fromValues(0,0,0,0);this._fov=55/180*Math.PI;this._nearFar=t.fromValues(1,1E3);this._viewDirty=!0;this._viewMatrix=g.create();this._viewProjectionDirty=!0;this._viewProjectionMatrix=g.create();this._viewInverseTransposeMatrixDirty=!0;this._viewInverseTransposeMatrix=g.create();this._frustumDirty=!0;this._frustum=n.create(); this._fullViewport=r.create();this._pixelRatio=1;this.column=this.row=0;this._columns=this._rows=1;this._center=v.create();this._up=v.create();this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(E){this._pixelRatio=0=G||m.squaredDistance(this.screenViewport,E.screenViewport)>=G||this.row!==E.row||this.column!==E.column||this.rows!==E.rows||this.columns!==E.columns)return!1;w.sub(F,E.eye,E.center);w.sub(H,this.eye,this.center);G=w.dot(F,H);const I=w.sqrLen(F),O=w.sqrLen(H);return G*G>=(1-1E-10)*I*O&&w.sqrDist(E.eye,this.eye)<2.5E-7*Math.max(I,O)}computeRenderPixelSizeAt(E){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(E))}computeRenderPixelSizeAtDist(E){return E* this.perRenderPixelRatio}computeScreenPixelSizeAt(E){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(E))}_viewDirectionDistance(E){return Math.abs(x.projectPointSignedLength(this.viewForward,w.subtract(F,E,this.eye)))}computeScreenPixelSizeAtDist(E){return E*this.perScreenPixelRatio}computeDistanceFromRadius(E,G){return E/Math.tan(Math.min(this.fovX,this.fovY)/(2*(G||1)))}getScreenCenter(E=p.createScreenPointArray()){E[0]=(this.padding[A.PaddingSide.LEFT]+this.width/2)/this.pixelRatio; E[1]=(this.padding[A.PaddingSide.TOP]+this.height/2)/this.pixelRatio;return E}getRenderCenter(E,G=.5,I=.5){E[0]=this.padding[A.PaddingSide.LEFT]+this.width*G;E[1]=this.padding[A.PaddingSide.BOTTOM]+this.height*I;E[2]=.5;return E}setGLViewport(E){const G=this.viewport,I=this.padding;E.setViewport(G[0]-I[3],G[1]-I[2],G[2]+I[1]+I[3],G[3]+I[0]+I[2])}applyProjection(E,G){E!==C&&w.copy(C,E);C[3]=1;m.transformMat4(C,C,this.projectionMatrix);E=Math.abs(C[3]);w.scale(C,C,1/E);const I=this.fullViewport;G[0]= l.lerp(0,I[0]+I[2],.5+.5*C[0]);G[1]=l.lerp(0,I[1]+I[3],.5+.5*C[1]);G[2]=.5*(C[2]+1);G[3]=E}unapplyProjection(E,G){const I=this.fullViewport;C[0]=(E[0]/(I[0]+I[2])*2-1)*E[3];C[1]=(E[1]/(I[1]+I[3])*2-1)*E[3];C[2]=(2*E[2]-1)*E[3];C[3]=E[3];null!=this.inverseProjectionMatrix&&(m.transformMat4(C,C,this.inverseProjectionMatrix),G[0]=C[0],G[1]=C[1],G[2]=C[2])}projectToScreen(E,G){this.projectToRenderScreen(E,N);this.renderToScreen(N,G);return G}projectToRenderScreen(E,G){C[0]=E[0];C[1]=E[1];C[2]=E[2];C[3]= 1;m.transformMat4(C,C,this.viewProjectionMatrix);if(0===C[3])return null;E=C;w.scale(E,E,1/Math.abs(C[3]));var I=this.fullViewport;const O=l.lerp(0,I[0]+I[2],.5+.5*E[0]);I=l.lerp(0,I[1]+I[3],.5+.5*E[1]);"x"in G?(G.x=O,G.y=I):(G[0]=O,G[1]=I,2E?(w.set(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(w.dot(F,this.center))>.9999*w.length(F)*E||(w.cross(this._up,F,this.center),w.cross(this._up, this._up,F),w.normalize(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){w.direction(F,this.eye,this.center);.9999>=Math.abs(F[2])&&(w.scale(F,F,F[2]),w.set(this._up,-F[0],-F[1],1-F[2]),w.normalize(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(E,G,I=""){"number"===typeof E[0]&&isFinite(E[0])&&"number"===typeof E[1]&&isFinite(E[1])&&"number"===typeof E[2]&&isFinite(E[2])?w.exactEquals(E,G)||(w.copy(G,E),this._markViewDirty(), I.length&&this.notifyChange(I)):q.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewProjectionDirty=this._frustumDirty=this._viewDirty=!0}_recomputeFrustum(){this._frustumDirty&&(n.fromMatrix(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(e.lookAt(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty= !1,this._viewInverseTransposeMatrixDirty=!0)}};a.__decorate([k.property()],b.prototype,"_viewport",void 0);a.__decorate([k.property()],b.prototype,"_padding",void 0);a.__decorate([k.property()],b.prototype,"_fov",void 0);a.__decorate([k.property()],b.prototype,"_nearFar",void 0);a.__decorate([k.property()],b.prototype,"_viewDirty",void 0);a.__decorate([k.property()],b.prototype,"_viewMatrix",void 0);a.__decorate([k.property()],b.prototype,"_pixelRatio",void 0);a.__decorate([k.property()],b.prototype, "pixelRatio",null);a.__decorate([k.property()],b.prototype,"row",void 0);a.__decorate([k.property()],b.prototype,"column",void 0);a.__decorate([k.property()],b.prototype,"_rows",void 0);a.__decorate([k.property()],b.prototype,"rows",null);a.__decorate([k.property()],b.prototype,"_columns",void 0);a.__decorate([k.property()],b.prototype,"columns",null);a.__decorate([k.property()],b.prototype,"eye",null);a.__decorate([k.property()],b.prototype,"center",null);a.__decorate([k.property()],b.prototype, "_center",void 0);a.__decorate([k.property()],b.prototype,"up",null);a.__decorate([k.property()],b.prototype,"_up",void 0);a.__decorate([k.property()],b.prototype,"viewMatrix",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"viewForward",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"viewUp",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"viewRight",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"nearFar",null);a.__decorate([k.property()],b.prototype, "near",null);a.__decorate([k.property()],b.prototype,"far",null);a.__decorate([k.property()],b.prototype,"viewport",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"screenViewport",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"screenPadding",null);a.__decorate([k.property()],b.prototype,"x",null);a.__decorate([k.property()],b.prototype,"y",null);a.__decorate([k.property()],b.prototype,"width",null);a.__decorate([k.property()],b.prototype,"height",null);a.__decorate([k.property()], b.prototype,"fullWidth",null);a.__decorate([k.property()],b.prototype,"fullHeight",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"_aspect",null);a.__decorate([k.property()],b.prototype,"padding",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"projectionMatrix",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"inverseProjectionMatrix",null);a.__decorate([k.property()],b.prototype,"fov",null);a.__decorate([k.property()],b.prototype,"fovX",null);a.__decorate([k.property()], b.prototype,"fovY",null);a.__decorate([k.property()],b.prototype,"viewInverseTransposeMatrix",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"_projectionMatrixInternal",null);a.__decorate([k.property()],b.prototype,"relativeElevation",void 0);a=b=B=a.__decorate([c.subclass("esri.views.3d.webgl.RenderCamera")],b);const C=r.create(),D=g.create(),F=v.create(),H=v.create(),N=p.createRenderScreenPointArray3();return a})},"esri/geometry/support/frustum":function(){define("exports ../../core/ObjectStack ../../core/libs/gl-matrix-2/math/mat4 ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../../chunks/vec42 ../../core/libs/gl-matrix-2/factories/vec4f64 ./clipRay ./plane ./vectorStacks".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(){return[p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create()]}function d(n,u){c.fromPoints(u[a.PointIndex.FAR_BOTTOM_LEFT],u[a.PointIndex.NEAR_BOTTOM_LEFT],u[a.PointIndex.NEAR_TOP_LEFT],n[a.PlaneIndex.LEFT]);c.fromPoints(u[a.PointIndex.NEAR_BOTTOM_RIGHT],u[a.PointIndex.FAR_BOTTOM_RIGHT],u[a.PointIndex.FAR_TOP_RIGHT],n[a.PlaneIndex.RIGHT]);c.fromPoints(u[a.PointIndex.FAR_BOTTOM_LEFT],u[a.PointIndex.FAR_BOTTOM_RIGHT],u[a.PointIndex.NEAR_BOTTOM_RIGHT], n[a.PlaneIndex.BOTTOM]);c.fromPoints(u[a.PointIndex.NEAR_TOP_LEFT],u[a.PointIndex.NEAR_TOP_RIGHT],u[a.PointIndex.FAR_TOP_RIGHT],n[a.PlaneIndex.TOP]);c.fromPoints(u[a.PointIndex.NEAR_BOTTOM_LEFT],u[a.PointIndex.NEAR_BOTTOM_RIGHT],u[a.PointIndex.NEAR_TOP_RIGHT],n[a.PlaneIndex.NEAR]);c.fromPoints(u[a.PointIndex.FAR_BOTTOM_RIGHT],u[a.PointIndex.FAR_BOTTOM_LEFT],u[a.PointIndex.FAR_TOP_LEFT],n[a.PlaneIndex.FAR])}function t(n,u){for(let x=0;6>x;x++)if(!c.clip(n[x],u))return!1;return!0}a.PlaneIndex=void 0; (function(n){n[n.LEFT=0]="LEFT";n[n.RIGHT=1]="RIGHT";n[n.BOTTOM=2]="BOTTOM";n[n.TOP=3]="TOP";n[n.NEAR=4]="NEAR";n[n.FAR=5]="FAR"})(a.PlaneIndex||(a.PlaneIndex={}));a.PointIndex=void 0;(function(n){n[n.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT";n[n.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT";n[n.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT";n[n.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT";n[n.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT";n[n.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT";n[n.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT";n[n.FAR_TOP_LEFT=7]= "FAR_TOP_LEFT"})(a.PointIndex||(a.PointIndex={}));const w={bottom:[a.PointIndex.FAR_BOTTOM_RIGHT,a.PointIndex.NEAR_BOTTOM_RIGHT,a.PointIndex.NEAR_BOTTOM_LEFT,a.PointIndex.FAR_BOTTOM_LEFT],near:[a.PointIndex.NEAR_BOTTOM_LEFT,a.PointIndex.NEAR_BOTTOM_RIGHT,a.PointIndex.NEAR_TOP_RIGHT,a.PointIndex.NEAR_TOP_LEFT],far:[a.PointIndex.FAR_BOTTOM_RIGHT,a.PointIndex.FAR_BOTTOM_LEFT,a.PointIndex.FAR_TOP_LEFT,a.PointIndex.FAR_TOP_RIGHT],right:[a.PointIndex.NEAR_BOTTOM_RIGHT,a.PointIndex.FAR_BOTTOM_RIGHT,a.PointIndex.FAR_TOP_RIGHT, a.PointIndex.NEAR_TOP_RIGHT],left:[a.PointIndex.FAR_BOTTOM_LEFT,a.PointIndex.NEAR_BOTTOM_LEFT,a.PointIndex.NEAR_TOP_LEFT,a.PointIndex.FAR_TOP_LEFT],top:[a.PointIndex.FAR_TOP_LEFT,a.PointIndex.NEAR_TOP_LEFT,a.PointIndex.NEAR_TOP_RIGHT,a.PointIndex.FAR_TOP_RIGHT]},v=[h.fromValues(-1,-1,-1,1),h.fromValues(1,-1,-1,1),h.fromValues(1,1,-1,1),h.fromValues(-1,1,-1,1),h.fromValues(-1,-1,1,1),h.fromValues(1,-1,1,1),h.fromValues(1,1,1,1),h.fromValues(-1,1,1,1)],m=new b.ObjectStack(f.create),r=g();a.computePlanes= d;a.copy=function(n,u){for(let x=0;6>x;x++)c.copy(n[x],u[x]);return n};a.create=function(n){return n?[c.create(n[0]),c.create(n[1]),c.create(n[2]),c.create(n[3]),c.create(n[4]),c.create(n[5])]:[c.create(),c.create(),c.create(),c.create(),c.create(),c.create()]};a.createPoints=g;a.fromMatrix=function(n,u,x,y=r){n=q.multiply(e.sm4d.get(),u,n);q.invert(n,n);for(u=0;8>u;++u){const z=k.transformMat4(e.sv4d.get(),v[u],n);l.set(y[u],z[0]/z[3],z[1]/z[3],z[2]/z[3])}d(x,y)};a.intersectClipRay=function(n,u){for(let x= 0;6>x;x++)if(!c.clipInfinite(n[x],u))return!1;return!0};a.intersectsLineSegment=function(n,u,x){return t(n,f.fromLineSegmentAndDirection(u,x,m.get()))};a.intersectsPoint=function(n,u){for(let x=0;6>x;x++)if(0x;x++){const y=n[x];if(y[0]*u[0]+y[1]*u[1]+y[2]*u[2]+y[3]>=u[3])return!1}return!0};a.numPlanes=6;a.numPoints=8;a.planePointIndices=w;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/clipRay":function(){define(["exports","../../core/ObjectStack","../../chunks/vec32","./ray"],function(a,b,q,l){function p(c){return c?{ray:l.create(c.ray),c0:c.c0,c1:c.c1}:{ray:l.create(),c0:0,c1:Number.MAX_VALUE}}function k(c,e,g,d=p()){l.copy(c,d.ray);d.c0=e;d.c1=g;return d}function h(c,e,g){return q.add(g,c.ray.origin,q.scale(g,c.ray.direction,e))}const f=new b.ObjectStack(()=>p());a.copy=function(c,e=p()){return k(c.ray,c.c0,c.c1, e)};a.create=p;a.fromLineSegmentAndDirection=function(c,e,g=p()){const d=q.length(c.vector);l.fromValues(c.origin,e,g.ray);g.c0=0;g.c1=d;return g};a.fromRay=function(c,e=p()){l.copy(c,e.ray);e.c0=0;e.c1=Number.MAX_VALUE;return e};a.fromValues=k;a.getAt=h;a.getEnd=function(c,e){return h(c,c.c1,e)};a.getStart=function(c,e){return h(c,c.c0,e)};a.wrap=function(c,e,g){const d=f.get();d.ray=c;d.c0=e;d.c1=g;return d};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/fov":function(){define(["exports"], function(a){a.fovd2fovx=function(b,q,l){return 2*Math.atan(q*Math.tan(.5*b)/Math.sqrt(q*q+l*l))};a.fovd2fovy=function(b,q,l){return 2*Math.atan(l*Math.tan(.5*b)/Math.sqrt(q*q+l*l))};a.fovx2fovd=function(b,q,l){return 2*Math.atan(Math.sqrt(q*q+l*l)*Math.tan(.5*b)/q)};a.fovy2fovd=function(b,q,l){return 2*Math.atan(Math.sqrt(q*q+l*l)*Math.tan(.5*b)/l)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/rendererUtils":function(){define(["exports","./ChangeSet"], function(a,b){a.RendererTarget=void 0;(function(q){q[q.Default=0]="Default";q[q.Screenshot=1]="Screenshot";q[q.ObjectAndLayerID=2]="ObjectAndLayerID"})(a.RendererTarget||(a.RendererTarget={}));a.PaddingSide=void 0;(function(q){q[q.TOP=0]="TOP";q[q.RIGHT=1]="RIGHT";q[q.BOTTOM=2]="BOTTOM";q[q.LEFT=3]="LEFT"})(a.PaddingSide||(a.PaddingSide={}));a.splitRenderGeometryChangeSetByMaterial=function(q){const l=new Map,p=k=>{let h=l.get(k);h||(h=new b.MaterialChangeSet,l.set(k,h));return h};q.removes.forAll(k=> {1<=k.geometry.indexCount&&p(k.material).removes.push(k)});q.adds.forAll(k=>{1<=k.geometry.indexCount&&p(k.material).adds.push(k)});q.updates.forAll(k=>{1<=k.renderGeometry.geometry.indexCount&&p(k.renderGeometry.material).updates.push(k)});return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ChangeSet":function(){define(["exports","../../../../core/PooledArray"],function(a,b){class q{constructor(){this.adds=new b;this.removes=new b;this.updates= new b({allocator:k=>k||new l,deallocator:k=>{k.renderGeometry=null;return k}})}clear(){this.adds.clear();this.removes.clear();this.updates.clear()}prune(){this.adds.prune();this.removes.prune();this.updates.prune()}get empty(){return 0===this.adds.length&&0===this.removes.length&&0===this.updates.length}}class l{}class p{constructor(){this.adds=[];this.removes=[];this.updates=[]}}a.ChangeSet=q;a.MaterialChangeSet=p;a.RenderGeometryUpdate=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/core/shaderLibrary/hud/HUDRenderStyle":function(){define(["exports"],function(a){a.HUDRenderStyle=void 0;var b=a.HUDRenderStyle||(a.HUDRenderStyle={});b[b.Occluded=0]="Occluded";b[b.NotOccluded=1]="NotOccluded";b[b.Both=2]="Both";b[b.COUNT=3]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl":function(){define(["exports","../output/ReadDepth.glsl","../../shaderModules/interfaces", "../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){class p{}a.MultipassGeometryUniforms=p;a.multipassGeometryTest=function(k){k.include(b.ReadDepth);k.uniforms.add(new l.Texture2DPassUniform("geometryDepthTexture",(h,f)=>f.multipassGeometry.depth?.attachment));k.code.add(q.glsl`bool geometryDepthTest(vec2 pos, float elementDepth) { float geometryDepth = linearDepthFromTexture(geometryDepthTexture, pos); return (elementDepth < (geometryDepth - 1.0)); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl":function(){define(["exports","../output/ReadDepth.glsl","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){class p{constructor(){this.cullAboveGround=!1}}a.MultipassTerrainUniforms=p;a.multipassTerrainTest=function(k,h){if(h.multipassEnabled){k.fragment.include(b.ReadDepth);k.fragment.uniforms.add(new l.Texture2DPassUniform("terrainDepthTexture", (c,e)=>e.multipassTerrain.depth?.attachment));var f=h.occlusionPass;k.fragment.code.add(q.glsl` ${f?"bool":"void"} terrainDepthTest(float fragmentDepth) { float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r; float linearDepth = linearizeDepth(depth); ${f?q.glsl`return fragmentDepth < linearDepth && depth < 1.0;`:q.glsl` if(fragmentDepth ${h.cullAboveGround?"\x3e":"\x3c\x3d"} linearDepth){ discard; }`} }`)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderSlot":function(){define(["exports"],function(a){a.RenderSlot=void 0;var b=a.RenderSlot||(a.RenderSlot={});b[b.INTEGRATED_MESH=0]="INTEGRATED_MESH";b[b.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN";b[b.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL";b[b.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH";b[b.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL";b[b.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH"; b[b.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN";b[b.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL";b[b.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN";b[b.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL";b[b.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL";b[b.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS";b[b.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT";b[b.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT";b[b.LASERLINES=14]="LASERLINES";b[b.LASERLINES_CONTRAST_CONTROL= 15]="LASERLINES_CONTRAST_CONTROL";b[b.HUD_MATERIAL=16]="HUD_MATERIAL";b[b.LABEL_MATERIAL=17]="LABEL_MATERIAL";b[b.LINE_CALLOUTS=18]="LINE_CALLOUTS";b[b.LINE_CALLOUTS_HUD_DEPTH=19]="LINE_CALLOUTS_HUD_DEPTH";b[b.DRAPED_MATERIAL=20]="DRAPED_MATERIAL";b[b.DRAPED_WATER=21]="DRAPED_WATER";b[b.VIEWSHED=22]="VIEWSHED";b[b.VOXEL=23]="VOXEL";b[b.MAX_SLOTS=24]="MAX_SLOTS";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TransparencyPassType":function(){define(["exports"], function(a){a.TransparencyPassType=void 0;var b=a.TransparencyPassType||(a.TransparencyPassType={});b[b.ColorAlpha=0]="ColorAlpha";b[b.FrontFace=1]="FrontFace";b[b.NONE=2]="NONE";b[b.COUNT=3]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lighting/SceneLighting":function(){define("exports ../../../../core/mathUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ./Lightsources ./SphericalHarmonics".split(" "),function(a, b,q,l,p,k){class h{constructor(){this.color=l.create();this.intensity=1}}class f{constructor(){this.direction=l.create();this.ambient=new h;this.diffuse=new h}}class c{constructor(){this._shOrder=2;this._legacy=new f;this.noonFactor=this.globalFactor=.5;this._sphericalHarmonics=new p.SphericalHarmonicsAmbientLight;this._mainLight=new p.MainLight(l.create(),l.fromValues(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(g){k.combineLights(g, this._shOrder,this._mainLight,this._sphericalHarmonics);q.copy(this._legacy.direction,this._mainLight.direction);g=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*g;this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*g;this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*g;q.scale(this._legacy.diffuse.color,this._mainLight.intensity,g);q.copy(e,this._legacy.diffuse.color);q.scale(e,e,.4*this.globalFactor);q.add(this._legacy.ambient.color, this._legacy.ambient.color,e)}copyFrom(g){this._sphericalHarmonics.r=Array.from(g.sh.r);this._sphericalHarmonics.g=Array.from(g.sh.g);this._sphericalHarmonics.b=Array.from(g.sh.b);q.copy(this._mainLight.direction,g.mainLight.direction);q.copy(this._mainLight.intensity,g.mainLight.intensity);this._mainLight.castShadows=g.mainLight.castShadows;this._mainLight.specularStrength=g.mainLight.specularStrength;this._mainLight.environmentStrength=g.mainLight.environmentStrength;this.globalFactor=g.globalFactor; this.noonFactor=g.noonFactor}lerpLighting(g,d,t){q.lerp(this._mainLight.intensity,g.mainLight.intensity,d.mainLight.intensity,t);this._mainLight.environmentStrength=b.lerp(g.mainLight.environmentStrength,d.mainLight.environmentStrength,t);this._mainLight.specularStrength=b.lerp(g.mainLight.specularStrength,d.mainLight.specularStrength,t);q.copy(this._mainLight.direction,d.mainLight.direction);this._mainLight.castShadows=d.mainLight.castShadows;this.globalFactor=b.lerp(g.globalFactor,d.globalFactor, t);this.noonFactor=b.lerp(g.noonFactor,d.noonFactor,t);if(g.sh.r.length===d.sh.r.length)for(let w=0;wG.needsUpdate)}constructor(){this._updating= e.signal(!0);this._microTaskQueued=!1;this._frameNumber=0;this.performanceInfo={total:new k("total"),tasks:new Map};this._frameTaskTimes=new Map;this._budget=new E;this._state=w.RenderState.INTERACTING;this._tasks=new h;this._runQueue=new h;this._load=0;this._idleStateCallbacks=new h;this._debug=this._forceTask=this._idleUpdatesStartFired=!1;this._debugHandle=c.watch(()=>t.SCHEDULER_LOG_SLOW_TASKS,G=>this._debug=G,c.initial);for(const G of Object.keys(a.TaskPriority))this.performanceInfo.tasks.set(a.TaskPriority[G], new k(a.TaskPriority[G]))}destroy(){this._tasks.toArray().forEach(G=>G.remove());this._tasks.clear();p.removeMaybe(this._debugHandle);this._microTaskQueued=!1;this._updatingChanged()}taskRunningChanged(G){this._updatingChanged();G&&0{this._microTaskQueued&&(this._microTaskQueued=!1,0this._removeIdleStateCallbacks(O),set idleBegin(P){L._idleUpdatesStartFired&&(O.idleEnd(),L._state===w.RenderState.IDLE&&P());O.idleBegin=P},set idleEnd(P){O.idleEnd=P}}}get load(){return this._load}set state(G){this._state!== G&&(this._state=G,this.state!==w.RenderState.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(I=>I.idleEnd())))}get state(){return this._state}updateBudget(G){++this._frameNumber;let I=n,O=G.frameDuration,L=u;switch(this.state){case w.RenderState.IDLE:I=g.Milliseconds(0);O=g.Milliseconds(Math.max(z,G.frameDuration));L=x;break;case w.RenderState.INTERACTING:O=g.Milliseconds(Math.max(y,G.frameDuration))}O=g.Milliseconds(O-G.elapsedFrameTime-I);if(this.state!== w.RenderState.IDLE&&OG.idleBegin()));this._runIdle();break;case w.RenderState.INTERACTING:this._runInteracting();break;default:this._runAnimating()}}stopFrame(){this._budget.reset(g.Milliseconds(0), this._state);this._budget.madeProgress()}_removeIdleStateCallbacks(G){this._idleUpdatesStartFired&&G.idleEnd();this._idleStateCallbacks.removeUnordered(G)}removeTask(G){this._tasks.removeUnordered(G);this._runQueue.removeUnordered(G);this._updatingChanged()}_updateTask(G){this._tasks.forAll(I=>{I.name===G&&I.setPriority(G)})}_getState(G){if(this._runQueue.some(O=>O.name===G))return a.TaskState.SCHEDULED;let I=a.TaskState.IDLE;this._tasks.forAll(O=>{O.name===G&&O.needsUpdate&&(1>=O.schedulePriority? I=a.TaskState.READY:I!==a.TaskState.READY&&(I=a.TaskState.WAITING))});return I}_getRuntime(G){let I=0;this._tasks.forAll(O=>{O.name===G&&(I+=O.runtime)});return I}_resetRuntimes(){this._tasks.forAll(G=>G.runtime=0)}_getRunning(){const G=new Map;this._tasks.forAll(O=>{O.needsUpdate&&G.set(O.name,(G.get(O.name)||0)+1)});if(0===G.size)return null;let I="";G.forEach((O,L)=>{I=1O.needsUpdate?++I:I,0);this._load=.9*this._load+G*(1-.9)}_schedule(){this._runQueue.filterInPlace(G=>{if(G.needsUpdate)return!0;G.schedulePriority=G.basePriority;return!1});for(this._tasks.forAll(G=>{0===G.basePriority&&G.needsUpdate&&!this._runQueue.includes(G)&&G.blockFrame!==this._frameNumber&&this._runQueue.unshift(G)});0===this._runQueue.length;){let G=!1;this._tasks.forAll(I=>{if(I.needsUpdate&&0!==I.schedulePriority&&0!==I.basePriority&&I.blockFrame!==this._frameNumber)switch(G= !0,I.schedulePriority){case 1:I.schedulePriority=0;this._runQueue.push(I);break;default:--I.schedulePriority}});if(!G)return this._updatingChanged(),!1}this._updatingChanged();return!0}_run(){const G=this._budget.now();this._startFrameTaskTimes();do for(;0=this._budget.remaining){this._updatingChanged();this._recordFrameTaskTimes(this._budget.now()-G);return}}while(this._schedule());this._updatingChanged();this._recordFrameTaskTimes(this._budget.now()-G)}_startFrameTaskTimes(){for(const G of Object.keys(a.TaskPriority))this._frameTaskTimes.set(a.TaskPriority[G], 0)}_recordFrameTaskTimes(G){this._frameTaskTimes.forEach((I,O)=>this.performanceInfo.tasks.get(O).record(I));this.performanceInfo.total.record(G)}get test(){}}F.Scheduler=H;class N{get task(){return this._task.value}get updating(){return this._queue.running}constructor(G,I,O){this._scheduler=G;this.name=I;this.runtime=this.blockFrame=0;this._queue=new d.PromiseQueue;this._handles=new b;this.schedulePriority=this._basePriority=m(I);this._task=e.signal(null!=O?O:this._queue);this._handles.add(c.when(()=> this.task.running,L=>G.taskRunningChanged(L)))}remove(){this.processQueue(B);this._scheduler.removeTask(this);this.schedule=D.schedule;this.reschedule=D.reschedule;this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(G){if(this.name!==G){this.name=G;G=m(G);if(0===this._basePriority||0!==this.schedulePriority)this.schedulePriority=G;this._basePriority=G}}get priority(){return this.name}set priority(G){this.setPriority(G)}get needsUpdate(){return this.updating||this.task.running}schedule(G, I,O){return this._queue.push(G,I,O)}reschedule(G,I,O){return this._queue.unshift(G,I,O)}processQueue(G){return this._queue.runTask(G)}}class E{constructor(){this._begin="undefined"!==typeof performance?performance.now():0;this._budget=0;this._state=w.RenderState.IDLE;this._progressed=this._done=!1;this._enabled=!0}run(G){if(this.done)return!1;!0===G()&&this.madeProgress();return!0}get done(){return this._done}get budget(){return this._budget}madeProgress(){this._progressed=!0;return this._done=this.elapsed>= this._budget&&this._enabled}get state(){return this._state}get enabled(){return this._enabled}set enabled(G){this._enabled=G}reset(G,I){this._begin=this.now();this._budget=G;this._state=I;this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._done=this._progressed=!1}get hasProgressed(){return this._progressed}}F.Budget=E})(A||={});a.TaskState=void 0;(function(F){F.SCHEDULED= "s";F.READY="r";F.WAITING="w";F.IDLE="i"})(a.TaskState||(a.TaskState={}));const B=(()=>{const F=new A.Budget;F.enabled=!1;return F})();class C{remove(){}processQueue(){}schedule(F,H,N){try{if(f.isAborted(H)){const E=f.createAbortError();return N?Promise.resolve(N(E)):Promise.reject(E)}return f.when(F(B))}catch(E){return Promise.reject(E)}}reschedule(F,H,N){return this.schedule(F,H,N)}}const D=new C;a.ImmediateTask=D;a.getTaskPriority=m;a.newScheduler=function(){return new A.Scheduler};a.noBudget= B;a.taskPriorities=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/PromiseQueue":function(){define(["exports","../../core/promiseUtils","../../core/signal","../../views/support/Yield"],function(a,b,q,l){class p{constructor(){this._tasks=[];this._runningTasks=q.signal(0)}get length(){return this._tasks.length}get running(){return 0this._tasks.push(new k(e,g,h,f,c)))).finally(()=>--this._runningTasks.value)}unshift(h,f,c){++this._runningTasks.value;return(new Promise((e,g)=>this._tasks.unshift(new k(e,g,h,f,c)))).finally(()=>--this._runningTasks.value)}_process(h){if(0===this._tasks.length)return!1;const f=this._tasks.shift();try{const c=b.isAborted(f.signal);if(c&&!f.abortCallback)f.reject(b.createAbortError());else{const e=c?f.abortCallback?.(b.createAbortError()): f.callback(h);b.isPromiseLike(e)?e.then(f.resolve,f.reject):f.resolve(e)}}catch(c){f.reject(c)}return!0}cancelAll(){const h=b.createAbortError();for(const f of this._tasks)if(f.abortCallback){const c=f.abortCallback(h);f.resolve(c)}else f.reject(h);this._tasks.length=0}}class k{constructor(h,f,c,e,g){this.resolve=h;this.reject=f;this.callback=c;this.signal=e;this.abortCallback=g}}a.PromiseQueue=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/Yield":function(){define(["exports"], function(a){const b=Symbol("Yield");a.Yield=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/debugFlags":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h){b=class extends b{constructor(){super(...arguments);this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=this.SCHEDULER_LOG_SLOW_TASKS= !1}};a.__decorate([q.property()],b.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0);a.__decorate([q.property()],b.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0);b=a.__decorate([h.subclass("esri.views.support.debugFlags")],b);return new b})},"esri/views/3d/environment/Fog":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ./atmosphereUtils ../../../chunks/Fog.glsl ./FogTechnique ./weather ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/glUtil3D ../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){a.Fog=class extends q{constructor(A){super(A);this._passParameters=new w.FogPassParameters;this._vao=n.createQuadVAO(A.context.renderContext.rctx,r.Pos2Tex);this._technique=new v.FogTechnique(A);A=d.getReferenceEllipsoid(A.view.spatialReference);this._planetRadius=A.radius;this._atmosphereRadius=A.radius+t.atmosphereHeight}destroy(){this._technique.release();this._vao.dispose()}set strength(A){this._passParameters.fogStrength=A}get strength(){return this._passParameters.fogStrength}render(A, B){this._update(A,B);if(!(0>=this._passParameters.fogAmount)){var C=this._technique;if(C.compiled){var D=A.offscreenRenderingHelper;D.renderDepthDetached(()=>{this._passParameters.depthTexture=D.depthTexture;const F=A.rctx.bindTechnique(C,A.bindParameters,this._passParameters);this._renderFog(F,A)})}else this.context.requestRender()}}_renderFog(A,B){B=B.rctx;B.bindVAO(this._vao);A.assertCompatibleVertexAttributeLocations(this._vao);B.drawArrays(u.PrimitiveType.TRIANGLE_STRIP,0,4)}_update(A,B){var C= A.bindParameters.camera;e.normalize(y,C.eye);A=Math.max(0,e.dot(y,A.bindParameters.lighting.mainLight.direction));const D=B.color;e.scale(z,D,.1);e.lerp(this._passParameters.fogColor,z,D,A);C=e.length(C.eye);this._passParameters.atmosphereC=C*C-this._atmosphereRadius*this._atmosphereRadius;this._passParameters.fogAmount=(1-l.smoothstep(.95*m.weatherHeightLimit,1*m.weatherHeightLimit,Math.abs(C-this._planetRadius)))*B.amount;this._passParameters.fogStrength=B.strength}};b.__decorate([p.property({constructOnly:!0})], a.Fog.prototype,"context",void 0);b.__decorate([p.property({constructOnly:!0})],a.Fog.prototype,"view",void 0);b.__decorate([p.property({constructOnly:!0})],a.Fog.prototype,"rctx",void 0);b.__decorate([p.property({constructOnly:!0})],a.Fog.prototype,"viewingMode",void 0);a.Fog=b.__decorate([c.subclass("esri.views.3d.environment.Fog")],a.Fog);class x{constructor(){this.color=g.create();this.amount=this.strength=0}}const y=g.create(),z=g.create();a.FogParameters=x;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/chunks/Fog.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(){const u=new t.ShaderBuilder;u.attributes.add(v.VertexAttribute.POSITION,"vec2");u.include(p.TextureCoordinateAttribute,{textureCoordinateType:p.TextureCoordinateAttributeType.Default});u.varyings.add("worldRay","vec3");u.varyings.add("eyeDir","vec3");const {vertex:x,fragment:y}=u;x.uniforms.add(new d.Matrix4PassUniform("inverseProjectionMatrix",(z,A)=>A.camera.inverseProjectionMatrix),new d.Matrix4PassUniform("inverseViewMatrix",(z,A)=>b.invertOrIdentity(n, A.camera.viewMatrix)));x.code.add(g.glsl`void main(void) { vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1, 1)).xyz; eyeDir = posViewNear; worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz; forwardTextureCoordinates(); gl_Position = vec4(position, 1, 1); }`);y.uniforms.add(new e.FloatPassUniform("atmosphereC",z=>z.atmosphereC),new c.Float3PassUniform("cameraPosition",(z,A)=>A.camera.eye),new f.Float2PassUniform("nearFar",(z,A)=>A.camera.nearFar),new w.Texture2DPassUniform("depthTexture",z=>z.depthTexture),new e.FloatPassUniform("fogStrength",z=>z.fogStrength),new e.FloatPassUniform("fogAmount",z=>z.fogAmount),new c.Float3PassUniform("fogColor",z=>z.fogColor));u.include(h.Gamma);y.include(k.ReadLinearDepth);y.code.add(g.glsl`vec2 sphereIntersect(vec3 start, vec3 dir) { float a = dot(dir, dir); float b = 2.0 * dot(dir, start); float d = (b * b) - 4.0 * a * atmosphereC; if (d < 0.0) { return vec2(1e5, -1e5); } return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a)); }`);y.code.add(g.glsl`vec4 applyFog(float dist, vec3 rayDir){ if(dist == -1.0){ vec2 rayAtmosphereIntersect = sphereIntersect(cameraPosition, rayDir); dist = 0.055 * rayAtmosphereIntersect.y; } float fogAmount = fogAmount * (1.0 - exp(-dist * fogStrength)); return vec4(fogAmount * fogColor, fogAmount); }`);y.code.add(g.glsl`vec3 tonemapACES(vec3 x) { return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); } void main() { vec3 rayDir = normalize(worldRay); float terrainDepth = -1.0; float depthSample = texture(depthTexture, vuv0).r; float zNorm = 2.0 * depthSample - 1.0; float linDepth = 2.0 * nearFar[0] * nearFar[1] / (nearFar[1] + nearFar[0] - zNorm * (nearFar[1] - nearFar[0])); if(depthSample < 1.0 && depthSample > 0.0){ vec3 cameraSpaceRay = normalize(eyeDir); cameraSpaceRay /= cameraSpaceRay.z; cameraSpaceRay *= linDepth; terrainDepth = max(0.0, length(cameraSpaceRay)); } vec4 fog = applyFog(terrainDepth, rayDir); fragColor = delinearizeGamma(vec4(tonemapACES(fog.rgb), fog.a)); }`);return u}class r extends g.NoParameters{constructor(){super(...arguments);this.fogColor=l.create();this.fogStrength=4E-6;this.atmosphereC=1;this.fogAmount=0}}const n=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,FogPassParameters:r,build:m},Symbol.toStringTag,{value:"Module"}));a.Fog=q;a.FogPassParameters=r;a.build=m})},"esri/views/3d/environment/FogTechnique":function(){define("require exports ../../../chunks/Fog.glsl ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g extends p.ShaderTechnique{constructor(d){super(d,new k.ShaderTechniqueConfiguration,()=>this.destroy())}initializeProgram(d){return new f.Program(d.rctx,g.shader.get().build(),h.Default3D)}initializePipeline(){return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.SRC_ALPHA,c.BlendFactor.ZERO,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE),colorWrite:e.defaultColorWriteParams})}}g.shader=new l.ReloadableShaderModule(q.Fog,()=>new Promise((d, t)=>a(["./Fog.glsl"],d,t)));b.FogTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/LocalAtmosphere":function(){define("exports ../../../core/maybe ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ./AtmosphereType ../../../chunks/SimpleAtmosphere.glsl ./SimpleAtmosphereTechnique ./SimpleAtmosphereTechniqueConfiguration ./resources/SimpleAtmosphereTexture ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/GeometryUtil ../webgl-engine/lib/VertexArrayObject ../webgl-engine/lib/VertexAttribute ../../webgl/BufferObject ../../webgl/enums ../../webgl/Texture ../../webgl/TextureDescriptor ../../webgl/Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){class y{constructor(B,C){this.type=p.AtmosphereType.Local;this._configuration=new f.SimpleAtmosphereTechniqueConfiguration;this._passParameters=new k.SimpleAtmospherePassParameters;this._configuration.geometry=f.SimpleAtmosphereGeometry.Cylinder;this._technique=C.techniques.acquire(h.SimpleAtmosphereTechnique,this._configuration);B=C.renderContext.rctx;C=t.createPolySphereData(1,2,!1);const {data:D,indices:F}=C[0][1];C=A.createBuffer(F.length);const H= C.position;for(let N=0;NB.camera.eye),new c.FloatPassUniform("undergroundFadeAlpha",A=>A.undergroundFadeAlpha)),y.code.add(e.glsl`void main(void) { float ndotl = dot(normalize(cameraPosition), mainLightDirection); float lighting = max(0.0, smoothstep(-1.0, 0.8, 2.0 * ndotl)); color = vec4(vec3(lighting), undergroundFadeAlpha); gl_Position = vec4(position.xy, 1.0, 1.0); }`),z.code.add(e.glsl`void main() { fragColor = color; }`)):(x.include(p.Transform,u),x.attributes.add(w.VertexAttribute.POSITION,"vec3"),x.varyings.add("vtc","vec2"),x.varyings.add("falloff","float"),u=u.geometry===l.SimpleAtmosphereGeometry.Cylinder,y.uniforms.add(new g.Matrix4PassUniform("proj",(A,B)=>B.camera.projectionMatrix),new g.Matrix4PassUniform("view",(A,B)=>B.camera.viewMatrix)),u||(x.varyings.add("innerFactor","float"),y.uniforms.add(new f.Float3PassUniform("silCircleCenter",A=>A.silhouette.center)),y.uniforms.add(new f.Float3PassUniform("silCircleV1", A=>A.silhouette.v1)),y.uniforms.add(new f.Float3PassUniform("silCircleV2",A=>A.silhouette.v2)),y.uniforms.add(new h.Float2PassUniform("texV",A=>A.texV)),y.uniforms.add(new c.FloatPassUniform("innerScale",A=>A.innerScale))),y.code.add(e.glsl` void main(void) { ${u?e.glsl` vec3 pos = position; float ndotl = mainLightDirection.z; vtc = vec2(0.0, position.z + 0.05);`:e.glsl` innerFactor = clamp(-position.z, 0.0, 1.0); float scale = position.y * (1.0 + innerFactor * innerScale); float phi = position.x * ${e.glsl.float(.04908738515625)} + 1.0; vec3 pos = (silCircleCenter + sin(phi) * silCircleV1 + cos(phi) * silCircleV2) * scale; float ndotl = dot(normalize(position.y > 0.0 ? pos: silCircleCenter), mainLightDirection); vtc.x = position.x * ${e.glsl.float(.0078125)}; vtc.y = texV.x * (1.0 - position.z) + texV.y * position.z; `} falloff = max(0.0, smoothstep(-1.0, 0.8, 2.0 * ndotl)); gl_Position = transformPosition(proj, view, pos); gl_Position.z = gl_Position.w; // project atmosphere onto the far plane } `),z.uniforms.add(new t.Texture2DPassUniform("tex",A=>A.texture)),u||z.uniforms.add(new c.FloatPassUniform("altitudeFade",A=>A.altitudeFade)),z.code.add(e.glsl` void main() { vec4 atmosphereColor = texture(tex, vtc) * falloff; ${u?e.glsl`fragColor = atmosphereColor;`:e.glsl` vec4 innerColor = vec4(atmosphereColor.rgb, 1.0 - altitudeFade); fragColor = mix(atmosphereColor, innerColor, smoothstep(0.0, 1.0, innerFactor)); `} }`));return x}class m extends e.NoParameters{constructor(){super(...arguments);this.texV=b.create();this.undergroundFadeAlpha=this.innerScale=this.altitudeFade=0;this.silhouette=new r}}class r{constructor(){this.center=q.create();this.v1=q.create();this.v2=q.create()}}const n=Object.freeze(Object.defineProperty({__proto__:null,SilhouetteCircle:r,SimpleAtmospherePassParameters:m,build:v},Symbol.toStringTag,{value:"Module"}));a.SilhouetteCircle=r;a.SimpleAtmosphere=n;a.SimpleAtmospherePassParameters= m;a.build=v})},"esri/views/3d/environment/SimpleAtmosphereTechniqueConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration","../webgl-engine/materials/DefaultTechniqueConfiguration"],function(a,b,q,l){a.SimpleAtmosphereGeometry=void 0;(function(k){k[k.Cone=0]="Cone";k[k.Cylinder=1]="Cylinder";k[k.Underground=2]="Underground";k[k.COUNT=3]="COUNT"})(a.SimpleAtmosphereGeometry||(a.SimpleAtmosphereGeometry={}));class p extends l.DefaultTechniqueConfiguration{constructor(){super(...arguments); this.geometry=a.SimpleAtmosphereGeometry.Cone}}b.__decorate([q.parameter({count:a.SimpleAtmosphereGeometry.COUNT})],p.prototype,"geometry",void 0);a.SimpleAtmosphereTechniqueConfiguration=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl","../core/shaderTechnique/BindType","../core/shaderTechnique/ShaderTechniqueConfiguration"], function(a,b,q,l,p){class k extends q.InstancedDoubleConfiguration{}b.__decorate([p.parameter({constValue:!0})],k.prototype,"hasSliceHighlight",void 0);b.__decorate([p.parameter({constValue:!1})],k.prototype,"hasSliceInVertexProgram",void 0);b.__decorate([p.parameter({constValue:l.BindType.Pass})],k.prototype,"pbrTextureBindType",void 0);a.DefaultTechniqueConfiguration=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl":function(){define("exports ../../../../../../chunks/tslib.es6 ../../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../chunks/vec32 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../ShaderOutput ../util/DoublePrecision.glsl ../util/View.glsl ../../shaderModules/Float3DrawUniform ../../shaderModules/interfaces ../../shaderModules/Matrix3PassUniform ../../shaderModules/Matrix4PassUniform ../../shaderTechnique/ShaderTechniqueConfiguration ../../../lib/VertexAttribute ../../../../../webgl/doublePrecisionUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){class n extends v.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.hasModelTransformation=this.instancedDoublePrecision=!1}}b.__decorate([v.parameter()],n.prototype,"instancedDoublePrecision",void 0);b.__decorate([v.parameter()],n.prototype,"hasModelTransformation",void 0);class u extends d.NoParameters{constructor(){super(...arguments);this.modelTransformation=null}}const x=l.create(),y=h.create();a.InstancedDoubleConfiguration=n;a.InstancedDoublePassParameters= u;a.InstancedDoublePrecision=function(z,A){const B=A.hasModelTransformation,C=A.instancedDoublePrecision;B&&(z.vertex.uniforms.add(new w.Matrix4PassUniform("model",D=>D.modelTransformation??p.IDENTITY)),z.vertex.uniforms.add(new t.Matrix3PassUniform("normalLocalOriginFromModel",D=>{q.normalFromMat4(x,D.modelTransformation??p.IDENTITY);return x})));A.instanced&&C&&(z.attributes.add(m.VertexAttribute.INSTANCEMODELORIGINHI,"vec3"),z.attributes.add(m.VertexAttribute.INSTANCEMODELORIGINLO,"vec3"),z.attributes.add(m.VertexAttribute.INSTANCEMODEL, "mat3"),z.attributes.add(m.VertexAttribute.INSTANCEMODELNORMAL,"mat3"));z=z.vertex;C&&(z.include(c.DoublePrecision,A),z.uniforms.add(new g.Float3DrawUniform("viewOriginHi",(D,F)=>r.encodeDoubleHi(k.set(y,F.camera.viewInverseTransposeMatrix[3],F.camera.viewInverseTransposeMatrix[7],F.camera.viewInverseTransposeMatrix[11]),y)),new g.Float3DrawUniform("viewOriginLo",(D,F)=>r.encodeDoubleLo(k.set(y,F.camera.viewInverseTransposeMatrix[3],F.camera.viewInverseTransposeMatrix[7],F.camera.viewInverseTransposeMatrix[11]), y))));z.code.add(d.glsl` vec3 getVertexInLocalOriginSpace() { return ${B?C?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":C?"instanceModel * localPosition().xyz":"localPosition().xyz"}; } vec3 subtractOrigin(vec3 _pos) { ${C?d.glsl` // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped // working for macOS 14+ and iOS 17+. // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280 vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo); return _pos - originDelta;`:"return vpos;"} } `);z.code.add(d.glsl` vec3 dpNormal(vec4 _normal) { return normalize(${B?C?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":C?"instanceModelNormal * _normal.xyz":"_normal.xyz"}); } `);A.output===f.ShaderOutput.Normal&&(e.addViewNormal(z),z.code.add(d.glsl` vec3 dpNormalView(vec4 _normal) { return normalize((viewNormal * ${B?C?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":C?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz); } `));A.hasVertexTangents&&z.code.add(d.glsl` vec4 dpTransformVertexTangent(vec4 _tangent) { ${B?C?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":C?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"} }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput":function(){define(["exports"],function(a){function b(c){return c===a.ShaderOutput.Shadow||c===a.ShaderOutput.ShadowHighlight||c===a.ShaderOutput.ShadowExcludeHighlight||c===a.ShaderOutput.ViewshedShadow}function q(c){return c===a.ShaderOutput.Highlight||c===a.ShaderOutput.ObjectAndLayerIdColor}function l(c){return c===a.ShaderOutput.Color}function p(c){return l(c)|| c===a.ShaderOutput.Highlight}function k(c){return l(c)||q(c)}function h(c){return k(c)||f(c)}function f(c){return c===a.ShaderOutput.Depth}a.ShaderOutput=void 0;(function(c){c[c.Color=0]="Color";c[c.Depth=1]="Depth";c[c.Normal=2]="Normal";c[c.Shadow=3]="Shadow";c[c.ShadowHighlight=4]="ShadowHighlight";c[c.ShadowExcludeHighlight=5]="ShadowExcludeHighlight";c[c.ViewshedShadow=6]="ViewshedShadow";c[c.Highlight=7]="Highlight";c[c.ObjectAndLayerIdColor=8]="ObjectAndLayerIdColor";c[c.COUNT=9]="COUNT"})(a.ShaderOutput|| (a.ShaderOutput={}));a.is2DGeometryOutput=function(c){return c===a.ShaderOutput.Color||q(c)};a.is3DGeometryOutput=function(c){return h(c)||c===a.ShaderOutput.Normal};a.isColor=l;a.isColorHighlightOIDOrDepth=h;a.isColorHighlightOrDepth=function(c){return p(c)||f(c)};a.isColorHighlightOrOID=k;a.isColorOrHighlight=p;a.isColorOrOID=function(c){return l(c)||c===a.ShaderOutput.ObjectAndLayerIdColor};a.isDepth=f;a.isDepthLikeOutput=function(c){return b(c)||c===a.ShaderOutput.Depth||c===a.ShaderOutput.Normal|| c===a.ShaderOutput.ObjectAndLayerIdColor};a.isOIDorHighlight=q;a.isShadowRelatedOutput=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/DoublePrecision.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.DoublePrecision=function({code:q},l){l.doublePrecisionRequiresObfuscation?q.add(b.glsl`vec3 dpPlusFrc(vec3 a, vec3 b) { return mix(a, a + b, vec3(notEqual(b, vec3(0)))); } vec3 dpMinusFrc(vec3 a, vec3 b) { return mix(vec3(0), a - b, vec3(notEqual(a, b))); } vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { vec3 t1 = dpPlusFrc(hiA, hiB); vec3 e = dpMinusFrc(t1, hiA); vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; return t1 + t2; }`):q.add(b.glsl`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { vec3 t1 = hiA + hiB; vec3 e = t1 - hiA; vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; return t1 + t2; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../chunks/vec32 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../shaderModules/Float3DrawUniform ../../shaderModules/Float3PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/Matrix4DrawUniform ../../shaderModules/Matrix4PassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e){const g=q.create(),d=p.create();a.addCameraPosition=function(t,w){w.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",p.ZEROS):t.uniforms.add(new k.Float3DrawUniform("cameraPosition",(v,m)=>l.set(d,m.camera.viewInverseTransposeMatrix[3]-v.origin[0],m.camera.viewInverseTransposeMatrix[7]-v.origin[1],m.camera.viewInverseTransposeMatrix[11]-v.origin[2])))};a.addPixelRatio=function(t){t.uniforms.add(new f.FloatPassUniform("pixelRatio",(w,v)=>v.camera.pixelRatio/ v.overlayStretch))};a.addProjViewLocalOrigin=function(t,w){w.instancedDoublePrecision?t.uniforms.add(new e.Matrix4PassUniform("proj",(v,m)=>m.camera.projectionMatrix),new e.Matrix4PassUniform("view",(v,m)=>b.translate(g,m.camera.viewMatrix,l.set(d,m.camera.viewInverseTransposeMatrix[3],m.camera.viewInverseTransposeMatrix[7],m.camera.viewInverseTransposeMatrix[11]))),new h.Float3PassUniform("localOrigin",(v,m)=>l.set(d,m.camera.viewInverseTransposeMatrix[3],m.camera.viewInverseTransposeMatrix[7],m.camera.viewInverseTransposeMatrix[11]))): t.uniforms.add(new e.Matrix4PassUniform("proj",(v,m)=>m.camera.projectionMatrix),new c.Matrix4DrawUniform("view",(v,m)=>b.translate(g,m.camera.viewMatrix,v.origin)),new k.Float3DrawUniform("localOrigin",v=>v.origin))};a.addViewNormal=function(t){t.uniforms.add(new e.Matrix4PassUniform("viewNormal",(w,v)=>v.camera.viewInverseTransposeMatrix))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform":function(){define(["exports", "./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"mat4",q.BindType.Draw,(h,f,c)=>h.setUniformMatrix4fv(p,k(f,c)))}}a.Matrix4DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/doublePrecisionUtils":function(){define(["exports"],function(a){const b=new Float32Array(2);a.decodeDoubleArray=function(q,l,p){for(let k=0;kg.camera.nearFar))}function f(c){c.vertex.code.add(p.glsl`float calculateLinearDepth(vec2 nearFar,float z) { return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]); }`)}a.ForwardLinearDepth=function(c,e){const {vertex:g}=c;switch(e.output){case b.ShaderOutput.Color:if(e.receiveShadows){k(c);g.code.add(p.glsl`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);return}break;case b.ShaderOutput.Shadow:case b.ShaderOutput.ShadowHighlight:case b.ShaderOutput.ShadowExcludeHighlight:case b.ShaderOutput.ViewshedShadow:c.include(q.VertexPosition,e);k(c);h(c);f(c);g.code.add(p.glsl`void forwardLinearDepth() { linearDepth = calculateLinearDepth(nearFar, vPosition_view.z); }`);return}g.code.add(p.glsl`void forwardLinearDepth() {}`)};a.addCalculateLinearDepth=f;a.addLinearDepth=k;a.addNearFar=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./PositionAttribute.glsl ../util/DoublePrecision.glsl ../../shaderModules/Float3DrawUniform ../../shaderModules/Float3PassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix3DrawUniform ../../shaderModules/Matrix3PassUniform ../../shaderModules/Matrix4PassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends c.NoParameters{constructor(){super(...arguments);this.transformWorldFromViewTH=l.create();this.transformWorldFromViewTL=l.create();this.transformViewFromCameraRelativeRS=b.create();this.transformProjFromView=q.create()}}class w extends c.NoParameters{constructor(){super(...arguments);this.transformWorldFromModelRS=b.create();this.transformWorldFromModelTH=l.create();this.transformWorldFromModelTL=l.create()}}a.VertexPosition=function(v,m){v.include(p.PositionAttribute); const r=v.vertex;r.include(k.DoublePrecision,m);v.varyings.add("vPositionWorldCameraRelative","vec3");v.varyings.add("vPosition_view","vec3");r.uniforms.add(new f.Float3PassUniform("transformWorldFromViewTH",n=>n.transformWorldFromViewTH),new f.Float3PassUniform("transformWorldFromViewTL",n=>n.transformWorldFromViewTL),new g.Matrix3PassUniform("transformViewFromCameraRelativeRS",n=>n.transformViewFromCameraRelativeRS),new d.Matrix4PassUniform("transformProjFromView",n=>n.transformProjFromView),new e.Matrix3DrawUniform("transformWorldFromModelRS", n=>n.transformWorldFromModelRS),new h.Float3DrawUniform("transformWorldFromModelTH",n=>n.transformWorldFromModelTH),new h.Float3DrawUniform("transformWorldFromModelTL",n=>n.transformWorldFromModelTL));r.code.add(c.glsl`vec3 positionWorldCameraRelative() { vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel(); vec3 transform_CameraRelativeFromModel = dpAdd( transformWorldFromModelTL, transformWorldFromModelTH, -transformWorldFromViewTL, -transformWorldFromViewTH ); return transform_CameraRelativeFromModel + rotatedModelPosition; }`);r.code.add(c.glsl` void forwardPosition(float fOffset) { vPositionWorldCameraRelative = positionWorldCameraRelative(); if (fOffset != 0.0) { vPositionWorldCameraRelative += fOffset * ${m.spherical?c.glsl`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:c.glsl`vec3(0.0, 0.0, 1.0)`}; } vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative; gl_Position = transformProjFromView * vec4(vPosition_view, 1.0); } `);v.fragment.uniforms.add(new f.Float3PassUniform("transformWorldFromViewTL",n=>n.transformWorldFromViewTL));r.code.add(c.glsl`vec3 positionWorld() { return transformWorldFromViewTL + vPositionWorldCameraRelative; }`);v.fragment.code.add(c.glsl`vec3 positionWorld() { return transformWorldFromViewTL + vPositionWorldCameraRelative; }`)};a.VertexPositionDrawParameters=w;a.VertexPositionPassParameters=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl":function(){define(["exports","../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q){a.PositionAttribute=function(l){l.attributes.add(q.VertexAttribute.POSITION,"vec3");l.vertex.code.add(b.glsl`vec3 positionModel() { return position; }`)};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"mat3",q.BindType.Draw,(h,f,c)=>h.setUniformMatrix3fv(p,k(f,c)))}}a.Matrix3DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/SimpleAtmosphereTechnique":function(){define("require exports ../../../chunks/SimpleAtmosphere.glsl ./SimpleAtmosphereTechniqueConfiguration ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g extends k.ShaderTechnique{initializeProgram(d){return new f.Program(d.rctx,g.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return this.configuration.geometry===l.SimpleAtmosphereGeometry.Cylinder?e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA),culling:e.backFaceCullingParams,depthTest:{func:c.CompareFunction.LEQUAL}, colorWrite:e.defaultColorWriteParams}):e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:{func:c.CompareFunction.LEQUAL},colorWrite:e.defaultColorWriteParams})}}g.shader=new p.ReloadableShaderModule(q.SimpleAtmosphere,()=>new Promise((d,t)=>a(["./SimpleAtmosphere.glsl"],d,t)));b.SimpleAtmosphereTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/resources/SimpleAtmosphereTexture":function(){define(["exports"], function(a){const b=new Uint8ClampedArray([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,11,0,0,0, 11,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,13,0,0,0,13,0,0,0,13,0,0,0,13,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,15,16,0,0,16,16,0,0,16,16,0,0,16,16,0,0,16,15,0,0,17,15,0,0,17,15,0,0,17,15,0,0,17,14,0,0,18,14,0,0,18,14,0,0,18,13,0,0,19,13,0,0,19,13,0,0,19,13,0,0,19,13,0,0,20,13,0,0,20,13,0,0,20,13,0,0,20,12,0,0,21,12,0,0,21,12,0,0,21,12,0,0,21,12,0,0,22,12,0,0,22,12,0,0,22,12,0,0,22,11,0,0,23,11,0,0,23,11,0,0,23,11,0,0,24,11,0,0,24, 11,0,0,24,11,0,0,24,10,0,0,25,10,0,0,25,10,0,0,25,10,0,0,26,10,0,0,26,10,0,0,26,10,0,0,26,9,0,0,27,9,0,0,27,9,0,0,27,18,0,0,28,18,0,0,28,18,0,0,28,18,0,0,28,18,0,0,29,18,0,0,29,18,0,0,29,17,0,0,30,17,0,0,30,17,0,0,30,17,0,0,30,16,0,0,31,16,0,0,31,16,0,0,31,16,0,0,32,16,0,0,32,16,0,0,32,15,0,0,33,15,0,0,33,15,0,0,33,15,0,0,34,15,8,0,34,15,8,0,34,15,8,0,34,15,7,0,35,15,7,0,35,15,7,0,35,21,7,0,36,21,7,0,36,21,7,0,36,21,7,0,37,21,7,0,37,21,7,0,37,20,7,0,38,20,7,0,38,20,7,0,38,20,7,0,39,20,7,0,39,20,7, 0,39,20,7,0,39,19,6,0,40,19,6,0,40,19,6,0,40,19,6,0,41,19,6,0,41,19,6,0,41,18,6,0,42,18,6,0,42,18,6,0,42,24,6,0,43,24,6,0,43,24,6,0,43,23,6,0,44,23,6,0,44,23,6,0,44,23,6,0,45,23,6,0,45,23,6,0,45,22,6,0,46,22,6,0,46,22,6,0,46,22,5,0,47,22,5,0,47,22,5,0,47,21,5,0,48,21,5,0,48,21,5,0,48,21,5,0,49,21,5,0,49,26,5,0,49,25,5,0,50,25,5,0,50,25,5,0,50,25,5,0,51,25,5,0,51,25,5,0,51,25,5,0,52,25,5,0,52,25,5,0,52,24,5,0,53,24,5,0,53,24,5,0,53,24,9,0,54,28,9,0,54,28,9,0,54,28,9,0,55,28,9,0,55,27,9,0,56,27,9,0, 56,27,9,0,56,27,9,4,57,27,9,4,57,27,9,4,57,26,9,4,58,26,9,4,58,26,9,4,58,26,9,4,59,26,9,4,59,26,9,4,59,26,8,4,60,30,8,4,60,30,8,4,60,29,8,4,61,29,8,4,61,29,8,4,62,29,8,4,62,29,8,4,62,28,8,4,63,28,8,4,63,28,8,4,63,28,12,4,64,28,12,4,64,28,12,4,64,27,12,4,65,27,12,8,65,27,12,8,65,31,12,8,66,31,12,8,66,30,11,8,67,30,11,8,67,30,11,8,67,30,11,8,68,30,11,8,68,30,11,8,68,30,15,7,69,30,15,7,69,30,15,7,69,33,15,11,70,33,15,11,70,32,14,11,71,32,14,11,71,32,14,11,71,32,18,14,72,32,18,14,72,32,18,14,72,31,17, 14,73,35,17,14,73,34,17,17,74,34,21,17,74,34,21,17,74,34,20,17,75,34,20,20,75,34,20,20,75,34,23,20,76,34,23,20,76,36,23,23,77,36,23,23,77,36,23,23,77,36,23,23,78,36,26,26,78,36,26,26,78,36,26,26,79,36,26,29,79,38,26,29,80,38,29,29,80,38,29,29,80,38,28,31,81,38,28,31,81,38,31,31,81,37,31,34,82,37,31,34,82,37,31,37,83,40,34,37,83,40,34,37,83,39,33,39,84,39,33,39,84,39,36,42,84,39,36,42,85,39,36,42,85,39,36,42,85,39,39,44,86,39,39,44,86,41,38,47,87,41,41,47,87,41,41,50,87,41,41,49,88,41,41,52,88,40, 43,52,89,43,43,52,89,43,43,54,89,42,45,54,90,42,45,57,90,42,45,57,90,42,45,59,91,42,48,59,91,44,47,61,92,44,47,61,92,44,50,61,92,44,49,63,93,44,49,63,93,44,52,66,93,43,52,65,94,46,54,68,94,46,54,70,95,46,54,70,95,46,54,70,95,45,56,72,96,45,56,72,96,45,58,74,97,47,58,76,97,47,58,76,97,47,60,78,98,47,60,78,98,47,60,81,98,49,62,80,99,49,62,82,99,48,61,84,100,48,64,84,100,48,64,84,100,50,63,86,101,50,66,86,101,50,66,88,101,50,65,90,102,52,67,89,103,51,69,91,104,51,68,92,105,52,69,93,107,52,71,94,108, 54,70,96,109,53,71,96,111,52,73,98,112,54,72,98,114,53,73,100,115,54,72,100,117,54,73,102,118,55,74,104,120,55,76,105,121,56,77,106,123,56,76,107,124,57,79,107,126,58,78,110,128,57,79,111,129,56,80,113,131,58,79,112,132,57,82,114,134,58,81,116,136,60,82,117,137,59,83,117,139,60,83,119,141,59,84,120,142,60,85,122,144,59,86,122,146,60,86,126,148,62,87,127,149,61,88,127,151,62,88,128,153,63,89,130,155,62,90,131,156,63,90,132,158,64,91,134,160,65,91,135,162,64,92,136,163,63,93,138,165,66,95,139,167,65, 95,140,169,66,95,142,171,67,96,142,172,66,97,144,174,67,99,145,176,67,97,148,178,67,99,147,180,68,100,149,181,68,100,150,183,69,101,152,185,70,102,153,187,71,103,155,188,70,103,156,190,70,104,157,192,71,105,158,194,71,106,160,195,72,106,161,197,72,108,161,199,73,108,163,200,73,109,164,202,74,109,165,204,74,110,167,206,75,111,168,207,74,112,170,209,75,112,170,210,76,113,171,212,76,114,173,214,77,115,174,215,78,115,175,217,78,116,175,218,78,117,177,220,78,118,178,221,79,118,180,223,80,120,180,224,81, 120,181,226,81,120,182,227,82,121,184,229,82,122,185,230,84,123,186,232,83,123,187,233,84,124,189,234,84,125,188,235,85,126,189,237,86,126,190,238,86,127,191,239,87,127,192,240,87,129,193,242,88,129,194,243,89,130,195,244,90,131,196,245,90,132,197,246,91,132,197,247,92,133,198,248,92,134,199,249,93,135,200,250,94,136,201,251,95,137,202,252,96,138,203,253,97,140,204,254,98,141,205,254,99,142,206,255,101,143,207,255,102,144,208,255,103,146,209,255,104,147,209,255,106,148,210,255,107,149,211,255,108, 151,212,255,110,152,213,255,111,153,213,255,112,154,214,255,114,156,215,255,115,157,215,255,117,158,216,255,118,160,217,255,120,161,217,255,121,162,218,255,123,164,218,255,124,165,219,255,125,166,219,255,127,167,220,255,129,169,220,255,130,170,221,255,132,171,221,255,133,173,222,255,134,174,222,255,136,175,223,255,139,178,224,255,142,180,224,255,144,182,225,255,147,185,226,255,150,187,226,255,153,189,227,255,155,191,228,255,158,194,228,255,160,196,229,255,163,198,229,255,165,200,230,255,168,202,231, 255,170,203,231,255,172,205,232,255,174,207,232,255,176,209,233,255,178,210,234,255,180,212,234,255,182,214,235,255,184,215,236,255,186,217,237,255,188,219,238,255,190,220,238,255,192,221,239,255,193,222,240,255,194,224,240,255,196,225,241,255,197,226,241,255,198,226,242,255,199,227,242,255,200,228,242,255,201,228,243,255,202,229,243,255,203,230,243,255,204,230,244,255,205,231,244,255,207,232,244,255,208,233,245,255,209,233,245,255,211,234,246,255,213,235,246,255,217,238,247,255,222,240,248,255,226, 242,249,255,231,245,250,255,236,247,251,255,241,249,252,255,245,251,253,255,249,252,254,255,255,255,255,255]);a.earthAtmosphereTextureSimple=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/buffer/glUtil":function(){define(["exports","../../../webgl/enums","../../../webgl/VertexElementDescriptor"],function(a,b,q){const l={u8:b.DataType.UNSIGNED_BYTE,u16:b.DataType.UNSIGNED_SHORT,u32:b.DataType.UNSIGNED_INT,i8:b.DataType.BYTE,i16:b.DataType.SHORT,i32:b.DataType.INT, f32:b.DataType.FLOAT};a.glLayout=function(p,k=0){const h=p.stride;return Array.from(p.fields.keys()).map(f=>{const c=p.fields.get(f),e=c.constructor.ElementCount;var g=l[c.constructor.ElementType];if(!g)throw Error("BufferType not supported in WebGL");return new q.VertexElementDescriptor(f,e,g,c.offset,h,c.optional?.glNormalized??!1,k)})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/buffer/InterleavedLayout":function(){define(["exports","../../../../geometry/support/buffer/BufferView", "../../../../geometry/support/buffer/types","../../webgl-engine/lib/Util"],function(a,b,q,l){class p{constructor(e,g){this.layout=e;this.buffer="number"===typeof g?new ArrayBuffer(g*e.stride):g;for(const d of e.fields.keys())g=e.fields.get(d),this[d]=new g.constructor(this.buffer,g.offset,this.stride)}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,g){return(e=this[e])&&e.elementCount===g.ElementCount&& e.elementType===g.ElementType?e:null}slice(e,g){return new p(this.layout,this.buffer.slice(e*this.stride,g*this.stride))}copyFrom(e,g=0,d=0,t=e.count){const w=this.stride;0===w%4?(e=new Uint32Array(e.buffer,g*w,t*w/4),(new Uint32Array(this.buffer,d*w,t*w/4)).set(e)):(e=new Uint8Array(e.buffer,g*w,t*w),(new Uint8Array(this.buffer,d*w,t*w)).set(e));return this}get usedMemory(){return this.byteLength}dispose(){}}class k{constructor(e=null){this._lastAligned=this._stride=0;this._fields=new Map;e&&(this._stride= e.stride,e.fields.forEach(g=>this._fields.set(g[0],{...g[1],constructor:c.get(g[1].constructor)})))}freeze(){return this}vec2f(e,g){this._appendField(e,b.BufferViewVec2f,g);return this}vec2f64(e,g){this._appendField(e,b.BufferViewVec2f64,g);return this}vec3f(e,g){this._appendField(e,b.BufferViewVec3f,g);return this}vec3f64(e,g){this._appendField(e,b.BufferViewVec3f64,g);return this}vec4f(e,g){this._appendField(e,b.BufferViewVec4f,g);return this}vec4f64(e,g){this._appendField(e,b.BufferViewVec4f64, g);return this}mat3f(e,g){this._appendField(e,b.BufferViewMat3f,g);return this}mat3f64(e,g){this._appendField(e,b.BufferViewMat3f64,g);return this}mat4f(e,g){this._appendField(e,b.BufferViewMat4f,g);return this}mat4f64(e,g){this._appendField(e,b.BufferViewMat4f64,g);return this}vec4u8(e,g){this._appendField(e,b.BufferViewVec4u8,g);return this}f32(e,g){this._appendField(e,b.BufferViewFloat,g);return this}f64(e,g){this._appendField(e,b.BufferViewFloat64,g);return this}u8(e,g){this._appendField(e,b.BufferViewUint8, g);return this}u16(e,g){this._appendField(e,b.BufferViewUint16,g);return this}i8(e,g){this._appendField(e,b.BufferViewInt8,g);return this}vec2i8(e,g){this._appendField(e,b.BufferViewVec2i8,g);return this}vec2i16(e,g){this._appendField(e,b.BufferViewVec2i16,g);return this}vec2u8(e,g){this._appendField(e,b.BufferViewVec2u8,g);return this}vec4u16(e,g){this._appendField(e,b.BufferViewVec4u16,g);return this}u32(e,g){this._appendField(e,b.BufferViewUint32,g);return this}_appendField(e,g,d){if(this._fields.has(e))l.assert(!1, `${e} already added to vertex buffer layout`);else{var t=g.ElementCount*q.elementTypeSize(g.ElementType),w=this._stride;this._stride+=t;this._fields.set(e,{size:t,constructor:g,offset:w,optional:d})}}createBuffer(e){return new p(this,e)}createView(e){return new p(this,e)}clone(){const e=new k;e._stride=this._stride;e._fields=new Map;this._fields.forEach((g,d)=>e._fields.set(d,g));e.BufferType=this.BufferType;return e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach(g=> e=Math.max(e,q.elementTypeSize(g.constructor.ElementType)));this._stride=Math.floor((this._stride+e-1)/e)*e;this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}class h{constructor(e){this.fields=[];e.fields.forEach((g,d)=>{var t=g.constructor;this.fields.push([d,{...g,constructor:`${t.ElementType}_${t.ElementCount}`}])});this.stride=e.stride}}const f=[b.BufferViewFloat,b.BufferViewVec2f,b.BufferViewVec3f,b.BufferViewVec4f,b.BufferViewMat3f,b.BufferViewMat4f,b.BufferViewFloat64, b.BufferViewVec2f64,b.BufferViewVec3f64,b.BufferViewVec4f64,b.BufferViewMat3f64,b.BufferViewMat4f64,b.BufferViewUint8,b.BufferViewVec2u8,b.BufferViewVec3u8,b.BufferViewVec4u8,b.BufferViewUint16,b.BufferViewVec2u16,b.BufferViewVec3u16,b.BufferViewVec4u16,b.BufferViewUint32,b.BufferViewVec2u32,b.BufferViewVec3u32,b.BufferViewVec4u32,b.BufferViewInt8,b.BufferViewVec2i8,b.BufferViewVec3i8,b.BufferViewVec4i8,b.BufferViewInt16,b.BufferViewVec2i16,b.BufferViewVec3i16,b.BufferViewVec4i16,b.BufferViewInt32, b.BufferViewVec2i32,b.BufferViewVec3i32,b.BufferViewVec4i32],c=new Map;f.forEach(e=>c.set(`${e.ElementType}_${e.ElementCount}`,e));a.InterleavedBuffer=p;a.InterleavedLayout=k;a.PackedLayout=h;a.newLayout=function(){return new k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/BufferView":function(){define("exports ./internals/Mat3 ./internals/Mat4 ./internals/Scalar ./internals/Vec2 ./internals/Vec3 ./internals/Vec4".split(" "),function(a,b,q,l,p,k,h){class f extends l.BufferViewScalarImpl{constructor(T, Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}static fromTypedArray(T,Y){return new f(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}f.ElementType="f32";class c extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(c,T,Y)}static fromTypedArray(T,Y){return new c(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}c.ElementType="f32";class e extends k.BufferViewVec3Impl{constructor(T,Y=0,ha, ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(e,T,Y)}static fromTypedArray(T,Y){return new e(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}e.ElementType="f32";class g extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(g,T,Y)}static fromTypedArray(T,Y){return new g(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}g.ElementType="f32";class d extends b.BufferViewMat3Impl{constructor(T, Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(d,T,Y)}static fromTypedArray(T,Y){return new d(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}d.ElementType="f32";class t extends b.BufferViewMat3Impl{constructor(T,Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(t,T,Y)}static fromTypedArray(T,Y){return new t(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}t.ElementType="f64";class w extends q.BufferViewMat4Impl{constructor(T, Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(w,T,Y)}static fromTypedArray(T,Y){return new w(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}w.ElementType="f32";class v extends q.BufferViewMat4Impl{constructor(T,Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(v,T,Y)}static fromTypedArray(T,Y){return new v(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}v.ElementType="f64";class m extends l.BufferViewScalarImpl{constructor(T, Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(m,T,Y)}static fromTypedArray(T,Y){return new m(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}m.ElementType="f64";class r extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(r,T,Y)}static fromTypedArray(T,Y){return new r(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}r.ElementType="f64";class n extends k.BufferViewVec3Impl{constructor(T, Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(n,T,Y)}static fromTypedArray(T,Y){return new n(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}n.ElementType="f64";class u extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(u,T,Y)}static fromTypedArray(T,Y){return new u(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}u.ElementType="f64";class x extends l.BufferViewScalarImpl{constructor(T, Y=0,ha,ba){super(Uint8Array,T,Y,ha,ba);this.elementType="u8"}slice(T,Y){return this.sliceBuffer(x,T,Y)}static fromTypedArray(T,Y){return new x(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}x.ElementType="u8";class y extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Uint8Array,T,Y,ha,ba);this.elementType="u8"}slice(T,Y){return this.sliceBuffer(y,T,Y)}static fromTypedArray(T,Y){return new y(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}y.ElementType="u8";class z extends k.BufferViewVec3Impl{constructor(T, Y=0,ha,ba){super(Uint8Array,T,Y,ha,ba);this.elementType="u8"}slice(T,Y){return this.sliceBuffer(z,T,Y)}static fromTypedArray(T,Y){return new z(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}z.ElementType="u8";class A extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Uint8Array,T,Y,ha,ba);this.elementType="u8"}slice(T,Y){return this.sliceBuffer(A,T,Y)}static fromTypedArray(T,Y){return new A(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}A.ElementType="u8";class B extends l.BufferViewScalarImpl{constructor(T, Y=0,ha,ba){super(Uint16Array,T,Y,ha,ba);this.elementType="u16"}slice(T,Y){return this.sliceBuffer(B,T,Y)}static fromTypedArray(T,Y){return new B(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}B.ElementType="u16";class C extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Uint16Array,T,Y,ha,ba);this.elementType="u16"}slice(T,Y){return this.sliceBuffer(C,T,Y)}static fromTypedArray(T,Y){return new C(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}C.ElementType="u16";class D extends k.BufferViewVec3Impl{constructor(T, Y=0,ha,ba){super(Uint16Array,T,Y,ha,ba);this.elementType="u16"}slice(T,Y){return this.sliceBuffer(D,T,Y)}static fromTypedArray(T,Y){return new D(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}D.ElementType="u16";class F extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Uint16Array,T,Y,ha,ba);this.elementType="u16"}slice(T,Y){return this.sliceBuffer(F,T,Y)}static fromTypedArray(T,Y){return new F(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}F.ElementType="u16";class H extends l.BufferViewScalarImpl{constructor(T, Y=0,ha,ba){super(Uint32Array,T,Y,ha,ba);this.elementType="u32"}slice(T,Y){return this.sliceBuffer(H,T,Y)}static fromTypedArray(T,Y){return new H(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}H.ElementType="u32";class N extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Uint32Array,T,Y,ha,ba);this.elementType="u32"}slice(T,Y){return this.sliceBuffer(N,T,Y)}static fromTypedArray(T,Y){return new N(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}N.ElementType="u32";class E extends k.BufferViewVec3Impl{constructor(T, Y=0,ha,ba){super(Uint32Array,T,Y,ha,ba);this.elementType="u32"}slice(T,Y){return this.sliceBuffer(E,T,Y)}static fromTypedArray(T,Y){return new E(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}E.ElementType="u32";class G extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Uint32Array,T,Y,ha,ba);this.elementType="u32"}slice(T,Y){return this.sliceBuffer(G,T,Y)}static fromTypedArray(T,Y){return new G(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}G.ElementType="u32";class I extends l.BufferViewScalarImpl{constructor(T, Y=0,ha,ba){super(Int8Array,T,Y,ha,ba);this.elementType="i8"}slice(T,Y){return this.sliceBuffer(I,T,Y)}static fromTypedArray(T,Y){return new I(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}I.ElementType="i8";class O extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Int8Array,T,Y,ha,ba);this.elementType="i8"}slice(T,Y){return this.sliceBuffer(O,T,Y)}static fromTypedArray(T,Y){return new O(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}O.ElementType="i8";class L extends k.BufferViewVec3Impl{constructor(T, Y=0,ha,ba){super(Int8Array,T,Y,ha,ba);this.elementType="i8"}slice(T,Y){return this.sliceBuffer(L,T,Y)}static fromTypedArray(T,Y){return new L(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}L.ElementType="i8";class P extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Int8Array,T,Y,ha,ba);this.elementType="i8"}slice(T,Y){return this.sliceBuffer(P,T,Y)}static fromTypedArray(T,Y){return new P(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}P.ElementType="i8";class M extends l.BufferViewScalarImpl{constructor(T, Y=0,ha,ba){super(Int16Array,T,Y,ha,ba);this.elementType="i16"}slice(T,Y){return this.sliceBuffer(M,T,Y)}static fromTypedArray(T,Y){return new M(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}M.ElementType="i16";class K extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Int16Array,T,Y,ha,ba);this.elementType="i16"}slice(T,Y){return this.sliceBuffer(K,T,Y)}static fromTypedArray(T,Y){return new K(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}K.ElementType="i16";class J extends k.BufferViewVec3Impl{constructor(T, Y=0,ha,ba){super(Int16Array,T,Y,ha,ba);this.elementType="i16"}slice(T,Y){return this.sliceBuffer(J,T,Y)}static fromTypedArray(T,Y){return new J(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}J.ElementType="i16";class R extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Int16Array,T,Y,ha,ba);this.elementType="i16"}slice(T,Y){return this.sliceBuffer(R,T,Y)}static fromTypedArray(T,Y){return new R(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}R.ElementType="i16";class Q extends l.BufferViewScalarImpl{constructor(T, Y=0,ha,ba){super(Int32Array,T,Y,ha,ba);this.elementType="i32"}slice(T,Y){return this.sliceBuffer(Q,T,Y)}static fromTypedArray(T,Y){return new Q(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}Q.ElementType="i32";class W extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Int32Array,T,Y,ha,ba);this.elementType="i32"}slice(T,Y){return this.sliceBuffer(W,T,Y)}static fromTypedArray(T,Y){return new W(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}W.ElementType="i32";class S extends k.BufferViewVec3Impl{constructor(T, Y=0,ha,ba){super(Int32Array,T,Y,ha,ba);this.elementType="i32"}slice(T,Y){return this.sliceBuffer(S,T,Y)}static fromTypedArray(T,Y){return new S(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}S.ElementType="i32";class V extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Int32Array,T,Y,ha,ba);this.elementType="i32"}slice(T,Y){return this.sliceBuffer(V,T,Y)}static fromTypedArray(T,Y){return new V(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}V.ElementType="i32";a.BufferViewFloat= f;a.BufferViewFloat64=m;a.BufferViewInt16=M;a.BufferViewInt32=Q;a.BufferViewInt8=I;a.BufferViewMat3f=d;a.BufferViewMat3f64=t;a.BufferViewMat4f=w;a.BufferViewMat4f64=v;a.BufferViewUint16=B;a.BufferViewUint32=H;a.BufferViewUint8=x;a.BufferViewVec2f=c;a.BufferViewVec2f64=r;a.BufferViewVec2i16=K;a.BufferViewVec2i32=W;a.BufferViewVec2i8=O;a.BufferViewVec2u16=C;a.BufferViewVec2u32=N;a.BufferViewVec2u8=y;a.BufferViewVec3f=e;a.BufferViewVec3f64=n;a.BufferViewVec3i16=J;a.BufferViewVec3i32=S;a.BufferViewVec3i8= L;a.BufferViewVec3u16=D;a.BufferViewVec3u32=E;a.BufferViewVec3u8=z;a.BufferViewVec4f=g;a.BufferViewVec4f64=u;a.BufferViewVec4i16=R;a.BufferViewVec4i32=V;a.BufferViewVec4i8=P;a.BufferViewVec4u16=F;a.BufferViewVec4u32=G;a.BufferViewVec4u8=A;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Mat3":function(){define(["exports"],function(a){class b{constructor(q,l,p=0,k,h){this.TypedArrayConstructor=q;this.elementCount=9;q=this.TypedArrayConstructor; void 0===k&&(k=9*q.BYTES_PER_ELEMENT);const f=0===l.byteLength?0:p;this.typedBuffer=null==h?new q(l,f):new q(l,f,(h-p)/q.BYTES_PER_ELEMENT);this.typedBufferStride=k/q.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(q,l,p=this.count-l){l=this.typedBuffer.byteOffset+l*this.stride;return new q(this.buffer,l,this.stride,l+p*this.stride)}getMat(q,l){q*=this.typedBufferStride; for(let p=0;9>p;p++)l[p]=this.typedBuffer[q++];return l}setMat(q,l){q*=this.typedBufferStride;for(let p=0;9>p;p++)this.typedBuffer[q++]=l[p]}get(q,l){return this.typedBuffer[q*this.typedBufferStride+l]}set(q,l,p){this.typedBuffer[q*this.typedBufferStride+l]=p}copyFrom(q,l,p){const k=this.typedBuffer,h=l.typedBuffer;q*=this.typedBufferStride;l=p*l.typedBufferStride;for(p=0;9>p;++p)k[q++]=h[l++]}get buffer(){return this.typedBuffer.buffer}}b.ElementCount=9;a.BufferViewMat3Impl=b;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Mat4":function(){define(["exports"],function(a){class b{constructor(q,l,p=0,k,h){this.TypedArrayConstructor=q;this.elementCount=16;q=this.TypedArrayConstructor;void 0===k&&(k=16*q.BYTES_PER_ELEMENT);const f=0===l.byteLength?0:p;this.typedBuffer=null==h?new q(l,f):new q(l,f,(h-p)/q.BYTES_PER_ELEMENT);this.typedBufferStride=k/q.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride= this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(q,l,p=this.count-l){l=this.typedBuffer.byteOffset+l*this.stride;return new q(this.buffer,l,this.stride,l+p*this.stride)}getMat(q,l){q*=this.typedBufferStride;for(let p=0;16>p;p++)l[p]=this.typedBuffer[q++];return l}setMat(q,l){q*=this.typedBufferStride;for(let p=0;16>p;p++)this.typedBuffer[q++]=l[p]}get(q,l){return this.typedBuffer[q*this.typedBufferStride+l]}set(q,l,p){this.typedBuffer[q*this.typedBufferStride+l]=p}copyFrom(q, l,p){const k=this.typedBuffer,h=l.typedBuffer;q*=this.typedBufferStride;l=p*l.typedBufferStride;for(p=0;16>p;++p)k[q++]=h[l++]}get buffer(){return this.typedBuffer.buffer}}b.ElementCount=16;a.BufferViewMat4Impl=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Scalar":function(){define(["exports"],function(a){class b{constructor(q,l,p=0,k,h){this.TypedArrayConstructor=q;this.elementCount=1;q=this.TypedArrayConstructor;void 0===k&&(k=q.BYTES_PER_ELEMENT); const f=0===l.byteLength?0:p;this.typedBuffer=null==h?new q(l,f):new q(l,f,(h-p)/q.BYTES_PER_ELEMENT);this.stride=k;this.typedBufferStride=k/q.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(q,l,p=this.count-l){l=this.typedBuffer.byteOffset+l*this.stride;return new q(this.buffer,l,this.stride,l+p*this.stride)}get(q){return this.typedBuffer[q*this.typedBufferStride]}set(q,l){this.typedBuffer[q*this.typedBufferStride]=l}get buffer(){return this.typedBuffer.buffer}} b.ElementCount=1;a.BufferViewScalarImpl=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Vec2":function(){define(["exports","../../../../core/libs/gl-matrix-2/math/vec2"],function(a,b){class q{constructor(l,p,k=0,h,f){this.TypedArrayConstructor=l;this.elementCount=2;l=this.TypedArrayConstructor;void 0===h&&(h=2*l.BYTES_PER_ELEMENT);const c=0===p.byteLength?0:k;this.typedBuffer=null==f?new l(p,c):new l(p,c,(f-k)/l.BYTES_PER_ELEMENT);this.typedBufferStride= h/l.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(l,p,k=this.count-p){p=this.typedBuffer.byteOffset+p*this.stride;return new l(this.buffer,p,this.stride,p+k*this.stride)}getVec(l,p){l*=this.typedBufferStride;return b.set(p,this.typedBuffer[l],this.typedBuffer[l+1])}setVec(l,p){l*=this.typedBufferStride;this.typedBuffer[l++]=p[0];this.typedBuffer[l]=p[1]}get(l,p){return this.typedBuffer[l* this.typedBufferStride+p]}set(l,p,k){this.typedBuffer[l*this.typedBufferStride+p]=k}setValues(l,p,k){l*=this.typedBufferStride;this.typedBuffer[l++]=p;this.typedBuffer[l]=k}copyFrom(l,p,k){const h=this.typedBuffer,f=p.typedBuffer;l*=this.typedBufferStride;p=k*p.typedBufferStride;h[l++]=f[p++];h[l]=f[p]}get buffer(){return this.typedBuffer.buffer}}q.ElementCount=2;a.BufferViewVec2Impl=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Vec3":function(){define(["exports", "../../../../chunks/vec32"],function(a,b){class q{constructor(l,p,k=0,h,f){this.TypedArrayConstructor=l;this.elementCount=3;l=this.TypedArrayConstructor;void 0===h&&(h=3*l.BYTES_PER_ELEMENT);const c=0===p.byteLength?0:k;this.typedBuffer=null==f?new l(p,c):new l(p,c,(f-k)/l.BYTES_PER_ELEMENT);this.typedBufferStride=h/l.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(l, p,k=this.count-p){p=this.typedBuffer.byteOffset+p*this.stride;return new l(this.buffer,p,this.stride,p+k*this.stride)}getVec(l,p){l*=this.typedBufferStride;return b.set(p,this.typedBuffer[l],this.typedBuffer[l+1],this.typedBuffer[l+2])}setVec(l,p){l*=this.typedBufferStride;this.typedBuffer[l++]=p[0];this.typedBuffer[l++]=p[1];this.typedBuffer[l]=p[2]}get(l,p){return this.typedBuffer[l*this.typedBufferStride+p]}set(l,p,k){this.typedBuffer[l*this.typedBufferStride+p]=k}setValues(l,p,k,h){l*=this.typedBufferStride; this.typedBuffer[l++]=p;this.typedBuffer[l++]=k;this.typedBuffer[l]=h}copyFrom(l,p,k){const h=this.typedBuffer,f=p.typedBuffer;l*=this.typedBufferStride;p=k*p.typedBufferStride;h[l++]=f[p++];h[l++]=f[p++];h[l]=f[p]}get buffer(){return this.typedBuffer.buffer}}q.ElementCount=3;a.BufferViewVec3Impl=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Vec4":function(){define(["exports","../../../../chunks/vec42"],function(a,b){class q{constructor(l, p,k=0,h,f){this.TypedArrayConstructor=l;this.start=k;this.elementCount=4;l=this.TypedArrayConstructor;void 0===h&&(h=4*l.BYTES_PER_ELEMENT);const c=0===p.byteLength?0:k;this.typedBuffer=null==f?new l(p,c):new l(p,c,(f-k)/l.BYTES_PER_ELEMENT);this.typedBufferStride=h/l.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(l,p,k=this.count-p){p=this.typedBuffer.byteOffset+p*this.stride; return new l(this.buffer,p,this.stride,p+k*this.stride)}getVec(l,p){l*=this.typedBufferStride;return b.set(p,this.typedBuffer[l++],this.typedBuffer[l++],this.typedBuffer[l++],this.typedBuffer[l])}setVec(l,p){l*=this.typedBufferStride;this.typedBuffer[l++]=p[0];this.typedBuffer[l++]=p[1];this.typedBuffer[l++]=p[2];this.typedBuffer[l]=p[3]}get(l,p){return this.typedBuffer[l*this.typedBufferStride+p]}set(l,p,k){this.typedBuffer[l*this.typedBufferStride+p]=k}setValues(l,p,k,h,f){l*=this.typedBufferStride; this.typedBuffer[l++]=p;this.typedBuffer[l++]=k;this.typedBuffer[l++]=h;this.typedBuffer[l]=f}copyFrom(l,p,k){const h=this.typedBuffer,f=p.typedBuffer;l*=this.typedBufferStride;p=k*p.typedBufferStride;h[l++]=f[p++];h[l++]=f[p++];h[l++]=f[p++];h[l]=f[p]}get buffer(){return this.typedBuffer.buffer}}q.ElementCount=4;a.BufferViewVec4Impl=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/types":function(){define(["exports"],function(a){a.elementTypeSize=function(b){switch(b){case "u8":return 1; case "u16":return 2;case "u32":return 4;case "i8":return 1;case "i16":return 2;case "i32":return 4;case "f32":return 4;case "f64":return 8}};a.isInteger=function(b){switch(b){case "u8":case "u16":case "u32":case "i8":case "i16":case "i32":return!0;case "f32":case "f64":return!1}};a.isSigned=function(b){switch(b){case "u8":case "u16":case "u32":return!1;case "i8":case "i16":case "i32":case "f32":case "f64":return!0}};a.maximumValue=function(b){switch(b){case "u8":return 255;case "u16":return 65535; case "u32":return 4294967295;case "i8":return 127;case "i16":return 32767;case "i32":return 2147483647;case "f32":return 3.402823E38;case "f64":return 1.79769E308}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GeometryUtil":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/DoubleArray ../../../../geometry/support/FloatArray ../../../../geometry/support/Indices ../../../../geometry/support/plane ../../../../geometry/support/ray ./Attribute ./BufferVectorMath ./ContentObjectType ./Geometry ./Util ./VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(ha,ba,U){function Z(ia,ka){ia>ka&&([ia,ka]=[ka,ia]);const fa=ia.toString()+"."+ka.toString();if(da[fa])return da[fa];let X=ca.length;ca.length+=3;y.add(ca,3*ia,ca,3*ka,ca,X);y.scale(ca,X,ha/y.length(ca,X));X/=3;return da[fa]=X}let ca;U?(ca=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],U=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1]):(U=ha*(1+Math.sqrt(5))/2,ca=[-ha,U,0,ha,U,0,-ha,-U,0,ha,-U,0,0,-ha,U,0,ha,U,0,-ha,-U,0,ha,-U,U,0,-ha,U,0,ha,-U,0,-ha, -U,0,ha],U=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]);for(var ea=0;eaHa;Ha++)ja.push(X[X.length-6+Ha]-sa)}wa+=ia}ba=U[U.length-1];for(U=0;Uca)return!1;q.cross(U,ha,ba);q.normalize(U,U);q.cross(Z,U,ha);q.normalize(Z,Z);return!0}function x(ha,ba,U,Z,ca,ea,da){return u(ha,ba,ca,ea,da)||u(ha,U,ca,ea,da)||u(ha,Z,ca,ea,da)}const y=d.Vec3Compact,z=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5, .5,-.5]],A=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],B=[0,0,1,0,1,1,0,1],C=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],D=Array(36);for(d=0;6>d;d++)for(var F=0;6>F;F++)D[6*d+F]=d;const H=Array(36);for(d=0;6>d;d++)H[6*d]=0,H[6*d+1]=1,H[6*d+2]=2,H[6*d+3]=2,H[6*d+4]=3,H[6*d+5]=0;const N=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],E=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],G=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],I=[0,0,0,1, 1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];d=l.fromValues(-.5,0,-.5);F=l.fromValues(.5,0,-.5);const O=l.fromValues(0,0,.5),L=l.fromValues(0,.5,0),P=l.create(),M=l.create(),K=l.create(),J=l.create(),R=l.create();q.subtract(P,d,L);q.subtract(M,d,F);q.cross(K,P,M);q.normalize(K,K);q.subtract(P,F,L);q.subtract(M,F,O);q.cross(J,P,M);q.normalize(J,J);q.subtract(P,O,L);q.subtract(M,O,d);q.cross(R,P,M);q.normalize(R,R);const Q=[d,F,O,L],W=[0,-1,0,K[0],K[1],K[2],J[0],J[1],J[2],R[0],R[1],R[2]],S=[0,1,2,3,1,0, 3,2,1,3,0,2],V=[0,0,0,1,1,1,2,2,2,3,3,3],T=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]],Y=p.create();a.cgToGIS=function(ha,ba=ha){var U=ha.attributes;ha=U.get(m.VertexAttribute.POSITION).data;if(U=U.get(m.VertexAttribute.NORMAL).data){var Z=ba.getMutableAttribute(m.VertexAttribute.NORMAL).data;for(let ca=0;caZ;Z++)U[3*Z]=z[Z][0]*ba[0],U[3*Z+1]=z[Z][1]*ba[1],U[3*Z+2]=z[Z][2]*ba[2];return new w.Geometry(ha,[[m.VertexAttribute.POSITION,new g.Attribute(U,C,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(A,D,3)],[m.VertexAttribute.UV0,new g.Attribute(B,H,2)]])};a.createConeGeometry=function(ha,ba,U,Z,ca,ea=!0,da=!0){let ia=0;var ka=l.fromValues(0,ia,0),fa=l.fromValues(0,ia+ba,0),X=l.fromValues(0,-1,0),ja=l.fromValues(0,1,0); ca&&(ia=ba,fa=l.fromValues(0,0,0),ka=l.fromValues(0,ia,0),X=l.fromValues(0,1,0),ja=l.fromValues(0,-1,0));ka=[fa,ka];X=[X,ja];ja=Z+2;fa=Math.sqrt(ba*ba+U*U);if(ca)for(ca=Z-1;0<=ca;ca--){var la=2*Math.PI/Z*ca,na=l.fromValues(Math.cos(la)*U,ia,Math.sin(la)*U);ka.push(na);la=l.fromValues(ba*Math.cos(la)/fa,-U/fa,ba*Math.sin(la)/fa);X.push(la)}else for(ca=0;caMath.abs(1-q.dot(ia,X))&&q.set(X,0,0,1);const ja=l.create();q.cross(ja,ia,X);q.normalize(ja,ja);q.cross(X,ja,ia);ba=2*Z+(da?2:0);ea=Z+(da?2:0);ca=h.newFloatArray(3*ba);const la=h.newFloatArray(3*ea),na=h.newFloatArray(2*ba),va=Array(3*Z*(da?4:2)),za=Array(3*Z*(da?4:2));da&&(ca[3*(ba-2)]=fa[0],ca[3*(ba-2)+1]=fa[1],ca[3*(ba-2)+2]=fa[2],na[2*(ba-2)]=0,na[2*(ba-2)+1]=0,ca[3*(ba-1)]=ca[3*(ba-2)]+ka[0],ca[3*(ba-1)+1]=ca[3*(ba-2)+1]+ka[1],ca[3*(ba-1)+2]=ca[3*(ba-2)+2]+ka[2], na[2*(ba-1)]=1,na[2*(ba-1)+1]=1,la[3*(ea-2)]=-ia[0],la[3*(ea-2)+1]=-ia[1],la[3*(ea-2)+2]=-ia[2],la[3*(ea-1)]=ia[0],la[3*(ea-1)+1]=ia[1],la[3*(ea-1)+2]=ia[2]);ia=0;const ya=l.create(),Da=l.create();for(let Ga=0;GaZ;Z++)U[3*Z]=N[Z][0]*ba[0],U[3*Z+1]=N[Z][1]*ba[1],U[3*Z+2]=N[Z][2]*ba[2];return new w.Geometry(ha,[[m.VertexAttribute.POSITION, new g.Attribute(U,G,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(E,I,3)]])};a.createExtrudedTriangle=function(ha,ba,U,Z,ca,ea=0){const da=Array(18);ba=[[-U,ea,ca/2],[Z,ea,ca/2],[0,ba+ea,ca/2],[-U,ea,-ca/2],[Z,ea,-ca/2],[0,ba+ea,-ca/2]];for(U=0;6>U;U++)da[3*U]=ba[U][0],da[3*U+1]=ba[U][1],da[3*U+2]=ba[U][2];return new w.Geometry(ha,[[m.VertexAttribute.POSITION,new g.Attribute(da,[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5],3,!0)]])};a.createPathExtrusionGeometry=n;a.createPointGeometry=function(ha, ba,U,Z,ca,ea,da,ia,ka=null){U=U?p.clone(U):p.create();ba=ba?p.clone(ba):p.fromValues(0,0,1);da??=b.create();Z=Z?[255*Z[0],255*Z[1],255*Z[2],3fa;fa++)ca[da++]=ba[ka][fa];0fa;fa++)da[ia++]=U[ka][fa];ca.push([m.VertexAttribute.NORMAL,new g.Attribute(da,ea,3,!0)])}Z&&ca.push([m.VertexAttribute.COLOR,new g.Attribute(Z,f.getContinuousIndexArray(Z.length/4),4)]);return new w.Geometry(ha,ca,null,t.ContentObjectType.Line)};a.createSphereGeometry=function(ha,ba,U,Z,ca={uv:!0}){var ea=-Math.PI,da=2*Math.PI,ia=-Math.PI/2,ka=Math.PI;U=Math.max(3,Math.floor(U));Z=Math.max(2,Math.floor(Z));var fa= (U+1)*(Z+1);const X=h.newFloatArray(3*fa),ja=h.newFloatArray(3*fa);fa=h.newFloatArray(2*fa);const la=[];var na=0;for(var va=0;va<=Z;va++){const ya=[],Da=va/Z,ra=ia+Da*ka,xa=Math.cos(ra);for(let Ma=0;Ma<=U;Ma++){const Ga=Ma/U;var za=ea+Ga*da;const Pa=Math.cos(za)*xa,Qa=Math.sin(ra);za=-Math.sin(za)*xa;X[3*na]=Pa*ba;X[3*na+1]=Qa*ba;X[3*na+2]=za*ba;ja[3*na]=Pa;ja[3*na+1]=Qa;ja[3*na+2]=za;fa[2*na]=Ga;fa[2*na+1]=Da;ya.push(na);++na}la.push(ya)}ba=[];for(ea=0;eaZ;Z++)for(let ca=0;3>ca;ca++)U[3*Z+ca]=ba[Z][ca];ba=[0,1,2,2,3,0];Z=[0,0,0,0,0,0];U=[[m.VertexAttribute.POSITION,new g.Attribute(U,ba,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute([0,0,1],Z,3,!0)],[m.VertexAttribute.UV0,new g.Attribute([0,0,1,0,1,1,0,1],ba,2,!0)],[m.VertexAttribute.COLOR,new g.Attribute([255,255,255,255],Z,4,!0)]];return new w.Geometry(ha, U)};a.createTetrahedronGeometry=function(ha,ba){Array.isArray(ba)||(ba=[ba,ba,ba]);const U=Array(12);for(let Z=0;4>Z;Z++)U[3*Z]=Q[Z][0]*ba[0],U[3*Z+1]=Q[Z][1]*ba[1],U[3*Z+2]=Q[Z][2]*ba[2];return new w.Geometry(ha,[[m.VertexAttribute.POSITION,new g.Attribute(U,S,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(W,V,3)]])};a.createTubeGeometry=function(ha,ba,U,Z,ca,ea){Z=Z||10;ca=null!=ca?ca:!0;v.assert(1k.length){k=new Uint32Array(Math.max(2*k.length,e));for(let g=0;gc.length&&(c=new Uint8Array(Math.max(2*c.length,e)));return new Uint8Array(c.buffer,0,e)}let k=(()=>{const e=new Uint32Array(131072);for(let g=0;g{const e=new Uint16Array(65536);for(let g= 0;g{g=g&&0===t;d=d&&t===w;return!g&&!d});return g?p(e.length):d?l(e.length):b.isArray(e)||e.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?q(e):e};a.getContinuousIndexArray=l;a.getZeroIndexArray=p;a.newIndexArray=function(e){return e<=b.nativeArrayMaxSize?Array(e): 65536>=e?new Uint16Array(e):new Uint32Array(e)};a.newIntArray=function(e){return e<=b.nativeArrayMaxSize?Array(e):new Uint32Array(e)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/BufferVectorMath":function(){define(["exports"],function(a){a.Vec3Compact=void 0;(function(b){b.length=function(q,l){const p=q[l],k=q[l+1];q=q[l+2];return Math.sqrt(p*p+k*k+q*q)};b.normalize=function(q,l){var p=q[l];const k=q[l+1],h=q[l+2];p=1/Math.sqrt(p*p+k*k+h*h);q[l]*= p;q[l+1]*=p;q[l+2]*=p};b.scale=function(q,l,p){q[l]*=p;q[l+1]*=p;q[l+2]*=p};b.add=function(q,l,p,k,h,f=l){h=h||q;h[f]=q[l]+p[k];h[f+1]=q[l+1]+p[k+1];h[f+2]=q[l+2]+p[k+2]};b.subtract=function(q,l,p,k,h,f=l){h=h||q;h[f]=q[l]-p[k];h[f+1]=q[l+1]-p[k+1];h[f+2]=q[l+2]-p[k+2]}})(a.Vec3Compact||(a.Vec3Compact={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ContentObjectType":function(){define(["exports"],function(a){a.ContentObjectType=void 0;var b=a.ContentObjectType|| (a.ContentObjectType={});b[b.Layer=0]="Layer";b[b.Object=1]="Object";b[b.Mesh=2]="Mesh";b[b.Line=3]="Line";b[b.Point=4]="Point";b[b.Material=5]="Material";b[b.Texture=6]="Texture";b[b.COUNT=7]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Geometry":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../geometry/support/Indices ./AttributeArray ./basicInterfaces ./BoundingInfo ./ContentObject ./ContentObjectType ./geometryDataUtils ./Object3DStateID ./Util ./VertexAttribute ../materials/renderers/utils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){class v extends f.ContentObject{constructor(m,r,n=null,u=c.ContentObjectType.Mesh,x=null,y=-1){super();this.material=m;this.mapPositions=n;this.type=u;this.objectAndLayerIdColor=x;this.edgeIndicesLength=y;this.visible=!0;this._attributes=new Map;this._boundingInfo=null;for(const [z,A]of r)this._attributes.set(z,{...A,indices:l.compactIndices(A.indices)}),z===t.VertexAttribute.POSITION&&(this.edgeIndicesLength=0>this.edgeIndicesLength?this._attributes.get(z).indices.length: this.edgeIndicesLength)}instantiate(m={}){const r=new v(m.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);this._attributes.forEach((n,u)=>{n.exclusive=!1;r._attributes.set(u,n)});r._boundingInfo=this._boundingInfo;r.transformation=m.transformation||this.transformation;return r}get attributes(){return this._attributes}getMutableAttribute(m){let r=this._attributes.get(m);r&&!r.exclusive&&(r={...r,exclusive:!0,data:p.cloneAttributeData(r.data)}, this._attributes.set(m,r));return r}setAttributeData(m,r){const n=this._attributes.get(m);n&&this._attributes.set(m,{...n,exclusive:!0,data:r})}get indexCount(){return this._attributes.values().next().value.indices?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo());return this._boundingInfo}computeAttachmentOrigin(m){return(this.type===c.ContentObjectType.Mesh?this._computeAttachmentOriginTriangles(m): this.type===c.ContentObjectType.Line?this._computeAttachmentOriginLines(m):this._computeAttachmentOriginPoints(m))?(null!=this._transformation&&q.transformMat4(m,m,this._transformation),!0):!1}_computeAttachmentOriginTriangles(m){const r=this.attributes.get(t.VertexAttribute.POSITION);return e.computeAttachmentOriginTriangles(r,m)}_computeAttachmentOriginLines(m){const r=this.attributes.get(t.VertexAttribute.POSITION);var n=e.computeAttachmentOriginLines;var u=this.material.parameters;u="isClosed"in u&&u.isClosed?2=f.length*this._numIndexPerPrimitive);var w=f.length;c=d*t[this._numIndexPerPrimitive*f[0]];h.clear();h.push(c);e=l.fromValues(g[c],g[c+1],g[c+2]);var v=l.clone(e);for(var m=0;m=q.squaredDistance(this.bbMin,this.bbMax))return this._children;var f=q.lerp(l.create(), this.bbMin,this.bbMax,.5),c=this.primitiveIndices.length;const e=new Uint8Array(c),g=Array(8);for(var d=0;8>d;++d)g[d]=0;const {data:t,size:w,indices:v}=this.position;for(d=0;dd;++d)0f)){f=Array(8);for(d=0;8>d;++d)f[d]=0d;++d)g[d]=0;for(d=0;dc;++c)void 0!==f[c]&&this._children.push(new k(f[c],this._numIndexPerPrimitive,this.position));return this._children}}static prune(){h.prune()}}const h=new b({deallocator:null});a.BoundingInfo=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ContentObject":function(){define(["exports", "../../../../core/uid"],function(a,b){class q{constructor(){this.id=b.generateUID()}}a.ContentObject=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/geometryDataUtils":function(){define(["exports","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../geometry/support/triangle"],function(a,b,q,l){const p=q.create(),k=q.create(),h=q.create(),f=q.create();a.computeAttachmentOriginLines=function(c,e,g){if(!c)return!1; b.set(g,0,0,0);b.set(f,0,0,0);let d=0,t=0;const {size:w,data:v,indices:m}=c;c=m.length-1;e=c+(e?2:0);for(let n=0;nh()),g=l.create(),d=l.create();a.areaPoints2d=function(t,w,v){return.5*Math.abs((w[0]-t[0])*(v[1]-t[1])-(w[1]-t[1])*(v[0]-t[0]))};a.areaPoints3d=function(t,w,v){q.subtract(g,w,t);q.subtract(d,v,t);return.5*q.length(q.cross(g,g,d))};a.copy=function(t,w=h()){return f(t.p0,t.p1,t.p2,w)};a.create=h;a.distance2=function(t, w){var v=t.p0,m=t.p1;t=t.p2;const r=q.subtract(k.sv3d.get(),m,v),n=q.subtract(k.sv3d.get(),t,m),u=q.subtract(k.sv3d.get(),v,t),x=q.subtract(k.sv3d.get(),w,v);var y=q.subtract(k.sv3d.get(),w,m),z=q.subtract(k.sv3d.get(),w,t);const A=q.cross(r,r,u),B=q.dot(q.cross(k.sv3d.get(),r,A),x);y=q.dot(q.cross(k.sv3d.get(),n,A),y);z=q.dot(q.cross(k.sv3d.get(),u,A),z);if(0H)return!1;H=1/H;const N=r[0]-n[0],E=r[1]-n[1],G=r[2]-n[2];C=H*(N*C+E*D+G*F);if(0>C||1z||1f!==h);return 0===k.length?null:k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/MarsAtmosphere":function(){define("../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/vec2 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/support/FloatArray ./AtmosphereType ./atmosphereUtils ../../../chunks/SimpleAtmosphere.glsl ./SimpleAtmosphereTechnique ./SimpleAtmosphereTechniqueConfiguration ./resources/MarsAtmosphereTexture ../support/mathUtils ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/glUtil3D ../webgl-engine/lib/Util ../webgl-engine/lib/VertexArrayObject ../webgl-engine/lib/VertexAttribute ../../webgl/BufferObject ../../webgl/enums ../../webgl/Texture ../../webgl/TextureDescriptor ../../webgl/Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N){function E(J,R,Q,W,S){const V=h.length(J),T=W*Math.sqrt(V*V-W*W)/V,Y=S.v1,ha=S.v2;h.scale(S.center,J,Math.sqrt(W*W-T*T)/V);h.cross(Y,J,R);1>h.squaredLength(Y)&&h.cross(Y,J,Q);h.scale(Y,Y,T/h.length(Y));h.cross(ha,Y,J);h.scale(ha,ha,T/h.length(ha));return T}const G=-d.innerAtmosphereDepth,I=r.makePiecewiseLinearFunction([[50,.1015625],[500,.21875],[5E3,.51171875],[5E4,.4140625]]);class O{constructor(J,R){this.view=J;this.type=g.AtmosphereType.Mars; this._passParameters=new t.SimpleAtmospherePassParameters;this._vaoCount=0;this._texV1=1;J=c.getReferenceEllipsoid(J.spatialReference);this._planetRadius=J.radius;this._outerRimWidth=J.outerAtmosphereRimWidth;this._innerRimFactor=(this._planetRadius+G)/this._planetRadius;this._middleRimFactor=(this._planetRadius+0)/this._planetRadius;this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius;this._texV0=0/this._outerRimWidth;this._texVScale=this._texV1-this._texV0;this._techniques= R.techniques;J=R.renderContext.rctx;this._cameraChangeHandle=q.watch(()=>this.view.state?.camera,()=>R.requestRender(),q.syncAndInitial);this._vao=this._createRibbon(J);this._vaoCount=N.vertexCount(this._vao,"geometry");this._fadeVao=y.createQuadVAO(J);this._fadeVaoCount=N.vertexCount(this._fadeVao,"geometry");const Q=new H.TextureDescriptor;Q.wrapMode=D.TextureWrapMode.CLAMP_TO_EDGE;Q.flipped=!0;Q.width=1;Q.height=512;this._passParameters.texture=new F.Texture(J,Q,m.marsAtmosphereTextureSimple); J=new v.SimpleAtmosphereTechniqueConfiguration;J.geometry=v.SimpleAtmosphereGeometry.Cone;this._coneTechnique=this._techniques.acquire(w.SimpleAtmosphereTechnique,J);J.geometry=v.SimpleAtmosphereGeometry.Underground;this._undergroundTechnique=this._techniques.acquire(w.SimpleAtmosphereTechnique,J)}destroy(){this._coneTechnique.release();this._undergroundTechnique.release();this._cameraChangeHandle.remove();this._passParameters.texture=b.disposeMaybe(this._passParameters.texture);this._fadeVao.dispose(); this._vao.dispose()}render(J){this._update(J.bindParameters.camera);const R=J.rctx;1>this._passParameters.undergroundFadeAlpha&&(R.bindTechnique(this._coneTechnique,J.bindParameters,this._passParameters),R.bindVAO(this._vao),R.drawArrays(D.PrimitiveType.TRIANGLES,0,this._vaoCount));0S?Math.min(-S/5E3,1):0;var V=Q+G,T=Q+Math.max(50,S);this._passParameters.innerScale=T*T/(Math.sqrt(T*T-Q*Q)*Math.sqrt(T*T-V*V)+Q*V)-1;this._passParameters.altitudeFade=d.computeInnerAltitudeFade(S);h.scale(R,J.eye,(Q+50)/W);E(R,J.center,J.up,Q,this._passParameters.silhouette);R=this._computeScreenRimWidth(J,R,J.up,this._passParameters.silhouette);W=I(S);V=this._texV0+.001953125*this._texVScale; T=this._texV0+R*W*this._texVScale;50W;W++){var S=9*W+3;R[S]=W;R[S+1]=this._innerRimFactor; R[S+2]=-1;R[S+3]=W;R[S+4]=this._middleRimFactor;R[S+5]=0;R[S+6]=W;R[S+7]=this._outerRimFactor;R[S+8]=1;S=3*W+1;var V=127===W?1:S+3,T=15*W;Q[T]=S;Q[T+1]=S+1;Q[T+2]=V+1;Q[T+3]=V+1;Q[T+4]=V;Q[T+5]=S;Q[T+6]=S+1;Q[T+7]=S+2;Q[T+8]=V+2;Q[T+9]=V+2;Q[T+10]=V+1;Q[T+11]=S+1;Q[T+12]=S;Q[T+13]=V;Q[T+14]=0}W=K.createBuffer(Q.length);S=W.position;for(V=0;V=this._passParameters.opacity|| (D=.5>D?l.lerp(0,.35,2*D):l.lerp(.35,1,2*(D-.5)),this._passParameters.time=("rainy"===F?this._rainSpeed:this._snowSpeed)*k.secondsFromMilliseconds(this._animation.time)%1E5,C=N.bindTechnique(H,C.bindParameters,this._passParameters),N.bindVAO(this._vao),C.assertCompatibleVertexAttributeLocations(this._vao),z.bindVertexBufferLayout(N,t.attributeLocations,this._instanceIdBuffer,B,0),N.drawArraysInstanced(y.PrimitiveType.TRIANGLES,0,3,this._numParticles*D),z.unbindVertexBufferLayout(N,t.attributeLocations, this._instanceIdBuffer,B)))}else this.context.requestRender()}_ensureResources(C){if(null==this._vao){const D=new Float32Array([-1,0,1,1,0,-1,1,0,1]);this._vao=new n.VertexArrayObject(C,t.attributeLocations,{geometry:v.glLayout(A)},{geometry:x.BufferObject.createVertex(C,y.Usage.STATIC_DRAW,D)})}null==this._instanceIdBuffer&&(this._instanceIdBuffer=this._createInstanceIndices(C))}_createInstanceIndices(C){const D=[];for(let F=0;F new Promise((w,v)=>a(["./Precipitation.glsl"],w,v)));const t=new Map([[f.VertexAttribute.POSITION,0],[f.VertexAttribute.INSTANCEFEATUREATTRIBUTE,1]]);b.PrecipitationPassParameters=g;b.PrecipitationTechnique=d;b.attributeLocations=t;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Precipitation.glsl":function(){define("exports ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/environment/PrecipitationTechniqueConfiguration ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(m){const r=new c.ShaderBuilder;r.attributes.add(e.VertexAttribute.POSITION,"vec3");r.attributes.add(e.VertexAttribute.INSTANCEFEATUREATTRIBUTE,"float");r.vertex.uniforms.add(new p.Float3PassUniform("cameraPosition",(n,u)=>u.camera.eye));r.vertex.uniforms.add(new p.Float3PassUniform("offset",(n,u)=>{u=u.camera.eye;var x=.5*n.width;const y=1/n.width;x=b.floor(d,b.set(d,(u[0]+x)*y,(u[1]+x)*y,(u[2]+x)*y));return b.sub(x,u,b.scale(x,x,n.width))}));r.vertex.uniforms.add(new k.FloatPassUniform("width", n=>n.width));r.vertex.uniforms.add(new f.Matrix4PassUniform("proj",(n,u)=>u.camera.projectionMatrix));r.vertex.uniforms.add(new f.Matrix4PassUniform("view",(n,u)=>u.camera.viewMatrix));r.vertex.uniforms.add(new k.FloatPassUniform("time",n=>n.time));r.varyings.add("vUv","vec2");r.vertex.code.add(h.glsl` vec3 hash31(float p){ vec3 p3 = fract(vec3(p) * vec3(0.1031, 0.1030, 0.0973)); p3 += dot(p3, p3.yzx + 33.33); return fract((p3.xxy + p3.yzz) * p3.zyx); } float hash11(float p){ p = fract(p * 0.1031); p *= p + 33.33; p *= p + p; return fract(p); } //https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/ vec3 rotateVectorByQuaternion(vec3 v, vec4 q){ return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v; } void main(void) { vUv = position.xz; vec3 rand = hash31(instanceFeatureAttribute); // Set random position for all particles // The hash function space is not high resolution so offset particles by an additional random value // This creates grids of 1000 particles which are shifted by random hundreths of the tile width // overlaying multiple identical but offset grids vec3 randomPosition = 2.0 * (rand + (0.01 + 0.01 * rand) * floor(0.001 * instanceFeatureAttribute)) - 1.0; // Random orientation of rain drops float angle = 3.1415 * hash11(instanceFeatureAttribute); vec3 up = vec3(0, 0, 1); // Gravity and wind direction vec3 direction = normalize(cameraPosition); vec3 tangent = normalize(cross(direction, up)); // Gravity vec3 animatedPos = randomPosition + direction * -time; // Rain particles fall straight down and are randomly oriented // Snow particles have random sinusoid trajectories and are rotated to face the camera ${m.type===l.PrecipitationType.Rain?h.glsl` // Random rotation for particle vec3 rotationAxis = up; vec4 quat = vec4(rotationAxis * sin(angle), cos(angle)); vec3 transformedPos = rotateVectorByQuaternion(vec3(0.2, 0.2, 4.0) * (position - vec3(0.5, 0.0, 0.5)), quat); // Rotate particle to planetary position rotationAxis = tangent; angle = 0.5 * -acos(dot(direction, up)); quat = vec4(rotationAxis * sin(angle), cos(angle)); transformedPos = rotateVectorByQuaternion(transformedPos, quat); vec4 pos = mat4(mat3(view)) * vec4(transformedPos + (mod(width * animatedPos - offset, width) - 0.5 * width), 1.0); gl_Position = proj * pos; `:h.glsl` vec3 rotationAxis = direction; vec4 quat = vec4(rotationAxis * sin(angle), cos(angle)); tangent = rotateVectorByQuaternion(tangent, quat); // Random sinusoid from friction animatedPos += tangent * 0.25 * sin(dot(animatedPos, direction)); vec4 pos = mat4(mat3(view)) * vec4((mod(width * animatedPos - offset, width) - 0.5 * width), 1.0); gl_Position = proj * (0.5 * vec4(position.xzy, 0.0) + pos); `} } `);r.fragment.uniforms.add(new k.FloatPassUniform("opacity",n=>n.opacity),new p.Float3PassUniform("particleColor",(n,u)=>{n=m.type===l.PrecipitationType.Rain?v:w;const x=b.scale(d,n,.7);b.normalize(t,u.camera.eye);u=Math.max(0,b.dot(t,u.lighting.mainLight.direction));return b.lerp(x,x,n,u)}));r.fragment.code.add(h.glsl` void main() { // Cut off corners of the triangle if(vUv.x < 0.0 || vUv.y < 0.0){ discard; } float d = length(vUv - vec2(0.5)); ${m.type===l.PrecipitationType.Rain?h.glsl`d = 0.35 * smoothstep(0.5, 0.0, d);`:h.glsl`d = smoothstep(0.5, 0.1, d);`} fragColor = opacity * vec4(particleColor * d, d); } `);return r}const d=q.create(),t=q.create(),w=q.fromValues(1,1,1),v=q.fromValues(.85,.85,.85);q=Object.freeze(Object.defineProperty({__proto__:null,build:g},Symbol.toStringTag,{value:"Module"}));a.Precipitation=q;a.build=g})},"esri/views/3d/environment/PrecipitationTechniqueConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){a.PrecipitationType=void 0;(function(p){p[p.Rain=0]="Rain";p[p.Snow= 1]="Snow";p[p.COUNT=2]="COUNT"})(a.PrecipitationType||(a.PrecipitationType={}));class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.type=a.PrecipitationType.Rain}}b.__decorate([q.parameter({count:a.PrecipitationType.COUNT})],l.prototype,"type",void 0);a.PrecipitationTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/AnimationTimer":function(){define(["exports","../../../../core/time"],function(a, b){class q{constructor(){this.enabled=!0;this._time=b.Milliseconds(0)}get time(){return this._time}advance({deltaTime:p,fixedTime:k}){if(null!=k){if(this._time===k)return!1;this._time=k;return!0}this._time=b.Milliseconds(this._time+p);return 0!==p}}class l{constructor(p,k){this.deltaTime=p;this.fixedTime=k}}a.AnimationTimer=q;a.Parameters=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/Stars":function(){define("exports ../../../chunks/tslib.es6 ../../../assets ../../../core/Accessor ../../../core/asyncUtils ../../../core/Error ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/support/UpdatingHandles ./StarsTechnique ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/VertexArrayObject ../webgl-engine/lib/VertexAttribute ../../webgl/BufferObject ../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){function D(I,O,L,P){const M=E.createBuffer(P),K=M.position,J=M.color,R=M.size;for(let S=0;S"virtual"!==this.view.environment.lighting.type? this.view.environment.lighting.date:null,P=>this._update(P),e.initial)}}_update(I){if(I){var O=I.getHours()/12,L=I.getMinutes()/60*(2/24),P=I.getSeconds()/60*(2/1440);O=(O+L+P-.9972222)%2;L=new Date(I.getFullYear(),0,1,11,58,56);P=new Date(I.getFullYear()+1,0,1,11,58,55);I=(+I-+L)/(+P-+L)*2;L=v.copy(this._passParameters.modelMatrix,N);v.rotateZ(L,L,-I*Math.PI);v.multiply(L,H,L);v.rotateZ(L,L,-O*Math.PI);this.requestRender()}}_createLoadDataTask(){if(null!=G)return null;const I=p.createTask(async O=> {({data:O}=await q.fetchAsset("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:O}));if(!O)throw new k("stars:no-data-received","Failed to create stars because star catalogue is missing");const L=O.byteLength/9;if(0!==L%1||5E4L)throw new k("stars:invalid-data","Failed to create stars because star catalogue data is invalid");G=O});I.promise.catch(O=>{c.isAbortError(O)||h.getLogger(this).error(O)}).then(()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))}); return I}};b.__decorate([g.property({constructOnly:!0})],a.Stars.prototype,"view",void 0);b.__decorate([g.property({constructOnly:!0})],a.Stars.prototype,"requestRender",void 0);b.__decorate([g.property({readOnly:!0})],a.Stars.prototype,"updating",null);b.__decorate([g.property()],a.Stars.prototype,"_loadDataTask",void 0);b.__decorate([g.property()],a.Stars.prototype,"_updatingTracking",void 0);a.Stars=b.__decorate([w.subclass("esri.views.3d.environment.Stars")],a.Stars);const F="9bb2ff;9eb5ff;aabfff;bbccff;ccd8ff ;dae2ff;e4e9ff;eeefff;f8f6ff;fff9fb;fff5ef;fff1e5;ffeddb;ffe9d2;ffe6ca;ffe3c3;ffe0bb;ffddb4;ffdaad;ffd6a5;ffd29c;ffcc8f;ffc178;ffa94b;ff7b00".split(";"), H=m.fromValues(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),N=m.fromValues(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),E=x.newLayout().vec3f(A.VertexAttribute.POSITION).vec4u8(A.VertexAttribute.COLOR).f32(A.VertexAttribute.SIZE);let G=null;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/StarsTechnique":function(){define("require exports ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/Stars.glsl ../webgl-engine/core/shaderModules/interfaces ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends p.NoParameters{constructor(){super(...arguments);this.modelMatrix=q.create()}}class w extends h.ShaderTechnique{constructor(v){super(v,new f.ShaderTechniqueConfiguration,()=>this.destroy())}initializeProgram(v){return new e.Program(v.rctx,w.shader.get().build(),c.Default3D)}initializePipeline(){return d.makePipelineState({blending:d.separateBlendingParams(g.BlendFactor.SRC_ALPHA,g.BlendFactor.ONE,g.BlendFactor.ONE_MINUS_SRC_ALPHA,g.BlendFactor.ONE_MINUS_SRC_ALPHA), depthTest:{func:g.CompareFunction.LEQUAL},colorWrite:d.defaultColorWriteParams})}}w.shader=new k.ReloadableShaderModule(l.Stars,()=>new Promise((v,m)=>a(["./Stars.glsl"],v,m)));b.StarPassParameters=t;b.StarsTechnique=w;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Stars.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c){function e(){const d=new f.ShaderBuilder;d.attributes.add(c.VertexAttribute.POSITION,"vec3");d.attributes.add(c.VertexAttribute.COLOR,"vec4");d.attributes.add(c.VertexAttribute.SIZE,"float");d.varyings.add("vcolor","vec4");d.varyings.add("vsize","float");d.vertex.uniforms.add(new h.Matrix4PassUniform("transform",(t,w)=>{b.copy(g,w.camera.projectionMatrix);g[10]=2.4E-7-1;g[11]=-1;g[14]=(2.4E-7-2)*w.camera.near;b.multiply(g,g,w.camera.viewMatrix);return b.multiply(g,g,t.modelMatrix)}), new l.Float4PassUniform("viewport",(t,w)=>w.camera.fullViewport),new p.FloatPassUniform("pixelRatio",(t,w)=>w.camera.pixelRatio));d.vertex.code.add(k.glsl`void main(void) { gl_Position = transform * vec4(position, 0); vcolor = color / 1.2; vsize = size * 5.0 * pixelRatio; gl_PointSize = vsize; }`);d.fragment.code.add(k.glsl`void main() { float cap = 0.7; float scale = 1.0 / cap; float helper = clamp(length(abs(gl_PointCoord - vec2(0.5))), 0.0, cap); float alpha = clamp((cap - helper) * scale, 0.0, 1.0); float intensity = alpha * alpha * alpha; if (vsize < 3.0) { intensity *= 0.5; } fragColor = vec4(vcolor.xyz, intensity); }`);return d}const g=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:e},Symbol.toStringTag,{value:"Module"}));a.Stars=q;a.build=e})},"esri/views/3d/webgl-engine/effects/RenderPlugin":function(){define(["exports","../../../../core/Accessor","../core/shaderLibrary/ShaderOutput"],function(a,b,q){const l={required:[]};q={required:[q.ShaderOutput.Depth]};class p extends b{consumes(){return l}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}get materialReference(){return null}modify(g){}get numGeometries(){return 0}get hasOccludees(){return!1}queryRenderOccludedState(g){return!1}} class k extends p{}class h extends p{constructor(){super(...arguments);this.drapedPriority=0}}class f extends p{}class c extends p{}class e extends p{}a.ASyncPreparesRenderPlugin=e;a.AsyncRenderPlugin=c;a.ConsumesDepth=q;a.ConsumesNone=l;a.SyncPrepareRenderPlugin=h;a.SyncPreparesRenderPlugin=f;a.SyncRenderPlugin=k;a.isPrepareRenderPlugin=function(g){return"prepareTechnique"in g};a.isPreparesRenderPlugin=function(g){return"prepareTechniques"in g};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/lib/Update":function(){define(["exports"],function(a){a.Update=void 0;var b=a.Update||(a.Update={});b[b.Immediate=0]="Immediate";b[b.Faded=1]="Faded";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/sunUtils":function(){define("exports ../../../core/mathUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../ViewingMode ../../../chunks/SunCalc ./mathUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(R,Q,W){Q===c.ViewingMode.Global?h.normalize(M,R.eye):h.set(M,0,0,1);h.scale(K,R.viewForward,-1);Q=g.angle(K,M);const S=Math.max(Q-.5,0);q.fromRotation(P,-Math.max(.25,Q-.25-.85*S/(S+1)),R.viewRight);h.transformMat4(W,K,P);h.add(W,W,h.scale(J,R.viewRight,.2));h.normalize(W,W)}function t(R,Q,W,S){const V=y,T=q.identity(x);if(W===c.ViewingMode.Global)e.SunCalc.getPosition(R,0,0,V),h.set(S,0,0,-1),q.rotateX(T,T,-V.azimuth),q.rotateY(T,T,-V.altitude);else{var Y= m.planarDirection;W=Y.globalAngles;Y=(Math.abs(Q[2])-Y.localAltitude)/(Y.globalAltitude-Y.localAltitude);Y=b.clamp(Y,0,1);1>Y?(e.SunCalc.getPosition(R,Q[1],Q[0],V),V.azimuth=(1-Y)*V.azimuth+Y*W.azimuth,V.altitude=(1-Y)*V.altitude+Y*W.altitude):(V.azimuth=W.azimuth,V.altitude=W.altitude);h.set(S,0,-1,0);q.rotateZ(T,T,-V.azimuth);q.rotateX(T,T,-V.altitude)}h.transformMat4(S,S,T)}function w(R){switch(R){case "disabled":case "sunny":return new r(1,1);case "cloudy":return new r(1,1);case "rainy":return new r(.4, 1.2);case "snowy":return new r(.5,1.3);case "foggy":return new r(.2,1.6)}}function v(R,Q){const W=(R[0]+R[1]+R[2])/3;R[0]+=(W-R[0])*Q;R[1]+=(W-R[1])*Q;R[2]+=(W-R[2])*Q}const m={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,directAtNoon:.65,directAtTwilight:.7},global:{altitude:8E5,ambient:.015,direct:.75},planarDirection:{localAltitude:1E4,globalAltitude:1E6,globalAngles:{azimuth:1.3*Math.PI,altitude:.6*Math.PI}}};class r{constructor(R,Q){this.direct=R;this.ambient= Q}}const n=f.fromValues(.5773502691896258,-.5773502691896258,.5773502691896258);class u{constructor(){this.ambient={color:f.fromValues(1,1,1),intensity:.55};this.direct={color:f.fromValues(1,1,1),intensity:.55,directionToLightSource:f.clone(n)};this.noonFactor=.5;this.globalFactor=0;this.environmentStrength=this.specularStrength=1}}const x=l.create(),y={azimuth:0,altitude:0},z=f.fromValues(.01,.01,.01),A=f.fromValues(1,.6,.5),B=f.fromValues(1,.98,.98),C=f.fromValues(1,1,1),D=f.fromValues(.8,.8,1), F=f.fromValues(.8,.8,1),H=f.fromValues(.98,.98,1),N=f.fromValues(1,1,1),E=k.fromValues(.01,m.local.ambientAtNight),G=k.fromValues(m.local.directAtTwilight,m.local.ambientAtTwilight),I=k.fromValues(.9*m.local.directAtNoon,m.local.ambientAtNoon),O=k.fromValues(m.local.directAtNoon,m.local.ambientAtNoon),L=new Date(0),P=l.create(),M=f.create(),K=f.create(),J=f.create();a.ColorAndIntensity=u;a.computeColorAndIntensity=function(R,Q,W,S,V,T){h.set(T.ambient.color,1,1,1);T.ambient.intensity=m.global.ambient; h.set(T.direct.color,1,1,1);T.direct.intensity=m.global.direct;var Y=b.clamp((Math.abs(Q[2])-m.local.altitude)/(m.global.altitude-m.local.altitude),0,1);T.globalFactor=Y;var ha;null!=R&&(ha=e.SunCalc.getTimes(R,Q[1],Q[0]));if(1>Y){if(null!=R){var ba=ha;var U=R.valueOf();if(ba.polarException===e.SunCalc.PolarException.MIDNIGHT_SUN){var Z=U-36E5*(R.getHours()+48)-6E4*R.getMinutes();ba=Z+432E6}else ba.polarException===e.SunCalc.PolarException.POLAR_NIGHT?(Z=U-2,ba=U-1):(Z=ba.sunrise.valueOf(),ba=ba.sunset.valueOf()); var ca=ba-Z;var ea=Z+ca/2,da=ca/4;const ia=ea-da;da=ea+da;ca*=.06;const ka=Z-ca/2,fa=Z+ca/2,X=ba-ca/2,ja=ba+ca/2;Z=k.create();ca=f.create();ba=f.create();Uja?(p.copy(Z,E),h.copy(ca,z),h.copy(ba,D)):UQ?B.PolarException.MIDNIGHT_SUN:1N.length)){z=N.length-1;for(let E=0;Ethis.view.navigation?.browserTouchPanEnabled,O=>{this._source.browserTouchPanningEnabled= !O},p.initial))}isModifierKeyDown(G){return this._inputManager?.isModifierKeyDown(G)??!1}_updateMode(){var G=this.primaryDragAction;if(G=E.get(this.mode)?.get(G))this._modeDragPan&&(this._modeDragPan.pointerAction=G.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=G.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=G.zoom)}get test(){}};a.__decorate([k.property()],b.prototype,"view",void 0);a.__decorate([k.property({value:"pan"})],b.prototype,"primaryDragAction",null);a.__decorate([k.property({value:"default"})], b.prototype,"mode",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"updating",null);a.__decorate([k.property()],b.prototype,"latestPointerType",null);a.__decorate([k.property()],b.prototype,"latestPointerLocation",null);a.__decorate([k.property()],b.prototype,"multiTouchActive",null);a.__decorate([k.property()],b.prototype,"_inputManager",void 0);b=a.__decorate([c.subclass("esri.views.3d.input.SceneInputManager")],b);const E=new Map;a=new Map;k=new Map;a.set("pan",{pan:"primary",rotate:"secondary", zoom:"tertiary"});a.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"});k.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"});k.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"});E.set("default",a);E.set("pro",k);return b})},"esri/views/3d/input/handlers/DoubleClickZoom":function(){define("exports ../../../../core/screenUtils ../../state/controllers/ZoomStepControllerGlobal ../../state/controllers/ZoomStepControllerLocal ../../../input/InputHandler ../../../input/handlers/support".split(" "), function(a,b,q,l,p,k){class h extends p.InputHandler{constructor(f,c){super(!0);this._view=f;this.registerIncoming("double-click",c,e=>this._handleDoubleClick(e))}_handleDoubleClick(f){const c=f.data;if(k.eventMatchesPointerAction(c,"primary")){const e=this._view.state.isGlobal?new q.ZoomStepControllerGlobal({view:this._view,mode:"animation"}):new l.ZoomStepControllerLocal({view:this._view,mode:"animation"});this._view.state.switchCameraController(e);e.zoomStep(Math.log(.5)/Math.log(.6),b.createScreenPointArray(c.x, c.y));f.stopPropagation()}}}a.DoubleClickZoom=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/ZoomStepControllerGlobal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/time ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/sphere ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../camera/constraintUtils/surfaceCollision ./PointToPointAnimationController ../utils/navigationUtils ../../support/geometryUtils/ray ../../support/geometryUtils/sphere ../../webgl/RenderCamera ../../webgl-engine/lib/Intersector ../../../animation/easing".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){a.ZoomStepControllerGlobal=class extends n.PointToPointAnimationController{constructor(){super(...arguments);this._zoomLocation=g.create();this._tmpCamera=new z;this._tmpViewDir=g.create();this._tmpRayDir={origin:g.create(),direction:g.create()};this._targetOnSphere=g.create();this._tmpCenter=g.create();this._beginCamera=new z;this._constraintOptions=new w.ConstraintOptions(v.ConstraintTypes.ALL_EXCEPT_COLLISION,m.InteractionType.ZOOM,null, this._beginCamera);this._sphere=d.create()}initialize(){this._intersector=A.newIntersector(this.view.state.viewingMode)}zoomStep(F,H){if(this.active){var N=this.view.state;this.animation.finished?this._beginCamera.copyFrom(N.camera):this.animation.cameraAt(1,this._beginCamera);var E=!1,G=!1;this.intersectionHelper.intersectScreen(H,this._zoomLocation,0===this.view.map.ground.opacity?u.contentIntersectorOptions:{})&&(E=0=H&&4>I&&(I=4,H=I/G);if(1E-6>Math.abs(G-I))return;G=e.length(F.center);this._sphere[3]!==G&&(F.center=e.scale(C,F.center,(this._sphere[3]+H*(G-this._sphere[3]))/G));e.scale(this._tmpViewDir,this._tmpViewDir,-H);F.eye=e.add(C,F.center,this._tmpViewDir);t.applyAll(this.view,F,this._constraintOptions);1E-12Math.abs(E-N))return;e.scale(this._tmpRayDir.direction,this._tmpRayDir.direction, O*(1-I));F.eye=e.add(C,F.eye,this._tmpRayDir.direction);F.center=e.add(C,F.center,this._tmpRayDir.direction)}r.applySurfaceCollisionConstraint(this.view,F)}};a.ZoomStepControllerGlobal=b.__decorate([c.subclass("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],a.ZoomStepControllerGlobal);const C=g.create(),D=g.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils":function(){define("exports ./constraintUtils/altitude ./constraintUtils/common ./constraintUtils/ConstraintOptions ./constraintUtils/ConstraintTypes ./constraintUtils/distance ./constraintUtils/InteractionType ./constraintUtils/surfaceCollision ./constraintUtils/tilt ../../animation/easing".split(" "), function(a,b,q,l,p,k,h,f,c,e){const g=[{type:p.ConstraintTypes.TILT,error:function(t,w,v){return c.getTiltConstraintError(t,w,v)*w.distance},apply:c.applyTiltConstraint},{type:p.ConstraintTypes.ALTITUDE,error:b.getAltitudeConstraintError,apply:b.applyAltitudeConstraint},{type:p.ConstraintTypes.DISTANCE,error:k.getDistanceConstraintError,apply:k.applyDistanceConstraint}],d=new l.ConstraintOptions;a.applyAll=function(t,w,v=d,m=w){m!==w&&m.copyFrom(w);m.computeUp(t.state.viewingMode);w=!1;for(let n= 0;5>n;n++){let u=0;for(var r of g)if(q.hasConstraintType(v.selection,r.type)){const x=Math.abs(r.error(t,m,v));r.apply(t,m,v)&&(w=!0,u+=x)}if(0===u)break}r=q.hasConstraintType(v.selection,p.ConstraintTypes.COLLISION);a:switch(v.interactionType){case h.InteractionType.PAN:v=f.Mode.EYE_AND_CENTER;break a;case h.InteractionType.ASCEND:v=t.state.isGlobal?f.Mode.EYE_AND_CENTER_SCALE:f.Mode.EYE_AND_CENTER;break a;default:v=f.Mode.EYE}r&&f.applySurfaceCollisionConstraint(t,m,v)&&(w=!0);w&&m.computeUp(t.state.viewingMode); return w};a.pixelDistanceToInteractionFactor=function(t){return e.inOutCubic(Math.min(1,t/150))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/altitude":function(){define("exports ../../../../core/mathUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/ray ./common ./ConstraintTypes ./InteractionType ../../support/intersectionUtils".split(" "),function(a,b,q,l,p,k,h,f,c){function e(m, r,n=k.defaultConstraintOptions){var u=m.state.constraints.altitude;u=m.state.isGlobal&&u?n.interactionType===f.InteractionType.TUMBLE&&k.hasConstraintType(n.selection,h.ConstraintTypes.TILT)?!1:!0:!1;if(!u||!m.state.constraints.altitude)return 0;var x=m.state.constraints.altitude;u=g;u.min=x.min;u.max=x.max;x=n.interactionType;if(x!==f.InteractionType.NONE){var {min:y,max:z}=u,{interactionStartCamera:A,interactionFactor:B}=n;if(A){n=x===f.InteractionType.TUMBLE||x===f.InteractionType.ZOOM;x=e(m,A); var C=0===x?0:m.renderCoordsHelper.getAltitude(A.eye);u.min=y;u.max=z;k.adjustRangeForInteraction(x,C,n,B,.05*C,u)}}m=m.renderCoordsHelper.getAltitude(r.eye);m=b.clamp(m,u.min,u.max)-m;return 1E-6>=Math.abs(m)?0:m}const g={min:0,max:0},d=l.create(),t=l.create(),w=l.create(),v=l.create();a.applyAltitudeConstraint=function(m,r,n=k.defaultConstraintOptions){var u=e(m,r,n);if(0===u)return!1;const x=m.renderCoordsHelper,y=x.getAltitude(r.eye)+u;var z=k.interactionDirectionTowardsConstraintMinimization; n=n.interactionDirection;u=Math.sign(u);m.renderCoordsHelper.worldUpAtPosition(r.eye,t);q.scale(t,t,u);z=z.call(k,r,n,t,d);m=q.copy(w,r.viewForward);z=x.intersectInfiniteManifold(p.wrap(r.eye,z),y,v);r.eye=null!=z?z:x.setAltitude(v,y,r.eye);r.center=c.closestPointOnRay(v,r.eye,m,r.center);return!0};a.getAltitudeConstraintError=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/common":function(){define(["exports","../../../../chunks/vec32","./ConstraintOptions", "./ConstraintTypes"],function(a,b,q,l){q=new q.ConstraintOptions(l.ConstraintTypes.NONE);a.adjustRangeForInteraction=function(p,k,h,f,c,e){0!==p&&(h?(e.min=Math.min(e.min,k),e.max=Math.max(e.max,k)):null!=f?(e.min-=Math.max(0,(k-e.min)*(1-f)),e.max+=Math.max(0,(k-e.max)*(1-f))):c&&(e.min-=Math.max(0,k-e.min-c),e.max+=Math.max(0,k-e.max-c)))};a.defaultConstraintOptions=q;a.hasConstraintType=function(p,k){return 0!==(p&k)};a.interactionDirectionTowardsConstraintMinimization=function(p,k,h,f){k=k||p.viewForward; b.copy(f,k);b.scale(f,f,Math.sign(b.dot(k,h)));return f};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/ConstraintOptions":function(){define(["exports","./ConstraintTypes","./InteractionType","./TiltMode"],function(a,b,q,l){class p{constructor(k=b.ConstraintTypes.ALL,h=q.InteractionType.NONE,f=0,c=null,e=null,g=l.TiltMode.TUMBLE){this.selection=k;this.interactionType=h;this.interactionFactor=f;this.interactionStartCamera=c;this.interactionDirection= e;this.tiltMode=g}}a.ConstraintOptions=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/ConstraintTypes":function(){define(["exports"],function(a){a.ConstraintTypes=void 0;var b=a.ConstraintTypes||(a.ConstraintTypes={});b[b.NONE=0]="NONE";b[b.TILT=1]="TILT";b[b.ALTITUDE=2]="ALTITUDE";b[b.DISTANCE=4]="DISTANCE";b[b.COLLISION=8]="COLLISION";b[b.ALL=15]="ALL";b[b.ALL_EXCEPT_COLLISION=7]="ALL_EXCEPT_COLLISION";Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/camera/constraintUtils/InteractionType":function(){define(["exports"],function(a){a.InteractionType=void 0;var b=a.InteractionType||(a.InteractionType={});b[b.NONE=0]="NONE";b[b.ZOOM=1]="ZOOM";b[b.TUMBLE=2]="TUMBLE";b[b.LOOK_AROUND=3]="LOOK_AROUND";b[b.PAN=4]="PAN";b[b.ASCEND=5]="ASCEND";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/TiltMode":function(){define(["exports"],function(a){a.TiltMode=void 0;var b= a.TiltMode||(a.TiltMode={});b[b.TUMBLE=0]="TUMBLE";b[b.LOOK_AROUND=1]="LOOK_AROUND";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/intersectionUtils":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/vec2f64","../../../chunks/vec32","../../../core/libs/gl-matrix-2/factories/vec3f64","../../../geometry/support/plane"],function(a,b,q,l,p){function k(c,e,g,d){const t=f;c?(g&&d&&(t.len=q.distance(e,g)),q.copy(t.dir,c)):d?(t.len=q.distance(e, g),q.subtract(t.dir,g,e),q.scale(t.dir,t.dir,1/t.len)):(q.subtract(t.dir,g,e),q.normalize(t.dir,t.dir));return t}function h(c,e,g,d){d.clip[0]=0;d.clip[1]=g?d.len:Number.MAX_VALUE;for(g=0;gt&&0<=m?v=!1:-1E-6m?v=0t||0>m)||0>t&&0>m?(t/=m,0v.clip[0]&&(v.clip[0]=t),v=v.clip[0]<=v.clip[1]):v=!0}if(!v)return!1}return!0}const f={dir:l.create(),len:0,clip:b.create()}; a.closestPointOnRay=function(c,e,g,d){d=q.dot(g,q.subtract(c,d,e));return q.add(c,e,q.scale(c,g,d))};a.frustumLineSegment=function(c,e,g,d){d=k(d,e,g,!0);return h(c,e,g,d)};a.frustumPoint=function(c,e){for(let g=0;6>g;g++)if(0g||c[1][0]*d+c[1][1]*t+c[1][2]*e+c[1][3]>g||c[2][0]*d+c[2][1]* t+c[2][2]*e+c[2][3]>g||c[3][0]*d+c[3][1]*t+c[3][2]*e+c[3][3]>g||c[4][0]*d+c[4][1]*t+c[4][2]*e+c[4][3]>g||c[5][0]*d+c[5][1]*t+c[5][2]*e+c[5][3]>g?!1:!0};a.planeSphere=function(c,e,g){return c[0]*e[0]+c[1]*e[1]+c[2]*e[2]+c[3]=e)return!1;g=b.length(f.eye);b.subtract(p,f.center,f.eye);f.eye=h.renderCoordsHelper.setAltitude(k,e,f.eye);c===a.Mode.EYE_AND_CENTER?f.center=b.add(p,f.eye,p):c===a.Mode.EYE_AND_CENTER_SCALE&&(f.center=b.scale(p,f.center,(g-d+e)/g));return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/tilt":function(){define("exports ../../../../core/compilerUtils ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../chunks/sphere ./common ./ConstraintTypes ./InteractionType ./TiltMode ../../state/utils/viewUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(D,F,H,N=!0){C.eyeCenterDistance=0;C.requiresTwoSteps=!1;const E=m(D,F,H,e.defaultConstraintOptions,C);if(0===E)return!1;l.fromRotation(x,-E,F.viewRight);switch(H.tiltMode){case t.TiltMode.LOOK_AROUND:k.transformMat4(u,F.viewForward,x);k.scale(u,u,C.eyeCenterDistance);F.center=k.add(y,F.eye,u);break;case t.TiltMode.TUMBLE:k.subtract(u,F.center,F.eye);k.transformMat4(u,u,x);F.eye=k.subtract(y,F.center,u);break;default:b.neverReached(H.tiltMode)}F.up= k.transformMat4(y,F.up,x);return C.requiresTwoSteps&&N?v(D,F,H,!1):!0}function m(D,F,H,N=e.defaultConstraintOptions,E){if(!D.state.constraints.tilt)return 0;var G=D.state.constraints.tilt(F.distance,A);if(H.interactionType!==d.InteractionType.NONE){var {interactionStartCamera:I,interactionFactor:O}=H;if(I){var {min:L,max:P}=G,M=m(D,I,e.defaultConstraintOptions,H),K=0===M?0:w.viewAngle(D.renderCoordsHelper,I.center,I.eye);G.min=L;G.max=P;H.interactionType===d.InteractionType.TUMBLE?(e.hasConstraintType(H.selection, g.ConstraintTypes.ALTITUDE)&&n(D,I,G),e.adjustRangeForInteraction(M,K,!0,O,z,G)):e.adjustRangeForInteraction(M,K,!1,O,z,G)}}N.interactionType===d.InteractionType.TUMBLE&&e.hasConstraintType(N.selection,g.ConstraintTypes.ALTITUDE)&&n(D,N.interactionStartCamera,G);if(H.tiltMode===t.TiltMode.LOOK_AROUND||N.tiltMode===t.TiltMode.LOOK_AROUND){a:{E&&(E.requiresTwoSteps=!1);switch(D.viewingMode){case "global":H=B;M=D.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude;N=M+f.getReferenceEllipsoid(D.spatialReference).radius; M=D.renderCoordsHelper.intersectManifold(F.ray,M,y);H.eyeCenterDistance=F.distance;H.centerIsOnSurface=!1;null!=M?(H.eyeCenterDistance=k.distance(F.eye,M),H.tiltAtCenter=w.viewAngle(D.renderCoordsHelper,M,F.eye),H.centerIsOnSurface=!0):D.state.isLocal?H.tiltAtCenter=w.viewAngle(D.renderCoordsHelper,F.center,F.eye):(c.closestPointOnSilhouette(c.fromRadius(c.tmpSphere,N),F.ray,y),H.eyeCenterDistance=k.distance(F.eye,y),H.tiltAtCenter=q.acosClamped(-k.dot(F.viewForward,k.normalize(y,y))));H.radius=N; H.eyeRadius=k.length(F.eye);H.constraints=D.state.constraints;F=q.clamp(H.tiltAtCenter,G.min,G.max);if(1E-9G&&1E-9H.radius?D-G:G-D}else F=H.constraints.clampTilt(H.eyeCenterDistance,H.tiltAtCenter),E&&FWQJ,p=J=>J*J,k=J=>1-p(1-J),h=J=>.5>J?p(2*J)/2:(1-p(1-2*(J-.5))+1)/2,f=J=>J*J*J,c=J=>1-f(1-J),e=J=>.5>J?f(2*J)/2:(1-f(1-2*(J-.5))+1)/2,g=J=>J*J*J*J,d=J=>1-g(1-J),t=J=>.5>J?g(2* J)/2:(1-g(1-2*(J-.5))+1)/2,w=J=>J*J*J*J*J,v=J=>1-w(1-J),m=J=>.5>J?w(2*J)/2:(1-w(1-2*(J-.5))+1)/2,r=J=>-Math.cos(J*Math.PI/2)+1,n=J=>1-r(1-J),u=J=>.5>J?r(2*J)/2:(1-r(1-2*(J-.5))+1)/2,x=J=>2**(10*(J-1)),y=J=>1-2**(10*(1-J-1)),z=J=>.5>J?2**(10*(2*J-1))/2:(1-2**(10*(1-2*(J-.5)-1))+1)/2,A=J=>-(Math.sqrt(1-J*J)-1),B=J=>1-A(1-J),C=J=>.5>J?A(2*J)/2:(1-A(1-2*(J-.5))+1)/2,D=q(b(1),1),F=q(b(1),0),H=q(b(1),.5),N=q(b(2),1),E=q(b(2),0),G=q(b(2),.5),I=q(b(3),1),O=q(b(3),0),L=q(b(3),.5),P=q(b(4),1),M=q(b(4),0),K= q(b(4),.5);a.EasingFunctions={linear:l,"in-quad":p,"out-quad":k,"in-out-quad":h,"in-coast-quad":D,"out-coast-quad":F,"in-out-coast-quad":H,"in-cubic":f,"out-cubic":c,"in-out-cubic":e,"in-coast-cubic":N,"out-coast-cubic":E,"in-out-coast-cubic":G,"in-quart":g,"out-quart":d,"in-out-quart":t,"in-coast-quart":I,"out-coast-quart":O,"in-out-coast-quart":L,"in-quint":w,"out-quint":v,"in-out-quint":m,"in-coast-quint":P,"out-coast-quint":M,"in-out-coast-quint":K,"in-sine":r,"out-sine":n,"in-out-sine":u,"in-expo":x, "out-expo":y,"in-out-expo":z,"in-circ":A,"out-circ":B,"in-out-circ":C};a.inCirc=A;a.inCoastCubic=N;a.inCoastQuad=D;a.inCoastQuart=I;a.inCoastQuint=P;a.inCubic=f;a.inExpo=x;a.inOutCirc=C;a.inOutCoastCubic=G;a.inOutCoastQuad=H;a.inOutCoastQuart=L;a.inOutCoastQuint=K;a.inOutCubic=e;a.inOutExpo=z;a.inOutQuad=h;a.inOutQuart=t;a.inOutQuint=m;a.inOutSine=u;a.inQuad=p;a.inQuart=g;a.inQuint=w;a.inSine=r;a.linear=l;a.outCirc=B;a.outCoastCubic=E;a.outCoastQuad=F;a.outCoastQuart=O;a.outCoastQuint=M;a.outCubic= c;a.outExpo=y;a.outQuad=k;a.outQuart=d;a.outQuint=v;a.outSine=n;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/PointToPointAnimationController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../ViewAnimation ../../animation/pointToPoint/Animation ./AnimationController ../../webgl/RenderCamera ../../webgl-engine/lib/Intersector ../../../animation/easing".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.PointToPointAnimationController=class extends g.AnimationController{get intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(r){super(r);this.mode="interaction";this._hasTarget=!1}initialize(){this.animation=new e.Animation(this.view.state.viewingMode);this.viewAnimation="interaction"===this.mode?null:new c}get isInteractive(){return"interaction"===this.mode}begin(r,n){this._hasTarget=!0;n=this.animationSettings(n);v.copyFrom(this.view.state.camera); const u=t.newIntersector(this.view.state.viewingMode);this.intersectionHelper.intersectRay(v.ray,u,m)&&(v.center=m);this.animation.update(v,r,n);this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time;super.finish()}get steppingFinished(){return this._hasTarget&&this.animation.finished}stepController(r,n){this._hasTarget&&this.animation.step(r,n)}onControllerEnd(r){this._hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,r),this.animation.currentTime= this.animation.time);super.onControllerEnd(r)}animationSettings(r={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(Infinity)/6,ascensionFactor:void 0,descensionFactor:void 0},...r,easing:"string"===typeof r.easing?w.EasingFunctions[r.easing]:r.easing}}};b.__decorate([q.property({constructOnly:!0})],a.PointToPointAnimationController.prototype,"mode",void 0);b.__decorate([q.property({readOnly:!0})],a.PointToPointAnimationController.prototype,"isInteractive",null);a.PointToPointAnimationController= b.__decorate([h.subclass("esri.views.3d.state.controllers.PointToPointAnimationController")],a.PointToPointAnimationController);const v=new d,m=f.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/animation/pointToPoint/Animation":function(){define("exports ../../../../core/time ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ./Camera ../../webgl/RenderCamera ../../../animation/pointToPoint/Animation".split(" "),function(a,b,q,l,p, k,h){class f{get finished(){return this.currentTime>=this._animation.time}get time(){return this._animation.time}constructor(e){this.currentTime=b.Milliseconds(0);this._animation=new h.Animation(()=>new p.Camera(e));this._current=new p.Camera(e)}update(e,g,d){const {source:t,target:w}=this._animation.definition,v=q.subtract(c,g.center,e.center),m=q.length(v);1E-5<=m?(v[0]/=m,v[1]/=m,v[2]/=m):(v[0]=0,v[1]=1,v[0]=0);q.copy(t.direction,v);q.copy(w.direction,v);t.copyFromRenderCamera(e);w.copyFromRenderCamera(g); this._current.copyFrom(t);this._animation.update(t,w,d);this.currentTime=b.Milliseconds(0);e.almostEquals(g)&&(this.currentTime=this._animation.time)}cameraAt(e,g){this._animation.cameraAt(e,this._current);g=g||new k;this._current.copyToRenderCamera(g);return g}step(e,g){this.finished||(this.currentTime=b.Milliseconds(this.currentTime+b.millisecondsFromSeconds(e)),this.currentTime>=this.time&&(this.currentTime=this.time));return this.cameraAt(this.currentTime/this.time,g)}}const c=l.create();a.Animation= f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/animation/pointToPoint/Camera":function(){define("exports ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../ViewingMode ../../support/mathUtils".split(" "),function(a,b,q,l,p,k,h,f){class c{get pitch(){return this._pitch}get yaw(){return this._yaw}get distance(){return this._distance}get fov(){return this._fov}get size(){return this._size}constructor(x){this.viewingMode= x;this.center=k.create();this._distance=this._yaw=this._pitch=0;this.direction=k.clone(r);this._fov=55;this._size=1}pixelsPerPanAtZoom(x){return this._size/2/(this._zoomToPanScale*x)}zoomAtPixelsPerPan(x){return this._size/2/(this._zoomToPanScale*x)}pixelsPerRotateAtZoom(){return this._size/2/Math.max(Math.cos(Math.abs(this._pitch)),.5)}compareTo(x,y){if(this.viewingMode===h.ViewingMode.Global){var z=p.length(this.center);const A=p.length(x.center);z=(z+A)/2;y.pan=f.angle(this.center,x.center)*z}else y.pan= p.distance(this.center,x.center);z=Math.abs(x._yaw-this._yaw);z>=Math.PI&&(z=2*Math.PI-z);y.rotate=Math.max(z,Math.abs(x._pitch-this._pitch));y.fov=x.fov-this.fov;y.sourceZoom=this._distance;y.targetZoom=x._distance}interpolate(x,y,z){this.viewingMode===h.ViewingMode.Global?f.slerp(x.center,y.center,z.pan,this.center):p.lerp(this.center,x.center,y.center,z.pan);this._distance=isFinite(y.distance)?b.lerp(x.distance,y.distance+z.zoomOffset,z.zoom):x.distance;this._pitch=b.lerp(x.pitch,y.pitch,z.rotate); let A=x._yaw;const B=y._yaw;Math.abs(B-A)>=Math.PI&&(A+=2*(AMath.abs(w[2])?(p.copy(z,w),0b.getEpsilon()}get hasFov(){return Math.abs(this.compared.fov)> b.getEpsilon()}get hasRotate(){return this.compared.rotate>b.getEpsilon()}}a.Definition=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Camera":function(){define(["exports"],function(a){class b{constructor(){this.targetZoom=this.sourceZoom=this.fov=this.rotate=this.pan=0}}a.CompareResult=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Settings":function(){define(["exports","../../../core/time"], function(a,b){const q={desiredScreenFlow:2,minDuration:b.Milliseconds(500),maxDuration:b.Milliseconds(8E3)};b={...q,maxDuration:b.Milliseconds(4E3)};a.defaultSettings=q;a.defaultSettings2D=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/InterpolateComponents":function(){define(["exports"],function(a){class b{constructor(){this.zoomOffset=this.fov=this.zoom=this.rotate=this.pan=0}}a.InterpolateComponents=b;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/animation/pointToPoint/apex/Path":function(){define(["exports","../../easing","../Path","../Segment","./planning"],function(a,b,q,l,p){class k extends q.Path{constructor(h,f){super();this._preallocSegments=[new l.Segment,new l.Segment,new l.Segment];this._descensionSegment=this._ascensionSegment=null;this.update(h,f)}update(h,f){h&&(this.definition?this.definition.copyFrom(h):this.definition=h.clone(),h=f?.apex?p.optimalDistance(h,f.apex):null,this.segments.length= 0,this._descensionSegment=this._ascensionSegment=null,h?this._updateWithApex(h,f?.apex):this._updateWithoutApex())}segmentInterpolateComponentsAt(h,f,c){h.interpolateComponentsAt(f,c);h===this._ascensionSegment?c.zoom=b.outQuad(c.zoom):h===this._descensionSegment&&(c.zoom=b.inQuad(c.zoom))}_updateWithApex(h,f){const [c,e,g]=this._preallocSegments,d=f?.ascensionFactor??.5;f=Math.min(1-d,null!=f?.ascensionFactor&&null!=f.descensionFactor?f.descensionFactor:.5);const t=1-d-f;c.definition?c.definition.copyFrom(this.definition): c.definition=this.definition.clone();c.definition.compared.targetZoom=h;c.definition.compared.pan=this.definition.compared.pan*d;c.definition.compared.rotate=this.definition.compared.rotate*d;c.definition.segmentEnd=d;c.update();this._ascensionSegment=c;this.segments.push(c);0b.Seconds(q+l.time),b.Seconds(0))}interpolateComponentsAt(q,l){q=Math.min(Math.max(q, 0),1);q*=this.time;var p=0,k=0;const h=this.definition,f=this.segments.reduce((c,e)=>c||e.definition.hasZoom,!1);for(let c=0;cMath.abs(d-p)?t:d;l.zoomOffset=k-this.segments[this.segments.length-1].definition.compared.targetZoom;l.zoom=(q-p)/(k-p)}else l.zoom=1;return l}q-=e.time;p+=g.compared.pan;k+=g.compared.rotate}}segmentInterpolateComponentsAt(q,l,p){q.interpolateComponentsAt(l,p)}};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Segment":function(){define(["exports","../../../core/mathUtils","../../../core/time"],function(a,b,q){class l{get time(){return this._time}constructor(k){k&&this.update(k)}update(k){k&&(this.definition?this.definition.copyFrom(k):this.definition=k.clone());this._updatePrecomputedVariables();this._updatePixelFlow()}_updatePrecomputedVariables(){var k=this.definition;const h=k.compared,f=h.sourceZoom,c=h.targetZoom;this._zoomSign= f>c?1:-1;this._panPixelsAtSource=h.pan*k.source.pixelsPerPanAtZoom(f);k=(k.source.pixelsPerRotateAtZoom(f)+k.target.pixelsPerRotateAtZoom(c))/2;this._rotatePixels=h.rotate*k}_updatePixelFlow(){var k=this.definition.compared.sourceZoom,h=this.definition.compared.targetZoom;const {hasZoom:f,hasPan:c,hasRotate:e}=this.definition;var g=0,d=0;f&&(c&&(g=(h/k-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),e&&(d=Math.log(k/h)/Math.LN2*this._zoomSign*this.definition.halfWindowSize/ this._rotatePixels));this._rotatePixelFlow=this._panPixelFlow=this._zoomPixelFlow=0;k=this.definition.desiredPixelFlow;f&&c&&e?(h=g+d+g*d,this._zoomPixelFlow=g*d/h*k,this._panPixelFlow=d/h*k,this._rotatePixelFlow=g/h*k):f&&c?(d=1+g,this._zoomPixelFlow=g/d*k,this._panPixelFlow=1/d*k):f&&e?(g=1+d,this._zoomPixelFlow=d/g*k,this._rotatePixelFlow=1/g*k):c&&e?(g=this._panPixelsAtSource/this._rotatePixels,d=1+g,this._panPixelFlow=g/d*k,this._rotatePixelFlow=1/d*k):c?this._panPixelFlow=k:f?this._zoomPixelFlow= k:e&&(this._rotatePixelFlow=k);this._time=this.rotateTime??this.zoomTime??this.panTime??this.fovTime??q.Seconds(0)}get rotateTime(){return this.definition.hasRotate?q.Seconds(this._rotatePixels/this._rotatePixelFlow):null}get zoomTime(){return this.definition.hasZoom?q.Seconds(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2*this._zoomSign*this.definition.halfWindowSize/this._zoomPixelFlow):null}get fovTime(){return this.definition.hasFov?q.Seconds(Math.abs(this.definition.compared.fov)/ p):null}get panTime(){if(this.definition.hasPan){if(this.definition.hasZoom){const k=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2;return q.Seconds(Math.log(this._zoomPixelFlow/this._panPixelFlow*this._panPixelsAtSource*k+1)/(k*this._zoomPixelFlow))}return q.Seconds(this._panPixelsAtSource/this._panPixelFlow)}}_interpolateComponentsZoom(k){if(0===k||1===k)return k;if(this.definition.hasZoom){const h=this.definition.compared.sourceZoom,f=this.definition.compared.targetZoom;return(h*(h/ f)**-k-h)/(f-h)}return k}_interpolateComponentsFov(k){if(0===k)return this.definition.segmentStart;if(1===k)return this.definition.segmentEnd;if(this.definition.hasFov){const {segmentStart:h,segmentEnd:f}=this.definition;return h+k*(f-h)}return this.definition.segmentStart}_interpolateComponentsPan(k){if(0===k||1===k)return k;if(this.definition.hasPan&&this.definition.hasZoom){const h=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*this._panPixelFlow* (2**(h*k*this._time)-1)/(h*Math.LN2)}return k}_interpolateComponentsRotate(k){return k}interpolateComponentsAt(k,h){k=Math.min(Math.max(k,0),1);h.zoom=this._interpolateComponentsZoom(k);h.pan=this._interpolateComponentsPan(k);h.rotate=this._interpolateComponentsRotate(k);h.zoomOffset=0;h.fov=this._interpolateComponentsFov(k)}}const p=b.deg2rad(90);a.Segment=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/apex/planning":function(){define(["exports", "./functions"],function(a,b){function q(l,p){const k=Math.max(l.compared.sourceZoom,l.compared.targetZoom);l=l.source.zoomAtPixelsPerPan(l.desiredPixelFlow/l.compared.pan)/2;return le(l,A,h)+b.tPanion(l,A,h)+t(l,A,h);c=A=>g(l,A,h)+b.dtPanion(l,A,h)+w(l,A,h);const m=A=>d(l,A,h)+b.ddtPanion(l,A,h)+v(l,A,h);let r=f(k);const n=b.tBaseLine(l);let u;const x=p.maximumIterations|| 20,y=null!=p.maximumDistance?p.maximumDistance:Infinity;for(u=0;uz&&(A+=z);z=A/m(k);if(isNaN(z)||k>=y&&0>z){if(!isFinite(y))return null;k=y;r=f(k);break}k-=z;if(k=Math.abs(z-r)/r)break;r=z}return r>.7*n||kthis.updateStateFromViewAnimation(),()=>this.updateStateFromViewAnimation())}updateStateFromViewAnimation(){null==this.viewAnimation||this.state!==g.State.Ready&&this.state!==g.State.Running||(this.viewAnimation.state===e.State.FINISHED?this.finish():this.viewAnimation.state===e.State.STOPPED&&(this.state=g.State.Stopped))}onControllerEnd(){null==this.viewAnimation||this.viewAnimation.done||(this.state===g.State.Finished?this.viewAnimation.finish(): this.state===g.State.Stopped&&this.viewAnimation.stop());this._asyncResult&&(this.state===g.State.Finished?this._asyncResult.resolve():this._asyncResult.reject(l.createAbortError()))}finish(){this.finishController()}};a.AnimationController=b.__decorate([c.subclass("esri.views.3d.state.controllers.AnimationController")],a.AnimationController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/CameraController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){a.State=void 0;(function(c){c[c.Ready=0]="Ready";c[c.Rejected=1]="Rejected";c[c.Running=2]="Running";c[c.Stopped=3]="Stopped";c[c.Finished=4]="Finished"})(a.State||(a.State={}));a.CameraController=class extends q{constructor(c){super(c);this.state=a.State.Ready}get active(){return this.state===a.State.Running}get isInteractive(){return!1}get canStop(){return!1}stopController(){return this.canStop?(this.state=a.State.Stopped,!0):!1}finishController(){this.state=a.State.Finished}get steppingFinished(){return!1}}; b.__decorate([l.property({constructOnly:!0})],a.CameraController.prototype,"view",void 0);b.__decorate([l.property({readOnly:!0})],a.CameraController.prototype,"active",null);b.__decorate([l.property()],a.CameraController.prototype,"state",void 0);b.__decorate([l.property({readOnly:!0})],a.CameraController.prototype,"isInteractive",null);a.CameraController=b.__decorate([f.subclass("esri.views.3d.state.controllers.CameraController")],a.CameraController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/state/utils/navigationUtils":function(){define("exports ../../../../core/Cyclical ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/axisAngle ../../../../geometry/support/coordinateSystem ../../../../geometry/support/plane ../../../../chunks/sphere ../../../../geometry/support/vectorStacks ../../support/geometryUtils/ray ../../support/geometryUtils/sphere ../../webgl/RenderCamera ../../webgl-engine/lib/verticalOffsetUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){function x(ya,Da,ra){ra=p.fromRotation(v.sm4d.get(),ra[3],g.axis(ra));null==ra||p.exactEquals(ra,k.IDENTITY)||(c.subtract(fa,ya.eye,Da),c.transformMat4(fa,fa,ra),ya.eye=c.add(fa,fa,Da),c.subtract(fa,ya.center,Da),c.transformMat4(fa,fa,ra),ya.center=c.add(fa,fa,Da),ya.up=c.transformMat4(fa,ya.up,ra))}function y(ya,Da,ra,xa){return Math.sin(ya/c.length(Da))*(ra+xa.radius)}function z(ya,Da,ra,xa){ra=m.fromScreenAtEye(Da,ra,va);if(null==ra)return!1;w.closestPointOnSilhouette(ya, ra,K);return w.intersectRay(ya,ra,xa)?c.squaredDistance(K,ra.origin)Pa?Pa=q.acosClamped(Pa):(ya=c.length(c.cross(e.create(),ya,Da))/(c.length(ya)* c.length(Da)),Pa=q.asinClamped(ya)),Ga=Math.cos(q.clamp(b.cyclicalPI.normalize(q.deg2rad(Ga)),0,P)),Pa=-Pa-Math.max(0,c.length(Da)-Ma)/(Ga*Ma)):(c.subtract(Q,xa.eye,xa.center),c.cross(ra,X,Q),Pa=-c.length(X)/Ma);c.normalize(ra,ra);c.scale(ra,ra,c.length(la));return Pa}function B(ya,Da,ra,xa){xa=Math.cos(q.clamp(b.cyclicalPI.normalize(q.deg2rad(xa)),0,P));Da=Da>ra?-(Da-ra)/(xa*ra):Da<-ra?Math.PI-(Da+ra)/(xa*ra):q.acosClamped(Da/ra);return((ya>ra?-(ya-ra)/(xa*ra):ya<-ra?Math.PI-(ya+ra)/(xa*ra):q.acosClamped(ya/ ra))-Da)*ra}function C(ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua){Qa=B(ya[2],Da[2],Ga[3],Qa);Da=Ea?B(ya[0],Da[0],Ga[3],180):Da[0]-ya[0];ya=Math.sin(Pa)*Da-Math.cos(Pa)*Qa;Pa=Math.cos(Pa)*Da+Math.sin(Pa)*Qa;c.normalize(fa,Ma);Ma=Ea?ya/Math.sqrt(Math.abs(Ga[3]**2-c.dot(ra,fa)**2)):ya/Ga[3];ra=Pa/Math.sqrt(Math.abs(Ga[3]**2-c.dot(ra,xa)**2));h.set(ua,Ma,ra)}function D(ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua){c.cross(la,ya,Da);d.coordinateSystemFromOneAxisAndNormalVector(Ga.up,Ga.eye,T,Y,ha);d.coordinateSystemFromOneAxisAndNormalVector([0, 0,1],Ga.eye,W,S,V);c.copy(ra,S);c.copy(xa,W);c.normalize(ra,ra);c.scale(ra,ra,c.length(la));d.vectorCoordinates(ya,c.normalize(Y,Y),c.normalize(ha,ha),c.normalize(T,T),ba);d.vectorCoordinates(Da,Y,ha,T,U);C(ba,U,ya,W,S,Pa,Qa,Ea,ua,Ma)}function F(ya,Da,ra,xa,Ma,Ga,Pa){p.fromRotation(ea,Ma,xa);p.fromRotation(da,Pa,Ga);p.multiply(ia,ea,da);c.subtract(Da,ya,ra);c.transformMat4(Da,Da,ia);c.add(Da,Da,ra)}function H(ya,Da,ra,xa,Ma,Ga){p.fromRotation(ea,xa,ra);p.fromRotation(da,Ga,Ma);p.multiply(ia,ea,da); c.subtract(fa,ya.eye,Da);c.transformMat4(fa,fa,ia);ya.eye=c.add(fa,fa,Da);c.subtract(fa,ya.center,Da);c.transformMat4(fa,fa,ia);ya.center=c.add(fa,fa,Da);c.subtract(fa,ya.up,Da);c.transformMat4(fa,fa,ia);ya.up=c.add(fa,fa,Da)}function N(ya,Da,ra,xa,Ma,Ga){return(Math.abs(xa)>Math.PI-L.Angle||Math.abs(xa)ra)&&Ga.aboveGround&&MaMath.abs(ya-ra)||(ra=c.scale(v.sv3d.get(),Da.viewForward,ra),Da.eye=c.subtract(fa,Da.center,ra))};a.applyZoomToPoint=function(ya,Da,ra,xa){const Ma=v.sv3d.get();ra=1-ra;c.subtract(Ma,Da,ya.eye);const Ga=c.length(Ma);let Pa=Ga*(1-ra);0<=ra&&PaMath.abs(Ga-Pa)||(c.scale(Ma,Ma,ra),ya.eye= c.add(fa,ya.eye,Ma),ya.center=c.lerp(fa,ya.center,Da,ra))};a.centroid=function(ya,Da){c.set(Da,0,0,0);for(const ra of ya)c.add(Da,Da,ra);c.scale(Da,Da,1/ya.length)};a.contentIntersectorOptions=u;a.distanceClampValues=[1,3E8];a.intersectPlaneFromScreenPoint=function(ya,Da,ra,xa){return t.intersectRay(ya,m.fromScreen(Da,ra,va),xa)};a.intersectPlaneFromScreenPointAtEye=function(ya,Da,ra,xa){return t.intersectRay(ya,m.fromScreenAtEye(Da,ra,va),xa)};a.lengthFromPoints=B;a.minHeightLimit=50;a.navigationMode= function(ya,Da,ra,xa){const Ma=ya.relativeElevation;if(Ma>O.Elevation&&"global"===xa)return a.NavigationMode.Horizontal;m.fromScreenAtEye(ya,Da,za);Da=Math.sign(Ma);ya=ra.worldUpAtPosition(ya.eye,fa);return-Da*c.dot(ya,za.direction) Math.PI;)ya-=2*Math.PI;for(;ya<-Math.PI;)ya+=2*Math.PI;return ya};a.offSurfaceTiltToEyeTiltGlobal=function(ya,Da,ra,xa){return y(Math.PI/2,Da,ra,xa)+(ya-Math.PI/2)};a.onSurfaceTiltToEyeTiltGlobal=y;a.panDistanceModifier=5;a.panMotionToRotationMatrix=function(ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea){if(N(ya.center,c.dot(ya.up,ya.center),c.length(ya.center),-b.cyclicalPI.normalize(q.deg2rad(Ga)),Pa,Da))switch(ya=-b.cyclicalPI.normalize(q.deg2rad(Ma)),{eye:Ma}=Da,d.coordinateSystemFromOneAxisAndNormalVector([0,0, 1],Ma,W,S,V),Ma=ra.translation[0]*xa.pan,Ga="zoom"===Ea.mode?0:ra.translation[1]*xa.pan,Da=Math.max(Math.sqrt(Math.abs(1-c.dot(Da.center,W)**2/c.length(Da.center)**2)),.5),Pa=-Math.cos(ya)*Ga+Math.sin(ya)*Ma,p.rotate(Qa.pan.matrix,Qa.pan.matrix,(Math.sin(ya)*Ga+Math.cos(ya)*Ma)/Da,W),Qa.pan.enabled=!0,Ea.mode){case "pan":p.rotate(Qa.pan.matrix,Qa.pan.matrix,Pa,S);Qa.pan.enabled=!0;break;case "zoom":Qa.zoom=-ra.translation[1]*xa.zoom}else{const {eye:ua,viewRight:Na}=Da;Da=c.cross(v.sv3d.get(),Na,ua); ya=ra.translation[0]*xa.pan;0!==ya&&(p.rotate(Qa.pan.matrix,Qa.pan.matrix,-ya,Da),Qa.pan.enabled=!0);switch(Ea.mode){case "pan":ra=ra.translation[1]*xa.pan;0!==ra&&(p.rotate(Qa.pan.matrix,Qa.pan.matrix,ra,Na),Qa.pan.enabled=!0);break;case "zoom":Qa.zoom=-ra.translation[1]*xa.zoom}}};a.panToPosition=function(ya,Da,ra,xa,Ma,Ga,Pa){N(ra,c.dot(Da.up,ra),ya[3],-b.cyclicalPI.normalize(q.deg2rad(Ma)),Ga,Da)?G(ya,Da,ra,xa,-b.cyclicalPI.normalize(q.deg2rad(Ma)),Ga,Pa):E(ya,Da,ra,xa,Ga,Pa)};a.pickPointAndInitSphere= function(ya,Da,ra,xa,Ma,Ga){const Pa=e.create(),Qa=w.create();let Ea=!0,ua=!0;ya.intersectScreen(ra,Pa,Ga)?Qa[3]=c.length(Pa):(ua=!1,Qa[3]=Da.aboveGround&&Ma!==a.SpherePickPointFallback.Ellipsoid?Math.max(c.length(Da.center),.9*xa.radius):c.length(Da.eye)-Da.relativeElevation,Ma===a.SpherePickPointFallback.Silhouette?z(Qa,Da,ra,Pa):Ea=r.intersectScreen(Qa,Da,ra,Pa));return{sphere:Qa,scenePickPoint:Ea?Pa:null,hasGeometryIntersection:ua}};a.pivotDistanceModifier=30;a.preserveHeadingThreshold=N;a.rotatePivotDistanceModifier= 5;a.rotatePivotMinDistanceModifier=10;a.rotatePointAroundTwoAxes=F;a.rotateScreenPixelArea=90;a.rotationAngleAndAxisDirectRotation=A;a.rotationAnglesAndAxesHeadingPreserving=D;a.rotationAnglesHeadingPreserving=C;a.screenPixelArea=80;a.sphereOrPlanePointFromScreenPoint=z;a.zoomDistanceModifier=8;a.zoomMaxDistanceModifier=1508E5;a.zoomMinDistanceModifier=200;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/axisAngle":function(){define("exports ../../core/libs/gl-matrix-2/math/quat ../../core/libs/gl-matrix-2/factories/quatf64 ../../chunks/vec32 ./vector ./vectorStacks".split(" "), function(a,b,q,l,p,k){function h(t=e){return[t[0],t[1],t[2],t[3]]}function f(t,w,v,m,r=h()){r[0]=t;r[1]=w;r[2]=v;r[3]=m;return r}function c(t,w){t[3]=w;return t}const e=[0,0,1,0],g=q.create(),d=q.create();a.angle=function(t){return t[3]};a.axis=function(t){return t};a.compose=function(t,w,v){b.setAxisAngle(g,t,t[3]);b.setAxisAngle(d,w,w[3]);b.multiply(g,d,g);return c(v,b.getAxisAngle(v,g))};a.copy=function(t,w=h()){return f(t[0],t[1],t[2],t[3],w)};a.create=h;a.fromAxisAndAngle=function(t,w){const v= h();l.copy(v,t);v[3]=w;return v};a.fromPoints=function(t,w,v){l.cross(v,t,w);l.normalize(v,v);v[3]=p.angle(t,w);return v};a.fromValues=f;a.setAngle=c;a.up=e;a.wrap=function(t,w,v,m){return f(t,w,v,m,k.sv4d.get())};a.wrapAxisAngle=function(t,w){return f(t[0],t[1],t[2],w,k.sv4d.get())};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/geometryUtils/ray":function(){define("exports ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../chunks/vec32 ../../../../geometry/support/ray ../../../../geometry/support/vectorStacks".split(" "), function(a,b,q,l,p,k){function h(e,g,d){return f(e,e.screenToRender(g,b.castRenderScreenPointArray3(k.sv3d.get())),d)}function f(e,g,d){const t=b.castRenderScreenPointArray3(q.copy(k.sv3d.get(),g));t[2]=0;if(!e.unprojectFromRenderScreen(t,d.origin))return null;g=b.castRenderScreenPointArray3(q.copy(k.sv3d.get(),g));g[2]=1;e=e.unprojectFromRenderScreen(g,k.sv3d.get());if(null==e)return null;l.subtract(d.direction,e,d.origin);return d}function c(e,g,d){l.copy(d.origin,e.eye);g=l.set(k.sv3d.get(),g[0], g[1],1);e=e.unprojectFromRenderScreen(g,k.sv3d.get());if(null==e)return null;l.subtract(d.direction,e,d.origin);return d}a.fromRender=f;a.fromRenderAtEye=c;a.fromScreen=h;a.fromScreenAtEye=function(e,g,d){return c(e,e.screenToRender(g,b.castRenderScreenPointArray3(k.sv3d.get())),d)};a.fromScreenNormalized=function(e,g,d=p.create()){h(e,b.screenPointObjectToArray(g),d);l.normalize(d.direction,d.direction);return d};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/geometryUtils/sphere":function(){define(["exports", "../../../../geometry/support/ray","../../../../chunks/sphere","./ray"],function(a,b,q,l){const p=b.create();a.intersectScreen=function(k,h,f,c){h=l.fromScreenAtEye(h,f,p);return q.intersectRay(k,h,c)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/ZoomStepControllerLocal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/time ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../layers/VoxelWasm ./PointToPointAnimationController ../utils/navigationUtils ../../webgl/RenderCamera ../../webgl-engine/lib/Intersector ../../../animation/easing".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){a.ZoomStepControllerLocal=class extends r.PointToPointAnimationController{constructor(){super(...arguments);this._zoomLocation=g.create();this._tmpCamera=new u;this._tmpRayDir=g.create();this._tmpCenter=g.create();this._beginCamera=new u;this._constraintOptions=new t.ConstraintOptions(w.ConstraintTypes.ALL,v.InteractionType.ZOOM,null,this._beginCamera)}zoomStep(C,D){if(this.active){var F=this.view.state;this.animation.finished?this._beginCamera.copyFrom(F.camera): this.animation.cameraAt(1,this._beginCamera);this._tmpCamera.copyFrom(F.camera);var H=x.newIntersector(this.view.state.viewingMode);F=!1;0=D&&NMath.abs(H-N)||(e.scale(this._tmpRayDir,this._tmpRayDir,D),C.eye=e.subtract(z, F,this._tmpRayDir),C.center=e.lerp(z,C.center,F,1-D),d.applyAll(this.view,C,this._constraintOptions)))}};a.ZoomStepControllerLocal=b.__decorate([c.subclass("esri.views.3d.state.controllers.ZoomStepControllerLocal")],a.ZoomStepControllerLocal);const z=g.create(),A=g.fromValues(0,0,1),B=g.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/VoxelWasm":function(){define(["require","exports"],function(a,b){let q,l=null;const p=new Map;b.addLayerViewToWasm=async function(k){null== l&&(null==q&&(q=new Promise((c,e)=>a(["../../../layers/VoxelWasmPerSceneView"],g=>c(Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"}))),e))),l=await q);const h=k.view;let f=p.get(h);f||(f=new l.default({view:h}),p.set(h,f));return f.addVoxelLayer(k)};b.getVoxelWasm=function(k){return p.get(k)};b.removeLayerViewFromWasm=function(k){const h=k.view,f=p.get(h);f&&1>f.removeVoxelLayer(k)&&(p.delete(h),0===p.size&&(l=q=null))};Object.defineProperty(b,Symbol.toStringTag, {value:"Module"})})},"esri/views/input/handlers/support":function(){define(["exports"],function(a){a.eventMatchesMousePointerAction=function(b,q){if("touch"===b.pointerType)return!1;switch(q){case "primary":return 0===b.button;case "secondary":return 2===b.button;case "tertiary":return 1===b.button}};a.eventMatchesPointerAction=function(b,q){switch(q){case "primary":return"touch"===b.pointerType||0===b.button;case "secondary":return"touch"!==b.pointerType&&2===b.button;case "tertiary":return"touch"!== b.pointerType&&1===b.button}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/DragRotate":function(){define(["exports","../../../../core/screenUtils","../../state/controllers/RotateController","../../../input/InputHandler","../../../input/handlers/support"],function(a,b,q,l,p){class k extends l.InputHandler{constructor(h,f,c,e){super(!0);this._view=h;this.pointerAction=f;this._pivot=c;this.registerIncoming("drag",e,g=>this._handleDrag(g))}_handleDrag(h){const f= h.data;if(!(1q.PivotPoint});a.DragRotate=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/RotateController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../camera/constraintUtils/TiltMode ../../layers/VoxelWasm ../Constraints ./InteractiveController ../utils/navigationUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){a.PivotPoint=void 0;(function(F){F[F.CENTER=0]="CENTER";F[F.EYE=1]="EYE"})(a.PivotPoint||(a.PivotPoint={}));a.RotateController=class extends A.InteractiveController{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(F){super(F);this.pivot=a.PivotPoint.CENTER;this._rotScale=0;this._lastPoint=t.create();this._tmpWorldUp=v.create();this._tmpViewDir=v.create();this._tmpRotCurPoint=t.create();this._tmpTransf=g.create(); this._tmpAxis=v.create();this._tmpPivotPoint=v.create();this._pivotPos=v.create();this._constraintOptions=new r.ConstraintOptions(n.ConstraintTypes.ALL,u.InteractionType.TUMBLE,0,this.startCamera)}initialize(){this._rotScale=this.pivot===a.PivotPoint.CENTER?3:1.5}begin(F){if(this.active){switch(this.pivot){case a.PivotPoint.EYE:w.copy(this._pivotPos,this.startCamera.eye);this._constraintOptions.interactionType=u.InteractionType.LOOK_AROUND;this._constraintOptions.tiltMode=x.TiltMode.LOOK_AROUND;this._constraintOptions.selection= n.ConstraintTypes.NONE;break;case a.PivotPoint.CENTER:const H=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,0===this.view.map.ground.opacity?B.contentIntersectorOptions:{});H||w.copy(this._pivotPos,this.startCamera.center);this._constrainPivotPoint(F,H);this.startCamera.center=this._pivotPos;this._constraintOptions.interactionType=u.InteractionType.TUMBLE;this._constraintOptions.tiltMode=x.TiltMode.TUMBLE;this._constraintOptions.selection=n.ConstraintTypes.ALL& ~n.ConstraintTypes.DISTANCE}B.normalizeCoordinate(this.startCamera,F,this._lastPoint)}}_constrainPivotPoint(F,H){const N=this.startCamera,E=v.create();w.subtract(E,this._pivotPos,N.eye);const G=w.length(E);var I=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(N.eye,D);I=Math.max(Math.min(B.rotatePivotDistanceModifier,1/Math.abs(w.dot(D,N.viewForward)))*I,B.rotatePivotMinDistanceModifier);H&&(I=Math.min(G,I));var O=l.createScreenPointArray(N.width/N.pixelRatio* .5,N.height/N.pixelRatio*.5);O=B.navigationMode(this.startCamera,O,this.view.renderCoordsHelper,this.view.viewingMode);let L=this.view._stage.renderView.getMinimalDepthForArea(y.getVoxelWasm(this.view),N.fullWidth/N.pixelRatio*.5,N.fullHeight/N.pixelRatio*.5,N,2.5*B.rotateScreenPixelArea,B.rotateScreenPixelArea);F=this.view._stage.renderView.getMinimalDepthForArea(y.getVoxelWasm(this.view),F[0],F[1],N,B.rotateScreenPixelArea);if(null!=L||null!=F)L=L??F??0,F=null==F||O===B.NavigationMode.Horizontal? L:F,I=L>F?F:L,I=H?Math.min(I,G):I;w.normalize(E,E);w.copy(this._pivotPos,w.add(this._tmpPivotPoint,N.eye,w.scale(this._tmpPivotPoint,E,I)))}update(F){if(this.active){switch(this.pivot){case a.PivotPoint.EYE:this.currentCamera.center=this._applyRotation(this.currentCamera,F,this.currentCamera.center,this._pivotPos);break;case a.PivotPoint.CENTER:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,F,this.currentCamera.eye,this._pivotPos)}m.applyAll(this.view, this.currentCamera,this._constraintOptions);this.commitCamera()}}end(){this.active&&this.finishController()}_applyRotation(F,H,N,E){this.view.renderCoordsHelper.worldUpAtPosition(E,this._tmpWorldUp);B.normalizeCoordinate(F,H,this._tmpRotCurPoint);H=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale;let G=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;w.subtract(this._tmpViewDir,N,E);N=w.length(this._tmpViewDir);N=q.acosClamped(w.dot(this._tmpViewDir,this._tmpWorldUp)/N);if(this.pivot=== a.PivotPoint.EYE){const I=.5*Math.PI-N,O=.495*Math.PI;H=I-Math.max(-O,Math.min(O,I+-.5*H))}H=q.clamp(H+N,z.TiltRange.min,z.TiltRange.max)-N;w.cross(this._tmpAxis,F.up,this._tmpViewDir);this.pivot===a.PivotPoint.CENTER&&(G=-G);e.fromRotation(this._tmpTransf,G,this._tmpWorldUp);e.rotate(this._tmpTransf,this._tmpTransf,H,this._tmpAxis);w.transformMat4(this._tmpViewDir,this._tmpViewDir,this._tmpTransf);F.up=w.transformMat4(C,F.up,this._tmpTransf);w.add(C,E,this._tmpViewDir);d.copy(this._lastPoint,this._tmpRotCurPoint); return C}};b.__decorate([p.property()],a.RotateController.prototype,"pivot",void 0);a.RotateController=b.__decorate([c.subclass("esri.views.3d.state.controllers.RotateController")],a.RotateController);const C=v.create(),D=v.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/InteractiveController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../ViewStateManager ./CameraController ../../webgl/RenderCamera".split(" "), function(a,b,q,l,p,k,h,f,c,e){a.InteractiveController=class extends c.CameraController{constructor(){super(...arguments);this.startCamera=new e;this.currentCamera=new e;this._lastInteraction=0}get isInteractive(){return performance.now()-this._lastInteractionthis.notifyChange("isInteractive"),f.interactingTimeout);this.view.state.updateCamera(g=>this.stepController(0,g));this.steppingFinished&&this.finishController()}};b.__decorate([q.property({readOnly:!0})],a.InteractiveController.prototype,"isInteractive",null);b.__decorate([q.property()],a.InteractiveController.prototype,"_lastInteraction",void 0);a.InteractiveController=b.__decorate([h.subclass("esri.views.3d.state.controllers.InteractiveController")],a.InteractiveController); Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/ViewStateManager":function(){define("exports ../../../chunks/tslib.es6 ../../../Camera ../../../Viewpoint ../../../core/Accessor ../../../core/Logger ../../../core/maybe ../../../core/reactiveUtils ../../../core/scheduling ../../../core/screenUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/Extent ../../../geometry/Point ../../../geometry/projection ../../ViewingMode ../camera/constraintUtils ../camera/intersectionUtils ./ConstraintsManager ./Frustum ./GoToOperation ./controllers/SurfaceCollisionCorrectionController ../support/cameraUtils ../support/PropertiesPool ../support/viewpointUtils ../webgl/RenderCamera ../webgl-engine/lib/rendererUtils ../webgl-engine/lib/RenderFeature ../../support/RenderState ../../webgl/FramebufferObject".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M){a.ViewStateManager=class extends p{constructor(T){super(T);this.ready=!1;this._windowDevicePixelRatio=1;this._devicePixelRatioOverride=null;this._idleTimeout=300;this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:Y=>this._devicePixelRatioOverride=Y,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!= this.renderState},get idleTimeoutEnabled(){return 0this.view.state.events,"before-camera-change",T=>T&&this._updateElevation(T)),f.watch(()=>this.view.state?.camera, (T,Y)=>this._cameraChangedHandler(T,Y),f.sync)]);f.when(()=>this.view.state?.camera,T=>this._updateElevation(T),{once:!0,sync:!0});this.addHandles([c.addFrameTask({prepare:()=>this._prepareFrame()}),f.watch(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0;this.removeHandles("pending-initial-view")}),f.on(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit();this._propertiesPool=h.destroyMaybe(this._propertiesPool)}get camera(){const T= this._get("camera");if(!this.ready)return T;const Y=N.internalToExternal(this.view,this.view.state.camera,W);return Y&&T&&Y.equals(T)?T:Y.clone()}set camera(T){this._updatePropertyBeforeReady("camera",T)||(this.view.elevationProvider?.enableCache(!0),this.setStateCamera(N.externalToInternal(this.view,T),{applyConstraints:!1})||k.getLogger(this).error("#camera\x3d","Invalid camera",T),this.view.elevationProvider?.enableCache(!1))}get contentCamera(){const T=this._get("contentCamera");if(!this.ready)return T; const Y=N.internalToExternal(this.view,this.view.state.contentCamera,W);return Y&&T&&Y.equals(T)?T:Y.clone()}set contentCamera(T){this._updatePropertyBeforeReady("contentCamera",T)||(T=N.externalToInternal(this.view,T),null==T?this.view.state.contentCamera=null:(this._updateElevation(T),this.view.state.contentCamera=T))}installContentCameraReset(T){this.removeHandles("content-camera-reset");this.test.contentCameraResetState.clear();if(!this.view.state.fixedContentCamera)return!1;const Y=this.zoom, ha=this.view.state.camera.distance**2,ba=m.fromArray(this.view.state.camera.center),U=T.sticky?this.contentCamera.clone():null;this.addHandles([f.watch(()=>this.contentCamera,()=>{T.sticky||(this.removeHandles("content-camera-reset"),this.test.contentCameraResetState.clear())}),f.watch(()=>this.zoom,Z=>{void 0!==Z&&void 0!==Y&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(Z-Y)/2),2 this.view.state.camera,Z=>{Z=v.squaredDistance(ba,Z.center);this.test.contentCameraResetState.set("camera.center",Z/ha);Z>ha?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=U)})],"content-camera-reset");return!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(T){this._updatePropertyBeforeReady("center",T)||(T?this.isCompatible(T)?this.setStateCamera(this._centerToCamera(T),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask(): k.getLogger(this).error("#center\x3d","Invalid center",T):k.getLogger(this).error("#center\x3d","Center has an incompatible spatial reference (center: "+(T.spatialReference?T.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",T):k.getLogger(this).error("#center\x3d","Center may not be null or undefined"))}get extent(){if(!this.ready)return this._get("extent");var T=this.view;T=N.toExtent(T,T.state.camera,T.pointsOfInterest.centerOnContent.renderLocation);return null!=T? T:this._get("extent")}set extent(T){this._updatePropertyBeforeReady("extent",T)||(T?this.isCompatible(T)?this.setStateCamera(this._extentToCamera(T),{applyConstraints:!0})||k.getLogger(this).error("#extent\x3d","Invalid extent",T):k.getLogger(this).error("#extent\x3d","Extent has an incompatible spatial reference (extent: "+(T.spatialReference?T.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",T):k.getLogger(this).error("#extent\x3d","Extent may not be null or undefined"))}get frustum(){const T= this._propertiesPool.get("frustum");T.renderCoordsHelper=this.view.renderCoordsHelper;T.update(this.view.state.camera);return T}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const T=this.view.map;return T&&"initialViewProperties"in T?T.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(this.ready){const T=this.view.pointsOfInterest.centerOnContent;return N.distanceToScale(this.view,T.distance,T.location.latitude)}return this._get("scale")}set scale(T){this._updatePropertyBeforeReady("scale", T)||this.setStateCamera(this._scaleToCamera(T),{applyConstraints:!0})||k.getLogger(this).error("#scale\x3d","Invalid scale",T)}get terrainScale(){if(!this.ready)return this._get("scale");var T=this.view;const Y=T.basemapTerrain.tilingScheme;var ha=T.pointsOfInterest.cameraOnSurface.scale;if(!Y||!ha)return this._get("scale");const ba=T.state.contentCamera;T=N.directionToHeadingTilt(T,ba.eye,ba.viewForward,ba.up).tilt;90ha?this._get("scale"): Y.scaleAtLevel(ha)}get padding(){if(!this.ready)return this._get("padding");var T=this.view.state.camera,Y=T.padding;const ha=T.pixelRatio;T=this._get("padding");const ba=Math.round(Y[O.PaddingSide.TOP]/ha),U=Math.round(Y[O.PaddingSide.RIGHT]/ha),Z=Math.round(Y[O.PaddingSide.BOTTOM]/ha);Y=Math.round(Y[O.PaddingSide.LEFT]/ha);return null!=T&&T.top===ba&&T.right===U&&T.bottom===Z&&T.left===Y?T:{top:ba,right:U,bottom:Z,left:Y}}set padding(T){this._updatePropertyBeforeReady("padding",T)||(this._paddingToArray(T, this.view.state.camera.pixelRatio,V),this.view.state.updateCamera(Y=>Y.padding=V))}_paddingToArray(T,Y,ha){T?r.set(ha,T.top||0,T.right||0,T.bottom||0,T.left||0):r.set(ha,0,0,0,0);for(T=0;4>T;T++)ha[T]=Math.round(ha[T]*Y)}get screenCenter(){const T=this.padding;return e.createScreenPoint((this.view.width-(T.left+T.right))/2+T.left,(this.view.height-(T.top+T.bottom))/2+T.top)}get viewpoint(){return this.ready?G.fromCamera(this.view,this.camera):this._get("viewpoint")}set viewpoint(T){if(!this._updatePropertyBeforeReady("viewpoint", T))if(T)if(this.isCompatible(T))this.setStateCamera(this._viewpointToCamera(T),{applyConstraints:!T.camera})||k.getLogger(this).error("#viewpoint\x3d","Invalid viewpoint",T);else{var Y=null!=T.camera?T.camera.position:T.targetGeometry;Y=null!=Y&&Y.spatialReference;k.getLogger(this).error("#viewpoint\x3d","Viewpoint has an incompatible spatial reference (viewpoint: "+(Y?Y.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",T)}else k.getLogger(this).error("#viewpoint\x3d","Viewpoint may not be null or undefined")}get zoom(){return this.ready? N.scaleToZoom(this.view,this.scale):this._get("zoom")}set zoom(T){this._updatePropertyBeforeReady("zoom",T)||void 0===T||this.setStateCamera(this._zoomToCamera(T),{applyConstraints:!0})||k.getLogger(this).error("#zoom\x3d","Invalid zoom",T)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight* this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;var T=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio);T=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:T)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*T);this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*T);const Y=this.view._stage.renderView.renderingContext?.parameters.maxTextureSize; Y&&M.ensureAttachmentMaxSize(this._tmpCanvasSize,Y);this._tmpCanvasSize.pixelRatio=0this.view.basemapTerrain.ready,()=>{this.removeHandles("pending-initial-view");this._setInitialView(this.view.dataExtent)}, {once:!0,initial:!0}),"pending-initial-view"))}exit(){this._cancelGoToOperation();this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles("pending-initial-view"),this._constraintsManager=h.destroyMaybe(this._constraintsManager))}async goTo(T,Y){Y={animate:!0,...Y};null!=this._gotoOperation&&this._gotoOperation.abort(Y.animate);this._gotoOperation=new F.GoToOperation(T,Y,this.view);this.view.resourceController.scheduler.stopFrame(); return this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(B.cameraOnContentAlongViewDirection(this.view),{applyConstraints:!1})}step(T){const Y=this.view.state,ha=Y?.cameraController;ha&&(Y.updateCamera(ba=>ha.stepController(T,ba)),ha.steppingFinished&&ha.finishController())}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const T=new Set,Y=[];for(const {propertyName:ha,overrides:ba}of R){const U= T.has(ha),Z=this._isOverridden(ha);!U&&Z&&Y.push({name:ha,value:this._get(ha)});this._clearOverride(ha);(U||Z)&&ba.forEach(ca=>T.add(ca))}return Y}_setInitialView(T){if(null!=T&&!this._cameraSetByUser)if(T instanceof q)this.setStateCamera(N.externalToInternal(this.view,T),{applyConstraints:!1});else if(T instanceof l)if(T.targetGeometry instanceof u){var Y=N.fromExtentSync(this.view,T.targetGeometry,0,.5,N.OrientationMode.LOCKED);null!=Y&&this.setStateCamera(N.externalToInternal(this.view,Y),{applyConstraints:!0})}else Y= {applyConstraints:!T.camera},T=this._viewpointToCamera(T),this.setStateCamera(T,Y);else Y=N.fromExtentSync(this.view,T,0,.5,N.OrientationMode.LOCKED),null!=Y&&this.setStateCamera(N.externalToInternal(this.view,Y),{applyConstraints:!0})}_updatePropertyBeforeReady(T,Y){if(this.ready)return!1;this._override(T,Y);Y&&J.has(T)&&this._override("hasInitialView",!0);return!0}isCompatible(T){return null==T?!1:T instanceof l?T.camera?this.isCompatible(T.camera):this.isCompatible(T.targetGeometry):T instanceof q?this.isCompatible(T.position):T.spatialReference&&!y.requiresLoad(T.spatialReference,this.view.spatialReference)}_getPreservingHeadingTilt(T=Q){this._cameraSetByUser?(T.heading=this.camera.heading,T.tilt=this.camera.tilt):(T.heading=0,T.tilt=.5);return T}_centerPointAtDistanceToCamera(T,Y,ha=S){const {heading:ba,tilt:U}=this._getPreservingHeadingTilt();T=N.getObserverForPointAtDistanceSync(this.view,ba,U,T,Y,N.OrientationMode.ADJUST);if(null==T)return null;ha.copyFrom(this.view.state.camera);ha.eye= T.eye;ha.center=T.center;ha.up=T.up;return ha}_centerToCamera(T){const Y=this.view.pointsOfInterest.centerOnContent;Y.runTask();return this._centerPointAtDistanceToCamera(T,Y.distance)}_extentToCamera(T){const {heading:Y,tilt:ha}=this._getPreservingHeadingTilt();return(T=N.fromExtentSync(this.view,T,Y,ha,N.OrientationMode.ADJUST,W))?N.externalToInternal(this.view,T):null}_scaleToCamera(T){if(null==T)return null;const Y=this.view.pointsOfInterest.centerOnContent;Y.runTask();const ha=Y.renderLocation; T=N.scaleToDistance(this.view,T,Y.location.latitude);return this._centerPointAtDistanceToCamera(ha,T)}_zoomToCamera(T){return this._scaleToCamera(N.zoomToScale(this.view,T))}_viewpointToCamera(T){return N.externalToInternal(this.view,G.toCameraSync(this.view,T))}setStateCamera(T,Y){if(null==T||!this.view.state.stopActiveCameraController())return!1;this._cameraSetByUser=!0;Y.doNotCancelGoToOperation||this._cancelGoToOperation();this.view.state.updateCamera(ha=>{Y.positionAndOrientationOnly?(ha.eye= T.eye,ha.center=T.center,ha.up=T.up,ha.fov=T.fov):ha.copyFrom(T);Y.applyConstraints&&A.applyAll(this.view,ha)});Y.applyConstraints||(this.view.state.cameraController=new H.SurfaceCollisionCorrectionController({view:this.view,desiredCamera:T}));return!0}_prepareFrame(){const {surface:T,canvas:Y}=this.view;if(T&&Y){this._windowDevicePixelRatio=window.devicePixelRatio;var ha=this._computeCanvasSize();if(0!==ha.width&&0!==ha.height){if(Y.width!==ha.width||Y.height!==ha.height)Y.width=ha.width,Y.height= ha.height;if(this.view.state){const ba=this.view.state.camera;if(ba.fullWidth!==ha.width||ba.fullHeight!==ha.height||ba.pixelRatio!==ha.pixelRatio)S.copyFrom(ba),S.pixelRatio!==ha.pixelRatio&&(this._paddingToArray(this.padding,ha.pixelRatio,V),S.padding=V),S.fullWidth=ha.width,S.fullHeight=ha.height,S.pixelRatio=ha.pixelRatio,this.view.state.camera=S;this._updateViewState()}}}}_updateElevation(T){var Y=this.view.basemapTerrain?.spatialReference;const ha=this.view.renderCoordsHelper?.getAltitude(T.eye)?? 0;Y=Y?B.surfaceElevationBelowRenderLocation(this.view,T.eye):0;T.relativeElevation=ha-Y}_updateViewState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=P.RenderState.ANIMATING:this.view.interacting?this.view.state.mode=P.RenderState.INTERACTING:(this.view.state.mode===P.RenderState.ANIMATING&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime[this.view.constraints?.clipDistance?.near,this.view.constraints?.clipDistance?.far],()=>this._clipDistanceNearFarChanged()),p.watch(()=>this.view.constraints?.clipDistance?.mode,()=>this._updateNearFar()),this.view.state.events.on("before-camera-change", u=>this._updateCameraNearFar(u)),p.watch(()=>this.view.renderDataExtent,()=>this._updateNearFar(),p.sync),p.watch(()=>[this.view.constraints?.altitude?.min,this.view.constraints?.altitude?.max],()=>this._updateAltitude(),p.sync),p.watch(()=>this.view.constraints?.tilt?.max,()=>this._updateTiltMax(),p.sync),p.watch(()=>this.view.constraints?.tilt?.mode,()=>this._updateTilt(),p.sync),p.watch(()=>this.view.state?.camera,()=>this._updateTiltAutoMax(),p.sync),p.watch(()=>[this.view.map?.ground?.navigationConstraint?.type, this.view.state?.constraints?.collision?.enabled],()=>this._updateCollision(),p.sync)]);this.view.state.isLocal&&this.addHandles(p.watch(()=>this.view.renderDataExtent,u=>this._updateLocalSurfaceDistance(u),p.initial));this._updateNearFar();this.view.state.viewingMode!==g.ViewingMode.Local&&this._updateAltitude();this._updateTilt();this._updateCollision();this._set("surfaceCollisionConstraint",new n.SurfaceCollisionConstraint({view:this.view}))}destroy(){this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(), this._set("surfaceCollisionConstraint",null))}_clipDistanceNearFarChanged(){const u=this.view.constraints?.clipDistance;u&&"auto"!==u.mode&&this.view.state.updateCamera(x=>{u&&(x.near=u.near,x.far=u.far)})}_updateNearFar(){this.view.state.updateCamera(u=>this._updateCameraNearFar(u))}_updateCameraNearFar(u){const x=this.view.constraints&&this.view.constraints.clipDistance;"manual"===(x?x.mode:"auto")?x&&(u.near=x.near,u.far=x.far):this._updateCameraNearFarAuto(u,x)}_updateCameraNearFarAuto(u,x){this.nearFarHeuristic.compute(u.eye, u.center,this.view.renderDataExtent,t.surfaceElevationBelowRenderLocation(this.view,u.eye),u);x&&x.autoUpdate(u.near,u.far)}_updateCollision(){var u=this.view.map?.ground?.navigationConstraint?.type;u=u?"stay-above"===u:!0;const x=this.view.state.constraints.collision;u!==x.enabled&&((x.enabled=u)&&this._reapplyConstraints(v.ConstraintTypes.COLLISION),(u=this.view.constraints&&this.view.constraints.tilt)&&"auto"!==u.mode||this._updateTiltAuto())}_updateAltitude(){const u=this.view.constraints&&this.view.constraints.altitude; this.view.state.constraints.altitude=u&&this.view.state.viewingMode!==g.ViewingMode.Local?{min:u.min,max:u.max}:null;this._reapplyConstraints()}_updateTiltMax(){const u=this.view.constraints&&this.view.constraints.tilt;u&&"auto"!==u.mode&&(this._updateTiltManual(u),this._reapplyConstraints())}_updateTilt(){const u=this.view.constraints&&this.view.constraints.tilt;"manual"===(u?u.mode:"auto")?this._updateTiltManual(u):this._updateTiltAuto();this._reapplyConstraints()}_updateTiltManual(u){const x=this.view.state.constraints; x.tilt=x.createConstantMaxTilt(l.deg2rad(u.max))}_updateTiltAuto(){const u=this.view.state.constraints;u.tilt=u.createDefaultTilt();this._updateTiltAutoMax()}_updateTiltAutoMax(){const u=this.view.constraints&&this.view.constraints.tilt;if(u&&"auto"===u.mode){var x=this.view.state.constraints;x.tilt&&(x=x.tilt(this.view.state.camera.distance).max,u.autoUpdate(l.rad2deg(x)))}}_updateLocalSurfaceDistance(u){if(null!=u){var x=Math.max(u.width,u.height);0>=x||(null!=u.zmax&&null!=u.zmin&&(x=Math.max(x, u.zmax-u.zmin)),u=this.view.state,x=3*x/Math.atan(u.camera.fov/2),x!==u.constraints.distance&&(u.constraints.distance=x))}}_reapplyConstraints(u=v.ConstraintTypes.ALL){this.view.state.updateCamera(x=>d.applyAll(this.view,x,new w.ConstraintOptions(u,m.InteractionType.NONE,null)))}};b.__decorate([k.property({constructOnly:!0})],a.ConstraintsManager.prototype,"view",void 0);b.__decorate([k.property({readOnly:!0})],a.ConstraintsManager.prototype,"surfaceCollisionConstraint",void 0);a.ConstraintsManager= b.__decorate([e.subclass("esri.views.3d.state.ConstraintsManager")],a.ConstraintsManager);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/NearFarHeuristic":function(){define("exports ../../../core/mathUtils ../../../core/unitUtils ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/Extent ../../ViewingMode ../environment/atmosphereUtils".split(" "),function(a,b,q,l,p,k,h,f,c){function e(v,m, r,n){r=2/r;v/m>r?(n.far=v,n.near=n.far/m):(n.near=r,n.far=n.near*m);return n}class g{constructor(v,m){this._elevationProvider=v;this._referenceEllipsoid=k.getReferenceEllipsoid(m);this._unitInMeters=q.getMetersPerUnitForSR(m,this._referenceEllipsoid.metersPerDegree)}compute(v,m,r,n,u){u||={near:0,far:0};var x=v[2]*this._unitInMeters,y=x;n=x-n;var z=this._elevationProvider?.visibleElevationBounds;z&&(x=0<=n?y-this._unitInMeters*z.min:this._unitInMeters*z.max-y);r=null!=r?r:new h({xmin:0,ymin:0,zmin:0, xmax:0,ymax:0,zmax:0});y=Math.max(r.xmax-r.xmin,r.ymax-r.ymin,4*Math.max(r.xmax-r.xmin,r.ymax-r.ymin));l.subtract(w,m,v);t[0]=0this._handleElevationChangeEvent(g)))}_handleElevationChangeEvent(g){if(!this.view.state.cameraController){var d=this.view.state.camera;null!=g.spatialReference&&c.eyeWithinExtent(this.view,d,g.extent,g.spatialReference)&&this._applyToCurrentCamera()}}_applyToCurrentCamera(){this.view.state.updateCamera(g=>e.applySurfaceCollisionConstraint(this.view, g,e.Mode.EYE_AND_CENTER))}};b.__decorate([l.property({constructOnly:!0})],a.SurfaceCollisionConstraint.prototype,"view",void 0);a.SurfaceCollisionConstraint=b.__decorate([f.subclass("esri.views.3d.state.SurfaceCollisionConstraint")],a.SurfaceCollisionConstraint);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/Frustum":function(){define(["exports","../../../chunks/vec32","../../../core/libs/gl-matrix-2/factories/vec3f64","../../../geometry/support/frustum"],function(a, b,q,l){function p(h,f,c){h.origin=f;h.endpoint=c;b.direction(h.direction,f,c)}class k{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(h){this.renderCoordsHelper=h;this.frustum=l.create();this._points=l.createPoints();this.lines=Array(12);this._origin=q.create();this._direction=q.create();this._altitude=null;for(h=0;12>h;h++)this.lines[h]={origin:null,direction:q.create(), endpoint:null}}update(h){l.fromMatrix(h.viewMatrix,h.projectionMatrix,this.frustum,this._points);b.copy(this._origin,h.eye);b.copy(this._direction,h.viewForward);this._altitude=this.renderCoordsHelper.getAltitude(this._origin);this._updateLines()}updatePoints(h){for(let f=0;ff;f++){const c=f+4;p(this.lines[f],h[f],h[c]);p(this.lines[f+4],h[f],3===f?h[0]:h[f+1]);p(this.lines[f+8],h[c],3===f?h[4]:h[c+1])}}}k.planePointIndices=l.planePointIndices;k.nearFarLineIndices=[[l.PointIndex.NEAR_BOTTOM_LEFT,l.PointIndex.FAR_BOTTOM_LEFT],[l.PointIndex.NEAR_BOTTOM_RIGHT,l.PointIndex.FAR_BOTTOM_RIGHT], [l.PointIndex.NEAR_TOP_RIGHT,l.PointIndex.FAR_TOP_RIGHT],[l.PointIndex.NEAR_TOP_LEFT,l.PointIndex.FAR_TOP_LEFT]];a.Frustum=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/GoToOperation":function(){define("exports ../../../Camera ../../../Viewpoint ../../../core/Error ../../../core/promiseUtils ../../../core/reactiveUtils ../camera/constraintUtils ../camera/constraintUtils/surfaceCollision ./controllers/CameraController ./controllers/PointToPointAnimationController ./controllers/SurfaceCollisionCorrectionController ../support/cameraUtils ../support/viewpointUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w{constructor(v,m,r){this._target=v;this._options=m;this.view=r;this.state="pending";this._animationController=null;this.promise=new Promise((n,u)=>{this._resolveCallback=n;this._rejectCallback=u;n=new AbortController;if(null!=this._options.signal)p.onAbort(this._options.signal,()=>{this.abort()});this._abortController=n;this._waitForReady()})}_resolve(v){if("finished"!==this.state)return this.state="finished",this._resolveCallback(v)}_reject(v){if("finished"!== this.state)return this.state="finished",this._rejectCallback(v)}abort(v=!1){this._abortController.abort();switch(this.state){case "wait-for-animation-finish":!v&&null!=this._animationController&&this.view.state.cameraController===this._animationController&&this._animationController.active&&this._animationController.stopController()}this._reject(p.createAbortError())}async _waitForReady(){this.state="wait-for-ready";if(!this.view.ready)try{await k.whenOnce(()=>this.view.ready,this._abortController.signal)}catch(v){return this._reject(v)}this._createViewPoint()}async _createViewPoint(){if("finished"!== this.state){this.state="wait-for-viewpoint";this._animationController=this._options.animate?this._getAnimationController():null;try{const m=await t.create(this.view,this._target,this._abortController.signal);if("finished"!==this.state){var v=m?this._getCameraFromViewpoint(m):null;null!=v&&(this._options.animate?null!=this._animationController&&this._startAnimation(v,this._animationController):(this.view.stateManager.setStateCamera(v.camera,{applyConstraints:!v.isFullySpecified,positionAndOrientationOnly:!0, doNotCancelGoToOperation:!0}),this._resolve()))}}catch(m){this._reject(m)}}}_getCameraFromViewpoint(v){const m=!!(this._target instanceof q&&this._target.camera||this._target instanceof b);var r=v.camera;if(null==r)return null;if(!this.view.stateManager.isCompatible(r))return v=(v=r.position)&&v.spatialReference,this._reject(new l("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${v?v.wkid:"none"}, view: ${this.view.spatialReference?.wkid})`, {camera:r})),null;r=d.externalToInternal(this.view,r);return null==r?(this._reject(new l("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:v,camera:r,isFullySpecified:m}}_startAnimation(v,m){this.state="wait-for-animation-finish";const r=m.viewAnimation;if(null==r)this._reject(new l("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));else{r.update(v.viewpoint,"running");if(!m.active||null==m.viewAnimation||m.viewAnimation.target!==v.viewpoint|| this.view.state.cameraController!==m)return this.abort();if(v.isFullySpecified){var n=new g.SurfaceCollisionCorrectionController({view:this.view,desiredCamera:v.camera});f.applySurfaceCollisionConstraint(this.view,v.camera,f.Mode.EYE_AND_CENTER)}else h.applyAll(this.view,v.camera);m.begin(v.camera,this._options);var u=x=>{if(null!=this.view.state)switch(m.state){case c.State.Finished:switch(this.state){case "pending":case "wait-for-ready":case "wait-for-viewpoint":case "wait-for-animation-finish":this._resolve()}break; case c.State.Ready:case c.State.Rejected:case c.State.Running:case c.State.Stopped:switch(this.state){case "pending":case "wait-for-ready":case "wait-for-viewpoint":case "wait-for-animation-finish":this._reject(x)}}};r.when(()=>{const x=this.view.state.cameraController;n&&(x&&x.active?x instanceof e.PointToPointAnimationController&&null!=x.viewAnimation&&x.viewAnimation.target===v.viewpoint&&(this.view.state.cameraController=n):null!=m.viewAnimation&&m.viewAnimation.target===v.viewpoint&&m.state=== c.State.Finished&&(this.view.state.cameraController=n))},x=>u(x));m.asyncResult={resolve:()=>u(),reject:x=>u(x)}}}_getAnimationController(){let v=null;var m=null;m=this.view.state.cameraController;m instanceof e.PointToPointAnimationController&&(m.updateStateFromViewAnimation(),m.active&&(v=m,m=v.viewAnimation));return null!=v||(v=new e.PointToPointAnimationController({view:this.view,mode:"animation"}),m=v.viewAnimation,this.view.state.switchCameraController(v))?v:(null!=m&&m.stop(),this._reject(new l("GotoAnimation:goto-cannot-interrupt", "Cannot start an animation while interacting")),null)}}a.GoToOperation=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/SurfaceCollisionCorrectionController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../camera/intersectionUtils ../../camera/constraintUtils/surfaceCollision ./CameraController".split(" "), function(a,b,q,l,p,k,h,f,c,e){a.SurfaceCollisionCorrectionController=class extends e.CameraController{set desiredCamera(g){this._set("desiredCamera",g.clone())}constructor(g){super(g)}get canStop(){return!0}get constraintEnabled(){return this.view.state.constraints.collision.enabled}onControllerStart(){this.state=e.State.Running;this.addHandles(this.view.basemapTerrain.on("elevation-change",g=>this._handleElevationChangeEvent(g)));this._applyCorrection()}onControllerEnd(){this.removeAllHandles()}stepController(){}_handleElevationChangeEvent(g){(null== g.spatialReference||f.eyeWithinExtent(this.view,this.desiredCamera,g.extent,g.spatialReference))&&this._applyCorrection()}_applyCorrection(){this.view.state.updateCamera(g=>{g.copyViewFrom(this.desiredCamera);c.applySurfaceCollisionConstraint(this.view,g,c.Mode.EYE_AND_CENTER)||this.constraintEnabled||(this.state=e.State.Stopped)})}};b.__decorate([q.property({constructOnly:!0})],a.SurfaceCollisionCorrectionController.prototype,"desiredCamera",null);a.SurfaceCollisionCorrectionController=b.__decorate([h.subclass("esri.views.3d.state.controllers.SurfaceCollisionCorrectionController")], a.SurfaceCollisionCorrectionController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/viewpointUtils":function(){define("exports ../../../Camera ../../../geometry ../../../Graphic ../../../Viewpoint ../../../core/asyncUtils ../../../core/has ../../../core/Cyclical ../../../core/Error ../../../core/promiseUtils ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection ../../../geometry/projection/computeTranslationToOriginAndRotation ../../../geometry/projection/projectPointToVector ../../../geometry/projection/projectVectorToPoint ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/frustum ../../../geometry/support/scaleUtils ../camera/intersectionUtils ./cameraUtils ./ElevationProvider ../../../geometry/Point ../../../geometry/Extent ../../../geometry/SpatialReference ../../../geometry/Geometry ../../../geometry/Multipoint".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I){async function O(ra,xa,Ma,Ga){var Pa=xa.camera;if(null!=Pa)return L(Pa,D.getViewSR(ra),Ga);({targetGeometry:Pa}=xa);if(null==Pa)throw Error("Viewpoint has no targetGeometry!");const {camera:Qa,mode:Ea}=P(ra,xa.rotation,Ma);if("point"===Pa.type)return M(ra,xa,Pa,Qa,Ea,Ga);xa=Pa.extent;if(null==xa)throw Error("Target geometry has no extent!");return D.fromExtentAsync(ra,xa,Qa.heading,Qa.tilt,Ea,Ga)}async function L(ra,xa,Ma){xa= await m.projectWithZConversion(ra.position,xa,{signal:Ma});e.throwIfAborted(Ma);ra=ra.clone();ra.position=xa.clone();return ra}function P(ra,xa,Ma){ra=D.internalToExternal(ra,ra.state.camera);let Ga=D.OrientationMode.ADJUST;null!=xa&&(ra.heading=360-f.cyclicalDegrees.normalize(xa),Ga=D.OrientationMode.LOCKED);null!=Ma&&(ra.tilt=Ma);return{camera:ra,mode:Ga}}async function M(ra,xa,Ma,Ga,Pa,Qa){const Ea=ra.spatialReference;Ma=await m.projectWithZConversion(Ma.clone(),Ea,{signal:Qa});e.throwIfAborted(Qa); xa=null!=xa.scale?D.scaleToDistance(ra,xa.scale,Ma.latitude):ra.state.camera.distance;return D.fromCenterDistanceAsync(ra,Ma,xa,Ga,Pa,Qa)}function K(ra,xa){return null==xa.scale&&null!=xa.zoom?D.zoomToScale(ra,xa.zoom):xa.scale}function J(ra,xa){let Ma=!1;null!=xa.heading?(ra.heading=xa.heading,Ma=!0):null!=xa.rotation&&(ra.heading=360-f.cyclicalDegrees.normalize(xa.rotation),Ma=!0);null!=xa.tilt&&(ra.tilt=xa.tilt,Ma=!0);null!=xa.fov&&(ra.fov=xa.fov);return Ma}function R(ra,xa,Ma,Ga){var Pa=ra.spatialReference|| E.WGS84;xa??=D.externalToInternal(ra,Ma);if(null==xa)return Ga;Pa=new H({spatialReference:Pa});if(!u.projectVectorToPoint(xa.center,ra.renderSpatialReference,Pa))return Ga;Ga.targetGeometry=Pa;({latitude:Pa}=Pa);Ga.scale=null!=Pa?D.distanceToScale(ra,xa.distance,Pa):D.computeScale(ra,xa);Ga.rotation=f.cyclicalDegrees.normalize(360-Ma.heading);Ga.camera=Ma;return Ga}async function Q(ra,xa,Ma,Ga){const Pa=()=>new c("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!xa)throw Pa(); "mesh"===xa.type&&(xa=xa.extent);const Qa=ra.basemapTerrain.spatialReference;if(!xa.hasZ&&ra.basemapTerrain){let ua;switch(xa.type){case "point":ua=xa;break;case "multipoint":case "polyline":ua=xa.extent?.center;break;case "extent":ua=xa.center;break;case "polygon":ua=xa.centroid}null!=ua&&Qa&&ra.elevationProvider?(ua=await m.projectWithZConversion(ua,Qa,{signal:Ga}),ia[2]=F.getElevationAtPoint(ra.elevationProvider,ua)??0):ia[2]=0}const Ea=[];(0,Da[xa.type])(xa,xa.hasZ?ua=>{Ea.push([ua[0],ua[1],ua[2]])}: ua=>{Ea.push([ua[0],ua[1]])},ia);if(0===Ea.length)throw Pa();ra=ra.spatialReference;Ga=await m.projectWithZConversion(new I({spatialReference:xa.spatialReference,hasZ:xa.hasZ,hasM:!1,points:Ea}),ra,{signal:Ga});xa.hasZ&&(Ma.hasZ=!0);if(xa.hasZ)for(const [ua,Na,Ua]of Ga.points)ia[0]=ua,ia[1]=Na,ia[2]=Ua,y.expandWithVec3(Ma.boundingBox,ia);else for(const [ua,Na]of Ga.points)ia[0]=ua,ia[1]=Na,y.expandWithVec3(Ma.boundingBox,ia)}async function W(ra,xa,Ma,Ga,Pa){const Qa=await k.result(ra.whenViewForGraphic(xa)); if(!1!==Qa.ok&&null!=Qa.value&&"whenGraphicBounds"in Qa.value)if(Ma=await k.result(Qa.value.whenGraphicBounds(xa,{minDemResolution:Ma})),!1!==Ma.ok&&Ma.value){var {screenSpaceObjects:Ea,boundingBox:ua}=Ma.value;y.expandWithAABB(Ga.boundingBox,ua);Ea&&Ea.forEach(Na=>{Ga.screenSpaceObjects.push(Na)});isFinite(ua[2])&&(Ga.hasZ=!0)}else await Q(ra,xa.geometry,Ga,Pa);else await Q(ra,xa.geometry,Ga,Pa)}async function S(ra,xa,Ma,Ga,Pa){if(Array.isArray(xa)&&2===xa.length){const Qa=xa[0],Ea=xa[1];if("number"=== typeof Qa&&"number"===typeof Ea){ya.x=Qa;ya.y=Ea;ya.z=void 0;ya.spatialReference=ra.spatialReference?.isGeographic?ra.spatialReference:E.WGS84;await Q(ra,ya,Ga,Pa);return}}xa&&"map"in xa&&"function"===typeof xa.map?await Promise.allSettled(xa.map(Qa=>S(ra,Qa,Ma,Ga,Pa))):xa instanceof G?await Q(ra,xa,Ga,Pa):xa instanceof l&&await W(ra,xa,Ma,Ga,Pa)}async function V(ra,xa,Ma,Ga,Pa){if(xa.camera)return T(ra,xa.camera,Ga,Pa);Pa.scale=xa.scale;Pa.rotation=xa.rotation;Pa.targetGeometry=null!=xa.targetGeometry? xa.targetGeometry.clone():null;Pa.camera=null;null!=Ma.heading?Pa.rotation=f.cyclicalDegrees.normalize(360-Ma.heading):null!=Ma.rotation&&(Pa.rotation=Ma.rotation);xa=K(ra,Ma);null!=xa&&(Pa.scale=xa);Pa.camera=await O(ra,Pa,Ma.tilt,Ga);return Pa}async function T(ra,xa,Ma,Ga){Ma=await m.projectWithZConversion(xa.position,ra.spatialReference,{signal:Ma});xa=xa.clone();xa.position=Ma;return R(ra,null,xa,Ga)}async function Y(ra,xa,Ma,Ga,Pa,Qa,Ea){const ua=ra.renderSpatialReference;await n.projectPointToVectorAsync(xa, va,ua,0,{signal:Ea});await n.projectPointToVectorAsync(Ma,na,ua,0,{signal:Ea});Qa.targetGeometry=new H(xa);Pa.position=new H(Ma);w.subtract(la,va,na);D.directionToHeadingTilt(ra,na,la,Ga.up,Pa);Qa.scale=D.distanceToScale(ra,w.distance(na,va),Qa.targetGeometry.latitude);Qa.rotation=f.cyclicalDegrees.normalize(360-Pa.heading);Qa.camera=Pa;return Qa}async function ha(ra,xa,Ma,Ga,Pa,Qa){Qa.targetGeometry=Ma.clone();const Ea=C.cameraOnContentAlongViewDirection(ra);if(xa.position)return Y(ra,Qa.targetGeometry, xa.position,Ea,Ga,Qa,Pa);if(xa.zoomFactor){var ua=Ea.distance/xa.zoomFactor;const Na=w.scale(ia,Ea.viewForward,-ua);Ea.eye=w.add(ia,Ea.center,Na);Qa.scale=D.distanceToScale(ra,ua,Ma.latitude)}D.internalToExternal(ra,Ea,Ga);ua=J(Ga,xa)?D.OrientationMode.LOCKED:D.OrientationMode.ADJUST;xa.zoomFactor||(xa=K(ra,xa),null==xa?(await n.projectPointToVectorAsync(Ma,ia,ra.renderSpatialReference,0,{signal:Pa}),A.intersectsPoint(Ea.frustum,ia)?Qa.scale=D.distanceToScale(ra,w.distance(Ea.eye,ia),Ma.latitude): Qa.scale=D.computeScale(ra,Ea)):Qa.scale=xa,Qa.camera=await D.fromCenterScale(ra,Qa.targetGeometry,Qa.scale,Ga,ua,Pa));return Qa}async function ba(ra,xa,Ma,Ga,Pa){var Qa=C.cameraOnContentAlongViewDirection(ra);w.copy(la,Qa.viewForward);D.directionToHeadingTilt(ra,Qa.eye,la,Qa.up,za);Qa=ra.spatialReference;const {position:Ea}=xa;Ea?(Pa=await m.projectWithZConversion(Ea,Qa,{signal:Pa}),Ma.position=Pa):Ma.position=new H;Ma.heading=null!=xa.heading?xa.heading:za.heading;Ma.tilt=null!=xa.tilt?xa.tilt: za.tilt;return R(ra,null,Ma,Ga)}async function U(ra,xa,Ma,Ga,Pa){if(null!=xa.heading||null!=xa.rotation||null!=xa.scale||null!=xa.tilt||null!=xa.zoom||null!=xa.zoomFactor){const Qa=C.cameraOnContentAlongViewDirection(ra),{spatialReference:Ea,renderSpatialReference:ua}=ra,Na=new H({spatialReference:Ea});return u.projectVectorToPoint(Qa.center,ua,Na)?ha(ra,xa,Na,Ma,Ga,Pa):Pa}Pa.scale=ra.scale;Pa.camera=ra.camera.clone();J(Pa.camera,xa);return Pa}async function Z(ra,xa,Ma,Ga,Pa,Qa){Qa.targetGeometry= Ma.clone();const Ea=C.cameraOnContentAlongViewDirection(ra);D.internalToExternal(ra,Ea,Ga);xa=J(Ga,xa)?D.OrientationMode.LOCKED:D.OrientationMode.ADJUST;Qa.camera=await D.fromExtentAsync(ra,Ma,Ga.heading,Ga.tilt,xa,Pa);return Qa}async function ca(ra,xa,Ma,Ga,Pa,Qa,Ea,ua){ua.targetGeometry=Ma.clone();const Na=C.cameraOnContentAlongViewDirection(ra);var Ua=0;null!=Ma.z?Ua=Ma.z:ra.basemapTerrain&&ra.elevationProvider&&(Ua=F.getElevationAtPoint(ra.elevationProvider,Ma));w.set(ia,Ma.x,Ma.y,Ua);r.computeTranslationToOriginAndRotation(ra.spatialReference, ia,ka,ra.renderSpatialReference);g.fromMat4(fa,ka);g.transpose(fa,fa);y.empty(X);Ma=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(var wa=0;waq(l,p))}}a.NestedMap=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/DragZoom":function(){define("exports ../../../../core/screenUtils ../../state/controllers/ZoomControllerGlobal ../../state/controllers/ZoomControllerLocal ../../../input/InputHandler ../../../input/handlers/support".split(" "), function(a,b,q,l,p,k){class h extends p.InputHandler{constructor(f,c,e){super(!0);this._view=f;this.pointerAction=c;this.registerIncoming("drag",e,g=>this._handleDrag(g))}_handleDrag(f){const c=f.data;if(!(1N&&EMath.abs(H-E))return;this._hasPickPoint&&EF&&EMath.abs(H-E))return;d.scale(this._tmpRayDir,this._tmpRay.direction,1-E/H);this.currentCamera.eye=d.add(C,this.currentCamera.eye,this._tmpRayDir);this.currentCamera.center=d.add(C,this.currentCamera.center,this._tmpRayDir)}y.applySurfaceCollisionConstraint(this.view,this.currentCamera);this.commitCamera()}}end(){this.active&&this.finishController()}};a.ZoomControllerGlobal=b.__decorate([c.subclass("esri.views.3d.state.controllers.ZoomControllerGlobal")], a.ZoomControllerGlobal);const C=t.create(),D=t.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/ZoomControllerLocal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/plane ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../layers/VoxelWasm ./InteractiveController ../utils/navigationUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){a.ZoomControllerLocal=class extends x.InteractiveController{constructor(){super(...arguments);this._tmpP=t.create();this._tmpDir=t.create();this._tmpN=t.create();this._tmpP0=g.create();this._tmpPoi=t.create();this._tmpRayDir=t.create();this.dragBeginPoint=l.createScreenPointArray();this._normalizedAnchorPoint=g.create();this._constraintOptions=new m.ConstraintOptions(r.ConstraintTypes.ALL,n.InteractionType.ZOOM,0,this.startCamera,t.create());this._plane= w.create()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(B){if(this.active){e.copy(this.dragBeginPoint,B);y.normalizeCoordinate(this.startCamera,B,this._normalizedAnchorPoint);var C=this._intersectionHelper.intersectScreenFreePointFallback(B,this._tmpP,0===this.view.map.ground.opacity?y.contentIntersectorOptions:{});d.subtract(this._tmpDir,this._tmpP,this.startCamera.eye);var D=d.length(this._tmpDir);d.normalize(this._tmpDir,this._tmpDir);var F=Math.abs(this.view.camera.position.z); F=q.clamp(Math.min(y.pivotDistanceModifier,1/Math.abs(d.dot(A,this._tmpDir)))*F,y.distanceClampValues[0],y.distanceClampValues[1]);B=this.view._stage.renderView.getMinimalDepthForArea(u.getVoxelWasm(this.view),B[0],B[1],this.view.state.camera,y.screenPixelArea);F=null!=B?B:F;F=C?Math.min(F,D):F;d.scale(this._tmpDir,this._tmpDir,F);d.add(this._tmpP,this.startCamera.eye,this._tmpDir);d.subtract(this._tmpN,this.startCamera.eye,this.startCamera.center);d.normalize(this._tmpN,this._tmpN);0>this._tmpN[1]&& d.negate(this._tmpN,this._tmpN);w.fromPositionAndNormal(this._tmpP,this._tmpN,this._plane)}}update(B){if(this.active){y.intersectPlaneFromScreenPoint(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||d.copy(this._tmpPoi,this.currentCamera.center);y.normalizeCoordinate(this.currentCamera,B,this._tmpP0);var C=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e.copy(this._normalizedAnchorPoint,this._tmpP0);d.subtract(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);var D=d.length(this._tmpRayDir), F=D*(1-C);this._constraintOptions.interactionDirection&&(d.copy(this._constraintOptions.interactionDirection,this._tmpRayDir),d.scale(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(C)/D));var H=this.view.state.constraints.minimumPoiDistance;0<=C&&FMath.abs(D-F)||(d.scale(this._tmpRayDir,this._tmpRayDir,C),this.currentCamera.eye=d.add(z,this.currentCamera.eye,this._tmpRayDir),d.lerp(z,this.currentCamera.center,this._tmpPoi, C),z[2]=this._tmpPoi[2]>this.startCamera.center[2]?Math.max(this.startCamera.center[2],z[2]):Math.min(this.startCamera.center[2],z[2]),this.currentCamera.center=z,this._constraintOptions.interactionFactor=v.pixelDistanceToInteractionFactor(e.distance(this.dragBeginPoint,B)),v.applyAll(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}}end(){this.active&&this.finishController()}};a.ZoomControllerLocal=b.__decorate([c.subclass("esri.views.3d.state.controllers.ZoomControllerLocal")], a.ZoomControllerLocal);const z=t.create(),A=t.fromValues(0,0,1);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/GamepadNavigation":function(){define(["exports","../../../../core/Handles","../../../../core/reactiveUtils","../../state/controllers/GamepadKeyboardController","../../../input/InputHandler"],function(a,b,q,l,p){class k extends p.InputHandler{constructor(h){super(!0);this._view=h;this._watchHandles=new b;this._handle=this.registerIncoming("gamepad", f=>this._handleEventGamepad(f));this._handle.pause()}onInstall(h){super.onInstall(h);this._watchHandles.add([q.watch(()=>this._view.navigation.gamepad.enabled,f=>{f?this._handle.resume():(this._handle.pause(),this._cameraControllerGamepad&&(this._cameraControllerGamepad.finishController(),this._cameraControllerGamepad=null))},q.initial),q.watch(()=>this._view.navigation.gamepad.device,f=>{this._cameraControllerGamepad&&f&&this._cameraControllerGamepad.gamepadDevice!==f&&(this._cameraControllerGamepad.finishController(), this._cameraControllerGamepad=null)})])}onUninstall(){this._watchHandles.removeAll();super.onUninstall()}_handleEventGamepad(h){var f=this._view.navigation.gamepad.device;if(!f||h.data.device===f)if((f=this._cameraControllerGamepad?.active)||l.GamepadKeyboardController.activatesFor(this._view,h.data))f||(f=new l.GamepadKeyboardController({view:this._view,gamepadDevice:h.data.device}),this._view.state.switchCameraController(f)&&(this._cameraControllerGamepad=f)),this._cameraControllerGamepad&&this._cameraControllerGamepad.active&& this._cameraControllerGamepad.gamepadDevice===h.data.device&&this._cameraControllerGamepad.handleEventGamepad(h.data)}}a.GamepadNavigation=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/GamepadKeyboardController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/compilerUtils ../../../../core/mathUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/support/ray ../../../../chunks/sphere ../../../../geometry/support/vector ../../../../geometry/support/vectorStacks ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../camera/constraintUtils/TiltMode ../Constraints ./InteractiveController ../utils/navigationUtils ../utils/viewUtils ../../support/cameraUtils ../../support/cameraUtilsInternal ../../webgl/RenderCamera ../../../navigation/gamepadAndKeyboardUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E){a.GamepadKeyboardController=class extends B.InteractiveController{constructor(R){super(R);this._filteredSurfaceElevation=0;this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0};this._keysButtonState=[0,0,0,0,0,0,0,0,0,0,0,0];this._tmpCamera=new N;this._headingStart=0;this._constraintOptions=new u.ConstraintOptions(x.ConstraintTypes.ALL,y.InteractionType.NONE,0,new N,null,z.TiltMode.LOOK_AROUND)}handleEventGamepad(R){const Q= E.extractTransformation(R,this.view.navigation.gamepad,this._transformation);("end"===R.action||E.isZeroTransformation(Q))&&this.finishController()}activateDirection(R){this._keysButtonState[R]=1;E.extractTransformationKeyboard(this._keysButtonState,this._transformation)}deactivateDirection(R){this._keysButtonState[R]=0;R=E.extractTransformationKeyboard(this._keysButtonState,this._transformation);E.isZeroTransformation(R)&&this.finishController()}onControllerStart(R){this._filteredSurfaceElevation= this.view.pointsOfInterest.cameraOnSurface.location.z;this._headingStart=this.view.camera.heading;super.onControllerStart(R)}_updateFilteredSurfaceElevation(R){this._filteredSurfaceElevation+=(this.view.pointsOfInterest.cameraOnSurface.location.z-this._filteredSurfaceElevation)*R}stepController(R,Q){this._updateStartHeading();this._updateFilteredSurfaceElevation(R);this.currentCamera.copyViewFrom(Q);this._updateCameraCenter();this._constraintOptions.interactionStartCamera?.copyFrom(this.currentCamera); this._calculateControlTransformation(R,this.currentCamera,P);this._applyDisabledMovementTypes(P);this._applyPan(P.pan);this._applyRotate(P.rotate);this._applyZoom(P.zoom);this._applyAscend(P.ascend);this._constraintOptions.interactionType=y.InteractionType.NONE;this._constraintOptions.selection=x.ConstraintTypes.COLLISION;n.applyAll(this.view,this.currentCamera,this._constraintOptions);super.stepController(R,Q)}_updateStartHeading(){0!==this._transformation.heading&&(this._headingStart=this.view.camera.heading)}_applyRotate(R){if(R.enabled){var Q= this.currentCamera;g.subtract(M,Q.center,Q.eye);g.transformMat4(M,M,R.matrix);Q.center=g.add(M,M,Q.eye);Q.up=g.transformMat4(M,Q.up,R.matrix);this._constraintOptions.interactionType=y.InteractionType.LOOK_AROUND;this._constraintOptions.selection=x.ConstraintTypes.ALL_EXCEPT_COLLISION;n.applyAll(this.view,Q,this._constraintOptions)}}_applyPan(R,Q=this.currentCamera){R.enabled&&(Q.eye=g.transformMat4(M,Q.eye,R.matrix),Q.center=g.transformMat4(M,Q.center,R.matrix),this.view.state.isGlobal&&(Q.up=g.transformMat4(M, Q.up,R.matrix)),this._constraintOptions.interactionType=y.InteractionType.PAN,this._constraintOptions.selection=x.ConstraintTypes.ALL,n.applyAll(this.view,Q,this._constraintOptions))}_applyZoom(R){if(R){var Q=this.currentCamera.viewForward;this.currentCamera.eye=g.add(M,this.currentCamera.eye,g.scale(r.sv3d.get(),Q,R));g.copy(K,Q);g.negate(K,K);this._constraintOptions.interactionDirection=K;this._constraintOptions.interactionType=y.InteractionType.ZOOM;this._constraintOptions.selection=x.ConstraintTypes.ALL_EXCEPT_COLLISION; n.applyAll(this.view,this.currentCamera,this._constraintOptions);this._constraintOptions.interactionDirection=null}}_applyAscend(R){if(R){var Q=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,r.sv3d.get());this._constraintOptions.interactionDirection=g.copy(K,Q);this.view.state.isGlobal?(Q=g.length(this.currentCamera.eye),R=(Q+R)/Q,this.currentCamera.eye=g.scale(M,this.currentCamera.eye,R),this.currentCamera.center=g.scale(M,this.currentCamera.center,R)):(R=g.scale(r.sv3d.get(), Q,R),this.currentCamera.eye=g.add(M,this.currentCamera.eye,R),this.currentCamera.center=g.add(M,this.currentCamera.center,R));this._updateCameraCenter();this._constraintOptions.interactionType=y.InteractionType.ASCEND;this._constraintOptions.selection=x.ConstraintTypes.COLLISION;n.applyAll(this.view,this.currentCamera,this._constraintOptions)&&this._updateCameraCenter();this._constraintOptions.selection=x.ConstraintTypes.ALL_EXCEPT_COLLISION;n.applyAll(this.view,this.currentCamera,this._constraintOptions); this._constraintOptions.interactionDirection=null}}_calculateControlTransformation(R,Q,W){W.zoom=0;W.ascend=0;W.pan.enabled=!1;c.identity(W.pan.matrix);W.rotate.enabled=!1;c.identity(W.rotate.matrix);R=this._computeVelocities(R);this.view.state.isLocal?this._calculateControlTransformationLocal(R,Q,W):this._calculateControlTransformationGlobal(R,Q,W)}_updateCameraCenter(){this.currentCamera.center=this.view.renderCoordsHelper.intersectManifoldClosestSilhouette(this.currentCamera.ray,this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude, M)}_calculateControlTransformationLocal(R,Q,W){const {viewRight:S,viewForward:V}=Q,T=this._transformation;var Y=this.view.navigation.gamepad,ha=g.set(r.sv3d.get(),V[0],V[1],0);g.normalize(ha,ha);var ba=T.translation[0]*R.pan;0!==ba&&(ba=g.scale(r.sv3d.get(),S,ba),c.translate(W.pan.matrix,W.pan.matrix,ba),W.pan.enabled=!0);switch(Y.mode){case "pan":Y=-T.translation[1]*R.pan;0!==Y&&(ha=g.scale(r.sv3d.get(),ha,Y),c.translate(W.pan.matrix,W.pan.matrix,ha),W.pan.enabled=!0);W.zoom=T.zoom*R.zoom;break; case "zoom":W.zoom=(-T.translation[1]+T.zoom)*R.zoom;break;default:q.neverReached(Y.mode)}W.ascend=T.translation[2]*R.ascend;ha=-T.heading*R.rotate;0!==ha&&(c.rotate(W.rotate.matrix,W.rotate.matrix,ha,this.view.renderCoordsHelper.worldUpAtPosition(Q.eye,r.sv3d.get())),W.rotate.enabled=!0);R=T.tilt*R.rotate;Q=D.viewAngle(this.view.renderCoordsHelper,Q.center,Q.eye);if(Q=l.clamp(Q+R,A.TiltRange.min,A.TiltRange.max)-Q)c.rotate(W.rotate.matrix,W.rotate.matrix,Q,S),W.rotate.enabled=!0}_calculateControlTransformationGlobal(R, Q,W){const {eye:S,viewRight:V}=Q,T=this._transformation;var Y=this.view.navigation.gamepad,ha=g.cross(r.sv3d.get(),V,S);g.normalize(ha,ha);g.negate(ha,ha);C.panMotionToRotationMatrix(this.startCamera,Q,T,R,this.view.camera.heading,this._headingStart,this.view.camera.tilt,W,Y);this._tmpCamera.copyFrom(this.currentCamera);this._applyPan(P.pan,this._tmpCamera);Y=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude;W.ascend=T.translation[2]*R.ascend;ha=-T.heading*R.rotate;0!==ha&& (c.rotate(W.rotate.matrix,W.rotate.matrix,ha,this._tmpCamera.eye),W.rotate.enabled=!0);Q=this._clampTiltDeltaGlobalToValidRange(T.tilt*R.rotate,Q.ray,Y);0!==Q&&(c.rotate(W.rotate.matrix,W.rotate.matrix,Q,this._tmpCamera.viewRight),W.rotate.enabled=!0);W.zoom+=T.zoom*R.zoom}_clampTiltDeltaGlobalToValidRange(R,Q,W){const S=t.getReferenceEllipsoid(this.view.spatialReference),V=C.onSurfaceTiltToEyeTiltGlobal(A.TiltRange.min,Q.origin,W,S);var T=0;let Y=0;T=r.sv3d.get();this.view.renderCoordsHelper.intersectManifold(Q, W,T)?(T=D.viewAngle(this.view.renderCoordsHelper,T,Q.origin),T=C.onSurfaceTiltToEyeTiltGlobal(T,Q.origin,W,S),Y=C.onSurfaceTiltToEyeTiltGlobal(A.TiltRange.max,Q.origin,W,S)):(v.closestPointOnSilhouette(v.fromRadius(v.tmpSphere,W+S.radius),Q,T),T=Math.PI+m.angle(Q.direction,T),T=C.offSurfaceTiltToEyeTiltGlobal(T,Q.origin,W,S),Y=C.offSurfaceTiltToEyeTiltGlobal(A.TiltRange.max,Q.origin,W,S));return l.clamp(T+R,V,Y)-T}_getPointAbsoluteSurfaceElevation(R,Q,W){const {renderCoordsHelper:S}=this.view,V=S.getAltitude(R); Q+=Math.abs(V-Q);S.setAltitude(W,Q,R);return Q}_clampedDistanceToSurface(R,Q){const {renderCoordsHelper:W}=this.view,{camera:S}=this.view.state;var {direction:V}=F.headingTiltToDirectionUp(this.view,Q,0,80,J);V=W.intersectManifoldClosestSilhouette(w.wrap(Q,V),R,r.sv3d.get());V=g.distance(Q,V);R=W.intersectManifoldClosestSilhouette(w.wrap(Q,g.direction(r.sv3d.get(),Q,S.center)),R,r.sv3d.get());Q=g.distance(Q,R);return Math.min(V,Q)}_computeHeadingRotateRadius(R){const {renderCoordsHelper:Q,state:W}= this.view,{camera:S,isGlobal:V}=W;var T=Q.intersectManifoldClosestSilhouette(S.ray,this._filteredSurfaceElevation,r.sv3d.get());if(V){const Y=g.subtract(r.sv3d.get(),R,T);T=g.length(Y);g.scale(Y,Y,1/T);R=g.normalize(r.sv3d.get(),R);R=l.acosClamped(g.dot(R,Y));return T*Math.sin(Math.min(I,R))}R=g.copy(r.sv3d.get(),R);Q.setAltitude(R,this._filteredSurfaceElevation);return g.distance(T,R)}_minimumAscendVelocity(){return this.view.state.constraints.collision.enabled?0:5}_computeVelocities(R){var Q=this._filteredSurfaceElevation, W=Q+t.getReferenceEllipsoid(this.view.spatialReference).radius;const {camera:S,isGlobal:V}=this.view.state;var T=r.sv3d.get();const Y=this._getPointAbsoluteSurfaceElevation(S.eye,Q,T);var ha=this._clampedDistanceToSurface(Q,T);const ba=S.width/2,U=.75*S.width,Z=.75*S.width;var ca=ha*Math.tan(.5*S.fovX)/ba;W=ca/W;T=ca/this._computeHeadingRotateRadius(T);ca=(V?W:ca)*U*R;Q=Y-Q;Q=Math.max(this._minimumAscendVelocity()*R,2**(U*R/ba)*Q-Q);ha=2**(U*R/ba)*ha-ha;R*=l.clamp(T*Z,O,L);return{pan:ca,ascend:Q, zoom:ha,rotate:R}}_applyDisabledMovementTypes(R){null==this.disableMovements||void 0!==this.disableMovements.mode&&this.view.state.viewingMode!==this.disableMovements.mode||(R.zoom=this.disableMovements.zoom?0:R.zoom,R.ascend=this.disableMovements.ascend?0:R.ascend,R.pan.enabled=!this.disableMovements.pan,this.disableMovements.pan&&c.identity(R.pan.matrix),R.rotate.enabled=!this.disableMovements.rotate,this.disableMovements.rotate&&c.identity(R.rotate.matrix))}static activatesFor(R,Q){R=E.extractTransformation(Q, R.navigation.gamepad,G);return!("end"===Q.action||E.isZeroTransformation(R))}};b.__decorate([p.property({constructOnly:!0})],a.GamepadKeyboardController.prototype,"gamepadDevice",void 0);b.__decorate([p.property({constructOnly:!0})],a.GamepadKeyboardController.prototype,"disableMovements",void 0);a.GamepadKeyboardController=b.__decorate([f.subclass("esri.views.3d.state.controllers.GamepadKeyboardController")],a.GamepadKeyboardController);const G={translation:[0,0,0],heading:0,tilt:0,zoom:0},I=l.deg2rad(80), O=l.deg2rad(30),L=l.deg2rad(80),P={zoom:0,ascend:0,pan:{enabled:!1,matrix:e.create()},rotate:{enabled:!1,matrix:e.create()}},M=d.create(),K=d.create(),J=H.createDirectionUp();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/gamepadAndKeyboardUtils":function(){define(["exports","../../chunks/vec32"],function(a,b){function q(l){let p=l*l;0>l&&(p*=-1);return p}a.extractTransformation=function(l,p,k){const h=l.state;l=l.device;p="forward-down"===p.tiltDirection?1: -1;"standard"===l.deviceType?(k.translation[0]=q(h.axes[0]),k.translation[1]=q(h.axes[1]),k.translation[2]=q(h.buttons[7])-q(h.buttons[6]),k.heading=q(h.axes[2]),k.tilt=q(h.axes[3])):"spacemouse"===l.deviceType&&(k.translation[0]=1.2*q(h.axes[0]),k.translation[1]=1.2*q(h.axes[1]),k.translation[2]=2*-q(h.axes[2]),k.heading=1.2*q(h.axes[5]),k.tilt=1.2*q(h.axes[3]));k.tilt*=p;b.scale(k.translation,k.translation,1);return k};a.extractTransformationKeyboard=function(l,p){p.translation[0]=l[1]-l[0];p.translation[1]= l[3]-l[2];p.translation[2]=l[4]-l[5];p.heading=l[7]-l[6];p.tilt=l[8]-l[9];p.zoom=l[10]-l[11];return p};a.isZeroTransformation=function(l){return 0===l.translation[0]&&0===l.translation[1]&&0===l.translation[2]&&0===l.heading&&0===l.tilt&&0===l.zoom};a.resetTransformation=function(l){l.translation[0]=0;l.translation[1]=0;l.translation[2]=0;l.heading=0;l.tilt=0;return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/KeyboardNavigation":function(){define(["exports", "../../../ViewingMode","../../state/controllers/GamepadKeyboardController","../../../input/InputHandler","../../../input/VisibilityChange"],function(a,b,q,l,p){var k;(function(f){f[f.LEFT=0]="LEFT";f[f.RIGHT=1]="RIGHT";f[f.FORWARD=2]="FORWARD";f[f.BACKWARD=3]="BACKWARD";f[f.UP=4]="UP";f[f.DOWN=5]="DOWN";f[f.HEADINGLEFT=6]="HEADINGLEFT";f[f.HEADINGRIGHT=7]="HEADINGRIGHT";f[f.TILTUP=8]="TILTUP";f[f.TILTDOWN=9]="TILTDOWN";f[f.ZOOMIN=10]="ZOOMIN";f[f.ZOOMOUT=11]="ZOOMOUT"})(k||={});class h extends l.InputHandler{constructor(f, c){super(!0);this._view=f;this._disableMovements={pan:!0,zoom:!1,ascend:!0,rotate:!1,mode:b.ViewingMode.Local};this._keyToNumber={[c.left]:k.LEFT,[c.right]:k.RIGHT,[c.forward]:k.FORWARD,[c.backward]:k.BACKWARD,[c.up]:k.UP,[c.down]:k.DOWN,[c.headingLeft]:k.HEADINGLEFT,[c.headingRight]:k.HEADINGRIGHT,[c.tiltUp]:k.TILTUP,[c.tiltDown]:k.TILTDOWN,[c.zoomIn]:k.ZOOMIN,[c.zoomOut]:k.ZOOMOUT};this.registerIncoming("key-down",null,e=>this._handleKeyDown(e));this.registerIncoming("key-up",null,e=>this._handleKeyUp(e)); this.registerIncoming("blur",null,()=>this._handleStop());this._visibilityHandle=p.onVisibilityChange(e=>e?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove();this._handleStop()}_handleKeyDown(f){if(!f.data.native.ctrlKey&&!f.data.native.metaKey){var c=this._keyToNumber[f.data.key];null!=c&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active||(this._cameraControllerKeyboard=new q.GamepadKeyboardController({view:this._view,disableMovements:this._disableMovements}), this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.activateDirection(c),f.stopPropagation()))}}_handleStop(){this._cameraControllerKeyboard?.active&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(f){if(!f.data.native.ctrlKey&&!f.data.native.metaKey){var c=this._keyToNumber[f.data.key];null!=c&&this._cameraControllerKeyboard?.active&&(this._cameraControllerKeyboard.deactivateDirection(c), f.stopPropagation())}}}a.KeyboardNavigation=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/VisibilityChange":function(){define(["exports","../../core/handleUtils"],function(a,b){a.onVisibilityChange=function(q){const l=()=>q("visible"===document.visibilityState);document.addEventListener("visibilitychange",l);return b.makeHandle(()=>document.removeEventListener("visibilitychange",l))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/MouseWheelZoom":function(){define(["exports", "../../../../core/screenUtils","../../state/controllers/ZoomStepControllerGlobal","../../state/controllers/ZoomStepControllerLocal","../../../input/InputHandler"],function(a,b,q,l,p){class k extends p.InputHandler{constructor(h,f){super(!0);this._view=h;this.registerIncoming("mouse-wheel",f,c=>this._handleMouseWheel(c))}_handleMouseWheel(h){if(this._view.navigation.mouseWheelZoomEnabled){var f=h.data;this._cameraController&&this._cameraController.active||(this._cameraController=this._view.state.isGlobal? new q.ZoomStepControllerGlobal({view:this._view,mode:"interaction"}):new l.ZoomStepControllerLocal({view:this._view,mode:"interaction"}),this._view.state.switchCameraController(this._cameraController));this._cameraController.zoomStep(-1/60*f.deltaY,b.createScreenPointArray(f.x,f.y));h.preventDefault();h.stopPropagation()}}}a.MouseWheelZoom=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/PinchAndPanNavigation":function(){define(["exports","../../state/controllers/PinchAndPanControllerGlobal", "../../state/controllers/PinchAndPanControllerLocal","../../../input/InputHandler","../../../input/handlers/support"],function(a,b,q,l,p){class k extends l.InputHandler{constructor(h,f,c){super(!0);this._view=h;this.pointerAction=f;this._lastTimestamp=this._lastEndTimestamp=0;this.registerIncoming("drag",c,e=>this._handleDrag(e))}_handleDrag(h){if("mouse"!==h.data.pointerType||p.eventMatchesMousePointerAction(h.data,this.pointerAction)){var f=h.timestamp-this._lastEndTimestamp;f=this._momentum&&this._momentum.active&& 40>f;switch(h.data.action){case "start":case "update":if(f)break;this._controller&&this._controller.active?2this._time.computeDelta(e)||(this._screen[0].update(f[0]),this._screen[1].update(f[1]),this._scene[0].update(c[0]), this._scene[1].update(c[1]),this._scene[2].update(c[2]),this._time.update(e))}reset(){this._screen[0].reset();this._screen[1].reset();this._scene[0].reset();this._scene[1].reset();this._scene[2].reset();this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;var f=this._screen[0].filteredDelta,c=this._screen[1].filteredDelta;f=null==f||null==c?0:Math.sqrt(f*f+c*c);c=this._time.filteredDelta;f=null==c||null==f?0:f/c;return Math.abs(f)< this._minimumInitialVelocity?null:this.createMomentum(f,this._stopVelocity,this._friction)}createMomentum(f,c,e){b.set(this._tmpDirection,this._scene[0].filteredDelta??0,this._scene[1].filteredDelta??0,this._scene[2].filteredDelta??0);const g=b.length(this._tmpDirection);0 this.duration}get friction(){return this._friction}value(q){return this.valueFromInitialVelocity(this._initialVelocity,q)}valueDelta(q,l){const p=this.value(q);return this.value(q+l)-p}valueFromInitialVelocity(q,l){l=Math.min(l,this.duration);const p=1-this.friction;return q*(p**l-1)/Math.log(p)}}a.Momentum=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/PanSphericalMomentumEstimator":function(){define("exports ../../core/libs/gl-matrix-2/factories/vec2f64 ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../3d/state/utils/navigationUtils ./FilteredFiniteDifference ./FilteredValue ./Momentum".split(" "), function(a,b,q,l,p,k,h,f){class c extends f.Momentum{constructor(g,d,t,w,v,m=0,r){super(g,d,t);this._angularVelocity1=w;this.axis1=v;this.angularVelocity2=m;this.axis2=r}value1(g){return super.valueFromInitialVelocity(this._angularVelocity1,g)}value2(g){return super.valueFromInitialVelocity(this.angularVelocity2,g)}}class e{constructor(g=300,d=12,t=.84){this._minimumInitialVelocity=g;this._stopVelocity=d;this._friction=t;this.enabled=!0;this._tmpAxis1=l.create();this._tmpAxis2=l.create();this._tmpAngles= b.create();this._time=new k.FilteredFiniteDifference(.3);this._screen=[new k.FilteredFiniteDifference(.4),new k.FilteredFiniteDifference(.4)];this._angle1=new h.FilteredValue(.6);this._angle2=new h.FilteredValue(.6);this._axis1=l.create();this._axis2=l.create();this._lastScene=l.create()}addMomentumDirectRotation(g,d,t,w,v,m){if(this.enabled){if(this._time.hasLastValue()){if(.01>this._time.computeDelta(t))return;w=p.rotationAngleAndAxisDirectRotation(this._lastScene,d,this._tmpAxis2,w,v,m);this._angle2.update(0); 1E-5>q.squaredLength(this._tmpAxis2)?w=0:q.normalize(this._axis1,this._tmpAxis2);this._angle1.update(w);q.copy(this._lastScene,d)}this._screen[0].update(g[0]);this._screen[1].update(g[1]);this._time.update(t)}}addMomentumPreserveHeading(g,d,t,w,v,m,r){if(this.enabled){if(this._time.hasLastValue()){if(.01>this._time.computeDelta(t))return;p.rotationAnglesAndAxesHeadingPreserving(this._lastScene,d,this._tmpAxis2,this._tmpAxis1,this._tmpAngles,w,v,m,r,!1);1E-5>q.squaredLength(this._tmpAxis2)?(this._angle1.update(0), this._angle2.update(0)):(this._angle1.update(this._tmpAngles[1]),this._angle2.update(this._tmpAngles[0]),q.normalize(this._axis1,this._tmpAxis1),q.normalize(this._axis2,this._tmpAxis2));q.copy(this._lastScene,d)}this._screen[0].update(g[0]);this._screen[1].update(g[1]);this._time.update(t)}}reset(){this._screen[0].reset();this._screen[1].reset();this._angle1.reset();this._angle2.reset();this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta())return null;var g=this._screen[0].filteredDelta, d=this._screen[1].filteredDelta;g=null==g||null==d?null:Math.sqrt(g*g+d*d);d=this._time.filteredDelta;g=null==g||null==d?0:g/d;return Math.abs(g)Math.PI;)l-=2*Math.PI;for(;l<-Math.PI;)l+=2*Math.PI;l=k+l}super.add(l,p)}}a.RotationMomentumEstimator=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/MomentumEstimator":function(){define(["exports","../../core/mathUtils","./FilteredFiniteDifference","./Momentum"],function(a,b, q,l){class p{constructor(k=2.5,h=.01,f=.95,c=12){this._minimumInitialVelocity=k;this._stopVelocity=h;this._friction=f;this._maxVelocity=c;this.enabled=!0;this.value=new q.FilteredFiniteDifference(.8);this.time=new q.FilteredFiniteDifference(.3)}add(k,h){if(this.enabled&&null!=h){if(this.time.hasLastValue()){if(.01>this.time.computeDelta(h))return;if(this.value.hasFilteredDelta()){const f=this.value.computeDelta(k);0>this.value.filteredDelta*f&&this.value.reset()}}this.time.update(h);this.value.update(k)}}reset(){this.value.reset(); this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let k=this.value.filteredDelta/this.time.filteredDelta;k=b.clamp(k,-this._maxVelocity,this._maxVelocity);return Math.abs(k){L[0]=M.x;L[1]=M.y;void 0===O[P]&&(O[P]=g.create());B.intersectPlaneFromScreenPointAtEye(G,I,L,O[P]);P+=1});return O}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};a.PinchAndPanControllerLocal=b.__decorate([f.subclass("esri.views.3d.state.controllers.PinchAndPanControllerLocal")], a.PinchAndPanControllerLocal);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/PointerDownCancelAnimation":function(){define(["exports","../../../input/InputHandler"],function(a,b){class q extends b.InputHandler{constructor(l,p){super(!0);this.view=l;this.registerIncoming("pointer-down",p,()=>this.view.state.stopActiveCameraController())}}a.PointerDownCancelAnimation=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/SingleKeyResetHeading":function(){define(["exports", "./SingleKey"],function(a,b){class q extends b.SingleKey{constructor(l,p,k){super(p,k);this.view=l}activate(){this.view.goTo({heading:0}).catch(()=>{})}}a.SingleKeyResetHeading=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/SingleKey":function(){define(["exports","../../../input/InputHandler"],function(a,b){class q extends b.InputHandler{constructor(l,p){super(!0);this.key=l;this.registerIncoming("key-down",p,k=>this._handleKeyDown(k))}_handleKeyDown(l){l.data.key=== this.key&&(this.activate(),l.stopPropagation())}}a.SingleKey=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/SingleKeyResetTilt":function(){define(["exports","./SingleKey"],function(a,b){class q extends b.SingleKey{constructor(l,p,k){super(p,k);this.view=l}activate(){this.view.goTo({tilt:0}).catch(()=>{})}}a.SingleKeyResetTilt=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/TwoFingerTilt":function(){define(["exports", "../../../../core/screenUtils","../../state/controllers/RotateController","../../../input/InputHandler"],function(a,b,q,l){class p extends l.InputHandler{constructor(k,h=!1){super(!0);this._view=k;this._invert=h;this.registerIncoming("vertical-two-finger-drag",f=>this._handleTwoFinger(f))}_handleTwoFinger(k){const h=b.createScreenPointArray(0,k.data.delta*(this._invert?-1:1));switch(k.data.action){case "begin":this._cameraController?.end();this._cameraController=new q.RotateController({view:this._view, pivot:q.PivotPoint.CENTER});this._view.state.switchCameraController(this._cameraController);this._cameraController.begin(h);break;case "update":this._cameraController?.update(h);break;case "end":this._cameraController?.end(),this._cameraController=null}}}a.TwoFingerTilt=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/BrowserEventSource":function(){define(["exports","../../core/has","../../core/maybe","./gamepad/GamepadSource","../support/screenUtils"],function(a, b,q,l,p){const k=b("edge"),h=b("chrome"),f=b("ff"),c=b("safari");class e{constructor(d,t){this._input=t;this._active={};this._callback=()=>{};this._activePointerCaptures=new Set;this._keyDownState=new Set;this._eventId=1;this._browserTouchPanningEnabled=!1;this._element=d;d.getAttribute("tabindex")||d.setAttribute("tabindex","0");this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault, "pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost};this._updateTouchAction();this._element.addEventListener("keydown",this._preventAltKeyDefault);this._gamepadSource=new l.GamepadSource(d,this._input);this._gamepadSource.onEvent=w=>this._callback("gamepad",w)}destroy(){this._callback=()=>{};this.activeEvents=null;this._activePointerCaptures.forEach(d=> {this._releasePointerCaptureSafe(d)});this._gamepadSource=q.destroyMaybe(this._gamepadSource);this._activePointerCaptures=null;this._removeTouchAction();this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(d){this._browserTouchPanningEnabled=d;this._updateTouchAction();this._updateTouchEventHandling()}set onEventReceived(d){this._callback=d}set activeEvents(d){for(const t in this._active)d&& d.has(t)||(this._element.removeEventListener(g[t],this._active[t]),delete this._active[t]);d&&d.forEach(t=>{if(!this._active[t]&&g[t]){const w=(this._eventHandlers[t]||this._handleDefault).bind(this,t);this._element.addEventListener(g[t],w);this._active[t]=w}});this._gamepadSource.hasEventListeners=d?.has("gamepad")??!1}setPointerCapture(d,t){t?this._setPointerCatpureSafe(d.pointerId):(this._releasePointerCaptureSafe(d.pointerId),this._activePointerCaptures.delete(d.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled? "esri-view-surface--touch-none":"esri-view-surface--touch-pan");this._element.classList.add(this._browserTouchPanningEnabled?"esri-view-surface--touch-pan":"esri-view-surface--touch-none")}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove("esri-view-surface--touch-none");this._element.classList.remove("esri-view-surface--touch-pan"); this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(d){try{this._element.setPointerCapture(d),this._activePointerCaptures.add(d)}catch{}}_releasePointerCaptureSafe(d){try{this._element.hasPointerCapture&&!this._element.hasPointerCapture(d)||this._element.releasePointerCapture(d)}catch(t){}}_updateNormalizedPointerLikeEvent(d,t){d=p.createScreenPointFromNativeEvent(this._element,d);e.test.disableSubpixelCoordinates&&(d.x=Math.round(d.x),d.y=Math.round(d.y)); t.x=d.x;t.y=d.y;return t}_handleKey(d,t){const {key:w}=t;w&&"key-up"===d&&this._keyDownState.delete(w);t={native:t,key:w,repeat:!!w&&this._keyDownState.has(w)};w&&"key-down"===d&&this._keyDownState.add(t.key);this._callback(d,t)}_handlePointer(d,t){t=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});this._callback(d,t)}_handlePointerPreventDefault(d,t){const w=this._updateNormalizedPointerLikeEvent(t,{native:t, x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});t.preventDefault();this._callback(d,w)}_handleMouseWheel(d,t){let w=t.deltaY;switch(t.deltaMode){case 0:k&&(w=w/document.documentElement.clientHeight*600);break;case 1:w*=30;break;case 2:w*=900}k?w*=.7:h||c?w*=.6:f&&(w*=1.375);const v=Math.abs(w);100{this._connectGamepad(c.gamepad)};this._onDisconnectGamepad=c=>{c=c.gamepad;const e=c.index,g=this._inputDevices[e];g&&(this._emitGamepadEvent(c,l.extractState(g),!1),this._inputDevices.splice(e,1),this._latestUpdate.splice(e,1),this._input.gamepad.devices.remove(g), this.ensurePollingState())};this._frameTask=null;this._latestUpdate=[];this._inputDevices=[];this._callback=null;h=window.isSecureContext;if(this.supported="getGamepads"in window.navigator&&h)p(c=>this._connectGamepad(c)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState()}destroy(){this.hasEventListeners=!1;this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad), window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(h){this._hasEventListeners!==h&&(this._hasEventListeners=h,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&0this._readGamepadState()}))}_stopPolling(){null!=this._frameTask&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=[])}_readGamepadState(){const h=document.hasFocus(),f=this._element.contains(document.activeElement),c="document"===this._input.gamepad.enabledFocusMode&&!h||"view"===this._input.gamepad.enabledFocusMode&&!f;p(e=>{var g=this._inputDevices[e.index]; if(g){var d=this._latestUpdate[e.index];g=l.extractState(g);var t=c||l.stateIdle(g);d&&(d.timestamp===e.timestamp||!d.active&&t||l.stateEqual(d.state,g))||this._emitGamepadEvent(e,g,!t)}})}_emitGamepadEvent(h,f,c){var e=this._latestUpdate[h.index];if((e=e&&e.active)||c)this._latestUpdate[h.index]={timestamp:h.timestamp,state:f,active:c},this._callback&&this._callback({device:this._inputDevices[h.index],state:f,action:!e&&c?"start":e&&c?"update":"end"})}}a.GamepadSource=k;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/input/gamepad/GamepadState":function(){define(["exports"],function(a){a.extractState=function(b){const q=b.native;return q?{buttons:q.buttons.map(l=>l.pressed?l.value||1:0),axes:q.axes.map(l=>{{var p=b.axisThreshold;const k=Math.abs(l);l=k {l.data.native.preventDefault()})}}a.PreventContextMenu=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/Drag":function(){define(["exports","../../../core/screenUtils","../../../core/time","../InputHandler","./support"],function(a,b,q,l,p){function k(g){const d=[];g.forEach(t=>{d.push(b.createScreenPoint(t.event.x,t.event.y))});return p.fitCircleLSQ(d)}function h(g){const d=k(g);let t=0;g.forEach(w=>{var v=c(w,d);for(v-=w.lastAngle;v>Math.PI;)v-=2*Math.PI; for(;v<-Math.PI;)v+=2*Math.PI;v=w.lastAngle+v;w.lastAngle=v;t+=v-w.initialAngle});t/=g.size||1;return{angle:t,radius:d.radius,center:d.center}}function f(g){const d=new Map;g.forEach((t,w)=>d.set(w,t.event));return d}function c(g,d){g=g.event;return Math.atan2(g.y-d.center.y,g.x-d.center.x)}class e extends l.InputHandler{constructor(g){super(!1);this._navigationTouch=g;this._startStateModifiers=new Set;this._activePointerMap=new Map;this._isCurrentDragSuppressed=this._isDragging=!1;this._drag=this.registerOutgoing("drag"); this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this));this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this));this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this));this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(g,d,t,w){return{action:g,pointerType:this._pointerType,button:this._mouseButton,buttons:d.buttons,timestamp:w,pointers:f(this._activePointerMap),pointer:d, angle:t.angle,radius:t.radius,center:t.center}}_addPointer(g){var d=g.native.pointerId;const t=h(this._activePointerMap).angle;g={event:g,initialAngle:0,lastAngle:0};this._activePointerMap.set(d,g);d=c(g,k(this._activePointerMap));g.initialAngle=d;g.lastAngle=d;this._updatePointerAngles(t)}_updatePointer(g){if(!g||null!=g.x||null!=g.y){var d=this._activePointerMap.get(g.native.pointerId);d?d.event=g:this._addPointer(g)}}_removePointer(g){const d=h(this._activePointerMap).angle;this._activePointerMap.delete(g); this._updatePointerAngles(d)}_updatePointerAngles(g){const d=h(this._activePointerMap);this._activePointerMap.forEach(t=>{t.initialAngle=c(t,d)-g;t.lastAngle=c(t,d)-g})}_emitEvent(g,d,t){const w=h(this._activePointerMap);this._drag.emit(this._createPayload(g,d,w,t),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(g){const d=g.data.native.pointerId,t=q.Milliseconds(g.timestamp);this._activePointerMap.get(d)&&(1===this._activePointerMap.size?(this._updatePointer(g.data),!this._isCurrentDragSuppressed&& this._emitEvent("end",g.data,t),this._isCurrentDragSuppressed=this._isDragging=!1,this._removePointer(d)):(this._removePointer(d),this._emitEvent("removed",g.data,q.Milliseconds(g.timestamp))))}_handlePointerDrag(g){const d=g.data,t=d.currentEvent,w=q.Milliseconds(g.timestamp);switch(d.action){case "start":case "update":this._isDragging?this._activePointerMap.has(t.native.pointerId)?(this._updatePointer(t),!this._isCurrentDragSuppressed&&this._emitEvent("update",t,w)):(this._addPointer(t),this._emitEvent("added", t,w),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(t),this._pointerType=g.data.startEvent.pointerType,this._mouseButton=g.data.startEvent.button,this._startStateModifiers=g.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",t,w))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&"touch"===this._pointerType&&1===this._activePointerMap.size}}a.Button= void 0;(function(g){g[g.Left=0]="Left";g[g.Middle=1]="Middle";g[g.Right=2]="Right";g[g.Back=3]="Back";g[g.Forward=4]="Forward";g[g.Undefined=-1]="Undefined"})(a.Button||(a.Button={}));a.Drag=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/support":function(){define(["exports","../../../core/screenUtils"],function(a,b){a.DefaultParameters={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250, maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};a.euclideanDistance=function(q,l){const p=l.x-q.x;q=l.y-q.y;return Math.sqrt(p*p+q*q)};a.fitCircleLSQ=function(q,l){l?(l.radius=0,l.center.x=0,l.center.y=0):l={radius:0,center:b.createScreenPoint()};if(0===q.length)return l;if(1===q.length)return l.center.x=q[0].x,l.center.y=q[0].y,l;if(2===q.length){const [m,r]=q,[n,u]=[r.x-m.x,r.y-m.y];l.radius=Math.sqrt(n*n+u*u)/2;l.center.x=(m.x+r.x)/2;l.center.y=(m.y+r.y)/ 2;return l}let p=0,k=0;for(l=0;lm.x-p),f=q.map(m=>m.y-k);let c=l=0;var e=0,g=0,d=0,t=0,w=0;for(var v=0;v {k.immediateDoubleClick&&k.immediateDoubleClick.timeoutHandle.remove()});super.onUninstall()}_handlePointerDown(k){k=k.data;const h=l.getPointerId(k);this._pointerState.has(h)||(this._pointerState.set(h,{downButton:k.native.button,x:k.x,y:k.y,immediateDoubleClick:null}),this.startCapturingPointer(k.native))}_handlePointerUp(k){const h=k.data;var f=l.getPointerId(h);if((f=this._pointerState.get(f))&&f.downButton===h.native.button){const c=f.immediateDoubleClick,e="touch"===k.data.native.pointerType? this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;c?(c.timeoutHandle.remove(),l.manhattanDistance(c,k.data)>e?this._startImmediateDoubleClick(k,f):(this._immediateDoubleClick.emit(k.data,void 0,c.modifiers),this._removeState(h))):l.manhattanDistance(f,k.data)>e?this._removeState(h):this._startImmediateDoubleClick(k,f)}}_startImmediateDoubleClick(k,h){h.immediateDoubleClick={x:k.data.x,y:k.data.y,modifiers:k.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(k.data), "touch"===k.data.native.pointerType?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay)}}_removeState(k){const h=l.getPointerId(k);this._pointerState.delete(h);this.stopCapturingPointer(k.native);this.refreshHasPendingInputs()}}a.ImmediateDoubleClick=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/PointerClickHoldAndDrag":function(){define(["exports","../../../core/clock","../../../core/maybe","../InputHandler","./support"],function(a,b,q,l, p){function k(f,c,e){return{action:f,startEvent:c.startEvent,previousEvent:c.previousEvent,currentEvent:e}}class h extends l.InputHandler{constructor(f=p.DefaultParameters.maximumClickDelay,c=p.DefaultParameters.movementUntilMouseDrag,e=p.DefaultParameters.movementUntilPenDrag,g=p.DefaultParameters.movementUntilTouchDrag,d=p.DefaultParameters.holdDelay,t=b.clock){super(!1);this._maximumClickDelay=f;this._movementUntilMouseDrag=c;this._movementUntilPenDrag=e;this._movementUntilTouchDrag=g;this._holdDelay= d;this._clock=t;this._pointerState=new Map;this._pointerDrag=this.registerOutgoing("pointer-drag");this._immediateClick=this.registerOutgoing("immediate-click");this._pointerHold=this.registerOutgoing("hold");this.registerIncoming("pointer-down",this._handlePointerDown.bind(this));this.registerIncoming("pointer-up",w=>{this._handlePointerLoss(w,"pointer-up")});this.registerIncoming("pointer-capture-lost",w=>{this._handlePointerLoss(w,"pointer-capture-lost")});this.registerIncoming("pointer-cancel", w=>{this._handlePointerLoss(w,"pointer-cancel")});this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this));this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(f=>{f.holdTimeout=q.removeMaybe(f.holdTimeout)});super.onUninstall()}_handlePointerDown(f){const c=f.data,e=c.native.pointerId;var g=null;0===this._pointerState.size&&(g=this._clock.setTimeout(()=>{const d=this._pointerState.get(e);d&&(d.isDragging||(this._pointerHold.emit(d.previousEvent,void 0, f.modifiers),d.holdEmitted=!0),d.holdTimeout=null)},this._holdDelay));g={startEvent:c,previousEvent:c,startTimestamp:f.timestamp,isDragging:!1,downButton:c.native.button,holdTimeout:g,modifiers:new Set};this._pointerState.set(e,g);this.startCapturingPointer(c.native);this._moveHandle.resume();1d&&this._startDragging(f)}e.previousEvent=c}}_getDragThreshold(f){switch(f){case "touch":return this._movementUntilTouchDrag;case "pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(f){const c=f.data,e=c.native.pointerId;this._pointerState.forEach(g=>{null!=g.holdTimeout&&(g.holdTimeout.remove(),g.holdTimeout=null);g.isDragging||(g.modifiers=f.modifiers, g.isDragging=!0,e===g.startEvent.native.pointerId?this._pointerDrag.emit(k("start",g,c)):this._pointerDrag.emit(k("start",g,g.previousEvent),f.timestamp))})}_handlePointerLoss(f,c){const e=f.data,g=e.native.pointerId,d=this._pointerState.get(g);d&&(null!=d.holdTimeout&&(d.holdTimeout.remove(),d.holdTimeout=null),d.isDragging?this._pointerDrag.emit(k("end",d,"pointer-up"===c?e:d.previousEvent),void 0,d.modifiers):"pointer-up"===c&&d.downButton===e.native.button&&f.timestamp-d.startTimestamp<=this._maximumClickDelay&& !d.holdEmitted&&this._immediateClick.emit(e),this._pointerState.delete(g),this.stopCapturingPointer(e.native),0===this._pointerState.size&&this._moveHandle.pause())}}a.PointerClickHoldAndDrag=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/SingleAndDoubleClick":function(){define("exports ../../../core/clock ../../../core/MapUtils ../../../core/maybe ../InputHandler ./support".split(" "),function(a,b,q,l,p,k){class h extends p.InputHandler{constructor(f= k.DefaultParameters.maximumDoubleClickDelay,c=k.DefaultParameters.maximumDoubleClickDistance,e=k.DefaultParameters.maximumDoubleTouchDelay,g=k.DefaultParameters.maximumDoubleTouchDistance,d=b.clock){super(!1);this._maximumDoubleClickDelay=f;this._maximumDoubleClickDistance=c;this._maximumDoubleTouchDelay=e;this._maximumDoubleTouchDistance=g;this._clock=d;this._pointerState=new Map;this._click=this.registerOutgoing("click");this._doubleClick=this.registerOutgoing("double-click");this.registerIncoming("immediate-click", this._handleImmediateClick.bind(this));this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach(f=>f.doubleClickTimer=l.removeMaybe(f.doubleClickTimer))}get hasPendingInputs(){return q.someMap(this._pointerState,f=>null!=f.doubleClickTimer)}_clearDoubleClickTimer(f,c){const e=this._pointerState.get(f);e&&(e.doubleClickTimer=l.removeMaybe(e.doubleClickTimer),c&&this._click.emit(e.event.data,void 0,e.event.modifiers),this._pointerState.delete(f), this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(f){const c=this._pointerState.get(f);1===c.pointerDownCount&&this._click.emit(c.event.data,void 0,c.event.modifiers);c.doubleClickTimer=null;this._pointerState.delete(f);this.refreshHasPendingInputs()}_handleImmediateClick(f){const c=f.data;var {pointerType:e}=c.native;const {pointerId:g,pointerType:d,button:t}=c.native;var w="mouse"===d?`${g}:${t}`:`${d}`;if(this._pointerState.has(w)){var v=this._pointerState.get(w),{data:m,modifiers:r}= v.event;e="touch"===e?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;k.manhattanDistance(m,c)>e?(this._clearDoubleClickTimer(w,!0),this._startClick(f)):(this._clearDoubleClickTimer(w,!1),2===v.pointerDownCount&&this._doubleClick.emit(m,void 0,r))}else this._startClick(f)}_handlePointerDown(f){f=k.getPointerId(f.data);if(f=this._pointerState.get(f))f.pointerDownCount+=1}_startClick(f){var {data:c}=f;const {native:{pointerType:e}}=c,g=k.getPointerId(c);c=this._clock.setTimeout(()=> this._doubleClickTimeoutExceeded(g),"touch"===e?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay);this._pointerState.set(g,{event:f,doubleClickTimer:c,pointerDownCount:1});this.refreshHasPendingInputs()}}a.SingleAndDoubleClick=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/VerticalTwoFingerDrag":function(){define(["exports","../DragEventSeparator","../InputHandler"],function(a,b,q){class l extends q.InputHandler{constructor(p=20,k=40){super(!1); this._threshold=p;this._maxDelta=k;this._state="ready";this._emittedArtificalEnd2=!1;this._vertical=this.registerOutgoing("vertical-two-finger-drag");this._artificalDrag=this.registerOutgoing("drag");this._dragEventSeparator=new b.DragEventSeparator({start:(h,f)=>this._observeStart(h,f),update:(h,f,c)=>this._observeUpdate(h,f,c),end:(h,f)=>this._observeEnd(f)});this.registerIncoming("drag",h=>this._dragEventSeparator.handle(h))}get failed(){return"failed"===this._state}_observeStart(p,k){1===p&&this._emittedArtificalEnd2&& (this._emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:k.data.button,buttons:k.data.buttons,pointerType:k.data.pointerType,timestamp:k.data.timestamp,pointers:k.data.pointers,pointer:k.data.pointer,angle:k.data.angle,radius:k.data.radius,center:k.data.center}),k.stopPropagation());this._state=2===p?"ready":"failed"}_observeUpdate(p,k,h){"failed"!==this._state&&2===p&&("active"===this._state?(this._vertical.emit({delta:k.data.center.y-this._thresholdReachedCenter.y,action:"update"}), k.stopPropagation()):this._checkMovementWithinLimits(k.data,h.data)?this._checkVerticalThresholdReached(k.data,h.data)&&(this._state="active",this._emittedArtificalEnd2=!0,this._thresholdReachedCenter=k.data.center,this._artificalDrag.emit({action:"end",button:k.data.button,buttons:k.data.buttons,pointerType:k.data.pointerType,timestamp:k.data.timestamp,pointers:k.data.pointers,pointer:k.data.pointer,angle:k.data.angle,radius:k.data.radius,center:k.data.center}),this._vertical.emit({delta:k.data.center.y- this._thresholdReachedCenter.y,action:"begin"}),k.stopPropagation()):this._state="failed")}_observeEnd(p){"active"===this._state&&(this._vertical.emit({delta:p.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this._state="ready",p.stopPropagation())}_checkMovementWithinLimits(p,k){let h=-Infinity,f=Infinity,c=-Infinity,e=Infinity;for(const {x:v,y:m}of k.pointers.values())h=Math.max(h,v),f=Math.min(f,v),c=Math.max(c,m),e=Math.min(e,m);let g=-Infinity,d=Infinity,t=-Infinity,w=Infinity;for(const {x:v, y:m}of p.pointers.values())g=Math.max(g,v),d=Math.min(d,v),t=Math.max(t,m),w=Math.min(w,m);return Math.abs(p.center.x-k.center.x){c=k.pointers.get(c);h=Math.min(h,Math.abs(f.y-c.y))});return h>=this._threshold}}a.VerticalTwoFingerDrag=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/DragEventSeparator":function(){define(["exports"], function(a){class b{constructor(q){this._callbacks=q;this._currentCount=0;this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(q){const l=q.data,p=l.pointers.size;switch(l.action){case "start":this._currentCount=p;this._emitStart(q);break;case "added":this._emitEnd(this._previousEvent);this._currentCount=p;this._emitStart(q);break;case "update":this._emitUpdate(q);break;case "removed":this._startEvent&&this._emitEnd(this._previousEvent);this._currentCount=p;this._emitStart(q);break; case "end":this._emitEnd(q),this._currentCount=0}this._previousEvent=q}_emitStart(q){this._startEvent=q;this._callbacks.condition?.(this._currentCount,q)&&this._callbacks.start(this._currentCount,q,this._startEvent)}_emitUpdate(q){this._callbacks.condition?.(this._currentCount,q)&&this._callbacks.update(this._currentCount,q,this._startEvent)}_emitEnd(q){this._callbacks.condition?.(this._currentCount,q)&&this._callbacks.end(this._currentCount,q,this._startEvent);this._startEvent=null}}a.DragEventSeparator= b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/GraphicsDeconflictor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/MapUtils ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/boundedPlane ./Deconflictor ./enums ./LabelDeconflictor ../../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(n){n=n.layer;return!(!n?.featureReduction||"selection"!==n.featureReduction.type)}function r(n){(n=n.graphics3DGraphics)&&n.forEach(u=>u.setVisibilityFlag(t.VisibilityGroup.GRAPHIC,t.VisibilityFlag.DECONFLICTION,!0))}a.GraphicsDeconflictor=class extends d.Deconflictor{constructor(){super(...arguments);this._contexts=new Map;this.visibilityGroup=t.VisibilityGroup.GRAPHIC;this._marginFactor=-.1;this.test={overrideMarginFactor:n=>{this._marginFactor= n;this.setDirty()}}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this.addHandles([p.watch(()=>this.view?.state?.camera,()=>{this._updateViewState();this.setDirty()}),p.watch(()=>this.view?.map?.ground?.opacity,(n,u)=>{1!==n&&1!==u||this.setDirty()}),p.watch(()=>this.view?.slicePlane,()=>{this._updateSlicePlane();this._slicePlaneChanged()},p.initial)]);this._frameTask=this.view.resourceController.scheduler.registerTask(v.TaskPriority.GRAPHICS_DECONFLICTOR,this); this._labels=new w.LabelDeconflictor({view:this.view,parent:this})}destroy(){this._labels=l.destroyMaybe(this._labels);this._frameTask=l.removeMaybe(this._frameTask)}get marginFactor(){return this._marginFactor}setDirty(){0u.symbolCreationContext.slicePlaneEnabled)&&this.setDirty()}addGraphicsOwner(n){const u=this._getGraphicsContext(n);return{addGraphic:x=>this._addGraphic(n,u,x),removeGraphic:x=>this._removeGraphic(u,x),labelingInfoChange:()=>this._labels.enabledChanged(n,u),featureReductionChange:()=> this.enabledChanged(n,u),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(n,u),clear:()=>u.forEach(x=>this._removeGraphic(u,x.graphics3DGraphic)),remove:()=>this._removeGraphicsOwner(n),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(n){const u=this._contexts.get(n);u&&(u.forEach(x=>this._removeGraphic(u,x.graphics3DGraphic)),this._contexts.delete(n),this.setDirty())}_addGraphic(n,u,x){const y=x.graphic.uid,z=new d.DeconflictorGraphic(x,n.symbolCreationContext.slicePlaneEnabled);u.set(y, z);m(n)&&this.addToActiveGraphics(z);n.labelsEnabled&&this._labels.addToActiveGraphics(z);n=!this._graphicSupportsDeconfliction(x)||!m(n);x.setVisibilityFlag(t.VisibilityGroup.GRAPHIC,t.VisibilityFlag.DECONFLICTION,n)}_removeGraphic(n,u){u=u.graphic.uid;const x=n.get(u);x&&(this.removeFromActiveGraphics(x),this._labels.removeFromActiveGraphics(x),n.delete(u),this.setDirty())}enabledChanged(n,u){const x=m(n);x||r(n);this.modifyGraphics(u,x)}_slicePlaneEnabledChanged(n,u){const x=n.symbolCreationContext.slicePlaneEnabled; u.forEach(y=>y.slicePlaneEnabled=x);this.setDirty()}getGraphicsLayers(n){return n.layers}_graphicSupportsDeconfliction(n){if(n.isDraped)return!1;n=n.layers;if(!n?.length)return!1;for(const u of n)if(this.layerSupportsDeconfliction(u))return!0;return!1}_getGraphicsContext(n){var u=this._contexts.get(n);if(u)return u;u=new Map;this._contexts.set(n,u);this.setDirty();return u}};a.GraphicsDeconflictor=b.__decorate([e.subclass("esri.views.3d.layers.graphics.GraphicsDeconflictor")],a.GraphicsDeconflictor); Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Deconflictor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/mathUtils ../../../../core/PooledArray ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/support/aaBoundingRect ../../../../chunks/boundedPlane ../../../../geometry/support/ray ../../../../chunks/sphere ./deconflictorDebug ./enums ../../webgl/RenderCamera ../../webgl-engine/lib/screenSizePerspectiveUtils ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/HUDMaterial ../../webgl-engine/materials/ScaleInfo".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N){function*E(Z){if(Map.prototype.entries){Z=Z.entries();for(let ca=Z.next();!ca.done;ca=Z.next())yield ca.value[1]}else yield*Z.values()}function*G(Z,ca,ea){ca.clear();Z.forEach((ia,ka)=>{const fa=ca.pushNew();fa.id=ka;fa.visible=ia.graphics3DGraphic.getVisibilityFlag(ea,B.VisibilityFlag.DECONFLICTION);ka=ia.info?.[ea];fa.prio=ia.graphics3DGraphic.deconflictionPriority;fa.distance=ka?ka.distance:Number.MAX_VALUE});yield;const da=ca.iterableSort((ia, ka)=>ia.prio!==ka.prio?ka.prio-ia.prio:ia.distance!==ka.distance?ia.distance-ka.distance:ia.visible!==ka.visible?ia.visible?-1:1:ia.id-ka.id);for(let ia=da.next();!ia.done;ia=da.next())yield;ca.forAll(ia=>{const ka=Z.get(ia.id);ka&&(Z.delete(ia.id),Z.set(ia.id,ka))});ca.clear()}const I=v.create(),O=r.create(),L=r.create(),P=v.create(),M=d.create(),K=z.create(),J=y.create(),R=v.create(),Q=u.create();class W{constructor(){this.aabr=u.create();this.distance=0;this.visible=this.culled=!1}}class S{constructor(Z, ca){this.graphics3DGraphic=Z;this.slicePlaneEnabled=ca;this.info={}}}a.State=void 0;(function(Z){Z[Z.Idle=0]="Idle";Z[Z.Process=1]="Process";Z[Z.Sort=2]="Sort";Z[Z.Deconflict=3]="Deconflict";Z[Z.NumStates=4]="NumStates"})(a.State||(a.State={}));class V{constructor(){this.camera=new C;this.slicePlane=x.create();this.slicePlaneEnabled=!1}copyFrom(Z){this.camera.copyFrom(Z.camera);x.copy(Z.slicePlane,this.slicePlane);this.slicePlaneEnabled=Z.slicePlaneEnabled}}a.Deconflictor=class extends q{get dirty(){return this._dirty}get state(){return this._state}constructor(Z){super(Z); this._dirty=!1;this._viewState=new V;this._state=a.State.Idle;this._active=new Map;this._visible=new Map;this._iterators=new Y;this._accBinsNumX=15;this._accBinsNumY=20;this._accBinsSizeY=this._accBinsSizeX=0;this._accBins=null;this.accNumTests=0}destroy(){this._active.clear();this._visible.clear();this._iterators=null}setDirty(){!this._dirty&&0this.addToActiveGraphics(ea)):Z.forEach(ea=>this.removeFromActiveGraphics(ea));this.setDirty()}layerSupportsDeconfliction(Z){if(null==Z||"object3d"!==Z.type)return!1;Z=Z.stageObject;return 1===(Z?.geometries.length??0)&&Z?.geometries[0]?.material instanceof H.HUDMaterial?!0:!1}_startUpdate(){A.prepare(this.view);this._dirty=!1;this._viewState.copyFrom(this.viewState);const {fullWidth:Z,fullHeight:ca}= this._viewState.camera;this._initBins(Z,ca);this._resetIterators()}addToActiveGraphics(Z){Z.info[this.visibilityGroup]=new W;this._active.set(Z.graphics3DGraphic.graphic.uid,Z);this.setDirty()}removeFromActiveGraphics(Z){this._visible.delete(Z.graphics3DGraphic.graphic.uid);const ca=Z.graphics3DGraphic;ca.destroyed||ca.setVisibilityFlag(this.visibilityGroup,B.VisibilityFlag.DECONFLICTION,!0);delete Z.info[this.visibilityGroup];this._active.delete(Z.graphics3DGraphic.graphic.uid);this.setDirty()}_processActiveGraphics(Z){const ca= this._ensureActiveGraphicsIterator(),ea=g.invertOrIdentity(M,this._viewState.camera.projectionMatrix),da="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&0la:!1}if(X){ka.culled=!0;return}}this._expandBoundingRect(ka,na,fa,ia)}null==ia?ka.culled=!0:(ka.distance=ia.distance,ka.culled=!1)}else ka.culled=!0}}_getProjectionInfo(Z,ca,ea){const da=this._viewState.camera;Z=Z.stageObject;var ia=Z.geometries[0]; const ka=ia.material;var fa=z.getCenter(Z.boundingVolumeWorldSpace.bounds);w.transformMat4(I,fa,da.viewMatrix);fa=ia.attributes;ia=fa.get(F.VertexAttribute.NORMAL).data;fa=fa.get(F.VertexAttribute.CENTEROFFSETANDDISTANCE).data;ka.applyShaderOffsetsView(I,ia,Z.transformation,fa,da,ea.scaleInfo,I);m.set(O,I[0],I[1],I[2],1);m.transformMat4(L,O,da.projectionMatrix);w.scale(ea.positionNDC,L,1/L[3]);ka.applyShaderOffsetsNDC(ea.positionNDC,fa,da,ea.positionNDC,P);ea.distanceWithoutPolygonOffset=da.depthNDCToWorld(P[2]); ea.distance=P[2]===ea.positionNDC[2]?ea.distanceWithoutPolygonOffset:da.depthNDCToWorld(ea.positionNDC[2]);m.set(L,ea.positionNDC[0],ea.positionNDC[1],ea.positionNDC[2],1);m.transformMat4(O,L,ca);m.scale(O,O,1/O[3]);w.set(ea.positionView,I[0],I[1],I[2])}_isCulledBySlice(Z,ca){return Z.slicePlaneEnabled&&this._viewState.slicePlaneEnabled&&x.extrusionContainsPoint(this._viewState.slicePlane,ca)}_expandBoundingRect(Z,ca,ea,{positionNDC:da,scaleInfo:ia}){const ka=this._viewState.camera;ca=ca.getScreenSize(ha); D.applyPrecomputedScaleFactor(ca,ia.factor,ca);ca[0]*=ka.pixelRatio;ca[1]*=ka.pixelRatio;ea=u.offset(ea.calculateRelativeScreenBounds(ca,ia.factorAlignment.scale,Q),l.lerp(0,ka.fullWidth,.5+.5*da[0]),l.lerp(0,ka.fullHeight,.5+.5*da[1]));da=this.marginFactor;0!==da&&(da*=Math.min(u.width(ea),u.height(ea)),ea[0]-=da,ea[1]-=da,ea[2]+=da,ea[3]+=da);u.expand(Z.aabr,ea,Z.aabr)}_isConflicted(Z){const ca=Z.graphics3DGraphic.graphic.uid;Z=Z.info[this.visibilityGroup];let ea=!0;for(let da=Math.floor(Z.aabr[0]/ this._accBinsSizeX);da<=Math.floor(Z.aabr[2]/this._accBinsSizeX);da++)if(!(0>da||da>=this._accBinsNumX))for(let ia=Math.floor(Z.aabr[1]/this._accBinsSizeY);ia<=Math.floor(Z.aabr[3]/this._accBinsSizeY);ia++){if(0>ia||ia>=this._accBinsNumY)continue;ea=!1;const ka=this._accBins[da][ia];for(let fa=0;faea||ea>=this._accBinsNumX))for(let ka=ia;ka<=ca;ka++)0>ka||ka>=this._accBinsNumY||this._accBins[ea][ka].push(Z)}_setGraphicVisibility(Z,ca){Z=Z.graphics3DGraphic;Z.destroyed||(Z.setVisibilityFlag(this.visibilityGroup,B.VisibilityFlag.DECONFLICTION,ca),this.visibilityGroup===B.VisibilityGroup.LABEL&&this.view.labeler.setLabelGraphicVisibility(Z, ca))}};b.__decorate([k.property({constructOnly:!0})],a.Deconflictor.prototype,"view",void 0);b.__decorate([k.property({type:Boolean,readOnly:!0})],a.Deconflictor.prototype,"updating",null);a.Deconflictor=b.__decorate([e.subclass("esri.views.3d.layers.graphics.Deconflictor")],a.Deconflictor);class T{constructor(){this.id=0;this.visible=!1;this.distance=this.prio=0}}class Y{constructor(Z=null,ca=null,ea=null){this.active=Z;this.visible=ca;this.sort=ea;this.sortArray=new p({allocator:da=>da||new T})}} const ha=t.create();class ba{constructor(){this.positionView=v.create();this.positionNDC=v.create();this.distanceWithoutPolygonOffset=this.distance=0;this.scaleInfo=new N.ScaleInfo}get isOutsideScreen(){const Z=this.positionNDC;return-1>Z[0]||-1>Z[1]||-1>Z[2]||1<=Z[0]||1<=Z[1]}}const U=new ba;a.DeconflictorGraphic=S;a.DeconflictorViewState=V;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/deconflictorDebug":function(){define(["exports","../../support/debugFlags"], function(a,b){function q(g,d,t,w,v){f&&(f(),f=null);const m=c.height,r=e;r.beginPath();r.lineWidth=1;r.strokeStyle=v;r.moveTo(g,m-t);r.lineTo(d,m-t);r.stroke();r.lineTo(d,m-w);r.stroke();r.lineTo(d,m-t);r.stroke();r.lineTo(g,m-t);r.stroke();r.lineTo(g,m-t);r.stroke();r.closePath()}let l=!1,p=!1,k=!1,h=!1,f=null,c,e;a.drawAccelerationStruct=function(g,d){if(p&&e){f&&(f(),f=null);var t=e,w=0;for(let v=0;v{null==c&&(c=document.createElement("canvas"),c.setAttribute("id","debugCanvas2d"),g.surface.parentElement.style.position="relative",g.surface.parentElement.appendChild(c));var {state:d}=g;const {camera:t,pixelRatio:w}=d,{width:v,height:m}=t;d=m*w;c.setAttribute("width",`${v*w}px`);c.setAttribute("height",`${d}px`);c.setAttribute("style",`position:absolute;left:0px;top:0px;display:block;pointer-events:none;width:${v}px;height:${m}px`); e=c.getContext("2d");e.clearRect(0,0,v,m);e.font="12px Arial"}:c&&(c.parentElement.removeChild(c),c=null)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/debugFlags":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){q=class extends q{constructor(){super(...arguments); this.LINE_WIREFRAMES=this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=this.I3S_SHOW_MODIFICATIONS=this.I3S_TREE_SHOW_TILES=this.TERRAIN_TILE_TREE_SHOW_TILES=this.FEATURE_TILE_TREE_SHOW_TILES=this.FEATURE_TILE_FETCH_SHOW_TILES=this.DRAW_MESH_GEOMETRY_NORMALS=this.TESTS_DISABLE_FAST_UPDATES=this.TESTS_DISABLE_OPTIMIZATIONS=this.SHOW_POI=this.OVERLAY_SHOW_CENTER=this.OVERLAY_DRAW_DEBUG_TEXTURE=this.TEXT_SHOW_BORDER=this.TEXT_SHOW_BASELINE= this.LABELS_SHOW_BORDER=this.DECONFLICTOR_SHOW_GRID=this.DECONFLICTOR_SHOW_INVISIBLE=this.DECONFLICTOR_SHOW_VISIBLE=this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1}};b.__decorate([l.property()],q.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0);b.__decorate([l.property()],q.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0);b.__decorate([l.property()],q.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0);b.__decorate([l.property()],q.prototype,"DECONFLICTOR_SHOW_GRID",void 0);b.__decorate([l.property()], q.prototype,"LABELS_SHOW_BORDER",void 0);b.__decorate([l.property()],q.prototype,"TEXT_SHOW_BASELINE",void 0);b.__decorate([l.property()],q.prototype,"TEXT_SHOW_BORDER",void 0);b.__decorate([l.property()],q.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0);b.__decorate([l.property()],q.prototype,"OVERLAY_SHOW_CENTER",void 0);b.__decorate([l.property()],q.prototype,"SHOW_POI",void 0);b.__decorate([l.property()],q.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0);b.__decorate([l.property()],q.prototype, "TESTS_DISABLE_FAST_UPDATES",void 0);b.__decorate([l.property()],q.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0);b.__decorate([l.property()],q.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0);b.__decorate([l.property()],q.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0);b.__decorate([l.property()],q.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0);b.__decorate([l.property()],q.prototype,"I3S_TREE_SHOW_TILES",void 0);b.__decorate([l.property()],q.prototype,"I3S_SHOW_MODIFICATIONS",void 0);b.__decorate([l.property()], q.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0);b.__decorate([l.property()],q.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0);b.__decorate([l.property()],q.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0);b.__decorate([l.property()],q.prototype,"LINE_WIREFRAMES",void 0);q=b.__decorate([f.subclass("esri.views.3d.support.debugFlags")],q);b=new q;a.debugFlags=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/enums":function(){define(["exports"], function(a){a.VisibilityFlag=void 0;(function(b){b[b.USER=1]="USER";b[b.SCALE_RANGE=2]="SCALE_RANGE";b[b.FILTER=4]="FILTER";b[b.DECONFLICTION=8]="DECONFLICTION";b[b.ALL_GRAPHIC=15]="ALL_GRAPHIC";b[b.ALL_LABEL=255]="ALL_LABEL"})(a.VisibilityFlag||(a.VisibilityFlag={}));a.VisibilityGroup=void 0;(function(b){b[b.GRAPHIC=1]="GRAPHIC";b[b.LABEL=16]="LABEL"})(a.VisibilityGroup||(a.VisibilityGroup={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/screenSizePerspectiveUtils":function(){define(["exports", "../../../../core/mathUtils","../../../ViewingMode"],function(a,b,q){function l(e,g,d){d=d.parameters;f.scale=Math.min(d.divisor/(g-d.offset),1);f.factor=Math.abs(e*e*e);return f}function p(e,g){return b.lerp(e*Math.max(g.scale,g.minScaleFactor),e,g.factor)}class k{get minScaleFactor(){return null!=this._fontHeight?Math.min(this._description.minPixelSize/this._fontHeight,1):0}constructor(e,g,d,t={camera:{distance:0,fovY:0},divisor:0,offset:0},w){this._viewingMode=e;this._description=g;this._ellipsoidRadius= d;this.parameters=t;this._fontHeight=w;this._viewingMode===q.ViewingMode.Local?(this._coverageCompensation=this._surfaceCoverageCompensationLocal,this._calculateCurvatureDependentParameters=this._calculateCurvatureDependentParametersLocal):(this._coverageCompensation=this._surfaceCoverageCompensationGlobal,this._calculateCurvatureDependentParameters=this._calculateCurvatureDependentParametersGlobal)}update(e){if(this.parameters&&this.parameters.camera.fovY===e.fovY&&this.parameters.camera.distance=== e.distance)return!1;this._calculateParameters(e,this._ellipsoidRadius,this.parameters);return!0}overrideFontHeight(e){return e!==this._fontHeight?new k(this._viewingMode,this._description,this._ellipsoidRadius,this.parameters,e):this}_calculateParameters(e,g,d){const {scaleStart:t,scaleFallOffRange:w}=this._description,{fovY:v,distance:m}=e;var r=this._calculateCurvatureDependentParameters(e,g);g=this._coverageCompensation(e,g,r);const {tiltAngle:n,scaleFallOffFactor:u}=r,x=Math.sin(n)*m,y=.5*Math.PI- n-v*(.5-t*g);r=x/Math.cos(y);g=(r-x/Math.cos(y+v*w*g)*u)/(1-u);d.camera.fovY=e.fovY;d.camera.distance=e.distance;d.offset=g;d.divisor=r-g;return d}_calculateCurvatureDependentParametersLocal(e,g,d=c){d.tiltAngle=this._description.curvatureDependent.min.tiltAngle;d.scaleFallOffFactor=this._description.curvatureDependent.min.scaleFallOffFactor;return d}_calculateCurvatureDependentParametersGlobal(e,g,d=c){const t=this._description.curvatureDependent;e=1+e.distance/g;e=Math.sqrt(e*e-1);const [w,v]=[t.min.curvature, t.max.curvature];e=b.clamp((e-w)/(v-w),0,1);const [m,r]=[t.min,t.max];d.tiltAngle=b.lerp(m.tiltAngle,r.tiltAngle,e);d.scaleFallOffFactor=b.lerp(m.scaleFallOffFactor,r.scaleFallOffFactor,e);return d}_surfaceCoverageCompensationLocal(e,g,d){return(e.fovY-d.tiltAngle)/e.fovY}_surfaceCoverageCompensationGlobal(e,g,d){const t=g*g;d=d.tiltAngle+.5*Math.PI;const {fovY:w,distance:v}=e;e=v*v+t-2*Math.cos(d)*v*g;const m=Math.sqrt(e);return(Math.acos(Math.sqrt(e-t)/m)-Math.asin(g/(m/Math.sin(d)))+.5*w)/w}}const h= {curvatureDependent:{min:{curvature:b.deg2rad(10),tiltAngle:b.deg2rad(12),scaleFallOffFactor:.5},max:{curvature:b.deg2rad(70),tiltAngle:b.deg2rad(40),scaleFallOffFactor:.8}},scaleStart:.3,scaleFallOffRange:.65,minPixelSize:0},f={scale:0,factor:0,minScaleFactor:0},c={tiltAngle:0,scaleFallOffFactor:0};a.applyPrecomputedScaleFactor=function(e,g,d=[0,0]){g=Math.min(Math.max(g.scale,g.minScaleFactor),1);d[0]=e[0]*g;d[1]=e[1]*g;return d};a.applyScaleFactor=p;a.getLabelSettings=function(e,g){const {curvatureDependent:d, scaleStart:t,scaleFallOffRange:w}=h;return new k(e,{curvatureDependent:{min:{curvature:d.min.curvature,tiltAngle:d.min.tiltAngle,scaleFallOffFactor:.7},max:{curvature:d.max.curvature,tiltAngle:d.max.tiltAngle,scaleFallOffFactor:.95}},scaleStart:t,scaleFallOffRange:w,minPixelSize:14},g)};a.getSettings=function(e,g){return new k(e,h,g)};a.precomputeScaleFactor=function(e,g,d,t){e=l(e,g,d);e.minScaleFactor=0;e=p(1,e);t.scale=e;t.factor=0;t.minScaleFactor=d.minScaleFactor};a.scale=function(e,g,d,t){return p(e, l(g,d,t))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/HUDMaterial":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../core/libs/gl-matrix-2/types/mat4 ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/buffer/BufferView ../../layers/support/FastSymbolUpdates ../../support/debugFlags ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/hud/HUD.glsl ../lib/GLTextureMaterial ../lib/Material ../lib/RenderSlot ../lib/screenSizePerspectiveUtils ../lib/Util ../lib/VertexAttribute ./ScaleInfo ./internal/bufferWriterUtils ./internal/MaterialUtil ../../../../chunks/HUDMaterial.glsl ../shaders/HUDMaterialTechnique ../shaders/HUDMaterialTechniqueConfiguration".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G){function I(fa,X,ja,la){d.isMat4(X)&&(X=l.fromMat4(V,X));c.transformMat3(la.normal,fa,X);c.transformMat4(la.normal,la.normal,ja.viewInverseTransposeMatrix);la.cosAngle=c.dot(Q,ca);return la}function O(fa,X,ja,la,na,va,za,ya){X=X-na-(0X&&fa[0]ja&&fa[1]n.isColorHighlightOrOID(X)&&!this.parameters.drawInSecondSlot],[z.RenderSlot.LABEL_MATERIAL,X=>n.isColorHighlightOrOID(X)&&this.parameters.drawInSecondSlot],[z.RenderSlot.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest], [z.RenderSlot.DRAPED_MATERIAL,X=>n.isColorHighlightOrOID(X)]])}getConfiguration(fa,X){this._configuration.output=fa;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset;this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective;this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits;this._configuration.hasPolygonOffset=this.parameters.polygonOffset;this._configuration.draped= this.parameters.draped;this._configuration.occlusionTestEnabled=this.parameters.occlusionTest;this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled;this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField;this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.occlusionPass= X.slot===z.RenderSlot.OCCLUSION_PIXELS&&this.parameters.occlusionTest;fa===n.ShaderOutput.Color&&(this._configuration.debugDrawLabelBorder=!!m.debugFlags.LABELS_SHOW_BORDER);this._configuration.depthEnabled=this.parameters.depthEnabled;this._configuration.transparencyPassType=X.transparencyPassType;this._configuration.multipassEnabled=X.multipassEnabled;this._configuration.cullAboveGround=X.multipassTerrain.cullAboveGround;return this._configuration}intersect(fa,X,ja,la,na,va){if(ja.options.selectionMode&& ja.options.hud&&fa.visible&&ja.point){la=this.parameters;na=ja.point;var za=ja.camera,{scaleX:ya,scaleY:Da}=this._getScreenScale(fa);ya*=za.pixelRatio;Da*=za.pixelRatio;l.fromMat4(S,X);if(fa.attributes.has(C.VertexAttribute.FEATUREATTRIBUTE)){var ra=S,xa=ra[0],Ma=ra[1],Ga=ra[2],Pa=ra[3],Qa=ra[4],Ea=ra[5],ua=ra[6],Na=ra[7];const Ua=ra[8],wa=1/Math.sqrt(xa*xa+Ma*Ma+Ga*Ga),sa=1/Math.sqrt(Pa*Pa+Qa*Qa+Ea*Ea),Ha=1/Math.sqrt(ua*ua+Na*Na+Ua*Ua);ra[0]=xa*wa;ra[1]=Ma*wa;ra[2]=Ga*wa;ra[3]=Pa*sa;ra[4]=Qa*sa; ra[5]=Ea*sa;ra[6]=ua*Ha;ra[7]=Na*Ha;ra[8]=Ua*Ha}ra=fa.attributes.get(C.VertexAttribute.POSITION);xa=fa.attributes.get(C.VertexAttribute.SIZE);Ma=fa.attributes.get(C.VertexAttribute.NORMAL);fa=fa.attributes.get(C.VertexAttribute.CENTEROFFSETANDDISTANCE);B.assert(3<=ra.size);Ga=N.calculateAnchorPosForRendering(la);Pa="screen"===this.parameters.centerOffsetUnits;for(Qa=0;Qa=this.parameters.shaderPolygonOffset)return c.copy(na,fa);X=q.clamp(Math.abs(X.cosAngle),.01,1);la=1-Math.sqrt(1-X*X)/X/la.viewport[2];0fa.length){fa=this._material.parameters;var za=va=0;var ya=fa.texCoordScale[0];var Da=fa.texCoordScale[1]}else va=fa[0],za=fa[1],ya=fa[2],Da=fa[3];ya=Math.min(1.99999,ya+1);Da=Math.min(1.99999,Da+1);fa=ja.attributes.get(C.VertexAttribute.POSITION).indices.length;X=na;var ra=la.uv0;for(let Ga=0;Gara;++ra)va.set(X,0,ya),va.set(X,1,Da),X++;ja.attributes.get(C.VertexAttribute.CENTEROFFSETANDDISTANCE)?F.writeBufferVec4(ja.attributes.get(C.VertexAttribute.CENTEROFFSETANDDISTANCE),la.centerOffsetAndDistance,na,6):F.writeBufferVec4Zeros(la.centerOffsetAndDistance, na,6*fa);ja.attributes.get(C.VertexAttribute.FEATUREATTRIBUTE)?F.writeBufferVec4(ja.attributes.get(C.VertexAttribute.FEATUREATTRIBUTE),la.featureAttribute,na,6):F.writeBufferVec4Zeros(la.featureAttribute,na,6*fa);null!=ja.objectAndLayerIdColor&&(fa=ja.attributes.get(C.VertexAttribute.POSITION)?.indices)&&(fa=fa.length,la=la.getField(C.VertexAttribute.OBJECTANDLAYERIDCOLOR,w.BufferViewVec4u8),F.writeObjectAndLayerIdColor(ja.objectAndLayerIdColor,la,fa,na,6))}}a.HUDMaterial=L;a.Parameters=ea;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/types/mat4":function(){define(["exports"],function(a){function b(l){return l instanceof Float32Array&&16<=l.length}function q(l){return Array.isArray(l)&&16<=l.length}a.isMat4=function(l){return b(l)||q(l)};a.isMat4f32=b;a.isMat4f64=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FastSymbolUpdates":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../renderers/support/lengthUtils ../../support/debugFlags ../../webgl-engine/core/shaderModules/interfaces".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){function t(S){return null!==S&&void 0!==S}function w(S){return"number"===typeof S}function v(S){return"string"===typeof S}function m(S,V){S&&S.push(V)}function r(S,V,T,Y=h.create()){S=S||0;V=V||0;T=T||0;0!==S&&k.rotateZ(Y,Y,-S/180*Math.PI);0!==V&&k.rotateX(Y,Y,V/180*Math.PI);0!==T&&k.rotateY(Y,Y,T/180*Math.PI);return Y}function n(S,V,T,Y,ha){const ba=S.minSize,U=S.maxSize;if(S.useSymbolValue)return S=Y.symbolSize[T],V.minSize[T]=S,V.maxSize[T]=S,V.offset[T]=V.minSize[T], V.factor[T]=0,V.type[T]=a.FastSizeType.DefinedSize,!0;if(t(S.field)){if(t(S.stops)){if(2===S.stops.length&&w(S.stops[0].size)&&w(S.stops[1].size))return u(S.stops[0].size,S.stops[1].size,S.stops[0].value,S.stops[1].value,V,T),V.type[T]=a.FastSizeType.DefinedSize,!0;m(ha,"Could not convert size info: stops only supported with 2 elements");return!1}if(w(ba)&&w(U)&&t(S.minDataValue)&&t(S.maxDataValue))return u(ba,U,S.minDataValue,S.maxDataValue,V,T),V.type[T]=a.FastSizeType.DefinedSize,!0;if("unknown"=== S.valueUnit)return m(ha,"Could not convert size info: proportional size not supported"),!1;if(null!=e.meterIn[S.valueUnit])return V.minSize[T]=-Infinity,V.maxSize[T]=Infinity,V.offset[T]=0,V.factor[T]=1/e.meterIn[S.valueUnit],V.type[T]=a.FastSizeType.DefinedSize,!0;m(ha,"Could not convert size info: scale-dependent size not supported");return!1}if(!t(S.field)){if(S.stops?.[0]&&w(S.stops[0].size))return V.minSize[T]=S.stops[0].size,V.maxSize[T]=S.stops[0].size,V.offset[T]=V.minSize[T],V.factor[T]= 0,V.type[T]=a.FastSizeType.DefinedSize,!0;if(w(ba))return V.minSize[T]=ba,V.maxSize[T]=ba,V.offset[T]=ba,V.factor[T]=0,V.type[T]=a.FastSizeType.DefinedSize,!0}m(ha,"Could not convert size info: unsupported variant of sizeInfo");return!1}function u(S,V,T,Y,ha,ba){Y=0Y;++Y){let ha=V.unitInMeters;S.type[Y]===a.FastSizeType.DefinedSize&&(ha*=V.modelSize[Y],S.type[Y]=a.FastSizeType.DefinedScale);S.minSize[Y]/=ha;S.maxSize[Y]/=ha;S.offset[Y]/=ha;S.factor[Y]/=ha}if(S.type[0]!==a.FastSizeType.Undefined)V= 0;else if(S.type[1]!==a.FastSizeType.Undefined)V=1;else if(S.type[2]!==a.FastSizeType.Undefined)V=2;else return m(T,"No size axis contains a valid size or scale"),!1;for(T=0;3>T;++T)S.type[T]===a.FastSizeType.Undefined&&(S.minSize[T]=S.minSize[V],S.maxSize[T]=S.maxSize[V],S.offset[T]=S.offset[V],S.factor[T]=S.factor[V],S.type[T]=S.type[V]);return!0}function z(S,V,T){S[4*V]=T.r/255;S[4*V+1]=T.g/255;S[4*V+2]=T.b/255;S[4*V+3]=T.a}function A(S,V,T){if(S.normalizationField)return m(T,"Could not convert color info: unsupported property"), null;if(v(S.field))if(S.stops){if(8T;++T){const Y=S[Math.min(T,S.length-1)];V.color.values[T]=Y.value;z(V.color.colors,T,Y.color)}}else return m(T,"Could not convert color info: missing stops or colors"),null;else if(S.stops&&0<=S.stops.length)for(S=S.stops&&0<=S.stops.length&&S.stops[0].color,V.color={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},T=0;8>T;T++)V.color.values[T]=Infinity,z(V.color.colors,T,S);else return m(T,"Could not convert color info: no field and no colors/stops"),null;return V}function B(S,V,T){if(S.normalizationField)return m(T,"Could not convert opacity info: unsupported property"),null;if(v(S.field))if(S.stops){if(8T;++T){const Y=S[Math.min(T, S.length-1)];V.opacity.values[T]=Y.value;V.opacity.opacityValues[T]=Y.opacity}}else return m(T,"Could not convert opacity info: missing stops or opacities"),null;else if(S.stops&&0<=S.stops.length)for(S=S.stops&&0<=S.stops.length?S.stops[0].opacity:0,V.opacity={field:null,values:[0,0,0,0,0,0,0,0],opacityValues:[0,0,0,0,0,0,0,0]},T=0;8>T;T++)V.opacity.values[T]=Infinity,V.opacity.opacityValues[T]=S;else return m(T,"Could not convert opacity info: no field and no opacities/stops"),null;return V}function C(S, V,T){S=2===T&&"arithmetic"===S.rotationType;V.offset[T]=S?90:0;V.factor[T]=S?-1:1;V.type[T]=1}function D(S,V,T){if(!v(S.field))return m(T,"Could not convert rotation info: field is not a string"),null;if(!V.rotation)V.rotation={field:S.field,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(S.field)if(!V.rotation.field)V.rotation.field=S.field;else if(S.field!==V.rotation.field)return m(T,"Could not convert rotation info: multiple fields in use"),null;switch(S.axis){case "tilt":return C(S,V.rotation, 0),V;case "roll":return C(S,V.rotation,1),V;case null:case void 0:case "heading":return C(S,V.rotation,2),V;default:return m(T,`Could not convert rotation info: unknown axis "${S.axis}""`),null}}function F(S,V,T){if(!S)return null;const Y=S.reduce((ha,ba)=>{if(!ha)return ha;if(ba.valueExpression)return m(T,"Could not convert visual variables: arcade expressions not supported"),null;switch(ba.type){case "size":return V.supports.size?x(ba,ha,V,T):ha;case "color":return V.supports.color?A(ba,ha,T):ha; case "opacity":return V.supports.opacity?B(ba,ha,T):null;case "rotation":return V.supports.rotation?D(ba,ha,T):ha;default:return null}},new P);return 0T;T++)if(S.type[T]!==V.type[T]||S.offset[T]!==V.offset[T]||S.factor[T]!==V.factor[T])return!1;return!0}function N(S,V){S=new J(S);S.vvSize&&(S.vvSymbolAnchor=V.anchor, k.identity(W),r(V.rotation[2],V.rotation[0],V.rotation[1],W),S.vvSymbolRotationMatrix=S.vvSymbolRotationMatrix||p.create(),l.fromMat4(S.vvSymbolRotationMatrix,W));return S}a.FastSizeType=void 0;(function(S){S[S.Undefined=0]="Undefined";S[S.DefinedSize=1]="DefinedSize";S[S.DefinedScale=2]="DefinedScale"})(a.FastSizeType||(a.FastSizeType={}));a.FastRotationType=void 0;(function(S){S[S.Undefined=0]="Undefined";S[S.DefinedAngle=1]="DefinedAngle"})(a.FastRotationType||(a.FastRotationType={}));class E{constructor(S){this.field= S}}class G extends E{constructor(S){super(S);this.minSize=[0,0,0];this.maxSize=[0,0,0];this.offset=[0,0,0];this.factor=[0,0,0];this.type=[a.FastSizeType.Undefined,a.FastSizeType.Undefined,a.FastSizeType.Undefined]}}class I extends E{constructor(S){super(S);this.colors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.values=[0,0,0,0,0,0,0,0]}}class O extends E{constructor(S){super(S);this.values=[0,0,0,0,0,0,0,0];this.opacityValues=[0,0,0,0,0,0,0,0]}}class L extends E{constructor(S){super(S); this.offset=[0,0,0];this.factor=[1,1,1];this.type=[0,0,0]}}class P{}class M{constructor(S,V=[1,1,1],T=[1,1,1],Y=1,ha=[0,0,0],ba=[1,1,1],U=[0,0,0]){this.supports=S;this.modelSize=V;this.symbolSize=T;this.unitInMeters=Y;this.anchor=ha;this.scale=ba;this.rotation=U}}class K{constructor(S,V,T){this.visualVariables=S;this.materialParameters=V;this.requiresShaderTransformation=T}}class J extends d.NoParameters{constructor(S){super();this.vvSize=S?.size??null;this.vvColor=S?.color??null;this.vvOpacity=S?.opacity?? null}}const R=h.create(),Q=c.create(),W=h.create();a.ConvertOptions=M;a.FastColorInfo=I;a.FastOpacityInfo=O;a.FastRotationInfo=L;a.FastSizeInfo=G;a.FastSymbolUpdatesState=K;a.FastVisualVariables=P;a.VisualVariablesParameters=J;a.convertVisualVariables=F;a.evaluateModelTransform=function(S,V,T){if(!S.vvSize)return T;k.copy(R,T);T=S.vvSymbolRotationMatrix;k.set(W,T[0],T[1],T[2],0,T[3],T[4],T[5],0,T[6],T[7],T[8],0,0,0,0,1);k.multiply(R,R,W);for(T=0;3>T;++T)Q[T]=q.clamp(S.vvSize.offset[T]+V[0]*S.vvSize.factor[T], S.vvSize.minSize[T],S.vvSize.maxSize[T]);k.scale(R,R,Q);k.translate(R,R,S.vvSymbolAnchor);return R};a.evaluateModelTransformScale=function(S,V,T){if(!V.vvSize)return f.set(S,1,1,1),S;for(let Y=0;3>Y;++Y)S[Y]=q.clamp(V.vvSize.offset[Y]+T[0]*V.vvSize.factor[Y],V.vvSize.minSize[Y],V.vvSize.maxSize[Y]);return S};a.getAttributeValue=function(S,V){S=null==S?0:V.attributes[S];return"number"===typeof S&&isFinite(S)?S:0};a.getMaterialParameters=N;a.initFastSymbolUpdatesState=function(S,V){return!S||g.debugFlags.TESTS_DISABLE_FAST_UPDATES? null:(S=F(S.visualVariables,V))?new K(S,N(S,V),!!S.size):null};a.updateFastSymbolUpdatesState=function(S,V,T){if(!V||!S)return!1;const Y=S.visualVariables;V=F(V.visualVariables,T);if(!(V&&H(Y.size,V.size,"size")&&H(Y.color,V.color,"color")&&H(Y.rotation,V.rotation,"rotation")&&H(Y.opacity,V.opacity,"opacity")))return!1;S.visualVariables=V;S.materialParameters=N(V,T);S.requiresShaderTransformation=!!V.size;return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl":function(){define("exports ../attributes/VerticalOffset.glsl ../util/ScreenSizePerspective.glsl ../util/View.glsl ../../shaderModules/Float4PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f){a.HUD=function(c,e){c.include(q.ScreenSizePerspective);c.attributes.add(f.VertexAttribute.POSITION,"vec3");c.attributes.add(f.VertexAttribute.NORMAL,"vec3");c.attributes.add(f.VertexAttribute.CENTEROFFSETANDDISTANCE,"vec4");c=c.vertex;l.addProjViewLocalOrigin(c,e);l.addCameraPosition(c,e);c.uniforms.add(new p.Float4PassUniform("viewport",(g,d)=>d.camera.fullViewport),new k.FloatPassUniform("polygonOffset",g=>g.shaderPolygonOffset),new k.FloatPassUniform("cameraGroundRelative", (g,d)=>d.camera.aboveGround?1:-1));e.hasVerticalOffset&&b.addVerticalOffset(c);c.constants.add("smallOffsetAngle","float",.984807753012208);c.code.add(h.glsl`struct ProjectHUDAux { vec3 posModel; vec3 posView; vec3 vnormal; float distanceToCamera; float absCosAngle; };`);c.code.add(h.glsl` float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) { float pointGroundSign = ${e.multipassEnabled?h.glsl.float(0):h.glsl`sign(pointGroundDistance)`}; if (pointGroundSign == 0.0) { pointGroundSign = cameraGroundRelative; } // cameraGroundRelative is -1 if camera is below ground, 1 if above ground // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise float groundRelative = cameraGroundRelative * pointGroundSign; // view angle dependent part of polygon offset emulation: we take the absolute value because the sign that is // dropped is instead introduced using the ground-relative position of the symbol and the camera if (polygonOffset > .0) { float cosAlpha = clamp(absCosAngle, 0.01, 1.0); float tanAlpha = sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha; float factor = (1.0 - tanAlpha / viewport[2]); // same side of the terrain if (groundRelative > 0.0) { posView *= factor; } // opposite sides of the terrain else { posView /= factor; } } return groundRelative; } `);e.draped&&!e.hasVerticalOffset||l.addViewNormal(c);e.draped||(c.uniforms.add(new k.FloatPassUniform("perDistancePixelRatio",(g,d)=>Math.tan(d.camera.fovY/2)/(d.camera.fullViewport[2]/2))),c.code.add(h.glsl` void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) { float distanceToCamera = length(posView); // Compute offset in world units for a half pixel shift float pixelOffset = distanceToCamera * perDistancePixelRatio * ${h.glsl.float(.5)}; // Apply offset along normal in the direction away from the ground surface vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset; // Apply the same offset also on the view space position vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; posModel += modelOffset; posView += viewOffset; } `));e.screenCenterOffsetUnitsEnabled&&l.addPixelRatio(c);e.hasScreenSizePerspective&&q.addScreenSizePerspectiveAlignment(c);c.code.add(h.glsl` vec4 projectPositionHUD(out ProjectHUDAux aux) { vec3 centerOffset = centerOffsetAndDistance.xyz; float pointGroundDistance = centerOffsetAndDistance.w; aux.posModel = position; aux.posView = (view * vec4(aux.posModel, 1.0)).xyz; aux.vnormal = normal; ${e.draped?"":"applyHUDVerticalGroundOffset(aux.vnormal, aux.posModel, aux.posView);"} // Screen sized offset in world space, used for example for line callouts // Note: keep this implementation in sync with the CPU implementation, see // - MaterialUtil.verticalOffsetAtDistance // - HUDMaterial.applyVerticalOffsetTransformation aux.distanceToCamera = length(aux.posView); vec3 viewDirObjSpace = normalize(cameraPosition - aux.posModel); float cosAngle = dot(aux.vnormal, viewDirObjSpace); aux.absCosAngle = abs(cosAngle); ${e.hasScreenSizePerspective?e.hasVerticalOffset||e.screenCenterOffsetUnitsEnabled?"vec3 perspectiveFactor \x3d screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);":"":""} ${e.hasVerticalOffset?e.hasScreenSizePerspective?"float verticalOffsetScreenHeight \x3d applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);":"float verticalOffsetScreenHeight \x3d verticalOffset.x;":""} ${e.hasVerticalOffset?h.glsl` float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w); vec3 modelOffset = aux.vnormal * worldOffset; aux.posModel += modelOffset; vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; aux.posView += viewOffset; // Since we elevate the object, we need to take that into account // in the distance to ground pointGroundDistance += worldOffset;`:""} float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView); ${e.screenCenterOffsetUnitsEnabled?"":h.glsl` // Apply x/y in view space, but z in screen space (i.e. along posView direction) aux.posView += vec3(centerOffset.x, centerOffset.y, 0.0); // Same material all have same z != 0.0 condition so should not lead to // branch fragmentation and will save a normalization if it's not needed if (centerOffset.z != 0.0) { aux.posView -= normalize(aux.posView) * centerOffset.z; } `} vec4 posProj = proj * vec4(aux.posView, 1.0); ${e.screenCenterOffsetUnitsEnabled?e.hasScreenSizePerspective?"float centerOffsetY \x3d applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);":"float centerOffsetY \x3d centerOffset.y;":""} ${e.screenCenterOffsetUnitsEnabled?"posProj.xy +\x3d vec2(centerOffset.x, centerOffsetY) * pixelRatio * 2.0 / viewport.zw * posProj.w;":""} // constant part of polygon offset emulation posProj.z -= groundRelative * polygonOffset * posProj.w; return posProj; } `)};a.HUDVerticalPixelOffset=.5;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl":function(){define("exports ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../util/ScreenSizePerspective.glsl ../util/View.glsl ../../shaderModules/Float4PassUniform ../../shaderModules/interfaces".split(" "),function(a,b,q,l,p,k,h){function f(e){e.uniforms.add(new k.Float4PassUniform("verticalOffset", (g,d)=>{const {minWorldLength:t,maxWorldLength:w,screenLength:v}=g.verticalOffset;return b.set(c,v*(d.camera.pixelRatio||1),Math.tan(.5*d.camera.fovY)/(.5*d.camera.fullViewport[3]),t,w)}))}const c=q.create();a.VerticalOffset=function(e,g){const d=e.vertex;g.hasVerticalOffset?(f(d),g.hasScreenSizePerspective&&(e.include(l.ScreenSizePerspective),l.addScreenSizePerspectiveAlignment(d),p.addCameraPosition(e.vertex,g)),d.code.add(h.glsl` vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) { float viewDistance = length((view * vec4(worldPos, 1.0)).xyz); ${g.spherical?h.glsl`vec3 worldNormal = normalize(worldPos + localOrigin);`:h.glsl`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`} ${g.hasScreenSizePerspective?h.glsl` float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition)); float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:h.glsl` float verticalOffsetScreenHeight = verticalOffset.x;`} // Screen sized offset in world space, used for example for line callouts float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w); return worldNormal * worldOffset; } vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos + calculateVerticalOffset(worldPos, localOrigin); } `)):d.code.add(h.glsl`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)};a.addVerticalOffset=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl":function(){define(["exports","../../../../../../chunks/vec32","../../../../../../core/libs/gl-matrix-2/factories/vec3f64","../../shaderModules/Float3PassUniform","../../shaderModules/interfaces"],function(a,b,q,l,p){function k(f){return b.set(h, f.parameters.divisor,f.parameters.offset,f.minScaleFactor)}const h=q.create();a.ScreenSizePerspective=function(f){f.vertex.code.add(p.glsl`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) { return absCosAngle * absCosAngle * absCosAngle; }`);f.vertex.code.add(p.glsl`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) { return vec3( min(params.x / (distanceToCamera - params.y), 1.0), screenSizePerspectiveViewAngleDependentFactor(absCosAngle), params.z ); }`);f.vertex.code.add(p.glsl`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) { return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); }`);f.vertex.code.add(p.glsl`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) { return applyScreenSizePerspectiveScaleFactorFloat( size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params) ); }`);f.vertex.code.add(p.glsl`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) { return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); }`);f.vertex.code.add(p.glsl`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) { return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)); }`)};a.addScreenSizePerspective=function(f){f.uniforms.add(new l.Float3PassUniform("screenSizePerspective",c=>k(c.screenSizePerspective)))};a.addScreenSizePerspectiveAlignment=function(f){f.uniforms.add(new l.Float3PassUniform("screenSizePerspectiveAlignment",c=>k(c.screenSizePerspectiveAlignment||c.screenSizePerspective)))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Material":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../core/shaderModules/interfaces ./AnimationTimer ./basicInterfaces ./ContentObject ./ContentObjectType ./DefaultVertexAttributeLocations ../materials/internal/MaterialUtil".split(" "), function(a,b,q,l,p,k,h,f,c){class e extends k.ContentObject{constructor(t,w){super();this.type=h.ContentObjectType.Material;this.supportsEdges=!1;this._visible=!0;this._renderPriority=0;this._vertexAttributeLocations=f.Default3D;this._pp0=b.fromValues(0,0,1);this._pp1=b.fromValues(0,0,0);this._parameters=c.copyParameters(t,w);this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(t){return!1}setParameters(t,w=!0){c.updateParameters(this._parameters,t)&&(this.validateParameters(this._parameters), w&&this.parametersChanged())}validateParameters(t){}get visible(){return this._visible}set visible(t){t!==this._visible&&(this._visible=t,this.parametersChanged())}shouldRender(t){return this.isVisible()&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bindParameters.decorations===p.Decorations.ON)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&& (this._renderPriority=t,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(t){return this.isVisible()&&this.parameters.renderOccluded===t}intersectDraped(t,w,v,m,r,n){this._pp0[0]=this._pp1[0]=m[0];this._pp0[1]=this._pp1[1]=m[1];return this.intersect(t,w,v,this._pp0,this._pp1,r)}}class g extends l.Parameters{constructor(t,w,v){super(w,v); this.camera=t}}a.RenderOccludedFlag=void 0;(function(t){t[t.None=0]="None";t[t.Occlude=1]="Occlude";t[t.Transparent=2]="Transparent";t[t.OccludeAndTransparent=4]="OccludeAndTransparent";t[t.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil";t[t.Opaque=16]="Opaque"})(a.RenderOccludedFlag||(a.RenderOccludedFlag={}));class d extends q.NoParameters{constructor(){super(...arguments);this.renderOccluded=a.RenderOccludedFlag.Occlude;this.isDecoration=!1}}a.Material=e;a.MaterialParameters=d;a.UpdateParameters= g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/internal/MaterialUtil":function(){define(["exports","../../../../../core/arrayUtils","../../../../../core/mathUtils","../../lib/screenSizePerspectiveUtils"],function(a,b,q,l){function p(h,f){f=f?p(f):{};for(const c in h){let e=h[c];e?.forEach&&(e=k(e));null==e&&c in f||(f[c]=e)}return f}function k(h){const f=[];h.forEach(c=>f.push(c));return f}a.colorMixModes={multiply:1,ignore:2,replace:3,tint:4}; a.copyParameters=p;a.updateParameters=function(h,f){let c=!1;for(const e in f){const g=f[e];void 0!==g&&(Array.isArray(g)?null===h[e]?(h[e]=g.slice(),c=!0):b.update(h[e],g)&&(c=!0):h[e]!==g&&(c=!0,h[e]=g))}return c};a.verticalOffsetAtDistance=function(h,f,c,e,g){let d=(c.screenLength||0)*h.pixelRatio;null!=g&&(d=l.scale(d,e,f,g));return q.clamp(d*Math.tan(.5*h.fovY)/(.5*h.fullHeight)*f,c.minWorldLength||0,null!=c.maxWorldLength?c.maxWorldLength:Infinity)};Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/webgl-engine/materials/ScaleInfo":function(){define(["exports"],function(a){class b{constructor(){this.factor=new q;this.factorAlignment=new q}}class q{constructor(){this.minScaleFactor=this.factor=this.scale=0}}a.ScaleFactor=q;a.ScaleInfo=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/internal/bufferWriterUtils":function(){define(["exports","../../../../../core/libs/gl-matrix-2/math/mat4","../../../../../geometry/support/buffer/BufferView", "../../lib/Util","../../lib/VertexAttribute"],function(a,b,q,l,p){function k(m,r,n){const {data:u,indices:x}=m;m=r.typedBuffer;r=r.typedBufferStride;const y=x.length;n*=r;for(let z=0;z{M=y[R]+O;K=y[R+1]+L;J=y[R+2]+P}:R=>{const Q=y[R],W=y[R+1];R=y[R+2];M=B*Q+F*W+E*R+O;K=C*Q+H*W+G*R+L;J=D*Q+N*W+I*R+P};if(1===x)for(x=0;x{L=y[J];P=y[J+1];M=y[J+2]}:J=>{const R=y[J],Q=y[J+1];J=y[J+2];L=B*R+F*Q+E*J;P=C*R+H*Q+G*J;M=D*R+N*Q+I*J};if(1===x)if(O)for(x=0;xO&&1E-6K&&1E-6P&&1E-6M&&1E-6B;++B)m[n+B]=u[A+B];n+=r}};a.writeBufferMat4f=function(m,r,n){const {data:u,indices:x}=m;m=r.typedBuffer;r=r.typedBufferStride;const y=x.length;n*=r;for(let z=0;zB;++B)m[n+B]=u[A+B];n+=r}};a.writeBufferVec2=k;a.writeBufferVec3=h;a.writeBufferVec4=f;a.writeBufferVec4Zeros=function(m,r,n){const u=m.typedBuffer;m=m.typedBufferStride;r*=m;for(let x=0;xJ.camera.fullViewport),new u.Float2PassUniform("screenOffset",(K,J)=>b.set(N,2*K.screenOffset[0]*J.camera.pixelRatio,2*K.screenOffset[1]*J.camera.pixelRatio)),new u.Float2PassUniform("anchorPosition",K=>H(K)),new x.Float4PassUniform("materialColor",K=>K.color));n.addPixelRatio(O);I&&(O.uniforms.add(new x.Float4PassUniform("outlineColor",K=>K.outlineColor)),L.uniforms.add(new x.Float4PassUniform("outlineColor", K=>00K.texture));P=E.debugDrawLabelBorder?z.glsl`(isBorder > 0.0 ? 0.0 : ${z.glsl.float(w.defaultMaskAlphaCutoff)})`:z.glsl.float(w.defaultMaskAlphaCutoff);I=z.glsl` ${E.debugDrawLabelBorder?z.glsl` float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`:""} ${E.sampleSignedDistanceFieldTexelCenter?z.glsl` // Attempt to sample texel centers to avoid that thin cross outlines // disappear with large symbol sizes. // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603041 float txSize = float(textureSize(tex, 0).x); float texelSize = 1.0 / txSize; // Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel vec2 scaleFactor = (vsize - txSize) * texelSize; vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor; `:z.glsl` vec2 samplePos = vtc; `} ${I?z.glsl` vec4 fillPixelColor = vcolor; // Get distance and map it into [-0.5, 0.5] float d = rgba2float(texture(tex, samplePos)) - 0.5; // Distance in output units (i.e. pixels) float dist = d * vsize.x; // Create smooth transition from the icon into its outline float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0); fillPixelColor.a *= fillAlphaFactor; if (outlineSize > 0.25) { vec4 outlinePixelColor = outlineColor; float clampedOutlineSize = min(outlineSize, 0.5*vsize.x); // Create smooth transition around outline float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0); outlinePixelColor.a *= outlineAlphaFactor; if ( outlineAlphaFactor + fillAlphaFactor < ${P} || fillPixelColor.a + outlinePixelColor.a < ${z.glsl.float(w.symbolAlphaCutoff)} ) { discard; } // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description) float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a); vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a + vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a); fragColor = vec4(compositeColor, compositeAlpha); } else { if (fillAlphaFactor < ${P}) { discard; } fragColor = premultiplyAlpha(fillPixelColor); } // visualize SDF: // fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0); `:z.glsl` vec4 texColor = texture(tex, vtc, -0.5); if (texColor.a < ${P}) { discard; } fragColor = texColor * premultiplyAlpha(vcolor); `} // Draw debug border with transparency, so that original texels along border are still partially visible ${E.debugDrawLabelBorder?z.glsl`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`:""} `;switch(E.output){case p.ShaderOutput.Color:E.transparencyPassType===C.TransparencyPassType.ColorAlpha&&(G.outputs.add("fragColor","vec4",0),G.outputs.add("fragAlpha","float",1));L.code.add(z.glsl` void main() { ${I} ${E.transparencyPassType===C.TransparencyPassType.FrontFace?"fragColor.rgb /\x3d fragColor.a;":""} ${E.transparencyPassType===C.TransparencyPassType.ColorAlpha?"fragAlpha \x3d fragColor.a;":""} }`);break;case p.ShaderOutput.ObjectAndLayerIdColor:L.code.add(z.glsl` void main() { ${I} outputObjectAndLayerIdColor(); }`);break;case p.ShaderOutput.Highlight:L.constants.add("occludedHighlightFlag","vec4",d.occludedHighlightFlag),L.constants.add("unoccludedHighlightFlag","vec4",d.unoccludedHighlightFlag),L.code.add(z.glsl` void main() { ${I} if (voccluded == 1.0) { fragColor = occludedHighlightFlag; } else { fragColor = unoccludedHighlightFlag; } }`)}return G}function H(E,G=N){if(E.textureIsSignedDistanceField){var I=E.anchorPosition;E=E.distanceFieldBoundingBox;null!=E?b.set(G,I[0]*(E[2]-E[0])+E[0],I[1]*(E[3]-E[1])+E[1]):b.set(G,0,0)}else b.copy(G,E.anchorPosition);return G}const N=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:F,calculateAnchorPosForRendering:H},Symbol.toStringTag,{value:"Module"}));a.HUDMaterial=q;a.build=F;a.calculateAnchorPosForRendering=H})},"esri/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl":function(){define("exports ../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../shaderModules/Float3DrawUniform ../shaderModules/Float3PassUniform ../shaderModules/interfaces".split(" "), function(a,b,q,l,p,k,h,f){function c(x,y,...z){if(y.hasSlicePlane){y.hasSliceInVertexProgram&&x.vertex.uniforms.add(...z);x.fragment.uniforms.add(...z);z=f.glsl`struct SliceFactors { float front; float side0; float side1; float side2; float side3; }; SliceFactors calculateSliceFactors(vec3 pos) { vec3 rel = pos - slicePlaneOrigin; vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2); float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin); float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1); float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2); float basis1Dot = dot(slicePlaneBasis1, rel); float basis2Dot = dot(slicePlaneBasis2, rel); return SliceFactors( dot(slicePlaneNormal, pos) + slicePlaneW, -basis1Dot - basis1Len2, basis1Dot - basis1Len2, -basis2Dot - basis2Len2, basis2Dot - basis2Len2 ); } bool sliceByFactors(SliceFactors factors) { return factors.front < 0.0 && factors.side0 < 0.0 && factors.side1 < 0.0 && factors.side2 < 0.0 && factors.side3 < 0.0; } bool sliceEnabled() { return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0; } bool sliceByPlane(vec3 pos) { return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos)); } #define rejectBySlice(_pos_) sliceByPlane(_pos_) #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`;var A=f.glsl`vec4 applySliceHighlight(vec4 color, vec3 pos) { SliceFactors factors = calculateSliceFactors(pos); const float HIGHLIGHT_WIDTH = 1.0; const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3); factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front); factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0); factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1); factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2); factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3); if (sliceByFactors(factors)) { return color; } float highlightFactor = (1.0 - step(0.5, factors.front)) * (1.0 - step(0.5, factors.side0)) * (1.0 - step(0.5, factors.side1)) * (1.0 - step(0.5, factors.side2)) * (1.0 - step(0.5, factors.side3)); return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a); }`;A=y.hasSliceHighlight?f.glsl` ${A} #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_)) `:f.glsl`#define highlightSlice(_color_, _pos_) (_color_)`;y.hasSliceInVertexProgram&&x.vertex.code.add(z);x.fragment.code.add(z);x.fragment.code.add(A)}else z=f.glsl`#define rejectBySlice(_pos_) false #define discardBySlice(_pos_) {} #define highlightSlice(_color_, _pos_) (_color_)`,y.hasSliceInVertexProgram&&x.vertex.code.add(z),x.fragment.code.add(z)}function e(x,y,z){return x.instancedDoublePrecision?l.set(m,z.camera.viewInverseTransposeMatrix[3],z.camera.viewInverseTransposeMatrix[7],z.camera.viewInverseTransposeMatrix[11]):y.slicePlaneLocalOrigin}function g(x,y){return null!=x?l.subtract(r,y.origin,x):y.origin}function d(x,y,z){return x.hasSliceTranslatedView?null!=y?b.translate(u,z.camera.viewMatrix,y):z.camera.viewMatrix: null}function t(x,y,z){if(null==z.slicePlane)return p.ZEROS;const A=e(x,y,z);y=g(A,z.slicePlane);x=d(x,A,z);return null!=x?l.transformMat4(r,y,x):y}function w(x,y,z,A){if(null==A||null==z.slicePlane)return p.ZEROS;const B=e(x,y,z);y=g(B,z.slicePlane);x=d(x,B,z);return null!=x?(l.add(n,A,y),l.transformMat4(r,y,x),l.transformMat4(n,n,x),l.subtract(n,n,r)):A}class v extends f.NoParameters{constructor(x){super();this.slicePlaneLocalOrigin=x}}const m=p.create(),r=p.create(),n=p.create(),u=q.create();a.SliceDraw= function(x,y){c(x,y,new k.Float3DrawUniform("slicePlaneOrigin",(z,A)=>t(y,z,A)),new k.Float3DrawUniform("slicePlaneBasis1",(z,A)=>w(y,z,A,A.slicePlane?.basis1)),new k.Float3DrawUniform("slicePlaneBasis2",(z,A)=>w(y,z,A,A.slicePlane?.basis2)))};a.SlicePass=function(x,y){c(x,y,new h.Float3PassUniform("slicePlaneOrigin",(z,A)=>t(y,z,A)),new h.Float3PassUniform("slicePlaneBasis1",(z,A)=>w(y,z,A,A.slicePlane?.basis1)),new h.Float3PassUniform("slicePlaneBasis2",(z,A)=>w(y,z,A,A.slicePlane?.basis2)))};a.SlicePlaneParameters= v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl":function(){define(["exports","../ShaderOutput","../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q,l){a.ObjectAndLayerIdColor=function(p,k){const h=k.output===b.ShaderOutput.ObjectAndLayerIdColor;k=k.objectAndLayerIdColorInstanced;h&&(p.varyings.add("objectAndLayerIdColorVarying","vec4"),k?p.attributes.add(l.VertexAttribute.INSTANCEOBJECTANDLAYERIDCOLOR, "vec4"):p.attributes.add(l.VertexAttribute.OBJECTANDLAYERIDCOLOR,"vec4"));p.vertex.code.add(q.glsl` void forwardObjectAndLayerIdColor() { ${h?k?q.glsl`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;`:q.glsl`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:q.glsl``} }`);p.fragment.code.add(q.glsl` void outputObjectAndLayerIdColor() { ${h?q.glsl`fragColor = objectAndLayerIdColorVarying;`:q.glsl``} }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl":function(){define(["exports","../../shaderModules/BooleanPassUniform","../../shaderModules/interfaces"],function(a,b,q){a.AlignPixel=function(l){l.uniforms.add(new b.BooleanPassUniform("alignPixelEnabled",(p,k)=>k.alignPixelEnabled));l.code.add(q.glsl`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) { if (!alignPixelEnabled) return clipCoord; vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w; vec2 pixelSz = vec2(1.0) / widthHeight; vec2 ij = (floor(xy * widthHeight) + vec2(0.5)) * pixelSz; vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; return vec4(result, clipCoord.zw); }`);l.code.add(q.glsl`vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) { if (!alignPixelEnabled) return clipCoord; vec2 xy = vec2(0.5) + 0.5 * clipCoord.xy / clipCoord.w; vec2 pixelSz = vec2(1.0) / widthHeight; vec2 ij = floor((xy + 0.5 * pixelSz) * widthHeight) * pixelSz; vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; return vec4(result, clipCoord.zw); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl":function(){define(["exports","./AlignPixel.glsl","../shading/MultipassTerrainTest.glsl","../../shaderModules/interfaces"],function(a,b,q,l){a.HUDOcclusionPass=function(p,k){const {vertex:h,fragment:f}=p;h.include(b.AlignPixel);k.multipassEnabled&&p.varyings.add("depth","float");h.code.add(l.glsl` void main(void) { vec4 posProjCenter; if (dot(position, position) > 0.0) { // Render single point to center of the pixel to avoid subpixel filtering to affect the marker color ProjectHUDAux projectAux; vec4 posProj = projectPositionHUD(projectAux); posProjCenter = alignToPixelCenter(posProj, viewport.zw); ${k.multipassEnabled?"depth \x3d projectAux.posView.z;":""} vec3 vpos = projectAux.posModel; if (rejectBySlice(vpos)) { // Project out of clip space posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); } } else { // Project out of clip space posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); } gl_Position = posProjCenter; gl_PointSize = 1.0; } `);p.include(q.multipassTerrainTest,k);f.code.add(l.glsl` void main() { fragColor = vec4(1); ${k.multipassEnabled?l.glsl` if(terrainDepthTest(depth)) { fragColor.g = 0.5; }`:""} } `)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl":function(){define("exports ./AlignPixel.glsl ./HUDRenderStyle ../../shaderModules/Float4PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform".split(" "),function(a,b,q,l,p,k,h){a.HUDVisibility=function(f){f.vertex.uniforms.add(new p.FloatPassUniform("renderTransparentlyOccludedHUD",(c,e)=>e.hudRenderStyle=== q.HUDRenderStyle.Occluded?1:e.hudRenderStyle===q.HUDRenderStyle.NotOccluded?0:.75),new l.Float4PassUniform("viewport",(c,e)=>e.camera.fullViewport),new h.Texture2DPassUniform("hudVisibilityTexture",(c,e)=>e.hudVisibility?.getTexture()));f.vertex.include(b.AlignPixel);f.vertex.code.add(k.glsl`bool testHUDVisibility(vec4 posProj) { vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw); vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w); if (renderTransparentlyOccludedHUD > 0.5) { return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0; } return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl":function(){define(["exports","../../../../../../core/libs/gl-matrix-2/factories/vec4f64","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){const p=b.fromValues(1,1,0,1),k=b.fromValues(1,0,1,1);a.OutputHighlight=function(h){h.fragment.uniforms.add(new l.Texture2DPassUniform("depthTexture",(f,c)=>c.mainDepth));h.fragment.constants.add("occludedHighlightFlag", "vec4",p).add("unoccludedHighlightFlag","vec4",k);h.fragment.code.add(q.glsl`void outputHighlight() { float sceneDepth = float(texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x); if (gl_FragCoord.z > sceneDepth + 5e-7) { fragColor = occludedHighlightFlag; } else { fragColor = unoccludedHighlightFlag; } }`)};a.occludedHighlightFlag=p;a.unoccludedHighlightFlag=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl":function(){define("exports ../../shaderModules/Float3PassUniform ../../shaderModules/Float4sPassUniform ../../shaderModules/FloatsPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix3PassUniform ../../../lib/VertexAttribute ../../../materials/VisualVariablePassParameters".split(" "), function(a,b,q,l,p,k,h,f){a.VisualVariables=function(c,e){const {vertex:g,attributes:d}=c;e.hasVvInstancing&&(e.vvSize||e.vvColor)&&d.add(h.VertexAttribute.INSTANCEFEATUREATTRIBUTE,"vec4");e.vvSize?(g.uniforms.add(new b.Float3PassUniform("vvSizeMinSize",t=>t.vvSize.minSize)),g.uniforms.add(new b.Float3PassUniform("vvSizeMaxSize",t=>t.vvSize.maxSize)),g.uniforms.add(new b.Float3PassUniform("vvSizeOffset",t=>t.vvSize.offset)),g.uniforms.add(new b.Float3PassUniform("vvSizeFactor",t=>t.vvSize.factor)), g.uniforms.add(new k.Matrix3PassUniform("vvSymbolRotationMatrix",t=>t.vvSymbolRotationMatrix)),g.uniforms.add(new b.Float3PassUniform("vvSymbolAnchor",t=>t.vvSymbolAnchor)),g.code.add(p.glsl`vec3 vvScale(vec4 _featureAttribute) { return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize); } vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) { return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0); }`),g.code.add(p.glsl` const float eps = 1.192092896e-07; vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) { vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize); return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0); } ${e.hasVvInstancing?p.glsl` vec4 vvLocalNormal(vec3 _normal) { return vvTransformNormal(_normal, instanceFeatureAttribute); } vec4 localPosition() { return vvTransformPosition(position, instanceFeatureAttribute); }`:""} `)):g.code.add(p.glsl`vec4 localPosition() { return vec4(position, 1.0); } vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`);e.vvColor?(g.constants.add("vvColorNumber","int",f.vvColorNumber),g.uniforms.add(new l.FloatsPassUniform("vvColorValues",t=>t.vvColor.values,f.vvColorNumber),new q.Float4sPassUniform("vvColorColors",t=>t.vvColor.colors,f.vvColorNumber)),g.code.add(p.glsl` vec4 interpolateVVColor(float value) { if (value <= vvColorValues[0]) { return vvColorColors[0]; } for (int i = 1; i < vvColorNumber; ++i) { if (vvColorValues[i] >= value) { float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); return mix(vvColorColors[i-1], vvColorColors[i], f); } } return vvColorColors[vvColorNumber - 1]; } vec4 vvGetColor(vec4 featureAttribute) { return interpolateVVColor(featureAttribute.y); } ${e.hasVvInstancing?p.glsl` vec4 vvColor() { return vvGetColor(instanceFeatureAttribute); }`:"vec4 vvColor() { return vec4(1.0); }"} `)):g.code.add(p.glsl`vec4 vvColor() { return vec4(1.0); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k,h){super(p,"vec4",q.BindType.Pass,(f,c,e)=>f.setUniform4fv(p,k(c,e)),h)}}a.Float4sPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform":function(){define(["exports", "./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k,h){super(p,"float",q.BindType.Pass,(f,c,e)=>f.setUniform1fv(p,k(c,e)),h)}}a.FloatsPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/VisualVariablePassParameters":function(){define(["exports","../../layers/support/FastSymbolUpdates","../lib/Material"],function(a,b,q){class l extends b.VisualVariablesParameters{constructor(){super(...arguments); this.renderOccluded=q.RenderOccludedFlag.Occlude;this.isDecoration=!1}}a.VisualVariablePassParameters=l;a.vvColorNumber=8;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff":function(){define(["exports"],function(a){a.defaultMaskAlphaCutoff=.1;a.symbolAlphaCutoff=.001;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/HUDMaterialTechnique":function(){define("require exports ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../lib/TransparencyPassType ../../../../chunks/HUDMaterial.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w extends k.ShaderTechnique{initializeConfiguration(r,n){n.spherical=r.viewingMode===q.ViewingMode.Global}initializeProgram(r){return new c.Program(r.rctx,w.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){const r=this.configuration.transparencyPassType,n=this.configuration,u=r===e.TransparencyPassType.NONE;var x=r===e.TransparencyPassType.FrontFace;const y=this.configuration.hasPolygonOffset?v:null;x=n.draped?null:(u||x)&&n.output!== l.ShaderOutput.Highlight?n.depthEnabled||n.occlusionPass?t.defaultDepthWriteParams:null:null;return t.makePipelineState({blending:n.output===l.ShaderOutput.Color||n.output===l.ShaderOutput.Highlight?u?m:f.oitBlending(r):null,depthTest:n.draped?null:{func:d.CompareFunction.LEQUAL},depthWrite:x,drawBuffers:f.oitDrawBuffers(r),colorWrite:t.defaultColorWriteParams,polygonOffset:y})}get primitiveType(){return this.configuration.occlusionPass?d.PrimitiveType.POINTS:d.PrimitiveType.TRIANGLES}}w.shader=new p.ReloadableShaderModule(g.HUDMaterial, ()=>new Promise((r,n)=>a(["./HUDMaterial.glsl"],r,n)));const v={factor:0,units:-4},m=t.simpleBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ONE_MINUS_SRC_ALPHA);b.HUDMaterialTechnique=w;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/OrderIndependentTransparency":function(){define(["exports","./TransparencyPassType","../../../webgl/enums","../../../webgl/renderState"],function(a,b,q,l){const p=l.separateBlendingParams(q.BlendFactor.SRC_ALPHA,q.BlendFactor.ONE, q.BlendFactor.ONE_MINUS_SRC_ALPHA,q.BlendFactor.ONE_MINUS_SRC_ALPHA),k=l.separateBlendingParams(q.BlendFactor.ONE,q.BlendFactor.ZERO,q.BlendFactor.ONE,q.BlendFactor.ONE_MINUS_SRC_ALPHA),h={factor:-1,units:-2};a.OITPolygonOffset=h;a.OITPolygonOffsetLimit=5E5;a.blendingColorAlpha=k;a.blendingDefault=p;a.getOITPolygonOffset=function(f){return f?h:null};a.oitBlending=function(f){return f===b.TransparencyPassType.FrontFace?null:k};a.oitDepthTest=function(f,c=q.CompareFunction.LESS){return f===b.TransparencyPassType.NONE|| f===b.TransparencyPassType.FrontFace?c:q.CompareFunction.LEQUAL};a.oitDepthWrite=function(f){return f===b.TransparencyPassType.FrontFace?l.defaultDepthWriteParams:null};a.oitDrawBuffers=function(f){return f===b.TransparencyPassType.ColorAlpha?{buffers:[q.ColorAttachment.COLOR_ATTACHMENT0,q.ColorAttachment.COLOR_ATTACHMENT1]}:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/TransparencyPassType ../materials/DefaultTechniqueConfiguration".split(" "), function(a,b,q,l,p,k){class h extends k.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.transparencyPassType=p.TransparencyPassType.NONE;this.spherical=this.screenCenterOffsetUnitsEnabled=!1;this.occlusionTestEnabled=!0;this.hasPolygonOffset=this.hasSlicePlane=this.debugDrawLabelBorder=this.hasScreenSizePerspective=this.hasVerticalOffset=this.vvColor=this.vvSize=this.sampleSignedDistanceFieldTexelCenter=this.signedDistanceFieldEnabled=!1;this.pixelSnappingEnabled= this.depthEnabled=!0;this.objectAndLayerIdColorInstanced=this.occlusionPass=this.cullAboveGround=this.multipassEnabled=this.draped=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],h.prototype,"output",void 0);b.__decorate([l.parameter({count:p.TransparencyPassType.COUNT})],h.prototype,"transparencyPassType",void 0);b.__decorate([l.parameter()],h.prototype,"screenCenterOffsetUnitsEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"spherical",void 0);b.__decorate([l.parameter()], h.prototype,"occlusionTestEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"signedDistanceFieldEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"sampleSignedDistanceFieldTexelCenter",void 0);b.__decorate([l.parameter()],h.prototype,"vvSize",void 0);b.__decorate([l.parameter()],h.prototype,"vvColor",void 0);b.__decorate([l.parameter()],h.prototype,"hasVerticalOffset",void 0);b.__decorate([l.parameter()],h.prototype,"hasScreenSizePerspective",void 0);b.__decorate([l.parameter()],h.prototype, "debugDrawLabelBorder",void 0);b.__decorate([l.parameter()],h.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],h.prototype,"hasPolygonOffset",void 0);b.__decorate([l.parameter()],h.prototype,"depthEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"pixelSnappingEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"draped",void 0);b.__decorate([l.parameter()],h.prototype,"multipassEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"cullAboveGround",void 0);b.__decorate([l.parameter()], h.prototype,"occlusionPass",void 0);b.__decorate([l.parameter()],h.prototype,"objectAndLayerIdColorInstanced",void 0);b.__decorate([l.parameter({constValue:!0})],h.prototype,"hasSliceInVertexProgram",void 0);b.__decorate([l.parameter({constValue:!1})],h.prototype,"hasVvInstancing",void 0);a.HUDMaterialTechniqueConfiguration=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/LabelDeconflictor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./Deconflictor ./enums ../../../support/RenderState ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){a.LabelDeconflictor=class extends f.Deconflictor{constructor(d){super(d);this.visibilityGroup=c.VisibilityGroup.LABEL;this.marginFactor=.05;this._lastDeconfliction=0}get viewState(){return this.parent.viewState}runTask(d){if(this.parent.running)return g.Yield;const t=performance.now();if(d.state!==e.RenderState.IDLE&&2E3>t-this._lastDeconfliction)return g.Yield;super.runTask(d);this.state===f.State.Idle&&(this._lastDeconfliction=t)}enabledChanged(d,t){this.modifyGraphics(t, d.labelsEnabled)}getGraphicsLayers(d){return d.labelLayers}};b.__decorate([q.property({constructOnly:!0})],a.LabelDeconflictor.prototype,"parent",void 0);a.LabelDeconflictor=b.__decorate([h.subclass("esri.views.3d.layers.graphics.LabelDeconflictor")],a.LabelDeconflictor);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Labeler":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/asyncUtils ../../../../core/has ../../../../core/Logger ../../../../core/MapUtils ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../layers/graphics/hydratedFeatures ../../../../layers/support/labelFormatUtils ../../../../symbols/callouts/calloutUtils ./enums ./Graphics3DCalloutSymbolLayerFactory ./Graphics3DLineCalloutSymbolLayer ./graphicSymbolUtils ./LabelParameters ./labelPlacement ./placementUtils ../../webgl-engine/lib/MaterialCollection ../../webgl-engine/lib/TextRenderer ../../webgl-engine/lib/TextRenderParameters ../../webgl-engine/lib/TextTextureAtlas ../../webgl-engine/lib/WebGLLayer ../../../support/Scheduler ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G){function I(J){return!J||0===J.length}function O(J){return!0===J.labelsVisible&&!!J.labelingInfo?.some(R=>!!R.symbol)}class L{constructor(J,R){this.labelingContext=J;this.graphics3DGraphic=R;this.textInitialized=this.addedToTextureAtlas=this.visible=this.hasGraphics3DResources=!1;this.textRenderers=[];this.textLabelPlacements=[]}}class P{constructor(J,R,Q,W,S){this.labelClass=J;this.graphics3DSymbol=R;this.graphics3DCalloutSymbolLayer= Q;this.textRenderParameters=W;this.labelFunction=S;this.calloutSymbolLayerIndex=0}}class M{constructor(J,R,Q,W,S,V,T,Y){this.layer=R;this.graphics3DCore=Q;this.scaleVisibility=W;this.emptySymbolLabelSupported=S;this.elevationInfoOverride=V;this.disablePlacement=T;this.active=Y;this.labelClassAbortController=new AbortController;this.labelClassContexts=[];this.graphics=new Map;this.labelsToInitialize=new Map;this.stageLayer=new N.WebGLLayer(J,{pickable:!0,disableOctree:!0},R.uid)}destroy(){this.stageLayer.destroy()}} a.Labeler=class extends q{constructor(J){super(J);this._dirty=!1;this._labels=new Map;this._labelingContexts=[]}setup(){this.dispose();this.addHandles([e.watch(()=>this.view.state?.camera,()=>this.setDirty()),e.watch(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),this.view.resourceController.scheduler.registerTask(E.TaskPriority.LABELER,this)]);this._textTextureAtlas=new H.TextTextureAtlas({view:this.view});this._hudMaterialCollection=new C.MaterialCollection(this.view._stage); this._calloutMaterialCollection=new C.MaterialCollection(this.view._stage)}dispose(){this.removeAllHandles();this._textTextureAtlas=f.disposeMaybe(this._textTextureAtlas);this._hudMaterialCollection=f.disposeMaybe(this._hudMaterialCollection);this._calloutMaterialCollection=f.disposeMaybe(this._calloutMaterialCollection);this._labelingContexts.length=0;this._labels.clear()}destroy(){this.dispose();K.graphic=null;K.renderingInfo=null;K.layer=null}_activateLabelingContext(J){J.graphics.forEach((R,Q)=> {const W=new L(J,R);this._labels.set(Q,W);J.labelsToInitialize.set(Q,W);R.setVisibilityFlag(n.VisibilityGroup.LABEL,n.VisibilityFlag.USER,!0)});J.active=!0}_deactivateLabelingContext(J){J.graphics.forEach((R,Q)=>{R.setVisibilityFlag(n.VisibilityGroup.LABEL,n.VisibilityFlag.USER,!1);this.setLabelGraphicVisibility(R,!1);R.clearLabelGraphics();this._labels.delete(Q)});J.active=!1}_addLabelTextureToAtlas(J){for(const R of J.graphics3DGraphic.labelLayers){if(!R._labelClass)continue;const Q=J.textRenderers[R._labelIndex]; Q&&(this._textTextureAtlas.addTextTexture(Q,R.stageObject),J.addedToTextureAtlas=!0)}}_removeLabelTextureFromAtlas(J){for(const R of J.graphics3DGraphic.labelLayers){if(!R._labelClass)continue;const Q=J.textRenderers[R._labelIndex];null!=Q&&(this._textTextureAtlas.removeTextTexture(Q,R.stageObject),J.addedToTextureAtlas=!1)}}get running(){return this.view.ready&&(this._dirty||this.deconflictor.running)}runTask(J){this._updateLabels(J);!this._dirty&&this.deconflictor.running&&this.deconflictor.runTask(J); return G.Yield}_updateLabels(J){if(this._dirty){this._dirty=!1;for(const R of this._labelingContexts)R.active&&(R.labelClassPromise&&R.labelClassAbortController?this._dirty=!0:I(R.labelClassContexts)?null===R.labelClassContexts?this._deactivateLabelingContext(R):(this._createLabelClassContext(R),this._dirty=!0):h.someMap(R.labelsToInitialize,(Q,W)=>{this._ensureGraphics3DResources(Q)&&(this._labels.set(W,Q),this.deconflictor.setDirty(),J.madeProgress());if(Q.visible&&Q.textInitialized||!Q.visible&& Q.hasGraphics3DResources)R.labelsToInitialize.delete(W),J.madeProgress();return J.done})&&(this._dirty=!0));this._dirty||this.notifyChange("updating")}}async _createLabelClassContextAsync(J){const R=J.labelClassAbortController?.signal;J.layer.when&&await J.layer.when();c.throwIfAborted(R);J.scaleVisibility?.updateScaleRangeActive();const Q=J.graphics3DCore,W=Q.layer.labelingInfo?.filter(S=>!!S.symbol);W&&0!==W.length&&(await l.forEach(W,async(S,V)=>{var T=S.symbol;const Y=y.getGraphics3DSymbol(Q.getOrCreateGraphics3DSymbol(T)); if(null==Y)k.getLogger(this).error("Failed to create Graphics3DSymbol for label");else{await Y.load();c.throwIfAborted(R);var ha=null;r.hasCalloutSupport(T)&&T.hasVisibleCallout()&&(ha=u.make(T,Q.symbolCreationContext),await ha.load(),c.throwIfAborted(R));T=await l.result(m.createLabelFunction(S,J.layer.fieldsIndex,this.view.spatialReference));c.throwIfAborted(R);if(!0===T.ok){const ba=await this._createTextRenderParameters(Y.symbol);c.throwIfAborted(R);J.labelClassContexts[V]=new P(S,Y,ha,ba,T.value)}else k.getLogger(this).error(`Label expression failed to evaluate: ${T.error}`)}}), c.throwIfAborted(R))}async _createLabelClassContext(J){null==J.labelClassPromise&&(J.labelClassPromise=this._createLabelClassContextAsync(J).catch(R=>{if(c.isAbortError(R))throw R;J.labelClassContexts.length=0}).then(()=>{J.labelClassAbortController=null;this.notifyChange("updating")}).catch(()=>{}),this.notifyChange("updating"));return J.labelClassPromise}async _createTextRenderParameters(J){J=J.symbolLayers.at(0);return"text"!==J?.type?null:F.TextRenderParameters.fromSymbol(J,this.view.state.rasterPixelRatio)}_destroyLabelClassContext(J){for(var R of J.labelClassContexts)--R.graphics3DSymbol.referenced; R=J.labelClassAbortController;J.labelClassAbortController=new AbortController;f.abortMaybe(R);J.labelClassContexts.length=0;J.labelClassPromise=null;this.notifyChange("updating")}_createTextSymbolGraphic(J,R,Q,W,S,V){J=new z.LabelParameters(Q,B.horizontalPlacementFromAnchor(Q.anchor),B.verticalPlacementFromAnchor(Q.anchor),J.text,w.fromValues(J.displayWidth,J.displayHeight));K.graphic=R;K.renderingInfo=null;K.layer=W;return S.createLabel(K,J,this._hudMaterialCollection,this._textTextureAtlas,()=> {const T=A.getLabelPlacement(V);return T?T.elevationOffset:null})}_createLineCalloutGraphic(J,R,Q,W,S){K.graphic=J;K.layer=S;K.renderingInfo=new x.LineCalloutSymbolLayerRenderingInfo(null,R,W.translation,W.centerOffset,W.screenOffset[0],W.centerOffsetUnits,W.elevationOffset,this._calloutMaterialCollection);return Q.createGraphics3DGraphic(K)}_ensureGraphics3DResources(J){if(J.hasGraphics3DResources)return!1;const R=J.graphics3DGraphic;if(R.destroyed)return!1;this._ensureTextTextureResources(J);const Q= J.labelingContext,W=Q.labelClassContexts;if(I(W)||!Q.emptySymbolLabelSupported&&0===R.layers.length)return!1;var S=!1,V=R.graphic;const T=Q.layer;var Y=O(Q.layer);for(let ba=0;baW.set(S.graphic.uid,S));Q.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(J,W,S=>S.labelLayers[0]);Q.graphics3DCalloutSymbolLayer&& Q.graphics3DCalloutSymbolLayer.globalPropertyChanged(J,W,S=>S.labelLayers[Q.calloutSymbolLayerIndex])}}_visibilityInfoChange(J){const R=O(J.layer);R&&!J.active&&this._activateLabelingContext(J);!R&&J.active&&this._deactivateLabelingContext(J);this.setDirty()}_resetAllLabels(){for(const J of this._labelingContexts)this._resetLabels(J)}_resetLabels(J){J.graphics.forEach((R,Q)=>{if(R=this._labels.get(Q))this._destroyGraphic(R,Q),R.visible=!1,J.labelsToInitialize.set(Q,R)});this._destroyLabelClassContext(J); this.setDirty();this.deconflictor.setDirty()}_findLabelingContext(J){for(const R of this._labelingContexts)if(R.graphics3DCore===J)return R;return null}addGraphicsOwner(J,R,Q){const W=Q?.emptySymbolLabelSupported||!1,S=Q?.elevationInfoOverride||null;Q=Q?.disablePlacement||null;if(!this._findLabelingContext(J)){var V=J.layer,T=new M(this.view._stage,V,J,R,W,S,Q,O(V));this._labelingContexts.push(T);this.setDirty();return{addGraphic:Y=>this._addGraphic(T,Y),removeGraphic:Y=>this._removeGraphic(T,Y), updateGraphicGeometry:Y=>this._updateGraphicGeometry(T,Y),layerLabelsEnabled:()=>O(T.layer),labelingInfoChange:Y=>this._labelingInfoChange(T,Y),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",T),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",T),visibilityInfoChange:()=>this._visibilityInfoChange(T),reset:()=>this._resetLabels(T),remove:()=>this._removeGraphicsOwner(J),setDirty:()=>this.setDirty()}}}_removeGraphicsOwner(J){const R=this._findLabelingContext(J); R&&(J=this._labelingContexts.indexOf(R),this._labelingContexts.splice(J,1),R.graphics.forEach(Q=>this._removeGraphic(R,Q)),R.destroy(),this.setDirty())}setLabelGraphicVisibility(J,R){J=J.graphic.uid;const Q=this._labels.get(J);Q&&Q.visible!==R&&(R&&!Q.addedToTextureAtlas?(this._addLabelTextureToAtlas(Q),Q.textInitialized||Q.labelingContext.labelsToInitialize.set(J,Q)):!R&&Q.addedToTextureAtlas&&this._removeLabelTextureFromAtlas(Q),Q.visible=R,this.setDirty())}setDirty(){!this._dirty&&0!!J.labelClassPromise&&!!J.labelClassAbortController)}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const J=0R+(Q.labelClassPromise&&Q.labelClassAbortController?0:1),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating? 0:.1)+.1*J+.5*this.deconflictor.updatingProgress}get test(){}};b.__decorate([g.property({constructOnly:!0})],a.Labeler.prototype,"view",void 0);b.__decorate([g.property({constructOnly:!0})],a.Labeler.prototype,"deconflictor",void 0);b.__decorate([g.property()],a.Labeler.prototype,"_textTextureAtlas",void 0);b.__decorate([g.property({type:Boolean,readOnly:!0})],a.Labeler.prototype,"updating",null);a.Labeler=b.__decorate([t.subclass("esri.views.3d.layers.graphics.Labeler")],a.Labeler);const K=new x.LineCalloutCreationContext(null, null,null);a.areLabelsVisible=O;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/hydratedFeatures":function(){define("exports ../../geometry ../../Graphic ../../core/has ../../core/lang ../../core/typedArrayUtil ../../geometry/support/jsonUtils ./dehydratedPoint ../../geometry/SpatialReference".split(" "),function(a,b,q,l,p,k,h,f,c){function e(u){return"declaredClass"in u}function g(u){return"declaredClass"in u}function d(u){return"declaredClass"in u}function t(u){return null== u?null:e(u)?u:h.fromJSON(w(u))}function w(u){const {wkid:x,wkt:y,wkt2:z,latestWkid:A}=u.spatialReference,B={wkid:x,wkt:y,wkt2:z,latestWkid:A};switch(u.type){case "point":const {x:C,y:D,z:F,m:H}=u;return{x:C,y:D,z:F,m:H,spatialReference:B};case "polygon":const {rings:N,hasZ:E,hasM:G}=u;return{rings:v(N),hasZ:E,hasM:G,spatialReference:B};case "polyline":const {paths:I,hasZ:O,hasM:L}=u;return{paths:v(I),hasZ:O,hasM:L,spatialReference:B};case "extent":const {xmin:P,xmax:M,ymin:K,ymax:J,zmin:R,zmax:Q, mmin:W,mmax:S,hasZ:V,hasM:T}=u;return{xmin:P,xmax:M,ymin:K,ymax:J,zmin:R,zmax:Q,mmin:W,mmax:S,hasZ:V,hasM:T,spatialReference:B};case "multipoint":const {points:Y,hasZ:ha,hasM:ba}=u;return{points:n(Y)?m(Y):Y,hasZ:ha,hasM:ba,spatialReference:B}}}function v(u){return r(u)?u.map(x=>m(x)):u}function m(u){return u.map(x=>Array.from(x))}function r(u){for(const x of u)if(0!==x.length)return n(x);return!1}function n(u){return 0q.getLogger("esri.layers.support.labelFormatUtils"), t={type:"simple",evaluate(){return null}},w={getAttribute(v,m){return v.field(m)}};a.createLabelFunction=async function(v,m,r){if(!v||!v.symbol||!m)return t;const n=v.where,u=c.getLabelExpression(v);if("arcade"===u.type){const x=await e.createLabelExpression(u.expression,r,m);if(null==x)return t;v={type:"arcade",evaluate(y,z){try{const A="attributes"in y?x.repurposeFeature(y):y;A.contextTimeZone=z??null;const B=x.evaluate({$view:{timeZone:z},$feature:A},x.services);if(null!=B)return B.toString()}catch(A){d().error(new b("arcade-expression-error", "Encountered an error when evaluating label expression for feature",{error:A,feature:y,expression:u}))}return null},needsHydrationToEvaluate(){return null==c.getSingleFieldArcadeExpression(u.expression)}}}else v={type:"simple",evaluate(x){return u.expression.replaceAll(/{[^}]*}/g,y=>{var z=y.slice(1,-1);z=m.get(z);if(!z)return y;y=null;"attributes"in x?x&&x.attributes&&(y=x.attributes[z.name]):y=x.field(z.name);return null==y?"":g(y,z)})}};if(n){let x;try{x=await l.parseWhereClause(n,m)}catch(z){return d().error(new b("bad-where-clause", "Encountered an error when evaluating where clause, ignoring",{where:n,error:z})),t}const y=v.evaluate;v.evaluate=(z,A)=>{const B="attributes"in z?void 0:w;try{if(x.testFeature(z,B))return y(z,A)}catch(C){d().error(new b("bad-where-clause","Encountered an error when evaluating where clause for feature",{where:n,feature:z,error:C}))}return null}}return v};a.formatField=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DCalloutSymbolLayerFactory":function(){define(["exports", "../../../../core/Logger","../../../../symbols/callouts/calloutUtils","./Graphics3DLineCalloutSymbolLayer"],function(a,b,q,l){const p=()=>b.getLogger("esri.views.3d.layers.graphics.Graphics3DCalloutSymbolLayerFactory"),k={line:l.Graphics3DLineCalloutSymbolLayer};a.make=function(h,f){if(!q.hasCalloutSupport(h))return p().error("Graphics3DCalloutSymbolLayerFactory#make",`symbol of type '${h.type}' does not support callouts`),null;if(!h.callout)return null;const c=k[h.callout.type];return c?new c(h, f):(p().error("Graphics3DCalloutSymbolLayerFactory#make",`unknown or unsupported callout type ${h.callout.type}`),null)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer":function(){define("exports ../../../../Color ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../symbols/callouts/calloutUtils ./ElevationAligners ./elevationAlignmentUtils ./ElevationContext ./Graphics3DGraphicCreationContext ./Graphics3DObject3DGraphicLayer ./Graphics3DObjectMetadata ./Graphics3DSymbolLayer ./graphicUtils ./pointUtils ./SymbolComplexity ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/LineCalloutMaterial".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){class z extends t.Graphics3DSymbolLayer{constructor(H,N){super(H,null,N,C);this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1};this.ensureDrapedStatus(!1)}async doLoad(){this._materials[0]=new y.LineCalloutMaterial(this._materialParameters);this._context.stage.add(this._materials[0])}destroy(){super.destroy();this._context.stage.remove(this._materials[0]);this._materials.length=0}_perInstanceMaterialParameters(H){const N= this._materialParameters;N.horizontalScreenOffset=H.horizontalScreenOffset??0;N.centerOffsetUnits=H.centerOffsetUnits||"world";return N}get _materialParameters(){const H=new y.Parameters;var N=this.symbol,E=N.callout;H.color=null!=E.color?b.toUnitRGBA(E.color):[0,0,0,0];H.color[3]*=this._getLayerOpacity();H.size=q.pt2px(E.size||0);if(N.verticalOffset){const {screenLength:G,minWorldLength:I,maxWorldLength:O}=N.verticalOffset;H.verticalOffset={screenLength:q.pt2px(G),minWorldLength:I||0,maxWorldLength:null!= O?O:Infinity}}H.borderColor=null!=E.border?.color?b.toUnitRGBA(E.border.color):null;E="object"===N.symbolLayers.at(0).type;N="label-3d"===N.type;H.occlusionTest=!E;H.shaderPolygonOffset=E?0:void 0;H.depthHUDAlignStart=N;H.hasSlicePlane=this._context.slicePlaneEnabled;H.screenSizePerspective=this._context.screenSizePerspectiveEnabled?this._context.sharedResources.screenSizePerspectiveSettings:null;return H}_defaultElevationInfoNoZ(){return B}createGraphics3DGraphic(H){const N=H.renderingInfo;H=H.graphic; const E=this.setGraphicElevationContext(H,new c.ElevationContext,N.elevationOffset||0);var G=N.symbol;const I="on-the-ground"===this._elevationContext.mode&&("cim"===G.type||!G.symbolLayers.some(O=>"object"===O.type||"text"===O.type));if("label-3d"!==G.type&&I||"point-3d"===G.type&&G.symbolLayers.every(O=>"text"===O.type&&!k.textSymbolLayerSupportsVerticalOffset(O)))return null;G=w.computeCentroid(H.geometry);return null==G?null:this._createAs3DShape(G,E,N,H.uid)}layerOpacityChanged(){this._materials[0]?.setParameters(this._materialParameters)}layerElevationInfoChanged(H, N,E){E=f.elevationModeChangeUpdateType(z.elevationModeChangeTypes,E,this._elevationContext.mode);if(E!==f.SymbolUpdateType.UPDATE)return E;H.forEach(G=>{const I=N(G);null!=I&&this.updateGraphicElevationContext(G.graphic,I)});return E}slicePlaneEnabledChanged(){this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){return!0}setGraphicElevationContext(H,N,E=0){super.setGraphicElevationContext(H,N);N.addOffsetRenderUnits(E);return N}updateGraphicElevationContext(H, N){this.setGraphicElevationContext(H,N.elevationContext,null!=N.metadata?N.metadata.elevationOffset:0);N.needsElevationUpdates=f.needsElevationUpdates2D(N.elevationContext.mode)}computeComplexity(){return new m.SymbolComplexity({verticesPerFeature:6})}_getOrCreateMaterial(H){const N=this._perInstanceMaterialParameters(H),E=y.LineCalloutMaterial.uniqueMaterialIdentifier(N);if(E===this._materials[0]?.uniqueMaterialIdentifier)return{material:this._materials[0],isUnique:!1};if(null!=H.materialCollection){let G= H.materialCollection.get(E);null==G&&(G=new y.LineCalloutMaterial(N),H.materialCollection.add(E,G));return{material:G,isUnique:!1}}return{material:new y.LineCalloutMaterial(N),isUnique:!0}}_createAs3DShape(H,N,E,G){var I=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:G,layerUid:this._context.layer.uid}),O=this._getOrCreateMaterial(E),L=u.Geometry,P=O.material;const {translation:M,centerOffset:K}=E;var J=M?new r.Attribute([M[0],M[1],M[2]],A,3,!0):new r.Attribute([0,0,0],A,3,!0); const R=K?new r.Attribute([K[0],K[1],K[2],K[3]],A,4,!0):new r.Attribute([0,0,0,1],A,4,!0);J=[[x.VertexAttribute.POSITION,J],[x.VertexAttribute.NORMAL,new r.Attribute([0,0,1],A,3,!0)],[x.VertexAttribute.CENTEROFFSETANDDISTANCE,R]];I=new L(P,J,null,n.ContentObjectType.Point,I);G=v.createStageObject(this._context,H,I,N,G);if(null==G)return null;O=new g.Graphics3DObject3DGraphicLayer(this,G.object,[I],O.isUnique?[O.material]:null,null,h.perObjectElevationAligner,N);O.metadata=new d.Graphics3DObjectMetadata(E.elevationOffset); O.alignedSampledElevation=G.sampledElevation;O.needsElevationUpdates=f.needsElevationUpdates2D(N.mode);v.extendPointGraphicElevationContext(O,H,this._context.elevationProvider);return O}}z.elevationModeChangeTypes={definedChanged:f.SymbolUpdateType.UPDATE,staysOnTheGround:f.SymbolUpdateType.UPDATE,onTheGroundChanged:f.SymbolUpdateType.RECREATE};const A=[0],B={mode:"relative-to-ground",offset:0},C={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};class D{constructor(H,N,E=l.create(),G=p.create(), I=0,O="world",L=0,P=null){this.renderer=H;this.symbol=N;this.translation=E;this.centerOffset=G;this.horizontalScreenOffset=I;this.centerOffsetUnits=O;this.elevationOffset=L;this.materialCollection=P}}class F extends e.Graphics3DGraphicCreationContext{}a.Graphics3DLineCalloutSymbolLayer=z;a.LineCalloutCreationContext=F;a.LineCalloutSymbolLayerRenderingInfo=D;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/ElevationAligners":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/projection/projectBuffer ./elevationAlignmentUtils ../../support/debugFlags ../../support/ElevationProvider ../../webgl-engine/lib/GeometryWithMapPositions ../../webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){function t(y,z,A,B,C){let D=!1;var F=y.transformation;z=z.requiresSampledElevationInfo;m[0]=F[12];m[1]=F[13];m[2]=F[14];y.invalidateBoundingInfo();var H=y.getMutableAttribute(d.VertexAttribute.POSITION);F=H.data;H=H.size;const N=F.length/H;y=new e.SamplePosition(y.mapPositions,A);let E=0,G=0;for(let I=0;I=O||Math.abs(r[1]-F[E+1])>=O||Math.abs(r[2]-F[E+2])>=O)D=!0}E+=H;y.offset+=3}return{update:D,averageGeometrySampledElevation:G/N}}const w=q.create(),v=p.create(),m=p.create(),r=p.create(),n=q.create(),u=p.create(),x=new f.SampleElevationInfo; a.perLodInstanceElevationAligner=function(y,z,A,B,C){var D=y.graphics3DSymbolLayer.lodRenderer;if(null==D)return 0;A=z.centerPointInElevationSR;B(A,x);z="absolute-height"!==z.mode?x.sampledElevation:0;B=D.instanceData;y=y.instanceIndex;B.getGlobalTransform(y,n);D=l.set(u,n[12],n[13],n[14]);c.debugFlags.TESTS_DISABLE_OPTIMIZATIONS?(v[0]=A.x,v[1]=A.y,v[2]=x.z,k.computeTranslationToOriginAndRotation(A.spatialReference,v,n,C.spatialReference)&&B.setGlobalTransform(y,n)):C.setAltitudeOfTransformation(x.z, n);C=.01/C.unitInMeters;(c.debugFlags.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(n[12]-D[0])>=C||Math.abs(n[13]-D[1])>=C||Math.abs(n[14]-D[2])>=C)&&B.setGlobalTransform(y,n);return z};a.perObjectElevationAligner=function(y,z,A,B,C,D){y=y.stageObject;const F=z.centerPointInElevationSR;A=0;y.usesVerticalDistanceToGround?(B(F,x),f.updateVertexPointGroundDistance(y,x.verticalDistanceToGround),A=x.sampledElevation):(B(F,x),"absolute-height"!==z.mode&&(A=x.sampledElevation));z=b.copy(w,D??y.transformation); B=l.set(u,z[12],z[13],z[14]);c.debugFlags.TESTS_DISABLE_OPTIMIZATIONS?(v[0]=F.x,v[1]=F.y,v[2]=x.z,k.computeTranslationToOriginAndRotation(F.spatialReference,v,z,C.spatialReference)&&(D?b.copy(D,z):y.transformation=z)):C.setAltitudeOfTransformation(x.z,z);C=.01/C.unitInMeters;if(Math.abs(z[12]-B[0])>=C||Math.abs(z[13]-B[1])>=C||Math.abs(z[14]-B[2])>=C)D?b.copy(D,z):y.transformation=z;return A};a.perVertexElevationAligner=function(y,z,A,B,C){y=y.stageObject;const D=y.geometries;let F=0;for(const H of D){if(!g.isGeometryWithMapPositions(H))continue; const {update:N,averageGeometrySampledElevation:E}=t(H,z,A,B,C);F+=E;N&&y.geometryVertexAttributeUpdated(H,d.VertexAttribute.POSITION)}return F/D.length};a.sharedGeometryElevationAligner=function(y,z,A,B,C){y=y.stageObject;const D=y.geometries;if(0===D.length)return 0;let F=0,H=null,N=0,E=!1;for(const G of D){if(!g.isGeometryWithMapPositions(G))continue;const I=G.attributes.get(d.VertexAttribute.POSITION);if(I!==H){const {update:O,averageGeometrySampledElevation:L}=t(G,z,A,B,C);N=L;H=I;E=O}E&&y.geometryVertexAttributeUpdated(G, d.VertexAttribute.POSITION);F+=N}return F/D.length};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/elevationAlignmentUtils":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/projection/projectBuffer ../../../../layers/graphics/dehydratedFeatureUtils ../../support/ElevationProvider ../../webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c){function e(r,n,u,x,y){const z=(h.isDehydratedPoint(r)?r.z:f.isSamplePosition(r)?r.array[r.offset+2]:r[2])||0;switch(u.mode){case "on-the-ground":u=f.getElevationAtPoint(n,r,"ground")??0;y.verticalDistanceToGround=0;y.sampledElevation=u;y.z=u;break;case "relative-to-ground":r=f.getElevationAtPoint(n,r,"ground")??0;u=u.geometryZWithOffset(z,x);y.verticalDistanceToGround=u;y.sampledElevation=r;y.z=u+r;break;case "relative-to-scene":r=f.getElevationAtPoint(n,r,"scene")??0; u=u.geometryZWithOffset(z,x);y.verticalDistanceToGround=u;y.sampledElevation=r;y.z=u+r;break;case "absolute-height":u=u.geometryZWithOffset(z,x);x=f.getElevationAtPoint(n,r,"ground")??0;y.verticalDistanceToGround=u-x;y.sampledElevation=x;y.z=u;break;default:y.z=0}}function g(r,n){for(let u=0;u!0},"relative-to-ground":{applyElevationAlignmentBuffer:function(r,n,u,x,y,z,A,B){let C=0;A=B.calculateOffsetRenderUnits(A); B=B.featureExpressionInfoContext;const D=z.spatialReference;n*=3;x*=3;for(let F=0;F!0},"relative-to-scene":{applyElevationAlignmentBuffer:function(r,n,u,x,y,z,A,B){let C=0;A=B.calculateOffsetRenderUnits(A);B=B.featureExpressionInfoContext;const D=z.spatialReference;n*=3;x*=3;for(let F=0;F!0}},w=q.create(),v=new d,m=l.create();a.SampleElevationInfo=d;a.applyElevationAlignmentForHUD=function(r,n,u,x,y){e(n,u,y,x,v);g(r,v.verticalDistanceToGround);u=v.sampledElevation;y=b.copy(w,r.transformation);m[0]=n.x;m[1]=n.y;m[2]=v.z;p.computeTranslationToOriginAndRotation(n.spatialReference,m,y,x.spatialReference)?r.transformation=y:console.warn("Could not locate symbol object properly, it might be misplaced"); return u};a.applyPerVertexElevationAlignment=function(r,n,u,x,y,z,A,B,C,D,F){const H=t[F.mode];let N=0;if(k.projectBuffer(r,n,u,x,C.spatialReference,y,B)&&(H.requiresAlignment(F)?(N=H.applyElevationAlignmentBuffer(x,y,z,A,B,C,D,F),r=z,y=A):r=x,k.projectBuffer(r,C.spatialReference,y,z,D.spatialReference,A,B)))return N};a.elevationModeChangeUpdateType=function(r,n,u){return"on-the-ground"===n&&"on-the-ground"===u?r.staysOnTheGround:n===u||"on-the-ground"!==n&&"on-the-ground"!==u?null==n||null==u?r.definedChanged: a.SymbolUpdateType.UPDATE:r.onTheGroundChanged};a.evaluateElevationAlignmentAtPoint=function(r,n,u,x){e(r,n,u,x,v);return v.z};a.evaluateElevationInfoAtPoint=e;a.needsElevationUpdates2D=function(r){return"relative-to-ground"===r||"relative-to-scene"===r};a.needsElevationUpdates3D=function(r){return"absolute-height"!==r};a.updateVertexPointGroundDistance=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GeometryWithMapPositions":function(){define(["exports", "./Geometry"],function(a,b){class q extends b.Geometry{}a.GeometryWithMapPositions=q;a.isGeometryWithMapPositions=function(l){return null!=l.mapPositions};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/ElevationContext":function(){define(["exports","../../../../symbols/support/unitConversionUtils","./featureExpressionInfoUtils"],function(a,b,q){class l{constructor(){this._renderUnitOffset=this._meterUnitOffset=0;this._unit="meters";this._metersPerElevationInfoUnit= 1;this.mode=this.centerPointInElevationSR=this._featureExpressionInfoContext=null}get featureExpressionInfoContext(){return this._featureExpressionInfoContext}get meterUnitOffset(){return this._meterUnitOffset}get unit(){return this._unit}set unit(p){this._unit=p;this._metersPerElevationInfoUnit=b.getMetersPerUnit(p)}get requiresSampledElevationInfo(){return"absolute-height"!==this.mode}reset(){this.mode=null;this._renderUnitOffset=this._meterUnitOffset=0;this._featureExpressionInfoContext=null;this.unit= "meters"}set offsetMeters(p){this._meterUnitOffset=p;this._renderUnitOffset=0}set offsetElevationInfoUnits(p){this._meterUnitOffset=p*this._metersPerElevationInfoUnit;this._renderUnitOffset=0}addOffsetRenderUnits(p){this._renderUnitOffset+=p}geometryZWithOffset(p,k){k=this.calculateOffsetRenderUnits(k);return null!=this.featureExpressionInfoContext?k:p+k}calculateOffsetRenderUnits(p){let k=this._meterUnitOffset;const h=this.featureExpressionInfoContext;null!=h&&(k+=q.execute(h)*this._metersPerElevationInfoUnit); return k/p.unitInMeters+this._renderUnitOffset}setFromElevationInfo(p){this.mode=p.mode;this.unit=b.supportsUnit(p.unit)?p.unit:"meters";this.offsetElevationInfoUnits=p.offset??0}updateFeatureExpressionInfoContext(p,k,h){if(null==p)this._featureExpressionInfoContext=null;else{var f=p?.arcade;f&&null!=k&&null!=h?(this._featureExpressionInfoContext=q.clone(p),q.setContextFeature(this._featureExpressionInfoContext,q.createFeature(f.modules,k,h))):this._featureExpressionInfoContext=p}}static fromElevationInfo(p){const k= new l;null!=p&&k.setFromElevationInfo(p);return k}}a.ElevationContext=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/featureExpressionInfoUtils":function(){define(["exports","../../../../core/Logger","../../../../core/promiseUtils","../../../../layers/graphics/hydratedFeatures","../../../../support/arcadeOnDemand"],function(a,b,q,l,p){a.clone=function(k){return{cachedResult:k.cachedResult,arcade:k.arcade?{func:k.arcade.func,context:k.arcade.modules.arcadeUtils.createExecContext(null, {sr:k.arcade.context.spatialReference}),modules:k.arcade.modules}:null}};a.createContext=async function(k,h,f,c){k=k?.expression;if("string"!==typeof k)return null;var e="0"===k?0:null;if(null!=e)return{cachedResult:e};e=await p.loadArcade();q.throwIfAborted(f);f=e.arcadeUtils;k=f.createSyntaxTree(k);return f.dependsOnView(k)?(null!=c&&c.error("Expressions containing '$view' are not supported on ElevationInfo"),{cachedResult:0}):{arcade:{func:f.createFunction(k),context:f.createExecContext(null,{sr:h}), modules:e}}};a.createContextWithoutExpressionSupport=function(k){k=k?.expression;return"string"===typeof k&&(k="0"===k?0:null,null!=k)?{cachedResult:k}:null};a.createFeature=function(k,h,f){return k.arcadeUtils.createFeature(h.attributes,h.geometry,f)};a.execute=function(k){if(null!=k){if(null!=k.cachedResult)return k.cachedResult;var h=k.arcade;h=h?.modules.arcadeUtils.executeFunction(h.func,h.context);"number"!==typeof h&&(h=k.cachedResult=0);return h}return 0};a.extractExpressionInfo=function(k, h=!1){k=k?.featureExpressionInfo;h||"0"===k?.expression||(k=null);return k??null};a.setContextFeature=function(k,h){null!=k&&null==k.cachedResult&&(h&&k.arcade?(h._geometry&&(h._geometry=l.hydrateGeometry(h._geometry)),k.arcade.modules.arcadeUtils.updateExecContext(k.arcade.context,h)):b.getLogger("esri.views.3d.layers.graphics.featureExpressionInfoUtils").errorOncePerTick("Arcade support required but not provided"))};a.zeroContext={cachedResult:0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/layers/graphics/Graphics3DGraphicCreationContext":function(){define(["exports"],function(a){class b{constructor(q,l,p){this.graphic=q;this.renderingInfo=l;this.layer=p}}a.Graphics3DGraphicCreationContext=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../chunks/sphere ./elevationAlignmentUtils ./featureExpressionInfoUtils ./graphicUtils ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/edgeRendering/interfaces".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(n){return n.isVisible()?n.parameters.transparent?e.Transparency.TRANSPARENT:e.Transparency.OPAQUE:e.Transparency.INVISIBLE}class d{constructor(n,u,x){this.baseMaterial=n;this.edgeMaterials=u;this.properties=x}}class t{get isElevationSource(){return!!this.stageObject.lastValidElevationBB}constructor(n,u,x,y,z,A,B,C=null){this.graphics3DSymbolLayer=n;this.stageObject=u;this._uniqueGeometries=x;this._uniqueMaterials=y;this._sharedResource=z;this.elevationAligner= A;this.elevationContext=B;this._edgeState=C;this.type="object3d";this._stageLayer=null;this._addedToStage=this._visible=!1;this.alignedSampledElevation=0;this.useObjectOriginAsAttachmentOrigin=this.needsElevationUpdates=!1}initialize(n){this._stageLayer=n;n=n.stage;n.addMany(this._uniqueMaterials);n.addMany(this._uniqueGeometries);n.add(this.stageObject)}destroy(){if(this._stageLayer){var n=this._stageLayer.stage;n.removeMany(this._uniqueMaterials);n.removeMany(this._uniqueGeometries);n.remove(this.stageObject); this._addedToStage&&(this._stageLayer.remove(this.stageObject),this._addedToStage=!1);n.renderer.edgeView?.removeObject(this.stageObject);this.stageObject.dispose();this._sharedResource?.release();this._visible=!1;this._stageLayer=null}}layerOpacityChanged(n,u){const {stageObject:x,_edgeState:y,_stageLayer:z}=this;if(null!=y){var A=g(y.baseMaterial),B=!1;for(const C of y.edgeMaterials)C.objectTransparency!==A&&(C.objectTransparency=A,B=!0);B&&this.resetEdgeObject(u);z.stage.renderer.withEdgeView(C=> {C.updateAllComponentOpacities(x,[n])})}}slicePlaneEnabledChanged(n,u){const {stageObject:x,_edgeState:y,_stageLayer:z}=this;null!=y&&z.stage.renderer.withEdgeView(A=>{A.updateAllComponentMaterials(x,y.edgeMaterials,{hasSlicePlane:n},!u);y.properties.hasSlicePlane=n})}setVisibility(n){const {_edgeState:u,stageObject:x,_stageLayer:y}=this;null!=y&&this.visible!==n&&(this._visible=n,(x.visible=n)&&!this._addedToStage&&(y.add(x),this._addedToStage=!0),null!=u&&y.stage.renderer.withEdgeView(z=>{z.hasObject(x)? z.updateObjectVisibility(x,n):n&&this._addOrUpdateEdgeObject(u,z,!1)}))}get visible(){return this._visible}alignWithElevation(n,u,x,y){null!=this.elevationAligner&&(null!=x&&h.setContextFeature(this.elevationContext.featureExpressionInfoContext,x),this.alignedSampledElevation=this.elevationAligner(this,this.elevationContext,n.spatialReference,(z,A)=>k.evaluateElevationInfoAtPoint(z,n,this.elevationContext,u,A),u),this.resetEdgeObject(y))}alignWithAbsoluteElevation(n,u,x){this.alignedSampledElevation= this.elevationAligner(this,this.elevationContext,null,(y,z)=>{z.sampledElevation=n;z.verticalDistanceToGround=0;z.z=n},u);this.resetEdgeObject(x)}getCenterObjectSpace(n=q.create()){return b.copy(n,p.getCenter(this.stageObject.boundingVolumeObjectSpace.bounds))}getBoundingBoxObjectSpace(n=l.create()){const u=this.stageObject.boundingVolumeObjectSpace;l.setMin(n,u.min);l.setMax(n,u.max);return n}computeAttachmentOrigin(n){const u=this.stageObject.effectiveTransformation;if(this.useObjectOriginAsAttachmentOrigin)n.render.origin[0]+= u[12],n.render.origin[1]+=u[13],n.render.origin[2]+=u[14],n.render.num++;else for(const x of this.stageObject.geometries)x.computeAttachmentOrigin(m)&&(b.transformMat4(m,m,u),b.add(n.render.origin,n.render.origin,m),n.render.num++)}async getProjectedBoundingBox(n,u,x,y,z){z=this.getBoundingBoxObjectSpace(z);var A=r,B=l.isPoint(z)?1:A.length;for(var C=0;CC;C++)z[C]=Math.min(z[C],w[A+C]),z[C+3]=Math.max(z[C+3],w[A+C]);n&&x.push({location:w.slice(A,A+3),screenSpaceBoundingRect:n})}if(u?.service&&"absolute-height"!==this.elevationContext.mode){l.center(z,m);x="relative-to-scene"===this.elevationContext.mode?"scene":"ground";B=0;if(u.useViewElevation)B=u.service.getElevation(m[0],m[1],x)??0;else try{const D= f.demResolutionForBoundingBox(z,u.service.spatialReference,u);B=await u.service.queryElevation(m[0],m[1],y,D,x)??0}catch(D){}l.offset(z,0,0,-this.alignedSampledElevation+B)}return z}addObjectState(n,u){n===c.Object3DState.Highlight&&u.addObject(this.stageObject,this.stageObject.highlight());n===c.Object3DState.MaskOccludee&&u.addObject(this.stageObject,this.stageObject.maskOccludee())}removeObjectState(n){n.removeObject(this.stageObject)}resetEdgeObject(n){const {_edgeState:u,stageObject:x,_stageLayer:y, _visible:z}=this;null!=u&&y.stage.renderer.withEdgeView(A=>{z?this._addOrUpdateEdgeObject(u,A,n):A.removeObject(x)})}_addOrUpdateEdgeObject(n,u,x){const y=g(n.baseMaterial);for(const z of n.edgeMaterials)z.objectTransparency=y;u.addOrUpdateObject3D(this.stageObject,n.edgeMaterials,n.properties,!x).then(()=>this._stageLayer?.sync())}}const w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=q.create(),m=q.create(),r=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];a.Graphics3DObject3DGraphicLayer= t;a.Object3DEdgeState=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/graphicUtils":function(){define("exports ../../../../core/unitUtils ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/projection ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/centroid ../../../../geometry/support/coordsUtils ../../../../layers/graphics/dehydratedPoint ../../../../layers/graphics/hydratedFeatures".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(n){var u=n.paths[0];if(!u||0===u.length)return null;u=d.getPointOnPath(u,d.getPathLength(u)/2);return t.makeDehydratedPoint(u[0],u[1],u[2],n.spatialReference)}function m(n,u,x){x=x?n:w.clonePoint(n);return u&&n?f.projectPoint(n,x,u)?x:null:x}function r(n){const u=x=>null==x||0<=x;return Array.isArray(n)?n.every(u):null==n||0<=n}a.computeCentroid=function(n,u){if("point"===n.type)return m(n,u,!1);if(w.isHydratedGeometry(n))switch(n.type){case "extent":return m(n.center, u,!1);case "polygon":return m(n.centroid,u,!1);case "polyline":return m(v(n),u,!0);case "mesh":return m(n.origin,u,!1)}else switch(n.type){case "extent":return n=t.makeDehydratedPoint(.5*(n.xmax+n.xmin),.5*(n.ymax+n.ymin),null!=n.zmin&&null!=n.zmax&&isFinite(n.zmin)&&isFinite(n.zmax)?.5*(n.zmax+n.zmin):void 0,n.spatialReference),m(n,u,!0);case "polygon":var x=n.rings[0];x&&0!==x.length?(x=g.ringsCentroid(n.rings,!!n.hasZ),n=t.makeDehydratedPoint(x[0],x[1],x[2],n.spatialReference)):n=null;return m(n, u,!0);case "polyline":return m(v(n),u,!0)}};a.computeObjectRotation=function(n,u,x,y=l.create()){n&&q.rotateZ(y,y,-n/180*Math.PI);u&&q.rotateX(y,y,u/180*Math.PI);x&&q.rotateY(y,y,x/180*Math.PI);return y};a.computeObjectScale=function(n=p.ONES,u,x,y=1){const z=Array(3);if(null==u||null==x)z[0]=1,z[1]=1,z[2]=1;else{let B=0;for(let C=2;0<=C;C--){const D=n[C];let F;const H=null!=D,N=0===C&&!A&&!H,E=x[C];"symbol-value"===D||N?F=0!==E?u[C]/E:1:H&&"proportional"!==D&&isFinite(D)&&(F=0!==E?D/E:1);if(null!= F){var A=z[C]=F;B=Math.max(B,Math.abs(F))}}for(n=2;0<=n;n--)null==z[n]?z[n]=A:0===z[n]&&(z[n]=.001*B)}for(A=2;0<=A;A--)z[A]/=y;return p.fromArray(z)};a.demResolutionForBoundingBox=function(n,u,x){if(null!=x.minDemResolution)return x.minDemResolution;const y=b.getMetersPerUnitForSR(u),z=c.width(n)*y,A=c.depth(n)*y;n=c.height(n)*(u.isGeographic?1:y);return 0===z&&0===A&&0===n?x.minDemResolutionForPoints:.01*Math.max(z,A,n)};a.enlargeExtent=function(n,u,x,y=0){if(n){u||=e.create();let z=.5*n.width*(x- 1);x=.5*n.height*(x-1);n.width<1E-7*n.height?z+=x/20:n.height<1E-7*n.width&&(x+=z/20);k.set(u,n.xmin-z-y,n.ymin-x-y,n.xmax+z+y,n.ymax+x+y);return u}return null};a.isValidSize=r;a.mixinColorAndOpacity=function(n,u,x=null){const y=h.clone(h.ONES);null!=n&&(y[0]=n[0],y[1]=n[1],y[2]=n[2]);null!=u?y[3]=u:null!=n&&3B;++B)A[B]=null!=n?.[B]?n[B]:null!=x?.[B]?x[B]:z[B];A[3]=null!= u?u:null!=y?y:z[3];return A};a.validateSymbolLayerSize=function(n){return r(null!=n.isPrimitive?[n.width,n.depth,n.height]:n)?null:"Symbol sizes may not be negative values"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/interfaces":function(){define(["exports"],function(a){a.Transparency=void 0;var b=a.Transparency||(a.Transparency={});b[b.INVISIBLE=0]="INVISIBLE";b[b.TRANSPARENT=1]="TRANSPARENT";b[b.OPAQUE=2]="OPAQUE";Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObjectMetadata":function(){define(["exports"],function(a){class b{constructor(q,l=null){this.labelText=l;this.elevationOffset=q??0}}a.Graphics3DObjectMetadata=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DSymbolLayer":function(){define("exports ../../../../Color ../../../../core/has ../../../../core/Logger ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/coordsUtils ./defaultSymbolComplexity ./elevationAlignmentUtils ./ElevationContext ./featureExpressionInfoUtils ./graphicUtils ./interfaces ./Loadable ../support/FastSymbolUpdates".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(z){const A={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};z&&"visualVariables"in z&&z.visualVariables&&z.visualVariables.forEach(B=>{switch(B.type){case "color":A.color=!0;if(B.stops)for(let C=0;CD.a&&(A.opacityAlwaysOpaque=!1))}break;case "opacity":A.opacity=!0;A.opacityAlwaysOpaque=!1;break;case "size":A.size=!0}});return A}const r=()=>l.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer"); class n extends w.Loadable{constructor(z,A,B,C){super(B.schedule);this.symbol=z;this.symbolLayer=A;this._context=B;this.ignoreDrivers=!1;this._drivenProperties={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};this._materials=[];this.usedMemory=0;this.logger=r();this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0};this.skipHighSymbolLodsChanged=!0;this._renderPriority=C.renderPriority;this._renderPriorityStep=C.renderPriorityStep;this._elevationContext=new e.ElevationContext; this.complexity=this.computeComplexity();this.ignoreDrivers=C.ignoreDrivers;this.ignoreDrivers||(this._drivenProperties=m(this._context.renderer));this._updateElevationContext()}getCachedSize(){return null}get extentPadding(){return 0}get materials(){return this._materials}_drivenPropertiesChanged(z){if(this.ignoreDrivers)return!1;const A=this._drivenProperties;z=m(z);return z.color!==A.color||z.opacity!==A.opacity||z.opacityAlwaysOpaque!==A.opacityAlwaysOpaque||z.size!==A.size}get needsDrivenTransparentPass(){return this._drivenProperties.opacity&& !this._drivenProperties.opacityAlwaysOpaque}_logGeometryCreationWarnings(z,A,B,C){const D="polygons"in z?z.polygons:null,F=`${C} geometry failed to be created`;z.projectionSuccess?!this._logGeometryValidationWarnings(A,B,C)&&D&&0===D.length&&"rings"===B&&0{const F=A(D);null!=F?(this.setGraphicElevationContext(D.graphic, F.elevationContext),F.needsElevationUpdates=B(F.elevationContext.mode)):C=c.SymbolUpdateType.RECREATE});return C}applyRendererDiff(z,A){return t.ApplyRendererDiffResult.RecreateSymbol}getFastUpdateAttrValues(z){if(!this._fastUpdates)return null;const A=this._fastUpdates.visualVariables,B=A.size?v.getAttributeValue(A.size.field,z):0,C=A.color?v.getAttributeValue(A.color.field,z):0;z=A.opacity?v.getAttributeValue(A.opacity.field,z):0;return k.fromValues(B,C,z,0)}get draped(){return this._draped}ensureDrapedStatus(z){if(null== this._draped)return this._draped=z,!0;z!==this.draped&&r().warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary.");return!1}test(){return{drivenProperties:this._drivenProperties,getVisVarFields:()=>({size:this._fastUpdates?.visualVariables.size?.field??null,color:this._fastUpdates?.visualVariables.color?.field??null,opacity:this._fastUpdates?.visualVariables.opacity?.field??null,rotation:this._fastUpdates?.visualVariables.rotation?.field?? null})}}}const u={mode:"on-the-ground",offset:0,unit:"meters"},x={mode:"absolute-height",offset:0,unit:"meters"},y={hasIntrinsicColor:!1};a.Graphics3DSymbolLayer=n;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/defaultSymbolComplexity":function(){define("exports ../../../../core/compilerUtils ../../../../symbols/support/ObjectSymbol3DLayerResource ./Graphics3DPathSymbolLayerConstants ./primitiveObjectSymbolUtils ./SymbolComplexity ../support/edgeUtils ../../webgl-engine/materials/DefaultMaterial".split(" "), function(a,b,q,l,p,k,h,f){function c(m){let r=0,n=0,u=0,x=!1,y=0;const z=new k.SymbolComplexityMemory;for(const A of m)null!=A&&(r+=A.verticesPerFeature,n+=A.verticesPerCoordinate,u+=A.drawCallsPerFeature,z.bytesPerFeature+=A.memory.bytesPerFeature,z.bytesPerFeatureLabel+=A.memory.bytesPerFeatureLabel,z.resourceBytes+=A.memory.resourceBytes,z.draped.bytesPerFeature+=A.memory.bytesPerFeature,z.draped.bytesPerFeatureLabel+=A.memory.bytesPerFeatureLabel,x=x||A.estimated,++y);return x?new k.EstimatedAggregateSymbolComplexity(y, {verticesPerFeature:r,verticesPerCoordinate:n,drawCallsPerFeature:u,memory:z}):new k.AggregateSymbolComplexity(y,{verticesPerFeature:r,verticesPerCoordinate:n,drawCallsPerFeature:u,memory:z})}function e(m,r){const n=g(m,r);var u=h.hasEdges(r)?2:0;switch(r.type){case "extrude":return new k.SymbolComplexity({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:u,memory:n});case "fill":if("mesh-3d"===m.type)return new k.SymbolComplexity({drawCallsPerFeature:u,memory:n});if(null!=r.outline&& 0r+1/10**u*n.numVertices,0)/m.reduce((r,n,u)=>r+1/10**u,0)}const t=new k.EstimatedSymbolComplexity({}),w={},v={ICON_POINT:{bytesPerFeature:2379.8272296852992,bytesPerFeatureLabel:852.246235,resourceBytes:0,draped:{bytesPerFeature:1868.2382921559424,bytesPerFeatureLabel:839.205415}},ICON_POLYGON:{bytesPerFeature:2957.8429876524656,bytesPerFeatureLabel:862.5307816666666,resourceBytes:0,draped:{bytesPerFeature:2579.7767085451133,bytesPerFeatureLabel:856.9298550000001}}, OBJECT_POINT:{bytesPerFeature:603.543820573039,bytesPerFeatureLabel:717.4551849999999,resourceBytes:0,draped:{bytesPerFeature:603.543820573039,bytesPerFeatureLabel:717.4551849999999}},OBJECT_POLYGON:{bytesPerFeature:1111.1693389308373,bytesPerFeatureLabel:707.4535949999998,resourceBytes:0,draped:{bytesPerFeature:1111.1693389308373,bytesPerFeatureLabel:707.4535949999998}},LINE_MITER:{bytesPerFeature:3081.208408220661,bytesPerFeatureLabel:858.6749016666668,resourceBytes:0,draped:{bytesPerFeature:2682.57863388475, bytesPerFeatureLabel:844.6118016666666}},LINE_ROUND:{bytesPerFeature:3209.3236242927915,bytesPerFeatureLabel:858.1810416666667,resourceBytes:0,draped:{bytesPerFeature:2687.6256038096126,bytesPerFeatureLabel:849.578535}},PATH_MITER_CIRCLE:{bytesPerFeature:38708.74276663992,bytesPerFeatureLabel:858.70415,resourceBytes:0,draped:{bytesPerFeature:38708.74276663992,bytesPerFeatureLabel:858.70415}},PATH_ROUND_CIRCLE:{bytesPerFeature:42098.00590216518,bytesPerFeatureLabel:868.3632500000001,resourceBytes:0, draped:{bytesPerFeature:42098.00590216518,bytesPerFeatureLabel:868.3632500000001}},PATH_MITER_QUAD:{bytesPerFeature:25037.823002405767,bytesPerFeatureLabel:835.93355,resourceBytes:0,draped:{bytesPerFeature:25037.823002405767,bytesPerFeatureLabel:835.93355}},PATH_ROUND_QUAD:{bytesPerFeature:40320.254760224525,bytesPerFeatureLabel:851.66955,resourceBytes:0,draped:{bytesPerFeature:40320.254760224525,bytesPerFeatureLabel:851.66955}},FILL:{bytesPerFeature:3147.43349219103,bytesPerFeatureLabel:850.7598550000001, resourceBytes:0,draped:{bytesPerFeature:2673.7898488975106,bytesPerFeatureLabel:846.6459950000002}},FILL_OUTLINE:{bytesPerFeature:4565.099993465867,bytesPerFeatureLabel:855.334515,resourceBytes:0,draped:{bytesPerFeature:3904.46969705314,bytesPerFeatureLabel:844.7081016666667}},EXTRUDE:{bytesPerFeature:7551.2282834569505,bytesPerFeatureLabel:849.5513283333333,resourceBytes:0,draped:{bytesPerFeature:7551.2282834569505,bytesPerFeatureLabel:849.5513283333333}},EXTRUDE_EDGES:{bytesPerFeature:2959.8379634500698, bytesPerFeatureLabel:602.0969283333335,resourceBytes:0,draped:{bytesPerFeature:2959.8379634500698,bytesPerFeatureLabel:602.0969283333335}}};a.averageSymbolComplexities=function(m){m=c(m);0e(m,n));return c(r)};a.defaultSymbolLayerComplexity=e;a.defaultSymbolLayerMemoryComplexity=g;a.emptySymbolComplexity=t;a.estimateNumVerticesForLods=d;a.memoryEstimators=v;a.totalSymbolComplexities=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants":function(){define(["exports"], function(a){a.pathNumCircleProfileSubdivisions=10;a.pathNumRoundCapExtrusionSubdivisions=3;a.pathNumRoundJoinSubdivisions=3;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/primitiveObjectSymbolUtils":function(){define(["exports","../../../../core/has","../../webgl-engine/lib/GeometryUtil","../../webgl-engine/lib/lodRendering/LodResources"],function(a,b,q,l){const p=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64, minScreenSpaceRadius:65}];a.isValidPrimitive=function(k){switch(k){case "sphere":case "cube":case "diamond":case "cylinder":case "cone":case "inverted-cone":case "tetrahedron":return!0}return!1};a.primitiveLodResources=function(k,h){const f=(c,e,g=!1)=>new l.LodResources(c.map(d=>{const t=e(d.tesselation);g&&q.cgToGIS(t);return new l.LodLevelResources([new l.LodComponentResources(t)],d.minScreenSpaceRadius)}));switch(k){case "sphere":return f([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1, minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],c=>q.createPolySphereGeometry(h,.5,c,!0));case "cube":return f([{tesselation:0,minScreenSpaceRadius:0}],()=>q.createBoxGeometry(h,1));case "cone":return f(p,c=>q.createConeGeometry(h,1,.5,c,!1),!0);case "inverted-cone":return f(p,c=>q.createConeGeometry(h,1,.5,c,!0),!0);case "cylinder":return f(p,c=>q.createCylinderGeometry(h,1,.5,c,[0,0,1],[0,0,.5]));case "tetrahedron":return f([{tesselation:0, minScreenSpaceRadius:0}],()=>q.createTetrahedronGeometry(h,1),!0);case "diamond":return f([{tesselation:0,minScreenSpaceRadius:0}],()=>q.createDiamondGeometry(h,1),!0)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/LodResources":function(){define(["exports","../../../../../core/arrayUtils","../VertexAttribute"],function(a,b,q){class l{constructor(h,f=null){this.geometry=h;this.textures=f}}class p{constructor(h,f,c){this.components=h; this.minScreenSpaceRadius=f;this.pivotOffset=c;this.numVertices=this.geometries.reduce((e,g)=>e+g.attributes.get(q.VertexAttribute.POSITION).indices.length,0)}get geometries(){return b.unique(this.components.map(h=>h.geometry))}}class k{constructor(h){this.levels=h;this.levels.sort((f,c)=>f.minScreenSpaceRadius===c.minScreenSpaceRadius?f.numVertices-c.numVertices:f.minScreenSpaceRadius-c.minScreenSpaceRadius)}}a.LodComponentResources=l;a.LodLevelResources=p;a.LodResources=k;a.geometriesFromLodResources= function(h){const f=[];h.levels.forEach(c=>c.components.forEach(e=>f.push(e.geometry)));return b.unique(f)};a.materialsFromLodResources=function(h){const f=[];h.levels.forEach(c=>c.components.forEach(e=>f.push(e.geometry.material)));return b.unique(f)};a.texturesFromLodResources=function(h){const f=[];h.levels.forEach(c=>c.components.forEach(e=>{null!=e.textures&&f.push(...e.textures)}));return b.unique(f)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/SymbolComplexity":function(){define(["exports"], function(a){class b{constructor(h){this.estimated=!1;this.verticesPerFeature=h.verticesPerFeature??0;this.verticesPerCoordinate=h.verticesPerCoordinate??0;this.drawCallsPerFeature=h.drawCallsPerFeature??0;this.memory=h.memory??new k}}class q extends b{constructor(h){super(h);this.estimated=!0}}class l extends b{constructor(h,f){super(f);this.numComplexities=h}}class p extends q{constructor(h,f){super(f);this.numComplexities=h}}class k{constructor(){this.resourceBytes=this.bytesPerFeatureLabel=this.bytesPerFeature= 0;this.draped={bytesPerFeature:0,bytesPerFeatureLabel:0}}}a.AggregateSymbolComplexity=l;a.EstimatedAggregateSymbolComplexity=p;a.EstimatedSymbolComplexity=q;a.SymbolComplexity=b;a.SymbolComplexityMemory=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/edgeUtils":function(){define("exports ../../../../Color ../../../../core/has ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec4f64 ./layerUtils ../../webgl-engine/lib/edgeRendering/interfaces ../../webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl".split(" "), function(a,b,q,l,p,k,h,f){function c(t,w){if(null==t)return null;const v=null!=t.color?p.fromArray(b.toUnitRGBA(t.color)):p.fromValues(0,0,0,0),m=l.pt2px(t.size),r=l.pt2px(t.extensionLength);switch(t.type){case "solid":return e({color:v,size:m,extensionLength:r,...w});case "sketch":return{...d,color:v,size:m,extensionLength:r,...w,type:f.EdgeType.Sketch}}}function e(t){return{...g,...t,type:f.EdgeType.Solid}}const g={color:p.fromValues(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:h.Transparency.OPAQUE, hasSlicePlane:!1},d={color:p.fromValues(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:h.Transparency.OPAQUE,hasSlicePlane:!1};a.createMaterial=function(t,w){return c(t&&t.enabled&&t.edges||null,w)};a.createMaterialFromEdges=c;a.createSolidEdgeMaterial=e;a.hasEdges=function(t){return t&&t.enabled&&(k.isExtrudeSymbol3DLayer(t)||k.isFillSymbol3DLayer(t))&&null!=t.edges};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/layerUtils":function(){define(["exports"], function(a){a.isExtrudeSymbol3DLayer=function(b){return"extrude"===b.type};a.isFillSymbol3DLayer=function(b){return"fill"===b.type};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl":function(){define("exports ../../../collections/Component/Material/shader/ComponentData.glsl ../../../core/shaderLibrary/attributes/NormalAttribute.glsl ../../../core/shaderLibrary/util/DoublePrecision.glsl ../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl ../../../core/shaderModules/Float3DrawUniform ../../../core/shaderModules/Float3PassUniform ../../../core/shaderModules/FloatPassUniform ../../../core/shaderModules/interfaces ../../../core/shaderModules/Matrix3DrawUniform ../../../core/shaderModules/Matrix3PassUniform ../../../core/shaderModules/Matrix4PassUniform ../../../core/shaderModules/Texture2DDrawUniform ../../../lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.EdgeType=void 0;(function(v){v[v.Solid=0]="Solid";v[v.Sketch=1]="Sketch";v[v.Mixed=2]="Mixed";v[v.COUNT=3]="COUNT"})(a.EdgeType||(a.EdgeType={}));a.EdgeSilhouette=void 0;(function(v){v[v.REGULAR=0]="REGULAR";v[v.SILHOUETTE=1]="SILHOUETTE"})(a.EdgeSilhouette||(a.EdgeSilhouette={}));a.EdgeUtil=function(v,m){const r=v.vertex;r.include(p.RgbaFloatEncoding);v.include(q.NormalAttribute,m);r.uniforms.add(new f.FloatPassUniform("distanceFalloffFactor",n=>n.distanceFalloffFactor)); r.code.add(c.glsl`float distanceBasedPerspectiveFactor(float distance) { return clamp(sqrt(distanceFalloffFactor / distance), 0.0, 1.0); }`);r.uniforms.add(new t.Texture2DDrawUniform("componentDataTex",n=>n.componentDataTexture));v.attributes.add(w.VertexAttribute.COMPONENTINDEX,"float");r.constants.add("componentColorFieldOffset","float",0);r.constants.add("componentOtherFieldOffset","float",1);r.constants.add("componentVerticalOffsetFieldOffset","float",2);r.constants.add("componentFieldCount","float",3);r.constants.add("lineWidthFractionFactor","float",8);r.constants.add("extensionLengthOffset","float",128);r.constants.add("verticalOffsetScale", "float",2*b.maxElevationOffset);r.code.add(c.glsl` vec2 _componentTextureCoords(float componentIndex, float fieldOffset) { float fieldIndex = componentFieldCount * componentIndex + fieldOffset; float texSize = float(textureSize(componentDataTex, 0).x); float colIndex = mod(fieldIndex, texSize); float rowIndex = floor(fieldIndex / texSize); return vec2(colIndex, rowIndex) + 0.5; } struct ComponentData { vec4 color; vec3 normal; vec3 normal2; float lineWidth; float extensionLength; float type; float verticalOffset; }; ComponentData readComponentData() { vec2 colorIndex = _componentTextureCoords(componentIndex, componentColorFieldOffset); vec2 otherIndex = _componentTextureCoords(componentIndex, componentOtherFieldOffset); vec2 verticalOffsetIndex = _componentTextureCoords(componentIndex, componentVerticalOffsetFieldOffset); vec3 normal = normalModel(); vec3 normal2 = ${m.silhouette?c.glsl`decompressNormal(normal2Compressed)`:c.glsl`normal`}; vec4 colorValue = texelFetch(componentDataTex, ivec2(colorIndex), 0); vec4 otherValue = texelFetch(componentDataTex, ivec2(otherIndex), 0); float verticalOffset = (rgba2float(texelFetch(componentDataTex, ivec2(verticalOffsetIndex), 0)) - 0.5) * verticalOffsetScale; return ComponentData( vec4(colorValue.rgb, colorValue.a * otherValue.w), // otherValue.w stores separate opacity normal, normal2, otherValue.x * (255.0 / lineWidthFractionFactor), otherValue.y * 255.0 - extensionLengthOffset, -(otherValue.z * 255.0) + 0.5, // SOLID (=0/255) needs to be > 0.0, SKETCHY (=1/255) needs to be <= 0; verticalOffset ); } `);m.legacy?r.code.add(c.glsl`vec3 _modelToWorldNormal(vec3 normal) { return (model * vec4(normal, 0.0)).xyz; } vec3 _modelToViewNormal(vec3 normal) { return (localView * model * vec4(normal, 0.0)).xyz; }`):(r.uniforms.add(new e.Matrix3DrawUniform("transformNormalGlobalFromModel",n=>n.transformNormalGlobalFromModel)),r.code.add(c.glsl`vec3 _modelToWorldNormal(vec3 normal) { return transformNormalGlobalFromModel * normal; }`));m.silhouette?(v.attributes.add(w.VertexAttribute.NORMAL2COMPRESSED,"vec2"),r.code.add(c.glsl`vec3 worldNormal(ComponentData data) { return _modelToWorldNormal(normalize(data.normal + data.normal2)); }`)):r.code.add(c.glsl`vec3 worldNormal(ComponentData data) { return _modelToWorldNormal(data.normal); }`);m.legacy?r.code.add(c.glsl`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) { worldPos = (model * vec4(modelPos, 1.0)).xyz; viewPos = (localView * vec4(worldPos, 1.0)).xyz; }`):(r.include(l.DoublePrecision,m),r.uniforms.add(new g.Matrix3PassUniform("transformViewFromCameraRelativeRS",n=>n.transformViewFromCameraRelativeRS),new e.Matrix3DrawUniform("transformWorldFromModelRS",n=>n.transformWorldFromModelRS),new k.Float3DrawUniform("transformWorldFromModelTL",n=>n.transformWorldFromModelTL),new k.Float3DrawUniform("transformWorldFromModelTH",n=>n.transformWorldFromModelTH),new h.Float3PassUniform("transformWorldFromViewTL",n=>n.transformWorldFromViewTL),new h.Float3PassUniform("transformWorldFromViewTH", n=>n.transformWorldFromViewTH)),r.code.add(c.glsl` void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) { vec3 rotatedModelPosition = transformWorldFromModelRS * modelPos; vec3 transformCameraRelativeFromModel = dpAdd( transformWorldFromModelTL, transformWorldFromModelTH, -transformWorldFromViewTL, -transformWorldFromViewTH ); worldPos = transformCameraRelativeFromModel + rotatedModelPosition; if (verticalOffset != 0.0) { vec3 vUp = ${m.spherical?c.glsl`normalize(transformWorldFromModelTL + rotatedModelPosition);`:c.glsl`vec3(0.0, 0.0, 1.0);`} worldPos += verticalOffset * vUp; } viewPos = transformViewFromCameraRelativeRS * worldPos; } `));r.uniforms.add(new d.Matrix4PassUniform("transformProjFromView",(n,u)=>u.camera.projectionMatrix));r.code.add(c.glsl`vec4 projFromViewPosition(vec3 position) { return transformProjFromView * vec4(position, 1.0); }`);r.code.add(c.glsl`float calculateExtensionLength(float extensionLength, float lineLength) { return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0); }`)};a.usesSketchLogic=function(v){return v===a.EdgeType.Sketch||v===a.EdgeType.Mixed};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl":function(){define("exports ../../../../../../../core/compilerUtils ../../../../../../../core/floatRGBA ../../../../../../../core/has ./DecodeSymbolColor.glsl ../../../../core/shaderLibrary/ShaderOutput ../../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl ../../../../core/shaderModules/Float4DrawUniform ../../../../core/shaderModules/IntegerDrawUniform ../../../../core/shaderModules/interfaces ../../../../core/shaderModules/Texture2DDrawUniform ../../../../lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){function t(m,r){const {vertex:n,fragment:u}=m;n.include(h.RgbaFloatEncoding);n.uniforms.add(new g.Texture2DDrawUniform("componentColorTex",x=>x.componentParameters.texture.texture));m.attributes.add(d.VertexAttribute.COMPONENTINDEX,"float");m.varyings.add("vExternalColorMixMode","mediump float");m.varyings.add("vExternalColor","vec4");(r=r.output===k.ShaderOutput.ObjectAndLayerIdColor)&&m.varyings.add("vObjectAndLayerIdColor","vec4");m.include(p.DecodeSymbolColor); n.constants.add("elevationScale","float",2*v);n.constants.add("stride","float",l("enable-feature:objectAndLayerId-rendering")?3:2);n.code.add(e.glsl`vec2 getComponentTextureCoordinates(float componentIndex, float typeOffset) { float index = componentIndex * stride + typeOffset; float texSize = float(textureSize(componentColorTex, 0).x); float coordX = mod(index, texSize); float coordY = floor(index / texSize); return vec2(coordX, coordY) + 0.5; }`);n.code.add(e.glsl` vec4 _readComponentColor() { vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 0.0); return texelFetch(componentColorTex, ivec2(textureCoordinates), 0); } float readElevationOffset() { vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 1.0); vec4 encodedElevation = texelFetch(componentColorTex, ivec2(textureCoordinates), 0); return (rgba2float(encodedElevation) - 0.5) * elevationScale; } ${r?e.glsl` void forwardObjectAndLayerIdColor() { vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 2.0); vObjectAndLayerIdColor = texelFetch(componentColorTex, ivec2(textureCoordinates), 0); }`:e.glsl`void forwardObjectAndLayerIdColor() {}`} vec4 forwardExternalColor(out bool castShadows) { vec4 componentColor = _readComponentColor() * 255.0; float shadowFlag = mod(componentColor.b * 255.0, 2.0); componentColor.b -= shadowFlag; castShadows = shadowFlag >= 1.0; int decodedColorMixMode; vExternalColor = decodeSymbolColor(componentColor, decodedColorMixMode) * 0.003921568627451; // = 1/255; vExternalColorMixMode = float(decodedColorMixMode) + 0.5; // add 0.5 to avoid interpolation artifacts return vExternalColor; } `);u.code.add(e.glsl` void readExternalColor(out vec4 externalColor, out int externalColorMixMode) { externalColor = vExternalColor; externalColorMixMode = int(vExternalColorMixMode); } void outputObjectAndLayerIdColor() { ${r?e.glsl`fragColor = vObjectAndLayerIdColor;`:""} } `)}function w(m,r){const {vertex:n,fragment:u}=m;n.uniforms.add(new f.Float4DrawUniform("externalColor",x=>x.componentParameters.externalColor));u.uniforms.add(new c.IntegerDrawUniform("externalColorMixMode",x=>x.componentParameters.externalColorMixMode));m.varyings.add("vExternalColor","vec4");n.code.add(e.glsl`float readElevationOffset() { return 0.0; } void forwardObjectAndLayerIdColor() {} vec4 forwardExternalColor(out bool castShadows) { vExternalColor = externalColor; castShadows = true; return externalColor; }`);u.code.add(e.glsl` void readExternalColor(out vec4 color, out int colorMixMode) { color = vExternalColor; colorMixMode = externalColorMixMode; } void outputObjectAndLayerIdColor() { ${r.output===k.ShaderOutput.ObjectAndLayerIdColor?e.glsl`fragColor = vec4(0,0,0,0);`:""} } `)}a.ComponentDataType=void 0;(function(m){m[m.Uniform=0]="Uniform";m[m.Varying=1]="Varying";m[m.COUNT=2]="COUNT"})(a.ComponentDataType||(a.ComponentDataType={}));const v=2**32/1E4;a.ComponentData=function(m,r){switch(r.componentData){case a.ComponentDataType.Varying:return t(m,r);case a.ComponentDataType.Uniform:return w(m,r);case a.ComponentDataType.COUNT:break;default:b.neverReached(r.componentData)}};a.encodeElevationOffset=function(m,r){q.packFloatRGBA(m/v*.5+.5,r)};a.maxElevationOffset=v;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/core/floatRGBA":function(){define(["exports","./mathUtils"],function(a,b){function q(h,f=0){let c=0;for(let e=0;4>e;e++)c+=h[f+e]*p[e];return c}const l=[1,256,65536,16777216],p=[1/256,1/65536,1/16777216,1/4294967296],k=q(new Uint8ClampedArray([255,255,255,255]));a.packFloatRGBA=function(h,f,c=0){h=b.clamp(h,0,k);for(let d=0;4>d;d++){var e=Math,g=h*l[d];f[c+d]=e.floor.call(e,256*(g-Math.floor(g)))}};a.unpackFloatRGBA=q;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/shader/DecodeSymbolColor.glsl":function(){define(["exports","../../../../../layers/support/symbolColorUtils","../../../../core/shaderModules/interfaces"],function(a,b,q){a.DecodeSymbolColor=function(l){l.vertex.code.add(q.glsl` vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) { float symbolAlpha = 0.0; const float maxTint = 85.0; const float maxReplace = 170.0; const float scaleAlpha = 3.0; if (symbolColor.a > maxReplace) { colorMixMode = ${q.glsl.int(b.ColorMixModeEnum.Multiply)}; symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace); } else if (symbolColor.a > maxTint) { colorMixMode = ${q.glsl.int(b.ColorMixModeEnum.Replace)}; symbolAlpha = scaleAlpha * (symbolColor.a - maxTint); } else if (symbolColor.a > 0.0) { colorMixMode = ${q.glsl.int(b.ColorMixModeEnum.Tint)}; symbolAlpha = scaleAlpha * symbolColor.a; } else { colorMixMode = ${q.glsl.int(b.ColorMixModeEnum.Multiply)}; symbolAlpha = 0.0; } return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha); } `)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/symbolColorUtils":function(){define(["exports","../../../../core/mathUtils"],function(a,b){a.ColorMixModeEnum=void 0;(function(q){q[q.Multiply=1]="Multiply";q[q.Ignore=2]="Ignore";q[q.Replace=3]="Replace";q[q.Tint=4]="Tint"})(a.ColorMixModeEnum||(a.ColorMixModeEnum={}));a.encodeSymbolColor=function(q,l,p){if(null==q||l===a.ColorMixModeEnum.Ignore)p[0]=255,p[1]=255,p[2]=255,p[3]=255;else{var k=b.clamp(Math.round(85* q[3]),0,85);l=0===k||l===a.ColorMixModeEnum.Tint?0:l===a.ColorMixModeEnum.Replace?85:170;p[0]=b.clamp(Math.round(255*q[0]),0,255);p[1]=b.clamp(Math.round(255*q[1]),0,255);p[2]=b.clamp(Math.round(255*q[2]),0,255);p[3]=k+l}};a.parseColorMixMode=function(q){switch(q){case "multiply":return a.ColorMixModeEnum.Multiply;case "ignore":return a.ColorMixModeEnum.Ignore;case "replace":return a.ColorMixModeEnum.Replace;case "tint":return a.ColorMixModeEnum.Tint;default:return a.ColorMixModeEnum.Multiply}};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec4",q.BindType.Draw,(h,f,c)=>h.setUniform4fv(p,k(f,c)))}}a.Float4DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/IntegerDrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"], function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"int",q.BindType.Draw,(h,f,c)=>h.setUniform1i(p,k(f,c)))}}a.IntegerDrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl":function(){define(["exports","../../../../../../core/compilerUtils","../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q,l){a.NormalType=void 0;(function(p){p[p.Attribute=0]="Attribute"; p[p.Compressed=1]="Compressed";p[p.Ground=2]="Ground";p[p.ScreenDerivative=3]="ScreenDerivative";p[p.COUNT=4]="COUNT"})(a.NormalType||(a.NormalType={}));a.NormalAttribute=function(p,k){switch(k.normalType){case a.NormalType.Compressed:p.attributes.add(l.VertexAttribute.NORMALCOMPRESSED,"vec2");p.vertex.code.add(q.glsl`vec3 decompressNormal(vec2 normal) { float z = 1.0 - abs(normal.x) - abs(normal.y); return vec3(normal + sign(normal) * min(z, 0.0), z); } vec3 normalModel() { return decompressNormal(normalCompressed); }`);break;case a.NormalType.Attribute:p.attributes.add(l.VertexAttribute.NORMAL,"vec3");p.vertex.code.add(q.glsl`vec3 normalModel() { return normal; }`);break;case a.NormalType.ScreenDerivative:p.fragment.code.add(q.glsl`vec3 screenDerivativeNormal(vec3 positionView) { return normalize(cross(dFdx(positionView), dFdy(positionView))); }`);break;default:b.neverReached(k.normalType);case a.NormalType.COUNT:case a.NormalType.Ground:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultMaterial":function(){define("exports ../../../../core/has ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../ViewingMode ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/shading/Normals.glsl ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../lib/basicInterfaces ../lib/GLTextureMaterial ../lib/Material ../lib/OrderIndependentTransparency ../lib/RayIntersections ../lib/RenderSlot ../lib/VertexAttribute ../lib/verticalOffsetUtils ./DefaultBufferWriter ./internal/MaterialUtil ../shaders/DefaultMaterialTechnique ../shaders/DefaultMaterialTechniqueConfiguration ../shaders/RealisticTreeTechnique".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(M){const K=k.newLayout().vec3f(r.VertexAttribute.POSITION);M.normalType===f.NormalType.Compressed?K.vec2i16(r.VertexAttribute.NORMALCOMPRESSED,{glNormalized:!0}):K.vec3f(r.VertexAttribute.NORMAL);M.hasVertexTangents&&K.vec4f(r.VertexAttribute.TANGENT);(M.textureId||M.normalTextureId||M.metallicRoughnessTextureId||M.emissiveTextureId||M.occlusionTextureId)&&K.vec2f(r.VertexAttribute.UV0);M.hasVertexColors&&K.vec4u8(r.VertexAttribute.COLOR); M.hasSymbolColors&&K.vec4u8(r.VertexAttribute.SYMBOLCOLOR);b("enable-feature:objectAndLayerId-rendering")&&K.vec4u8(r.VertexAttribute.OBJECTANDLAYERIDCOLOR);return K}class C extends t.Material{constructor(M){super(M,H);this.supportsEdges=!0;this.produces=new Map([[m.RenderSlot.OPAQUE_MATERIAL,K=>(h.is3DGeometryOutput(K)||h.isShadowRelatedOutput(K))&&!this.parameters.transparent],[m.RenderSlot.TRANSPARENT_MATERIAL,K=>(h.is3DGeometryOutput(K)||h.isShadowRelatedOutput(K))&&this.parameters.transparent&& this.parameters.writeDepth],[m.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,K=>(h.is3DGeometryOutput(K)||h.isShadowRelatedOutput(K))&&this.parameters.transparent&&!this.parameters.writeDepth]]);this._configuration=new z.DefaultMaterialTechniqueConfiguration;this._vertexBufferLayout=B(this.parameters)}isVisibleForOutput(M){return M===h.ShaderOutput.Shadow||M===h.ShaderOutput.ShadowExcludeHighlight||M===h.ShaderOutput.ShadowHighlight?this.parameters.castShadows:!0}isVisible(){var M=this.parameters; if(!super.isVisible()||0===M.layerOpacity)return!1;const {hasInstancedColor:K,hasVertexColors:J,hasSymbolColors:R,vvColor:Q}=M,W="replace"===M.colorMixMode,S=0 0.0 ? normalize(-params.normalView) : normalize(params.normalView); }`);break;case a.NormalsDoubleSidedMode.WindingOrder:l.code.add(q.glsl`vec3 shadingNormal(ShadingNormalParameters params) { return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView); }`);break;default:b.neverReached(p.doubleSidedMode);case a.NormalsDoubleSidedMode.COUNT:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RayIntersections":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ./ContentObjectType ./Util ./VertexAttribute".split(" "),function(a,b,q,l,p,k,h){function f(C,D,F,H,N,E,G){if(null!=C){var I=g(F,m);l.setMin(v,C.bbMin); l.setMax(v,C.bbMax);null!=N&&N.applyToAabb(v);if(d(v,D,I,H)){const {primitiveIndices:ha,position:ba}=C;I=ha?ha.length:ba.indices.length/3;if(1E3=Math.abs(fa))){K=U-K;J=Z-J;R=D-R;T=K*T+J*Y+R*ka;if(0T||T>fa)continue}else if(0K||T+K>fa)continue}else if(0=K?M>=J?0:2:K>=J?1:2;J=0>D[M]?2:1;K=(M+J)%3;J=(M+(3-J))%3;const R=D[K]/D[M],Q=D[J]/D[M];D=1/D[M];const W=n,S=u,V=x;for({normalRequired:O}=O;FT||0>ba||0>ha)&&(0T*Math.sign(Y)||(T/=Y,0<=T&&(O?(Y=P,b.sub(y,Y[1],Y[0]),b.sub(z,Y[2],Y[0]),b.cross(r,y,z),b.normalize(r,r),Y=r):Y=null,L(T,F,Y)))))}}function e(C,D,F,H,N,E,G){b.set(y, C,D,F);b.set(z,H,N,E);b.cross(G,y,z);b.normalize(G,G);return G}function g(C,D){return b.set(D,1/C[0],1/C[1],1/C[2])}function d(C,D,F,H){return t(C,D,F,H,Infinity)}function t(C,D,F,H,N){var E=(C[0]-H-D[0])*F[0],G=(C[3]+H-D[0])*F[0];let I=Math.min(E,G);E=Math.max(E,G);G=(C[1]-H-D[1])*F[1];const O=(C[4]+H-D[1])*F[1];E=Math.min(E,Math.max(G,O));if(0>E)return!1;I=Math.max(I,Math.min(G,O));if(I>E)return!1;G=(C[2]-H-D[2])*F[2];C=(C[5]+H-D[2])*F[2];E=Math.min(E,Math.max(G,C));if(0>E)return!1;I=Math.max(I, Math.min(G,C));return I>E?!1:I=Math.abs(Z))){S=M-S;V=K-V;T=C-T;ba=S*ba+V*U+T*ia;if(0ba||ba>Z)continue}else if(0S||ba+S>Z)continue}else if(0=Math.abs(ea))){T=J-T;Y=R-Y;ha=C-ha;da=T*da+Y*ia+ha*ka;if(0da||da>ea)continue}else if(0Y|| da+Y>ea)continue}else if(0{E(O,P,L,!1)},I=new w(!1,D.options.normalRequired);C.boundingInfo?(k.assert(C.type===p.ContentObjectType.Mesh),f(C.boundingInfo,F,H,D.tolerance,N,I,G)):(C=C.attributes.get(h.VertexAttribute.POSITION),D=C.indices,c(F,H,0,D.length/3,D,C.data,C.stride,N,I,G))}};a.intersectTriangles=function(C, D,F,H,N,E,G,I,O){const {data:L,stride:P}=E;D=b.sub(A,D,C);c(C,D,F,H,N,L,P,G,I,O)};a.triangleRayParallelTolerance=1E-7;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultBufferWriter":function(){define(["exports","../lib/VertexAttribute","./internal/bufferWriterUtils"],function(a,b,q){class l{constructor(p){this.vertexBufferLayout=p}elementCount(p){return p.attributes.get(b.VertexAttribute.POSITION).indices.length}write(p,k,h,f,c){q.writeDefaultAttributes(h, this.vertexBufferLayout,p,k,f,c)}}a.DefaultBufferWriter=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/DefaultMaterialTechnique":function(){define("require exports ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../core/shaderLibrary/attributes/VertexNormal.glsl ../core/shaderLibrary/util/AlphaCutoff ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/basicInterfaces ../lib/DefaultVertexAttributeLocations ../lib/Material ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../materials/pbrUtils ../../../../chunks/DefaultMaterial.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){class B extends c.VertexNormalPassParameters{constructor(){super(...arguments);this.usePBR=this.isSchematic=!1;this.mrrFactors=q.fromArray(x.defaultAdvancedMRRFactors);this.doubleSided=this.hasSymbolColors=this.hasVertexColors=!1;this.doubleSidedType="normal";this.cullFace=t.CullFaceOptions.Back;this.hasInstancedColor=this.isInstanced=!1;this.emissiveFactor=q.fromValues(0,0,0);this.instancedDoublePrecision=!1;this.normalType=h.NormalType.Attribute; this.castShadows=this.receiveAmbientOcclusion=this.receiveShadows=!0;this.shadowMappingEnabled=!1;this.ambient=q.fromValues(.2,.2,.2);this.diffuse=q.fromValues(.8,.8,.8);this.externalColor=l.fromValues(1,1,1,1);this.colorMixMode="multiply";this.layerOpacity=this.opacity=1;this.origin=q.create();this.hasSlicePlane=!1;this.hasSliceHighlight=!0;this.offsetTransparentBackfaces=!1;this.modelTransformation=this.vvSymbolRotationMatrix=this.vvSymbolAnchor=this.vvOpacity=this.vvColor=this.vvSize=null;this.transparent= !1;this.writeDepth=!0;this.customDepthTest=t.DepthTestFunction.Less;this.textureAlphaMode=t.AlphaDiscardMode.Blend;this.textureAlphaCutoff=e.defaultMaskAlphaCutoff;this.hasOccludees=this.textureAlphaPremultiplied=!1;this.renderOccluded=v.RenderOccludedFlag.Occlude;this.isDecoration=!1}}class C extends c.VertexNormalDrawParameters{constructor(){super(...arguments);this.slicePlaneLocalOrigin=this.origin=q.create()}}class D extends d.ShaderTechnique{initializeConfiguration(F,H){H.spherical=F.viewingMode=== p.ViewingMode.Global;H.doublePrecisionRequiresObfuscation=F.rctx.driverTest.doublePrecisionRequiresObfuscation.result;H.textureCoordinateType=H.hasColorTexture||H.hasMetallicRoughnessTexture||H.hasEmissionTexture||H.hasOcclusionTexture||H.hasNormalTexture?f.TextureCoordinateAttributeType.Default:f.TextureCoordinateAttributeType.None;H.objectAndLayerIdColorInstanced=H.instanced}initializeProgram(F){return this._initializeProgram(F,D.shader)}_initializeProgram(F,H){return new r.Program(F.rctx,H.get().build(this.configuration), w.Default3D)}_makePipeline(F,H){const N=this.configuration,E=F===u.TransparencyPassType.NONE,G=F===u.TransparencyPassType.FrontFace;var I=A.makePipelineState,O=N.output===k.ShaderOutput.Color&&N.transparent?E?m.blendingDefault:m.oitBlending(F):null;var L=N.cullFace!==t.CullFaceOptions.None?!0:N.hasSlicePlane?!1:!N.transparent&&!N.doubleSidedMode;return I.call(A,{blending:O,culling:L?A.cullingParams(N.cullFace):null,depthTest:{func:m.oitDepthTest(F,N.customDepthTest===t.DepthTestFunction.Lequal?z.CompareFunction.LEQUAL: z.CompareFunction.LESS)},depthWrite:E||G?N.writeDepth?A.defaultDepthWriteParams:null:null,drawBuffers:N.output===k.ShaderOutput.Depth?{buffers:[z.SpecialDrawBuffers.NONE]}:m.oitDrawBuffers(F),colorWrite:A.defaultColorWriteParams,stencilWrite:N.hasOccludees?n.stencilWriteMaskOn:null,stencilTest:N.hasOccludees?H?n.stencilToolMaskBaseParams:n.stencilBaseAllZerosParams:null,polygonOffset:E||G?null:m.getOITPolygonOffset(N.enableOffset)})}initializePipeline(){this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType, !0);return this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(F){return F?this._occludeePipelineState:super.getPipeline()}}D.shader=new g.ReloadableShaderModule(y.DefaultMaterial,()=>new Promise((F,H)=>a(["./DefaultMaterial.glsl"],F,H)));b.DefaultMaterialDrawParameters=C;b.DefaultMaterialPassParameters=B;b.DefaultMaterialTechnique=D;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl":function(){define("exports ../../../../../../core/compilerUtils ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ./NormalAttribute.glsl ./VertexPosition.glsl ../../shaderModules/interfaces ../../shaderModules/Matrix3DrawUniform ../../shaderModules/Matrix3PassUniform".split(" "), function(a,b,q,l,p,k,h,f,c){class e extends k.VertexPositionPassParameters{constructor(){super(...arguments);this.transformNormalViewFromGlobal=q.create()}}class g extends k.VertexPositionDrawParameters{constructor(){super(...arguments);this.transformNormalGlobalFromModel=q.create();this.toMapSpace=l.create()}}a.VertexNormal=function(d,t){switch(t.normalType){case p.NormalType.Attribute:case p.NormalType.Compressed:d.include(p.NormalAttribute,t);d.varyings.add("vNormalWorld","vec3");d.varyings.add("vNormalView", "vec3");d.vertex.uniforms.add(new f.Matrix3DrawUniform("transformNormalGlobalFromModel",w=>w.transformNormalGlobalFromModel),new c.Matrix3PassUniform("transformNormalViewFromGlobal",w=>w.transformNormalViewFromGlobal));d.vertex.code.add(h.glsl`void forwardNormal() { vNormalWorld = transformNormalGlobalFromModel * normalModel(); vNormalView = transformNormalViewFromGlobal * vNormalWorld; }`);break;case p.NormalType.Ground:d.include(k.VertexPosition,t);d.varyings.add("vNormalWorld","vec3");d.vertex.code.add(h.glsl` void forwardNormal() { vNormalWorld = ${t.spherical?h.glsl`normalize(vPositionWorldCameraRelative);`:h.glsl`vec3(0.0, 0.0, 1.0);`} } `);break;case p.NormalType.ScreenDerivative:d.vertex.code.add(h.glsl`void forwardNormal() {}`);break;default:b.neverReached(t.normalType);case p.NormalType.COUNT:}};a.VertexNormalDrawParameters=g;a.VertexNormalPassParameters=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/StencilUtils":function(){define(["exports","./basicInterfaces","../../../webgl/enums"],function(a,b,q){const l={func:q.CompareFunction.LESS},p={function:{func:q.CompareFunction.ALWAYS, ref:b.StencilBits.OutlineVisualElementMask,mask:b.StencilBits.OutlineVisualElementMask},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.ZERO}},k={function:{func:q.CompareFunction.ALWAYS,ref:b.StencilBits.OutlineVisualElementMask,mask:b.StencilBits.OutlineVisualElementMask},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.REPLACE}},h={function:{func:q.CompareFunction.EQUAL,ref:b.StencilBits.OutlineVisualElementMask, mask:b.StencilBits.OutlineVisualElementMask},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.KEEP}};b={function:{func:q.CompareFunction.NOTEQUAL,ref:b.StencilBits.OutlineVisualElementMask,mask:b.StencilBits.OutlineVisualElementMask},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.KEEP}};a.depthCompareAlways={func:q.CompareFunction.ALWAYS};a.depthCompareLess=l;a.renderWhenBitIsNotSet=f=>({function:{func:q.CompareFunction.NOTEQUAL, ref:f,mask:f},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.KEEP}});a.replaceBitWhenDepthTestPasses=f=>({function:{func:q.CompareFunction.ALWAYS,ref:f,mask:f},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.REPLACE}});a.stencilBaseAllZerosParams=p;a.stencilToolMaskBaseParams=k;a.stencilToolMaskOccluderParams=h;a.stencilToolTransparentOccluderParams=b;a.stencilWriteMaskOff={mask:0};a.stencilWriteMaskOn= {mask:255};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/pbrUtils":function(){define(["exports","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q){a.defaultAdvancedMRRFactors=[1,1,.5];a.defaultEsriSymbologyMRRFactors=[0,1,.2];a.defaultSchematicMRRFactors=[0,.6,.2];a.useSchematicPBR=function({normalTexture:l,metallicRoughnessTexture:p,metallicFactor:k,roughnessFactor:h,emissiveTexture:f,emissiveFactor:c, occlusionTexture:e}){return null==l&&null==p&&null==f&&(null==c||b.exactEquals(c,q.ZEROS))&&null==e&&(null==h||1===h)&&(null==k||1===k)};a.useSchematicPBRI3S=function({normalTexture:l,metallicRoughnessTexture:p,metallicFactor:k,roughnessFactor:h,emissiveTexture:f,emissiveFactor:c,occlusionTexture:e}){return null==l&&null==p&&null==f&&(null==c||b.exactEquals(c,q.ZEROS))&&null==e&&(null==h||1===h)&&(null==k||1===k||0===k)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/DefaultMaterial.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl ../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J){function R(W){const S=new P.ShaderBuilder,{vertex:V,fragment:T,varyings:Y}=S;E.addProjViewLocalOrigin(V,W);S.include(c.PositionAttribute);Y.add("vpos","vec3");S.include(D.VisualVariables,W);S.include(h.InstancedDoublePrecision,W);S.include(w.VerticalOffset,W);S.include(C.colorTextureUV,W);if(W.output===l.ShaderOutput.Color){S.include(C.normalTextureUV,W);S.include(C.emissiveTextureUV,W);S.include(C.occlusionTextureUV, W);S.include(C.metallicRoughnessTextureUV,W);E.addCameraPosition(V,W);S.include(f.NormalAttribute,W);S.include(k.Transform,W);const ha=W.normalType===f.NormalType.Attribute||W.normalType===f.NormalType.Compressed;ha&&W.offsetBackfaces&&S.include(q.Offset);S.include(m.ComputeNormalTexture,W);S.include(t.VertexNormal,W);W.instancedColor&&S.attributes.add(J.VertexAttribute.INSTANCECOLOR,"vec4");Y.add("vPositionLocal","vec3");S.include(g.TextureCoordinateAttribute,W);S.include(b.ForwardLinearDepth,W); S.include(e.SymbolColor,W);S.include(d.VertexColor,W);V.uniforms.add(new I.Float4PassUniform("externalColor",ba=>ba.externalColor));Y.add("vcolorExt","vec4");W.multipassEnabled&&Y.add("depth","float");V.code.add(L.glsl` void main(void) { forwardNormalizedVertexColor(); vcolorExt = externalColor; ${W.instancedColor?"vcolorExt *\x3d instanceColor * 0.003921568627451;":""} vcolorExt *= vvColor(); vcolorExt *= getSymbolColor(); forwardColorMixMode(); if (vcolorExt.a < ${L.glsl.float(F.symbolAlphaCutoff)}) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); } else { vpos = getVertexInLocalOriginSpace(); vPositionLocal = vpos - view[3].xyz; vpos = subtractOrigin(vpos); ${ha?L.glsl`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""} vpos = addVerticalOffset(vpos, localOrigin); ${W.hasVertexTangents?"vTangent \x3d dpTransformVertexTangent(tangent);":""} gl_Position = transformPosition(proj, view, vpos); ${ha&&W.offsetBackfaces?"gl_Position \x3d offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""} } ${W.multipassEnabled?"depth \x3d (view * vec4(vpos, 1.0)).z;":""} forwardLinearDepth(); forwardTextureCoordinates(); forwardColorUV(); forwardNormalUV(); forwardEmissiveUV(); forwardOcclusionUV(); forwardMetallicRoughnessUV(); } `);S.include(p.SliceDraw,W);S.include(n.EvaluateSceneLighting,W);S.include(r.EvaluateAmbientOcclusion,W);S.include(H.DiscardOrAdjustAlphaPass,W);S.include(W.instancedDoublePrecision?B.ReadShadowMapPass:B.ReadShadowMapDraw,W);S.include(x.multipassTerrainTest,W);E.addCameraPosition(T,W);T.uniforms.add(V.uniforms.get("localOrigin"),new G.Float3PassUniform("ambient",ba=>ba.ambient),new G.Float3PassUniform("diffuse",ba=>ba.diffuse),new O.FloatPassUniform("opacity",ba=>ba.opacity),new O.FloatPassUniform("layerOpacity", ba=>ba.layerOpacity));W.hasColorTexture&&T.uniforms.add(new M.Texture2DPassUniform("tex",ba=>ba.texture));S.include(A.PhysicallyBasedRenderingParameters,W);S.include(z.PhysicallyBasedRendering,W);T.include(N.MixExternalColor);S.include(y.Normals,W);n.addAmbientBoostFactor(T);n.addLightingGlobalFactor(T);u.addMainLightIntensity(T);W.transparencyPassType===K.TransparencyPassType.ColorAlpha&&(S.outputs.add("fragColor","vec4",0),S.outputs.add("fragAlpha","float",1));T.code.add(L.glsl` void main() { discardBySlice(vpos); ${W.multipassEnabled?"terrainDepthTest(depth);":""} ${W.hasColorTexture?L.glsl` vec4 texColor = texture(tex, ${W.hasColorTextureTransform?L.glsl`colorUV`:L.glsl`vuv0`}); ${W.textureAlphaPremultiplied?"texColor.rgb /\x3d texColor.a;":""} discardOrAdjustAlpha(texColor);`:L.glsl`vec4 texColor = vec4(1.0);`} shadingParams.viewDirection = normalize(vpos - cameraPosition); ${W.normalType===f.NormalType.ScreenDerivative?L.glsl` vec3 normal = screenDerivativeNormal(vPositionLocal);`:L.glsl` shadingParams.normalView = vNormalWorld; vec3 normal = shadingNormal(shadingParams);`} ${W.pbrMode===A.PBRMode.Normal?"applyPBRFactors();":""} float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion(); vec3 posWorld = vpos + localOrigin; float additionalAmbientScale = additionalDirectedAmbientLight(posWorld); float shadow = ${W.receiveShadows?"readShadowMap(vpos, linearDepth)":W.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; vec3 matColor = max(ambient, diffuse); ${W.hasVertexColors?L.glsl` vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:L.glsl` vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} ${W.hasNormalTexture?L.glsl` mat3 tangentSpace = ${W.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"} vec3 shadingNormal = computeTextureNormal(tangentSpace, ${W.hasNormalTextureTransform?L.glsl`normalUV`:"vuv0"});`:L.glsl`vec3 shadingNormal = normal;`} vec3 normalGround = ${W.spherical?L.glsl`normalize(posWorld);`:L.glsl`vec3(0.0, 0.0, 1.0);`} ${W.snowCover?L.glsl` float snow = smoothstep(0.5, 0.55, dot(normal, normalGround)); albedo = mix(albedo, vec3(1), snow); shadingNormal = mix(shadingNormal, normal, snow); ssao = mix(ssao, 1.0, snow);`:""} vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; ${W.pbrMode===A.PBRMode.Normal||W.pbrMode===A.PBRMode.Schematic?L.glsl` float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; ${W.snowCover?L.glsl` mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow); emission = mix(emission, vec3(0.0), snow);`:""} vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:L.glsl`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos); ${W.transparencyPassType===K.TransparencyPassType.ColorAlpha?L.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""} } `)}S.include(v.DefaultMaterialAuxiliaryPasses,W);return S}const Q=Object.freeze(Object.defineProperty({__proto__:null,build:R},Symbol.toStringTag,{value:"Module"}));a.DefaultMaterial=Q;a.build=R})},"esri/views/3d/webgl-engine/core/shaderLibrary/Offset.glsl":function(){define(["exports","../shaderModules/interfaces"],function(a,b){a.Offset=function(q){q.vertex.code.add(b.glsl`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) { vec3 camToVert = posWorld - camPosWorld; bool isBackface = dot(camToVert, normalWorld) > 0.0; if (isBackface) { posClip.z += 0.0000003 * posClip.w; } return posClip; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl":function(){define("exports ../../../collections/Component/Material/shader/DecodeSymbolColor.glsl ../../shaderModules/IntegerPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute ../../../materials/internal/MaterialUtil".split(" "),function(a,b,q,l,p,k){a.SymbolColor=function(h,f){f.hasSymbolColors?(h.include(b.DecodeSymbolColor),h.attributes.add(p.VertexAttribute.SYMBOLCOLOR, "vec4"),h.varyings.add("colorMixMode","mediump float"),h.vertex.code.add(l.glsl`int symbolColorMixMode; vec4 getSymbolColor() { return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; } void forwardColorMixMode() { colorMixMode = float(symbolColorMixMode) + 0.5; }`)):(h.fragment.uniforms.add(new q.IntegerPassUniform("colorMixMode",c=>k.colorMixModes[c.colorMixMode])),h.vertex.code.add(l.glsl`vec4 getSymbolColor() { return vec4(1.0); } void forwardColorMixMode() {}`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/IntegerPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"int",q.BindType.Pass,(h,f,c)=>h.setUniform1i(p,k(f,c)))}}a.IntegerPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl":function(){define(["exports", "../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q){a.VertexColor=function(l,p){p.hasVertexColors?(l.attributes.add(q.VertexAttribute.COLOR,"vec4"),l.varyings.add("vColor","vec4"),l.vertex.code.add(b.glsl`void forwardVertexColor() { vColor = color; }`),l.vertex.code.add(b.glsl`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):l.vertex.code.add(b.glsl`void forwardVertexColor() {} void forwardNormalizedVertexColor() {}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl":function(){define("exports ../ForwardLinearDepth.glsl ../ShaderOutput ../Slice.glsl ../Transform.glsl ../attributes/NormalAttribute.glsl ../attributes/ObjectAndLayerIdColor.glsl ../attributes/TextureCoordinateAttribute.glsl ../attributes/VertexNormal.glsl ../output/OutputDepth.glsl ../output/OutputHighlight.glsl ../shading/VisualVariables.glsl ../util/AlphaDiscard.glsl ../util/View.glsl ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform ../../../lib/basicInterfaces".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){a.DefaultMaterialAuxiliaryPasses=function(n,u){const {vertex:x,fragment:y}=n,z=u.hasColorTexture&&u.alphaDiscardMode!==r.AlphaDiscardMode.Opaque;switch(u.output){case q.ShaderOutput.Depth:w.addProjViewLocalOrigin(x,u);n.include(p.Transform,u);n.include(l.SliceDraw,u);n.include(f.TextureCoordinateAttribute,u);z&&y.uniforms.add(new m.Texture2DPassUniform("tex",A=>A.texture));x.code.add(v.glsl`void main(void) { vpos = getVertexInLocalOriginSpace(); vpos = subtractOrigin(vpos); vpos = addVerticalOffset(vpos, localOrigin); gl_Position = transformPosition(proj, view, vpos); forwardTextureCoordinates(); }`);n.include(t.DiscardOrAdjustAlphaPass,u);y.code.add(v.glsl` void main(void) { discardBySlice(vpos); ${z?v.glsl` vec4 texColor = texture(tex, ${u.hasColorTextureTransform?v.glsl`colorUV`:v.glsl`vuv0`}); discardOrAdjustAlpha(texColor);`:""} } `);break;case q.ShaderOutput.Shadow:case q.ShaderOutput.ShadowHighlight:case q.ShaderOutput.ShadowExcludeHighlight:case q.ShaderOutput.ViewshedShadow:case q.ShaderOutput.ObjectAndLayerIdColor:w.addProjViewLocalOrigin(x,u);n.include(p.Transform,u);n.include(f.TextureCoordinateAttribute,u);n.include(d.VisualVariables,u);n.include(e.OutputDepth,u);n.include(l.SliceDraw,u);n.include(h.ObjectAndLayerIdColor,u);b.addNearFar(n);n.varyings.add("depth","float");z&&y.uniforms.add(new m.Texture2DPassUniform("tex", A=>A.texture));x.code.add(v.glsl`void main(void) { vpos = getVertexInLocalOriginSpace(); vpos = subtractOrigin(vpos); vpos = addVerticalOffset(vpos, localOrigin); gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); forwardTextureCoordinates(); forwardObjectAndLayerIdColor(); }`);n.include(t.DiscardOrAdjustAlphaPass,u);y.code.add(v.glsl` void main(void) { discardBySlice(vpos); ${z?v.glsl` vec4 texColor = texture(tex, ${u.hasColorTextureTransform?v.glsl`colorUV`:v.glsl`vuv0`}); discardOrAdjustAlpha(texColor);`:""} ${u.output===q.ShaderOutput.ObjectAndLayerIdColor?v.glsl`outputObjectAndLayerIdColor();`:v.glsl`outputDepth(depth);`} } `);break;case q.ShaderOutput.Normal:w.addProjViewLocalOrigin(x,u);n.include(p.Transform,u);n.include(k.NormalAttribute,u);n.include(c.VertexNormal,u);n.include(f.TextureCoordinateAttribute,u);n.include(d.VisualVariables,u);z&&y.uniforms.add(new m.Texture2DPassUniform("tex",A=>A.texture));u.normalType===k.NormalType.ScreenDerivative&&n.varyings.add("vPositionView","vec3");x.code.add(v.glsl` void main(void) { vpos = getVertexInLocalOriginSpace(); ${u.normalType===k.NormalType.Attribute||u.normalType===k.NormalType.Compressed?v.glsl`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:v.glsl` // Get vertex position in camera space for screen-space derivative normals vPositionView = (view * vec4(vpos, 1.0)).xyz; `} vpos = subtractOrigin(vpos); vpos = addVerticalOffset(vpos, localOrigin); gl_Position = transformPosition(proj, view, vpos); forwardTextureCoordinates(); } `);n.include(l.SliceDraw,u);n.include(t.DiscardOrAdjustAlphaPass,u);y.code.add(v.glsl` void main() { discardBySlice(vpos); ${z?v.glsl` vec4 texColor = texture(tex, ${u.hasColorTextureTransform?v.glsl`colorUV`:v.glsl`vuv0`}); discardOrAdjustAlpha(texColor);`:""} ${u.normalType===k.NormalType.ScreenDerivative?v.glsl`vec3 normal = screenDerivativeNormal(vPositionView);`:v.glsl` vec3 normal = normalize(vNormalWorld); if (gl_FrontFacing == false){ normal = -normal; }`} fragColor = vec4(0.5 + 0.5 * normal, 1.0); } `);break;case q.ShaderOutput.Highlight:w.addProjViewLocalOrigin(x,u),n.include(p.Transform,u),n.include(f.TextureCoordinateAttribute,u),n.include(d.VisualVariables,u),z&&y.uniforms.add(new m.Texture2DPassUniform("tex",A=>A.texture)),x.code.add(v.glsl`void main(void) { vpos = getVertexInLocalOriginSpace(); vpos = subtractOrigin(vpos); vpos = addVerticalOffset(vpos, localOrigin); gl_Position = transformPosition(proj, view, vpos); forwardTextureCoordinates(); }`),n.include(l.SliceDraw,u),n.include(t.DiscardOrAdjustAlphaPass,u),n.include(g.OutputHighlight,u),y.code.add(v.glsl` void main() { discardBySlice(vpos); ${z?v.glsl` vec4 texColor = texture(tex, ${u.hasColorTextureTransform?v.glsl`colorUV`:v.glsl`vuv0`}); discardOrAdjustAlpha(texColor);`:""} outputHighlight(); } `)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl":function(){define(["exports","../ShaderOutput","../util/RgbaFloat16Encoding.glsl","../../shaderModules/interfaces"],function(a,b,q,l){a.OutputDepth=function(p,k){switch(k.output){case b.ShaderOutput.Shadow:case b.ShaderOutput.ShadowHighlight:case b.ShaderOutput.ShadowExcludeHighlight:case b.ShaderOutput.ViewshedShadow:p.fragment.include(q.Rgba4FloatEncoding), p.fragment.code.add(l.glsl`float _calculateFragDepth(const in float depth) { const float SLOPE_SCALE = 2.0; const float BIAS = 20.0 * .000015259; float m = max(abs(dFdx(depth)), abs(dFdy(depth))); return depth + SLOPE_SCALE * m + BIAS; } void outputDepth(float _linearDepth) { fragColor = floatToRgba4(_calculateFragDepth(_linearDepth)); }`)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloat16Encoding.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.Rgba4FloatEncoding=function(q){q.code.add(b.glsl`const float MAX_RGBA4_FLOAT = 15.0 / 16.0 + 15.0 / 16.0 / 16.0 + 15.0 / 16.0 / 16.0 / 16.0 + 15.0 / 16.0 / 16.0 / 16.0 / 16.0; const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0); vec4 floatToRgba4(const float value) { float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT); vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0); const float toU4AsFloat = 1.0 / 15.0; return fixedPointU4 * toU4AsFloat; } const vec4 RGBA4_2_FLOAT_FACTORS = vec4( 15.0 / (16.0), 15.0 / (16.0 * 16.0), 15.0 / (16.0 * 16.0 * 16.0), 15.0 / (16.0 * 16.0 * 16.0 * 16.0) ); float rgba4ToFloat(vec4 rgba) { return dot(rgba, RGBA4_2_FLOAT_FACTORS); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl":function(){define("exports ./DiscardOrAdjustAlphaBlend.glsl ../../shaderModules/FloatDrawUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../lib/basicInterfaces".split(" "),function(a,b,q,l,p,k){function h(f,c,e){const g=f.fragment;c.alphaDiscardMode!==k.AlphaDiscardMode.Mask&&c.alphaDiscardMode!==k.AlphaDiscardMode.MaskBlend|| g.uniforms.add(e);switch(c.alphaDiscardMode){case k.AlphaDiscardMode.Blend:return f.include(b.DiscardOrAdjustAlphaBlend);case k.AlphaDiscardMode.Opaque:g.code.add(p.glsl`void discardOrAdjustAlpha(inout vec4 color) { color.a = 1.0; }`);break;case k.AlphaDiscardMode.Mask:g.code.add(p.glsl`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case k.AlphaDiscardMode.MaskBlend:f.fragment.code.add(p.glsl`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}a.DiscardOrAdjustAlphaDraw=function(f,c){h(f,c,new q.FloatDrawUniform("textureAlphaCutoff",e=>e.textureAlphaCutoff))};a.DiscardOrAdjustAlphaPass=function(f,c){h(f,c,new l.FloatPassUniform("textureAlphaCutoff", e=>e.textureAlphaCutoff))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl":function(){define(["exports","./AlphaCutoff","../../shaderModules/interfaces"],function(a,b,q){a.DiscardOrAdjustAlphaBlend=function(l){l.fragment.code.add(q.glsl` #define discardOrAdjustAlpha(color) { if (color.a < ${q.glsl.float(b.symbolAlphaCutoff)}) { discard; } } `)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/FloatDrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"float",q.BindType.Draw,(h,f,c)=>h.setUniform1f(p,k(f,c)))}}a.FloatDrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../attributes/TextureCoordinateAttribute.glsl ../attributes/VertexTextureCoordinates.glsl ./Normals.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix3PassUniform ../../shaderModules/Texture2DDrawUniform ../../shaderModules/Texture2DPassUniform ../../shaderTechnique/BindType ../../../lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.ComputeNormalTexture=function(w,v){const m=w.fragment;v.hasVertexTangents?(w.attributes.add(t.VertexAttribute.TANGENT,"vec4"),w.varyings.add("vTangent","vec4"),v.doubleSidedMode===k.NormalsDoubleSidedMode.WindingOrder?m.code.add(f.glsl`mat3 computeTangentSpace(vec3 normal) { float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w; vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz); vec3 bitangent = cross(normal, tangent) * tangentHeadedness; return mat3(tangent, bitangent, normal); }`):m.code.add(f.glsl`mat3 computeTangentSpace(vec3 normal) { float tangentHeadedness = vTangent.w; vec3 tangent = normalize(vTangent.xyz); vec3 bitangent = cross(normal, tangent) * tangentHeadedness; return mat3(tangent, bitangent, normal); }`)):m.code.add(f.glsl`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) { vec3 Q1 = dFdx(pos); vec3 Q2 = dFdy(pos); vec2 stx = dFdx(st); vec2 sty = dFdy(st); float det = stx.t * sty.s - sty.t * stx.s; vec3 T = stx.t * Q2 - sty.t * Q1; T = T - normal * dot(normal, T); T *= inversesqrt(max(dot(T,T), 1.e-10)); vec3 B = sign(det) * cross(normal, T); return mat3(T, B, normal); }`);v.textureCoordinateType!==l.TextureCoordinateAttributeType.None&&(w.include(p.VertexTextureCoordinates,v),m.uniforms.add(v.pbrTextureBindType===d.BindType.Pass?new g.Texture2DPassUniform("normalTexture",r=>r.textureNormal):new e.Texture2DDrawUniform("normalTexture",r=>r.textureNormal)),v.hasNormalTextureTransform&&(m.uniforms.add(new h.Float2PassUniform("scale",r=>r.scale??q.ONES)),m.uniforms.add(new c.Matrix3PassUniform("normalTextureTransformMatrix",r=>r.normalTextureTransformMatrix??b.IDENTITY))), m.code.add(f.glsl`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) { vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),v.hasNormalTextureTransform&&m.code.add(f.glsl`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0, normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0, 0.0, 0.0, 0.0 ); rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),m.code.add(f.glsl`return tangentSpace * rawNormal; }`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl":function(){define(["exports","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform","../../../effects/ssao/SSAO"],function(a,b,q,l){a.EvaluateAmbientOcclusion=function(p,k){p=p.fragment;k.receiveAmbientOcclusion?(p.uniforms.add(new q.Texture2DPassUniform("ssaoTex",(h,f)=>f.ssao?.getTexture())),p.constants.add("blurSizePixelsInverse", "float",1/l.blurSizePixels),p.code.add(b.glsl`float evaluateAmbientOcclusionInverse() { vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0)); return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r; } float evaluateAmbientOcclusion() { return 1.0 - evaluateAmbientOcclusionInverse(); }`)):p.code.add(b.glsl`float evaluateAmbientOcclusionInverse() { return 1.0; } float evaluateAmbientOcclusion() { return 0.0; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ssao/SSAO":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/mathUtils ../../../../../core/maybe ../../../../../core/reactiveUtils ../../../../../core/time ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/vec2 ../../../webgl/formats ../../../webgl/RenderNode ../../core/shaderLibrary/shading/ScreenSpaceConstants ./SSAOBlurTechnique ./SSAONoiseData ./SSAOParameters ./SSAOTechnique ../../lib/basicInterfaces ../../../../../chunks/SSAO.glsl ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){a.SSAO=class extends w{constructor(C){super(C);this.consumes={required:["normals"]};this.produces="ssao";this.isEnabled=()=>!1;this._enableTime=k.Milliseconds(0);this._passParameters=new n.SSAOPassParameters;this._drawParameters=new n.BlurDrawParameters}initialize(){const C=Uint8Array.from(atob(r.noiseData),F=>F.charCodeAt(0)),D=new B.TextureDescriptor;D.wrapMode=z.TextureWrapMode.CLAMP_TO_EDGE;D.pixelFormat=z.PixelFormat.RGB;D.wrapMode=z.TextureWrapMode.REPEAT; D.hasMipmap=!0;D.width=32;D.height=32;this._passParameters.noiseTexture=new A.Texture(this.renderingContext,D,C);this._ssaoTechnique=this.techniques.acquire(u.SSAOTechnique);this._blurTechnique=this.techniques.acquire(m.SSAOBlurTechnique);this.addHandles(p.watch(()=>this.isEnabled(),()=>this._enableTime=k.Milliseconds(0)))}destroy(){this._passParameters.noiseTexture=l.disposeMaybe(this._passParameters.noiseTexture);this._blurTechnique.release();this._ssaoTechnique.release()}render(C){const D=this.bindParameters; C=C.find(({name:K})=>"normals"===K);var F=C?.getTexture(),H=C?.getTexture(z.DepthStencilAttachment),N=this.fboCache;C=D.camera;const E=C.fullViewport[2],G=C.fullViewport[3],I=Math.round(E/2),O=Math.round(G/2);if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=k.Milliseconds(performance.now()),this.requestRender(),N.acquire(I,O,"ssao",t.ColorFormat.RED);0===this._enableTime&&(this._enableTime=k.Milliseconds(performance.now()));const L=this.renderingContext;var P= this.view.qualitySettings.fadeDuration,M=q.clamp((v.distanceFadeEnd-C.relativeElevation)/(v.distanceFadeEnd-v.distanceFadeStart),0,1);P=0P&&this.requestRender(x.RenderRequestType.UPDATE);return N}};b.__decorate([h.property()],a.SSAO.prototype,"consumes",void 0);b.__decorate([h.property()], a.SSAO.prototype,"produces",void 0);b.__decorate([h.property({constructOnly:!0})],a.SSAO.prototype,"techniques",void 0);b.__decorate([h.property({constructOnly:!0})],a.SSAO.prototype,"isEnabled",void 0);a.SSAO=b.__decorate([g.subclass("esri.views.3d.webgl-engine.effects.ssao.SSAO")],a.SSAO);a.blurSizePixels=2;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/RenderNode":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Error ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../webgl-engine/lib/basicInterfaces".split(" "), function(a,b,q,l,p,k,h){b=class extends b{constructor(f){super(f);this.view=null;this.consumes={required:[]};this.produces="composite-color";this._context=null;this._dirty=!0}initialize(){this.addHandles([l.watch(()=>this.view.ready,f=>{f&&this.view._stage?.renderer.addRenderNode(this)},l.initial)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}render(){throw new q("RenderNode:render-function-not-implemented","render() is not implemented.");}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view._stage.renderView.renderingContext.gl}acquireOutputFramebuffer(){var f= this._frameBuffer?.getTexture()?.descriptor;f=this.view._stage.renderer.fboCache.acquire(f?.width??640,f?.height??480,this.produces);f.fbo?.initializeAndBind();return f}bindRenderTarget(){this._frameBuffer?.fbo?.initializeAndBind();return this._frameBuffer}requestRender(f){f===h.RenderRequestType.UPDATE&&this.view._stage?.renderView.requestRender(f);this._dirty=!0}resetWebGLState(){this.renderingContext.resetState();this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view._stage.renderer.fboCache}get bindParameters(){return this._context.bindParameters}get renderingContext(){return this.view._stage.renderView.renderingContext}updateAnimation(){return this._dirty? (this._dirty=!1,!0):!1}doRender(f,c){this._context=c;this._frameBuffer=f.find(({name:e})=>e===this.produces);try{return this.render(f)}finally{this._frameBuffer=null}}};a.__decorate([p.property({constructOnly:!0})],b.prototype,"view",void 0);a.__decorate([p.property({constructOnly:!0})],b.prototype,"consumes",void 0);a.__decorate([p.property()],b.prototype,"produces",void 0);return b=a.__decorate([k.subclass("esri.views.3d.webgl.RenderNode")],b)})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceConstants":function(){define(["exports"], function(a){a.distanceFadeEnd=5E5;a.distanceFadeStart=3E5;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/SSAOBlur.glsl ../../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx, c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.SSAOBlur,()=>new Promise((e,g)=>a(["../../shaders/SSAOBlur.glsl"],e,g)));b.SSAOBlurTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/SSAOBlur.glsl":function(){define("exports ./vec32 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(){const t=new f.ShaderBuilder,w=t.fragment;t.include(q.ScreenSpacePass);w.include(l.ReadDepth);w.uniforms.add(new e.Texture2DPassUniform("depthMap",v=>v.depthTexture),new c.Texture2DDrawUniform("tex",v=>v.colorTexture),new p.Float2DrawUniform("blurSize",v=>v.blurSize),new k.FloatPassUniform("projScale",(v,m)=>{m=b.distance(m.camera.eye,m.camera.center);return 5E4h.setUniform2fv(p,k(f,c,e)))}}a.Float2DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/effects/ssao/SSAONoiseData":function(){define(["exports"],function(a){a.noiseData="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"; Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ssao/SSAOParameters":function(){define(["exports","../../../../../core/libs/gl-matrix-2/factories/vec2f64","../../core/shaderModules/interfaces"],function(a,b,q){class l extends q.NoParameters{constructor(){super(...arguments);this.projScale=1}}class p extends l{constructor(){super(...arguments);this.intensity=1}}class k extends q.NoParameters{}class h extends k{constructor(){super(...arguments);this.blurSize= b.create()}}a.BlurDrawParameters=h;a.BlurPassParameters=l;a.SSAODrawParameters=k;a.SSAOPassParameters=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ssao/SSAOTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/SSAO.glsl ../../../../webgl/renderState".split(" "),function(a,b,q, l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.SSAO,()=>new Promise((e,g)=>a(["../../shaders/SSAO.glsl"],e,g)));b.SSAOTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/SSAO.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(){const v=new e.ShaderBuilder,m=v.fragment;v.include(l.ScreenSpacePass);v.include(k.CameraSpace);m.include(p.ReadDepth);m.uniforms.add(new f.FloatPassUniform("radius",(r,n)=>t(n.camera))).code.add(c.glsl`vec3 sphere[16] = vec3[16]( vec3(0.186937, 0.0, 0.0), vec3(0.700542, 0.0, 0.0), vec3(-0.864858, -0.481795, -0.111713), vec3(-0.624773, 0.102853, -0.730153), vec3(-0.387172, 0.260319, 0.007229), vec3(-0.222367, -0.642631, -0.707697), vec3(-0.01336, -0.014956, 0.169662), vec3(0.122575, 0.1544, -0.456944), vec3(-0.177141, 0.85997, -0.42346), vec3(-0.131631, 0.814545, 0.524355), vec3(-0.779469, 0.007991, 0.624833), vec3(0.308092, 0.209288,0.35969), vec3(0.359331, -0.184533, -0.377458), vec3(0.192633, -0.482999, -0.065284), vec3(0.233538, 0.293706, -0.055139), vec3(0.417709, -0.386701, 0.442449) ); float fallOffFunction(float vv, float vn, float bias) { float f = max(radius * radius - vv, 0.0); return f * f * f * max(vn - bias, 0.0); }`);m.code.add(c.glsl`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) { vec3 v = Q - C; float vv = dot(v, v); float vn = dot(normalize(v), n_C); return fallOffFunction(vv, vn, 0.1); }`);m.uniforms.add(new g.Texture2DPassUniform("normalMap",r=>r.normalTexture),new g.Texture2DPassUniform("depthMap",r=>r.depthTexture),new f.FloatPassUniform("projScale",r=>r.projScale),new g.Texture2DPassUniform("rnm",r=>r.noiseTexture),new h.Float2PassUniform("rnmScale",(r,n)=>b.set(w,n.camera.fullWidth/r.noiseTexture.descriptor.width,n.camera.fullHeight/r.noiseTexture.descriptor.height)),new f.FloatPassUniform("intensity",r=>r.intensity),new h.Float2PassUniform("screenSize",(r,n)=>b.set(w,n.camera.fullWidth, n.camera.fullHeight)));v.outputs.add("fragOcclusion","float");m.code.add(c.glsl` void main(void) { float depth = depthFromTexture(depthMap, uv); // Early out if depth is out of range, such as in the sky if (depth >= 1.0 || depth <= 0.0) { fragOcclusion = 1.0; return; } // get the normal of current fragment vec4 norm4 = texture(normalMap, uv); if(norm4.a != 1.0) { fragOcclusion = 1.0; return; } vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz; float currentPixelDepth = linearizeDepth(depth); vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth); float sum = 0.0; vec3 tapPixelPos; vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0); // note: the factor 2.0 should not be necessary, but makes ssao much nicer. // bug or deviation from CE somewhere else? float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y); for(int i = 0; i < ${c.glsl.int(16)}; ++i) { vec2 unitOffset = reflect(sphere[i], fres).xy; vec2 offset = vec2(-unitOffset * radius * ps); // don't use current or very nearby samples if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){ continue; } vec2 tc = vec2(gl_FragCoord.xy + offset); if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue; vec2 tcTap = tc / screenSize; float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap); tapPixelPos = reconstructPosition(tc, occluderFragmentDepth); sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos); } // output the result float A = max(1.0 - sum * intensity / float(${c.glsl.int(16)}), 0.0); // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2 A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2; fragOcclusion = A; } `);return v}function t(v){return Math.max(10,20*v.computeScreenPixelSizeAtDist(Math.abs(4*v.relativeElevation)))}const w=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:d,getRadius:t},Symbol.toStringTag,{value:"Module"}));a.SSAO=q;a.build=d;a.getRadius=t})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/vec2 ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../shaderModules/Float2PassUniform ../../shaderModules/Float4PassUniform ../../shaderModules/interfaces".split(" "), function(a,b,q,l,p,k,h,f){function c(t){const w=t.projectionMatrix;return 0===w[11]?l.set(g,2/(t.fullWidth*w[0]),2/(t.fullHeight*w[5]),(1+w[12])/w[0],(1+w[13])/w[5]):l.set(g,-2/(t.fullWidth*w[0]),-2/(t.fullHeight*w[5]),(1-w[8])/w[0],(1-w[9])/w[5])}function e(t){return 0===t.projectionMatrix[11]?b.set(d,0,1):b.set(d,1,0)}const g=p.create(),d=q.create();a.CameraSpace=function(t){t.fragment.uniforms.add(new h.Float4PassUniform("projInfo",(w,v)=>c(v.camera)));t.fragment.uniforms.add(new k.Float2PassUniform("zScale", (w,v)=>e(v.camera)));t.fragment.code.add(f.glsl`vec3 reconstructPosition(vec2 fragCoord, float depth) { return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); }`)};a.getProjectionInfo=c;a.getZScale=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl":function(){define("exports ../../../../../../core/compilerUtils ./EvaluateAmbientLighting.glsl ./EvaluateAmbientOcclusion.glsl ./MainLighting.glsl ./PhysicallyBasedRendering.glsl ./PhysicallyBasedRenderingParameters.glsl ./PiUtils.glsl ../../shaderModules/BooleanPassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../lighting/SceneLighting".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){function t(v){v.constants.add("ambientBoostFactor","float",d.ambientBoost)}function w(v){v.uniforms.add(new e.FloatPassUniform("lightingGlobalFactor",(m,r)=>r.lighting.globalFactor))}a.EvaluateSceneLighting=function(v,m){const r=v.fragment;v.include(l.EvaluateAmbientOcclusion,m);m.pbrMode!==h.PBRMode.Disabled&&v.include(k.PhysicallyBasedRendering,m);v.include(q.EvaluateAmbientLighting,m);v.include(f.PiUtils);r.code.add(g.glsl` const float GAMMA_SRGB = 2.1; const float INV_GAMMA_SRGB = 0.4761904; ${m.pbrMode===h.PBRMode.Disabled?"":"const vec3 GROUND_REFLECTANCE \x3d vec3(0.2);"} `);t(r);w(r);p.addMainLightDirection(r);r.code.add(g.glsl` float additionalDirectedAmbientLight(vec3 vPosWorld) { float vndl = dot(${m.spherical?g.glsl`normalize(vPosWorld)`:g.glsl`vec3(0.0, 0.0, 1.0)`}, mainLightDirection); return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0)); } `);p.addMainLightIntensity(r);r.code.add(g.glsl`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) { float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld); return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity; }`);switch(m.pbrMode){case h.PBRMode.Disabled:case h.PBRMode.WaterOnIntegratedMesh:case h.PBRMode.Water:v.include(p.MainLighting);r.code.add(g.glsl`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) { vec3 mainLighting = evaluateMainLighting(normalWorld, shadow); vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao); vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); vec3 totalLight = mainLighting + ambientLighting + additionalLight; totalLight = min(totalLight, vec3(PI)); vec3 outColor = vec3((albedoLinear / PI) * totalLight); return pow(outColor, vec3(INV_GAMMA_SRGB)); }`);break;case h.PBRMode.Normal:case h.PBRMode.Schematic:r.code.add(g.glsl`const float fillLightIntensity = 0.25; const float horizonLightDiffusion = 0.4; const float additionalAmbientIrradianceFactor = 0.02; vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance) { vec3 viewDirection = -viewDir; vec3 h = normalize(viewDirection + mainLightDirection); PBRShadingInfo inputs; inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0); inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0); inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0); inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0); inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0); vec3 reflectedView = normalize(reflect(viewDirection, normal)); inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0); inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); inputs.ssao = ssao; inputs.metalness = mrr[0]; inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`);r.code.add(g.glsl`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness; inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0)); inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`);m.useFillLights?r.uniforms.add(new c.BooleanPassUniform("hasFillLights",(n,u)=>u.enableFillLights)):r.constants.add("hasFillLights","bool",!1);r.code.add(g.glsl`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]); ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0)); inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0; vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity; vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity; vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight; inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ; inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`);r.uniforms.add(new e.FloatPassUniform("lightingSpecularStrength",(n,u)=>u.lighting.mainLight.specularStrength),new e.FloatPassUniform("lightingEnvironmentStrength",(n,u)=>u.lighting.mainLight.environmentStrength));r.code.add(g.glsl`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView; vec3 horizonRingH = normalize(viewDirection + horizonRingDir); inputs.NdotH_Horizon = dot(normal, horizonRingH); vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow); vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity; vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight; float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0)); inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`);r.code.add(g.glsl` vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs); vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance; vec3 emissionComponent = _emission == vec3(0.0) ? _emission : pow(_emission, vec3(GAMMA_SRGB)); vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent; ${m.pbrMode!==h.PBRMode.Schematic||m.hasColorTexture?g.glsl`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:g.glsl`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`} return outColor; } `);break;case h.PBRMode.Simplified:case h.PBRMode.TerrainWithWater:v.include(p.MainLighting);r.code.add(g.glsl`const float roughnessTerrain = 0.5; const float specularityTerrain = 0.5; const vec3 fresnelReflectionTerrain = vec3(0.04); vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) { vec3 viewDirection = -vd; vec3 h = normalize(viewDirection + mainLightDirection); float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0); float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0); float NdotH = clamp(dot(n, h), 0.0, 1.0); float NdotNG = clamp(dot(n, nup), -1.0, 1.0); vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB)); float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2]; vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain; vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0)); vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity; vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al; vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent; vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5; vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI; vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity; vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV); vec3 specularColor = f0 * dfg.x + f90 * dfg.y; vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent; vec3 outColorLinear = outDiffColor + specularComponent; vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB)); return outColor; }`);break;default:b.neverReached(m.pbrMode);case h.PBRMode.COUNT:}};a.addAmbientBoostFactor=t;a.addLightingGlobalFactor=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl":function(){define(["exports","./AnalyticalSkyModel.glsl","./PhysicallyBasedRenderingParameters.glsl","./PiUtils.glsl","../../shaderModules/interfaces"],function(a,b,q,l,p){a.PhysicallyBasedRendering=function(k,h){const f=k.fragment.code; k.include(l.PiUtils);if(h.pbrMode===q.PBRMode.Normal||h.pbrMode===q.PBRMode.Schematic||h.pbrMode===q.PBRMode.Simplified||h.pbrMode===q.PBRMode.TerrainWithWater)f.add(p.glsl`float normalDistribution(float NdotH, float roughness) { float a = NdotH * roughness; float b = roughness / (1.0 - NdotH * NdotH + a * a); return b * b * INV_PI; }`),f.add(p.glsl`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022); const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040); const vec2 c2 = vec2(-1.04, 1.04); vec2 prefilteredDFGAnalytical(float roughness, float NdotV) { vec4 r = roughness * c0 + c1; float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y; return c2 * a004 + r.zw; }`);if(h.pbrMode===q.PBRMode.Normal||h.pbrMode===q.PBRMode.Schematic)k.include(b.AnalyticalSkyModel),f.add(p.glsl`struct PBRShadingInfo { float NdotL; float NdotV; float NdotH; float VdotH; float LdotH; float NdotNG; float RdotNG; float NdotAmbDir; float NdotH_Horizon; vec3 skyRadianceToSurface; vec3 groundRadianceToSurface; vec3 skyIrradianceToSurface; vec3 groundIrradianceToSurface; float averageAmbientRadiance; float ssao; vec3 albedoLinear; vec3 f0; vec3 f90; vec3 diffuseColor; float metalness; float roughness; };`),f.add(p.glsl`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) { vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG); vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness); vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI; vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV); vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y; vec3 specularComponent = specularColor * indirectSpecular; return (diffuseComponent + specularComponent); }`),f.add(p.glsl`float gamutMapChanel(float x, vec2 p){ return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) ); }`),f.add(p.glsl`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){ vec3 outColor; vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance)); outColor.x = gamutMapChanel(inColor.x, p) ; outColor.y = gamutMapChanel(inColor.y, p) ; outColor.z = gamutMapChanel(inColor.z, p) ; return outColor; }`)};a.PhysicallyBasedRenderingWater=function(k,h){const f=k.fragment.code;k.include(l.PiUtils);f.add(p.glsl` struct PBRShadingWater { float NdotL; // cos angle between normal and light direction float NdotV; // cos angle between normal and view direction float NdotH; // cos angle between normal and half vector float VdotH; // cos angle between view direction and half vector float LdotH; // cos angle between light direction and half vector float VdotN; // cos angle between view direction and normal vector }; float dtrExponent = ${h.useCustomDTRExponentForWater?"2.2":"2.0"}; `);f.add(p.glsl`vec3 fresnelReflection(float angle, vec3 f0, float f90) { return f0 + (f90 - f0) * pow(1.0 - angle, 5.0); }`);f.add(p.glsl`float normalDistributionWater(float NdotH, float roughness) { float r2 = roughness * roughness; float NdotH2 = NdotH * NdotH; float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI; return r2 / denom; }`);f.add(p.glsl`float geometricOcclusionKelemen(float LoH) { return 0.25 / (LoH * LoH); }`);f.add(p.glsl`vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max) { vec3 F = fresnelReflection(props.VdotH, F0, F0Max); float dSun = normalDistributionWater(props.NdotH, roughness); float V = geometricOcclusionKelemen(props.LdotH); float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH); float strengthSunHaze = 1.2; float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze; return ((dSun + dSunHaze) * V) * F; } vec3 tonemapACES(const vec3 x) { return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.AnalyticalSkyModel=function(q){q=q.fragment.code;q.add(b.glsl`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) { return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5; }`);q.add(b.glsl`float integratedRadiance(float cosTheta2, float roughness) { return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0); }`);q.add(b.glsl`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) { float cosTheta2 = 1.0 - RdotNG * RdotNG; float intRadTheta = integratedRadiance(cosTheta2, roughness); float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta; float sky = 2.0 - ground; return (ground * ambientGround + sky * ambientSky) * 0.5; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../util/RgbaFloat16Encoding.glsl ../../shaderModules/Float4PassUniform ../../shaderModules/IntegerPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix4sDrawUniform ../../shaderModules/Matrix4sPassUniform ../../shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(m){m=m.fragment;m.include(l.Rgba4FloatEncoding);m.uniforms.add(new e.Texture2DPassUniform("shadowMap",(r,n)=>n.shadowMap.depthTexture),new k.IntegerPassUniform("numCascades",(r,n)=>n.shadowMap.numCascades),new p.Float4PassUniform("cascadeDistances",(r,n)=>n.shadowMap.cascadeDistances));m.code.add(h.glsl`int chooseCascade(float depth, out mat4 mat) { vec4 distance = cascadeDistances; int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3; mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3]; return i; } vec3 lightSpacePosition(vec3 _vpos, mat4 mat) { vec4 lv = mat * vec4(_vpos, 1.0); lv.xy /= lv.w; return 0.5 * lv.xyz + vec3(0.5); } vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) { float xScale = float(textureSize.y) / float(textureSize.x); return vec2((float(i) + lvpos.x) * xScale, lvpos.y); } float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) { return rgba4ToFloat(texelFetch(_depthTex, uv, 0)); } float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) { return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0; } float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) { vec2 st = fract(uv * vec2(texSize) + vec2(0.5)); ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5)); float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex); float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex); float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex); float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex); return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y); } float readShadowMap(const in vec3 _vpos, float _linearDepth) { mat4 mat; int i = chooseCascade(_linearDepth, mat); if (i >= numCascades) { return 0.0; } vec3 lvpos = lightSpacePosition(_vpos, mat); if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; } ivec2 size = textureSize(shadowMap, 0); vec2 uv = cascadeCoordinates(i, size, lvpos); return filterShadow(uv, lvpos, size, shadowMap); }`)}class d extends h.NoParameters{constructor(){super(...arguments);this.origin=q.create()}}class t extends d{}class w extends h.NoParameters{constructor(){super(...arguments);this.modelTransformation=b.IDENTITY}}class v extends w{constructor(){super(...arguments);this.origin=q.create()}}a.ReadShadowMapDraw=function(m,r){r.receiveShadows&&(m.fragment.uniforms.add(new f.Matrix4sDrawUniform("shadowMapMatrix",(n,u)=>u.shadowMap.getShadowMapMatrices(n.origin),4)),g(m))};a.ReadShadowMapDrawParameters= t;a.ReadShadowMapParameters=w;a.ReadShadowMapPass=function(m,r){r.receiveShadows&&(m.fragment.uniforms.add(new c.Matrix4sPassUniform("shadowMapMatrix",(n,u)=>u.shadowMap.getShadowMapMatrices(n.origin),4)),g(m))};a.ReadShadowMapPassParameters=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p, k,h){super(p,"mat4",q.BindType.Draw,(f,c,e,g)=>f.setUniformMatrix4fv(p,k(c,e,g)),h)}}a.Matrix4sDrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k,h){super(p,"mat4",q.BindType.Pass,(f,c,e)=>f.setUniformMatrix4fv(p,k(c,e)),h)}}a.Matrix4sPassUniform=l;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl":function(){define(["exports","../../../../../../core/libs/gl-matrix-2/factories/mat3f64","../attributes/TextureCoordinateAttribute.glsl","../../shaderModules/interfaces","../../shaderModules/Matrix3PassUniform"],function(a,b,q,l,p){a.colorTextureUV=function(k,h){h.hasColorTextureTransform?(k.vertex.uniforms.add(new p.Matrix3PassUniform("colorTextureTransformMatrix",f=>f.colorTextureTransformMatrix?? b.IDENTITY)),k.varyings.add("colorUV","vec2"),k.vertex.code.add(l.glsl`void forwardColorUV(){ colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy; }`)):k.vertex.code.add(l.glsl`void forwardColorUV(){}`)};a.emissiveTextureUV=function(k,h){h.hasEmissionTextureTransform&&h.textureCoordinateType!==q.TextureCoordinateAttributeType.None?(k.vertex.uniforms.add(new p.Matrix3PassUniform("emissiveTextureTransformMatrix",f=>f.emissiveTextureTransformMatrix??b.IDENTITY)),k.varyings.add("emissiveUV","vec2"),k.vertex.code.add(l.glsl`void forwardEmissiveUV(){ emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy; }`)):k.vertex.code.add(l.glsl`void forwardEmissiveUV(){}`)};a.metallicRoughnessTextureUV=function(k,h){h.hasMetallicRoughnessTextureTransform&&h.textureCoordinateType!==q.TextureCoordinateAttributeType.None?(k.vertex.uniforms.add(new p.Matrix3PassUniform("metallicRoughnessTextureTransformMatrix",f=>f.metallicRoughnessTextureTransformMatrix??b.IDENTITY)),k.varyings.add("metallicRoughnessUV","vec2"),k.vertex.code.add(l.glsl`void forwardMetallicRoughnessUV(){ metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy; }`)):k.vertex.code.add(l.glsl`void forwardMetallicRoughnessUV(){}`)};a.normalTextureUV=function(k,h){h.hasNormalTextureTransform&&h.textureCoordinateType!==q.TextureCoordinateAttributeType.None?(k.vertex.uniforms.add(new p.Matrix3PassUniform("normalTextureTransformMatrix",f=>f.normalTextureTransformMatrix??b.IDENTITY)),k.varyings.add("normalUV","vec2"),k.vertex.code.add(l.glsl`void forwardNormalUV(){ normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy; }`)):k.vertex.code.add(l.glsl`void forwardNormalUV(){}`)};a.occlusionTextureUV=function(k,h){h.hasOcclusionTextureTransform&&h.textureCoordinateType!==q.TextureCoordinateAttributeType.None?(k.vertex.uniforms.add(new p.Matrix3PassUniform("occlusionTextureTransformMatrix",f=>f.occlusionTextureTransformMatrix??b.IDENTITY)),k.varyings.add("occlusionUV","vec2"),k.vertex.code.add(l.glsl`void forwardOcclusionUV(){ occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy; }`)):k.vertex.code.add(l.glsl`void forwardOcclusionUV(){}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl":function(){define(["exports","../../../../layers/support/symbolColorUtils","./ColorConversion.glsl","../../shaderModules/interfaces"],function(a,b,q,l){a.MixExternalColor=function(p){p.include(q.ColorConversion);p.code.add(l.glsl` vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) { // workaround for artifacts in OSX using Intel Iris Pro // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 vec3 internalMixed = internalColor * textureColor; vec3 allMixed = internalMixed * externalColor; if (mode == ${l.glsl.int(b.ColorMixModeEnum.Multiply)}) { return allMixed; } if (mode == ${l.glsl.int(b.ColorMixModeEnum.Ignore)}) { return internalMixed; } if (mode == ${l.glsl.int(b.ColorMixModeEnum.Replace)}) { return externalColor; } // tint (or something invalid) float vIn = rgb2v(internalMixed); vec3 hsvTint = rgb2hsv(externalColor); vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z); return hsv2rgb(hsvOut); } float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) { // workaround for artifacts in OSX using Intel Iris Pro // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 float internalMixed = internalOpacity * textureOpacity; float allMixed = internalMixed * externalOpacity; if (mode == ${l.glsl.int(b.ColorMixModeEnum.Ignore)}) { return internalMixed; } if (mode == ${l.glsl.int(b.ColorMixModeEnum.Replace)}) { return externalOpacity; } // multiply or tint (or something invalid) return allMixed; } `)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../core/shaderLibrary/shading/Normals.glsl ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/basicInterfaces ../lib/TransparencyPassType ../materials/DefaultTechniqueConfiguration".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){class d extends g.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.alphaDiscardMode=c.AlphaDiscardMode.Opaque;this.doubleSidedMode=k.NormalsDoubleSidedMode.None;this.pbrMode=h.PBRMode.Disabled;this.cullFace=c.CullFaceOptions.None;this.transparencyPassType=e.TransparencyPassType.NONE;this.normalType=l.NormalType.Attribute;this.textureCoordinateType=p.TextureCoordinateAttributeType.None;this.customDepthTest=c.DepthTestFunction.Less; this.hasSlicePlane=this.hasVerticalOffset=this.hasSymbolColors=this.hasVertexColors=this.spherical=!1;this.hasSliceHighlight=!0;this.doublePrecisionRequiresObfuscation=this.instancedDoublePrecision=this.objectAndLayerIdColorInstanced=this.instancedColor=this.instanced=this.textureAlphaPremultiplied=this.receiveAmbientOcclusion=this.receiveShadows=this.vvColor=this.vvSize=this.offsetBackfaces=this.hasModelTransformation=this.multipassEnabled=this.hasOccludees=this.hasVertexTangents=this.hasScreenSizePerspective= this.hasNormalTexture=this.hasOcclusionTexture=this.hasEmissionTexture=this.hasMetallicRoughnessTexture=this.hasColorTexture=!1;this.writeDepth=!0;this.transparent=!1;this.enableOffset=!0;this.hasMetallicRoughnessTextureTransform=this.hasOcclusionTextureTransform=this.hasNormalTextureTransform=this.hasEmissionTextureTransform=this.hasColorTextureTransform=this.snowCover=this.cullAboveGround=!1}}b.__decorate([f.parameter({count:q.ShaderOutput.COUNT})],d.prototype,"output",void 0);b.__decorate([f.parameter({count:c.AlphaDiscardMode.COUNT})], d.prototype,"alphaDiscardMode",void 0);b.__decorate([f.parameter({count:k.NormalsDoubleSidedMode.COUNT})],d.prototype,"doubleSidedMode",void 0);b.__decorate([f.parameter({count:h.PBRMode.COUNT})],d.prototype,"pbrMode",void 0);b.__decorate([f.parameter({count:c.CullFaceOptions.COUNT})],d.prototype,"cullFace",void 0);b.__decorate([f.parameter({count:e.TransparencyPassType.COUNT})],d.prototype,"transparencyPassType",void 0);b.__decorate([f.parameter({count:l.NormalType.COUNT})],d.prototype,"normalType", void 0);b.__decorate([f.parameter({count:p.TextureCoordinateAttributeType.COUNT})],d.prototype,"textureCoordinateType",void 0);b.__decorate([f.parameter({count:c.DepthTestFunction.COUNT})],d.prototype,"customDepthTest",void 0);b.__decorate([f.parameter()],d.prototype,"spherical",void 0);b.__decorate([f.parameter()],d.prototype,"hasVertexColors",void 0);b.__decorate([f.parameter()],d.prototype,"hasSymbolColors",void 0);b.__decorate([f.parameter()],d.prototype,"hasVerticalOffset",void 0);b.__decorate([f.parameter()], d.prototype,"hasSlicePlane",void 0);b.__decorate([f.parameter()],d.prototype,"hasSliceHighlight",void 0);b.__decorate([f.parameter()],d.prototype,"hasColorTexture",void 0);b.__decorate([f.parameter()],d.prototype,"hasMetallicRoughnessTexture",void 0);b.__decorate([f.parameter()],d.prototype,"hasEmissionTexture",void 0);b.__decorate([f.parameter()],d.prototype,"hasOcclusionTexture",void 0);b.__decorate([f.parameter()],d.prototype,"hasNormalTexture",void 0);b.__decorate([f.parameter()],d.prototype, "hasScreenSizePerspective",void 0);b.__decorate([f.parameter()],d.prototype,"hasVertexTangents",void 0);b.__decorate([f.parameter()],d.prototype,"hasOccludees",void 0);b.__decorate([f.parameter()],d.prototype,"multipassEnabled",void 0);b.__decorate([f.parameter()],d.prototype,"hasModelTransformation",void 0);b.__decorate([f.parameter()],d.prototype,"offsetBackfaces",void 0);b.__decorate([f.parameter()],d.prototype,"vvSize",void 0);b.__decorate([f.parameter()],d.prototype,"vvColor",void 0);b.__decorate([f.parameter()], d.prototype,"receiveShadows",void 0);b.__decorate([f.parameter()],d.prototype,"receiveAmbientOcclusion",void 0);b.__decorate([f.parameter()],d.prototype,"textureAlphaPremultiplied",void 0);b.__decorate([f.parameter()],d.prototype,"instanced",void 0);b.__decorate([f.parameter()],d.prototype,"instancedColor",void 0);b.__decorate([f.parameter()],d.prototype,"objectAndLayerIdColorInstanced",void 0);b.__decorate([f.parameter()],d.prototype,"instancedDoublePrecision",void 0);b.__decorate([f.parameter()], d.prototype,"doublePrecisionRequiresObfuscation",void 0);b.__decorate([f.parameter()],d.prototype,"writeDepth",void 0);b.__decorate([f.parameter()],d.prototype,"transparent",void 0);b.__decorate([f.parameter()],d.prototype,"enableOffset",void 0);b.__decorate([f.parameter()],d.prototype,"cullAboveGround",void 0);b.__decorate([f.parameter()],d.prototype,"snowCover",void 0);b.__decorate([f.parameter()],d.prototype,"hasColorTextureTransform",void 0);b.__decorate([f.parameter()],d.prototype,"hasEmissionTextureTransform", void 0);b.__decorate([f.parameter()],d.prototype,"hasNormalTextureTransform",void 0);b.__decorate([f.parameter()],d.prototype,"hasOcclusionTextureTransform",void 0);b.__decorate([f.parameter()],d.prototype,"hasMetallicRoughnessTextureTransform",void 0);b.__decorate([f.parameter({constValue:!1})],d.prototype,"occlusionPass",void 0);b.__decorate([f.parameter({constValue:!0})],d.prototype,"hasVvInstancing",void 0);b.__decorate([f.parameter({constValue:!1})],d.prototype,"useCustomDTRExponentForWater", void 0);b.__decorate([f.parameter({constValue:!1})],d.prototype,"supportsTextureAtlas",void 0);b.__decorate([f.parameter({constValue:!0})],d.prototype,"useFillLights",void 0);a.DefaultMaterialTechniqueConfiguration=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/RealisticTreeTechnique":function(){define("require exports ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/shading/Normals.glsl ../core/shaderTechnique/ReloadableShaderModule ./DefaultMaterialTechnique ../../../../chunks/RealisticTree.glsl".split(" "), function(a,b,q,l,p,k,h){class f extends k.DefaultMaterialTechnique{initializeConfiguration(c,e){super.initializeConfiguration(c,e);e.hasMetallicRoughnessTexture=!1;e.hasEmissionTexture=!1;e.hasOcclusionTexture=!1;e.hasNormalTexture=!1;e.hasModelTransformation=!1;e.normalType=q.NormalType.Attribute;e.doubleSidedMode=l.NormalsDoubleSidedMode.WindingOrder;e.hasVertexTangents=!1}initializeProgram(c){return this._initializeProgram(c,f.shader)}}f.shader=new p.ReloadableShaderModule(h.RealisticTree,()=> new Promise((c,e)=>a(["./RealisticTree.glsl"],c,e)));b.RealisticTreeTechnique=f;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/RealisticTree.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl ../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){function P(K){const J=new G.ShaderBuilder,{vertex:R,fragment:Q,varyings:W}=J;D.addProjViewLocalOrigin(R,K);J.include(c.PositionAttribute);W.add("vpos","vec3");J.include(z.VisualVariables,K);J.include(h.InstancedDoublePrecision,K);J.include(t.VerticalOffset,K);K.output===l.ShaderOutput.Color&&(D.addCameraPosition(J.vertex,K),J.include(f.NormalAttribute,K),J.include(k.Transform,K),K.offsetBackfaces&&J.include(q.Offset),K.instancedColor&& J.attributes.add(L.VertexAttribute.INSTANCECOLOR,"vec4"),W.add("vNormalWorld","vec3"),W.add("localvpos","vec3"),K.multipassEnabled&&W.add("depth","float"),J.include(g.TextureCoordinateAttribute,K),J.include(b.ForwardLinearDepth,K),J.include(e.SymbolColor,K),J.include(d.VertexColor,K),R.uniforms.add(new H.Float4PassUniform("externalColor",S=>S.externalColor)),W.add("vcolorExt","vec4"),R.code.add(E.glsl` void main(void) { forwardNormalizedVertexColor(); vcolorExt = externalColor; ${K.instancedColor?"vcolorExt *\x3d instanceColor * 0.003921568627451;":""} vcolorExt *= vvColor(); vcolorExt *= getSymbolColor(); forwardColorMixMode(); if (vcolorExt.a < ${E.glsl.float(A.symbolAlphaCutoff)}) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); } else { vpos = getVertexInLocalOriginSpace(); localvpos = vpos - view[3].xyz; vpos = subtractOrigin(vpos); vNormalWorld = dpNormal(vvLocalNormal(normalModel())); vpos = addVerticalOffset(vpos, localOrigin); gl_Position = transformPosition(proj, view, vpos); ${K.offsetBackfaces?"gl_Position \x3d offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""} } ${K.multipassEnabled?E.glsl`depth = (view * vec4(vpos, 1.0)).z;`:""} forwardLinearDepth(); forwardTextureCoordinates(); } `));K.output===l.ShaderOutput.Color&&(J.include(p.SliceDraw,K),J.include(m.EvaluateSceneLighting,K),J.include(v.EvaluateAmbientOcclusion,K),J.include(B.DiscardOrAdjustAlphaPass,K),J.include(K.instancedDoublePrecision?y.ReadShadowMapPass:y.ReadShadowMapDraw,K),J.include(n.multipassTerrainTest,K),D.addCameraPosition(J.fragment,K),r.addMainLightDirection(Q),m.addAmbientBoostFactor(Q),m.addLightingGlobalFactor(Q),Q.uniforms.add(R.uniforms.get("localOrigin"),R.uniforms.get("view"),new F.Float3PassUniform("ambient", S=>S.ambient),new F.Float3PassUniform("diffuse",S=>S.diffuse),new N.FloatPassUniform("opacity",S=>S.opacity),new N.FloatPassUniform("layerOpacity",S=>S.layerOpacity)),K.hasColorTexture&&Q.uniforms.add(new I.Texture2DPassUniform("tex",S=>S.texture)),J.include(x.PhysicallyBasedRenderingParameters,K),J.include(u.PhysicallyBasedRendering,K),Q.include(C.MixExternalColor),K.transparencyPassType===O.TransparencyPassType.ColorAlpha&&(J.outputs.add("fragColor","vec4",0),J.outputs.add("fragAlpha","float",1)), r.addMainLightIntensity(Q),Q.code.add(E.glsl` void main() { discardBySlice(vpos); ${K.multipassEnabled?E.glsl`terrainDepthTest(depth);`:""} ${K.hasColorTexture?E.glsl` vec4 texColor = texture(tex, ${K.hasColorTextureTransform?E.glsl`colorUV`:E.glsl`vuv0`}); ${K.textureAlphaPremultiplied?"texColor.rgb /\x3d texColor.a;":""} discardOrAdjustAlpha(texColor);`:E.glsl`vec4 texColor = vec4(1.0);`} vec3 viewDirection = normalize(vpos - cameraPosition); ${K.pbrMode===x.PBRMode.Normal?"applyPBRFactors();":""} float ssao = evaluateAmbientOcclusionInverse(); ssao *= getBakedOcclusion(); float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; ${K.receiveShadows?"float shadow \x3d readShadowMap(vpos, linearDepth);":K.spherical?"float shadow \x3d lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow \x3d 0.0;"} vec3 matColor = max(ambient, diffuse); ${K.hasVertexColors?E.glsl` vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:E.glsl` vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} ${K.snowCover?E.glsl`albedo = mix(albedo, vec3(1), 0.9);`:E.glsl``} ${E.glsl` vec3 shadingNormal = normalize(vNormalWorld); albedo *= 1.2; vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]); float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0); float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0); float treeRadialFalloff = vColor.r; float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow); additionalLight += backLightFactor * mainLightIntensity;`} ${K.pbrMode===x.PBRMode.Normal||K.pbrMode===x.PBRMode.Schematic?K.spherical?E.glsl`vec3 normalGround = normalize(vpos + localOrigin);`:E.glsl`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:E.glsl``} ${K.pbrMode===x.PBRMode.Normal||K.pbrMode===x.PBRMode.Schematic?E.glsl` float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; ${K.snowCover?E.glsl` mrr = vec3(0.0, 1.0, 0.04); emission = vec3(0.0);`:""} vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:E.glsl`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos); ${K.transparencyPassType===O.TransparencyPassType.ColorAlpha?E.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""} } `));J.include(w.DefaultMaterialAuxiliaryPasses,K);return J}const M=Object.freeze(Object.defineProperty({__proto__:null,build:P},Symbol.toStringTag,{value:"Module"}));a.RealisticTree=M;a.build=P})},"esri/views/3d/layers/graphics/interfaces":function(){define(["exports"],function(a){a.ApplyRendererDiffResult=void 0;var b=a.ApplyRendererDiffResult||(a.ApplyRendererDiffResult={});b[b.RecreateSymbol=0]="RecreateSymbol";b[b.RecreateGraphics=1]="RecreateGraphics";b[b.FastUpdate=2]="FastUpdate";Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Loadable":function(){define(["exports","../../../../core/maybe","../../../../core/promiseUtils"],function(a,b,q){class l{constructor(p){this.schedule=p;this._abortController=null;this._loadStatus=a.LoadStatus.LOADING;this.logger=this._loader=this._loadError=null}destroy(){this.abortLoad()}get loadStatus(){return this._loadStatus}load(p,k){if(this._loadStatus===a.LoadStatus.LOADED)return p&&p(),this._loader??Promise.resolve();if(this._loadStatus=== a.LoadStatus.FAILED)return k&&k(this._loadError),this._loader??Promise.resolve();null==this._loader&&(this._abortController=new AbortController,this._loader=this.doLoad(this._abortController.signal).then(()=>{this._abortController=null;this._loadStatus=a.LoadStatus.LOADED},h=>{this._loadError=h;this._abortController=null;this._loadStatus=a.LoadStatus.FAILED;!q.isAbortError(h)&&this.logger&&h.message&&this.logger.warn(h.message);throw h;}));this._loader.then(p,k).catch(()=>{});return this._loader}abortLoad(){null!= this._abortController?this._abortController=b.abortMaybe(this._abortController):this._loadStatus===a.LoadStatus.LOADING&&(this._loadStatus=a.LoadStatus.FAILED);this._loader=null}}a.LoadStatus=void 0;(function(p){p[p.LOADING=0]="LOADING";p[p.LOADED=1]="LOADED";p[p.FAILED=2]="FAILED"})(a.LoadStatus||(a.LoadStatus={}));a.Loadable=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/pointUtils":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectPointToVector ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/coordsUtils ../../../../layers/graphics/dehydratedPoint ./elevationAlignmentUtils ./graphicUtils ../../webgl-engine/lib/Object3D".split(" "), function(a,b,q,l,p,k,h,f,c){function e(t,w){const v=t.clippingExtent;if(!v)return!1;q.projectPointToVector(w,d,t.elevationProvider.spatialReference);return!l.containsPoint(v,d)}function g(t,w){q.projectPointToVector(w,d,t.renderCoordsHelper.spatialReference);return t.localOriginFactory.getOrigin(d)}const d=b.create();a.createStageObject=function(t,w,v,m,r){if(e(t,w))return null;v.localOrigin=g(t,w);v=new c.Object3D({geometries:[v],castShadow:!1,layerUid:t.layer.uid,graphicUid:r,usesVerticalDistanceToGround:!0}); t=h.applyElevationAlignmentForHUD(v,w,t.elevationProvider,t.renderCoordsHelper,m);return{object:v,sampledElevation:t}};a.extendPointGraphicElevationContext=function(t,w,v){t=t.elevationContext;v=v.spatialReference;q.projectPointToVector(w,d,v);t.centerPointInElevationSR=k.makeDehydratedPoint(d[0],d[1],w.hasZ?d[2]:0,null!=v?v:null)};a.getLocalOriginForPoint=g;a.placePointOnGeometry=function(t){switch(t.type){case "point":return t;case "polygon":case "extent":return f.computeCentroid(t);case "polyline":var w= t.paths[0];if(!w||0===w.length)break;w=p.getPointOnPath(w,p.getPathLength(w)/2);return k.makeDehydratedPoint(w[0],w[1],w[2],t.spatialReference);case "mesh":return t.origin}return null};a.updateStageObjectGeometry=function(t,w,v,m){return e(w,v)?null:h.applyElevationAlignmentForHUD(t,v,w.elevationProvider,w.renderCoordsHelper,m)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Object3D":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/sphere ../../support/mathUtils ./basicInterfaces ./ContentObject ./ContentObjectType ./Object3DStateID ./Util ./VertexAttribute ../materials/renderers/utils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){class m extends e.ContentObject{get geometries(){return this._geometries}get transformation(){return this._transformation??l.IDENTITY}set transformation(B){this._transformation=q.copy(this._transformation??l.create(),B);this._invalidateBoundingVolume();this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(B){this._shaderTransformation=B?q.copy(this._shaderTransformation??l.create(),B): null;this._invalidateBoundingVolume();this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}constructor(B={}){super();this.type=g.ContentObjectType.Object;this._parentLayer=this._shaderTransformation=null;this._visible=!0;this.castShadow=B.castShadow??!0;this.usesVerticalDistanceToGround=B.usesVerticalDistanceToGround??!1;this.graphicUid=B.graphicUid;this.layerUid=B.layerUid;B.isElevationSource&&(this.lastValidElevationBB= new r);this._geometries=B.geometries?Array.from(B.geometries):[]}dispose(){this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(B){t.assert(null==this._parentLayer||null==B,"Object3D can only be added to a single Layer");this._parentLayer=B}addGeometry(B){B.visible=this._visible;this._geometries.push(B);this._emit("geometryAdded",{object:this,geometry:B});this._invalidateBoundingVolume()}removeGeometry(B){if(B=this._geometries.splice(B,1)[0])this._emit("geometryRemoved", {object:this,geometry:B}),this._invalidateBoundingVolume()}removeAllGeometries(){for(;0E;++E)H.min[E]=Math.min(H.min[E],x[E]),H.max[E]=Math.max(H.max[E],y[E]); else if(p.transformMat4(x,E,N),p.exactEquals(E,F))for(E=0;3>E;++E)H.min[E]=Math.min(H.min[E],x[E]),H.max[E]=Math.max(H.max[E],x[E]);else{p.transformMat4(y,F,N);for(var G=0;3>G;++G)H.min[G]=Math.min(H.min[G],x[G],y[G]),H.max[G]=Math.max(H.max[G],x[G],y[G]);for(G=0;3>G;++G){p.copy(x,E);p.copy(y,F);x[G]=F[G];y[G]=E[G];p.transformMat4(x,x,N);p.transformMat4(y,y,N);for(let I=0;3>I;++I)H.min[I]=Math.min(H.min[I],x[I],y[I]),H.max[I]=Math.max(H.max[I],x[I],y[I])}}}}p.lerp(h.getCenter(B.bounds),B.min,B.max, .5);for(const I of this._geometries)D=I.boundingInfo,null!=D&&(E=C?I.transformation:this.getCombinedShaderTransformation(I),H=f.maxScale(E),p.transformMat4(z,D.center,E),E=p.distance(z,h.getCenter(B.bounds)),B.bounds[3]=Math.max(B.bounds[3],E+D.radius*H))}_invalidateBoundingVolume(){const B=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0;this._parentLayer&&B&&this._parentLayer.notifyObjectBBChanged(this,B)}_emit(B,C){this._parentLayer&&this._parentLayer.events.emit(B,C)}get test(){}} class r{constructor(){this.min=k.fromValues(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);this.max=k.fromValues(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]x===p.ShaderOutput.Color],[f.RenderSlot.LINE_CALLOUTS_HUD_DEPTH,x=>x===p.ShaderOutput.Color]]);this._configuration=new d.LineCalloutTechniqueConfiguration;this._uniqueMaterialIdentifier=t.uniqueMaterialIdentifier(this.parameters)}passParameters(){return this.parameters}getConfiguration(u,x){u=x?.slot!== f.RenderSlot.LINE_CALLOUTS;this._configuration.occlusionTestEnabled=this.parameters.occlusionTest;this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset;this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective;this._configuration.depthHudEnabled=u;this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart;this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits;this._configuration.hasSlicePlane= this.parameters.hasSlicePlane;this._configuration.multipassEnabled=x.multipassEnabled;return this._configuration}intersect(){}createGLMaterial(u){return new w(u)}createBufferWriter(){return new n}validateParameters(u){u=t.uniqueMaterialIdentifier(u);u!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=u)}static uniqueMaterialIdentifier({renderOccluded:u,isDecoration:x,horizontalScreenOffset:y,color:z,size:A,occlusionTest:B,shaderPolygonOffset:C,depthHUDAlignStart:D,centerOffsetUnits:F, hasSlicePlane:H,screenSizePerspective:N,verticalOffset:E,borderColor:G}){return b.safeToString`${u}:${x}:${y}:[${z}]:${A}:${B}:${C}:${D}:${F}:${H}:${null!=N}:{${E.screenLength}:${E.minWorldLength}:${E.maxWorldLength}}:[${G}]`}}class w extends k{beginSlot(u){return this.ensureTechnique(g.LineCalloutTechnique,u)}}class v extends h.MaterialParameters{constructor(){super(...arguments);this.horizontalScreenOffset=0;this.color=[0,0,0,1];this.size=1;this.occlusionTest=!1;this.shaderPolygonOffset=1E-5;this.depthHUDAlignStart= !1;this.centerOffsetUnits="world";this.hasSlicePlane=!1}}const m=l.newLayout().vec3f(c.VertexAttribute.POSITION).vec3f(c.VertexAttribute.NORMAL).vec2f(c.VertexAttribute.UV0).vec4f(c.VertexAttribute.CENTEROFFSETANDDISTANCE),r=[q.fromValues(0,0),q.fromValues(1,0),q.fromValues(0,1),q.fromValues(1,0),q.fromValues(1,1),q.fromValues(0,1)];class n{constructor(){this.vertexBufferLayout=m}elementCount(u){return 6*u.attributes.get(c.VertexAttribute.POSITION).indices.length}write(u,x,y,z,A){e.writePosition(y.attributes.get(c.VertexAttribute.POSITION), u,z.position,A,6);e.writeNormal(y.attributes.get(c.VertexAttribute.NORMAL),x,z.normal,A,6);e.writeBufferVec4(y.attributes.get(c.VertexAttribute.CENTEROFFSETANDDISTANCE),z.centerOffsetAndDistance,A,6);for(u=0;unew Promise((d,t)=>a(["./LineCallout.glsl"],d,t)));b.LineCalloutTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/LineCallout.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(x){const y=new v.ShaderBuilder,{vertex:z,fragment:A}=y;z.include(k.AlignPixel);y.include(h.HUD,x);y.include(p.SliceDraw,x);y.attributes.add(m.VertexAttribute.UV0,"vec2");z.uniforms.add(new d.Float4PassUniform("viewport",(B,C)=>C.camera.fullViewport),new t.FloatPassUniform("lineSize",(B,C)=>0b.set(u,2/C.camera.fullViewport[2],2/C.camera.fullViewport[3])), new t.FloatPassUniform("borderSize",(B,C)=>null!=B.borderColor?C.camera.pixelRatio:0),new g.Float2PassUniform("screenOffset",(B,C)=>b.set(u,B.horizontalScreenOffset*C.camera.pixelRatio,0)));y.varyings.add("coverageSampling","vec4");y.varyings.add("lineSizes","vec2");x.multipassEnabled&&y.varyings.add("depth","float");x.occlusionTestEnabled&&y.include(f.HUDVisibility);x.hasScreenSizePerspective&&e.addScreenSizePerspectiveAlignment(z);z.code.add(w.glsl` void main(void) { ProjectHUDAux projectAux; vec4 endPoint = projectPositionHUD(projectAux); vec3 vpos = projectAux.posModel; if (rejectBySlice(vpos)) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } ${x.occlusionTestEnabled?w.glsl` if (!testHUDVisibility(endPoint)) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; }`:""} ${x.hasScreenSizePerspective?w.glsl` vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment); vec2 screenOffsetScaled = applyScreenSizePerspectiveScaleFactorVec2(screenOffset, perspectiveFactor); `:w.glsl`vec2 screenOffsetScaled = screenOffset;`} // Add view dependent polygon offset to get exact same original starting point. This is mostly used to get the // correct depth value vec3 posView = (view * vec4(position, 1.0)).xyz; ${x.multipassEnabled?"depth \x3d posView.z;":""} applyHUDViewDependentPolygonOffset(centerOffsetAndDistance.w, projectAux.absCosAngle, posView); vec4 startPoint = proj * vec4(posView, 1.0); // Apply screen offset to both start and end point vec2 screenOffsetNorm = screenOffsetScaled * 2.0 / viewport.zw; startPoint.xy += screenOffsetNorm * startPoint.w; endPoint.xy += screenOffsetNorm * endPoint.w; // Align start and end to pixel origin vec4 startAligned = alignToPixelOrigin(startPoint, viewport.zw); vec4 endAligned = alignToPixelOrigin(endPoint, viewport.zw); ${x.depthHudEnabled?x.depthHudAlignStartEnabled?w.glsl`endAligned = vec4(endAligned.xy / endAligned.w * startAligned.w, startAligned.zw);`:w.glsl`startAligned = vec4(startAligned.xy / startAligned.w * endAligned.w, endAligned.zw);`:""} vec4 projectedPosition = mix(startAligned, endAligned, uv0.y); // The direction of the line in screen space vec2 screenSpaceDirection = normalize(endAligned.xy / endAligned.w - startAligned.xy / startAligned.w); vec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x); ${x.hasScreenSizePerspective?w.glsl` float lineSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(lineSize, perspectiveFactor); float borderSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(borderSize, perspectiveFactor); `:w.glsl` float lineSizeScaled = lineSize; float borderSizeScaled = borderSize; `} float halfPixelSize = lineSizeScaled * 0.5; // Compute full ndc offset, adding 1px padding for doing anti-aliasing and the border size float padding = 1.0 + borderSizeScaled; vec2 ndcOffset = (-halfPixelSize - padding + uv0.x * (lineSizeScaled + padding + padding)) * pixelToNDC; // Offset x/y from the center of the line in screen space projectedPosition.xy += perpendicularScreenSpaceDirection * ndcOffset * projectedPosition.w; // Compute a coverage varying which we can use in the fragment shader to determine // how much a pixel is actually covered by the line (i.e. to anti alias the line). // This works by computing two coordinates that can be linearly interpolated and then // subtracted to find out how far away from the line edge we are. float edgeDirection = (uv0.x * 2.0 - 1.0); float halfBorderSize = 0.5 * borderSizeScaled; float halfPixelSizeAndBorder = halfPixelSize + halfBorderSize; float outerEdgeCoverageSampler = edgeDirection * (halfPixelSizeAndBorder + halfBorderSize + 1.0); float isOneSided = float(lineSizeScaled < 2.0 && borderSize < 2.0); coverageSampling = vec4( // Edge coordinate outerEdgeCoverageSampler, // Border edge coordinate outerEdgeCoverageSampler - halfPixelSizeAndBorder * isOneSided, // Line offset halfPixelSize - 0.5, // Border offset halfBorderSize - 0.5 + halfPixelSizeAndBorder * (1.0 - isOneSided) ); lineSizes = vec2(lineSizeScaled, borderSizeScaled); gl_Position = projectedPosition; } `);A.uniforms.add(new d.Float4PassUniform("uColor",B=>n(B.color)),new d.Float4PassUniform("borderColor",B=>n(B.borderColor)));x.multipassEnabled&&(A.include(c.multipassGeometryTest,x),A.uniforms.add(new g.Float2PassUniform("inverseViewport",(B,C)=>C.inverseViewport)));A.code.add(w.glsl` void main() { ${x.multipassEnabled?"if( geometryDepthTest(gl_FragCoord.xy * inverseViewport, depth) ){ discard; }":""} // Mix between line and border coverage offsets depending on whether we need // a border (based on the sidedness). vec2 coverage = min(1.0 - clamp(abs(coverageSampling.xy) - coverageSampling.zw, 0.0, 1.0), lineSizes); // Mix between border and line color based on the line coverage (conceptually the line blends on top of the // border background). // // Anti-alias by blending final result using the full (including optional border) coverage and the color alpha float borderAlpha = uColor.a * borderColor.a * coverage.y; float colorAlpha = uColor.a * coverage.x; float finalAlpha = mix(borderAlpha, 1.0, colorAlpha); ${x.depthHudEnabled?w.glsl` if (finalAlpha < 0.01) { discard; } `:w.glsl` vec3 finalRgb = mix(borderColor.rgb * borderAlpha, uColor.rgb, colorAlpha); fragColor = vec4(finalRgb, finalAlpha); `} } `);return y}function n(x){return null!=x?x:l.ZEROS}const u=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:r},Symbol.toStringTag,{value:"Module"}));a.LineCallout=q;a.build=r})},"esri/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration","../materials/DefaultTechniqueConfiguration"],function(a,b,q,l){class p extends l.DefaultTechniqueConfiguration{constructor(){super(...arguments); this.spherical=this.screenCenterOffsetUnitsEnabled=!1;this.occlusionTestEnabled=!0;this.multipassEnabled=this.hasSlicePlane=this.depthHudAlignStartEnabled=this.depthHudEnabled=this.hasScreenSizePerspective=this.hasVerticalOffset=!1}}b.__decorate([q.parameter()],p.prototype,"screenCenterOffsetUnitsEnabled",void 0);b.__decorate([q.parameter()],p.prototype,"spherical",void 0);b.__decorate([q.parameter()],p.prototype,"occlusionTestEnabled",void 0);b.__decorate([q.parameter()],p.prototype,"hasVerticalOffset", void 0);b.__decorate([q.parameter()],p.prototype,"hasScreenSizePerspective",void 0);b.__decorate([q.parameter()],p.prototype,"depthHudEnabled",void 0);b.__decorate([q.parameter()],p.prototype,"depthHudAlignStartEnabled",void 0);b.__decorate([q.parameter()],p.prototype,"hasSlicePlane",void 0);b.__decorate([q.parameter()],p.prototype,"multipassEnabled",void 0);b.__decorate([q.parameter({constValue:!0})],p.prototype,"hasSliceInVertexProgram",void 0);b.__decorate([q.parameter({constValue:!1})],p.prototype, "draped",void 0);a.LineCalloutTechniqueConfiguration=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/graphicSymbolUtils":function(){define(["exports","./Graphics3DSymbol","./Graphics3DWebStyleSymbol"],function(a,b,q){a.getGraphics3DSymbol=function(l){return l instanceof q.Graphics3DWebStyleSymbol?l.graphics3DSymbol:l instanceof b.Graphics3DSymbol?l:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DSymbol":function(){define("exports ../../../../core/arrayUtils ../../../../core/asyncUtils ../../../../core/has ../../../../core/promiseUtils ./defaultSymbolComplexity ./Graphics3DGraphic ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolCreationContext ./Graphics3DSymbolLayerFactory ./interfaces ./Loadable".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends d.Loadable{set symbol(v){this._symbol=v;v.symbolLayers.forEach((m,r)=>{r=this.symbolLayers[r];null!=r&&(r.symbol=v,r.symbolLayer=m)})}get symbol(){return this._symbol}constructor(v,m,r){super(m.schedule);this._symbol=v;this._context=m;this._backgroundLayers=r;this._destroyed=!1;this.symbolLayers=[];this._extentPadding=this.referenced=0}async doLoad(v){let m=this._symbol.symbolLayers;this._extentPadding=0;this._backgroundLayers&&(m=this._backgroundLayers.concat(m)); const r=m.length;for(;this.symbolLayers.length{this.symbolLayers[x]=null;y.destroy()}))&&n.push(u);this.symbolLayers[x]=y}await q.forEach(this.symbolLayers,async(x,y)=>{if(null!=x)try{await x.load(), this._extentPadding+=Math.max(this._extentPadding,x.extentPadding)}catch{this.symbolLayers[y]=null}});n.forEach(x=>x.remove());p.throwIfAborted(v);if(this.symbolLayers.length&&!this.symbolLayers.some(x=>!!x))throw Error();}getSymbolLayerSize(v){v=this.symbolLayers[v];return null!=v?v.getCachedSize():null}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(v=>v?.queryForSnapping)}createGraphics3DGraphic(v,m){const r=v.graphic,n=this.symbolLayers.map(u=> u?.createGraphics3DGraphic(v)??null);return new h.Graphics3DGraphic(r,m||this,n,v.layer,this._context.arcade||this._context.featureExpressionInfoContext?.arcade?.modules||null)}get complexity(){return k.totalSymbolComplexities(this.symbolLayers.map(v=>null!=v?v.complexity:null))}globalPropertyChanged(v,m){const r=this.symbolLayers.length;for(let n=0;n{y=y.layers[n];return y instanceof f.Graphics3DObject3DGraphicLayer?y:null};if(null!=u&&!u.globalPropertyChanged(v, m,x))return!1}return!0}applyRendererDiff(v,m){return this.loadStatus!==d.LoadStatus.LOADED?g.ApplyRendererDiffResult.RecreateSymbol:this.symbolLayers.reduce((r,n)=>r!==g.ApplyRendererDiffResult.RecreateSymbol&&null!=n?Math.min(r,n.applyRendererDiff(v,m)):r,g.ApplyRendererDiffResult.FastUpdate)}prepareSymbolPatch(v){if(this.loadStatus!==d.LoadStatus.FAILED&&"partial"===v.diff.type){var m=v.diff.diff;if(m.symbolLayers&&"partial"===m.symbolLayers.type){var r=m.symbolLayers.diff;this.symbolLayers.forEach((n, u)=>{if(null!=n){var x=r[u];if(x){const y={diff:x,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};n.prepareSymbolLayerPatch(y);v.symbolStatePatches.push(...y.symbolLayerStatePatches);y.graphics3DGraphicPatches.length&&v.graphics3DGraphicPatches.push((z,A)=>{const B=z.layers[u];null!=B&&y.graphics3DGraphicPatches.forEach(C=>C(B,A))})}}})}}}updateGeometry(v,m){return this._updateGeometryOrTransform(v,(r,n)=>r.updateGeometry(n,m))}updateTransform(v,m,r,n){return this._updateGeometryOrTransform(v, (u,x)=>u.updateTransform(x,m,r,n))}_updateGeometryOrTransform(v,m){for(let r=0;r{null!=n&&(n.loadStatus===d.LoadStatus.LOADING?v++:n.isFastUpdatesEnabled()? r++:m++)});return{loading:v,slow:m,fast:r}}async queryForSnapping(v,m,r,n){var u=this.symbolLayers.filter(b.isSome).filter(x=>null!=x.queryForSnapping).map(x=>x.queryForSnapping(v,m,r,n));u=await Promise.all(u);p.throwIfAborted(n);return u.flat()}destroy(){if(!this.destroyed){super.destroy();for(const v of this.symbolLayers)null!=v&&v.destroy();this.symbolLayers.length=0;this._destroyed=!0}}get destroyed(){return this._destroyed}}const w=new c.Graphics3DSymbolLayerCreationContext;a.Graphics3DSymbol= t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DGraphic":function(){define("exports ../../../../core/arrayUtils ../../../../core/asyncUtils ../../../../core/byteSizeEstimations ../../../../core/has ../../../../core/ObjectPool ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/Polygon ../../../../geometry/projection/projectBoundingRect ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../../../layers/graphics/dehydratedFeatures ../../../../layers/graphics/featureConversionUtils ./enums ./featureExpressionInfoUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){const x=new k(Array,A=>t.set(A,t.zero),null,10,5),y=w.create();class z{get labelLayers(){return this._labelLayers||b.emptyArray}get extent(){return this._extent}get isElevationSource(){return this.layers.some(A=>A?.isElevationSource)}constructor(A,B,C,D,F){this.graphic=A;this.graphics3DSymbol=B;this.layers=C;this._visibleFlags=n.VisibilityFlag.ALL_LABEL;this.deconflictionPriority=0;++B.referenced;this._featureExpressionFeature=F?u.createFeature(F,A, D):null}initialize(A){this._layer=A;this._forEachSymbolLayerGraphic(B=>{B.initialize(A);B.setVisibility(this.isVisible())})}destroy(){this._forEachSymbolLayerGraphic(A=>A.destroy());this._calloutLayer=null;--this.graphics3DSymbol.referenced;this.graphics3DSymbol=null}get destroyed(){return null==this.layers}clearLabelGraphics(){this._forEachLabelGraphic(A=>A.destroy());this._labelLayers=null}addLabelGraphic(A,B){this._labelLayers||(this._labelLayers=[]);this._labelLayers.push(A);A.initialize(B);A.setVisibility(this.isVisible(n.VisibilityGroup.LABEL))}setCalloutGraphic(A){this._calloutLayer= A;this._layer&&(A.initialize(this._layer),A.setVisibility(this.isVisible()))}get calloutLayer(){return this._calloutLayer}get isDraped(){let A=!1;this._forEachSymbolLayerGraphic(B=>{"draped"===B.type&&(A=!0)});return A}isVisible(A=n.VisibilityGroup.GRAPHIC,B){B=B?this._visibleFlags|B|n.VisibilityGroup.LABEL*B:this._visibleFlags;return A===n.VisibilityGroup.GRAPHIC?(B&n.VisibilityFlag.ALL_GRAPHIC)===n.VisibilityFlag.ALL_GRAPHIC:(B&n.VisibilityFlag.ALL_LABEL)===n.VisibilityFlag.ALL_LABEL}setVisibilityFlag(A, B,C){const D=this.isVisible(A);this._visibleFlags=C?this._visibleFlags|A*B:this._visibleFlags&~(A*B);const F=this.isVisible(A);if(D===F)return!1;if(A===n.VisibilityGroup.LABEL)this._forEachLabelGraphic(H=>H.setVisibility(F));else{this._forEachSymbolLayerGraphic(N=>N.setVisibility(F));const H=this.isVisible(n.VisibilityGroup.LABEL);this._forEachLabelGraphic(N=>N.setVisibility(H))}return!0}getVisibilityFlag(A,B){return 0!==(this._visibleFlags&A*B)}computeExtent(A){if(!this._extent){var B=this.graphic.geometry; if(null==B)return!1;this._extent=w.create();m.computeAABR(B,this._extent);B=B.spatialReference;if(!v.equals(B,A)&&!d.projectBoundingRect(this._extent,B,this._extent,A))return this._extent=null,!1}return!0}getAsOptimizedGeometry(A,B){this._optimizedGeometry||(this._optimizedGeometry=this._convertGraphicToOptimizedGeometry(this.graphic,A,B));return this._optimizedGeometry}_convertGraphicToOptimizedGeometry(A,B,C){A=A.geometry;if("mesh"===A.type||"extent"===A.type)A=g.fromExtent("mesh"===A.type?A.extent: A);return r.convertFromGeometry(A,B,C)}get usedMemory(){let A=l.estimateAttributesObjectSize(this.graphic.attributes);this._forEachSymbolLayerGraphic(B=>A+=B.graphics3DSymbolLayer.usedMemory);return A}computeAttachmentOrigin(){const A={render:{origin:e.create(),num:0},draped:{origin:f.create(),num:0}};for(const B of this.layers)null!=B&&B.computeAttachmentOrigin(A);1{if(null!=H){var N="draped"===H.type?B:A,E=x.acquire();H=await H.getProjectedBoundingBox(N,C,F.screenSpaceObjects,D,E);isFinite(H[2])&&isFinite(H[5])||(F.requiresDrapedElevation=!0);H&&t.expandWithAABB(F.boundingBox,E);x.release(E)}});return t.allFinite(F.boundingBox)|| w.allFinite(t.toRect(F.boundingBox,y))?F:null}needsElevationUpdates(){for(const A of this.layers)if(null!=A&&("object3d"===A.type||"lod-instance"===A.type)&&A.needsElevationUpdates)return!0;return this._labelLayers?.some(A=>A?.needsElevationUpdates??!1)??!1}alignWithElevation(A,B,C){this._forEachRenderedGraphic(D=>{"object3d"!==D.type&&"lod-instance"!==D.type||D.alignWithElevation(A,B,this._featureExpressionFeature,C)})}alignWithAbsoluteElevation(A,B,C){this._forEachRenderedGraphic(D=>{"object3d"=== D.type&&D.alignWithAbsoluteElevation(A,B,C)})}addObjectStateSet(A,B){this._forEachSymbolLayerGraphic(C=>C.addObjectState(A,B))}removeObjectState(A){this._forEachSymbolLayerGraphic(B=>B.removeObjectState(A))}_forEachGraphicList(A,B){A?.forEach(C=>C&&B(C))}_forEachSymbolLayerGraphic(A){this._forEachGraphicList(this.layers,A);this._calloutLayer&&A(this._calloutLayer)}_forEachLabelGraphic(A){this._forEachGraphicList(this._labelLayers,A)}_forEachRenderedGraphic(A){this._forEachSymbolLayerGraphic(A);this._forEachLabelGraphic(A)}get test(){}} a.Graphics3DGraphic=z;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/dehydratedFeatures":function(){define("exports ../../core/byteSizeEstimations ../../core/has ../../core/typedArrayUtil ../../core/uid ../../geometry/SpatialReference ../../geometry/support/aaBoundingBox ../../geometry/support/aaBoundingRect ../../geometry/support/quantizationUtils ../../geometry/support/typeUtils ../support/Field ./dehydratedFeatureComparison".split(" "),function(a,b,q,l,p, k,h,f,c,e,g,d){function t(x,y,z,A){return{uid:p.generateUID(),objectId:A&&x.attributes?x.attributes[A]:null,attributes:x.attributes,geometry:w(x.geometry,y,z),visible:!0}}function w(x,y,z){if(null==x)return null;switch(y){case "point":return{x:x.x,y:x.y,z:x.z,m:x.m,hasZ:null!=x.z,hasM:null!=x.m,type:"point",spatialReference:z};case "polyline":return{paths:x.paths,hasZ:!!x.hasZ,hasM:!!x.hasM,type:"polyline",spatialReference:z};case "polygon":return{rings:x.rings,hasZ:!!x.hasZ,hasM:!!x.hasM,type:"polygon", spatialReference:z};case "multipoint":return{points:x.points,hasZ:!!x.hasZ,hasM:!!x.hasM,type:"multipoint",spatialReference:z}}}function v(x){if(null==x)return 0;let y=32;switch(x.type){case "point":y+=42;break;case "polyline":case "polygon":var z=0;const A=2+(x.hasZ?1:0)+(x.hasM?1:0);x="polyline"===x.type?x.paths:x.rings;for(const B of x)z+=B.length;y+=8*z*A+64;y+=128*z;y=y+34+32*(x.length+1);break;case "multipoint":z=x.points.length;y+=8*z*(2+(x.hasZ?1:0)+(x.hasM?1:0))+64;y+=128*z;y=y+34+32;break; case "extent":y+=98;x.hasM&&(y+=32);x.hasZ&&(y+=32);break;case "mesh":y+=l.estimateSize(x.vertexAttributes.position,x.vertexAttributes.normal,x.vertexAttributes.uv,x.vertexAttributes.tangent)}return y}function m(x,y){return null!=x.objectId?x.objectId:x.attributes&&y?x.attributes[y]:null}function r(x,y,z,A){if(y?.size&&null!=z&&x)for(const B in x){if(!y.has(B))continue;const C=x[B];"string"===typeof C&&C.length>z&&(A(B),x[B]="")}}class n{constructor(x,y,z){this.uid=x;this.geometry=y;this.attributes= z;this.visible=!0;this.centroid=this.objectId=null}}class u{constructor(){this.exceededTransferLimit=!1;this.features=[];this.fields=[];this.hasZ=this.hasM=!1;this.transform=this.spatialReference=this.geohashFieldName=this.geometryProperties=this.globalIdFieldName=this.objectIdFieldName=this.geometryType=null}}a.equals=d.equals;a.DehydratedFeatureClass=n;a.DehydratedFeatureSetClass=u;a.computeAABB=function(x,y){h.empty(y);"mesh"===x.type&&(x=x.extent);switch(x.type){case "point":y[0]=y[3]=x.x;y[1]= y[4]=x.y;x.hasZ&&(y[2]=y[5]=x.z);break;case "polyline":for(var z=0;z{const E=t(N,z,A,x.objectIdFieldName);N=E.geometry;r(E.attributes,F,D,G=>{H??=[];const I=m(E,C);null!=I&&H.push({objectId:I,attribute:G})});if(null!=N&&B)switch(N.type){case "point":E.geometry=c.unquantizePoint(B,N,N);break;case "multipoint":E.geometry=c.unquantizeMultipoint(B, N,N);break;case "polygon":E.geometry=c.unquantizePolygon(B,N,N);break;case "polyline":E.geometry=c.unquantizePolyline(B,N,N);break;case "extent":E.geometry=N;break;case "mesh":E.geometry=N}return E});return{geometryType:z,features:y,spatialReference:A,fields:x.fields?.map(N=>g.fromJSON(N))??[],objectIdFieldName:x.objectIdFieldName,globalIdFieldName:x.globalIdFieldName,geohashFieldName:x.geohashFieldName,geometryProperties:x.geometryProperties,hasZ:x.hasZ,hasM:x.hasM,exceededTransferLimit:x.exceededTransferLimit, transform:null,missingAttributes:H}};a.fromJSONGeometry=w;a.getObjectId=m;a.hasGeometry=function(x){return null!=x.geometry};a.hasVertices=function(x){if(null==x)return!1;switch(x.type){case "extent":case "point":return!0;case "polyline":for(const y of x.paths)if(0Ka?na:la;Aa=0>Ka?la:na;for(Ya=0;YaKa&&(Aa=ua+Ua+1,qa=ua);Ha*=3;for(let Ia=0;IaTa;++Ta){var Ra=Ha[Ja+Ta];qa[Ta]=Ra;Ra*=3;g.set(fa,Ea[Ra+0],Ea[Ra+1],Ea[Ra+2]);g.transformMat4(Aa[Ta],fa,Qa)}g.sub(Sa,Aa[1],Aa[0]);g.sub(Ya,Aa[2],Aa[0]);g.cross(aa,Sa,Ya);g.normalize(aa, aa);for(Ja=0;3>Ja;++Ja)Ta=3*(qa[Ja]-Na),Pa[Ta+0]+=aa[0],Pa[Ta+1]+=aa[1],Pa[Ta+2]+=aa[2]}for(Qa=Na;QaPa||this.needsDrivenTransparentPass;Ga={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:Ga,ambient:Ga,opacity:Pa,transparent:Qa,cullFace:Qa?O.CullFaceOptions.None:O.CullFaceOptions.Back,hasVertexColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0,normalType:G.NormalType.Compressed}; this._materials[ra.Main]=new Q.DefaultMaterial(Ga);this._materials[ra.Bottom]=new Q.DefaultMaterial({...Ga,cullFace:O.CullFaceOptions.Back});this._context.stage.addMany(this._materials)}destroy(){super.destroy();this._context.stage.removeMany(this._materials);this._materials.length=0}createGraphics3DGraphic(Ga){const Pa=Ga.graphic;if(!this._validateGeometry(Pa.geometry,ha,this.symbolLayer.type))return null;const Qa=this._getVertexOpacityAndColor(Ga.renderingInfo,255),Ea=this.setGraphicElevationContext(Pa); return this._createAs3DShape(Pa,Ga.renderingInfo,Qa,Ea,Pa.uid)}layerOpacityChanged(Ga,Pa){const Qa=this._getCombinedOpacity(this.symbolLayer?.material?.color),Ea=1>Qa||this.needsDrivenTransparentPass;this._materials[ra.Main]?.setParameters({opacity:Qa,transparent:Ea});this._materials[ra.Bottom]?.setParameters({opacity:Qa,transparent:Ea});const ua=this._getLayerOpacity();Ga.forEach(Na=>{Na=Pa(Na);null!=Na&&Na.layerOpacityChanged(ua,this._context.isAsync)})}layerElevationInfoChanged(Ga,Pa){return this.updateGraphics3DGraphicElevationInfo(Ga, Pa,y.needsElevationUpdates3D)}slicePlaneEnabledChanged(Ga,Pa){this._materials[ra.Main]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});this._materials[ra.Bottom]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});Ga.forEach(Qa=>{Qa=Pa(Qa);null!=Qa&&Qa.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)});return!0}physicalBasedRenderingChanged(){const Ga={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};this._materials[ra.Main]?.setParameters(Ga); this._materials[ra.Bottom]?.setParameters(Ga);return!0}_getExtrusionSize(Ga){Ga=Ga.size&&this._drivenProperties.size?u.getDriverAxisSizeValue(Ga.size,2)??0:this._getSymbolSize();return Ga/=this._context.renderCoordsHelper.unitInMeters}applyRendererDiff(Ga,Pa){return this._drivenPropertiesChanged(Pa)?C.ApplyRendererDiffResult.RecreateSymbol:C.ApplyRendererDiffResult.RecreateGraphics}async queryForSnapping(Ga,Pa,Qa,Ea){Pa=this._getExtrusionSize(Qa)*this._context.renderCoordsHelper.unitInMeters/p.getMetersPerVerticalUnitForSR(Pa); const {objectId:ua,target:Na}=Ga;Qa=l.clone(Na);Qa.z=(Qa.z??0)+Pa;switch(Ga.type){case "edge":const {start:Ua,end:wa}=Ga;Ga=l.clone(Ua);Ea=l.clone(wa);Ga.z=(Ga.z??0)+Pa;Ea.z=(Ea.z??0)+Pa;return[n.makeEdgeCandidate(ua,Qa,Infinity,Ga,Ea)];case "vertex":return[n.makeVertexCandidate(ua,Qa,Infinity),n.makeEdgeCandidate(ua,Na,Infinity,Na,Qa)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(Ga,Pa,Qa,Ea,ua){var Na=D.geometryAsPolygon(Ga.geometry);if(null==Na)return null; if(0===Na.rings.length||!Na.rings.some(Ba=>0{Ba=Ba.stageObject;const La=Ba.geometries,Xa=La.length;Ia="absolute-height"!==Ia.mode;let eb=0;const db=Ba.transformation,jb=c.invertOrIdentity(e.create(),db);for(let qb=0;qb=kc||Math.abs(ka[1]-nb[Ib+1])>=kc||Math.abs(ka[2]-nb[Ib+2])>=kc)Kb=!0;pb.offset+=3;Ib+=3}Kb&&((nb=Ja.get(ub))&&Y(ub,nb,db),Ba.geometryVertexAttributeUpdated(La[qb], R.VertexAttribute.NORMALCOMPRESSED),ub.invalidateBoundingInfo(),Ba.geometryVertexAttributeUpdated(La[qb],R.VertexAttribute.POSITION),La[qb+1].invalidateBoundingInfo(),Ba.geometryVertexAttributeUpdated(La[qb+1],R.VertexAttribute.POSITION));eb+=bc/Bb}return eb/Xa},Ea,null!=Qa?{baseMaterial:this._materials[ra.Main],edgeMaterials:[Qa],properties:{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}}:null);wa.alignedSampledElevation=Ga.sampledElevation;wa.needsElevationUpdates=y.needsElevationUpdates3D(Ea.mode); return wa}}const U=d.create(),Z=d.create(),ca=d.create(),ea=d.create(),da=d.create(),ia=d.create(),ka=d.create(),fa=d.create(),X=d.create(),ja=new y.SampleElevationInfo,la=[0,2,1],na=[0,1,2],va=[d.create(),d.create(),d.create()],za=d.create(),ya=d.create(),Da=[0,0,0];var ra;(function(Ga){Ga[Ga.Main=0]="Main";Ga[Ga.Bottom=1]="Bottom"})(ra||={});class xa{constructor(Ga,Pa,Qa,Ea){this.positions=Ga;this.elevation=Pa;this.normals=Qa;this.heights=Ea}}class Ma{constructor(Ga,Pa,Qa,Ea){this.topVertexStart= Ga;this.topVertexCount=Pa;this.topFaceStart=Qa;this.topFaceCount=Ea}}a.Graphics3DExtrudeSymbolLayer=ba;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/earcut":function(){define(["exports","./_commonjsHelpers"],function(a,b){var q={exports:{}};(function(l){(function(p){p=p();void 0!==p&&(l.exports=p)})(function(){function p(D,F,H){H=H||2;var N=F&&F.length,E=N?F[0]*H:D.length,G=k(D,0,E,H,!0),I=[];if(!G||G.next===G.prev)return I;var O;if(N){var L=G;var P=H;G=[];var M;N=0; for(M=F.length;N80*H){var S=O=D[0];var V=N=D[1];for(P=H;PO&&(O=F),L>N&&(N=L);O=Math.max(O-S,N-V);O=0!==O?1/ O:0}f(G,I,H,S,V,O);return I}function k(D,F,H,N,E){if(E===0=F;E-=N)G=z(E,D[E],D[E+1],G);G&&m(G,G.next)&&(D=G.next,A(G),G=D);return G}function h(D,F){if(!D)return D;F||=D;do{var H=!1;if(D.steiner||!m(D,D.next)&&0!==v(D.prev,D,D.next))D=D.next;else{F=D.prev;A(D);D=F;if(D===D.next)break;H=!0}}while(H||D!==F);return F}function f(D,F,H,N,E,G,I){if(D){if(!I&&G){var O=D,L=O;do null===L.z&&(L.z=t(L.x,L.y,N,E,G)),L.prevZ=L.prev,L=L.nextZ= L.next;while(L!==O);L.prevZ.nextZ=null;L.prevZ=null;O=L;var P,M,K,J,R=1;do{L=O;var Q=O=null;for(M=0;L;){M++;var W=L;for(P=K=0;PR!==Q.next.y>R&&Q.next.y!==Q.y&&K<(Q.next.x-Q.x)*(R-Q.y)/(Q.next.y-Q.y)+Q.x&&(M=!M),Q=Q.next;while(Q!==L);Q=M}Q=Q&&(v(L.prev,L,W.prev)||v(L,W.prev,W))||m(L,W)&&0D.x?E.x>G.x?E.x:G.x:D.x>G.x?D.x:G.x,O=E.y>D.y?E.y>G.y?E.y:G.y:D.y>G.y?D.y:G.y,L=t(E.x=L&&N&&N.z<=F;){if(H!==D.prev&&H!==D.next&&w(E.x,E.y,D.x,D.y,G.x,G.y,H.x,H.y)&&0<=v(H.prev,H,H.next))return!1;H=H.prevZ;if(N!==D.prev&&N!==D.next&&w(E.x,E.y,D.x,D.y,G.x,G.y,N.x,N.y)&&0<=v(N.prev,N,N.next))return!1; N=N.nextZ}for(;H&&H.z>=L;){if(H!==D.prev&&H!==D.next&&w(E.x,E.y,D.x,D.y,G.x,G.y,H.x,H.y)&&0<=v(H.prev,H,H.next))return!1;H=H.prevZ}for(;N&&N.z<=F;){if(N!==D.prev&&N!==D.next&&w(E.x,E.y,D.x,D.y,G.x,G.y,N.x,N.y)&&0<=v(N.prev,N,N.next))return!1;N=N.nextZ}return!0}function e(D,F){return D.x-F.x}function g(D){if(D.next.prev===D)return D;let F=D;do{const H=F.next;if(H.prev===F||H===F||H===D)break;F=H}while(1);return F}function d(D,F){var H=F,N=D.x,E=D.y,G=-Infinity;do{if(E<=H.y&&E>=H.next.y&&H.next.y!== H.y){var I=H.x+(E-H.y)*(H.next.x-H.x)/(H.next.y-H.y);if(I<=N&&I>G){G=I;if(I===N){if(E===H.y)return H;if(E===H.next.y)return H.next}var O=H.x=H.x&&H.x>=I&&N!==H.x&&w(EO.x)&&(K=H.x===O.x)){K=O;var J=H;K=0>v(K.prev,K,J.prev)&&0>v(J.next,K,K.next)}K&&(O=H,P=M)}H=H.next}while(H!== F);return O}function t(D,F,H,N,E){D=32767*(D-H)*E;F=32767*(F-N)*E;D=(D|D<<8)&16711935;D=(D|D<<4)&252645135;D=(D|D<<2)&858993459;F=(F|F<<8)&16711935;F=(F|F<<4)&252645135;F=(F|F<<2)&858993459;return(D|D<<1)&1431655765|((F|F<<1)&1431655765)<<1}function w(D,F,H,N,E,G,I,O){return 0<=(E-I)*(F-O)-(D-I)*(G-O)&&0<=(D-I)*(N-O)-(H-I)*(F-O)&&0<=(H-I)*(G-O)-(E-I)*(N-O)}function v(D,F,H){return(F.y-D.y)*(H.x-F.x)-(F.x-D.x)*(H.y-F.y)}function m(D,F){return D.x===F.x&&D.y===F.y}function r(D,F,H,N){var E=u(v(D,F, H)),G=u(v(D,F,N)),I=u(v(H,N,D)),O=u(v(H,N,F));return E!==G&&I!==O||0===E&&n(D,H,F)||0===G&&n(D,N,F)||0===I&&n(H,D,N)||0===O&&n(H,F,N)?!0:!1}function n(D,F,H){return F.x<=Math.max(D.x,H.x)&&F.x>=Math.min(D.x,H.x)&&F.y<=Math.max(D.y,H.y)&&F.y>=Math.min(D.y,H.y)}function u(D){return 0D?-1:0}function x(D,F){return 0>v(D.prev,D,D.next)?0<=v(D,F,D.next)&&0<=v(D,D.prev,F):0>v(D,F,D.prev)||0>v(D,D.next,F)}function y(D,F){var H=new B(D.i,D.x,D.y),N=new B(F.i,F.x,F.y),E=D.next,G=F.prev;D.next=F;F.prev= D;H.next=E;E.prev=H;N.next=H;H.prev=N;G.next=N;N.prev=G;return N}function z(D,F,H,N){D=new B(D,F,H);N?(D.next=N.next,D.prev=N,N.next.prev=D,N.next=D):(D.prev=D,D.next=D);return D}function A(D){D.next.prev=D.prev;D.prev.next=D.next;D.prevZ&&(D.prevZ.nextZ=D.nextZ);D.nextZ&&(D.nextZ.prevZ=D.prevZ)}function B(D,F,H){this.i=D;this.x=F;this.y=H;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function C(D,F,H,N){for(var E=0,G=H-N;F>m,n[y+1]=u[x+1]>>m,n[y+2]=u[x+2]>>m,x+=v,y+=w}b=Object.freeze(Object.defineProperty({__proto__:null,normalize:d, normalizeView:g,scale:c,scaleView:f,shiftRight:t,transformMat3:h,transformMat3View:k,transformMat4:p,transformMat4View:l,translate:e},Symbol.toStringTag,{value:"Module"}));a.normalize=d;a.normalizeView=g;a.scale=c;a.scaleView=f;a.shiftRight=t;a.transformMat3=h;a.transformMat3View=k;a.transformMat4=p;a.transformMat4View=l;a.translate=e;a.vec3=b})},"esri/layers/graphics/data/SnappingCandidate":function(){define(["exports"],function(a){a.makeEdgeCandidate=function(b,q,l,p,k,h=!1){return{objectId:b,target:q, distance:l,type:"edge",start:p,end:k,draped:h}};a.makeVertexCandidate=function(b,q,l){return{objectId:b,target:q,distance:l,type:"vertex"}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/support/renderingInfoUtils":function(){define(["exports","../../Color","../visualVariables/support/visualVariableUtils"],function(a,b,q){function l(k,h){if(!k||k.symbol)return null;h=h?.renderer;return k&&null!=h&&h.getObservationRenderer?h.getObservationRenderer(k):h}async function p(k, h){if(null!=k.symbol)return k.symbol;const f=l(k,h);return null!=f?f.getSymbolAsync(k,h):null}a.getDriverAxisSizeValue=function(k,h=0){k=k[h];return"number"===typeof k&&isFinite(k)?k:null};a.getDriverAxisSizeValueAny=function(k){for(let h=0;3>h;h++){const f=k[h];if("number"===typeof f)return isFinite(f)?f:0}return 0};a.getRenderer=l;a.getRenderingInfo=function(k,h){const f=l(k,h);if(null!=k.symbol)var c=k.symbol;else c=l(k,h),c=null!=c&&"dot-density"!==c.type?c.getSymbol(k,h):null;if(null==c)return null; c={renderer:f,symbol:c};if(!(null!=f&&"visualVariables"in f&&f.visualVariables))return c;h=q.getVisualVariableValues(f,k,h)??[];k=["proportional","proportional","proportional"];for(const {variable:e,value:g}of h)switch(e.type){case "color":c.color=g.toRgba();break;case "size":if("outline"===e.target)c.outlineSize=g;else switch(h=e.useSymbolValue?"symbol-value":g,e.axis){case "width":k[0]=h;break;case "depth":k[1]=h;break;case "height":k[2]=h;break;case "width-and-depth":k[0]=k[1]=h;break;default:k[0]= k[1]=k[2]=h}break;case "opacity":c.opacity=g;break;case "rotation":switch(e.axis){case "tilt":c.tilt=g;break;case "roll":c.roll=g;break;default:c.heading=g}}if("proportional"!==k[0]||"proportional"!==k[1]||"proportional"!==k[2])c.size=k;return c};a.getRenderingInfoAsync=async function(k,h){var f=l(k,h),c=await p(k,h);if(!c)return null;c={renderer:f,symbol:c};if(!(f&&"visualVariables"in f&&f.visualVariables))return c;h=q.getVisualVariableValues(f,k,h)??[];k=["proportional","proportional","proportional"]; for(const {variable:e,value:g}of h)"color"===e.type?c.color=b.toUnitRGBA(g):"size"===e.type?"outline"===e.target?c.outlineSize=g:(h=e.axis,f=e.useSymbolValue?"symbol-value":g,"width"===h?k[0]=f:"depth"===h?k[1]=f:"height"===h?k[2]=f:k[0]="width-and-depth"===h?k[1]=f:k[1]=k[2]=f):"opacity"===e.type?c.opacity=g:"rotation"===e.type&&"tilt"===e.axis?c.tilt=g:"rotation"===e.type&&"roll"===e.axis?c.roll=g:"rotation"===e.type&&(c.heading=g);if(isFinite(k[0])||isFinite(k[1])||isFinite(k[2]))c.size=k;return c}; a.getSymbolAsync=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/polygonUtils":function(){define("exports ../../../../geometry ../../../../chunks/earcut ../../../../geometry/support/Axis ../../../../geometry/support/Indices ../../../../geometry/support/polygonUtils ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/VertexAttribute ../../../../geometry/Extent ../../../../geometry/Polygon".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(w,v,m){this.renderData=w;this.layerUid=v;this.graphicUid=m;this.outGeometries=[]}}a.PolygonCreationDataBase=t;a.createColorGeometry=function(w){const v=[[e.VertexAttribute.POSITION,new h.Attribute(w.attributeData.position,w.indices,3,!0)]],m=p.getZeroIndexArray(w.indices.length);null!=w.attributeData.colorFeature?v.push([e.VertexAttribute.COLORFEATUREATTRIBUTE,new h.Attribute([w.attributeData.colorFeature],m,1,!0)]):w.attributeData.color&&v.push([e.VertexAttribute.COLOR, new h.Attribute(w.attributeData.color,m,4,!0)]);w.attributeData.uvMapSpace&&v.push([e.VertexAttribute.UVMAPSPACE,new h.Attribute(w.attributeData.uvMapSpace,w.indices,4,!0)]);w.attributeData.boundingRect&&v.push([e.VertexAttribute.BOUNDINGRECT,new h.Attribute(w.attributeData.boundingRect,w.indices,9,!0)]);return new c.Geometry(w.material,v,w.mapPositions,f.ContentObjectType.Mesh,w.attributeData.objectAndLayerIdColor)};a.createIndices3D=function(w,v,m){m=k.leastSignificantAxis(w,(0e[v][m]:(v,m)=>e[3*v+m],w=d?q.getMetersPerUnitForSR(d)/q.getMetersPerVerticalUnitForSR(d):1;return k.fromManyPoints(c,(v,m)=>l.set(v,t(m,0)*w,t(m,1)*w,t(m,2)),g)}const f=k.create(); a.fitPlane=h;a.leastSignificantAxis=function(c,e,g){c=h(f,c,e,g)?k.getNormal(f):[0,0,1];return Math.abs(c[2])>Math.cos(b.deg2rad(80))?p.Axis.Z:Math.abs(c[1])>Math.abs(c[0])?p.Axis.Y:p.Axis.X};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/renderInfoUtils/polygon":function(){define("exports ../../../../geometry/projection/projectBuffer ../../../../geometry/support/DoubleArray ../../../../geometry/support/triangulationUtils ../../layers/graphics/elevationAlignmentUtils ../../terrain/OverlayRenderer".split(" "), function(a,b,q,l,p,k){function h(w,v,m=null){return w.filter(({count:r})=>1{const u=3*r,x=3*n;return null!=m?new e(r,n,q.doubleSubArray(v,u,x),q.doubleSubArray(m,u,x)):new c(r,n,q.doubleSubArray(v,u,x))})}function f(w,v,m=null){const r=[];for(const {index:n,count:u,holeIndices:x,pathLengths:y}of w){if(1>=u)continue;w=3*n;const z=3*u,A=x.map(B=>B-n);w=null!=m?new g(n,u,q.doubleSubArray(v,3*n,3*u),q.doubleSubArray(m,w,z),A,y):new d(n,u,q.doubleSubArray(v,3*n,3*u),A,y);r.push(w)}return r} class c{constructor(w,v,m){this.index=w;this.count=v;this.position=m}}class e extends c{constructor(w,v,m,r){super(w,v,m);this.mapPositions=r}}class g extends e{constructor(w,v,m,r,n,u){super(w,v,m,r);this.holeIndices=n;this.pathLengths=u}}class d extends c{constructor(w,v,m,r,n){super(w,v,m);this.holeIndices=r;this.pathLengths=n}}class t{constructor(w,v,m,r,n,u){this.position=w;this.mapPositions=v;this.polygons=m;this.outlines=r;this.projectionSuccess=n;this.sampledElevation=u}}a.PolygonRenderInfo= t;a.PolygonVertexData=g;a.PolygonVertexDataDraped=d;a.geometryToRenderInfo=function(w,v,m,r){const n=l.ringsToTriangulationInfo(w.rings,!!w.hasZ&&"on-the-ground"!==r.mode,l.CounterClockwiseMode.CCW_IS_HOLE,w.spatialReference),u=q.newDoubleArray(n.position.length);w=p.applyPerVertexElevationAlignment(n.position,w.spatialReference,0,u,0,n.position,0,n.position.length/3,v,m,r);v=null!=w;return new t(n.position,u,f(n.polygons,n.position,u),h(n.outlines,n.position,u),v,w)};a.geometryToRenderInfoDraped= function(w,v){const m=l.ringsToTriangulationInfo(w.rings,!1,l.CounterClockwiseMode.CCW_IS_HOLE);w=b.projectBuffer(m.position,w.spatialReference,0,m.position,v,0,m.position.length/3);for(v=2;vy-u);n=k.compactIndices(b.earcut(x,n,3));w.push({position:x,faces:n});v+=x.length;m+=n.length}r= c(w,v,m);t=Array.isArray(r.position)?f.deduplicate(r.position,3,{originalIndices:r.faces}):f.deduplicate(r.position.buffer,6,{originalIndices:r.faces});r.position=p.doubleArrayFrom(new Float64Array(t.buffer));r.faces=t.indices;return r};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/deduplicate":function(){define(["exports","../../../core/mathUtils","../Indices"],function(a,b,q){let l=null;a.deduplicate=function(p,k,h){var f=Array.isArray(p),c=f?p.length/ k:p.byteLength/(4*k),e=f?p:new Uint32Array(p,0,c*k),g=h?.minReduction??0;const d=(p=h?.originalIndices||null)?p.length:0;var t=h?.componentOffsets||null;h=0;if(t)for(var w=0;wh&&(h=v)}else h=c;var m=Math.floor(1.1*h)+1;if(null==l||l.length<2*m)l=new Uint32Array(b.nextHighestPowerOfTwo(2*m));for(h=0;h<2*m;h++)l[h]=0;h=0;const r=(v=!!t&&!!p)?d:c;w=q.newIndexArray(c);var n=new Uint32Array(d),u=0!==g?Math.ceil(7.84*1.96/(g*g)*g*(1-g)):r,x=1,y=t?t[1]:r;for(let D=0;D< r;D++){if(D===u){var z=1-h/D;if(z+1.96*Math.sqrt(z*(1-z)/D)>>2)|0;A>>>=0;B=A%m;let H=h;for(;0!==l[2*B+1];){if(l[2*B]===A){const N=l[2*B+1]-1;var C=N*k;a:{for(let E=0;E=m&&(B-=m)}H===h&&(l[2*B]=A,l[2*B+1]=z+1,h++);w[z]=H}if(0!==g&&1-h/cda!==C.ShaderOutput.Highlight||this.hasHighlights],[L.RenderSlot.DRAPED_WATER,()=>this._hasWater]]);this._hasDrapedRasterSource=this._hasDrapedFeatureSource=this._hasTargetWithoutRasterImage=!1}initialize(){const ea=this.view._stage.renderer.fboCache,da=this.view._stage.renderView, {waterTextures:ia,stippleTextures:ka,markerTextures:fa}=da;this._techniques=new H.ShaderTechniqueRepository({rctx:this._rctx,viewingMode:r.ViewingMode.Local,stippleTextures:ka,markerTextures:fa,waterTextures:ia});this._renderContext=new O.OverlayRenderContext(this._rctx,new P.ShadowMap(ea,this.view.state.viewingMode),null);this.addHandles([f.watch(()=>ia.updating,()=>this.events.emit("content-changed"),f.syncAndInitial),f.watch(()=>this.spatialReference,X=>this._localOriginFactory=new G.GridLocalOriginFactory(X), f.syncAndInitial),f.on(()=>this.view.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0)]);this._materials=new E.GLMaterialRepository(da.textures,this._techniques,()=>{this.notifyChange("rendersOccludedDraped");this.events.emit("content-changed");this.notifyChange("updating");this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._bindParameters.slot=L.RenderSlot.DRAPED_MATERIAL;this._bindParameters.mainDepth=null;this._camera.near=1;this._camera.far=1E4; this._camera.relativeElevation=null;this._bindParameters.camera=this._camera;this._bindParameters.transparencyPassType=R.TransparencyPassType.NONE;this._bindParameters.newLighting.noonFactor=0;this._bindParameters.newLighting.globalFactor=0;this._bindParameters.newLighting.set([new W.AmbientLight(m.fromValues(1,1,1))]);this.addHandles(this.view.resourceController.scheduler.registerTask(T.TaskPriority.STAGE,this))}destroy(){this._renderers.forEach(ea=>ea.destroy());this._renderers.clear();this._debugTextureTechnique= k.releaseMaybe(this._debugTextureTechnique);this._passParameters.texture=k.disposeMaybe(this._passParameters.texture);this._techniques=k.destroyMaybe(this._techniques);this.disposeOverlays()}get _bindParameters(){return this._renderContext.bindParameters}get _rctx(){return this.view._stage.renderView.renderingContext}get rctx(){return this._rctx}get materials(){return this._materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}initializeRenderContext(ea){this.pluginContext= ea}uninitializeRenderContext(){}renderNode(){}get updating(){return this._sortedDrapeSourceRenderersDirty||p.someMap(this._renderers,ea=>ea.updating)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(ea){for(const da of this._renderers.values()){const ia=da.getMaterialRenderer(ea);if(ia)return ia}return null}get layers(){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();return this._sortedRenderers.map(ea=>ea.drapeSource.layer).filter(ea=> !!ea)}createGeometryDrapeSourceRenderer(ea){return this.createDrapeSourceRenderer(ea,M.SortedRenderGeometryRenderer)}createDrapeSourceRenderer(ea,da,ia){const ka=this._renderers.get(ea);null!=ka&&ka.destroy();da=new da({...ia,rendererContext:this,drapeSource:ea});this._renderers.set(ea,da);this._sortedDrapeSourceRenderersDirty=!0;"fullOpacity"in ea&&this.addHandles(f.watch(()=>ea.fullOpacity,()=>this.events.emit("content-changed")),ea);return da}removeDrapeSourceRenderer(ea){if(null!=ea){var da=this._renderers.get(ea); null!=da&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(ea),this.removeHandles(ea),da.destroy())}}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(){this._renderTargets?.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(ea){this._hasTargetWithoutRasterImage=this._overlays?c.someSet(ea,da=>da.drapeTargetType===n.DrapeTargetType.WithoutRasterImage):!1}ensureDrapeSources(ea){this._overlays?(this._hasDrapedFeatureSource=c.someSet(ea, da=>da.drapeSourceType===n.DrapeSourceType.Features),this._hasDrapedRasterSource=c.someSet(ea,da=>da.drapeSourceType===n.DrapeSourceType.RasterImage)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(ea,da,ia=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new A.OverlayRenderTargets(this.view._stage.renderer.fboCache), this._overlays=[new y.Overlay,new y.Overlay]);this.ensureDrapeTargets(ea);this.ensureDrapeSources(da);this._bindParameters.overlayStretch=ia}disposeOverlays(){this._overlays=null;this._renderTargets=k.disposeMaybe(this._renderTargets);this.events.emit("textures-disposed")}getTexture(ea){if(null!=ea)return ea===z.OverlayContent.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?this._renderTargets?.getTexture(z.OverlayContent.Color):this._renderTargets?.getTexture(ea)}get running(){return this.updating}runTask(ea){this._processDrapeSources(ea, ()=>!0)}_processDrapeSources(ea,da){let ia=!1;for(const [ka,fa]of this._renderers){if(ea.done)break;(ka.destroyed||da(ka))&&fa.commitChanges()&&(ia=!0,ea.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,ia=!0,this._updateSortedDrapeSourceRenderers());ia&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=p.someMap(this._renderers, ka=>ka.hasHighlights),this.notifyChange("rendersOccludedDraped"),this._updateHasWater())}processSyncDrapeSources(){this._processDrapeSources(T.noBudget,ea=>ea.updatePolicy===Q.UpdatePolicy.SYNC)}get isEmpty(){return u.debugFlags.OVERLAY_DRAW_DEBUG_TEXTURE?!1:!p.someMap(this._renderers,ea=>!ea.isEmpty)}get hasWater(){return this._hasWater}get rendersOccludedDraped(){const ea=this._renderContext.renderOccludedMask;this._renderContext.renderOccludedMask=ca;const da=this._sortedRenderers.some(({renderer:ia})=> ia.shouldRender(this._renderContext));this._renderContext.renderOccludedMask=ea;return da}renders(ea){return u.debugFlags.OVERLAY_DRAW_DEBUG_TEXTURE&&ea!==z.OverlayContent.Occluded||this._sortedRenderers.some(({renderer:da})=>da.shouldRender(this._renderContext))}get mode(){return this.isEmpty?D.OverlayMode.Disabled:this._renderTargets?.getTexture(z.OverlayContent.WaterNormal)?D.OverlayMode.EnabledWithWater:this._renderTargets?.getTexture(z.OverlayContent.Color)?D.OverlayMode.Enabled:D.OverlayMode.Disabled}updateAnimation(ea){let da= !1;this._renderers.forEach(ia=>da=ia.updateAnimation(ea)||da);return da}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}drawOverlays(ea){if(this._overlays&&this._renderTargets){for(var da of this._overlays)this.longitudeCyclical?da.setupGeometryViewsCyclical(this.longitudeCyclical):da.setupGeometryViewsDirect();for(const ia of this._renderTargets.targets){if(ia.content===z.OverlayContent.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;da=this._drawTarget(x.OverlayIndex.INNER, ia,ea);const ka=this._drawTarget(x.OverlayIndex.OUTER,ia,ea);(da||ka)&&ia.fbo.generateMipMap()}}}_drawTarget(ea,da,ia){const ka=this._overlays[ea],fa=ka.canvasGeometries;if(0===fa.numViews)return!1;const {alignPixelEnabled:X,contentPixelRatio:ja}=ia;this._screenToWorldRatio=ja*ka.mapUnitsPerPixel/this._bindParameters.overlayStretch;const la=da.output;if(this.isEmpty||la===C.ShaderOutput.Highlight&&!this.hasHighlights||la===C.ShaderOutput.Normal&&!this.hasWater||!ka.hasSomeSizedView())return!1;const na= this._rctx;this._camera.pixelRatio=ka.pixelRatio*ja;this._renderContext.output=la;this._bindParameters.alignPixelEnabled=X;this._bindParameters.screenToWorldRatio=this._screenToWorldRatio;this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio;this._bindParameters.slot=la===C.ShaderOutput.Normal?L.RenderSlot.DRAPED_WATER:L.RenderSlot.DRAPED_MATERIAL;da.content===z.OverlayContent.Occluded&&(this._renderContext.renderOccludedMask=ca);if(!this.renders(da.content))return this._renderContext.renderOccludedMask= O.defaultRenderOccludedMask,!1;ia=ka.resolution;this._rctx.setViewport(ea===x.OverlayIndex.INNER?0:ia,0,ia,ia);const va=2*ka.resolution,za=ka.resolution,ya=da.fbo;ya.bind(na,va,za);ea===x.OverlayIndex.INNER&&(na.setClearColor(0,0,0,0),na.clear(Y.ClearBufferBit.COLOR_BUFFER_BIT));if(u.debugFlags.OVERLAY_DRAW_DEBUG_TEXTURE&&da.content!==z.OverlayContent.Occluded)for(ia=0;ia{if(da.content!==z.OverlayContent.ColorNoRasterImage||Da.drapeSourceType!==n.DrapeSourceType.RasterImage){var {fullOpacity:xa}=Da;Da=null!=xa&&1>xa&&la===C.ShaderOutput.Color?this.bindTemporaryFramebuffer(va,za):null;for(let Ma=0;Ma{const fa=ea.indexOf(ka.layer),X=0<=fa;this._sortedRenderers.push(new U(ka,ia,da*(ka.renderGroup??(X?n.DrapedRenderGroup.MapLayer:n.DrapedRenderGroup.ViewLayer))+(X?fa:0)))});this._sortedRenderers.sort((ia,ka)=>ia.index-ka.index)}}_setViewParameters(ea,da){const ia=this._camera;ia.viewport=[0,0,da.resolution,da.resolution];w.ortho(ia.projectionMatrix,0,ea[2]-ea[0],0,ea[3]-ea[1],ia.near,ia.far); w.fromTranslation(ia.viewMatrix,[-ea[0],-ea[1],0])}_updateHasWater(){const ea=p.someMap(this._renderers,da=>da.hasWater);ea!==this._hasWater&&(this._hasWater=ea,this.events.emit("has-water",ea))}_ensureDebugPatternResources(ea,da){v.set(this._passParameters.color,da[0],da[1],da[2]);if(!this._passParameters.texture){da=new Uint8Array(ea*ea*4);var ia=0;for(let ka=0;kaX||2>ja||10*X>ea-20||10*ja>ea-20?(da[ia++]=255,da[ia++]= 255,da[ia++]=255,da[ia++]=255):(da[ia++]=255,da[ia++]=255,da[ia++]=255,X&1&&ja&1?da[ia++]=fa&1^ka&1?0:255:da[ia++]=X&1^ja&1?0:128)}ea=new ba.TextureDescriptor(ea);ea.samplingMode=Y.TextureSamplingMode.NEAREST;this._passParameters.texture=new ha.Texture(this._rctx,ea,da);ea=new J.TextureTechniqueConfiguration;ea.hasAlpha=!0;this._debugTextureTechnique=this._techniques.acquire(K.TextureTechnique,ea)}}get test(){}};b.__decorate([e.property()],a.OverlayRenderer.prototype,"hasHighlights",void 0);b.__decorate([e.property()], a.OverlayRenderer.prototype,"_sortedDrapeSourceRenderersDirty",void 0);b.__decorate([e.property()],a.OverlayRenderer.prototype,"_techniques",void 0);b.__decorate([e.property({constructOnly:!0})],a.OverlayRenderer.prototype,"view",void 0);b.__decorate([e.property()],a.OverlayRenderer.prototype,"worldToPCSRatio",void 0);b.__decorate([e.property()],a.OverlayRenderer.prototype,"spatialReference",void 0);b.__decorate([e.property({type:Boolean,readOnly:!0})],a.OverlayRenderer.prototype,"updating",null); b.__decorate([e.property()],a.OverlayRenderer.prototype,"isEmpty",null);b.__decorate([e.property({readOnly:!0})],a.OverlayRenderer.prototype,"rendersOccludedDraped",null);a.OverlayRenderer=b.__decorate([t.subclass("esri.views.3d.terrain.OverlayRenderer")],a.OverlayRenderer);class U{constructor(ea,da,ia){this.drapeSource=ea;this.renderer=da;this.index=ia}}const Z=[[1,.5,.5],[.5,.5,1]],ca=I.RenderOccludedFlag.OccludeAndTransparent;a.drapedZ=-2;a.overlayRenderOccludedFlag=ca;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/interfaces":function(){define(["exports"],function(a){a.DrapeSourceType=void 0;(function(b){b[b.RasterImage=0]="RasterImage";b[b.Features=1]="Features"})(a.DrapeSourceType||(a.DrapeSourceType={}));a.DrapedRenderGroup=void 0;(function(b){b[b.MapLayer=0]="MapLayer";b[b.ViewLayer=1]="ViewLayer";b[b.Outline=2]="Outline";b[b.SnappingHint=3]="SnappingHint"})(a.DrapedRenderGroup||(a.DrapedRenderGroup={}));a.DrapeTargetType=void 0;(function(b){b[b.WithRasterImage= 0]="WithRasterImage";b[b.WithoutRasterImage=1]="WithoutRasterImage"})(a.DrapeTargetType||(a.DrapeTargetType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/interfaces":function(){define(["exports"],function(a){a.OverlayIndex=void 0;(function(b){b[b.INNER=0]="INNER";b[b.OUTER=1]="OUTER"})(a.OverlayIndex||(a.OverlayIndex={}));a.PatchType=void 0;(function(b){b[b.REGULAR=0]="REGULAR";b[b.HAS_NORTH_POLE=1]="HAS_NORTH_POLE";b[b.HAS_SOUTH_POLE=2]="HAS_SOUTH_POLE"; b[b.HAS_BOTH_POLES=3]="HAS_BOTH_POLES"})(a.PatchType||(a.PatchType={}));a.LODSnapping=void 0;(function(b){b[b.OFF=0]="OFF";b[b.ON=1]="ON"})(a.LODSnapping||(a.LODSnapping={}));a.TextureUpdate=void 0;(function(b){b[b.FADING=0]="FADING";b[b.IMMEDIATE=1]="IMMEDIATE";b[b.UNFADED=2]="UNFADED"})(a.TextureUpdate||(a.TextureUpdate={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/Overlay":function(){define(["exports","../../../geometry/support/aaBoundingRect","../webgl-engine/lib/LocalOriginFactory"], function(a,b,q){class l{constructor(){this._extent=b.create();this.resolution=0;this.renderLocalOrigin=q.fromValues(0,0,0,"O");this.mapUnitsPerPixel=this.pixelRatio=1;this.canvasGeometries=new p}get extent(){return this._extent}setupGeometryViewsCyclical(k){this.setupGeometryViewsDirect();var h=.001*k.range;if(this._extent[0]-h<=k.min){const f=this.canvasGeometries.extents[this.canvasGeometries.numViews++];b.offset(this._extent,k.range,0,f)}this._extent[2]+h>=k.max&&(h=this.canvasGeometries.extents[this.canvasGeometries.numViews++], b.offset(this._extent,-k.range,0,h))}setupGeometryViewsDirect(){this.canvasGeometries.numViews=1;b.copy(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let k=0;ke.valid?c|=1<= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y); } vec4 getOverlayColor(sampler2D ov0Tex, vec4 texCoords) { vec4 color0 = texture(ov0Tex, vec2(texCoords.x * 0.5, texCoords.y)); vec4 color1 = texture(ov0Tex, vec2(texCoords.z * 0.5 + 0.5, texCoords.w)); bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy)); bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0)); return mix(color1 * float(isValid1), color0, float(isValid0)); }`);A.code.add(t.glsl`vec4 getCombinedOverlayColor() { return overlayOpacity * getOverlayColor(ovColorTex, vtcOverlay); }`);A.code.add(t.glsl`vec4 getOverlayColorTexel(vec4 texCoords) { vec2 texDim = vec2(textureSize(ovColorTex, 0)); vec4 color0 = texelFetch(ovColorTex, ivec2(vec2(texCoords.x * 0.5, texCoords.y) * texDim), 0); vec4 color1 = texelFetch(ovColorTex, ivec2(vec2(texCoords.z * 0.5 + 0.5, texCoords.w) * texDim), 0); bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy)); bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0)); return mix(color1 * float(isValid1), color0, float(isValid0)); }`);if(y.pbrMode===c.PBRMode.Water||y.pbrMode===c.PBRMode.WaterOnIntegratedMesh||y.pbrMode===c.PBRMode.TerrainWithWater)f.addMainLightDirection(A),f.addMainLightIntensity(A),A.code.add(t.glsl`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir, float shadow, vec3 localUp, mat3 tbn, vec3 position, vec3 positionWorld) { vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0))); vec3 v = vposEyeDir; vec3 final = getSeaColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld); return vec4(final, colorInput.w); }`)}function r(x,y){return x.identifier===k.RenderPassIdentifier.Material&&x.output===h.ShaderOutput.Color?y.overlay?.getTexture(p.OverlayContent.ColorNoRasterImage):x.identifier===k.RenderPassIdentifier.Material&&x.output===h.ShaderOutput.ObjectAndLayerIdColor?y.overlay?.getTexture(p.OverlayContent.ObjectAndLayerIdColor):x.identifier===k.RenderPassIdentifier.Highlight?y.overlay?.getTexture(p.OverlayContent.Highlight):null}a.OverlayMode=void 0;(function(x){x[x.Disabled=0]="Disabled";x[x.Enabled=1]= "Enabled";x[x.EnabledWithWater=2]="EnabledWithWater";x[x.COUNT=3]="COUNT"})(a.OverlayMode||(a.OverlayMode={}));class n extends v.Uniform{constructor(x){super(x,"vec4")}}const u=b.create();a.OverlayIM=function(x,y){const {vertex:z,fragment:A}=x;z.uniforms.add(new g.Float4DrawUniform("overlayTexOffset",(B,C)=>{const D=C.overlay?.overlays[l.OverlayIndex.INNER]?.extent;q.hasArea(D)&&(u[0]=B.toMapSpace[0]/q.width(D)-D[0]/q.width(D),u[1]=B.toMapSpace[1]/q.height(D)-D[1]/q.height(D));C=C.overlay?.overlays[l.OverlayIndex.OUTER]?.extent; q.hasArea(C)&&(u[2]=B.toMapSpace[0]/q.width(C)-C[0]/q.width(C),u[3]=B.toMapSpace[1]/q.height(C)-C[1]/q.height(C));return u}),new g.Float4DrawUniform("overlayTexScale",(B,C)=>{const D=C.overlay?.overlays[l.OverlayIndex.INNER]?.extent;q.hasArea(D)&&(u[0]=B.toMapSpace[2]/q.width(D),u[1]=B.toMapSpace[3]/q.height(D));C=C.overlay?.overlays[l.OverlayIndex.OUTER]?.extent;q.hasArea(C)&&(u[2]=B.toMapSpace[2]/q.width(C),u[3]=B.toMapSpace[3]/q.height(C));return u}));A.constants.add("overlayOpacity","float",1); A.uniforms.add(new w.Texture2DPassUniform("ovColorTex",(B,C)=>r(B,C)));m(x,y)};a.OverlayTerrain=function(x,y){const {vertex:z,fragment:A}=x;z.uniforms.add(new n("overlayTexOffset"),new n("overlayTexScale"));A.uniforms.add(new d.FloatPassUniform("overlayOpacity",B=>B.overlayOpacity),new w.Texture2DPassUniform("ovColorTex",(B,C)=>C.overlay?.getTexture(B.overlayContent)));m(x,y)};a.getIMColorTexture=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/renderPasses/AllRenderPasses":function(){define(["exports", "../../../../../core/libs/gl-matrix-2/factories/vec3f64","../shaderLibrary/ShaderOutput","../shaderLibrary/attributes/VertexNormal.glsl"],function(a,b,q,l){class p extends l.VertexNormalPassParameters{constructor(){super(...arguments);this.origin=this.slicePlaneLocalOrigin=b.create();this.modelTransformation=null}}class k extends l.VertexNormalDrawParameters{}a.RenderPassIdentifier=void 0;(function(g){g[g.Material=0]="Material";g[g.ShadowMap=1]="ShadowMap";g[g.Highlight=2]="Highlight";g[g.ViewshedShadowMap= 3]="ViewshedShadowMap"})(a.RenderPassIdentifier||(a.RenderPassIdentifier={}));class h extends p{constructor(){super(...arguments);this.identifier=a.RenderPassIdentifier.Material;this.output=q.ShaderOutput.Color;this.transparent=!1}}class f extends p{constructor(){super(...arguments);this.identifier=a.RenderPassIdentifier.ShadowMap}}class c extends p{constructor(){super(...arguments);this.identifier=a.RenderPassIdentifier.Highlight}}class e extends p{constructor(){super(...arguments);this.identifier= a.RenderPassIdentifier.ViewshedShadowMap}}a.DrawParameters=k;a.HighlightPassParameters=c;a.MaterialPassParameters=h;a.PassParameters=p;a.ShadowMapPassParameters=f;a.ViewshedShadowMapPassParameters=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl":function(){define("exports ./FoamRendering.glsl ./Gamma.glsl ./PhysicallyBasedRendering.glsl ./ScreenSpaceConstants ./ScreenSpaceReflections.glsl ../util/CloudsParallaxShading.glsl ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix4PassUniform ../../shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){a.Water=function(d,t){d.include(l.PhysicallyBasedRenderingWater,t);d.include(q.Gamma);d.include(b.FoamColor);t.hasCloudsReflections&&d.include(h.CloudsParallaxShading,t);t.hasScreenSpaceReflections&&d.include(k.ScreenSpaceReflections,t);d=d.fragment;d.constants.add("fresnelSky","vec3",[.02,1,15]).add("fresnelMaterial","vec2",[.02,.1]).add("roughness","float",.015).add("foamIntensityExternal","float",1.7).add("ssrIntensity","float",.65).add("ssrHeightFadeStart","float", p.distanceFadeStart).add("ssrHeightFadeEnd","float",p.distanceFadeEnd).add("waterDiffusion","float",.92).add("waterSeaColorMod","float",.8).add("correctionViewingPowerFactor","float",.4).add("skyZenitColor","vec3",[.52,.68,.9]).add("skyColor","vec3",[.67,.79,.9]).add("cloudFresnelModifier","vec2",[1.2,.01]);d.code.add(c.glsl`PBRShadingWater shadingInfo; vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) { float exponent = pow((1.0 - cosTheta), fresnelSky[2]); return mix(zenit, horizon, exponent); }`);d.uniforms.add(new f.FloatPassUniform("lightingSpecularStrength",(w,v)=>v.lighting.mainLight.specularStrength),new f.FloatPassUniform("lightingEnvironmentStrength",(w,v)=>v.lighting.mainLight.environmentStrength));d.code.add(c.glsl`vec3 getSeaColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 viewPosition, vec3 position) { float reflectionHit = 0.0; float reflectionHitDiffused = 0.0; vec3 seaWaterColor = linearizeGamma(color); vec3 h = normalize(l + v); shadingInfo.NdotL = clamp(dot(n, l), 0.0, 1.0); shadingInfo.NdotV = clamp(dot(n, v), 0.001, 1.0); shadingInfo.VdotN = clamp(dot(v, n), 0.001, 1.0); shadingInfo.NdotH = clamp(dot(n, h), 0.0, 1.0); shadingInfo.VdotH = clamp(dot(v, h), 0.0, 1.0); shadingInfo.LdotH = clamp(dot(l, h), 0.0, 1.0); float upDotV = max(dot(localUp,v), 0.0); vec3 skyHorizon = linearizeGamma(skyColor); vec3 skyZenit = linearizeGamma(skyZenitColor); vec3 skyColor = getSkyGradientColor(upDotV, skyHorizon, skyZenit ); float upDotL = max(dot(localUp,l),0.0); float daytimeMod = 0.1 + upDotL * 0.9; skyColor *= daytimeMod; float shadowModifier = clamp(shadow, 0.8, 1.0); vec3 fresnelModifier = fresnelReflection(shadingInfo.VdotN, vec3(fresnelSky[0]), fresnelSky[1]); vec3 reflSky = lightingEnvironmentStrength * fresnelModifier * skyColor * shadowModifier; vec3 reflSea = seaWaterColor * mix(skyColor, upDotL * lightIntensity * LIGHT_NORMALIZATION, 2.0 / 3.0) * shadowModifier; vec3 specular = vec3(0.0); if(upDotV > 0.0 && upDotL > 0.0) { vec3 specularSun = brdfSpecularWater(shadingInfo, roughness, vec3(fresnelMaterial[0]), fresnelMaterial[1]); vec3 incidentLight = lightIntensity * LIGHT_NORMALIZATION * shadow; specular = lightingSpecularStrength * shadingInfo.NdotL * incidentLight * specularSun; } vec3 foam = vec3(0.0); if(upDotV > 0.0) { foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitColor, daytimeMod); } float correctionViewingFactor = pow(max(dot(v, localUp), 0.0), correctionViewingPowerFactor); vec3 normalCorrectedClouds = mix(localUp, n, correctionViewingFactor); vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`);t.hasCloudsReflections&&d.code.add(c.glsl`vec4 cloudsColor = renderClouds(reflectedWorld, position); cloudsColor.a = 1.0 - cloudsColor.a; cloudsColor = pow(cloudsColor, vec4(GAMMA)); cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * clamp((1.0 - totalFadeInOut), 0.0, 1.0);`);t.hasScreenSpaceReflections?(d.uniforms.add(new e.Matrix4PassUniform("view",(w,v)=>v.camera.viewMatrix),new g.Texture2DPassUniform("lastFrameColorTexture",(w,v)=>v.ssr.lastFrameColor?.getTexture()),new f.FloatPassUniform("fadeFactorSSR",(w,v)=>v.ssr.fadeFactor)),d.code.add(c.glsl`vec3 viewDir = normalize(viewPosition); vec4 viewNormalVectorCoordinate = view *vec4(n, 0.0); vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz); vec4 viewUp = view * vec4(localUp, 0.0); vec3 viewNormalCorrectedSSR = mix(viewUp.xyz, viewNormal, correctionViewingFactor); vec3 reflected = normalize(reflect(viewDir, viewNormalCorrectedSSR)); vec3 hitCoordinate = screenSpaceIntersection(reflected, viewPosition, viewDir, viewUp.xyz); vec3 reflectedColor = vec3(0.0); if (hitCoordinate.z > 0.0) { vec2 reprojectedCoordinate = reprojectionCoordinate(hitCoordinate); vec2 dCoords = smoothstep(0.3, 0.6, abs(vec2(0.5, 0.5) - hitCoordinate.xy)); float heightMod = smoothstep(ssrHeightFadeEnd, ssrHeightFadeStart, -viewPosition.z); reflectionHit = clamp(1.0 - (1.3 * dCoords.y), 0.0, 1.0) * heightMod * fadeFactorSSR; reflectionHitDiffused = waterDiffusion * reflectionHit; reflectedColor = linearizeGamma(texture(lastFrameColorTexture, reprojectedCoordinate).xyz) * reflectionHitDiffused * fresnelModifier.y * ssrIntensity; } float seaColorMod = mix(waterSeaColorMod, waterSeaColorMod * 0.5, reflectionHitDiffused); vec3 waterRenderedColor = tonemapACES((1.0 - reflectionHitDiffused) * reflSky + reflectedColor + reflSea * seaColorMod + specular + foam);`)):d.code.add(c.glsl`vec3 waterRenderedColor = tonemapACES(reflSky + reflSea * waterSeaColorMod + specular + foam);`);t.hasCloudsReflections?t.hasScreenSpaceReflections?d.code.add(c.glsl`return waterRenderedColor * (1.0 - (1.0 - reflectionHit) * cloudsColor.a) + (1.0 - reflectionHit) * cloudsColor.xyz; }`):d.code.add(c.glsl`return waterRenderedColor * (1.0 - cloudsColor.a) + cloudsColor.xyz; }`):d.code.add(c.glsl`return waterRenderedColor; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/FoamRendering.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.FoamColor=function(q){q.fragment.code.add(b.glsl`vec3 foamIntensity2FoamColor(float foamIntensityExternal, float foamPixelIntensity, vec3 skyZenitColor, float dayMod){ return foamIntensityExternal * (0.075 * skyZenitColor * pow(foamPixelIntensity, 4.) + 50.* pow(foamPixelIntensity, 23.0)) * dayMod; }`)};a.FoamIntensity=function(q){q.fragment.code.add(b.glsl`float normals2FoamIntensity(vec3 n, float waveStrength){ float normalizationFactor = max(0.015, waveStrength); return max((n.x + n.y)*0.3303545/normalizationFactor + 0.3303545, 0.0); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl":function(){define("exports ../output/ReadDepth.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix4PassUniform ../../shaderModules/Texture2DPassUniform".split(" "),function(a,b,q,l,p,k,h){a.ScreenSpaceReflections=function(f,c){f=f.fragment;f.include(b.ReadDepth); f.uniforms.add(new q.Float2PassUniform("nearFar",(e,g)=>g.camera.nearFar));f.uniforms.add(new h.Texture2DPassUniform("depthMap",(e,g)=>g.depth?.attachment));f.uniforms.add(new k.Matrix4PassUniform("proj",(e,g)=>g.camera.projectionMatrix));f.uniforms.add(new l.FloatPassUniform("invResolutionHeight",(e,g)=>1/g.camera.height));f.uniforms.add(new k.Matrix4PassUniform("reprojectionMatrix",(e,g)=>g.ssr.reprojectionMatrix));f.code.add(p.glsl` vec2 reprojectionCoordinate(vec3 projectionCoordinate) { vec4 zw = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0); vec4 reprojectedCoord = reprojectionMatrix * vec4(zw.w * (projectionCoordinate.xy * 2.0 - 1.0), zw.z, zw.w); reprojectedCoord.xy /= reprojectedCoord.w; return reprojectedCoord.xy * 0.5 + 0.5; } const int maxSteps = ${c.highStepCount?"150":"75"}; vec4 applyProjectionMat(mat4 projectionMat, vec3 x) { vec4 projectedCoord = projectionMat * vec4(x, 1.0); projectedCoord.xy /= projectedCoord.w; projectedCoord.xy = projectedCoord.xy*0.5 + 0.5; return projectedCoord; } vec3 screenSpaceIntersection(vec3 dir, vec3 startPosition, vec3 viewDir, vec3 normal) { vec3 viewPos = startPosition; vec3 viewPosEnd = startPosition; // Project the start position to the screen vec4 projectedCoordStart = applyProjectionMat(proj, viewPos); vec3 Q0 = viewPos / projectedCoordStart.w; // homogeneous camera space float k0 = 1.0/ projectedCoordStart.w; // advance the position in the direction of the reflection viewPos += dir; vec4 projectedCoordVanishingPoint = applyProjectionMat(proj, dir); // Project the advanced position to the screen vec4 projectedCoordEnd = applyProjectionMat(proj, viewPos); vec3 Q1 = viewPos / projectedCoordEnd.w; // homogeneous camera space float k1 = 1.0/ projectedCoordEnd.w; // calculate the reflection direction in the screen space vec2 projectedCoordDir = (projectedCoordEnd.xy - projectedCoordStart.xy); vec2 projectedCoordDistVanishingPoint = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy); float yMod = min(abs(projectedCoordDistVanishingPoint.y), 1.0); float projectedCoordDirLength = length(projectedCoordDir); float maxSt = float(maxSteps); // normalize the projection direction depending on maximum steps // this determines how blocky the reflection looks vec2 dP = yMod * (projectedCoordDir)/(maxSt * projectedCoordDirLength); // Normalize the homogeneous camera space coordinates vec3 dQ = yMod * (Q1 - Q0)/(maxSt * projectedCoordDirLength); float dk = yMod * (k1 - k0)/(maxSt * projectedCoordDirLength); // initialize the variables for ray marching vec2 P = projectedCoordStart.xy; vec3 Q = Q0; float k = k0; float rayStartZ = -startPosition.z; // estimated ray start depth value float rayEndZ = -startPosition.z; // estimated ray end depth value float prevEstimateZ = -startPosition.z; float rayDiffZ = 0.0; float dDepth; float depth; float rayDiffZOld = 0.0; // early outs if (dot(normal, dir) < 0.0 || dot(-viewDir, normal) < 0.0) return vec3(P, 0.0); for(int i = 0; i < maxSteps-1; i++) { depth = -linearDepthFromTexture(depthMap, P); // get linear depth from the depth buffer // estimate depth of the marching ray rayStartZ = prevEstimateZ; dDepth = -rayStartZ - depth; rayEndZ = (dQ.z * 0.5 + Q.z)/ ((dk * 0.5 + k)); rayDiffZ = rayEndZ- rayStartZ; prevEstimateZ = rayEndZ; if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || P.y < 0.0 || P.y > 1.0 ) { return vec3(P, 0.); } // If we detect a hit - return the intersection point, two conditions: // - dDepth > 0.0 - sampled point depth is in front of estimated depth // - if difference between dDepth and rayDiffZOld is not too large // - if difference between dDepth and 0.025/abs(k) is not too large // - if the sampled depth is not behind far plane or in front of near plane if((dDepth) < 0.025/abs(k) + abs(rayDiffZ) && dDepth > 0.0 && depth > nearFar[0] && depth < nearFar[1] && abs(P.y - projectedCoordStart.y) > invResolutionHeight) { return vec3(P, depth); } // continue with ray marching P = clamp(P + dP, vec2(0.0), vec2(0.999)); Q.z += dQ.z; k += dk; rayDiffZOld = rayDiffZ; } return vec3(P, 0.0); } `)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/TextureOnly.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),function(a,b, q,l,p,k,h){function f(){const g=new k.ShaderBuilder;g.include(q.ScreenSpacePass);g.fragment.uniforms.add(new h.Texture2DPassUniform("tex",d=>d.texture),new l.Float3PassUniform("uColor",d=>d.color));g.fragment.code.add(p.glsl`void main() { vec4 texColor = texture(tex, uv); fragColor = texColor * vec4(uColor, 1.0); }`);return g}class c extends p.NoParameters{constructor(){super(...arguments);this.color=b.fromValues(1,1,1)}}const e=Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:c,build:f},Symbol.toStringTag,{value:"Module"}));a.TextureOnly=e;a.TextureOnlyPassParameters=c;a.build=f})},"esri/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository":function(){define(["exports","../../../../../core/NestedMap","./ShaderTechniqueConfiguration"],function(a,b,q){class l{constructor(h){this._context= h;this._perConstructorInstances=new b.NestedMap;this._frameCounter=0;this._keepAliveFrameCount=-1}get viewingMode(){return this._context.viewingMode}get constructionContext(){return this._context}destroy(){this._perConstructorInstances.forEach(h=>h.forEach(f=>f.technique.destroy()));this._perConstructorInstances.clear()}acquire(h,f=k){const c=f.key;let e=this._perConstructorInstances.get(h,c);if(null==e){const g=new h(this._context,f,()=>this.release(g));e=new p(g);this._perConstructorInstances.set(h, c,e)}++e.refCount;return e.technique}releaseAndAcquire(h,f,c){if(null!=c){if(f.key===c.key)return c;this.release(c)}return this.acquire(h,f)}release(h){null==h||this._perConstructorInstances.empty||(h=this._perConstructorInstances.get(h.constructor,h.key),null!=h&&(--h.refCount,0===h.refCount&&(h.refZeroFrame=this._frameCounter)))}frameUpdate(){this._frameCounter++;-1!==this._keepAliveFrameCount&&this._perConstructorInstances.forEach((h,f)=>{h.forEach((c,e)=>{0===c.refCount&&c.refZeroFrame+this._keepAliveFrameCount< this._frameCounter&&(c.technique.destroy(),this._perConstructorInstances.delete(f,e))})})}async reloadAll(){const h=[];this._perConstructorInstances.forEach((f,c)=>{h.push((async(e,g)=>{if(g=g.shader)await g.reload(),e.forEach(d=>d.technique.reload(this._context))})(f,c))});await Promise.all(h)}}class p{constructor(h){this.technique=h;this.refZeroFrame=this.refCount=0}}const k=new q.ShaderTechniqueConfiguration;a.ShaderTechniqueRepository=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/lib/GLMaterialRepository":function(){define(["exports","../../../../core/Logger","../../../../core/maybe","../../../../core/NestedMap","./Util"],function(a,b,q,l,p){class k{constructor(f,c,e,g){this._textures=f;this._techniques=c;this.materialChanged=e;this.requestRender=g;this._id2glMaterialRef=new l.NestedMap}dispose(){this._textures.destroy()}acquire(f,c,e){this._ownMaterial(f);if(!f.produces.get(c)?.(e))return null;c=this._id2glMaterialRef.get(e,f.id);null==c&&(c=f.createGLMaterial({material:f, techniques:this._techniques,textures:this._textures,output:e}),c=new h(c),this._id2glMaterialRef.set(e,f.id,c));c.ref();return c.glMaterial}release(f,c){const e=this._id2glMaterialRef.get(c,f.id);null!=e&&(e.unref(),e.referenced||(q.disposeMaybe(e.glMaterial),this._id2glMaterialRef.delete(c,f.id)))}_ownMaterial(f){f.repository&&f.repository!==this&&b.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository");f.repository= this}}class h{constructor(f){this.glMaterial=f;this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt;p.assert(0<=this._refCnt)}get referenced(){return 0d.handleEvent(v,m)))}destroy(){this._handles.size&&(this._handles.destroy(), this.stage.remove(this),this.invalidateSpatialQueryAccelerator())}add(d){this._objects.push(d);d.parentLayer=this;this.events.emit("layerObjectAdded",{layer:this,object:d});null!=this._octree&&this._objectsAdded.push(d)}remove(d){this._objects.removeUnordered(d)&&(d.parentLayer=null,this.events.emit("layerObjectRemoved",{layer:this,object:d}),null!=this._octree&&(this._objectsAdded.removeUnordered(d)||this._octree.remove([d])))}addMany(d){this._objects.pushArray(d);for(const t of d)t.parentLayer= this;this.events.emit("layerObjectsAdded",{layer:this,objects:d});null!=this._octree&&this._objectsAdded.pushArray(d)}removeMany(d){const t=[];this._objects.removeUnorderedMany(d,d.length,t);if(0!==t.length){for(const w of t)w.parentLayer=null;this.events.emit("layerObjectsRemoved",{layer:this,objects:t});if(null!=this._octree){for(d=0;dd.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.data,this._objects.length)):null!=this._octree&&0{I.push(V.node);I.push(T)})?S.node.terminals:S.node.residents;W.removeUnordered(Q);if(0===W.length)for(Q=I.length- 2;0<=Q&&d(I.data[Q],I.data[Q+1]);Q-=2);}function d(Q,W){0<=W&&(Q.children[W]=null);return v(Q)?(null===Q.residents&&(Q.residents=new b({shrink:!0})),!0):!1}function t(Q,W){m(h.getCenter(W.bounds),2*-W.halfSize,E);m(h.getCenter(W.bounds),2*W.halfSize,G);return f.rayBoxTest(Q.origin,Q.direction,E,G)}function w(Q,W,S){m(h.getCenter(W.bounds),2*-W.halfSize,E);m(h.getCenter(W.bounds),2*W.halfSize,G);S.applyToMinMax(E,G);return f.rayBoxTest(Q.origin,Q.direction,E,G)}function v(Q){if(0!==Q.terminals.length)return!1; if(null!==Q.residents)return 0===Q.residents.length;for(let W=0;WV;++V)J.push({index:0,distance:0});for(V=0;8>V;++V){const T=B[V];J.data[V].index=V;J.data[V].distance=x(Q,W,T)}J.sort((T,Y)=>T.distance-Y.distance);for(Q=0;8>Q;++Q)S[Q]=J.data[Q].index}function u(Q,W){let S=Infinity,V;for(let T=0;8>T;++T){const Y=x(Q,W,C[T]);Y{if(!t(V,T))return!1;T=T.node;T.terminals.forAll(Y=>{this._intersectsObject(V,Y)&&S(Y)});null!==T.residents&&T.residents.forAll(Y=>{this._intersectsObject(V,Y)&&S(Y)}); return!0})}forEachAlongRayWithVerticalOffset(Q,W,S,V){const T=k.wrap(Q,W);c(this._root,Y=>{if(!w(T,Y,V))return!1;Y=Y.node;Y.terminals.forAll(ha=>{this._intersectsObjectWithOffset(T,ha,V)&&S(ha)});null!==Y.residents&&Y.residents.forAll(ha=>{this._intersectsObjectWithOffset(T,ha,V)&&S(ha)});return!0})}forEach(Q){c(this._root,W=>{W=W.node;W.terminals.forAll(Q);null!==W.residents&&W.residents.forAll(Q);return!0});this._degenerateObjects.forEach(Q)}forEachDegenerateObject(Q){this._degenerateObjects.forEach(Q)}findClosest(Q, W,S,V=()=>!0,T=Infinity){let Y=Infinity,ha=Infinity,ba=null;const U=u(Q,W),Z=ca=>{--T;if(V(ca)){var ea=this.objectToBoundingSphere(ca);if(p.intersectsSphere(S,ea)){var da=x(Q,W,h.getCenter(ea)),ia=da-ea[3];ea=da+ea[3];ia{if(0>=T||!p.intersectsSphere(S,ca.bounds))return!1;q.scale(N,U,ca.halfSize);q.add(N,N,h.getCenter(ca.bounds));if(x(Q,W,N)>ha)return!1;ca=ca.node;ca.terminals.forAll(ea=>Z(ea));null!==ca.residents&&ca.residents.forAll(ea=>Z(ea));return!0}, Q,W);return ba}forEachInDepthRange(Q,W,S,V,T,Y,ha){let ba=-Infinity,U=Infinity;const Z={setRange:ka=>{S===z.DepthOrder.FRONT_TO_BACK?(ba=Math.max(ba,ka.near),U=Math.min(U,ka.far)):(ba=Math.max(ba,-ka.far),U=Math.min(U,-ka.near))}};Z.setRange(V);const ca=x(W,S,Q),ea=u(W,S),da=u(W,-S),ia=ka=>{if(ha(ka)){var fa=this.objectToBoundingSphere(ka),X=h.getCenter(fa);X=x(W,S,X)-ca;var ja=X+fa[3];X-fa[3]>U||ja{if(!p.intersectsSphere(Y,ka.bounds))return!1; q.scale(N,ea,ka.halfSize);q.add(N,N,h.getCenter(ka.bounds));if(x(W,S,N)-ca>U)return!1;q.scale(N,da,ka.halfSize);q.add(N,N,h.getCenter(ka.bounds));if(x(W,S,N)-caia(fa));null!==ka.residents&&ka.residents.forAll(fa=>ia(fa));return!0},W,S)}forEachNode(Q){c(this._root,W=>Q(W.node,W.bounds,W.halfSize,W.depth))}forEachNeighbor(Q,W){const S=h.getRadius(W),V=h.getCenter(W),T=ba=>{const U=this.objectToBoundingSphere(ba);var Z=h.getRadius(U);Z=S+Z;return 0>=q.squaredDistance(h.getCenter(U), V)-Z*Z?Q(ba):!0};let Y=!0;const ha=ba=>{Y&&=T(ba)};c(this._root,ba=>{var U=h.getRadius(ba.bounds);U=S+U;if(0this._maximumObjectsPerNode&&W.depththis.objectToBoundingSphere(S),L),y(L[3])&&!this._fitsInsideTree(L)&&(v(this._root.node)?(h.copy(L,this._root.bounds), this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize()):(Q=this._rootBoundsForRootAsSubNode(L),this._placingRootViolatesMaxDepth(Q)?this._rebuildTree(L,Q):this._growRootAsSubNode(Q),A.release(Q))))}_rebuildTree(Q,W){q.copy(h.getCenter(P),h.getCenter(W.bounds));P[3]=W.halfSize;r([Q,P],2,S=>S,M);Q=A.acquire().init(this._root);this._root.initFrom(null,M,M[3]);this._root.increaseHalfSize(1.25);c(Q,S=>{this.add(S.node.terminals.data,S.node.terminals.length);null!==S.node.residents&& this.add(S.node.residents.data,S.node.residents.length);return!0});A.release(Q)}_placingRootViolatesMaxDepth(Q){const W=Math.log(Q.halfSize/this._root.halfSize)*Math.LOG2E;let S=0;c(this._root,V=>{S=Math.max(S,V.depth);return S+W<=this._maximumDepth});return S+W>this._maximumDepth}_rootBoundsForRootAsSubNode(Q){var W=Q[3],S=-Infinity;const V=this._root.bounds,T=this._root.halfSize;for(var Y=0;3>Y;Y++){var ha=Math.max(0,Math.ceil((V[Y]-T-(Q[Y]-W))/(2*T)));const ba=Math.max(0,Math.ceil((Q[Y]+W-(V[Y]+ T))/(2*T)))+1;S=Math.max(S,2**Math.ceil(Math.log(ha+ba)*Math.LOG2E));K[Y].min=ha;K[Y].max=ba}for(Q=0;3>Q;Q++)W=K[Q].min,Y=K[Q].max,ha=(S-(W+Y))/2,W+=Math.ceil(ha),Y+=Math.floor(ha),H[Q]=V[Q]-T-W*T*2+(Y+W)*T;S*=T;H[3]=S*D;return A.acquire().initFrom(null,H,S,0)}_growRootAsSubNode(Q){const W=this._root.node;q.copy(h.getCenter(L),h.getCenter(this._root.bounds));L[3]=this._root.halfSize;this._root.init(Q);Q.advanceTo(L,null,!0);Q.node.children=W.children;Q.node.residents=W.residents;Q.node.terminals= W.terminals}_shrink(){for(;;){const Q=this._findShrinkIndex();if(-1===Q)break;this._root.advance(Q);this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let Q=null;const W=this._root.node.children;let S=0,V=0;for(;V= W[0]-S&&Q[0]<=W[0]+S&&Q[1]>=W[1]-S&&Q[1]<=W[1]+S&&Q[2]>=W[2]-S&&Q[2]<=W[2]+S}toJSON(){const {maximumDepth:Q,maximumObjectsPerNode:W,_objectCount:S}=this,V=this._nodeToJSON(this._root.node);return{maximumDepth:Q,maximumObjectsPerNode:W,objectCount:S,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:V}}}_nodeToJSON(Q){const W=Q.children.map(V=>V?this._nodeToJSON(V):null),S=Q.residents?.map(V=>this.objectToBoundingSphere(V));Q=Q.terminals?.map(V=>this.objectToBoundingSphere(V)); return{children:W,residents:S,terminals:Q}}static fromJSON(Q){const W=new z(S=>S,{maximumDepth:Q.maximumDepth,maximumObjectsPerNode:Q.maximumObjectsPerNode});W._objectCount=Q.objectCount;W._root.initFrom(Q.root.node,Q.root.bounds,Q.root.halfSize,Q.root.depth);return W}}class A{constructor(){this.bounds=h.create();this.halfSize=0;this.initFrom(null,null,0,0)}init(Q){return this.initFrom(Q.node,Q.bounds,Q.halfSize,Q.depth)}initFrom(Q,W,S,V=this.depth){this.node=null!=Q?Q:A.createEmptyNode();W&&h.copy(W, this.bounds);this.halfSize=S;this.depth=V;return this}increaseHalfSize(Q){this.halfSize*=Q;this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*D}advance(Q){let W=this.node.children[Q];W||(W=A.createEmptyNode(),this.node.children[Q]=W);this.node=W;this.halfSize/=2;this.depth++;Q=B[Q];this.bounds[0]+=Q[0]*this.halfSize;this.bounds[1]+=Q[1]*this.halfSize;this.bounds[2]+=Q[2]*this.halfSize;this.updateBoundsRadiusFromHalfSize();return this}advanceTo(Q,W, S=!1){for(;;){if(this.isTerminalFor(Q))return W&&W(this,-1),!0;if(this.isLeaf()){if(!S)return W&&W(this,-1),!1;this.node.residents=null}const V=this._childIndex(Q);W&&W(this,V);this.advance(V)}}isLeaf(){return null!=this.node.residents}isTerminalFor(Q){return Q[3]>this.halfSize/2}_childIndex(Q){const W=this.bounds;return(W[0]da===w.ShaderOutput.Highlight||da===w.ShaderOutput.ObjectAndLayerIdColor||da===w.ShaderOutput.Color&&this.parameters.renderOccluded===m.RenderOccludedFlag.OccludeAndTransparentStencil],[r.RenderSlot.OPAQUE_NO_SSAO_DEPTH,da=>w.isDepth(da)],[r.RenderSlot.OCCLUDER_MATERIAL,da=>w.isColorHighlightOIDOrDepth(da)&&this.parameters.renderOccluded===m.RenderOccludedFlag.OccludeAndTransparentStencil], [r.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL,da=>w.isColorHighlightOIDOrDepth(da)&&this.parameters.renderOccluded===m.RenderOccludedFlag.OccludeAndTransparentStencil],[r.RenderSlot.TRANSPARENT_MATERIAL,da=>da===w.ShaderOutput.Color&&this.parameters.writeDepth&&this.parameters.renderOccluded!==m.RenderOccludedFlag.OccludeAndTransparentStencil],[r.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,da=>da===w.ShaderOutput.Color&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==m.RenderOccludedFlag.OccludeAndTransparentStencil], [r.RenderSlot.DRAPED_MATERIAL,da=>w.is2DGeometryOutput(da)]]);this._vertexAttributeLocations=A.vertexAttributeLocations}getConfiguration(ea,da){this._configuration.output=ea;this._configuration.draped=da.slot===r.RenderSlot.DRAPED_MATERIAL;ea=null!=this.parameters.stipplePattern&&ea!==w.ShaderOutput.Highlight;this._configuration.stippleEnabled=ea;this._configuration.stippleOffColorEnabled=ea&&null!=this.parameters.stippleOffColor;this._configuration.stipplePreferContinuous=ea&&this.parameters.stipplePreferContinuous; this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.hasOccludees=this.parameters.hasOccludees;this._configuration.roundJoins="round"===this.parameters.join;this._configuration.capType=this.parameters.cap;ea=this._configuration;if(null!=this.parameters.markerParameters){var ia=this.parameters.markerParameters;ia=ia.anchor===y.LineMarkerAnchor.Tip&&ia.hideOnShortSegments&&"begin-end"===ia.placement&&ia.worldSpace}else ia=!1;ea.applyMarkerOffset=ia;this._configuration.hasPolygonOffset= this.parameters.hasPolygonOffset;this._configuration.writeDepth=this.parameters.writeDepth;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.vvOpacity=!!this.parameters.vvOpacity;this._configuration.innerColorEnabled=0ea;ea++)if(!la.unprojectFromRenderScreen(Y[ea],ha[ea]))return;d.fromPoints(la.eye,ha[0],ha[1],ba);d.fromPoints(la.eye,ha[1],ha[2],U);d.fromPoints(la.eye,ha[2],ha[3],Z);d.fromPoints(la.eye,ha[3],ha[0],ca);var va=Number.MAX_VALUE;ea=0;ja=this.parameters.isClosed&&2d.signedDistance(ba,G)&&0>d.signedDistance(ba,I)||0>d.signedDistance(U,G)&&0>d.signedDistance(U,I)||0>d.signedDistance(Z,G)&&0>d.signedDistance(Z,I)||0>d.signedDistance(ca,G)&&0>d.signedDistance(ca,I))){la.projectToRenderScreen(G,M);la.projectToRenderScreen(I,K);if(0>M[2]&&0K[2])h.subtract(O,I,G),za=la.frustum,za=-d.signedDistance(za[e.PlaneIndex.NEAR],I)/h.dot(O,d.getNormal(za[e.PlaneIndex.NEAR])),h.scale(O,O,za),h.add(I,I,O),la.projectToRenderScreen(I,K);else if(0>M[2]&&0>K[2])continue;M[2]=0;K[2]=0;za=g.distance2(g.fromPoints(M,K,Q),na);zaNa=za[qa]: (Sa,Ya,qa)=>Na+=h.distance(Sa,Ya),wa=b("enable-feature:objectAndLayerId-rendering"),sa=(Sa,Ya,qa,aa,Ja,Ta,Ra)=>{Qa[ua++]=Ya[0];Qa[ua++]=Ya[1];Qa[ua++]=Ya[2];Qa[ua++]=Sa[0];Qa[ua++]=Sa[1];Qa[ua++]=Sa[2];Qa[ua++]=qa[0];Qa[ua++]=qa[1];Qa[ua++]=qa[2];Qa[ua++]=aa;Qa[ua++]=Ra;Qa[ua++]=Ja;Qa[ua++]=ya;xa?Qa[ua++]=ra:(Sa=Math.min(4*Ta,Da.length-4),Qa[ua++]=Da[Sa],Qa[ua++]=Da[Sa+1],Qa[ua++]=Da[Sa+2],Qa[ua++]=Da[Sa+3]);Ga&&(Qa[ua++]=Pa);wa&&(null!=Ma&&(Ea[4*ua]=Ma[0],Ea[4*ua+1]=Ma[1],Ea[4*ua+2]=Ma[2],Ea[4*ua+ 3]=Ma[3]),ua++)};ua+=na;h.set(X,la.data[0],la.data[1],la.data[2]);ea&&h.transformMat4(X,X,ea);if(ia=this._isClosed(ia)){var Ha=la.data.length-3;h.set(da,la.data[Ha],la.data[Ha+1],la.data[Ha+2]);ea&&h.transformMat4(da,da,ea)}else h.set(ja,la.data[3],la.data[4],la.data[5]),ea&&h.transformMat4(ja,ja,ea),sa(X,X,ja,1,D.LEFT_CAP_START,0,0),sa(X,X,ja,1,D.RIGHT_CAP_START,0,0),h.copy(da,X),h.copy(X,ja);Ha=ia?0:1;const Ka=ia?va:va-1;for(let Sa=Ha;SaJ.markerScale)),D.include(h.MarkerSizing,{space:y.LineMarkerSpace.World,draped:!1}));D.include(l.ObjectAndLayerIdColor,C);d.addProjViewLocalOrigin(E,C);E.uniforms.add(new r.Matrix4PassUniform("inverseProjectionMatrix", (J,R)=>R.camera.inverseProjectionMatrix),new t.Float2PassUniform("nearFar",(J,R)=>R.camera.nearFar),new v.FloatPassUniform("miterLimit",J=>"miter"!==J.join?0:J.miterLimit),new w.Float4PassUniform("viewport",(J,R)=>R.camera.fullViewport));E.constants.add("LARGE_HALF_FLOAT","float",65500);F.add(x.VertexAttribute.POSITION,"vec3");F.add(x.VertexAttribute.PREVPOSITION,"vec3");F.add(x.VertexAttribute.NEXTPOSITION,"vec3");F.add(x.VertexAttribute.SUBDIVISIONFACTOR,"float");F.add(x.VertexAttribute.UV0,"vec2"); H.add("vColor","vec4");H.add("vpos","vec3");H.add("vLineDistance","float");H.add("vLineWidth","float");const O=C.multipassEnabled&&C.output===b.ShaderOutput.Color;O&&H.add("depth","float");const L=C.stippleEnabled;L&&H.add("vLineSizeInv","float");N.add("aaWidth","float",C.stippleEnabled?0:1);const P=C.capType===z.CapType.ROUND,M=C.stippleEnabled&&P,K=C.falloffEnabled||M;K&&H.add("vLineDistanceNorm","float");P&&(H.add("vSegmentSDF","float"),H.add("vReverseSegmentSDF","float"));E.code.add(m.glsl`#define PERPENDICULAR(v) vec2(v.y, -v.x); float interp(float ncp, vec4 a, vec4 b) { return (-ncp - a.z) / (b.z - a.z); } vec2 rotate(vec2 v, float a) { float s = sin(a); float c = cos(a); mat2 m = mat2(c, -s, s, c); return m * v; }`);E.code.add(m.glsl`vec4 projectAndScale(vec4 pos) { vec4 posNdc = proj * pos; posNdc.xy *= viewport.zw / posNdc.w; return posNdc; }`);E.code.add(m.glsl` void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next, in bool isStartVertex) { float vnp = nearFar[0] * 0.99; if(pos.z > -nearFar[0]) { //current pos behind ncp --> we need to clip if (!isStartVertex) { if(prev.z < -nearFar[0]) { //previous in front of ncp pos = mix(prev, pos, interp(vnp, prev, pos)); next = pos; } else { pos = vec4(0.0, 0.0, 0.0, 1.0); } } else { if(next.z < -nearFar[0]) { //next in front of ncp pos = mix(pos, next, interp(vnp, pos, next)); prev = pos; } else { pos = vec4(0.0, 0.0, 0.0, 1.0); } } } else { //current position visible if (prev.z > -nearFar[0]) { //previous behind ncp prev = mix(pos, prev, interp(vnp, pos, prev)); } if (next.z > -nearFar[0]) { //next behind ncp next = mix(next, pos, interp(vnp, next, pos)); } } ${O?"depth \x3d pos.z;":""} pos = projectAndScale(pos); next = projectAndScale(next); prev = projectAndScale(prev); } `);d.addPixelRatio(E);E.code.add(m.glsl` void main(void) { // unpack values from uv0.y bool isStartVertex = abs(abs(uv0.y)-3.0) == 1.0; float coverage = 1.0; // Check for special value of uv0.y which is used by the Renderer when graphics // are removed before the VBO is recompacted. If this is the case, then we just // project outside of clip space. if (uv0.y == 0.0) { // Project out of clip space gl_Position = vec4(1e038, 1e038, 1e038, 1.0); } else { bool isJoin = abs(uv0.y) < 3.0; float lineSize = getSize(); if (lineSize < 1.0) { coverage = lineSize; // convert sub-pixel coverage to alpha lineSize = 1.0; } lineSize += aaWidth; float lineWidth = lineSize * pixelRatio; vLineWidth = lineWidth; ${L?m.glsl`vLineSizeInv = 1.0 / lineSize;`:""} vec4 pos = view * vec4(position, 1.0); vec4 prev = view * vec4(prevPosition, 1.0); vec4 next = view * vec4(nextPosition, 1.0); `);I&&E.code.add(m.glsl`vec4 other = isStartVertex ? next : prev; bool markersHidden = areWorldMarkersHidden(pos, other); if(!isJoin && !markersHidden) { pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos) * 0.5; }`);E.code.add(m.glsl`clipAndTransform(pos, prev, next, isStartVertex); vec2 left = (pos.xy - prev.xy); vec2 right = (next.xy - pos.xy); float leftLen = length(left); float rightLen = length(right);`);(C.stippleEnabled||P)&&E.code.add(m.glsl` float isEndVertex = float(!isStartVertex); vec2 segmentOrigin = mix(pos.xy, prev.xy, isEndVertex); vec2 segment = mix(right, left, isEndVertex); ${P?m.glsl`vec2 segmentEnd = mix(next.xy, pos.xy, isEndVertex);`:""} `);E.code.add(m.glsl`left = (leftLen > 0.001) ? left/leftLen : vec2(0.0, 0.0); right = (rightLen > 0.001) ? right/rightLen : vec2(0.0, 0.0); vec2 capDisplacementDir = vec2(0, 0); vec2 joinDisplacementDir = vec2(0, 0); float displacementLen = lineWidth; if (isJoin) { bool isOutside = (left.x * right.y - left.y * right.x) * uv0.y > 0.0; joinDisplacementDir = normalize(left + right); joinDisplacementDir = PERPENDICULAR(joinDisplacementDir); if (leftLen > 0.001 && rightLen > 0.001) { float nDotSeg = dot(joinDisplacementDir, left); displacementLen /= length(nDotSeg * left - joinDisplacementDir); if (!isOutside) { displacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg)); } } if (isOutside && (displacementLen > miterLimit * lineWidth)) {`);C.roundJoins?E.code.add(m.glsl` vec2 startDir = leftLen < 0.001 ? right : left; startDir = PERPENDICULAR(startDir); vec2 endDir = rightLen < 0.001 ? left : right; endDir = PERPENDICULAR(endDir); float factor = ${C.stippleEnabled?m.glsl`min(1.0, subdivisionFactor * ${m.glsl.float(1.5)})`:m.glsl`subdivisionFactor`}; float rotationAngle = acos(clamp(dot(startDir, endDir), -1.0, 1.0)); joinDisplacementDir = rotate(startDir, -sign(uv0.y) * factor * rotationAngle); `):E.code.add(m.glsl`if (leftLen < 0.001) { joinDisplacementDir = right; } else if (rightLen < 0.001) { joinDisplacementDir = left; } else { joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? right : left; } joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);`);E.code.add(m.glsl` displacementLen = lineWidth; } } else { // CAP handling --------------------------------------------------- joinDisplacementDir = isStartVertex ? right : left; joinDisplacementDir = PERPENDICULAR(joinDisplacementDir); ${C.capType!==z.CapType.BUTT?m.glsl`capDisplacementDir = isStartVertex ? -right : left;`:""} } `);E.code.add(m.glsl` // Displacement (in pixels) caused by join/or cap vec2 dpos = joinDisplacementDir * sign(uv0.y) * displacementLen + capDisplacementDir * displacementLen; float lineDistNorm = sign(uv0.y) * pos.w; vLineDistance = lineWidth * lineDistNorm; ${K?m.glsl`vLineDistanceNorm = lineDistNorm;`:""} pos.xy += dpos; `);P&&E.code.add(m.glsl`vec2 segmentDir = normalize(segment); vSegmentSDF = (isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin, segmentDir) * pos.w) ; vReverseSegmentSDF = (isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd, -segmentDir) * pos.w);`);C.stippleEnabled&&(C.draped?E.uniforms.add(new v.FloatPassUniform("worldToScreenRatio",(J,R)=>1/R.screenToPCSRatio)):E.code.add(m.glsl`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex); float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),E.code.add(m.glsl`float segmentLengthScreenDouble = length(segment); float segmentLengthScreen = segmentLengthScreenDouble * 0.5; float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio); float segmentLengthRender = length(mix(nextPosition - position, position - prevPosition, isEndVertex)); vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),C.draped?E.code.add(m.glsl`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio; float startPseudoScreen = uv0.x * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):E.code.add(m.glsl`float startPseudoScreen = mix(uv0.x, uv0.x - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio; float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),E.uniforms.add(new v.FloatPassUniform("stipplePatternPixelSize",J=>k.computePixelSize(J))),E.code.add(m.glsl`float patternLength = lineSize * stipplePatternPixelSize; vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength); vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex); if (segmentLengthScreenDouble >= 0.001) { vec2 stippleDisplacement = pos.xy - segmentOrigin; float stippleDisplacementFactor = dot(segment, stippleDisplacement) / (segmentLengthScreenDouble * segmentLengthScreenDouble); vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x); } vStippleDistanceLimits *= pos.w; vStippleDistance *= pos.w; vStippleDistanceLimits = isJoin ? vStippleDistanceLimits : isStartVertex ? vec2(-1e34, vStippleDistanceLimits.y) : vec2(vStippleDistanceLimits.x, 1e34);`));E.code.add(m.glsl` // Convert back into NDC pos.xy = (pos.xy / viewport.zw) * pos.w; vColor = getColor(); vColor.a *= coverage; ${C.wireframe&&!C.draped?"pos.z -\x3d 0.001 * pos.w;":""} // transform final position to camera space for slicing vpos = (inverseProjectionMatrix * pos).xyz; gl_Position = pos; forwardObjectAndLayerIdColor(); } } `);O&&D.include(f.multipassTerrainTest,C);D.include(q.SliceDraw,C);G.include(g.ColorConversion);G.code.add(m.glsl` void main() { discardBySlice(vpos); ${O?"terrainDepthTest(depth);":""} `);C.wireframe?G.code.add(m.glsl`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(P&&G.code.add(m.glsl` float sdf = min(vSegmentSDF, vReverseSegmentSDF); vec2 fragmentPosition = vec2( min(sdf, 0.0), vLineDistance ) * gl_FragCoord.w; float fragmentRadius = length(fragmentPosition); float fragmentCapSDF = (fragmentRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0); if (capCoverage < ${m.glsl.float(e.symbolAlphaCutoff)}) { discard; } `),M?G.code.add(m.glsl` vec2 stipplePosition = vec2( min(getStippleSDF() * 2.0 - 1.0, 0.0), vLineDistanceNorm * gl_FragCoord.w ); float stippleRadius = length(stipplePosition * vLineWidth); float stippleCapSDF = (stippleRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0); float stippleAlpha = step(${m.glsl.float(e.symbolAlphaCutoff)}, stippleCoverage); `):G.code.add(m.glsl`float stippleAlpha = getStippleAlpha();`),C.output!==b.ShaderOutput.ObjectAndLayerIdColor&&G.code.add(m.glsl`discardByStippleAlpha(stippleAlpha, stippleAlphaColorDiscard);`),G.uniforms.add(new w.Float4PassUniform("intrinsicColor",J=>J.color)),G.code.add(m.glsl`vec4 color = intrinsicColor * vColor;`),C.innerColorEnabled&&(G.uniforms.add(new w.Float4PassUniform("innerColor",J=>J.innerColor??J.color),new v.FloatPassUniform("innerWidth",(J,R)=>J.innerWidth*R.camera.pixelRatio)), G.code.add(m.glsl`float distToInner = abs(vLineDistance * gl_FragCoord.w) - innerWidth; float innerAA = clamp(0.5 - distToInner, 0.0, 1.0); float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a); color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`)),G.code.add(m.glsl`vec4 finalColor = blendStipple(color, stippleAlpha);`),C.falloffEnabled&&(G.uniforms.add(new v.FloatPassUniform("falloff",J=>J.falloff)),G.code.add(m.glsl`finalColor.a *= pow(max(0.0, 1.0 - abs(vLineDistanceNorm * gl_FragCoord.w)), falloff);`)),C.stippleEnabled||G.code.add(m.glsl`float featherStartDistance = max(vLineWidth - 2.0, 0.0); float value = abs(vLineDistance) * gl_FragCoord.w; float feather = (value - featherStartDistance) / (vLineWidth - featherStartDistance); finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`));C.transparencyPassType===u.TransparencyPassType.ColorAlpha&&(D.outputs.add("fragColor","vec4",0),D.outputs.add("fragAlpha","float",1));G.code.add(m.glsl` ${C.output===b.ShaderOutput.ObjectAndLayerIdColor?m.glsl`finalColor.a = 1.0;`:""} if (finalColor.a < ${m.glsl.float(e.symbolAlphaCutoff)}) { discard; } ${C.output===b.ShaderOutput.Color?m.glsl`fragColor = highlightSlice(finalColor, vpos);`:""} ${C.output===b.ShaderOutput.Color&&C.transparencyPassType===u.TransparencyPassType.ColorAlpha?m.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""} ${C.output===b.ShaderOutput.Highlight?m.glsl`fragColor = vec4(1.0);`:""} ${C.output===b.ShaderOutput.ObjectAndLayerIdColor?m.glsl`outputObjectAndLayerIdColor();`:""} } `);return D}const B=Object.freeze(Object.defineProperty({__proto__:null,build:A,ribbonlineNumRoundJoinSubdivisions:1},Symbol.toStringTag,{value:"Module"}));a.RibbonLine=B;a.build=A;a.ribbonlineNumRoundJoinSubdivisions=1})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl":function(){define("exports ../shading/VisualVariables.glsl ../../shaderModules/Float3PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/FloatsPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h){a.RibbonVertexPosition=function(f,c){const e=f.vertex;e.uniforms.add(new l.FloatPassUniform("intrinsicWidth",g=>g.width));c.vvSize?(f.attributes.add(h.VertexAttribute.SIZEFEATUREATTRIBUTE,"float"),e.uniforms.add(new q.Float3PassUniform("vvSizeMinSize",g=>g.vvSize.minSize),new q.Float3PassUniform("vvSizeMaxSize",g=>g.vvSize.maxSize),new q.Float3PassUniform("vvSizeOffset",g=>g.vvSize.offset),new q.Float3PassUniform("vvSizeFactor",g=>g.vvSize.factor)),e.code.add(k.glsl`float getSize() { return intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x; }`)):(f.attributes.add(h.VertexAttribute.SIZE,"float"),e.code.add(k.glsl`float getSize(){ return intrinsicWidth * size; }`));c.vvOpacity?(f.attributes.add(h.VertexAttribute.OPACITYFEATUREATTRIBUTE,"float"),e.constants.add("vvOpacityNumber","int",8),e.uniforms.add(new p.FloatsPassUniform("vvOpacityValues",g=>g.vvOpacity.values,8),new p.FloatsPassUniform("vvOpacityOpacities",g=>g.vvOpacity.opacityValues,8)),e.code.add(k.glsl`float interpolateOpacity( float value ){ if (value <= vvOpacityValues[0]) { return vvOpacityOpacities[0]; } for (int i = 1; i < vvOpacityNumber; ++i) { if (vvOpacityValues[i] >= value) { float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]); return mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f); } } return vvOpacityOpacities[vvOpacityNumber - 1]; } vec4 applyOpacity( vec4 color ){ return vec4(color.xyz, interpolateOpacity(opacityFeatureAttribute)); }`)):e.code.add(k.glsl`vec4 applyOpacity( vec4 color ){ return color; }`);c.vvColor?(f.include(b.VisualVariables,c),f.attributes.add(h.VertexAttribute.COLORFEATUREATTRIBUTE,"float"),e.code.add(k.glsl`vec4 getColor(){ return applyOpacity(interpolateVVColor(colorFeatureAttribute)); }`)):(f.attributes.add(h.VertexAttribute.COLOR,"vec4"),e.code.add(k.glsl`vec4 getColor(){ return applyOpacity(color); }`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl":function(){define("exports ../util/RgbaFloatEncoding.glsl ../util/View.glsl ../../shaderModules/Float4PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform ../../../materials/stippleTextureRepository ../../../shaders/ensureColor4".split(" "),function(a,b,q,l,p,k,h,f,c){function e(t,w){const v= !(w.draped&&w.stipplePreferContinuous),{vertex:m,fragment:r}=t;r.include(b.RgbaFloatEncoding);w.draped||(q.addCameraPosition(m,w),m.uniforms.add(new p.FloatPassUniform("worldToScreenPerDistanceRatio",(n,u)=>1/u.camera.perScreenPixelRatio)),m.code.add(k.glsl`float computeWorldToScreenRatio(vec3 segmentCenter) { float segmentDistanceToCamera = length(segmentCenter - cameraPosition); return worldToScreenPerDistanceRatio / segmentDistanceToCamera; }`));t.varyings.add("vStippleDistance","float");t.varyings.add("vStippleDistanceLimits","vec2");t.varyings.add("vStipplePatternStretch","float");m.code.add(k.glsl` float discretizeWorldToScreenRatio(float worldToScreenRatio) { float step = ${d}; float discreteWorldToScreenRatio = log(worldToScreenRatio); discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step; discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio); return discreteWorldToScreenRatio; } `);m.code.add(k.glsl`vec2 computeStippleDistanceLimits(float startPseudoScreen, float segmentLengthPseudoScreen, float segmentLengthScreen, float patternLength) {`);m.code.add(k.glsl` if (segmentLengthPseudoScreen >= ${v?"patternLength":"1e4"}) { `);q.addPixelRatio(m);m.code.add(k.glsl`float repetitions = segmentLengthScreen / (patternLength * pixelRatio); float flooredRepetitions = max(1.0, floor(repetitions + 0.5)); float segmentLengthScreenRounded = flooredRepetitions * patternLength; float stretch = repetitions / flooredRepetitions; vStipplePatternStretch = max(0.75, stretch); return vec2(0.0, segmentLengthScreenRounded); } return vec2(startPseudoScreen, startPseudoScreen + segmentLengthPseudoScreen); }`);r.uniforms.add(new h.Texture2DPassUniform("stipplePatternTexture",n=>n.stippleTexture),new p.FloatPassUniform("stipplePatternSDFNormalizer",n=>(n=n.stipplePattern)?(Math.floor(.5*(f.computeLongestPattern(n)-1))+.5)/n.pixelRatio:1),new p.FloatPassUniform("stipplePatternPixelSizeInv",n=>1/g(n)));r.code.add(k.glsl`float getStippleSDF(out bool isClamped) { float stippleDistanceClamped = clamp(vStippleDistance, vStippleDistanceLimits.x, vStippleDistanceLimits.y); vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w; isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y; float u = stippleDistanceClamped * gl_FragCoord.w * stipplePatternPixelSizeInv * vLineSizeInv; u = fract(u); float encodedSDF = rgba2float(texture(stipplePatternTexture, vec2(u, 0.5))); float sdf = (encodedSDF * 2.0 - 1.0) * stipplePatternSDFNormalizer; return (sdf - 0.5) * vStipplePatternStretch + 0.5; } float getStippleSDF() { bool ignored; return getStippleSDF(ignored); } float getStippleAlpha() { bool isClamped; float stippleSDF = getStippleSDF(isClamped); float antiAliasedResult = clamp(stippleSDF * vLineWidth + 0.5, 0.0, 1.0); return isClamped ? floor(antiAliasedResult + 0.5) : antiAliasedResult; }`);w.stippleOffColorEnabled?(r.uniforms.add(new l.Float4PassUniform("stippleOffColor",n=>c.ensureColor4(n.stippleOffColor))),r.code.add(k.glsl`#define discardByStippleAlpha(stippleAlpha, threshold) {} #define blendStipple(color, stippleAlpha) mix(color, stippleOffColor, stippleAlpha)`)):r.code.add(k.glsl`#define discardByStippleAlpha(stippleAlpha, threshold) if (stippleAlpha < threshold) { discard; } #define blendStipple(color, stippleAlpha) vec4(color.rgb, color.a * stippleAlpha)`)}function g(t){const w=t.stipplePattern;return w?f.computeTextureSize(t.stipplePattern)/w.pixelRatio:1}const d=k.glsl.float(.4);a.LineStipple=function(t,w){t.constants.add("stippleAlphaColorDiscard","float",.001);t.constants.add("stippleAlphaHighlightDiscard","float",.5);w.stippleEnabled?e(t,w):t.fragment.code.add(k.glsl`float getStippleAlpha() { return 1.0; } #define discardByStippleAlpha(_stippleAlpha_, _threshold_) {} #define blendStipple(color, _stippleAlpha_) color`)};a.computePixelSize=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/stippleTextureRepository":function(){define("exports ../../../../core/floatRGBA ./ProceduralTextureRepository ../../../webgl/enums ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "),function(a,b,q,l,p,k){function h(e){return e.pattern.map(g=>Math.round(g*e.pixelRatio))}function f(e){if(null==e)return 1;e=h(e); return Math.floor(e.reduce((g,d)=>g+d))}function c(e){return h(e).reduce((g,d)=>Math.max(g,d))}a.computeLongestPattern=c;a.computeTextureSize=f;a.createStippleTextureRepository=function(e,g){return new q.ProceduralTextureRepository(d=>{var t=h(d),w=1/d.pixelRatio,v=f(d);d=c(d);const m=(Math.floor(.5*(d-1))+.5)*w;d=[];let r=1;for(var n of t){for(let y=0;y`${d.pattern.join(",")}-r${d.pixelRatio}`,g)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/ProceduralTextureRepository":function(){define(["exports","../../../../core/uid"],function(a,b){class q{constructor(p,k,h){this._createTexture= p;this._parametersKey=k;this._repository=new Map;this._orphanCache=h.newCache(`procedural-texture-repository:${b.generateUID()}`,f=>f.dispose())}destroy(){for(const [,{texture:p}]of this._repository)p.dispose();this._repository.clear();this._orphanCache.destroy()}swap(p,k=null){p=this._acquire(p);this.release(k);return p}release(p){if(null!=p){p=this._parametersKey(p);var k=this._repository.get(p);k&&(k.refCount--,0===k.refCount&&(this._repository.delete(p),{texture:k}=k,this._orphanCache.put(p,k, k.usedMemory)))}}_acquire(p){if(null==p)return null;const k=this._parametersKey(p);var h=this._repository.get(k);if(h)return h.refCount++,h.texture;p=this._orphanCache.pop(k)??this._createTexture(p);h=new l(p);this._repository.set(k,h);return p}}class l{constructor(p){this.texture=p;this.refCount=1}}a.ProceduralTextureRepository=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ensureColor4":function(){define(["exports","../../../../chunks/vec42", "../../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a,b,q){const l=q.create();a.ensureColor4=function(p){return null==p?q.ZEROS:4===p.length?p:b.set(l,p[0],p[1],p[2],1)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl":function(){define("exports ../../../../support/engineContent/marker ../util/View.glsl ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../shaders/LineMarkerTechniqueConfiguration".split(" "), function(a,b,q,l,p,k){a.MarkerSizing=function(h,f){const {vertex:c,constants:e}=h;e.add("markerSizePerLineWidth","float",b.markerSizePerLineWidth);q.addPixelRatio(c);null==c.uniforms.get("markerScale")&&c.constants.add("markerScale","float",1);c.code.add(p.glsl`float getLineWidth() { return max(getSize(), 1.0) * pixelRatio; } float getScreenMarkerSize() { return markerSizePerLineWidth * markerScale * getLineWidth(); }`);f.space===k.LineMarkerSpace.World&&(c.constants.add("maxSegmentLengthFraction","float",.45),c.uniforms.add(new l.FloatPassUniform("perRenderPixelRatio",(g,d)=>d.camera.perRenderPixelRatio)),c.code.add(p.glsl`bool areWorldMarkersHidden(vec4 pos, vec4 other) { vec3 midPoint = mix(pos.xyz, other.xyz, 0.5); float distanceToCamera = length(midPoint); float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5; float worldMarkerSize = getScreenMarkerSize() * screenToWorldRatio; float segmentLen = length(pos.xyz - other.xyz); return worldMarkerSize > maxSegmentLengthFraction * segmentLen; } float getWorldMarkerSize(vec4 pos) { float distanceToCamera = length(pos.xyz); float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5; return getScreenMarkerSize() * screenToWorldRatio; }`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/engineContent/marker":function(){define(["exports","./sdfPrimitives","../../../webgl/enums","../../../webgl/Texture","../../../webgl/TextureDescriptor"],function(a,b,q,l,p){a.createMarkerTexture=function(k,h){k=b.createPrimitive(k,64,32,6.4);const f=new p.TextureDescriptor;f.internalFormat=q.PixelFormat.RGBA;f.width=64;f.height=64;f.wrapMode=q.TextureWrapMode.CLAMP_TO_EDGE;return new l.Texture(h,f,k)};a.markerSizePerLineWidth= 10;a.markerSymbolSize=32;a.markerTextureSize=64;a.markerThickness=6.4;a.markerTipThicknessFactor=.25;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/engineContent/sdfPrimitives":function(){define(["exports","../../../../core/has","../../../../core/floatRGBA","../../webgl-engine/lib/Texture","../../../webgl/enums"],function(a,b,q,l,p){function k(u,x=128,y=.5*x,z=0){switch(u){case "circle":return h(x,y);case "square":return f(x,y);case "cross":return e(x,y,z); case "x":return g(x,y,z);case "kite":return c(x,y);case "triangle":return d(x,y);case "arrow":return t(x,y);default:return h(x,y)}}function h(u,x){const y=u/2-.5;return n(u,m(y,y,x/2))}function f(u,x){return w(u,x,!1)}function c(u,x){return w(u,x,!0)}function e(u,x,y=0){return v(u,x,!1,y)}function g(u,x,y=0){return v(u,x,!0,y)}function d(u,x){return n(u,r(u/2,x,x/2))}function t(u,x){const y=x/2,z=u/2,A=.8*x,B=m(z,(u-x)/2-A,Math.sqrt(A*A+y*y)),C=r(z,x,y);return n(u,(D,F)=>Math.max(C(D,F),-B(D,F)))} function w(u,x,y){y&&(x/=Math.SQRT2);return n(u,(z,A)=>{z=z-.5*u+.25;A=-A+.5*u-.75;if(y){const B=(z+A)/Math.SQRT2;A=(A-z)/Math.SQRT2;z=B}return Math.max(Math.abs(z),Math.abs(A))-.5*x})}function v(u,x,y,z=0){x-=z;y&&(x*=Math.SQRT2);const A=.5*x;return n(u,(B,C)=>{B-=.5*u;C=-C+.5*u-1;if(y){const D=(B+C)/Math.SQRT2;C=(C-B)/Math.SQRT2;B=D}B=Math.abs(B);C=Math.abs(C);B=B>C?B>A?Math.sqrt((B-A)*(B-A)+C*C):C:C>A?Math.sqrt(B*B+(C-A)*(C-A)):B;return B-=z/2})}function m(u,x,y){return(z,A)=>{z-=u;A-=x;return Math.sqrt(z* z+A*A)-y}}function r(u,x,y){const z=Math.sqrt(x*x+y*y);return(A,B)=>{B=B-u+x/2+.75;return Math.max((x*(Math.abs(A-u)-y)+y*B)/z,-B)}}function n(u,x){const y=new Uint8Array(4*u*u);for(let z=0;zthis._frameUpdate(C,D),this._startPreloadVideoElement(C)):C instanceof HTMLImageElement&&this._startPreloadImageElement(C))}_startPreloadVideoElement(C){if(!(f.isBlobProtocol(C.src)||"auto"===C.preload&&C.crossOrigin)){C.preload="auto";C.crossOrigin="anonymous";const D=!C.paused;C.src=C.src;if(D&&C.autoplay){const F=()=>{C.removeEventListener("canplay",F);C.play()};C.addEventListener("canplay",F)}}}_startPreloadImageElement(C){f.isDataProtocol(C.src)|| f.isBlobProtocol(C.src)||C.crossOrigin||(C.crossOrigin="anonymous",C.src=C.src)}_createDescriptor(C){const D=new x.TextureDescriptor;D.wrapMode=this._parameters.wrap??n.TextureWrapMode.REPEAT;D.flipped=!this._parameters.noUnpackFlip;D.samplingMode=this._parameters.mipmap?n.TextureSamplingMode.LINEAR_MIPMAP_LINEAR:n.TextureSamplingMode.LINEAR;D.hasMipmap=!!this._parameters.mipmap;D.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha;D.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap? C.parameters.maxMaxAnisotropy:1);return D}get glTexture(){return this._glTexture}get memoryEstimate(){var C;if(!(C=this._glTexture?.usedMemory)){C=this._data;var D=this._parameters;if(null==C)C=0;else if(h.isArrayBuffer(C)||h.isUint8Array(C))C=D.encoding===g.TextureEncodingMimeType.KTX2_ENCODING?d.estimateMemoryKTX2(C,!!D.mipmap):D.encoding===g.TextureEncodingMimeType.BASIS_ENCODING?d.estimateMemoryBasis(C,!!D.mipmap):C.byteLength;else{var {width:F,height:H}=C instanceof Image||C instanceof ImageData|| C instanceof HTMLCanvasElement||C instanceof HTMLVideoElement?y(C):D;C=(D.mipmap?4/3:1)*F*H*(D.components||4)||0}}return C}load(C){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const D=this._data;if(null==D)return this._glTexture=new u.Texture(C,this._createDescriptor(C),null);this._parameters.reloadable||(this._data=void 0);return"string"===typeof D?this._loadFromURL(C,D):D instanceof Image?this._loadFromImageElement(C,D):D instanceof HTMLVideoElement? this._loadFromVideoElement(C,D):D instanceof ImageData||D instanceof HTMLCanvasElement?this._loadFromImage(C,D):(h.isArrayBuffer(D)||h.isUint8Array(D))&&this._parameters.encoding===g.TextureEncodingMimeType.DDS_ENCODING?this._loadFromDDSData(C,D):(h.isArrayBuffer(D)||h.isUint8Array(D))&&this._parameters.encoding===g.TextureEncodingMimeType.KTX2_ENCODING?this._loadFromKTX2(C,D):(h.isArrayBuffer(D)||h.isUint8Array(D))&&this._parameters.encoding===g.TextureEncodingMimeType.BASIS_ENCODING?this._loadFromBasis(C, D):h.isUint8Array(D)?this._loadFromPixelData(C,D):h.isArrayBuffer(D)?this._loadFromPixelData(C,new Uint8Array(D)):null}_frameUpdate(C,D){if(null==this._glTexture||C.readyStated.createTextureKTX2(C,this._createDescriptor(C),D).then(F=>this._glTexture=F))}_loadFromBasis(C,D){return this._loadAsync(()=>d.createTextureBasis(C,this._createDescriptor(C),D).then(F=>this._glTexture=F))}_loadFromPixelData(C,D){r.assert(0{const H=await c.requestImage(D,{signal:F});k.throwIfAborted(F);return this._loadFromImage(C,H)})}_loadFromImageElement(C,D){return D.complete?this._loadFromImage(C,D):this._loadAsync(async F=>{const H=await e.loadImageAsync(D,D.src,!1,F);k.throwIfAborted(F);return this._loadFromImage(C,H)})}_loadFromVideoElement(C,D){return D.readyState>= A.HAVE_CURRENT_DATA?this._loadFromImage(C,D):this._loadFromVideoElementAsync(C,D)}_loadFromVideoElementAsync(C,D){return this._loadAsync(F=>new Promise((H,N)=>{const E=()=>{D.removeEventListener("loadeddata",G);D.removeEventListener("error",I);p.removeMaybe(O)},G=()=>{D.readyState>=A.HAVE_CURRENT_DATA&&(E(),H(this._loadFromImage(C,D)))},I=L=>{E();N(L||new q("Failed to load video"))};D.addEventListener("loadeddata",G);D.addEventListener("error",I);const O=k.onAbort(F,()=>I(k.createAbortError()))}))}_loadFromImage(C, D){if(!(D instanceof HTMLVideoElement)){var {maxTextureSize:F}=C.parameters;D=this._parameters.downsampleUncompressed?m.downsampleImage(D,F):m.ensureImageMaxSize(D,F)}F=y(D);this._parameters.width=F.width;this._parameters.height=F.height;const H=this._createDescriptor(C);H.pixelFormat=3===this._parameters.components?n.PixelFormat.RGB:n.PixelFormat.RGBA;H.width=F.width;H.height=F.height;return this._glTexture=new u.Texture(C,H,D)}_loadAsync(C){const D=new AbortController;this._loadingController=D; const F=C(D.signal);this._loadingPromise=F;C=()=>{this._loadingController===D&&(this._loadingController=null);this._loadingPromise===F&&(this._loadingPromise=null)};F.then(C,C);return F}unload(){this._glTexture=p.disposeMaybe(this._glTexture);if(null!=this._loadingController){const C=this._loadingController;this._loadingPromise=this._loadingController=null;C.abort()}this.events.emit("unloaded")}}var A;(function(C){C[C.HAVE_NOTHING=0]="HAVE_NOTHING";C[C.HAVE_METADATA=1]="HAVE_METADATA";C[C.HAVE_CURRENT_DATA= 2]="HAVE_CURRENT_DATA";C[C.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA";C[C.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(A||={});const B={wrap:{s:n.TextureWrapMode.REPEAT,t:n.TextureWrapMode.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};a.Texture=z;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/requestImageUtils":function(){define(["exports","../request"],function(a,b){a.requestImage=async function(q,l){({data:q}=await b(q,{responseType:"image", ...l}));return q};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/BasisUtil":function(){define("exports ../../../../libs/basisu/BasisU ../../../../libs/basisu/TextureFormat ../../../webgl/enums ../../../webgl/Texture ../../../webgl/Util".split(" "),function(a,b,q,l,p,k){async function h(){null==t&&(t=b.getBasisTranscoder(),d=await t);return t}function f(w,v,m,r,n){v=k.getBytesPerElementFormat(v?l.CompressedTextureFormat.COMPRESSED_RGBA8_ETC2_EAC:l.CompressedTextureFormat.COMPRESSED_RGB8_ETC2); return Math.ceil(m*r*v*(n&&1r.getImageTranscodedSizeInBytes(0,n,u),(n,u,x)=>r.transcodeImage(x,0,n,u,0,0));r.close();r.delete();return w};a.createTextureKTX2=async function(w,v,m){null==d&&(d=await h());const r=new d.KTX2File(new Uint8Array(m));if(!e(r))return null;r.startTranscoding();w=g(w,v,r.getLevels(),r.getHasAlpha(),r.getWidth(), r.getHeight(),(n,u)=>r.getImageTranscodedSizeInBytes(n,0,0,u),(n,u,x)=>r.transcodeImage(x,n,0,0,u,0,-1,-1));r.close();r.delete();return w};a.estimateMemoryBasis=function(w,v){if(null==d)return w.byteLength;w=new d.BasisFile(new Uint8Array(w));v=c(w)?f(w.getNumLevels(0),w.getHasAlpha(),w.getImageWidth(0,0),w.getImageHeight(0,0),v):0;w.close();w.delete();return v};a.estimateMemoryKTX2=function(w,v){if(null==d)return w.byteLength;w=new d.KTX2File(new Uint8Array(w));v=e(w)?f(w.getLevels(),w.getHasAlpha(), w.getWidth(),w.getHeight(),v):0;w.close();w.delete();return v};a.loadBasis=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/libs/basisu/BasisU":function(){define(["require","exports","../../assets"],function(a,b,q){let l;b.getBasisTranscoder=function(){l??=(async()=>{const p=await (await new Promise((k,h)=>a(["../../chunks/basis_transcoder"],k,h))).default({locateFile:k=>q.getAssetUrl(`esri/libs/basisu/${k}`)});p.initializeBasis();return p})();return l};Object.defineProperty(b, Symbol.toStringTag,{value:"Module"})})},"esri/libs/basisu/TextureFormat":function(){define(["exports"],function(a){a.TextureFormat=void 0;var b=a.TextureFormat||(a.TextureFormat={});b[b.ETC1_RGB=0]="ETC1_RGB";b[b.ETC2_RGBA=1]="ETC2_RGBA";b[b.BC1_RGB=2]="BC1_RGB";b[b.BC3_RGBA=3]="BC3_RGBA";b[b.BC4_R=4]="BC4_R";b[b.BC5_RG=5]="BC5_RG";b[b.BC7_M6_RGB=6]="BC7_M6_RGB";b[b.BC7_M5_RGBA=7]="BC7_M5_RGBA";b[b.PVRTC1_4_RGB=8]="PVRTC1_4_RGB";b[b.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA";b[b.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA"; b[b.ATC_RGB=11]="ATC_RGB";b[b.ATC_RGBA=12]="ATC_RGBA";b[b.FXT1_RGB=17]="FXT1_RGB";b[b.PVRTC2_4_RGB=18]="PVRTC2_4_RGB";b[b.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA";b[b.ETC2_EAC_R11=20]="ETC2_EAC_R11";b[b.ETC2_EAC_RG11=21]="ETC2_EAC_RG11";b[b.RGBA32=13]="RGBA32";b[b.RGB565=14]="RGB565";b[b.BGR565=15]="BGR565";b[b.RGBA4444=16]="RGBA4444";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/DDSUtil":function(){define(["exports","../../../../core/Logger","../../../webgl/enums", "../../../webgl/Texture"],function(a,b,q,l){function p(g){return g.charCodeAt(0)+(g.charCodeAt(1)<<8)+(g.charCodeAt(2)<<16)+(g.charCodeAt(3)<<24)}function k(g,d){var t=new Int32Array(g,0,31);if(542327876!==t[0])return h().error("Invalid magic number in DDS header"),null;if(!(t[20]&4))return h().error("Unsupported format, must contain a FourCC code"),null;var w=t[21];let v;switch(w){case f:w=8;v=q.CompressedTextureFormat.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case c:w=16;v=q.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT3_EXT; break;case e:w=16;v=q.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return h().error("Unsupported FourCC code:",String.fromCharCode(w&255,w>>8&255,w>>16&255,w>>24&255)),null}let m=1,r=t[4],n=t[3];if(0!==(r&3)||0!==(n&3))h().warn("Rounding up compressed texture size to nearest multiple of 4."),r=r+3&-4,n=n+3&-4;const u=r,x=n;t[2]&131072&&!1!==d&&(m=Math.max(1,t[7]));let y=t[1]+4;const z=[];for(let A=0;A>2)*(n+3>>2)*w,d=new Uint8Array(g,y,t),z.push(d),y+=t,r=Math.max(1, r>>1),n=Math.max(1,n>>1);return{textureData:{type:"compressed",levels:z},internalFormat:v,width:u,height:x}}const h=()=>b.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),f=p("DXT1"),c=p("DXT3"),e=p("DXT5");a.createDDSTexture=function(g,d,t){t=k(t,d.hasMipmap??!1);if(null==t)throw Error("DDS texture data is null");const {textureData:w,internalFormat:v,width:m,height:r}=t;d.samplingMode=1new Promise((r,n)=>a(["./RibbonLine.glsl"],r,n)));const m={factor:0,units:-4};b.RibbonLineTechnique=v;b.vertexAttributeLocations=w;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/lib/RenderContext":function(){define("exports ../../../../core/time ../../webgl/RenderCamera ../core/shaderLibrary/ShaderOutput ./BindParameters ./Material".split(" "),function(a,b,q,l,p,k){class h{constructor(e,g,d=null){this.rctx=e;this.sliceHelper=d;this.lastFrameCamera=new q;this.output=l.ShaderOutput.Color;this.renderOccludedMask=c;this.bindParameters=new p.BindParameters(g,null!=d?d.plane:null);this.bindParameters.alignPixelEnabled=!0}}class f extends h{constructor(e, g,d,t){super(e,d,t);this.offscreenRenderingHelper=g;this.sliceHelper=t;this.time=b.Milliseconds(0)}}const c=k.RenderOccludedFlag.Occlude|k.RenderOccludedFlag.OccludeAndTransparent|k.RenderOccludedFlag.OccludeAndTransparentStencil;a.OverlayRenderContext=h;a.RenderContext=f;a.defaultRenderOccludedMask=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ShadowMap":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../core/maybe ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../ViewingMode ../../webgl/formats ./CascadeCamera ./textureUtils ./Util ../../../webgl/enums ../../../webgl/Texture".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){function y(ca,ea){f.set(ba,ca[ea],ca[ea+3]);return ba}a.SnapshotSlot=void 0;(function(ca){ca[ca.Highlight=0]="Highlight";ca[ca.ExcludeHighlight=1]="ExcludeHighlight"})(a.SnapshotSlot||(a.SnapshotSlot={}));class z{constructor(){this.camera=new m.CascadeCamera;this.lightMat=h.create()}}class A{constructor(){this.maxNumCascadesLowQuality=this.maxNumCascadesHighQuality=4;this.textureSizeModHighQuality=1.3;this.textureSizeModLowQuality=.9;this.splitSchemeLambda= 0}}class B{constructor(ca,ea){this._fbos=ca;this._viewingMode=ea;this._enabled=!1;this._snapshots=[];this._textureHeight=0;this._numCascades=1;this.settings=new A;this._projectionView=h.create();this._projectionViewInverse=h.create();this._modelViewLight=h.create();this._cascadeDistances=[0,0,0,0,0];this._usedCascadeDistances=t.create();this._cascades=[new z,new z,new z,new z];this._lastOrigin=null;this._maxTextureWidth=Math.min(b("esri-mobile")?4096:16384,ca.rctx.parameters.maxTextureSize)}dispose(){this.enabled= !1;this.disposeOffscreenBuffers()}get depthTexture(){return this._handle?.getTexture()}get _textureWidth(){return this._textureHeight*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return d.set(this._usedCascadeDistances,this._cascadeDistances[0],1fa&&(fa=2);2>X&&(X=2);fa>=X&&(fa=2,X=4);const {near:ja,far:la}={near:fa,far:X};this._computeCascadeDistances(ja,la,ia);this._textureHeight=this._computeTextureHeight(ca,ka,ia);this._setupMatrices(ca,ea);const {viewMatrix:na,projectionMatrix:va}=ca;for(ca=0;cada;++da)M[16*ea+da]=P[da]}}return M}moveSnapshot(ca){n.assert(this.enabled);this._handle?.detachDepth();this._snapshots[ca]?.release();this._snapshots[ca]=this._handle;this._handle=null;this.clear()}copySnapshot(ca){var ea=this._handle?.getTexture()?.descriptor;if(this.enabled&&ea){this._snapshots[ca]?.release();var {width:da,height:ia}=ea; this._snapshots[ca]=this._fbos.acquire(da,ia,ca===a.SnapshotSlot.Highlight?"shadow highlight snapshot":"shadow no highlight snapshot",v.ColorFormat.RGBA4);ea=this._fbos.rctx;this._bindFbo();ca=ea.bindTexture(this._snapshots[ca]?.getTexture(),x.Texture.TEXTURE_UNIT_FOR_UPDATES);ea.gl.copyTexSubImage2D(u.TextureType.TEXTURE_2D,0,0,0,0,0,da,ia);ea.bindTexture(ca,x.Texture.TEXTURE_UNIT_FOR_UPDATES)}}getSnapshot(ca){return this.enabled?this._snapshots[ca]?.getTexture():null}clear(){const ca=this._fbos.rctx; this._ensureFbo();this._bindFbo();ca.setClearColor(1,1,1,1);ca.clear(u.ClearBufferBit.COLOR_BUFFER_BIT|u.ClearBufferBit.DEPTH_BUFFER_BIT)}_computeTextureHeight(ca,ea,da){ca=r.applyTextureResizeModulo(Math.floor(Math.min(window.devicePixelRatio,ea)/ca.pixelRatio*Math.max(ca.fullWidth,ca.fullHeight)*(da?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality)));return r.applyTextureResizeFloorModulo(Math.min(this._maxTextureWidth,this._numCascades*ca)/this._numCascades)}_ensureFbo(){if(this._handle?.fbo?.width!== this._textureWidth||this._handle?.fbo.height!==this._textureHeight)this._handle?.release(),this._handle=this._fbos.acquire(this._textureWidth,this._textureHeight,"shadow map",v.ColorFormat.RGBA4);this._handle?.acquireDepth(v.DepthFormat.DEPTH16_BUFFER)}_discardSnapshot(ca){this._snapshots[ca]=l.releaseMaybe(this._snapshots[ca])}_discardSnapshots(){for(let ca=0;caX;++X){d.set(D,0===X%4||3===X%4?-1:1,0===X%4||1===X%4?-1:1,4>X?fa:ea,1);var ja=F[X];d.transformMat4(ja,D,this._projectionViewInverse);ja[0]/=ja[3];ja[1]/=ja[3];ja[2]/=ja[3]}e.negate(O,F[0]);ka.camera.viewMatrix=k.translate(C, this._modelViewLight,O);for(fa=0;8>fa;++fa)e.transformMat4(F[fa],F[fa],ka.camera.viewMatrix);fa=F[0][2];ea=F[0][2];for(X=1;8>X;++X)fa=Math.min(fa,F[X][2]),ea=Math.max(ea,F[X][2]);fa-=200;ea+=200;ka.camera.near=-ea;ka.camera.far=-fa;X=ka.camera;ja=1/F[0][3];var la=1/F[4][3];n.assert(jaDa;++Da)f.add(K,K,da[Da]);f.scale(K,K,.25);f.set(J, 0,0);for(Da=4;8>Da;++Da)f.add(J,J,da[Da]);f.scale(J,J,.25);f.lerp(R[0],da[4],da[5],.5);f.lerp(R[1],da[5],da[6],.5);f.lerp(R[2],da[6],da[7],.5);f.lerp(R[3],da[7],da[4],.5);Da=0;var ra=f.squaredDistance(R[0],K);for(var xa=1;4>xa;++xa){var Ma=f.squaredDistance(R[xa],K);Maf.dot(W,Q)&&f.negate(Q,Q);f.lerp(Q,Q,W,na);f.normalize(Q,Q);na=Da=f.dot(f.subtract(S,da[0],K),Q);for(ra=1;8>ra;++ra)xa=f.dot(f.subtract(S, da[ra],K),Q),xaDa&&(Da=xa);f.copy(ia,K);f.scale(S,Q,na-va);f.add(ia,ia,S);xa=-1;Ma=1;va=ra=0;for(let Ga=0;8>Ga;++Ga){f.subtract(V,da[Ga],ia);f.normalize(V,V);const Pa=Q[0]*V[1]-Q[1]*V[0];0xa&&(xa=Pa,ra=Ga):PaMa,"rightArea");f.scale(T,Q,na);f.add(T,T,K);f.scale(Y,Q,Da);f.add(Y,Y,K);ha[0]=-Q[1];ha[1]=Q[0];za=n.rayRay2D(ia,da[va],Y,f.add(S,Y,ha),1,za);ya=n.rayRay2D(ia,da[ra],Y,S,1,ya);la=n.rayRay2D(ia,da[ra],T,f.add(S,T,ha), 1,la);da=n.rayRay2D(ia,da[va],T,S,1,ja);n.verify(za,"rayRay");n.verify(ya,"rayRay");n.verify(la,"rayRay");n.verify(da,"rayRay");ya=H;da=N;ia=G;la=I;ja=X.projectionMatrix;f.subtract(U,ia,la);f.scale(U,U,.5);Z[0]=U[0];Z[1]=U[1];Z[2]=0;Z[3]=U[1];Z[4]=-U[0];Z[5]=0;Z[6]=U[0]*U[0]+U[1]*U[1];Z[7]=U[0]*U[1]-U[1]*U[0];Z[8]=1;Z[6]=-f.dot(y(Z,0),ya);Z[7]=-f.dot(y(Z,1),ya);ya=f.dot(y(Z,0),ia)+Z[6];za=f.dot(y(Z,1),ia)+Z[7];va=f.dot(y(Z,0),la)+Z[6];la=f.dot(y(Z,1),la)+Z[7];ya=-(ya+va)/(za+la);Z[0]+=Z[1]*ya;Z[3]+= Z[4]*ya;Z[6]+=Z[7]*ya;ya=1/(f.dot(y(Z,0),ia)+Z[6]);za=1/(f.dot(y(Z,1),ia)+Z[7]);Z[0]*=ya;Z[3]*=ya;Z[6]*=ya;Z[1]*=za;Z[4]*=za;Z[7]*=za;Z[2]=Z[1];Z[5]=Z[4];Z[8]=Z[7];Z[7]+=1;ya=f.dot(y(Z,1),da)+Z[7];za=f.dot(y(Z,2),da)+Z[8];va=f.dot(y(Z,1),ia)+Z[7];la=f.dot(y(Z,2),ia)+Z[8];ya=-.5*(ya/za+va/la);Z[1]+=Z[2]*ya;Z[4]+=Z[5]*ya;Z[7]+=Z[8]*ya;ya=f.dot(y(Z,1),da)+Z[7];za=f.dot(y(Z,2),da)+Z[8];va=-za/ya;Z[1]*=va;Z[4]*=va;Z[7]*=va;ja[0]=Z[0];ja[1]=Z[1];ja[2]=0;ja[3]=Z[2];ja[4]=Z[3];ja[5]=Z[4];ja[6]=0;ja[7]=Z[5]; ja[8]=0;ja[9]=0;ja[10]=1;ja[11]=0;ja[12]=Z[6];ja[13]=Z[7];ja[14]=0;ja[15]=Z[8];X.projectionMatrix[10]=2/(fa-ea);X.projectionMatrix[14]=-(fa+ea)/(fa-ea);k.multiply(ka.lightMat,ka.camera.projectionMatrix,ka.camera.viewMatrix);fa=this._textureHeight;ka.camera.viewport=[ca*fa,0,fa,fa]}_setupMatrices(ca,ea){k.multiply(this._projectionView,ca.projectionMatrix,ca.viewMatrix);k.invert(this._projectionViewInverse,this._projectionView);ca=this._viewingMode===w.ViewingMode.Global?ca.eye:e.set(O,0,0,1);k.lookAt(this._modelViewLight, [0,0,0],[-ea[0],-ea[1],-ea[2]],ca)}_computeCascadeDistances(ca,ea,da){da=da?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor(n.logWithBase(ea/ca,4)),da);da=(ea-ca)/this._numCascades;ea=(ea/ca)**(1/this._numCascades);let ia=ca;for(let ka=0;kaca;++ca)F.push(t.create()); const H=c.create(),N=c.create(),E=c.create(),G=c.create(),I=c.create(),O=g.create(),L=[],P=h.create(),M=h.IDENTITY.concat(h.IDENTITY,h.IDENTITY,h.IDENTITY,h.IDENTITY),K=c.create(),J=c.create(),R=[c.create(),c.create(),c.create(),c.create()],Q=c.create(),W=c.create(),S=c.create(),V=c.create(),T=c.create(),Y=c.create(),ha=c.create(),ba=c.create(),U=c.create(),Z=p.create();a.ShadowMap=B;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/CascadeCamera":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../webgl/RenderCamera".split(" "), function(a,b,q,l,p,k,h,f,c){a.CascadeCamera=class extends c{constructor(){super(...arguments);this._projectionMatrix=f.create()}get projectionMatrix(){return this._projectionMatrix}};b.__decorate([q.property()],a.CascadeCamera.prototype,"_projectionMatrix",void 0);b.__decorate([q.property({readOnly:!0})],a.CascadeCamera.prototype,"projectionMatrix",null);a.CascadeCamera=b.__decorate([h.subclass("esri.views.3d.webgl-engine.lib.CascadeCamera")],a.CascadeCamera);Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/MapUtils ../../../../core/PooledArray ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/sphere ../../terrain/Intersector ../core/shaderLibrary/ShaderOutput ./ChangeSet ./Intersector ./IntersectorInterfaces ./Material ./ModelDirtyTypes ./rendererUtils ./RenderSlot ../materials/renderers/MergedRenderer".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(D,F,H,N,E,G,I){const O=new t.OverlayTarget(G,I,F);F=L=>{L.set(r.IntersectorType.OVERLAY,O,D.dist,D.normal,D.transformation,H,N)};(null==E.results.min.drapedLayerOrder||H>=E.results.min.drapedLayerOrder)&&(null==E.results.min.dist||E.results.ground.dist<=E.results.min.dist)&&F(E.results.min);E.options.store!==r.StoreResults.MIN&&(null==E.results.max.drapedLayerOrder||H E.results.max.dist)&&F(E.results.max);E.options.store===r.StoreResults.ALL&&(G=m.newIntersectorResult(E.ray),F(G),E.results.all.push(G))}a.SortedRenderGeometryRenderer=class extends q{constructor(D){super(D);this._pending=new B;this._changes=new v.ChangeSet;this._materialRenderers=new Map;this._sortedMaterialRenderers=new k;this._geometries=new Map;this._hasWater=this._hasHighlights=!1}destroy(){this._changes.prune();this._materialRenderers.forEach(D=>D.destroy());this._materialRenderers.clear(); this._sortedMaterialRenderers.clear();this._geometries.clear();this._pending.clear()}get updating(){return!this._pending.empty||00!==D.numGeometries&& !D.queryRenderOccludedState(n.RenderOccludedFlag.Occlude))}get isEmpty(){return!this.updating&&0===this._materialRenderers.size&&0===this._geometries.size}getMaterialRenderer(D){return this._materialRenderers.get(D)}commitChanges(){if(!this.updating)return!1;this._processAddsRemoves();let D=!1;x.splitRenderGeometryChangeSetByMaterial(this._changes).forEach((F,H)=>{var N=this.getMaterialRenderer(H);!N&&0(F=F.produces.get(y.RenderSlot.DRAPED_MATERIAL))?F(w.ShaderOutput.Highlight):!1);this._hasWater=p.someMap(this._materialRenderers,F=>(F=F.produces.get(y.RenderSlot.DRAPED_WATER))?F(w.ShaderOutput.Normal):!1);this.notifyChange("updating"); return!0}addGeometries(D,F){if(0!==D.length){var H=this._validateRenderGeometries(D);for(var N of H)this._geometries.set(N.id,N);N=this._pending.empty;for(const E of H)this._pending.adds.add(E);N&&this.notifyChange("updating");F===u.DirtyOperation.UPDATE&&this._notifyGraphicGeometryChanged(D)}}removeGeometries(D,F){const H=this._pending.empty,N=this._pending.adds;for(const E of D)N.has(E)?(this._pending.removed.add(E),N.delete(E)):this._pending.removed.has(E)||this._pending.removes.add(E),this._geometries.delete(E.id); H&&!this._pending.empty&&this.notifyChange("updating");F===u.DirtyOperation.UPDATE&&this._notifyGraphicGeometryChanged(D)}modifyGeometries(D,F){const H=0===this._changes.updates.length;for(const N of D){const E=this._changes.updates.pushNew();E.renderGeometry=this._validateRenderGeometry(N);E.updateType=F}H&&0F=!!H.updateAnimation&&H.updateAnimation(D)||F);return F}shouldRender(D){return this._sortedMaterialRenderers.some(F=>F.prepareTechnique(D))}render(D){this._sortedMaterialRenderers.forAll(F=>{const H=F.prepareTechnique(D);null!=H&&F.renderNode(D,H)})}intersect(D,F,H,N,E){this._geometries.forEach(G=>{if(!N||N(G)){this._intersectRenderGeometry(G,H,F,0,D,E);var I=this.rendererContext.longitudeCyclical;I&&(G.boundingSphere[0]-G.boundingSphere[3]I.max&&this._intersectRenderGeometry(G,H,F,-I.range,D,E));E++}});return E}_updateSortedMaterialRenderers(){this._sortedMaterialRenderers.clear();let D=0;for(const F of this._materialRenderers.values())F.drapedPriority=D++,this._sortedMaterialRenderers.push(F);this._sortedMaterialRenderers.sort((F,H)=>H.materialReference?.renderPriority===F.materialReference?.renderPriority?F.drapedPriority-H.drapedPriority:(H.materialReference?.renderPriority|| 0)-(F.materialReference?.renderPriority||0))}_processAddsRemoves(){this._changes.adds.clear();this._changes.removes.clear();this._changes.adds.pushArray(Array.from(this._pending.adds));this._changes.removes.pushArray(Array.from(this._pending.removes));for(let D=0;D{A(F,P,G,D.material.renderPriority,E,D.layerUid,D.graphicUid)},F)}}_notifyGraphicGeometryChanged(D){if(null!=this.drapeSource.notifyGraphicGeometryChanged)for(const H of D)if(D=H.graphicUid,null!=D&&D!==F){this.drapeSource.notifyGraphicGeometryChanged(D);var F=D}}_notifyGraphicVisibilityChanged(D){if(null!=this.drapeSource.notifyGraphicVisibilityChanged)for(const H of D)if(D= H.graphicUid,null!=D&&D!==F){this.drapeSource.notifyGraphicVisibilityChanged(D);var F=D}}_validateRenderGeometries(D){for(const F of D)this._validateRenderGeometry(F);return D}_validateRenderGeometry(D){null==D.localOrigin&&(D.localOrigin=this._localOriginFactory.getOrigin(d.getCenter(D.boundingSphere)));return D}get test(){}};b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"drapeSource",void 0);b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"updating",null); b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"rctx",null);b.__decorate([h.property({constructOnly:!0})],a.SortedRenderGeometryRenderer.prototype,"rendererContext",void 0);b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"_materials",null);b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"_localOriginFactory",null);b.__decorate([h.property({readOnly:!0})],a.SortedRenderGeometryRenderer.prototype,"isEmpty",null);b.__decorate([h.property()], a.SortedRenderGeometryRenderer.prototype,"_materialRenderers",void 0);b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"_geometries",void 0);a.SortedRenderGeometryRenderer=b.__decorate([e.subclass("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],a.SortedRenderGeometryRenderer);class B{constructor(){this.adds=new Set;this.removes=new Set;this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(D){return this.adds.has(D)|| this.removes.has(D)||this.removed.has(D)}clear(){this.adds.clear();this.removes.clear();this.removed.clear()}}const C=g.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/Intersector":function(){define(["exports","../webgl-engine/lib/IntersectorInterfaces","../webgl-engine/lib/IntersectorTarget","../webgl-engine/lib/intersectorUtils"],function(a,b,q,l){class p extends q.Graphic3DTarget{constructor(k,h,f){super(k,h);this.triangleNr=f}}a.OverlayTarget=p; a.isOverlayIntersectorResult=function(k){return l.isValidIntersectorResult(k)&&k.intersector===b.IntersectorType.OVERLAY&&!!k.target};a.isTerrainIntersectorResult=function(k){return l.isValidIntersectorResult(k)&&k.intersector===b.IntersectorType.TERRAIN&&!!k.target};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ModelDirtyTypes":function(){define(["exports"],function(a){a.DirtyOperation=void 0;(function(b){b[b.ADD=0]="ADD";b[b.UPDATE=1]="UPDATE";b[b.REMOVE= 2]="REMOVE"})(a.DirtyOperation||(a.DirtyOperation={}));a.DirtyState=void 0;(function(b){b[b.NONE=0]="NONE";b[b.VISIBILITY=1]="VISIBILITY";b[b.GEOMETRY=2]="GEOMETRY";b[b.TRANSFORMATION=4]="TRANSFORMATION";b[b.HIGHLIGHT=8]="HIGHLIGHT";b[b.OCCLUDEE=16]="OCCLUDEE"})(a.DirtyState||(a.DirtyState={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/MergedRenderer":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/arrayUtils ../../../../../core/has ../../../../../core/MapUtils ../../../../../core/mathUtils ../../../../../core/maybe ../../../../../core/NestedMap ../../../../../core/PooledArray ../../../../../core/accessorSupport/decorators/property ../../../../../core/Logger ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../support/buffer/glUtil ../../core/shaderLibrary/ShaderOutput ../../effects/RenderPlugin ../../lib/GLMaterials ../../lib/ModelDirtyTypes ../../lib/RenderSlot ../../lib/Util ../DrawParameters ./BufferRange ./Instance ./PerBufferData ./PerOriginData ./VaoCache".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F){function H(K,J){let R;if(!K.some(W=>{if(W.numElements=R.to&&K.removeUnordered(R);return Q}function N(K){M.length=K?1024:262144>K?k.nextHighestPowerOfTwo(K):Math.max(Math.min(262144*Math.ceil(1.5*K/262144),16777216),K)}a.MergedRenderer=class extends r.SyncPrepareRenderPlugin{constructor(K){super(K); this._bufferWriter=this._glMaterials=this._vaoCache=null;this._dataByOrigin=new Map;this._hasOccludees=this._hasHighlights=!1;this._produces=new Map;this.drapedPriority=0}destroy(){this._glMaterials=h.disposeMaybe(this._glMaterials);this._dataByOrigin.forEach(K=>K.dispose());this._dataByOrigin.clear();this._vaoCache=h.disposeMaybe(this._vaoCache)}initialize(){this.material.produces.forEach((K,J)=>{this._produces.set(J,R=>0!==this._dataByOrigin.size&&(R!==m.ShaderOutput.Highlight&&R!==m.ShaderOutput.ShadowHighlight|| this._hasHighlights)?K(R):!1)})}get produces(){return this._produces}initializeRenderContext(K,J){const {rctx:R}=K.renderContext;this._glMaterials=new n.GLMaterials(this.material,J??K.materials);this._bufferWriter=this.material.createBufferWriter();this._vaoCache=new F.VaoCache(R,this.material.vertexAttributeLocations,v.glLayout(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get hasOccludees(){return this._hasOccludees}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(K){return this.material.queryRenderOccludedState(K)}get materialReference(){return this.material}get numGeometries(){let K= 0;this._dataByOrigin.forEach(J=>K+=J.buffers.reduce((R,Q)=>R+=Q.instances.size,0));return K}get usedMemory(){let K=0;this._dataByOrigin.forEach(J=>K+=J.buffers.reduce((R,Q)=>R+Q.vao.usedMemory,0));return K}forEachGeometry(K){this._dataByOrigin.forEach(J=>J.buffers.forEach(R=>R.instances.forEach(Q=>K(Q.geometry))))}modify(K){this._updateGeometries(K.updates);this._addAndRemoveGeometries(K.adds,K.removes);this._updateDrawCommands()}_updateGeometries(K){const J=this._bufferWriter;if(null!==J){var R= J.vertexBufferLayout.stride/4;for(const W of K){K=W.renderGeometry;const S=this._dataByOrigin.get(K.localOrigin.id)?.findBuffer(K.id);if(null==S)break;const V=S.instances.get(K.id);if(W.updateType&(u.DirtyState.GEOMETRY|u.DirtyState.TRANSFORMATION)){var Q=J.elementCount(V.geometry.geometry)*R;Q=N(Q);const T=J.vertexBufferLayout.createView(Q.buffer);this._writeGeometry(K,T,0);S.vao.vertexBuffers.geometry.setSubData(Q,V.from*R,0,V.numElements*R)}W.updateType&(u.DirtyState.HIGHLIGHT|u.DirtyState.OCCLUDEE| u.DirtyState.VISIBILITY)&&(S.drawCommandsDirty=!0)}}}_computeDeltas(K,J){const R=new f.NestedMap;for(var Q of K){K=Q.localOrigin;if(null==K)continue;let W=R.get(K.id,null);null==W&&(W=new G(K.vec3),R.set(K.id,null,W));W.changes.push(Q)}for(const W of J)J=W.localOrigin,null!=J&&(Q=this._dataByOrigin.get(J.id)?.findBuffer(W.id),null!=Q&&(K=R.get(J.id,Q),null==K&&(K=new G(J.vec3),R.set(J.id,Q,K)),K.changes.push(W)));return R}_addAndRemoveGeometries(K,J){if(null!==this._bufferWriter&&null!==this._vaoCache){var {_bufferWriter:R, _dataByOrigin:Q}=this,W=R.vertexBufferLayout.stride/4,S=this._computeDeltas(K,J);S.forEach((V,T)=>{const Y=V.get(null),ha=null!=Y?Y.changes:[];S.delete(T,null);let ba=Q.get(T);V.forEach((U,Z)=>{S.delete(T,Z);if(null==Z)y.assert(!1,"No VAO for removed geometries");else if(Z.instances.size===U.changes.length)this._vaoCache.deleteVao(Z.vao),q.removeUnordered(ba.buffers,Z),0===ba.buffers.length&&0===ha.length&&Q.delete(T);else{var ca=Z.numElements,ea=Z.vao.byteSize/4,da=ha.reduce((ka,fa)=>ka+R.elementCount(fa.geometry), 0),ia=U.changes.reduce((ka,fa)=>ka+R.elementCount(fa.geometry),0);ca=Math.min((ca+da-ia)*W,4194304);da=ca>ea;65536Z.deleteInstance(ka)),Z.instances.forEach(({geometry:ka})=>ha.push(ka)),this._vaoCache.deleteVao(Z.vao),q.removeUnordered(ba.buffers,Z)):da?this._applyAndRebuild(Z,ha,U):this._applyRemoves(Z,U)}});if(0this._applyAdds(U,ha));0{K.buffers.forEach(J=>{J.drawCommandsDirty&&(J.hasHiddenInstances=!1,J.hasHighlights=!1,J.hasOccludees=!1,p.someMap(J.instances,R=>{J.updateDrawState(R);return J.hasHiddenInstances&&J.hasHighlights&&J.hasOccludees}),J.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride));this._hasHighlights=this._hasHighlights||J.hasHighlights;this._hasOccludees=this._hasOccludees||J.hasOccludees})})}_applyAndRebuild(K, J,R){if(null!=R)for(var Q of R.changes)K.deleteInstance(Q.id);const W=this._bufferWriter;R=W.vertexBufferLayout.stride;Q=R/4;var S=Math.floor(4194304/Q);let V=K.numElements;for(;0S&&0{this._writeGeometry(ba.geometry,Y,ha);const Z=ha;ha+=W.elementCount(ba.geometry.geometry);K.updateInstance(U,Z,ha);K.updateDrawState(ba)});this._vaoCache.deleteVao(K.vao);K.vao=this._vaoCache.newVao(E(J));K.vao.vertexBuffers.geometry.setSubData(S,0,0,ha*Q);K.holes.clear();J=K.holes.pushNew();J.from=ha;J.to=Math.floor(K.vao.byteSize/R);K.updateDrawCommands(R);return K}_applyRemoves(K,J){if(0!==J.changes.length&&null!==this._bufferWriter){for(var R of J.changes){var Q=R.id;if(J=K.instances.get(Q)){K.deleteInstance(Q); if(Q=P.back()){if(Q.to===J.from){Q.to=J.to;continue}if(Q.from===J.to){Q.from=J.from;continue}}Q=P.pushNew();Q.from=J.from;Q.to=J.to}}A.mergeAdjacentRanges(P);var W=this._bufferWriter.vertexBufferLayout.stride/4;R=P.reduce((T,Y)=>Math.max(T,Y.numElements),0)*W;var S=N(R);S.fill(0,0,R);var V=K.vao.vertexBuffers.geometry;P.forAll(T=>V.setSubData(S,T.from*W,0,T.numElements*W));K.holes.pushArray(P.data,P.length);P.forAll((T,Y)=>P.data[Y]=null);P.clear();K.drawCommandsDirty=!0}}_applyAdds(K,J){if(0!==J.length&& null!==this._bufferWriter)if(C.hasVao(K)){var R=this._bufferWriter,Q=R.vertexBufferLayout.stride/4,W=K.numElements,S=J.reduce((ea,da)=>ea+R.elementCount(da.geometry),0);W=Math.min((W+S)*Q,4194304);S=4*W;if(K.vao.byteSizeK.vao.byteSize)this._applyAndRebuild(K,J,null);else{A.mergeAdjacentRanges(K.holes);var V=[];for(var T of J)S=R.elementCount(T.geometry),S=H(K.holes,S),V.push(S);var Y=K.vao.vertexBuffers.geometry,ha=0,ba=0,U=0,Z=N(W),ca=R.vertexBufferLayout.createView(Z.buffer);J.forEach((ea, da)=>{da=V[da];if(null!=da){if(U!==da){var ia=U-ba;0null==V[da])}}else this._applyAndRebuild(K,J,null)}_writeGeometry(K,J,R){if(null!==this._bufferWriter){var Q=K.localOrigin.vec3;y.setMatrixTranslation3(I, -Q[0],-Q[1],-Q[2]);Q=t.multiply(O,I,K.transformation);t.invert(L,Q);t.transpose(L,L);this._bufferWriter.write(Q,L,K.geometry,J,R)}}updateAnimation(K){return this.material.update(K)}prepareTechnique(K){if(!this.material.shouldRender(K))return null;const {output:J,bindParameters:R}=K;if(!this.material.produces.get(R.slot)?.(J))return null;const Q=J===m.ShaderOutput.Highlight||J===m.ShaderOutput.ShadowHighlight;if(Q&&!this._hasHighlights)return null;const W=J===m.ShaderOutput.ShadowExcludeHighlight, S=!(Q||W);for(const T of this._dataByOrigin.values())for(const Y of T.buffers){if(Q&&!Y.hasHighlights)continue;var V=(Q?Y.drawCommandsHighlight:W&&Y.needsMultipleCommands()?Y.drawCommandsShadowHighlightRest:Y.drawCommandsDefault)||null;const ha=S&&Y.drawCommandsOccludees||null;if(V?.length||ha?.length)if(V=this._glMaterials.load(K.rctx,R.slot,J),V=null!=V?V.beginSlot(R):null,null!=V)return V}return null}renderNode(K,J){const {output:R,bindParameters:Q}=K,W=R===m.ShaderOutput.Highlight||R===m.ShaderOutput.ShadowHighlight, S=R===m.ShaderOutput.ShadowExcludeHighlight,V=!(W||S),T=Q.slot===x.RenderSlot.OCCLUDER_MATERIAL,Y=Q.slot===x.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL,ha=K.rctx;ha.runAppleAmdDriverHelper();ha.bindTechnique(J,Q,this.material.parameters);for(const ba of this._dataByOrigin.values())for(const U of ba.buffers){if(W&&!U.hasHighlights)continue;K=(W?U.drawCommandsHighlight:S&&U.needsMultipleCommands()?U.drawCommandsShadowHighlightRest:U.drawCommandsDefault)||null;const Z=V&&U.drawCommandsOccludees||null; if(K?.length||Z?.length)J.program.bindDraw(new z.DrawParameters(ba.origin),Q,this.material.parameters),J.ensureAttributeLocations(U.vao),ha.bindVAO(U.vao),K?.length&&(ha.setPipelineState(J.getPipeline(!1,T,Y)),K.forAll(ca=>ha.drawArrays(J.primitiveType,ca.first,ca.count))),Z?.length&&(ha.setPipelineState(J.getPipeline(!0,T,Y)),Z.forAll(ca=>ha.drawArrays(J.primitiveType,ca.first,ca.count)))}}get test(){}};b.__decorate([e.property({constructOnly:!0})],a.MergedRenderer.prototype,"material",void 0);a.MergedRenderer= b.__decorate([d.subclass("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],a.MergedRenderer);class G{constructor(K){this.origin=K;this.changes=[]}}const I=w.create(),O=w.create(),L=w.create(),P=new c({allocator:K=>K||new A.BufferRange,deallocator:null});let M=new Float32Array(65536);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GLMaterials":function(){define(["exports","./basicInterfaces"],function(a,b){class q{constructor(l,p){this._material= l;this._repository=p;this._map=new Map}dispose(){this._map.forEach((l,p)=>{null!=l&&this._repository.release(this._material,p)})}load(l,p,k){if(!this._material.produces.get(p)?.(k))return null;this._map.has(k)||this._map.set(k,this._repository.acquire(this._material,p,k));p=this._map.get(k);if(null!=p){if(p.ensureResources(l)===b.ResourceState.LOADED)return p;this._repository.requestRender()}return null}}a.GLMaterials=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DrawParameters":function(){define(["exports", "../../../../core/libs/gl-matrix-2/factories/vec3f64","../core/shaderLibrary/attributes/VertexNormal.glsl"],function(a,b,q){class l extends q.VertexNormalDrawParameters{constructor(p=b.create()){super();this.slicePlaneLocalOrigin=this.origin=p}}a.DrawParameters=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/BufferRange":function(){define(["exports"],function(a){class b{constructor(q=0,l=0){this.from=q;this.to=l}get numElements(){return this.to- this.from}}a.BufferRange=b;a.mergeAdjacentRanges=function(q){const l=new Map;q.forAll(k=>l.set(k.from,k));for(var p=!0;p;){p=!1;for(let k=0;kc||new l.DrawCommand,deallocator:c=> c})}function k(c,e){const g=c.back();null==g?(c=c.pushNew(),c.first=e.from,c.count=e.numElements):g.first+g.count>=e.from?g.count=e.from-g.first+e.numElements:(c=c.pushNew(),c.first=e.from,c.count=e.numElements)}class h{constructor(){this._numElements=0;this._instances=new Map;this.holes=new b({allocator:c=>c||new q.BufferRange,deallocator:null});this.hasOccludees=this.hasHighlights=this.hasHiddenInstances=!1;this.drawCommandsDirty=!0;this.drawCommandsDefault=p();this.drawCommandsHighlight=p();this.drawCommandsOccludees= p();this.drawCommandsShadowHighlightRest=p()}get numElements(){return this._numElements}get instances(){return this._instances}addInstance(c,e){this.deleteInstance(c);this._instances.set(c,e);this._numElements+=e.numElements}deleteInstance(c){const e=this._instances.get(c);e&&(this._numElements-=e.numElements,this._instances.delete(c))}updateInstance(c,e,g){if(c=this._instances.get(c))this._numElements-=c.numElements,c.from=e,c.to=g,this._numElements+=c.numElements}updateDrawState(c){c.isVisible? (c.hasHighlights&&(this.hasHighlights=!0),c.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(c){this.drawCommandsDefault.clear();this.drawCommandsHighlight.clear();this.drawCommandsOccludees.clear();this.drawCommandsShadowHighlightRest.clear();this.drawCommandsDirty=!1;if(0!==this._instances.size)if(this.needsMultipleCommands()){c=Array.from(this._instances.values()).sort((g,d)=>g.from===d.from?g.to-d.to:g.from-d.from);for(var e of c)e.isVisible&&(k(e.hasOccludees? this.drawCommandsOccludees:this.drawCommandsDefault,e),k(e.hasHighlights?this.drawCommandsHighlight:this.drawCommandsShadowHighlightRest,e))}else{const g=this.drawCommandsDefault.pushNew();e=this.holes.front();null!=this.vao&&1===this.holes.length&&e.to===Math.floor(this.vao.byteSize/c)?(g.first=0,g.count=e.from):(g.first=Infinity,g.count=0,this._instances.forEach(d=>{g.first=Math.min(g.first,d.from);g.count=Math.max(g.count,d.to)}),g.count-=g.first)}}needsMultipleCommands(){return this.hasOccludees|| this.hasHighlights||this.hasHiddenInstances}}class f extends h{}a.PerBufferData=h;a.PerVaoData=f;a.hasVao=function(c){return null!=c.vao};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/DrawCommand":function(){define(["exports"],function(a){class b{constructor(){this.count=this.first=0}}a.DrawCommand=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/PerOriginData":function(){define(["exports"], function(a){class b{constructor(q){this.origin=q;this.buffers=[]}dispose(){this.buffers.forEach(q=>q.vao.dispose());this.buffers.length=0}findBuffer(q){return this.buffers.find(l=>l.instances.has(q))}}a.PerOriginData=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/VaoCache":function(){define(["exports","../../../../../core/MemCachePool","../../lib/VertexArrayObject","../../../../webgl/BufferObject","../../../../webgl/enums"],function(a, b,q,l,p){class k{constructor(h,f,c){this._rctx=h;this._locations=f;this._layout=c;this._cache=new b.MemCachePool(h.newCache,"VAOCache")}dispose(){this._cache.destroy()}newVao(h){let f=this._cache.pop(h.toString());if(f)return f;f=new q.VertexArrayObject(this._rctx,this._locations,{geometry:this._layout},{geometry:l.BufferObject.createVertex(this._rctx,p.Usage.STATIC_DRAW)});f.vertexBuffers.geometry.setSize(h);return f}deleteVao(h){null!=h&&this._cache.put(h.byteSize.toString(),h)}}a.VaoCache=k;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/core/MemCachePool":function(){define(["exports","./MemCache"],function(a,b){class q{constructor(l,p){this._cache=l(p,(k,h,f)=>{switch(h){case b.RemoveMode.ALL:return k.forEach(c=>c.dispose()),0;case b.RemoveMode.SOME:if(k=k.shift())f-=Math.round(k.usedMemory),k.dispose();return f}})}hitrate(){return this._cache.hitRate}destroy(){this._cache.destroy()}clear(){this._cache.clear()}getSize(l){return this._cache.getSize(l)}pop(l){const p=this._cache.peek(l); if(p){var k=p.pop();if(0new Promise((g,d)=>a(["../core/shaderLibrary/util/TextureOnly.glsl"],g,d)));b.TextureTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.hasAlpha=!1}}b.__decorate([q.parameter()],l.prototype,"hasAlpha", void 0);a.TextureTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/OverlayCompositing.glsl":function(){define("exports ../views/3d/terrain/interfaces ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f){function c(){const d=new h.ShaderBuilder;d.include(q.ScreenSpacePass);d.fragment.uniforms.add(new f.Texture2DPassUniform("tex",t=>t.texture));d.fragment.uniforms.add(new p.IntegerPassUniform("overlayIdx",t=>t.overlayIndex));d.fragment.uniforms.add(new l.FloatPassUniform("opacity",t=>t.opacity));d.fragment.code.add(k.glsl`void main() { vec2 overlayUV = overlayIdx == 0 ? vec2(uv.x * 0.5, uv.y) : vec2(uv.x * 0.5 + 0.5, uv.y); fragColor = texture(tex, overlayUV) * opacity; }`);return d}class e extends k.NoParameters{constructor(){super(...arguments);this.overlayIndex=b.OverlayIndex.INNER;this.opacity=1}}const g=Object.freeze(Object.defineProperty({__proto__:null,OverlayCompositingPassParameters:e,build:c},Symbol.toStringTag,{value:"Module"}));a.OverlayCompositing=g;a.OverlayCompositingPassParameters=e;a.build=c})},"esri/views/3d/webgl-engine/shaders/OverlayCompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/OverlayCompositing.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx,e.shader.get().build(),p.Default3D)}initializePipeline(){return c.makePipelineState({blending:c.simpleBlendingParams(f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:c.defaultColorWriteParams})}}e.shader=new q.ReloadableShaderModule(h.OverlayCompositing,()=>new Promise((g,d)=>a(["./OverlayCompositing.glsl"],g,d)));b.OverlayCompositingTechnique=e;Object.defineProperty(b,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/webgl-engine/lib/Normals":function(){define(["exports","../../../../core/mathUtils","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../geometry/support/FloatArray"],function(a,b,q,l,p){function k(e,g,d,t,w,v=2){var m=1/(Math.abs(d)+Math.abs(t)+Math.abs(w));d*=m;t*=m;m=0>=w?(0<=t?1:-1)*(1-Math.abs(d)):t;g*=v;e[g]=f(0>=w?(0<=d?1:-1)*(1-Math.abs(t)):d);e[g+1]=f(m)}function h(e,g,d,t=2){t*=d;d=c(g[t]);g=c(g[t+1]);t=1-Math.abs(d)- Math.abs(g);e[2]=t;0>t?(e[0]=(0<=d?1:-1)*(1-Math.abs(g)),e[1]=(0<=g?1:-1)*(1-Math.abs(d))):(e[0]=d,e[1]=g);q.normalize(e,e)}function f(e){return b.clamp(Math.round(32767*e),-32767,32767)}function c(e){return b.clamp(e/32767,-1,1)}a.compressAndTransformNormals=function(e,g){const d=e.length/3,t=new Int16Array(2*d);let w=0;const v=l.create();for(let m=0;mJ.createTexture(ja)),X.textureId=la.texture.id);X.textureIsSignedDistanceField= !0;X.sampleSignedDistanceFieldTexelCenter=J.requiresHalfTexelOffset(ja);X.distanceFieldBoundingBox=ea;la=this._getIconSize();this._size=[la,la];this._symbolTextureRatio=1/ca;this._createMaterialAndAddToStage(X,this._context.stage)}async _prepareResourcesHref(X,ja,la){this._outlineSize=this._getOutlineSize();X.color=this._getFillColor();X.outlineColor=this._getOutlineColor();X.outlineSize=this._outlineSize;X.textureIsSignedDistanceField=!1;const na=this._getIconSize(),va=na*this._context.graphicsCoreOwner.view.state.rasterPixelRatio; if(null!=this._context.sharedResources.textures){la=await l.result(this._context.sharedResources.textures.fromUrl(ja,va,{signal:la}));if(!1===la.ok)throw c.throwIfAbortError(la.error),new p("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${ja})`);this._textureHandle=la.value;ja=la.value.texture;this._size=ba(ja,na);X.textureId=ja.id}this._createMaterialAndAddToStage(X,this._context.stage)}async _prepareResourcesCIM(X,ja,la){this._cimData=ja;if(!this._context.sharedResources.cimSymbolRasterizer){var na= (await new Promise((ya,Da)=>a(["../../../../symbols/cim/CIMSymbolRasterizer"],ya,Da))).CIMSymbolRasterizer;c.throwIfAborted(la);this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new na(this._context.renderCoordsHelper.spatialReference))}var va=this._context.sharedResources.cimSymbolRasterizer;na=[];const za=ja?.symbol;u.CIMSymbolHelper.fetchResources(za,va.resourceManager,na,la);u.CIMSymbolHelper.fetchFonts(za,va.resourceManager,na);va=this._context.layer.fields? this._context.layer.fields.map(ya=>ya.toJSON()):[];this._arcadeInfo={spatialReference:this._context.renderCoordsHelper.spatialReference,fields:va,geometryType:"esriGeometryPoint"};ja?.primitiveOverrides&&na.push(x.OverrideHelper.createRenderExpressions(ja.primitiveOverrides,this._arcadeInfo));0{Da=D(ya,Da,{$view:xa},"esriGeometryPoint",ra);return null!==Da?Da:1}}c.throwIfAborted(la);this._cimMaterialParametersInfo=X;this._cimMaterialParametersInfo.color=this._getFillColor();this._cimMaterialParametersInfo.outlineColor=[0,0,0,0];this._cimMaterialParametersInfo.outlineSize=0;this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource?.href? null:this.symbolLayer.resource?.primitive??A.defaultPrimitive}_getOutlineSize(){var X=0;X=this.symbolLayer;if(null!=X.outline?.size)return Math.max(e.pt2px(X.outline.size),0);X=this._getPrimitive();X=T(X)?1.5:0;return Math.max(X,0)}_getOutlineColor(){const X=this._getLayerOpacity(),ja=this.symbolLayer?.outline?.color;if(null!=ja){const la=q.toUnitRGB(ja);return[la[0],la[1],la[2],ja.a*X]}return[0,0,0,0]}_getFillColor(){if(T(this._getPrimitive()))return F.transparentUnit;const X=null==this._getPrimitive(); return this._getCombinedOpacityAndColor(this.symbolLayer?.material?.color,{hasIntrinsicColor:X})}_createMaterialAndAddToStage(X,ja){if(this._cimData){this._fastUpdates=null;let la=X.textureId?this._cimSymbolMaterials.get(X.textureId):null;la||(la=new V.HUDMaterial(X),this._cimSymbolMaterials.set(X.textureId??0,la),ja.add(la));return la}(this._fastUpdates=K.initFastSymbolUpdatesState(this._context.renderer,this._fastVisualVariableConvertOptions()))&&(X={...X,...this._fastUpdates.materialParameters}); this._materials[0]=new V.HUDMaterial(X);ja.add(this._materials[0]);return this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial(X=>{X.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})}),this.layerOpacityChanged())}destroy(){super.destroy();this._patchTask=f.abortMaybe(this._patchTask);this._forEachMaterial(X=>this._context.stage.remove(X));this._materials.length=0;this._cimSymbolMaterials.clear(); this._cimSymbolTextures.forEach(X=>this._context.stage.remove(X));this._cimSymbolTextures.clear();this._textureHandle=f.releaseMaybe(this._textureHandle)}_getScaleFactor(X,ja){if(this._drivenProperties.size&&X.size){for(let la=0;3>la;la++){const na=X.size[la];na&&"symbol-value"!==na&&"proportional"!==na&&(X.size[la]=e.pt2px(na))}if("symbol-value"===X.size[0])return 1;if(isFinite(+X.size[0]))return+X.size[0]/ja;if(isFinite(+X.size[2]))return+X.size[2]/ja}return 1}createGraphics3DGraphic(X){const ja= X.graphic;if(!this._validateGeometry(ja.geometry))return null;var la=[0,0];let na;if(this._cimData){if(!this._cimData.symbol)return null;var va=this._generateTextureCIM(ja);na=this._createMaterialAndAddToStage({textureId:va.id,...this._cimMaterialParametersInfo},this._context.stage);var za=window.devicePixelRatio||1;la=[va.parameters.width/za,va.parameters.height/za]}else la=this._size,na=this._materials[0];va=M.placePointOnGeometry(ja.geometry);if(null==va)return this.logger.warn(`unsupported geometry type for icon symbol: ${ja.geometry.type}`), null;var ya=X.renderingInfo;za=this._getVertexOpacityAndColor(ya);let Da=1;this._fastUpdates?.visualVariables.size||(Da=this._getScaleFactor(ya,la[0]>la[1]?la[0]:la[1]));Da*=this._symbolTextureRatio;la=t.fromValues(la[0]*Da,la[1]*Da);ya=this.setGraphicElevationContext(ja);this.ensureDrapedStatus("on-the-ground"===ya.mode)&&this._setDrapingDependentMaterialParameters();return this.draped?this._createAsOverlay(ja,va,na,za,la,X.layer.uid):this._createAs3DShape(ja,va,na,za,la,ya,ja.uid)}layerOpacityChanged(){const X= this._getFillColor(),ja=this._getOutlineColor();this._forEachMaterial(la=>{la.setParameters({color:X});la.setParameters({outlineColor:ja})})}updateGeometry(X,ja){if(this.draped||!this._validateGeometry(ja))return!1;const {elevationContext:la,stageObject:na}=X;if(la.mode!==this.getGeometryElevationMode(ja))return!1;ja=M.placePointOnGeometry(ja);if(!ja)return!1;const va=M.updateStageObjectGeometry(na,this._context,ja,la);if(null==va)return!1;const za=M.getLocalOriginForPoint(this._context,ja);if(na.geometries[0].localOrigin!== za)return!1;X.alignedSampledElevation=va;M.extendPointGraphicElevationContext(X,ja,this._context.elevationProvider);return!0}layerElevationInfoChanged(X,ja,la){const na=this._elevationContext.mode;la=N.elevationModeChangeUpdateType(da.elevationModeChangeTypes,la,na);if(la!==N.SymbolUpdateType.UPDATE)return la;const va=N.needsElevationUpdates2D(na)||"absolute-height"===na;return this.updateGraphics3DGraphicElevationInfo(X,ja,()=>va)}slicePlaneEnabledChanged(){this.draped||this._forEachMaterial(X=> {X.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})});return!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(X,ja){for(const la in X.diff)switch(la){case "visualVariables":if(K.updateFastSymbolUpdatesState(this._fastUpdates,ja,this._fastVisualVariableConvertOptions()))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return L.ApplyRendererDiffResult.RecreateSymbol;break;default:return L.ApplyRendererDiffResult.RecreateSymbol}return L.ApplyRendererDiffResult.FastUpdate}prepareSymbolLayerPatch(X){this._patchTask?.abort(); "partial"===X.diff.type&&this._preparePatchResource(X,X.diff.diff)}_preparePatchResource(X,ja){if(ja.resource&&"partial"===ja.resource.type&&(ja=ja.resource.diff,"complete"===ja?.href?.type)){var la=ja.href.newValue,{textures:na}=this._context.sharedResources;if(null!=la&&null!=na&&null==Y(la)){var va=this._getIconSize(),za=va*this._context.graphicsCoreOwner.view.state.pixelRatio;X.symbolLayerStatePatches.push(()=>{this._patchTask=f.abortMaybe(this._patchTask);this._patchTask=l.createTask(ya=>this._context.schedule(async(Da, ra)=>{Da=await l.result(na.fromUrl(la,za,{signal:ra}));c.throwIfAborted(ra);(ra=!Da.ok)&&c.throwIfAbortError(Da.error);this._textureHandle=f.releaseMaybe(this._textureHandle);this._patchTask=null;if(ra)this._forEachMaterial(Ma=>{Ma.visible=!1;Ma.setParameters({textureId:null})}),this.logger.error(new p("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${la})`));else{this._textureHandle=Da.value;var xa=Da.value.texture;this._size=ba(xa,va);this._forEachMaterial(Ma=> {Ma.setParameters({textureId:xa.id});Ma.visible=!0})}},ya))});delete ja.href}}}_defaultElevationInfoNoZ(){return ia}_createAs3DShape(X,ja,la,na,va,za,ya){X=this.getFastUpdateAttrValues(X);const Da=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:ya,layerUid:this._context.layer.uid});na=Q.createPointGeometry(la,U,null,na,va,ka,null,X,Da);ya=M.createStageObject(this._context,ja,na,za,ya);if(null==ya)return null;const ra=new G.Graphics3DObject3DGraphicLayer(this,ya.object,[na],null, null,H.perObjectElevationAligner,za);ra.alignedSampledElevation=ya.sampledElevation;ra.needsElevationUpdates=N.needsElevationUpdates2D(za.mode)||"absolute-height"===za.mode;ra.getScreenSize=this._createScreenSizeGetter(va,X);ra.calculateRelativeScreenBounds=xa=>la.calculateRelativeScreenBounds(ra.getScreenSize(),1,xa);M.extendPointGraphicElevationContext(ra,ja,this._context.elevationProvider);return ra}_createAsOverlay(X,ja,la,na,va,za){la.renderPriority=this._renderPriority;const ya=w.create();m.projectPointToVector(ja, ya,this._context.overlaySR);ya[2]=R.drapedZ;ja=this._context.clippingExtent;if(null!=ja&&!r.containsPoint(ja,ya))return null;ja=this.getFastUpdateAttrValues(X);const Da=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:X.uid,layerUid:this._context.layer.uid});na=Q.createPointGeometry(la,U,ya,na,va,null,null,ja,Da);X=new W.RenderGeometry(na,{layerUid:za,graphicUid:X.uid});const ra=new E.Graphics3DDrapedGraphicLayer(this,[X],null,this._context.drapeSourceRenderer);ra.getScreenSize= this._createScreenSizeGetter(va,ja);ra.calculateRelativeScreenBounds=xa=>la.calculateRelativeScreenBounds(ra.getScreenSize(),1,xa);return ra}_createScreenSizeGetter(X,ja){const la=this._outlineSize+2;if(this._fastUpdates&&ja){const za=X[0]/this._symbolTextureRatio,ya=X[1]/this._symbolTextureRatio;return(Da=t.create())=>{const [ra,xa]=K.evaluateModelTransformScale(fa,this._fastUpdates.materialParameters,ja);Da[0]=ra*za+la;Da[1]=xa*ya+la;return Da}}const na=X[0]/this._symbolTextureRatio+la,va=X[1]/ this._symbolTextureRatio+la;return(za=t.create())=>{za[0]=na;za[1]=va;return za}}_fastVisualVariableConvertOptions(){var X=Math.max(this._size[0],this._size[1]);const ja=w.fromValues(X,X,X),la=e.px2pt(1);X*=la;X=w.fromValues(X,X,X);return new K.ConvertOptions({size:!0,color:!0,rotation:!0,opacity:!1},ja,X,la)}_forEachMaterial(X){this._materials.forEach(X);this._cimSymbolMaterials.forEach(X)}test(){return{...super.test(),material:this._materials[0]}}}da.PRIMITIVE_SIZE=[Z*ca,Z*ca];da.elevationModeChangeTypes= {definedChanged:N.SymbolUpdateType.UPDATE,staysOnTheGround:N.SymbolUpdateType.NONE,onTheGroundChanged:N.SymbolUpdateType.RECREATE};const ia={mode:"relative-to-ground",offset:0},ka=v.fromValues(0,0,0,1),fa=w.create();b.Graphics3DIconSymbolLayer=da;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMSymbolHelper":function(){define("exports ../../core/BidiText ../../core/has ../../core/lang ../../core/Logger ../../core/RandomLCG ../../core/screenUtils ../../geometry/support/aaBoundingRect ../../geometry/support/boundsUtils ../Font ./CIMPlacements ./CIMSymbolDrawHelper ./defaultCIMValues ./enums ./utils ../support/defaults ../../views/2d/engine/vectorTiles/GeometryUtils ../../views/2d/engine/webgl/definitions ../../views/2d/engine/webgl/mesh/templates/shapingUtils ../../views/2d/layers/graphics/graphicsUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){function y(S,V,T){switch(V.type){case "CIMSymbolReference":return y(S,V.symbol,T);case "CIMPointSymbol":null==T&&(T={x:0,y:0});S.drawSymbol(V,T);break;case "CIMLineSymbol":null==T&&(T={paths:[[[0,0],[10,0]]]});S.drawSymbol(V,T);break;case "CIMPolygonSymbol":null==T&&(T={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]});S.drawSymbol(V,T);break;case "CIMTextSymbol":S.drawSymbol(V,{x:0,y:0});break;case "CIMVectorMarker":T=new g.Placement,S.drawMarker(V,T)}return S.envelope()} function z(S){if(!S)return 0;switch(S.type){case "CIMMarkerPlacementAlongLineSameSize":return Math.abs(S.offset);case "CIMMarkerPlacementAlongLineRandomSize":return Math.abs(S.offset);case "CIMMarkerPlacementAtExtremities":return Math.abs(S.offset);case "CIMMarkerPlacementAtMeasuredUnits":return Math.abs(S.offset);case "CIMMarkerPlacementAtRatioPositions":return Math.abs(S.offset);case "CIMMarkerPlacementInsidePolygon":return 0;case "CIMMarkerPlacementOnLine":return Math.abs(S.offset);case "CIMMarkerPlacementOnVertices":return Math.abs(S.offset); case "CIMMarkerPlacementPolygonCenter":return 0;default:return 0}}function A(S){if(!S)return 0;switch(S.type){case "CIMGeometricEffectArrow":return Math.abs(.5*S.width);case "CIMGeometricEffectBuffer":return Math.abs(S.size);case "CIMGeometricEffectControlMeasureLine":return 500;case "CIMGeometricEffectExtension":return Math.abs(S.length);case "CIMGeometricEffectJog":return Math.abs(.5*S.length);case "CIMGeometricEffectMove":return Math.max(Math.abs(v.getNumericValue(S.offsetX)),Math.abs(v.getNumericValue(S.offsetY))); case "CIMGeometricEffectOffset":return Math.abs(S.offset);case "CIMGeometricEffectOffsetTangent":return Math.abs(S.offset);case "CIMGeometricEffectRadial":return Math.abs(S.length);case "CIMGeometricEffectRegularPolygon":return Math.abs(S.radius);case "CIMGeometricEffectRotate":return 0;case "CIMGeometricEffectScale":return 0;case "CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(S.fromWidth),Math.abs(S.toWidth));case "CIMGeometricEffectWave":return Math.abs(S.amplitude);case "CIMGeometricEffectDonut":return Math.abs(S.width); default:return 0}}function B(S){if(!S)return 0;let V=0;for(const T of S)V+=A(T);return V}function C(S,V){if(S)switch(S.type){case "CIMPointSymbol":case "CIMLineSymbol":case "CIMPolygonSymbol":if(S=S.symbolLayers)for(const T of S)switch(V(T),T.type){case "CIMVectorMarker":if(S=T.markerGraphics)for(const Y of S)Y&&(S=Y.symbol)&&C(S,V)}}}function D(S,V,T){S.effects&&null==V.geometryEngine&&(V.geometryEnginePromise?T.push(V.geometryEnginePromise):v.isGeometryEngineRequired(S.effects)&&(V.geometryEnginePromise= v.importGeometryEngine(),T.push(V.geometryEnginePromise),V.geometryEnginePromise.then(Y=>V.geometryEngine=Y)))}function F(S){if(!S)return null;let V=null;const {cap:T,color:Y,join:ha,miterLimit:ba,style:U,width:Z}=S;"solid"!==U&&"none"!==U&&"esriSLSSolid"!==U&&"esriSLSNull"!==U&&(V=[{type:"CIMGeometricEffectDashes",dashTemplate:Q(U,T),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);return{type:"CIMSolidStroke",color:"esriSLSNull"!==U&&"none"!==U?R(Y):[0,0,0,0],capStyle:P(T),joinStyle:M(ha), miterLimit:ba,width:Z,effects:V}}const H=Math.PI,N=H/2,E=Math.PI/180,G=96/72,I=()=>p.getLogger("esri.symbols.cim.CIMSymbolHelper");class O{static getSymbolInflateSize(S,V,T,Y,ha){S||=[0,0,0,0];return V?this._getInflateSize(S,V,T,Y,ha):S}static safeSize(S){const V=Math.max(Math.abs(S[0]),Math.abs(S[2]));S=Math.max(Math.abs(S[1]),Math.abs(S[3]));return Math.sqrt(V*V+S*S)}static _vectorMarkerBounds(S,V,T,Y){let ha=!0;const ba=f.create();if(V?.markerGraphics)for(const U of V.markerGraphics)V=[0,0,0,0], U.geometry&&(c.getBoundsXY(ba,U.geometry),V[0]=0,V[1]=0,V[2]=0,V[3]=0,this.getSymbolInflateSize(V,U.symbol,T,0,Y),ba[0]+=V[0],ba[1]+=V[1],ba[2]+=V[2],ba[3]+=V[3],ha?(S[0]=ba[0],S[1]=ba[1],S[2]=ba[2],S[3]=ba[3],ha=!1):(S[0]=Math.min(S[0],ba[0]),S[1]=Math.min(S[1],ba[1]),S[2]=Math.max(S[2],ba[2]),S[3]=Math.max(S[3],ba[3])));return S}static _getInflateSize(S,V,T,Y,ha){return void 0!==V.symbolLayers?(S=this._getLayersInflateSize(S,V.symbolLayers,T,Y,ha),V=B(V.effects),0ea.width&&0{switch(ba.type){case "CIMSolidStroke":null!=ba.width&&(ba.width*=V);ba.effects?.forEach(U=>{"CIMGeometricEffectDashes"===U.type&&(U.dashTemplate=U.dashTemplate?.map(Z=> Z*V))});break;case "CIMVectorMarker":null!=ba.size&&(ba.size*=V),ba=ba.markerPlacement,null!=ba&&"placementTemplate"in ba&&(ba.placementTemplate=ba.placementTemplate.map(U=>U*V))}});for(var ha=this._getLineSymbolPeriod(S)||4;4>ha;)ha*=2;ha/=2;return{type:"CIMVectorMarker",frame:{xmin:-ha,xmax:ha,ymin:-Y,ymax:Y},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-ha,0],[ha,0]]]},symbol:S}],size:T}}static fetchResources(S,V,T,Y=null){if(!S||!V)return T;C(S,ha=>{D(ha,V,T);"url"in ha&&ha.url&& T.push(V.fetchResource(ha.url,{signal:Y}))});return T}static fetchFonts(S,V,T){if(S&&V)if("symbolLayers"in S&&S.symbolLayers)for(const ba of S.symbolLayers){if("CIMVectorMarker"===ba.type&&ba.markerGraphics)for(const U of ba.markerGraphics)U?.symbol&&L.fetchFonts(U.symbol,V,T)}else if("CIMTextSymbol"===S.type){const {fontFamilyName:ba,fontStyleName:U}=S;if(ba&&"calcitewebcoreicons"!==ba.toLowerCase()){var {style:Y,weight:ha}=v.fromCIMFontStyle(U);S=v.fromCIMFontDecoration(S);S=new e({family:ba,style:Y, weight:ha,decoration:S});T.push(V.loadFont(S).catch(()=>{I().error(`Unsupported font ${ba} in CIM symbol`)}))}}}static _getLineSymbolPeriod(S){if(S){const V=this._getEffectsRepeat(S.effects);if(V)return V;if(S.symbolLayers)for(const T of S.symbolLayers)if(T){if(S=this._getEffectsRepeat(T.effects))return S;switch(T.type){case "CIMCharacterMarker":case "CIMPictureMarker":case "CIMVectorMarker":case "CIMObjectMarker3D":case "CIMglTFMarker3D":if(S=this._getPlacementRepeat(T.markerPlacement))return S}}}return 0}static _getEffectsRepeat(S){if(S)for(var V of S)if(V)switch(V.type){case "CIMGeometricEffectDashes":if((S= V.dashTemplate)&&S.length){V=0;for(const T of S)V+=T;S.length&1&&(V*=2);return V}break;case "CIMGeometricEffectWave":return V.period;default:I().error(`unsupported geometric effect type ${V.type}`)}return 0}static _getPlacementRepeat(S){if(S)switch(S.type){case "CIMMarkerPlacementAlongLineSameSize":case "CIMMarkerPlacementAlongLineRandomSize":case "CIMMarkerPlacementAlongLineVariableSize":if((S=S.placementTemplate)&&S.length){let V=0;for(const T of S)V+=+T;S.length&1&&(V*=2);return V}}return 0}static fromCIMInsidePolygon(S){var V= S.markerPlacement;const T={...S,markerPlacement:null,anchorPoint:null};S=Math.abs(V.stepX);const Y=Math.abs(V.stepY);var ha=(V.randomness??100)/100;let ba,U;if("Random"===V.gridType){var Z=h.px2pt(n.randomInsidePolygonTextureSize);const ca=Math.max(Math.floor(Z/S),1),ea=Math.max(Math.floor(Z/Y),1);Z=ca*S/2;ba=ea*Y/2;U=2*ba;V=new k(V.seed);const da=ha*S/1.5,ia=ha*Y/1.5;ha=[];for(let ka=0;ka({type:"CIMMarkerGraphic",geometry:ca,symbol:{type:"CIMPointSymbol",symbolLayers:[T]}}));return{type:"CIMVectorMarker",frame:{xmin:-Z,xmax:Z,ymin:-ba,ymax:ba},markerGraphics:S,size:U}}}const P=S=>{if(!S)return w.LineCapStyle.Butt; switch(S){case "butt":return w.LineCapStyle.Butt;case "square":return w.LineCapStyle.Square;case "round":return w.LineCapStyle.Round}},M=S=>{if(!S)return w.LineJoinStyle.Miter;switch(S){case "miter":return w.LineJoinStyle.Miter;case "round":return w.LineJoinStyle.Round;case "bevel":return w.LineJoinStyle.Bevel}},K=S=>{if(null==S)return"Center";switch(S){case "left":return"Left";case "right":return"Right";case "center":return"Center"}},J=S=>{if(null==S)return"Center";switch(S){case "baseline":return"Baseline"; case "top":return"Top";case "middle":return"Center";case "bottom":return"Bottom"}},R=S=>{if(!S)return[0,0,0,0];const {r:V,g:T,b:Y,a:ha}=S;return[V,T,Y,255*ha]},Q=(S,V)=>{const T=q("safari")?.001:0;V="butt"===V;switch(S){case "dash":case "esriSLSDash":return V?[4,3]:[3,4];case "dash-dot":case "esriSLSDashDot":return V?[4,3,1,3]:[3,4,T,4];case "dot":case "esriSLSDot":return V?[1,3]:[T,4];case "long-dash":case "esriSLSLongDash":return V?[8,3]:[7,4];case "long-dash-dot":case "esriSLSLongDashDot":return V? [8,3,1,3]:[7,4,T,4];case "long-dash-dot-dot":case "esriSLSDashDotDot":return V?[8,3,1,3,1,3]:[7,4,T,4,T,4];case "short-dash":case "esriSLSShortDash":return V?[4,1]:[3,2];case "short-dash-dot":case "esriSLSShortDashDot":return V?[4,1,1,1]:[3,2,T,2];case "short-dash-dot-dot":case "esriSLSShortDashDotDot":return V?[4,1,1,1,1,1]:[3,2,T,2,T,2];case "short-dot":case "esriSLSShortDot":return V?[1,1]:[T,2];case "solid":case "esriSLSSolid":case "none":return I().error("Unexpected: style does not require rasterization"), [0,0];default:return I().error(`Tried to rasterize SLS, but found an unexpected style: ${S}!`),[0,0]}},W=(S,V=100)=>{var T=V/2,Y;if("circle"===S||"esriSMSCircle"===S){var ha=Math.acos(1-.25/T);V=Math.ceil(H/ha/4);0===V&&(V=1);ha=N/V;V*=4;S=[];S.push([T,0]);for(Y=1;Y=A[0]?"ltr":"rtl":""}function l(A,B){A=A.split("");const C=[];p(A,C,B);if(0!==B.hiLevel&&B.swap.substr(0,1)!==B.swap.substr(1,2))for(let H=0;Ha.swapTable[N][0])E=N+1;else{F=a.swapTable[N][1];break b}}A[D]=F}c(2,A,C,B);c(1,A,C,B);u=C;return A.join("")}function p(A,B,C){const D=A.length;var F=C.dir?a.impTabRtl:a.impTabLtr,H=0,N=-1;const E= [],G=[];C.hiLevel=C.dir;C.lastArabic=!1;C.hasUbatAl=!1;C.hasUbatB=!1;C.hasUbatS=!1;for(var I=0;I>8];E[O]=P=a.arabicAlefBetIntervalsBegine[B]&&A<=a.arabicAlefBetIntervalsEnd[B])return!0;return!1}function f(A,B,C,D){for(;B*C= A){for(H=F+1;H=A;)H++;for(N=H-1;F{F.lastArabic=!1;return a.ubatL},UBAT_R:()=>{F.lastArabic=!1;return a.ubatR},UBAT_ON:()=>a.ubatOn,UBAT_AN:()=>a.ubatAn,UBAT_EN:()=>F.lastArabic?a.ubatAn:a.ubatEn,UBAT_AL:()=>{F.lastArabic=!0;F.hasUbatAl=!0;return a.ubatR},UBAT_WS:()=>a.ubatOn,UBAT_CS:()=>{let H,N;if(1>D||D+1>=B.length||(H=C[D-1])!==a.ubatEn&&H!==a.ubatAn|| (N=B[D+1])!==a.ubatEn&&N!==a.ubatAn)return a.ubatOn;F.lastArabic&&(N=a.ubatAn);return N===H?N:a.ubatOn},UBAT_ES:()=>(0{if(0{if("VLTR"===F.inFormat){for(var H=B.length,N=D+1;N=H||64286===H)&&(N===a.ubatR||N===a.ubatAl)))return a.ubatR}return 1>D||B[D-1]===a.ubatB?a.ubatOn:C[D-1]},UBAT_B:()=>{F.lastArabic=!0;F.hasUbatB=!0;return F.dir},UBAT_S:()=>{F.hasUbatS=!0;return a.ubatOn},UBAT_LRE:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_RLE:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_LRO:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_RLO:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_PDF:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_BN:()=>a.ubatOn}[a.typesNames[B[D]]]()} function g(A,B){for(let C=0;C=A}function t(A){return"L"===A?"LTR":"R"===A?"RTL":"C"===A?"CLR":"D"===A?"CRL":""}function w(A,B){for(let C=0;CB||!C&&A[F]===B)A[F]+=D}class m{constructor(){this.inputFormat="ILYNN";this.outputFormat="VLNNN";this.sourceToTarget=[];this.targetToSource= [];this.levels=[]}bidiTransform(A,B,C){this.sourceToTarget=[];this.targetToSource=[];if(!A)return"";var D=this.sourceToTarget,F=this.targetToSource,H=A.length;r=[];u=[];for(var N=0;ND[F]?(N=B.charCodeAt(F),"\ufef5"<=D[F]&&"\ufefc">=D[F]?(C?(0-J&&RR&&(R=-R);for(var W=0,S=.5*R;W>S;)W-=R;for(;W<-S;)W+=R;var V=c.create();e.getBoundsXY(V,M);V[0]-=S;V[1]-=S;V[2]+=S;V[3]+=S;for(var T=[[V[0],V[1]], [V[0],V[3]],[V[2],V[3]],[V[2],V[1]]];180Q;)Q+=180;V=Math.cos(Q*H);var Y=Math.sin(Q*H);Q=-R*Y;S=R*V;W=z.getNumericValue(K.offsetX)*J;J*=z.getNumericValue(K.offsetY);W=W*Y-J*V;var ha;var ba=J=Number.MAX_VALUE;var U=ha=-Number.MAX_VALUE;for(var Z of T){var ca=Z[0];const ea=Z[1];T=V*ca+Y*ea;ca=-Y*ca+V*ea;ba=Math.min(ba,T);J=Math.min(J,ca);U=Math.max(U,T);ha=Math.max(ha,ca)}J=Math.floor(J/R)*R;Z=V*ba-Y*J-Q*W/R;ba=Y*ba+V*J-S*W/R;T=V*U-Y*J-Q*W/R;V=Y*U+V*J-S*W/R;R=1+Math.round((ha-J)/R); W=[];for(Y=0;Y=R)){var Q=J.width;J=J.height;if(Q&&J){J=Q/J;var W=z.getNumericValue(M.scaleX,1);Q=N.createIdentity();var S=M.anchorPoint;if(S){var V=S.x;S=S.y;"Absolute"!==M.anchorPointUnits&&(V*=R*J*W,S*=R);Q.translate(-V,-S)}J=z.getNumericValue(M.rotation);M.rotateClockwise&&(J=-J);this._mapRotation&& (J+=this._mapRotation);J&&Q.rotate(J*H);J=z.getNumericValue(M.offsetX);W=z.getNumericValue(M.offsetY);if(J||W){if(this._mapRotation){S=H*this._mapRotation;V=Math.cos(S);S=Math.sin(S);const T=J*S+W*V;J=J*V-W*S;W=T}Q.translate(J,W)}J=this.geomUnitsPerPoint();1!==J&&Q.scale(J,J);(J=K.getAngle())&&Q.rotate(J);Q.translate(K.tx,K.ty);this.push(Q,!1);this.drawImage(M,R);this.pop()}}}}drawVectorMarker(M,K){if(M){var J=M.markerGraphics;if(J){var R=z.getNumericValue(M.size,r.defaultCIMValues.CIMVectorMarker.size), Q=M.frame,W=Q?Q.ymax-Q.ymin:0;W=R&&W?R/W:1;R=N.createIdentity();Q&&R.translate(.5*-(Q.xmax+Q.xmin),.5*-(Q.ymax+Q.ymin));var S=M.anchorPoint;if(S){var V=S.x;S=S.y;"Absolute"!==M.anchorPointUnits?Q&&(V*=Q.xmax-Q.xmin,S*=Q.ymax-Q.ymin):(V/=W,S/=W);R.translate(-V,-S)}1!==W&&R.scale(W,W);Q=z.getNumericValue(M.rotation);M.rotateClockwise&&(Q=-Q);this._mapRotation&&(Q+=this._mapRotation);Q&&R.rotate(Q*H);Q=z.getNumericValue(M.offsetX);W=z.getNumericValue(M.offsetY);if(Q||W){if(this._mapRotation){S=H*this._mapRotation; V=Math.cos(S);S=Math.sin(S);const T=Q*S+W*V;Q=Q*V-W*S;W=T}R.translate(Q,W)}Q=this.geomUnitsPerPoint();1!==Q&&R.scale(Q,Q);(Q=K.getAngle())&&R.rotate(Q);R.translate(K.tx,K.ty);this.push(R,M.scaleSymbolsProportionally);for(const T of J)if(T?.symbol&&T.geometry||p.getLogger("esri.symbols.cim.CIMSymbolDrawHelper").error("Invalid marker graphic",T),M=T.textString,"number"===typeof M&&(M=M.toString()),this.drawSymbol(T.symbol,T.geometry,M),this._earlyReturn)break;this.pop()}}}drawTextSymbol(M,K,J){if(M&& d.isPoint(K)&&!(0>=z.getNumericValue(M.height,r.defaultCIMValues.CIMTextSymbol.height))){var R=N.createIdentity(),Q=z.getNumericValue(M.angle);(Q=-Q)&&R.rotate(Q*H);Q=z.getNumericValue(M.offsetX);var W=z.getNumericValue(M.offsetY);(Q||W)&&R.translate(Q,W);Q=this.geomUnitsPerPoint();1!==Q&&R.scale(Q,Q);R.translate(K.x,K.y);this.push(R,!1);this.drawText(M,J);this.pop()}}}class G extends E{constructor(M,K){super(M,K);this.reset()}reset(){this._xmin=this._ymin=Infinity;this._xmax=this._ymax=-Infinity; this._clipCount=0}envelope(){return new x(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return c.fromValues(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(M){!M||0=J||(K=Math.max(.5*this.transformSize(z.getNumericValue(J, r.defaultCIMValues.CIMSolidStroke.width)),.25),d.isPolygon(M)?this._processPath(M.rings,K):d.isPolyline(M)?this._processPath(M.paths,K):d.isExtent(M)?(M=L(M))&&this._processPath(M.rings,K):console.error("drawSolidStroke unexpected geometry type!"))}drawMarkerLayer(M,K){d.isPolygon(K)&&M.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===M.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===M.markerPlacement.type&&M.markerPlacement.clipAtBoundary)?this._processPath(K.rings,0):super.drawMarkerLayer(M, K)}drawHatchFill(M,K){this.drawSolidFill(M)}drawPictureFill(M,K){this.drawSolidFill(M)}drawGradientFill(M,K){this.drawSolidFill(M)}drawPictureStroke(M,K){this.drawSolidStroke(M,null,K.width)}drawGradientStroke(M,K){this.drawSolidStroke(M,null,K.width)}pushClipPath(M){this.drawSolidFill(M);this._clipCount++}popClipPath(){this._clipCount--}drawImage(M,K){var {url:J}=M;M=z.getNumericValue(M.scaleX,1);let R=M*K;var Q=K;J=this._resourceManager.getResource(J);null!=J&&(Q=J.height/J.width,R=M*(K?1this._xmax&&(this._xmax=M[0]+K);M[1]- Kthis._ymax&&(this._ymax=M[1]+K)}}class I extends E{constructor(){super(...arguments);this._searchPoint=[0,0];this._searchDistPoint=0;this._textInfo=null}hitTest(M,K,J,R,Q,W){W*=h.pt2px(1);this.setTransform();this.setGeomUnitsPerPoint(W);this._searchPoint=[(M[0]+M[2])/2,(M[1]+M[3])/2];this._searchDistPoint=(M[2]-M[0])/2/W;this._textInfo=R;this._mapRotation=K&&("CIMPointSymbol"===K.type&&"Map"!==K.angleAlignment||"CIMTextSymbol"===K.type)?Q:0;q("esri-mobile")|| (M=h.px2pt(A.hittestToleranceSmallSymbol*window.devicePixelRatio),R=h.px2pt(A.hittestSmallSymbolThreshold),("CIMLineSymbol"!==K?.type&&"CIMPolygonSymbol"!==K?.type||!K.symbolLayers?.some(z.isCIMFill))&&"CIMMeshSymbol"!==K?.type&&(z.getSize(K)??0)V.xTopLeft&&K-V.yBottomRight&&J<-V.yTopLeft){this._earlyReturn= !0;break}}}_hitTestFill(M){let K=null;if(d.isExtent(M))K=[[[M.xmin,M.ymin],[M.xmin,M.ymax],[M.xmax,M.ymax],[M.xmax,M.ymin],[M.xmin,M.ymin]]];else if(d.isPolygon(M))K=M.rings;else if(d.isPolyline(M))K=M.paths;else return;M=this.reverseTransformPt(this._searchPoint);let J=0;for(var R of K){const Q=R.length;for(let W=1;WM[1]!==V[1]>M[1]&&(0<(V[0]-S[0])*(M[1]-S[1])-(V[1]-S[1])*(M[0]-S[0])?J++:J--)}}0!==J&&(this._earlyReturn=!0);this._earlyReturn||(R=this.reverseTransformScalar(this._searchDistPoint)* this.prevGeomUnitsPerPoint(),D(M,K,R)&&(this._earlyReturn=!0))}_hitTestStroke(M,K){let J=null;if(d.isExtent(M))J=[[[M.xmin,M.ymin],[M.xmin,M.ymax],[M.xmax,M.ymax],[M.xmax,M.ymin],[M.xmin,M.ymin]]];else if(d.isPolygon(M))J=M.rings;else if(d.isPolyline(M))J=M.paths;else return;M=this.reverseTransformPt(this._searchPoint);K=z.getNumericValue(K,r.defaultCIMValues.CIMSolidStroke.width)*this.geomUnitsPerPoint();const R=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();D(M, J,K/2+R)&&(this._earlyReturn=!0)}}class O extends E{constructor(M,K,J,R){super(K,J);this._applyAdditionalRenderProps=R;this._colorSubstitutionHelper=new w;this._ctx=M}drawSolidFill(M,K){if(M){if(d.isPolygon(M))this._buildPath(M.rings,!0);else if(d.isPolyline(M))this._buildPath(M.paths,!0);else if(d.isExtent(M))this._buildPath(L(M).rings,!0);else if(d.isMultipoint(M))console.log("CanvasDrawHelper.drawSolidFill - No implementation!");else return;M=this._ctx;M.fillStyle="string"===typeof K?K:"rgba("+ Math.round(K[0])+","+Math.round(K[1])+","+Math.round(K[2])+","+(K[3]??255)/255+")";M.fill("evenodd")}}drawSolidStroke(M,K,J,R,Q,W){if(M&&K&&0!==J){if(d.isPolygon(M))this._buildPath(M.rings,!0);else if(d.isPolyline(M))this._buildPath(M.paths,!1);else if(d.isExtent(M))this._buildPath(L(M).rings,!0);else{console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");return}M=this._ctx;M.strokeStyle="string"===typeof K?K:"rgba("+Math.round(K[0])+","+Math.round(K[1])+","+Math.round(K[2])+","+(K[3]?? 255)/255+")";M.lineWidth=Math.max(this.transformSize(J),.5);this._setCapStyle(R);this._setJoinStyle(Q);M.miterLimit=W;M.stroke()}}pushClipPath(M){this._ctx.save();if(d.isPolygon(M))this._buildPath(M.rings,!0);else if(d.isPolyline(M))this._buildPath(M.paths,!0);else if(d.isExtent(M))this._buildPath(L(M).rings,!0);else return;this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(M,K){const {colorSubstitutions:J,url:R,tintColor:Q}=M;M=z.getNumericValue(M.scaleX,1);var W=this._resourceManager.getResource(R); if(null!=W){var S=W.width/W.height*K,V=K;K||(S=W.width,V=W.height);var T=z.isSVGImage(R)||"src"in W&&z.isSVGImage(W.src);K="getFrame"in W?u.getFirstFrame(W):W;J&&(K=this._colorSubstitutionHelper.applyColorSubstituition(K,J));this._applyAdditionalRenderProps&&!T&&Q&&(K=this._colorSubstitutionHelper.tintImageData(K,Q));W=this.transformPt([0,0]);var [Y,ha]=this.getTransformAngle();T=this.transformSize(1);var ba=this._ctx;ba.save();ba.setTransform({m11:M*T*Y,m12:M*T*ha,m21:-T*ha,m22:T*Y,m41:W[0],m42:W[1]}); ba.drawImage(K,-S/2,-V/2,S,V);ba.restore()}}drawText(M,K){if(K&&0!==K.length&&(this._textRasterizer||(this._textRasterizer=new y),M=F(M),M.size*=this.transformSize(h.px2pt(1)),K=this._textRasterizer.rasterizeText(K,M))){var {size:J,anchorX:R,anchorY:Q,canvas:W}=K;K=J[0]*(R+.5);M=J[1]*(Q-.5);var S=this._ctx,V=this.transformPt([0,0]),[T,Y]=this.getTransformAngle();S.save();S.setTransform({m11:1*T,m12:1*Y,m21:-1*Y,m22:1*T,m41:V[0]-1*K,m42:V[1]+1*M});S.drawImage(W,0,0);S.restore()}}drawPictureFill(M, K){if(M){var {colorSubstitutions:J,height:R,offsetX:Q,offsetY:W,rotation:S,scaleX:V,tintColor:T,url:Y}=K;K=this._resourceManager.getResource(Y);if(null!=K){if(d.isPolygon(M))this._buildPath(M.rings,!0);else if(d.isPolyline(M))this._buildPath(M.paths,!0);else if(d.isExtent(M))this._buildPath(L(M).rings,!0);else if(d.isMultipoint(M))console.log("CanvasDrawHelper.drawPictureFill - No implementation!");else return;M=this._ctx;var ha=z.isSVGImage(Y)||"src"in K&&z.isSVGImage(K.src),ba="getFrame"in K?u.getFirstFrame(K): K;J&&(ba=this._colorSubstitutionHelper.applyColorSubstituition(ba,J));if(this._applyAdditionalRenderProps){if(ha||T&&(ba=this._colorSubstitutionHelper.tintImageData(ba,T)),ha=M.createPattern(ba,"repeat"),ba=this.transformSize(1),S||=0,Q=Q?ba*Q:0,W=W?ba*W:0,R&&=ba*R,ba=R?R/K.height:1,K=V&&R?V*R/K.width:1,0!==S||1!==ba||1!==K||0!==Q||0!==W){const U=new DOMMatrix;U.rotateSelf(0,0,-S).translateSelf(Q,W).scaleSelf(K,ba,1);ha.setTransform(U)}}else ha=M.createPattern(ba,"repeat");M.save();M.fillStyle=ha; M.fill("evenodd");M.restore()}}}drawPictureStroke(M,K){if(M){var {colorSubstitutions:J,capStyle:R,joinStyle:Q,miterLimit:W,tintColor:S,url:V,width:T}=K;K=this._resourceManager.getResource(V);if(null!=K){if(d.isPolygon(M))var Y=M.rings;else if(d.isPolyline(M))Y=M.paths;else if(d.isExtent(M))Y=L(M).rings;else{d.isMultipoint(M)&&console.log("CanvasDrawHelper.drawPictureStroke - No implementation!");return}T||(T=K.width);M=z.isSVGImage(V)||"src"in K&&z.isSVGImage(K.src);var ha="getFrame"in K?u.getFirstFrame(K): K;J&&(ha=this._colorSubstitutionHelper.applyColorSubstituition(ha,J));this._applyAdditionalRenderProps&&(M||S&&(ha=this._colorSubstitutionHelper.tintImageData(ha,S)));K=Math.max(this.transformSize(h.pt2px(T)),.5);M=K/ha.width;var ba=this._ctx;ha=ba.createPattern(ha,"repeat-y");ba.save();this._setCapStyle(R);this._setJoinStyle(Q);void 0!==W&&(ba.miterLimit=W);ba.lineWidth=K;var U;for(let ia of Y){ia=l.clone(ia);var Z=U=void 0,ca=void 0;let ka=Z=void 0;Y=ia;for(var ea=Y[0],da=1;da=Z-ca?(Y.splice(da-1,1),ea=U):(U=ea,ea=Y[da],da++),ca=Z;if(ia&&!(1>=ia.length))for(Y=this.transformPt(ia[0]),ca=1;caM?{spatialReference:M.spatialReference,rings:[[[M.xmin,M.ymin],[M.xmin,M.ymax],[M.xmax,M.ymax],[M.xmax,M.ymin],[M.xmin,M.ymin]]]}:null,P=(M,K,J)=>{switch(M){case "ExtraLeading":return 1+K/J;case "Multiple":return K;case "Exact":return K/J}};a.CIMSymbolDrawHelper=E;a.CanvasDrawHelper=O;a.EnvDrawHelper=G;a.HittestDrawHelper=I;a.Transformation=N;a.cDegToRad=H;a.lineGapType2LineHeight=P;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/core/fontUtils":function(){define(["exports","../config"],function(a,b){function q(g){if(!g)return"arial-unicode-ms";g=g.toLowerCase().split(" ").join("-");switch(g){case "serif":return"noto-serif";case "sans-serif":return"arial-unicode-ms";case "monospace":return"ubuntu-mono";case "fantasy":return"cabin-sketch";case "cursive":return"redressed";default:return g}}function l(g){const d=k(g)+h(g);return q(g.family)+(0{g.delete(d.fontFace)});f.clear();c.clear()};a.defaultFontFamily= "arial-unicode-ms";a.getFontFamily=q;a.getFullyQualifiedFontName=l;a.isCachedFontFace=function(g){return c.has(g)};a.loadFont=async function(g){const d=p(g),t=l(g),w=f.get(d);if(w)return w.promise;const v=new FontFace(g.family,`url('${b.fontsUrl}/woff2/${t}.${"woff2"}') format('${"woff2"}')`,{style:g.style,weight:g.weight}),m=document.fonts;if(m.has(v)&&"loading"===v.status)return v.loaded;g=v.load().then(()=>{m.add(v);return v});f.set(d,new e(v,g));c.add(v);return g};Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/geometry/GeometryCursor":function(){define(["exports","../core/lang","./geometryCursorCollectUtils","./support/jsonUtils","../layers/graphics/OptimizedGeometry"],function(a,b,q,l,p){function k(d){if(l.isPolygon(d))d=[d.rings,"esriGeometryPolygon"];else if(l.isPolyline(d))d=[d.paths,"esriGeometryPolyline"];else if(l.isMultipoint(d))d=[[d.points],"esriGeometryMultipoint"];else if(l.isExtent(d))d=[[[[d.xmin,d.ymin],[d.xmin,d.ymax],[d.xmax,d.ymax],[d.xmax,d.ymin],[d.xmin,d.ymin]]], "esriGeometryEnvelope"];else if(l.isPoint(d)){const t=[d.x,d.y];d.z&&t.push(d.z);d.m&&t.push(d.m);d=[[[t]],"esriGeometryPoint"]}else d=[[],"esriGeometryPolyline"];return d}class h{static fromOptimized(d,t,w=!1,v=!1,m=1){return(new f).initialize(d,t,w,v,m)}static fromJSON(d,t=!1,w=!1){const [v,m]=k(d);return(new c).initialize(v,m,t,w,1)}static fromOptimizedCIM(d,t,w=!1,v=!1,m=1){return(new e).initialize(d,t,w,v,m)}static fromJSONCIM(d,t=!1,w=!1,v=1){const [m,r]=k(d);return(new g).initialize(m,r,t, w,v)}static fromFeatureSetReader(d){const t=d.readGeometryForDisplay();d=d.geometryType;return t&&d?this.fromOptimized(t,d):null}static fromFeatureSetReaderCIM(d){const t=d.readGeometryForDisplay();d=d.geometryType;return t&&d?this.fromOptimizedCIM(t,d):null}static createEmptyOptimized(d,t=!1,w=!1,v=1){return(new f).initialize(new p,d,t,w,v)}static createEmptyJSON(d,t=!1,w=!1){return(new c).initialize([],d,t,w,1)}static createEmptyOptimizedCIM(d,t=!1,w=!1,v=1){return(new e).initialize(new p,d,t,w, v)}static createEmptyJSONCIM(d,t=!1,w=!1,v=1){return(new g).initialize([],d,t,w,v)}asJSON(){const d=q.collectMultipath(this);return"esriGeometryEnvelope"===this.geometryType?{xmin:d[0][0][0],ymin:d[0][0][1],xmax:d[0][2][0],ymax:d[0][2][1]}:"esriGeometryMultipoint"===this.geometryType?{points:d.flat()}:"esriGeometryPoint"===this.geometryType?{x:d[0][0][0],y:d[0][0][1]}:"esriGeometryPolygon"===this.geometryType?{rings:d}:{paths:d}}getCurrentRingArea(){if(3>this.pathSize)return 0;let d=0,t,w;this.seekPathStart(); if(!this.nextPoint())return 0;t=this.x;w=this.y;const v=t,m=w;for(;this.nextPoint();)d+=(t-this.x)*(w+this.y),t=this.x,w=this.y;return-.5*(d+(t-v)*(w+m))}invertY(){this.yFactor*=-1}}class f extends h{constructor(){super(...arguments);this._end=-1}initialize(d,t,w,v,m){this.hasZ=w;this.hasM=v;this.geometryType=t;this._stride=2+Number(w)+Number(v);this._geometry=d;this._pathIndex=-1;this._pathOffset=0;this._pointOffset=-this._stride;this._end=-1;this.yFactor=m;return this}reset(){this.initialize(this._geometry, this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(d){if(0<=d&&dd)for(;this._pathIndex>d&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(d){d=this._pathOffset+d*this._stride;return 0<=d&&d=this._pathOffset}nextPath(){if(this.pathIndex>=this.totalSize-1)return!1;0<=this._pathIndex&&(this._pathOffset+=this._stride*this.pathSize);this._pathIndex++;this._pointOffset=this._pathOffset-this._stride;this._end=this._pointOffset+this._stride+this._stride*this.pathSize;return!0}prevPath(){if(0>=this.pathIndex)return!1;this._pathIndex--;this._end=this._pathOffset;this._pathOffset-=this._stride*this.pathSize;this._pointOffset=this._pathOffset-this._stride;return!0}pathLength(){const d= this._end,t=this._stride,w=this._geometry.coords;let v=0;for(let m=this._pathOffset+t;md+t)}get pathSize(){const {lengths:d}=this._geometry;return this._geometry.isPoint?1:0>this._pathIndex||this._pathIndex>d.length-1?0:d[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(d){this._geometry.coords[this._pointOffset]= d}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(d){this._geometry.coords[this._pointOffset+1]=this.yFactor*d}get z(){return this._geometry.coords[this._pointOffset+2]}set z(d){this._geometry.coords[this._pointOffset+2]=d}get m(){return this._geometry.coords[this._pointOffset+(this.hasZ?3:2)]}set m(d){this._geometry.coords[this._pointOffset+3]=d}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}}class c extends h{initialize(d, t,w,v,m){this._paths=d;this.geometryType=t;this.hasZ=w;this.hasM=v;this._pathIndex=this._pointIndex=-1;this.yFactor=m;this._mIndex=this.hasZ?3:2;return this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(d){this._pathIndex=d;this._pointIndex=-1;return 0<=d&&dd.length).reduce((d,t)=>d+t)}get pathSize(){return 0>this._pathIndex||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(d){this._currentPoint[0]=d}get y(){return this.yFactor*this._currentPoint[1]}set y(d){this._currentPoint[1]=this.yFactor*d}get z(){return this._currentPoint[2]}set z(d){this._currentPoint[2]=d}get m(){return this._currentPoint[this._mIndex]}set m(d){this._currentPoint[this._mIndex]= d}get pathIndex(){return this._pathIndex}}class e extends f{initialize(d,t,w,v,m){super.initialize(d,t,w,v,m);this._controlPoints||(this._controlPoints=this._controlPoints=Array(this.totalSize).fill(void 0).map(r=>new Set));return this}startPath(){super.startPath();this._controlPoints.push(new Set)}clone(){const d=(new e).initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);d._controlPoints=this._controlPoints;return d}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(d){this._controlPoints[this.pathIndex].add(d)}getControlPointAt(d){return this._controlPoints[this.pathIndex].has(d)}} class g extends c{initialize(d,t,w,v,m){return super.initialize(d,t,w,v,m)}clone(){return(new g).initialize(b.clone(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][4]=1}getControlPoint(){return 1===this._paths[this.pathIndex][this._pointIndex][4]}setControlPointAt(d){this._paths[this.pathIndex][d][4]=1}getControlPointAt(d){return 1===this._paths[this.pathIndex][d][4]}}a.GeometryCursor=h;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/symbols/cim/CIMEffects":function(){define(["exports","../../geometry/GeometryCursor","../../geometry/support/TileClipper"],function(a,b,q){let l;class p{constructor(k){this._geometry=k}next(){const k=this._geometry;this._geometry=null;return k}}a.SimpleEffectCursor=p;a.clipCursorToTileExtent=function(k,h){l||=new q.TileClipper(0,0,0,1);var f="esriGeometryPolygon"===k.geometryType;const c=f?3:2;l.reset(f?q.GeometryType.Polygon:q.GeometryType.LineString);l.setPixelMargin(h+ 1);l.setExtent(512);let e;for(;k.nextPath();)if(!(k.pathSize>=this._dz;e>c&&(e=c);this._margin=e;this._xmin=c*this._xPos-e;this._ymin=c*this._yPos-e;this._xmax=this._xmin+c+2*e;this._ymax=this._ymin+c+2*e}reset(c){this._type=c;this._lines=[];this._starts=[];this._line=null;this._start=0}moveTo(c,e){this._pushLine();this._prevIsIn=this._isIn(c,e);this._moveTo(c,e,this._prevIsIn); this._prevPt=new b(c,e);this._firstPt=new b(c,e);this._dist=0}lineTo(c,e){const g=this._isIn(c,e),d=new b(c,e),t=b.distance(this._prevPt,d);if(g)if(this._prevIsIn)this._lineTo(c,e,!0);else{var w=this._prevPt;var v=d;c=this._intersect(v,w);this._start=this._dist+t*(1-this._r);this._lineTo(c.x,c.y,!0);this._lineTo(v.x,v.y,!0)}else if(this._prevIsIn)v=this._prevPt,w=d,c=this._intersect(v,w),this._lineTo(c.x,c.y,!0),this._lineTo(w.x,w.y,!1);else{const r=this._prevPt;if(!(r.x<=this._xmin&&d.x<=this._xmin|| r.x>=this._xmax&&d.x>=this._xmax||r.y<=this._ymin&&d.y<=this._ymin||r.y>=this._ymax&&d.y>=this._ymax)){c=[];if(r.xthis._xmin||r.x>this._xmin&&d.x=this._ymax?v=!0:c.push(new q(e,this._xmin,m))}if(r.xthis._xmax||r.x>this._xmax&&d.x=this._ymax?v=!0:c.push(new q(e,this._xmax,m));if(r.ythis._ymin|| r.y>this._ymin&&d.y=this._xmax?w=!0:c.push(new q(e,m,this._ymin));if(r.ythis._ymax||r.y>this._ymax&&d.y=this._xmax?w=!0:c.push(new q(e,m,this._ymax));if(0===c.length)w?v?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):v?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin, !0);else if(1c[1].ratio)this._start=this._dist+t*c[1].ratio,this._lineTo(c[1].x,c[1].y,!0),this._lineTo(c[0].x,c[0].y,!0);else for(this._start=this._dist+t*c[0].ratio,w=0;w=this._xmin&&c<=this._xmax&&e>=this._ymin&&e<=this._ymax}_intersect(c,e){let g,d,t;if(e.x>=this._xmin&&e.x<=this._xmax)d=e.y<=this._ymin?this._ymin:this._ymax,t=(d-c.y)/(e.y-c.y),g=c.x+t*(e.x-c.x);else if(e.y>=this._ymin&&e.y<=this._ymax)g=e.x<=this._xmin?this._xmin:this._xmax,t=(g-c.x)/(e.x-c.x),d=c.y+t*(e.y-c.y);else{d=e.y<=this._ymin?this._ymin:this._ymax;g=e.x<=this._xmin?this._xmin:this._xmax;const w=(g-c.x)/(e.x-c.x),v=(d-c.y)/(e.y-c.y);wthis._xmax&&(c=this._xmax),ethis._ymax&&(e=this._ymax)),c=Math.round((c-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+this._margin))*this._finalRatio),this._line.push(new b(c,e)),this._isV=this._isH=!1)}_lineTo(c,e,g){if(this._type!==a.GeometryType.Polygon)if(g){c= Math.round((c-(this._xmin+this._margin))*this._finalRatio);e=Math.round((e-(this._ymin+this._margin))*this._finalRatio);if(0this._xmax&&(c=this._xmax),ethis._ymax&&(e=this._ymax)),c=Math.round((c-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+ this._margin))*this._finalRatio),this._line&&0=this._line.length?this._isV=this._isH=!1:(g=this._line[this._line.length-2],this._isH=g.x===c,this._isV=g.y===e)):(this._isH=g.x===c,this._isV=g.y===e)):this._isV&&t?(g.x=c,g.y=e,g=this._line[this._line.length-2],g.x===c&&g.y===e?(this._line.pop(),1>=this._line.length?this._isV= this._isH=!1:(g=this._line[this._line.length-2],this._isH=g.x===c,this._isV=g.y===e)):(this._isH=g.x===c,this._isV=g.y===e)):(this._line.push(new b(c,e)),this._isH=d,this._isV=t))}else this._line.push(new b(c,e))}}class p{setExtent(c){this._ratio=4096===c?1:4096/c}get validateTessellation(){return 1>this._ratio}reset(c){this._lines=[];this._line=null}moveTo(c,e){this._line&&this._lines.push(this._line);this._line=[];const g=this._ratio;this._line.push(new b(c*g,e*g))}lineTo(c,e){const g=this._ratio; this._line.push(new b(c*g,e*g))}close(){const c=this._line;c&&!c[0].isEqual(c[c.length-1])&&c.push(c[0])}result(){this._line&&this._lines.push(this._line);return 0===this._lines.length?null:this._lines}}var k;(function(c){c[c.sideLeft=0]="sideLeft";c[c.sideRight=1]="sideRight";c[c.sideTop=2]="sideTop";c[c.sideBottom=3]="sideBottom"})(k||={});class h{static simplify(c,e,g){if(g){var d=-e,t=c+e,w=-e,v=c+e;c=[];e=[];var m=g.length;for(let r=0;rn.length)continue;let u=n[0], x;const y=n.length;for(let z=1;zx.y?(c.push(r),c.push(z),c.push(k.sideLeft),c.push(-1)):(e.push(r),e.push(z),e.push(k.sideLeft),e.push(-1))),u.x>=t&&(u.y=v&&(u.x>x.x?(c.push(r),c.push(z),c.push(k.sideBottom),c.push(-1)): (e.push(r),e.push(z),e.push(k.sideBottom),e.push(-1)))),u=x}0!==c.length&&0!==e.length&&(h.fillParent(g,e,c),h.fillParent(g,c,e),d=[],h.calcDeltas(d,e,c),h.calcDeltas(d,c,e),h.addDeltas(d,g))}}static fillParent(c,e,g){const d=g.length,t=e.length;for(let n=0;nd&&(d=w)}for(t=0;tc>=e&&c<=g||c>=g&&c<=e;a.Point=b;a.SimpleBuilder=p;a.TileClipper=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMImageColorSubstitutionHelper":function(){define(function(){class a{applyColorSubstituition(b,q){if(!q)return b;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const {width:l,height:p}=b,k=this._rasterizationCanvas,h=k.getContext("2d",{willReadFrequently:!0});b!==k&&(k.width=l,k.height=p,h.drawImage(b, 0,0,l,p));b=h.getImageData(0,0,l,p).data;if(q)for(var f of q)if(f&&f.oldColor&&4===f.oldColor.length&&f.newColor&&4===f.newColor.length){const [c,e,g,d]=f.oldColor,[t,w,v,m]=f.newColor;if(c!==t||e!==w||g!==v||d!==m)for(q=0;qq.length)return b;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas")); const {width:l,height:p}=b,k=this._rasterizationCanvas,h=k.getContext("2d",{willReadFrequently:!0});b!==k&&(k.width=l,k.height=p,h.drawImage(b,0,0,l,p));b=h.getImageData(0,0,l,p);b=new Uint8Array(b.data);q=[q[0]/255,q[1]/255,q[2]/255,q[3]/255];for(let f=0;fe.length)return null;var d=e[e.length-2];e=e[e.length-1];d=[e[0]-d[0], e[1]-d[1]];this._curveHelper.normalize(d);return[e[0]+d[1]*g,e[1]-d[0]*g]}}a.EffectArrow=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMCursor":function(){define(["exports","./CIMEffects","./CIMPlacements"],function(a,b,q){class l{constructor(k,h=!0,f=!0,c=0){this.isClosed=!1;this.geometryCursor=null;this.geometryCursor=!h&&"esriGeometryPolygon"===k.geometryType||!f&&"esriGeometryPolyline"===k.geometryType?null:k;this.geomUnitsPerPoint=c;this.iteratePath=this.iterateMultiPath= !1;this.internalPlacement=new q.Placement}next(){if(!this.geometryCursor)return null;const k=this.processMultiPath(this.geometryCursor);this.iterateMultiPath&&k||(this.geometryCursor=null);return k}processMultiPath(k){for(;this.iteratePath||k.pathIndex=c?[p,k]:this.getCoord2D(p,k,h,f,c);p=1<=e?[h,f]:this.getCoord2D(p,k,h,f,e);return[c,p]}getSubCurve(p,k,h){const f=b.GeometryCursor.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(f,p,k,h)?f:null}appendSubCurve(p,k,h,f){p.startPath();k.seekPathStart(); let c=0;var e=!0;if(!k.nextPoint())return!1;var g=k.x;let d=k.y;for(;k.nextPoint();){const t=this.getLength(g,d,k.x,k.y);if(0!==t){if(e){if(c+t>h){const w=(h-c)/t;let v=1;e=!1;c+t>=f&&(v=(f-c)/t,e=!0);(g=this.cut(g,d,k.x,k.y,w,v))&&p.pushPoints(g);if(e)break;e=!1}}else{if(c+t>f){(k=this.cut(g,d,k.x,k.y,0,(f-c)/t))&&p.pushPoint(k[1]);break}p.pushXY(k.x,k.y)}c+=t}g=k.x;d=k.y}return!0}getCIMPointAlong(p,k){if(!p.nextPoint())return null;let h=0,f,c,e,g;f=p.x;for(c=p.y;p.nextPoint();f=e,c=g){e=p.x;g=p.y; const d=this.getLength(f,c,e,g);if(0!==d){if(h+d>k)return this.getCoord2D(f,c,e,g,(k-h)/d);h+=d}}return null}offset(p,k,h,f,c){if(!p||2>p.length)return null;var e=0,g=p[e++];for(c=e;e=k)1>r&&(w=[w[0]-v[0],w[1]-v[1]],this.normalize(w),v=Math.sqrt((1+r)/2),v>1/f&&(v=-Math.abs(k)/v,d.push([t[0]-w[0]*v,t[1]-w[1]*v])));else switch(h){case q.GeometricEffectOffsetMethod.Mitered:if(g=Math.sqrt((1+r)/2),0r){d.push([t[0]+v[1]*k,t[1]-v[0]*k]);g=Math.floor(2.5*(1-r));if(0m?(d.push([t[0]+(v[1]+v[0])*k,t[1]+(v[1]-v[0])*k]),d.push([t[0]+(w[1]-w[0])*k,t[1]-(w[0]+w[1])*k])):(g=Math.sqrt((1+Math.abs(r))/2),w=[w[0]- v[0],w[1]-v[1]],this.normalize(w),v=k/g,d.push([t[0]-w[0]*v,t[1]-w[1]*v]))}}else w=[t[0]-g[0],t[1]-g[1]],this.normalize(w),d.push([t[0]+w[1]*k,t[1]-w[0]*k]);else w=[u[0]-t[0],u[1]-t[1]],this.normalize(w),d.push([t[0]+w[1]*k,t[1]-w[0]*k]);g=t;t=u}if(d.length<(e?3:2))return null;e&&d.push([d[0][0],d[0][1]]);return d}}a.CurveHelper=l;a.pixelTolerance=.03;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/enums":function(){define(["exports"],function(a){a.CapType=void 0; (function(b){b[b.BUTT=0]="BUTT";b[b.ROUND=1]="ROUND";b[b.SQUARE=2]="SQUARE";b[b.UNKNOWN=4]="UNKNOWN"})(a.CapType||(a.CapType={}));a.JoinType=void 0;(function(b){b[b.BEVEL=0]="BEVEL";b[b.ROUND=1]="ROUND";b[b.MITER=2]="MITER";b[b.UNKNOWN=4]="UNKNOWN"})(a.JoinType||(a.JoinType={}));a.Alignment=void 0;(function(b){b[b.SCREEN=0]="SCREEN";b[b.MAP=1]="MAP"})(a.Alignment||(a.Alignment={}));a.ExternalColorMixMode=void 0;(function(b){b[b.Tint=0]="Tint";b[b.Ignore=1]="Ignore";b[b.Multiply=99]="Multiply"})(a.ExternalColorMixMode|| (a.ExternalColorMixMode={}));a.ExtremityPlacement=void 0;(function(b){b.Both="Both";b.JustBegin="JustBegin";b.JustEnd="JustEnd";b.None="None"})(a.ExtremityPlacement||(a.ExtremityPlacement={}));a.FillMode=void 0;(function(b){b[b.Mosaic=0]="Mosaic";b[b.Centered=1]="Centered"})(a.FillMode||(a.FillMode={}));a.FontEffects=void 0;(function(b){b[b.Normal=0]="Normal";b[b.Superscript=1]="Superscript";b[b.Subscript=2]="Subscript"})(a.FontEffects||(a.FontEffects={}));a.FontEncoding=void 0;(function(b){b[b.MSSymbol= 0]="MSSymbol";b[b.Unicode=1]="Unicode"})(a.FontEncoding||(a.FontEncoding={}));a.FontType=void 0;(function(b){b[b.Unspecified=0]="Unspecified";b[b.TrueType=1]="TrueType";b[b.PSOpenType=2]="PSOpenType";b[b.TTOpenType=3]="TTOpenType";b[b.Type1=4]="Type1"})(a.FontType||(a.FontType={}));a.AngleAlignment=void 0;(function(b){b[b.Display=0]="Display";b[b.Map=1]="Map"})(a.AngleAlignment||(a.AngleAlignment={}));a.AnimatedSymbolRepeatType=void 0;(function(b){b.None="None";b.Loop="Loop";b.Oscillate="Oscillate"})(a.AnimatedSymbolRepeatType|| (a.AnimatedSymbolRepeatType={}));a.DominantSizeAxis=void 0;(function(b){b[b.Z=0]="Z";b[b.X=1]="X";b[b.Y=2]="Y"})(a.DominantSizeAxis||(a.DominantSizeAxis={}));a.RotationOrder=void 0;(function(b){b[b.XYZ=0]="XYZ";b[b.ZXY=1]="ZXY";b[b.YXZ=2]="YXZ"})(a.RotationOrder||(a.RotationOrder={}));a.BalloonCalloutStyle=void 0;(function(b){b[b.Rectangle=0]="Rectangle";b[b.RoundedRectangle=1]="RoundedRectangle";b[b.Oval=2]="Oval"})(a.BalloonCalloutStyle||(a.BalloonCalloutStyle={}));a.BlendingMode=void 0;(function(b){b[b.None= 0]="None";b[b.Alpha=1]="Alpha";b[b.Screen=2]="Screen";b[b.Multiply=3]="Multiply";b[b.Add=4]="Add"})(a.BlendingMode||(a.BlendingMode={}));a.BlockProgression=void 0;(function(b){b[b.TTB=0]="TTB";b[b.RTL=1]="RTL";b[b.BTT=2]="BTT"})(a.BlockProgression||(a.BlockProgression={}));a.BillBoardMode=void 0;(function(b){b[b.None=0]="None";b[b.SignPost=1]="SignPost";b[b.FaceNearPlane=2]="FaceNearPlane"})(a.BillBoardMode||(a.BillBoardMode={}));a.CGAAttributeType=void 0;(function(b){b[b.Float=0]="Float";b[b.String= 1]="String";b[b.Boolean=2]="Boolean"})(a.CGAAttributeType||(a.CGAAttributeType={}));a.ClippingType=void 0;(function(b){b[b.Intersect=0]="Intersect";b[b.Subtract=1]="Subtract"})(a.ClippingType||(a.ClippingType={}));a.GeometricEffectArrowType=void 0;(function(b){b.OpenEnded="OpenEnded";b.Block="Block";b.Crossed="Crossed"})(a.GeometricEffectArrowType||(a.GeometricEffectArrowType={}));a.GeometricEffectControlMeasureLineRule=void 0;(function(b){b.FullGeometry="FullGeometry";b.PerpendicularFromFirstSegment= "PerpendicularFromFirstSegment";b.ReversedFirstSegment="ReversedFirstSegment";b.PerpendicularToSecondSegment="PerpendicularToSecondSegment";b.SecondSegmentWithTicks="SecondSegmentWithTicks";b.DoublePerpendicular="DoublePerpendicular";b.OppositeToFirstSegment="OppositeToFirstSegment";b.TriplePerpendicular="TriplePerpendicular";b.HalfCircleFirstSegment="HalfCircleFirstSegment";b.HalfCircleSecondSegment="HalfCircleSecondSegment";b.HalfCircleExtended="HalfCircleExtended";b.OpenCircle="OpenCircle";b.CoverageEdgesWithTicks= "CoverageEdgesWithTicks";b.GapExtentWithDoubleTicks="GapExtentWithDoubleTicks";b.GapExtentMidline="GapExtentMidline";b.Chevron="Chevron";b.PerpendicularWithArc="PerpendicularWithArc";b.ClosedHalfCircle="ClosedHalfCircle";b.TripleParallelExtended="TripleParallelExtended";b.ParallelWithTicks="ParallelWithTicks";b.Parallel="Parallel";b.PerpendicularToFirstSegment="PerpendicularToFirstSegment";b.ParallelOffset="ParallelOffset";b.OffsetOpposite="OffsetOpposite";b.OffsetSame="OffsetSame";b.CircleWithArc= "CircleWithArc";b.DoubleJog="DoubleJog";b.PerpendicularOffset="PerpendicularOffset";b.LineExcludingLastSegment="LineExcludingLastSegment";b.MultivertexArrow="MultivertexArrow";b.CrossedArrow="CrossedArrow";b.ChevronArrow="ChevronArrow";b.ChevronArrowOffset="ChevronArrowOffset";b.PartialFirstSegment="PartialFirstSegment";b.Arch="Arch";b.CurvedParallelTicks="CurvedParallelTicks";b.Arc90Degrees="Arc90Degrees";b.TipWithPerpendicularAndTicks="TipWithPerpendicularAndTicks"})(a.GeometricEffectControlMeasureLineRule|| (a.GeometricEffectControlMeasureLineRule={}));a.GeometricEffectDonutMethod=void 0;(function(b){b.Mitered="Mitered";b.Bevelled="Bevelled";b.Rounded="Rounded";b.Square="Square";b.TrueBuffer="TrueBuffer"})(a.GeometricEffectDonutMethod||(a.GeometricEffectDonutMethod={}));a.GeometricEffectEnclosingPolygonMethod=void 0;(function(b){b.ClosePath="ClosePath";b.ConvexHull="ConvexHull";b.RectangularBox="RectangularBox"})(a.GeometricEffectEnclosingPolygonMethod||(a.GeometricEffectEnclosingPolygonMethod={})); a.GeometricEffectExtensionOrigin=void 0;(function(b){b.BeginningOfLine="BeginningOfLine";b.EndOfLine="EndOfLine"})(a.GeometricEffectExtensionOrigin||(a.GeometricEffectExtensionOrigin={}));a.GeometricEffectOffsetMethod=void 0;(function(b){b.Mitered="Mitered";b.Bevelled="Bevelled";b.Rounded="Rounded";b.Square="Square"})(a.GeometricEffectOffsetMethod||(a.GeometricEffectOffsetMethod={}));a.GeometricEffectOffsetOption=void 0;(function(b){b.Fast="Fast";b.Accurate="Accurate"})(a.GeometricEffectOffsetOption|| (a.GeometricEffectOffsetOption={}));a.GeometricEffectOffsetTangentMethod=void 0;(function(b){b.BeginningOfLine="BeginningOfLine";b.EndOfLine="EndOfLine"})(a.GeometricEffectOffsetTangentMethod||(a.GeometricEffectOffsetTangentMethod={}));a.GeometricEffectWaveform=void 0;(function(b){b.Sinus="Sinus";b.Square="Square";b.Triangle="Triangle";b.Random="Random"})(a.GeometricEffectWaveform||(a.GeometricEffectWaveform={}));a.GlyphHinting=void 0;(function(b){b[b.None=0]="None";b[b.Default=1]="Default";b[b.Force= 2]="Force"})(a.GlyphHinting||(a.GlyphHinting={}));a.GradientAlignment=void 0;(function(b){b[b.Buffered=0]="Buffered";b[b.Left=1]="Left";b[b.Right=2]="Right";b[b.AlongLine=3]="AlongLine"})(a.GradientAlignment||(a.GradientAlignment={}));a.GradientFillMethod=void 0;(function(b){b[b.Linear=0]="Linear";b[b.Rectangular=1]="Rectangular";b[b.Circular=2]="Circular";b[b.Buffered=3]="Buffered"})(a.GradientFillMethod||(a.GradientFillMethod={}));a.GradientStrokeType=void 0;(function(b){b[b.Discrete=0]="Discrete"; b[b.Continuous=1]="Continuous"})(a.GradientStrokeType||(a.GradientStrokeType={}));a.GradientStrokeMethod=void 0;(function(b){b[b.AcrossLine=0]="AcrossLine";b[b.AloneLine=1]="AloneLine"})(a.GradientStrokeMethod||(a.GradientStrokeMethod={}));a.HorizontalAlignment=void 0;(function(b){b[b.Left=0]="Left";b[b.Right=1]="Right";b[b.Center=2]="Center";b[b.Justify=3]="Justify"})(a.HorizontalAlignment||(a.HorizontalAlignment={}));a.LeaderLineStyle=void 0;(function(b){b[b.Base=0]="Base";b[b.MidPoint=1]="MidPoint"; b[b.ThreePoint=2]="ThreePoint";b[b.FourPoint=3]="FourPoint";b[b.Underline=4]="Underline";b[b.CircularCW=5]="CircularCW";b[b.CircularCCW=6]="CircularCCW"})(a.LeaderLineStyle||(a.LeaderLineStyle={}));a.LineCapStyle=void 0;(function(b){b.Butt="Butt";b.Round="Round";b.Square="Square"})(a.LineCapStyle||(a.LineCapStyle={}));a.LineDashEnding=void 0;(function(b){b.NoConstraint="NoConstraint";b.HalfPattern="HalfPattern";b.HalfGap="HalfGap";b.FullPattern="FullPattern";b.FullGap="FullGap";b.Custom="Custom"})(a.LineDashEnding|| (a.LineDashEnding={}));a.LineDecorationStyle=void 0;(function(b){b[b.None=-1]="None";b[b.Custom=0]="Custom";b[b.Circle=1]="Circle";b[b.OpenArrow=2]="OpenArrow";b[b.ClosedArrow=3]="ClosedArrow";b[b.Diamond=4]="Diamond"})(a.LineDecorationStyle||(a.LineDecorationStyle={}));a.LineGapType=void 0;(function(b){b[b.ExtraLeading=0]="ExtraLeading";b[b.Multiple=1]="Multiple";b[b.Exact=2]="Exact"})(a.LineGapType||(a.LineGapType={}));a.LineJoinStyle=void 0;(function(b){b.Bevel="Bevel";b.Round="Round";b.Miter= "Miter"})(a.LineJoinStyle||(a.LineJoinStyle={}));a.ExpressionReturnType=void 0;(function(b){b[b.Default=0]="Default";b[b.String=1]="String";b[b.Numeric=2]="Numeric"})(a.ExpressionReturnType||(a.ExpressionReturnType={}));a.MarkerPlacementType=void 0;(function(b){b[b.InsidePolygon=0]="InsidePolygon";b[b.PolygonCenter=1]="PolygonCenter";b[b.RandomlyInsidePolygon=2]="RandomlyInsidePolygon"})(a.MarkerPlacementType||(a.MarkerPlacementType={}));a.MaterialMode=void 0;(function(b){b[b.Tint=0]="Tint";b[b.Replace= 1]="Replace";b[b.Multiply=2]="Multiply"})(a.MaterialMode||(a.MaterialMode={}));a.PlacementClip=void 0;(function(b){b[b.ClipAtBoundary=0]="ClipAtBoundary";b[b.RemoveIfCenterOutsideBoundary=1]="RemoveIfCenterOutsideBoundary";b[b.DoNotTouchBoundary=2]="DoNotTouchBoundary";b[b.DoNotClip=3]="DoNotClip"})(a.PlacementClip||(a.PlacementClip={}));a.PlacementEndings=void 0;(function(b){b.NoConstraint="NoConstraint";b.WithMarkers="WithMarkers";b.WithFullGap="WithFullGap";b.WithHalfGap="WithHalfGap";b.Custom= "Custom"})(a.PlacementEndings||(a.PlacementEndings={}));a.PlacementGridType=void 0;(function(b){b.Fixed="Fixed";b.Random="Random";b.RandomFixedQuantity="RandomFixedQuantity"})(a.PlacementGridType||(a.PlacementGridType={}));a.PlacementOnLineRelativeTo=void 0;(function(b){b.LineMiddle="LineMiddle";b.LineBeginning="LineBeginning";b.LineEnd="LineEnd";b.SegmentMidpoint="SegmentMidpoint"})(a.PlacementOnLineRelativeTo||(a.PlacementOnLineRelativeTo={}));a.PlacementPolygonCenterMethod=void 0;(function(b){b.OnPolygon= "OnPolygon";b.CenterOfMass="CenterOfMass";b.BoundingBoxCenter="BoundingBoxCenter"})(a.PlacementPolygonCenterMethod||(a.PlacementPolygonCenterMethod={}));a.PlacementRandomlyAlongLineRandomization=void 0;(function(b){b[b.Low=0]="Low";b[b.Medium=1]="Medium";b[b.High=2]="High"})(a.PlacementRandomlyAlongLineRandomization||(a.PlacementRandomlyAlongLineRandomization={}));a.PlacementStepPosition=void 0;(function(b){b[b.MarkerCenter=0]="MarkerCenter";b[b.MarkerBounds=1]="MarkerBounds"})(a.PlacementStepPosition|| (a.PlacementStepPosition={}));a.PointSymbolCalloutScale=void 0;(function(b){b[b.None=0]="None";b[b.PropUniform=1]="PropUniform";b[b.PropNonuniform=2]="PropNonuniform";b[b.DifUniform=3]="DifUniform";b[b.DifNonuniform=4]="DifNonuniform"})(a.PointSymbolCalloutScale||(a.PointSymbolCalloutScale={}));a.Simple3DLineStyle=void 0;(function(b){b.Tube="Tube";b.Strip="Strip";b.Wall="Wall"})(a.Simple3DLineStyle||(a.Simple3DLineStyle={}));a.SizeVariationMethod=void 0;(function(b){b[b.Random=0]="Random";b[b.Increasing= 1]="Increasing";b[b.Decreasing=2]="Decreasing";b[b.IncreasingThenDecreasing=3]="IncreasingThenDecreasing"})(a.SizeVariationMethod||(a.SizeVariationMethod={}));a.SymbolUnits=void 0;(function(b){b[b.Relative=0]="Relative";b[b.Absolute=1]="Absolute"})(a.SymbolUnits||(a.SymbolUnits={}));a.TextCase=void 0;(function(b){b[b.Normal=0]="Normal";b[b.LowerCase=1]="LowerCase";b[b.Allcaps=2]="Allcaps"})(a.TextCase||(a.TextCase={}));a.TextReadingDirection=void 0;(function(b){b[b.LTR=0]="LTR";b[b.RTL=1]="RTL"})(a.TextReadingDirection|| (a.TextReadingDirection={}));a.TextureFilter=void 0;(function(b){b.Draft="Draft";b.Picture="Picture";b.Text="Text"})(a.TextureFilter||(a.TextureFilter={}));a.VerticalAlignment=void 0;(function(b){b[b.Top=0]="Top";b[b.Center=1]="Center";b[b.Baseline=2]="Baseline";b[b.Bottom=3]="Bottom"})(a.VerticalAlignment||(a.VerticalAlignment={}));a.VerticalGlyphOrientation=void 0;(function(b){b[b.Right=0]="Right";b[b.Upright=1]="Upright"})(a.VerticalGlyphOrientation||(a.VerticalGlyphOrientation={}));a.WaterbodySize= void 0;(function(b){b[b.Small=0]="Small";b[b.Medium=1]="Medium";b[b.Large=2]="Large"})(a.WaterbodySize||(a.WaterbodySize={}));a.WaveStrength=void 0;(function(b){b[b.Calm=0]="Calm";b[b.Rippled=1]="Rippled";b[b.Slight=2]="Slight";b[b.Moderate=3]="Moderate"})(a.WaveStrength||(a.WaveStrength={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectBuffer":function(){define("exports ../../../geometry ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../CIMEffects ../CurveHelper ../enums ../../../geometry/SpatialReference".split(" "), function(a,b,q,l,p,k,h,f){class c{static local(){null===c.instance&&(c.instance=new c);return c.instance}execute(g,d,t,w,v,m){return new e(g,d,t,w,v,m)}}c.instance=null;class e{constructor(g,d,t,w,v,m){this._inputGeometries=g;this._tileKey=w;this._geometryEngine=v;this._curveHelper=new k.CurveHelper;this._size=(void 0!==d.size?d.size:1)*t;this._maxInflateSize=m*t;this._offsetFlattenError=k.pixelTolerance*t}next(){for(var g;g=this._inputGeometries.next();){if(0===this._size)return g;if("esriGeometryEnvelope"=== g.geometryType)if(0this._size&&(d=g.asJSON(),0.95*v&&(t=.95*v);v=.5*m;var r=this._leftPerp(w);t=[d[0]+w[0]*t,d[1]+ w[1]*t];var n=c.length-1;d=[];d.push(e?[-r[0],-r[1]]:r);var u=[-w[0],-w[1]];for(e=1;er?[-u[0],-u[1]]:u);u=w}d.push(this._rightPerp(u));for(n=d.length-1;0e.length)return[];const r=this._cp2(e,-4,1),n=this._cp3(e,r,.882353,-1.94),u=[];u.push(this._mid(r,n));u.push(d);c.push(u); break;case p.GeometricEffectControlMeasureLineRule.SecondSegmentWithTicks:if(3>e.length)return[];const x=this._cp2(e,-4,1),y=this._cp3(e,x,.882353,-1.94),z=this._sub(y,x);let A;A=0=Eb;Eb++)ia.push(this._add(ba,U)),this._rotateDirect(U,Z,ca);ia.push(ka);c.push(ia);break;case p.GeometricEffectControlMeasureLineRule.HalfCircleSecondSegment:const fa=this._cp2(e,0,-1),X=this._cp3(e,fa,1,-1);let ja=this._sub(d,fa);this._normalize(ja);const la=this._crossProduct(ja,this._sub(X,fa))/2;this._leftPerpendicular(ja);const na=[fa[0]+ja[0]*la,fa[1]+ja[1]*la];ja=this._sub(fa,na);const va=Math.cos(Math.PI/18);let za=Math.sin(Math.PI/18);0=Eb;Eb++)this._rotateDirect(ja, va,za),ya.push(this._add(na,ja));c.push(ya);break;case p.GeometricEffectControlMeasureLineRule.HalfCircleExtended:const Da=this._cp2(e,0,-2),ra=this._cp3(e,Da,1,-1);let xa;if(4<=g)xa=e[3];else{const Eb=this._sub(d,Da);xa=this._add(ra,Eb)}const Ma=this._dist(Da,ra)/2/.75,Ga=this._sub(Da,d);this._normalize(Ga,Ma);const Pa=this._sub(ra,xa);this._normalize(Pa,Ma);c.push([xa,ra]);const Qa=[this._clone(ra)];this._addBezier3(Qa,ra,this._add(ra,Pa),this._add(Da,Ga),Da,4);Qa.push(d);c.push(Qa);break;case p.GeometricEffectControlMeasureLineRule.OpenCircle:const Ea= this._cp2(e,-2,0),ua=this._sub(Ea,d),Na=Math.cos(Math.PI/18),Ua=-Math.sin(Math.PI/18),wa=[Ea];for(let Eb=1;33>=Eb;Eb++)this._rotateDirect(ua,Na,Ua),wa.push(this._add(d,ua));c.push(wa);break;case p.GeometricEffectControlMeasureLineRule.CoverageEdgesWithTicks:const sa=this._cp2(e,0,-1);let Ha;if(3<=g)Ha=e[2];else{const Eb=this._sub(sa,d),ec=this._leftPerp(Eb);Ha=[d[0]+ec[0]-.25*Eb[0],d[1]+ec[1]-.25*Eb[1]]}let Ka;if(4<=g)Ka=e[3];else{const Eb=this._mid(d,sa),ec=this._sub(d,sa);this._normalize(ec);this._leftPerpendicular(ec); const pc=this._crossProduct(ec,this._sub(Ha,Eb));this._rightPerpendicular(ec);Ka=[Ha[0]+ec[0]*pc*2,Ha[1]+ec[1]*pc*2]}const Aa=this._sub(sa,d);let Sa,Ya;Sa=0.95*ib&&(Xa=.95*ib);const eb=[d[0]+gb[0]*Xa,d[1]+gb[1]*Xa];let db=this._leftPerp(gb),jb=[];jb.push([eb[0]-db[0]*La,eb[1]-db[1]*La]);jb.push([eb[0]+db[0]*La,eb[1]+db[1]*La]);c.push(jb);if(4<=g){const Eb=e[3];let ec=this._dotProduct(gb,this._sub(Eb,d));ec<.1*ib?ec=.1*ib:ec>.9*ib&&(ec=.9*ib);const pc=[d[0]+gb[0]*ec,d[1]+gb[1]*ec],Fc=this._crossProduct(gb,this._sub(Eb,d)),Fe=[];Fe.push([pc[0]-db[0]*Fc,pc[1]-db[1]*Fc]);Fe.push([pc[0]+db[0]*Fc, pc[1]+db[1]*Fc]);c.push(Fe)}const nb=[Ia[0]+db[0]*La,Ia[1]+db[1]*La];db=this._sub(Ia,nb);const qb=Math.cos(Math.PI/18);let ub=Math.sin(Math.PI/18);0>La&&(ub=-ub);jb=[d,Ia];for(let Eb=1;9>=Eb;Eb++)this._rotateDirect(db,qb,ub),jb.push(this._add(nb,db));c.push(jb);break;case p.GeometricEffectControlMeasureLineRule.ClosedHalfCircle:const xb=this._cp2(e,2,0),pb=this._mid(d,xb),Bb=this._sub(xb,pb),Kb=Math.cos(Math.PI/18),bc=Math.sin(Math.PI/18),Ib=[d,xb];for(let Eb=1;18>=Eb;Eb++)this._rotateDirect(Bb,Kb, bc),Ib.push(this._add(pb,Bb));c.push(Ib);break;case p.GeometricEffectControlMeasureLineRule.TripleParallelExtended:const $b=this._cp2(e,0,-2),kc=this._cp3(e,$b,1,-2),fc=this._mid(d,$b),Pb=this._sub(kc,$b);this._normalize(Pb);const Cb=Math.abs(this._crossProduct(Pb,this._sub(fc,$b)))/2,Vb=this._dist($b,kc),gc=[$b,d];gc.push([d[0]+Pb[0]*Vb*.5,d[1]+Pb[1]*Vb*.5]);c.push(gc);const Lb=[];Lb.push([fc[0]-Pb[0]*Cb,fc[1]-Pb[1]*Cb]);Lb.push([fc[0]+Pb[0]*Vb*.375,fc[1]+Pb[1]*Vb*.375]);l.setId(Lb[Lb.length-1], 1);Lb.push([fc[0]+Pb[0]*Vb*.75,fc[1]+Pb[1]*Vb*.75]);c.push(Lb);c.push([$b,kc]);break;case p.GeometricEffectControlMeasureLineRule.ParallelWithTicks:const lb=this._cp2(e,3,0),oa=this._cp3(e,lb,.5,-1),Fa=this._sub(oa,lb);this._normalize(Fa);const Va=this._crossProduct(Fa,this._sub(oa,d));this._leftPerpendicular(Fa);this._addAngledTicks(c,d,lb,oa);this._addAngledTicks(c,this._mix(d,1,Fa,Va),this._mix(lb,1,Fa,Va),this._mid(d,lb));break;case p.GeometricEffectControlMeasureLineRule.Parallel:const Za=this._cp2(e, 3,0),fb=this._cp3(e,Za,.5,-1),kb=this._sub(Za,d);this._normalize(kb);const mb=this._leftPerp(kb),rb=this._crossProduct(kb,this._sub(fb,d));let tb=[d,Za];c.push(tb);tb=[];tb.push([d[0]+mb[0]*rb,d[1]+mb[1]*rb]);tb.push([Za[0]+mb[0]*rb,Za[1]+mb[1]*rb]);c.push(tb);break;case p.GeometricEffectControlMeasureLineRule.PerpendicularToFirstSegment:const yb=this._cp2(e,3,0),zb=this._cp3(e,yb,.5,-1),Ab=this._mid(d,yb),Fb=this._sub(yb,d);this._normalize(Fb);const Qb=this._crossProduct(Fb,this._sub(zb,d));this._leftPerpendicular(Fb); const sb=[];sb.push([Ab[0]-Fb[0]*Qb*.25,Ab[1]-Fb[1]*Qb*.25]);sb.push([Ab[0]+Fb[0]*Qb*1.25,Ab[1]+Fb[1]*Qb*1.25]);c.push(sb);break;case p.GeometricEffectControlMeasureLineRule.ParallelOffset:const vb=this._cp2(e,3,0),Gb=this._cp3(e,vb,.5,-1),Hb=this._sub(vb,d);this._normalize(Hb);const Tb=this._crossProduct(Hb,this._sub(Gb,d));this._leftPerpendicular(Hb);const lc=[];lc.push([d[0]-Hb[0]*Tb,d[1]-Hb[1]*Tb]);lc.push([vb[0]-Hb[0]*Tb,vb[1]-Hb[1]*Tb]);c.push(lc);const Ub=[];Ub.push([d[0]+Hb[0]*Tb,d[1]+Hb[1]* Tb]);Ub.push([vb[0]+Hb[0]*Tb,vb[1]+Hb[1]*Tb]);c.push(Ub);break;case p.GeometricEffectControlMeasureLineRule.OffsetOpposite:const Zb=this._cp2(e,3,0),ac=this._cp3(e,Zb,.5,-1),Mb=this._sub(Zb,d);this._normalize(Mb);const Jb=this._crossProduct(Mb,this._sub(ac,d));this._leftPerpendicular(Mb);const Wb=[];Wb.push([d[0]-Mb[0]*Jb,d[1]-Mb[1]*Jb]);Wb.push([Zb[0]-Mb[0]*Jb,Zb[1]-Mb[1]*Jb]);c.push(Wb);break;case p.GeometricEffectControlMeasureLineRule.OffsetSame:const cc=this._cp2(e,3,0),Db=this._cp3(e,cc,.5, -1),Nb=this._sub(cc,d);this._normalize(Nb);const hc=this._crossProduct(Nb,this._sub(Db,d));this._leftPerpendicular(Nb);const xc=[];xc.push([d[0]+Nb[0]*hc,d[1]+Nb[1]*hc]);xc.push([cc[0]+Nb[0]*hc,cc[1]+Nb[1]*hc]);c.push(xc);break;case p.GeometricEffectControlMeasureLineRule.CircleWithArc:let nc=this._cp2(e,3,0);const Xb=this._cp3(e,nc,.5,-1);let tc,Yb;if(4<=g)tc=e[3],Yb=0=Eb;Eb++)this._rotateDirect(dc,Gc,Cc),uc.push(this._add(d,dc));this._add90DegArc(uc,nc,tc,Xb,Yb);l.setId(uc[uc.length-8],1);c.push(uc);break;case p.GeometricEffectControlMeasureLineRule.DoubleJog:let oc=this._cp2(e,-3,1),yc=this._cp3(e,oc,-1,-.5),Dc;if(4<= g)Dc=e[3];else{const Eb=d;d=oc;Dc=yc;const ec=this._dist(d,Eb),pc=this._dist(Dc,Eb);let Fc=30*this._geomUnitsPerPoint;.5*ecthis._crossProduct(qc,this._sub(d,yc))?this._rotateDirect(qc,wc,wc):this._rotateDirect(qc,wc,-wc);zc=[];zc.push(yc);zc.push(this._add(Oc,qc));zc.push(this._sub(Oc,qc));zc.push(Dc);c.push(zc);break;case p.GeometricEffectControlMeasureLineRule.PerpendicularOffset:const rd=this._cp2(e,-4,1),Pd=this._cp3(e, rd,.882353,-1.94),ed=this._sub(Pd,rd);0.95*Rc-ad&&(Sc=.95*Rc-ad);const ud=[td[0]+vc[0]* Sc,td[1]+vc[1]*Sc],Tc=this._leftPerp(vc),Uc=[];Uc.push([ud[0]+Tc[0]*Pc+vc[0]*ad,ud[1]+Tc[1]*Pc+vc[1]*ad]);Uc.push(d);Uc.push([ud[0]-Tc[0]*Pc+vc[0]*ad,ud[1]-Tc[1]*Pc+vc[1]*ad]);c.push(Uc);break;case p.GeometricEffectControlMeasureLineRule.ChevronArrowOffset:const [Qc,Id]=this._arrowLastSeg(e),Ac=this._sub(d,Qc),gd=this._norm(Ac);this._normalize(Ac);const hd=this._crossProduct(Ac,this._sub(Id,Qc));let Ec=this._dotProduct(Ac,this._sub(Id,Qc));Ec<.05*gd?Ec=.05*gd:Ec>.95*gd&&(Ec=.95*gd);const id=[Qc[0]+ Ac[0]*Ec,Qc[1]+Ac[1]*Ec];this._leftPerpendicular(Ac);const Jd=[];Jd.push([id[0]+Ac[0]*hd*.5,id[1]+Ac[1]*hd*.5]);Jd.push(this._mid(id,d));Jd.push([id[0]-Ac[0]*hd*.5,id[1]-Ac[1]*hd*.5]);c.push(Jd);break;case p.GeometricEffectControlMeasureLineRule.PartialFirstSegment:const [jd,ye]=this._arrowLastSeg(e),kd=this._sub(d,jd),vd=this._norm(kd);this._normalize(kd);let bd=this._dotProduct(kd,this._sub(ye,jd));bd<.05*vd?bd=.05*vd:bd>.95*vd&&(bd=.95*vd);c.push([jd,[jd[0]+kd[0]*bd,jd[1]+kd[1]*bd]]);break;case p.GeometricEffectControlMeasureLineRule.Arch:const Kd= this._cp2(e,0,-1),wd=this._cp3(e,Kd,.5,1),Ld=this._sub(d,Kd),Td=this._mix(wd,1,Ld,.55),Ud=this._mix(wd,1,Ld,-.55),xd=[d];this._addBezier2(xd,d,Td,wd,4);this._addBezier2(xd,wd,Ud,Kd,4);c.push(xd);break;case p.GeometricEffectControlMeasureLineRule.CurvedParallelTicks:const Vc=this._cp2(e,-4,1),ld=this._cp3(e,Vc,.882353,-1.94),Zc=this._sub(ld,Vc);0Eb;Eb++){const ec=yd[2*Eb+1],pc=[this._clone(ec)];pc.push(this._add(ec,[Zc[0]/4,Zc[1]/4]));c.push(pc)}break;case p.GeometricEffectControlMeasureLineRule.Arc90Degrees:const zd=this._cp2(e,0,-1),Vd=this._cp3(e,zd,.5,1),Be=[zd];this._add90DegArc(Be,zd,d,Vd);c.push(Be);break;case p.GeometricEffectControlMeasureLineRule.TipWithPerpendicularAndTicks:const [Wd, Xd]=this._arrowLastSeg(e),Od=10*this._geomUnitsPerPoint,Wc=this._sub(d,Wd),Yd=this._norm(Wc);this._normalize(Wc);let $c=this._crossProduct(Wc,this._sub(Xd,Wd)),Zd=this._dotProduct(Wc,this._sub(Xd,Wd));Zd<.05*Yd?Zd=.05*Yd:Zd>.95*Yd-Od&&(Zd=.95*Yd-Od);const md=this._leftPerp(Wc),cd=[d[0]-Wc[0]*Od,d[1]-Wc[1]*Od],nd=.5*Math.max(Yd-Zd-Od,Od);$c=Math.abs($c);const $d=[];$d.push([cd[0]+md[0]*($c+nd)-Wc[0]*nd,cd[1]+md[1]*($c+nd)-Wc[1]*nd]);$d.push([cd[0]+md[0]*$c,cd[1]+md[1]*$c]);$d.push([cd[0]-md[0]*$c, cd[1]-md[1]*$c]);$d.push([cd[0]-md[0]*($c+nd)-Wc[0]*nd,cd[1]-md[1]*($c+nd)-Wc[1]*nd]);c.push($d);c.push([cd,d]);break;default:c.push(e)}}return c}}a.EffectControlMeasureLine=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectCut":function(){define(["exports","../../../geometry/GeometryCursor","../CIMCursor","../CurveHelper"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h, f,c)}}p.instance=null;class k extends q.PathEffectCursor{constructor(h,f,c){super(h,!0,!0);this._curveHelper=new l.CurveHelper;this._beginCut=(void 0!==f.beginCut?f.beginCut:1)*c;this._endCut=(void 0!==f.endCut?f.endCut:1)*c;this._middleCut=(void 0!==f.middleCut?f.middleCut:0)*c;this._invert=void 0!==f.invert?f.invert:!1;0>this._beginCut&&(this._beginCut=0);0>this._endCut&&(this._endCut=0);0>this._middleCut&&(this._middleCut=0)}processPath(h){const {_beginCut:f,_endCut:c,_middleCut:e}=this,g=h.pathLength(), d=b.GeometryCursor.createEmptyOptimizedCIM("esriGeometryPolyline");if(!this._invert)if(0===f&&0===c&&0===e)for(d.startPath();h.nextPoint();)d.pushXY(h.x,h.y);else f+c+e=g)for(d.startPath();h.nextPoint();)d.pushXY(h.x,h.y);else this._curveHelper.appendSubCurve(d,h,0,f),this._curveHelper.appendSubCurve(d,h, .5*(g-e),.5*(g+e)),this._curveHelper.appendSubCurve(d,h,g-c,c);return 0===d.totalSize?null:d}}a.EffectCut=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectDashes":function(){define("exports ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../../../geometry/support/coordsUtils ../CIMCursor ../enums ../GeometryWalker ../utils".split(" "),function(a,b,q,l,p,k,h,f){class c{static local(){null===c.instance&&(c.instance=new c); return c.instance}execute(g,d,t,w,v){return new e(g,d,t,w)}}c.instance=null;class e extends p.PathEffectCursor{constructor(g,d,t,w){super(g,!0,!0);this._firstCurve=null;this._walker=new h.GeometryWalker;this._walker.updateTolerance(t);this._endings=d.lineDashEnding;this._customDashPos=-(d.offsetAlongLine??0)*t;this._offsetAtEnd=(d.customEndingOffset??0)*t;this._tileKey=w;g=f.normalizeDashTemplate(d).dashTemplate;null==g&&(g=[]);g.length%2&&(g=[...g,...g]);d=0;for(w=0;wv&&(v=1E-7);d+=v}this._patternLength=d;this._numOfDashesPerPattern=g.length/2;this._pattern=new h.DashPattern;this._pattern.init(g,!0);this._pattern.scale(t)}processPath(g){if(0===this._pattern.length())return this.iteratePath=!1,g=q.collectPath(g),b.GeometryCursor.fromJSONCIM({paths:[g]});if(!this.iteratePath){var d=!0;switch(this._endings){default:this._pattern.extPtGap=0;break;case k.LineDashEnding.FullPattern:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case k.LineDashEnding.FullGap:this.isClosed|| (this._pattern.extPtGap=.5*this._pattern.lastValue());break;case k.LineDashEnding.NoConstraint:this.isClosed||(d=!1);break;case k.LineDashEnding.Custom:this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}var t=g.pathLength();if(this._pattern.isEmpty()||t<.1*this._pattern.length()||!this._walker.init(g,this._pattern,d))return g=q.collectPath(g),b.GeometryCursor.fromJSONCIM({paths:[g]})}if(this.iteratePath)g=this._pattern.nextValue();else{switch(this._endings){default:d=.5*this._pattern.firstValue(); break;case k.LineDashEnding.HalfGap:d=.5*-this._pattern.lastValue();break;case k.LineDashEnding.FullGap:d=-this._pattern.lastValue();break;case k.LineDashEnding.FullPattern:d=0;break;case k.LineDashEnding.NoConstraint:case k.LineDashEnding.Custom:d=-this._customDashPos}g=d/this._pattern.length();g-=Math.floor(g);d=g*this._pattern.length();this._pattern.reset();g=this._pattern.nextValue();for(t=!1;d>=g;)d-=g,g=this._pattern.nextValue(),t=!t;g-=d;t?(this._walker.nextPosition(g),g=this._pattern.nextValue()): this.isClosed&&(this._firstCurve=this._walker.nextCurve(g),g=this._pattern.nextValue(),this._walker.nextPosition(g),g=this._pattern.nextValue())}if(d=this._walker.nextCurve(g))if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)d.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else g=this._pattern.nextValue(),!this._walker.nextPosition(g)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&& (d.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,d=this._firstCurve,this._firstCurve=null;d?.reset();return d}isClippingRequired(g){g=q.collectMultipath(g);let d=0;for(const t of g)d+=l.getPathLength(t);return 1E3d&&(d=1E-7);this._values.push(d);this._length+=d}c&&f.length&1&&(this._length*=2);if(0===this._length)return!1;this.ctrlPtGap=this.extPtGap=0;this._currentValue=-1;return!0}scale(f){const c= this._values?this._values.length:0;for(let e=0;ec.segmentLength+this._tolerance;)if(e&&(0===e.pathSize&&(0===d?(d=c.segment[0],e.pushXY(d[0],d[1])):e.pushPoint(this.getSegCoord2D(c.segment,d))),d=c.segment[1],e.pushXY(d[0],d[1])),d=0,f-=(c.segmentLength-c.abscissa)/this._partLengthRatio,this._partSegCount)c.segment=this._nextSegment(),c.segmentLength=this.getSegLength(c.segment),c.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart()){if(g=== a.EndType.FAIL)return!1;c.segmentLength=this.getSegLength(c.segment);c.isPartEnd=!0;g===a.EndType.END?(c.abscissa=c.segmentLength,c.isPathEnd=!0):c.abscissa=c.segmentLength+f;return!0}this._currentPosition.copyTo(c)}c.abscissa+=f*this._partLengthRatio;e&&(0===e.pathSize&&(0===d?e.pushPoint(c.segment[0]):e.pushPoint(this.getSegCoord2D(c.segment,d))),f=c.abscissa/c.segmentLength,1===f?e.pushPoint(c.segment[1]):e.pushPoint(this.getSegCoord2D(c.segment,f)));!this._partSegCount&&Math.abs(c.abscissa-c.segmentLength)< this._tolerance&&(c.isPathEnd=this._partIsLast,c.isPartEnd=!0);return!0}_getPoint(f){return this.getSegCoord2D(this._currentPosition.segment,0>=f.segmentLength?0:f.abscissa/f.segmentLength)}_getAngleCS(f){return this.getSegAngleCS(this._currentPosition.segment,0>=f.segmentLength?0:f.abscissa/f.segmentLength)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;this._partLength=0;this._partIsLast=!0;for(this._partSegCount= 0;this._hasNextSegment();)if(this._partLength+=this.getSegLength(this._nextSegment()),this._partSegCount++,this._pathCursor.getControlPointAt(this._getEndPointIndex())){this._partIsLast=!this._hasNextSegment();break}for(var f=this._partSegCount;f;)this._previousSegment(),--f;this._currentPosition.segment=this._nextSegment();this._currentPosition.segmentLength=this.getSegLength(this._currentPosition.segment);this._currentPosition.abscissa=0;this._currentPosition.isPathEnd=this._currentPosition.isPartEnd= !1;--this._partSegCount;f=this._getStartPointIndex();this._ctrlPtBegin=this._pathCursor.getControlPointAt(f);f=f+this._partSegCount+1;f>=this._pathCursor.pathSize&&(f=0);this._ctrlPtEnd=this._pathCursor.getControlPointAt(f);if(0=e&&(e=0this._partLengthRatio&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._segMath.min(e.xmax- e.xmin,e.ymax-e.ymin)-2*this._width?c:q.GeometryCursor.fromJSONCIM({paths:[[[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]],[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]})}if("esriGeometryPolygon"===c.geometryType){if(0===this._width)return c.clone();var g=this._geometryEngine;if(null==g)break;if(c=this._tileKey? l.clipCursorToTileExtent(c,this._maxInflateSize):c.clone()){if(g=g.buffer(k.WebMercator,c.asJSON(),-this._width,1))for(e of g.rings)if(e){c.startPath();for(const d of e.reverse())c.pushXY(d[0],c.yFactor*d[1])}return c}}}return null}}a.EffectDonut=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectJog":function(){define(["exports","../../../geometry/GeometryCursor","../CIMCursor","../CurveHelper"],function(a,b,q,l){class p{static local(){null===p.instance&& (p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends q.PathEffectCursor{constructor(h,f,c){super(h,!1,!0);this._curveHelper=new l.CurveHelper;this._length=(void 0!==f.length?f.length:20)*c;this._angle=void 0!==f.angle?f.angle:225;this._position=void 0!==f.position?f.position:50;0>this._length&&(this._length=-this._length);20>this._position&&(this._position=20);80=this._height&&(this._height=Math.abs(this._height));0>=this._period&&(this._period=Math.abs(this._period)); this._pattern=new l.DashPattern;this._pattern.addValue(this._period);this._pattern.addValue(this._period);this._walker=new l.GeometryWalker;this._walker.updateTolerance(c)}next(){for(var h=this._inputGeometries.next();h;){if(0===this._height||0===this._period||(h=this._processGeom(h)))return h;h=this._inputGeometries.next()}return null}_processGeom(h){const f=b.GeometryCursor.createEmptyOptimizedCIM(h.geometryType);for(;h.nextPath();){f.startPath();const c=h.pathLength();if(this._walker.init(h,this._pattern))switch(this._style){default:this._constructCurve(f, c,!1);break;case q.GeometricEffectWaveform.Square:this._constructSquare(f,c);break;case q.GeometricEffectWaveform.Triangle:this._constructTriangle(f,c);break;case q.GeometricEffectWaveform.Random:this._constructCurve(f,c,!0)}else for(;h.nextPoint();)f.pushXY(h.x,h.y)}return f}_constructCurve(h,f,c){var e=Math.round(f/this._period);0===e&&(e=1);const g=this._period/16,d=1/(16*e+1);f=2*Math.PI*f/(f/e);e=2*Math.PI*Math.random();const t=2*Math.PI*Math.random(),w=2*Math.PI*Math.random(),v=.75-Math.random()/ 2,m=.75-Math.random()/2,r=new l.Pos;this._walker.curPointAndAngle(r);h.pushPoint(r.pt);let n=0;for(;;)if(this._walker.nextPointAndAngle(g,r)){const u=n;n+=d;let x;if(c){const y=this._height/2*(1+.3*Math.sin(v*f*u+e));x=y*Math.sin(f*u+t);x+=y*Math.sin(m*f*u+w);x/=2}else x=.5*this._height*Math.sin(.5*f*u);h.pushXY(r.pt[0]-x*r.sa,r.pt[1]+x*r.ca)}else{h.pushPoint(this._walker.getPathEnd());break}}_constructSquare(h,f){Math.round(f/this._period);for(f=!0;;){let c=!1;if(this._walker.curPositionIsValid()){const e= new l.Pos;this._walker.curPointAndAngle(e);const g=new l.Pos;if(this._walker.nextPointAndAngle(this._period,g)){const d=new l.Pos;this._walker.nextPointAndAngle(this._period,d)&&(f?(h.pushPoint(e.pt),f=!1):h.pushPoint(e.pt),h.pushXY(e.pt[0]-this._height/2*e.sa,e.pt[1]+this._height/2*e.ca),h.pushXY(g.pt[0]-this._height/2*g.sa,g.pt[1]+this._height/2*g.ca),h.pushXY(g.pt[0]+this._height/2*g.sa,g.pt[1]-this._height/2*g.ca),h.pushXY(d.pt[0]+this._height/2*d.sa,d.pt[1]-this._height/2*d.ca),c=!0)}}if(!c){h.pushPoint(this._walker.getPathEnd()); break}}}_constructTriangle(h,f){Math.round(f/this._period);for(f=!0;;){let c=!1;if(this._walker.curPositionIsValid()){const e=new l.Pos;this._walker.curPointAndAngle(e);const g=new l.Pos;if(this._walker.nextPointAndAngle(this._period/2,g)){const d=new l.Pos;this._walker.nextPointAndAngle(this._period,d)&&(this._walker.nextPosition(this._period/2)&&(f?(h.pushPoint(e.pt),f=!1):h.pushPoint(e.pt),h.pushXY(g.pt[0]-this._height/2*g.sa,g.pt[1]+this._height/2*g.ca),h.pushXY(d.pt[0]+this._height/2*d.sa,d.pt[1]- this._height/2*d.ca)),c=!0)}}if(!c){h.pushPoint(this._walker.getPathEnd());break}}}}a.EffectWave=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAlongLineSameSize":function(){define(["exports","../CIMCursor","../enums","../GeometryWalker"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends b.PathTransformationCursor{constructor(h, f,c){super(h);this._geometryWalker=new l.GeometryWalker;this._geometryWalker.updateTolerance(c);this._angleToLine=f.angleToLine??!0;this._offset=(f.offset?f.offset:0)*c;this._originalEndings=f.endings;this._offsetAtEnd=(f.customEndingOffset?f.customEndingOffset:0)*c;this._position=-(f.offsetAlongLine?f.offsetAlongLine:0)*c;this._pattern=new l.DashPattern;this._pattern.init(f.placementTemplate,!1);this._pattern.scale(c);this._endings=this._originalEndings}processPath(h){if(this._pattern.isEmpty())return null; if(this.iteratePath)var f=this._pattern.nextValue();else{this._endings=this._originalEndings===q.PlacementEndings.WithFullGap&&this.isClosed?q.PlacementEndings.WithMarkers:this._originalEndings;this._pattern.extPtGap=0;let c=!0;switch(this._endings){case q.PlacementEndings.NoConstraint:f=-this._position;f=this._adjustPosition(f);c=!1;break;default:f=-this._pattern.lastValue()/2;break;case q.PlacementEndings.WithFullGap:f=-this._pattern.lastValue();this._pattern.extPtGap=this._pattern.lastValue(); break;case q.PlacementEndings.WithMarkers:f=0;break;case q.PlacementEndings.Custom:f=-this._position,f=this._adjustPosition(f),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(h,this._pattern,c))return null;this._pattern.reset();for(h=0;f>h;)f-=h,h=this._pattern.nextValue();f=h-f;this.iteratePath=!0}h=new l.Pos;if(!this._geometryWalker.nextPointAndAngle(f,h)||this._endings===q.PlacementEndings.WithFullGap&&this._geometryWalker.isPathEnd())return this.iteratePath=!1,null;if(this._endings=== q.PlacementEndings.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed))return null;this.internalPlacement.setTranslate(h.pt[0]-this._offset*h.sa,h.pt[1]+this._offset*h.ca);this._angleToLine&&this.internalPlacement.setRotateCS(h.ca,h.sa);return this.internalPlacement}_adjustPosition(h){h/=this._pattern.length();h-=Math.floor(h);return h*this._pattern.length()}}a.PlacementAlongLineSameSize=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAtExtremities":function(){define(["exports", "../CIMCursor","../CurveHelper","../enums"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends b.PathTransformationCursor{constructor(h,f,c){super(h,!1,!0);this._curveHelper=new q.CurveHelper;this._placePerPart=f.placePerPart??!1;this._angleToLine=void 0!==f.angleToLine?f.angleToLine:!0;this._offset=void 0!==f.offset?f.offset*c:0;this._type=f.extremityPlacement;this._position=void 0!== f.offsetAlongLine?f.offsetAlongLine*c:0;this._beginProcessed=!1}processMultiPath(h){return this._placePerPart?super.processMultiPath(h):this.processPath(h)}processPath(h){let f;switch(this._type){default:this._beginProcessed?(f=this._atExtremities(h,this._position,!1),this.iteratePath=this.iterateMultiPath=this._beginProcessed=!1):(f=this._atExtremities(h,this._position,!0),this.iteratePath=this.iterateMultiPath=this._beginProcessed=!0);break;case l.ExtremityPlacement.JustBegin:f=this._atExtremities(h, this._position,!0);break;case l.ExtremityPlacement.JustEnd:f=this._atExtremities(h,this._position,!1);case l.ExtremityPlacement.None:}return f}_atExtremities(h,f,c){this._placePerPart||(c?h.seekPath(0):h.seekPath(h.totalSize-1));c||h.seekPathEnd();if(c?h.nextPoint():h.prevPoint()){let e=0,[g,d]=[0,0],[t,w]=[h.x,h.y];for(;c?h.nextPoint():h.prevPoint();){g=t;d=w;t=h.x;w=h.y;const v=this._curveHelper.getLength(g,d,t,w);if(e+v>f){h=(f-e)/v;const [m,r]=this._curveHelper.getAngleCS(g,d,t,w,h);h=this._curveHelper.getCoord2D(g, d,t,w,h);this.internalPlacement.setTranslate(h[0]-this._offset*r,h[1]+this._offset*m);this._angleToLine&&this.internalPlacement.setRotateCS(-m,-r);return this.internalPlacement}e+=v}}return null}}a.PlacementAtExtremities=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAtRatioPositions":function(){define(["exports","../CIMCursor","../GeometryWalker"],function(a,b,q){class l{static local(){null===l.instance&&(l.instance=new l);return l.instance}execute(k, h,f,c,e){return new p(k,h,f)}}l.instance=null;class p extends b.PathTransformationCursor{constructor(k,h,f){super(k);this._walker=new q.GeometryWalker;this._walker.updateTolerance(f);this._angleToLine=void 0!==h.angleToLine?h.angleToLine:!0;this._offset=void 0!==h.offset?h.offset*f:0;this._beginGap=void 0!==h.beginPosition?h.beginPosition*f:0;this._endGap=void 0!==h.endPosition?h.endPosition*f:0;this._flipFirst=void 0!==h.flipFirst?h.flipFirst:!0;this._pattern=new q.DashPattern;this._pattern.init(h.positionArray, !1,!1);this._subPathLen=0;this._posCount=this._pattern.size();this._isFirst=!0;this._prevPos=0}processPath(k){if(this._pattern.isEmpty())return null;if(this.iteratePath){k=this._pattern.nextValue()*this._subPathLen;var h=this._beginGap+k;k=h-this._prevPos;this._prevPos=h}else{this._posCount=this._pattern.size();this._isFirst=!0;this._prevPos=0;this._subPathLen=k.pathLength()-this._beginGap-this._endGap;if(0>this._subPathLen)return this.iteratePath=!1,null;if(!this._walker.init(k,this._pattern,!1))return null; this._pattern.reset();k=this._pattern.nextValue()*this._subPathLen;h=this._beginGap+k;k=h-this._prevPos;this._prevPos=h;this.iteratePath=!0}h=new q.Pos;if(!this._walker.nextPointAndAngle(k,h,q.EndType.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(h.pt[0]-this._offset*h.sa,h.pt[1]+this._offset*h.ca);k=this._isFirst&&this._flipFirst;let f;this._angleToLine?(f=h.ca,h=h.sa):(f=1,h=0);k&&(f=-f,h=-h);this.internalPlacement.setRotateCS(f,h);this._isFirst=!1;this._posCount--;0=== this._posCount&&(this.iteratePath=!1);return this.internalPlacement}}a.PlacementAtRatioPositions=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementInsidePolygon":function(){define(["exports","../../../core/RandomLCG","../CIMPlacements","../enums"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c,e,g)}}p.instance=null;class k{constructor(h,f,c,e,g){this._currentY= this._currentX=this._yMax=this._yMin=this._xMax=this._xMin=0;this._accelerationMap=null;this._testInsidePolygon=!1;this._verticalSubdivision=!0;this._stepX=Math.abs(f.stepX??16)*c;this._stepY=Math.abs(f.stepY??16)*c;this._stepX=Math.round(128*this._stepX)/128;this._stepY=Math.round(128*this._stepY)/128;if(0!==this._stepX&&0!==this._stepY){this._gridType=f.gridType??l.PlacementGridType.Fixed;if(this._gridType===l.PlacementGridType.Random)this._randomLCG=new b(1*(f.seed??13)),this._randomness=(f.randomness?? 100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._offsetY=this._offsetX=this._sinAngle=0,this._buildRandomValues();else{this._randomness=0;this._gridAngle=f.gridAngle??0;this._shiftOddRows=f.shiftOddRows??!1;this._offsetX=(f.offsetX??0)*c;this._offsetY=(f.offsetY??0)*c;this._cosAngle=Math.cos(this._gridAngle/180*Math.PI);this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI);if(this._stepX)if(0>this._offsetX)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>= .5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(0>this._offsetY)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}this._graphicOriginY=this._graphicOriginX=0;if(null!=e){const [d,t,w,v]=e.split("/");f=parseFloat(d);c=parseFloat(t);e=parseFloat(w);this._graphicOriginX=512*-(parseFloat(v)*2**f+e);this._graphicOriginY=512*c;this._testInsidePolygon=!0}this._internalPlacement=new q.Placement;this._calculateMinMax(h); this._geometryCursor=h}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!k._randValues){k._randValues=[];for(let h=0;24>h;h++)for(let f=0;24>f;f++)k._randValues.push(this._randomLCG.getFloat()),k._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(h){this._yMax=this._yMin=this._xMax=this._xMin=0;let f,c,e,g,d,t,w,v;f=c=w=d=Number.MAX_VALUE;e=g=v=t=-Number.MAX_VALUE;var m=1!==this._cosAngle;for(h.reset();h.nextPath();)for(;h.nextPoint();){var r=h.x;var n= h.y;var u=r-this._graphicOriginX-this._offsetX;var x=n-this._graphicOriginY-this._offsetY;if(m){var y=this._cosAngle*u-this._sinAngle*x;u=this._sinAngle*u+this._cosAngle*x}else y=u,u=x;f=Math.min(f,y);e=Math.max(e,y);c=Math.min(c,u);g=Math.max(g,u);d=Math.min(d,n);t=Math.max(t,n);w=Math.min(w,r);v=Math.max(v,r)}d=d!==Number.MAX_VALUE?d:-512-this._stepY;t=t!==-Number.MAX_VALUE?t:this._stepY;w=w!==Number.MAX_VALUE?w:-this._stepX;v=v!==-Number.MAX_VALUE?v:512+this._stepX;this._polygonMin=(this._verticalSubdivision= t-d>=v-w)?d:w;if(this._testInsidePolygon){y=0-this._graphicOriginX-this._offsetX-this._stepX;n=512-this._graphicOriginX-this._offsetX+this._stepX;r=-512-this._graphicOriginY-this._offsetY-this._stepY;u=0-this._graphicOriginY-this._offsetY+this._stepY;if(m){m=[[y,r],[y,u],[n,r],[n,u]];y=r=Number.MAX_VALUE;n=u=-Number.MAX_VALUE;for(const z of m)m=this._cosAngle*z[0]-this._sinAngle*z[1],x=this._sinAngle*z[0]+this._cosAngle*z[1],y=Math.min(y,m),n=Math.max(n,m),r=Math.min(r,x),u=Math.max(u,x)}f=f!==Number.MAX_VALUE? Math.max(f,y):y;c=c!==Number.MAX_VALUE?Math.max(c,r):r;e=e!==-Number.MAX_VALUE?Math.min(e,n):n;g=g!==-Number.MAX_VALUE?Math.min(g,u):u}this._xMin=Math.round(f/this._stepX);this._xMax=Math.round(e/this._stepX);this._yMin=Math.round(c/this._stepY);this._yMax=Math.round(g/this._stepY);this._currentX=this._xMax+1;this._currentY=this._yMin-1;this._buildAccelerationMap(h,w,v,d,t)}_buildAccelerationMap(h,f,c,e,g){h.reset();const d=new Map,t=this._verticalSubdivision;c=t?g-e:c-f;g=Math.ceil(c/10);if(!(1>= g)){c=Math.floor(c/g);g++;this._delta=c;var w,v;if(t){g=-512-2*this._stepY;var m=2*this._stepY;var r=e}else g=-2*this._stepX,m=512+2*this._stepX,r=f;for(;h.nextPath();)if(!(2>h.pathSize)&&h.nextPoint()){var n=h.x;for(w=h.y;h.nextPoint();n=f,w=e){f=h.x;e=h.y;if(t){if(w===e||wm&&e>m)continue;var u=Math.min(w,e);var x=Math.max(w,e)}else{if(n===f||nm&&f>m)continue;u=Math.min(n,f);x=Math.max(n,f)}for(;uv&&(x=f,y=e,z=d,A=z.get(u),A||(A=[],z.set(u,A)),A.push([[n,w],[x,y]]))}}this._accelerationMap=d}}_nextInside(){for(;;){if(this._currentX>this._xMax){this._currentY++;if(this._currentY>this._yMax)return null;this._currentX=this._xMin;this._shiftOddRows&&this._currentY%2&&this._currentX--}var h=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(h+=.5*this._stepX);const f=this._currentY*this._stepY+this._offsetY;this._currentX++; let c;if(this._gridType===l.PlacementGridType.Random){const e=(this._currentX%24+24)%24,g=(this._currentY%24+24)%24;c=this._graphicOriginX+h+this._stepX*this._randomness*(.5-k._randValues[24*g+e])*2/3;h=this._graphicOriginY+f+this._stepY*this._randomness*(.5-k._randValues[24*g+e+1])*2/3}else c=this._graphicOriginX+this._cosAngle*h+this._sinAngle*f,h=this._graphicOriginY-this._sinAngle*h+this._cosAngle*f;if(!this._testInsidePolygon||this._isInsidePolygon(c,h,this._geometryCursor))return this._internalPlacement.setTranslate(c, h),this._internalPlacement}}_isInsidePolygon(h,f,c){if(null==this._accelerationMap){var e=0,g;let w;h+=1E-6;f+=1E-6;for(c.reset();c.nextPath();)if(c.nextPoint()){var d=c.x;for(g=c.y;c.nextPoint();d=t,g=w){var t=c.x;w=c.y;g>f!==w>f&&(0<(t-d)*(f-g)-(w-g)*(h-d)?e++:e--)}}return 0!==e}h+=1E-6;f+=1E-6;c=this._verticalSubdivision;g=this._accelerationMap.get(Math.floor(((c?f:h)-this._polygonMin)/this._delta));if(!g)return!1;d=0;for(e of g){g=e[0];t=e[1];if(c){if(g[1]>f===t[1]>f)continue;g=(t[0]-g[0])*(f- g[1])-(t[1]-g[1])*(h-g[0])}else{if(g[0]>h===t[0]>h)continue;g=(t[1]-g[1])*(h-g[0])-(t[0]-g[0])*(f-g[1])}0f){h=(f-g)/m;const [r,n]=this._curveHelper.getAngleCS(d,t,w,v,h);h=this._curveHelper.getCoord2D(d,t,w,v,h);c=e?-this._offset:this._offset;this.internalPlacement.setTranslate(h[0]- c*n,h[1]+c*r);this._angleToLine&&(e?this.internalPlacement.setRotateCS(-r,-n):this.internalPlacement.setRotateCS(r,n));return this.internalPlacement}d=w;t=v;g+=m}}return null}}a.PlacementOnLine=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementOnVertices":function(){define(["exports","../CIMCursor","../CurveHelper"],function(a,b,q){function l(h,f){const c=Math.PI;for(;Math.abs(f-h)>c+2E-15;)f=f-h>c?f-2*c:f+2*c;return(h+f)/2}class p{static local(){null=== p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends b.PathTransformationCursor{constructor(h,f,c){super(h);this._curveHelper=new q.CurveHelper;this._angleToLine=void 0!==f.angleToLine?f.angleToLine:!0;this._offset=void 0!==f.offset?f.offset*c:0;this._endPoints=void 0!==f.placeOnEndPoints?f.placeOnEndPoints:!0;this._controlPoints=void 0!==f.placeOnControlPoints?f.placeOnControlPoints:!0;this._regularVertices=void 0!==f.placeOnRegularVertices? f.placeOnRegularVertices:!0;this._tags=[];this._tagIterator=0}processPath(h){this.iteratePath||(this._preparePath(h),this.iteratePath=!0);if(this._tagIterator>=this._tags.length)return this._tagIterator=this._tags.length=0,this.iteratePath=!1,null;h=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(h[2]);let f=h[0],c=h[1];if(0!==this._offset){const e=Math.cos(h[2]);f-=this._offset*Math.sin(h[2]);c+=this._offset*e}this.internalPlacement.setTranslate(f,c);this._tagIterator++; return this.internalPlacement}_preparePath(h){this._tagIterator=this._tags.length=0;h.seekPathStart();const f=h.isClosed();let c=0,e=!1,g=0,d=0;h.seekPathStart();if(h.nextPoint()){let t=h.x,w=h.y,v=h.getControlPoint(),m=!0,r=h.nextPoint();for(;r;){const n=h.x,u=h.y,x=h.getControlPoint();if(this._angleToLine||0!==this._offset)g=this._curveHelper.getAngle(t,w,n,u,0);m?(m=!1,f?(c=g,e=v):(this._endPoints||this._controlPoints&&v)&&this._tags.push([t,w,g])):v?this._controlPoints&&this._tags.push([t,w,l(d, g)]):this._regularVertices&&this._tags.push([t,w,l(d,g)]);if(this._angleToLine||0!==this._offset)d=this._curveHelper.getAngle(t,w,n,u,1);(r=h.nextPoint())||(f?x||e?this._controlPoints&&this._tags.push([n,u,l(d,c)]):this._regularVertices&&this._tags.push([n,u,l(d,c)]):(this._endPoints||this._controlPoints&&x)&&this._tags.push([n,u,d]));t=n;w=u;v=x}}this._tagIterator=0}}a.PlacementOnVertices=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementPolygonCenter":function(){define("exports ../../../geometry/support/boundsUtils ../../../geometry/support/centroid ../../../geometry/support/labelPoint ../CIMPlacements ../enums".split(" "), function(a,b,q,l,p,k){class h{static local(){null===h.instance&&(h.instance=new h);return h.instance}execute(c,e,g,d,t){return new f(c,e,g)}}h.instance=null;class f{constructor(c,e,g){this._geometryCursor=c;this._offsetX=void 0!==e.offsetX?e.offsetX*g:0;this._offsetY=void 0!==e.offsetY?e.offsetY*g:0;this._method=void 0!==e.method?e.method:k.PlacementPolygonCenterMethod.OnPolygon;this._internalPlacement=new p.Placement}next(){const c=this._geometryCursor;this._geometryCursor=null;return c?this._polygonCenter(c): null}_polygonCenter(c){let e=!1;switch(this._method){case k.PlacementPolygonCenterMethod.CenterOfMass:if(c=q.weightedAreaCentroid(c))this._internalPlacement.setTranslate(c[0]+this._offsetX,c[1]+this._offsetY),e=!0;break;case k.PlacementPolygonCenterMethod.BoundingBoxCenter:if(c=b.getCursorBoundsXY(c))this._internalPlacement.setTranslate((c[2]+c[0])/2+this._offsetX,(c[3]+c[1])/2+this._offsetY),e=!0;break;default:c=l.getLabelPoint(c),null!==c&&(this._internalPlacement.setTranslate(c[0]+this._offsetX, c[1]+this._offsetY),e=!0)}return e?this._internalPlacement:null}}a.PlacementPolygonCenter=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/labelPoint":function(){define("exports ../../core/PriorityQueue ./aaBoundingRect ./boundsUtils ./centroid ./coordsUtils ./intersectsBase".split(" "),function(a,b,q,l,p,k,h){function f(v,m){let r=0,n,u,x,y;for(m.reset();m.nextPath()&&m.nextPoint();)for(n=m.x,u=m.y;m.nextPoint();n=x,u=y)x=m.x,y=m.y,u>v[1]!==y>v[1]&&(0<(x-n)* (v[1]-u)-(y-u)*(v[0]-n)?r++:r--);return 0!==r}function c(v,m,r){if(r&&f(v,m))return{coord:v,distance:0};r=Infinity;let n=0,u=0;var x=[0,0];let y=[0,0];const z=[0,0];for(m.reset();m.nextPath()&&m.nextPoint();)if(!(2>m.pathSize))for(x[0]=m.x,x[1]=m.y;m.nextPoint();x=y)y=[m.x,m.y],k.projectPointOnLineSeg(z,v,x,y),x=d(v,z),xv.pathSize))for(C[0][0]=v.x,C[0][1]=v.y;v.nextPoint();C[0][0]=C[1][0],C[0][1]=C[1][1]){C[1][0]=v.x;C[1][1]=v.y;a:{var F=D;var H=C;if(2>H.length){F=null;break a}F||=q.create();const [E,G]=H[0],[I,O]=H[1];F[0]=Math.min(E,I);F[1]=Math.min(G,O);F[2]=Math.max(E,I);F[3]=Math.max(G,O)}if(null!==F){A[0]=m[0][0];A[1]=m[0][1];B[0]=m[1][0];B[1]=m[1][1];a:{F=D;H=A;var N=B;let E=g(H,F),G=g(N,F);const I=F[0],O=F[1],L=F[2],P=F[3]; if(E&G){F=0;break a}if(!(E|G)){F=4;break a}const M=(E?1:0)|(G?2:0);do{const K=N[0]-H[0],J=N[1]-H[1];if(K>J)E&3?(E&1?(H[1]+=J*(I-H[0])/K,H[0]=I):(H[1]+=J*(L-H[0])/K,H[0]=L),E=g(H,F)):G&3?(G&1?(N[1]+=J*(I-N[0])/K,N[0]=I):(N[1]+=J*(L-N[0])/K,N[0]=L),G=g(N,F)):E?(E&4?(H[0]+=K*(O-H[1])/J,H[1]=O):(H[0]+=K*(P-H[1])/J,H[1]=P),E=g(H,F)):(G&4?(N[0]+=K*(O-N[1])/J,N[1]=O):(N[0]+=K*(P-N[1])/J,N[1]=P),G=g(N,F));else if(E&12?(E&4?(H[0]+=K*(O-H[1])/J,H[1]=O):(H[0]+=K*(P-H[1])/J,H[1]=P),E=g(H,F)):G&12?(G&4?(N[0]+= K*(O-N[1])/J,N[1]=O):(N[0]+=K*(P-N[1])/J,N[1]=P),G=g(N,F)):E?(E&1?(H[1]+=J*(I-H[0])/K,H[0]=I):(H[1]+=J*(L-H[0])/K,H[0]=L),E=g(H,F)):(G&1?(N[1]+=J*(I-N[0])/K,N[0]=I):(N[1]+=J*(L-N[0])/K,N[0]=L),G=g(N,F)),E&G){F=0;break a}}while(E|G);F=M}0!==F&&h.segmentIntersects(m[0],m[1],C[0],C[1],n)&&(F=n[1],u>x?Fm[2]?1:0)<<1|(v[1]m[3]?1:0)<<3}function d(v,m){return(v[0]-m[0])* (v[0]-m[0])+(v[1]-m[1])*(v[1]-m[1])}function t(v,m){if(vm)return 1;if(v===m)return 0;v=isNaN(v);m=isNaN(m);return vm?1:0}class w{constructor(v,m,r,n){this.x=v;this.y=m;this.cellSize=r;this.distancefromCellCenter=k.distanceFromPointToPolygon(v,m,n);this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}a.getLabelPoint=function(v){if(0===v.totalSize)return null;var m=l.getCursorBoundsXY(v);if(!m)return null;var r=8.8818E-14*(Math.abs(m[0])+Math.abs(m[2])+ Math.abs(m[1])+Math.abs(m[3])+1),n=0,u=0;v.reset();for(var x=0;v.nextPath();x++){var y=v.getCurrentRingArea();y>u&&(u=y,n=x)}v.seekPath(n);if(0===v.pathSize)return null;v.seekPathStart();y=l.getCursorPathBounds(v);if(Math.abs(u)<=2*r*r)return[(y[0]+y[2])/2,(y[1]+y[3])/2];v.seekPathStart();var z=p.ringCentroidCursorXY(v,q.create());if(null===z)return null;if(4>v.totalPoints)return z;u=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]];n=[NaN,NaN,NaN,NaN];x=[NaN,NaN,NaN,NaN];var A=!1,B=c(z,v,!0);0===B.distance&& (A=!0,u[0][0]=z[0],u[0][1]=z[1],B=c(z,v,!1));n[0]=B.distance;x[0]=0;var C=[NaN,NaN];let D=!1,F=.25,H=-1;B=NaN;do{B=NaN;var N=y[0];u[1]=e(v,N+(y[2]-N)*F,r,m);isNaN(u[1][0])||isNaN(u[1][1])||(B=c(u[1],v,!1),B=B.distance);if(!isNaN(B)&&B>r&&f(u[1],v))D=!0,n[1]=B,x[1]=d(u[1],z);else if(!isNaN(B)&&B>H&&(H=B,C[0]=u[1][0],C[1]=u[1][1]),F-=.01,.1>F)if(0<=H)D=!0,n[1]=H,u[1][0]=C[0],u[1][1]=C[1],x[1]=d(u[1],z);else break}while(!D);D=!1;F=.5;H=-1;N=.01;let E=1;do{B=NaN;var G=y[0];u[2]=e(v,G+(y[2]-G)*F,r,m); isNaN(u[2][0])||isNaN(u[2][1])||(B=c(u[2],v,!1),B=B.distance);if(!isNaN(B)&&B>r&&f(u[2],v))D=!0,n[2]=B,x[2]=d(u[2],z);else if(!isNaN(B)&&B>H)H=B,C[0]=u[2][0],C[1]=u[2][1];else if(B>H&&(H=B,C[0]=u[2][0],C[1]=u[2][1]),F=.5+N*E,N+=.01,E*=-1,.3>F||.7r&&f(u[3],v))D=!0,n[3]=B,x[3]=d(u[3], z);else if(B>H&&(H=B,C[0]=u[3][0],C[1]=u[3][1]),F+=.01,.9y;y++)for(A=m;3>A;A++)z=x[A],C=x[A+1],0m;m++){switch(m){case 0:y=2*n[v[m]];break;case 1:y=1.66666666*n[v[m]];break;case 2:y=1.33333333*n[v[m]];break;case 3:y=n[v[m]]}y>r&&(r=y,x=v[m])}return u[x]};a.getPolylabelPoint=function(v){if(!v.nextPath()||!v.pathSize)return null; var m=l.getCursorPathBounds(v),r=m[2]-m[0],n=m[3]-m[1];if(0===r||0===n)return[m[0]+r/2,m[1]+n/2];const u=Math.max(Math.min(r,n)/100,1),x=new b((A,B)=>B.maxDistanceToPolygon-A.maxDistanceToPolygon);n=Math.min(r,n);r=n/2;let y=0,z=0;for(y=m[0];ym.distancefromCellCenter&&(m=n),n.maxDistanceToPolygon- m.distancefromCellCenter<=u||(r=n.cellSize/2,x.enqueue(new w(n.x-r,n.y-r,r,v)),x.enqueue(new w(n.x+r,n.y-r,r,v)),x.enqueue(new w(n.x-r,n.y+r,r,v)),x.enqueue(new w(n.x+r,n.y+r,r,v)));return[m.x,m.y]};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/PriorityQueue":function(){define(function(){class a{constructor(q=b){this._data=[];this._compare=q}get size(){return this._data.length}enqueue(q){if(null!=q){var {_data:l,_compare:p}=this;l.push(q);q=l.length-1>>>0;for(var k=l[q];0< q;){const h=q-1>>1,f=l[h];if(0>=p(f,k))l[h]=k,l[q]=f,q=h;else break}}}dequeue(){const {_data:q,_compare:l}=this,p=q[0];var k=q.pop();if(0===q.length)return p;q[0]=k;k=0;const h=q.length,f=q[0];let c;let e=null;for(;;){var g=2*k+1;const d=2*k+2;e=null;g=l(g,f)||null!==e&&0>=l(g,c))&&(e=d);if(null===e)break;q[k]=q[e];q[e]=f;k=e}return p}}const b=(q,l)=>ql?1:0;return a})},"esri/symbols/cim/imageUtils":function(){define(["exports"],function(a){a.getFirstFrame= function(b){const q=b.getFrame(0);if(q instanceof HTMLImageElement||q instanceof HTMLCanvasElement)return q;const l=document.createElement("canvas");l.width=b.width;l.height=b.height;b=l.getContext("2d");q instanceof ImageData?b.putImageData(q,0,0):b.drawImage(q,0,0);return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/Rect":function(){define(function(){class a{constructor(b=0,q=0,l=0,p=0){this.x=b;this.y=q;this.width=l;this.height=p}static fromExtent(b){return new a(b.xmin, -b.ymax,b.xmax-b.xmin,b.ymax-b.ymin)}get isEmpty(){return 0>=this.width||0>=this.height}union(b){this.x=Math.min(this.x,b.x);this.y=Math.min(this.y,b.y);this.width=Math.max(this.width,b.width);this.height=Math.max(this.height,b.height)}}return a})},"esri/symbols/cim/TextRasterizer":function(){define(["../../core/screenUtils","../support/textUtils"],function(a,b){function q(k){return`rgba(${k.slice(0,3).toString()},${k[3]})`}function l(k,h){var f=h.font;f=`${f.style} ${f.weight} ${a.pt2px(Math.max(h.size, .5)*h.pixelRatio).toFixed(1)}px ${f.family}, sans-serif`;k.font=f;k.textBaseline="top";switch(h.horizontalAlignment){case "left":h="left";break;case "right":h="right";break;case "center":h="center";break;default:h="left"}k.textAlign=h}class p{constructor(k){k&&(this._textRasterizationCanvas=k)}rasterizeText(k,h){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const f=this._textRasterizationCanvas;var c=f.getContext("2d",{willReadFrequently:!0});l(c, h);this._parameters=h;this._textLines=k.split(/\r?\n/);this._lineHeight=this._computeLineHeight();const {decoration:e,weight:g}=h.font;this._lineThroughWidthOffset=e&&"line-through"===e?.1*this._lineHeight:0;var d=(k=null!=h.backgroundColor||null!=h.borderLine)?b.backgroundPadding:0,t=this._computeTextWidth(c,h)+2*d,w=this._lineHeight*this._textLines.length+2*d;f.width=t+2*this._lineThroughWidthOffset;f.height=w;if(0===f.width||0===f.height)return f.width=f.height=1,{size:[0,0],image:new Uint32Array(0), sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:f};this._renderedLineHeight=Math.round(this._lineHeight*h.pixelRatio);this._renderedHaloSize=a.pt2px(h.halo.size)*h.pixelRatio;this._renderedWidth=t*h.pixelRatio;this._renderedHeight=w*h.pixelRatio;this._lineThroughWidthOffset*=h.pixelRatio;t=h.halo&&h.halo.color?h.halo.color:[0,0,0,0];this._fillStyle=q(h.color??[0,0,0,0]);this._haloStyle=`rgb(${t.slice(0,3).toString()})`;t=this._renderedLineHeight;var v=this._renderedHaloSize;c.save();c.clearRect(0, 0,f.width,f.height);l(c,h);w=d*h.pixelRatio;d=c.textAlign;var m=this._renderedWidth-2*w;d=("center"===d?.5*m:"right"===d?m:0)+v+w;w=v+w;v=0v;v++){const m=(.6+.1*v)*w; k.lineWidth=m;k.strokeText(t,h,f);c&&"none"!==c&&this._renderDecoration(k,h,f,c,e,m)}f+=g}}computeTextSize(k,h){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const f=this._textRasterizationCanvas;var c=f.getContext("2d");l(c,h);this._parameters=h;this._textLines=k.split(/\r?\n/);this._lineHeight=this._computeLineHeight();k=this._computeTextWidth(c,h);c=this._lineHeight*this._textLines.length;f.width=k;f.height=c;return[k*h.pixelRatio,c*h.pixelRatio]}_computeTextWidth(k, h){let f=0;for(const c of this._textLines)f=Math.max(f,k.measureText(c).width);h=h.font;if("italic"===h.style||"oblique"===h.style||"string"===typeof h.weight&&("bold"===h.weight||"bolder"===h.weight)||"number"===typeof h.weight&&600l.transformMat2d(m,m,v));return{topLeft:w[0],topRight:w[1],bottomLeft:w[2],bottomRight:w[3]}}const e=Math.PI/180;class g{constructor(w,v,m,r){this._rotationT=q.create();this.minZoom=this._yBounds=this._xBounds=0;this.maxZoom=255;this._bounds=null;const n=m.rect,u=new Float32Array(8);w*=r;v*=r;const x=m.code?n.width*r:m.metrics.width,y=m.code?n.height*r:m.metrics.height;this.width=x;this.height=y;u[0]=w;u[1]=v;u[2]=w+x;u[3]=v;u[4]=w;u[5]=v+y;u[6]= w+x;u[7]=v+y;this._data=u;this._setTextureCoords(n);this._scale=r;this._mosaic=m;this.x=w;this.y=v;this.maxOffset=Math.max(w+x,v+y)}get mosaic(){return this._mosaic}set angle(w){this._angle=w;b.fromRotation(this._rotationT,-w);this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){this._offsets|| this._setOffsets();return this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const {height:n,width:u}=this._mosaic.metrics;var w=u*this._scale,v=Math.abs(n)*this._scale,m=new Float32Array(8);m[0]=this.x;m[1]=this.y;m[2]=this.x+w;m[3]=this.y;m[4]=this.x;m[5]=this.y+v;m[6]=this.x+w;m[7]=this.y+v;w=b.multiply(q.create(),this._rotationT,this._transform);q.transformMany(m,m,w);v=w=Infinity;let x=0;var r=0;for(let y= 0;4>y;y++){const z=m[2*y],A=m[2*y+1];w=Math.min(w,z);v=Math.min(v,A);x=Math.max(x,z);r=Math.max(r,A)}m=x-w;r-=v;this._bounds=new f(w+m/2,v+r/2,m,r)}return this._bounds}setTransform(w){this._transform=w;this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const w=b.multiply(q.create(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0];this._offsets.topLeft[1]=this._data[1];this._offsets.topRight[0]=this._data[2]; this._offsets.topRight[1]=this._data[3];this._offsets.bottomLeft[0]=this._data[4];this._offsets.bottomLeft[1]=this._data[5];this._offsets.bottomRight[0]=this._data[6];this._offsets.bottomRight[1]=this._data[7];l.transformMat2d(this._offsets.topLeft,this._offsets.topLeft,w);l.transformMat2d(this._offsets.topRight,this._offsets.topRight,w);l.transformMat2d(this._offsets.bottomLeft,this._offsets.bottomLeft,w);l.transformMat2d(this._offsets.bottomRight,this._offsets.bottomRight,w)}_setTextureCoords({x:w, y:v,width:m,height:r}){this._texcoords={topLeft:[w,v],topRight:[w+m,v],bottomLeft:[w,v+r],bottomRight:[w+m,v+r]}}}class d{constructor(w,v,m){this._rotation=0;this._decorate(w,v,m);this.glyphs=w;this.bounds=this._createBounds(w);this.isMultiline=1x&&(H!==F?(I=H-2*A,C-=N,w.push(new t(n,F,I,C-D,E,G)),E=Infinity,G=0,F=H,C=D):(w.push(new t(n,F,B-A,C,E,G)),E=Infinity,G=0,H=F=B,C=0)),C+=L.advance,D+=L.advance);B+=A}x=new t(n,F,B-A,C,E,G);0<=x.start&&x.end=this.width||0>=this.height}union(b){this.x= Math.min(this.x,b.x);this.y=Math.min(this.y,b.y);this.width=Math.max(this.width,b.width);this.height=Math.max(this.height,b.height)}}return a})},"esri/views/2d/engine/webgl/collisions/BoundingBox":function(){define(["../../../../../core/libs/gl-matrix-2/factories/vec2f32"],function(a){class b{constructor(q,l,p,k){this.computedY=this.computedX=0;this.center=a.fromValues(q,l);this.centerT=a.create();this.halfWidth=p/2;this.halfHeight=k/2;this.width=p;this.height=k}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+ this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(q){this.center[0]=q}set y(q){this.center[1]=q}clone(){return new b(this.x,this.y,this.width,this.height)}serialize(q){q.writeF32(this.center[0]);q.writeF32(this.center[1]);q.push(this.width); q.push(this.height);return q}findCollisionDelta(q,l=4){return Math.log2(Math.min((q.halfWidth+this.halfWidth+l)/Math.abs(q.centerT[0]-this.centerT[0]),(q.halfHeight+this.halfHeight+l)/Math.abs(q.centerT[1]-this.centerT[1])))}extend(q){const l=Math.min(this.xmin,q.xmin),p=Math.min(this.ymin,q.ymin),k=Math.max(this.xmax,q.xmax)-l;q=Math.max(this.ymax,q.ymax)-p;this.width=k;this.height=q;this.halfWidth=k/2;this.halfHeight=q/2;this.x=l+k/2;this.y=p+q/2}static deserialize(q){const l=q.readF32(),p=q.readF32(), k=q.readInt32();q=q.readInt32();return new b(l,p,k,q)}}return b})},"esri/views/2d/layers/graphics/graphicsUtils":function(){define("exports ../../../../core/screenUtils ../../../../geometry/Polygon ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../engine/webgl/definitions".split(" "),function(a,b,q,l,p,k){a.getLineWidth=function(h){const f=b.px2pt(k.minTextLineWidth),c=b.px2pt(k.maxTextLineWidth);return Math.max(f,Math.min(h||c,c))};a.intersectingInternationalDateline= function(h,f){f=p.getInfo(f);if(!f)return null;const [c,e]=f.valid;return h[2]>e?[l.create([h[0],h[1],e,h[3]]),l.create([c,h[1],c+h[2]-e,h[3]])]:h[0]=g&&e<=d||e>=d&&e<=g};a.c2pi=2*k;a.cDegTo256=f;a.cDegToRad=k/180;a.cInfinity=p;a.cPi=k;a.cRadTo256=h;a.degToByte=function(e){return l(e*f,256)};a.distanceFromToPolylineWithinThreshold=function(e,g,d,t){let w,v,m;t*=t;for(const r of d){const n=r.length;if(!(2>n)){d=r[0].x;w=r[0].y;for(let u=1;ug!==v.y>g&&(0<(v.x-w.x)*(g-w.y)-(v.y-w.y)*(e-w.x)?t++:t--)}return 0!==t};a.positiveMod=l;a.radToByte=function(e){return l(e*h,256)};a.sqr=function(e){return e* e};a.translateAnchor=function(e,g,d,t){e=new q.Point(e[0],e[1]);e.scale(t);"viewport"===g&&(g=Math.PI/180*-d,e.rotate(Math.cos(g),Math.sin(g)));return e};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/cimSymbolUtils":function(){define(["exports","../../Color","../cim/utils"],function(a,b,q){function l(d){d=q.toCIMSymbolJSON(d);if("CIMTextSymbol"===d?.type)return d.height??0;let t=0;if(d?.symbolLayers)for(const w of d.symbolLayers)q.isCIMMarker(w)&&null!=w.size&& w.size>t?t=w.size:q.isCIMStroke(w)&&null!=w.width&&w.width>t?t=w.width:q.isCIMFill(w);return t}function p(d,t,w,v){if(d)if("CIMTextSymbol"===d.type)null!=d.height&&(d.height*=t);else{if(w&&d.effects)for(const m of d.effects)f(m,t);if(d.symbolLayers)for(const m of d.symbolLayers)switch(m.type){case "CIMPictureMarker":case "CIMVectorMarker":k(m,t,v);break;case "CIMPictureStroke":case "CIMSolidStroke":!v?.preserveOutlineWidth&&m.width&&(m.width*=t);break;case "CIMPictureFill":m.height&&(m.height*=t); m.offsetX&&(m.offsetX*=t);m.offsetY&&(m.offsetY*=t);break;case "CIMHatchFill":p(m.lineSymbol,t,!0,{...v,preserveOutlineWidth:!1}),m.offsetX&&(m.offsetX*=t),m.offsetY&&(m.offsetY*=t),m.separation&&(m.separation*=t)}}}function k(d,t,w){if(d&&(d.markerPlacement&&h(d.markerPlacement,t),d.offsetX&&(d.offsetX*=t),d.offsetY&&(d.offsetY*=t),d.anchorPoint&&"Absolute"===d.anchorPointUnits&&(d.anchorPoint={x:d.anchorPoint.x*t,y:d.anchorPoint.y*t}),d.size=null!=d.size?d.size*t:0,"CIMVectorMarker"===d.type&&d.markerGraphics))for(const v of d.markerGraphics)d.scaleSymbolsProportionally|| p(v.symbol,t,!0,w)}function h(d,t){q.isCIMMarkerStrokePlacement(d)&&d.offset&&(d.offset*=t);switch(d.type){case "CIMMarkerPlacementAlongLineRandomSize":case "CIMMarkerPlacementAlongLineSameSize":d.customEndingOffset&&(d.customEndingOffset*=t);d.offsetAlongLine&&(d.offsetAlongLine*=t);if(d.placementTemplate&&d.placementTemplate.length){var w=d.placementTemplate.map(v=>v*t);d.placementTemplate=w}break;case "CIMMarkerPlacementAlongLineVariableSize":d.maxRandomOffset&&(d.maxRandomOffset*=t);d.placementTemplate&& d.placementTemplate.length&&(w=d.placementTemplate.map(v=>v*t),d.placementTemplate=w);break;case "CIMMarkerPlacementOnLine":d.startPointOffset&&(d.startPointOffset*=t);break;case "CIMMarkerPlacementAtExtremities":d.offsetAlongLine&&(d.offsetAlongLine*=t);break;case "CIMMarkerPlacementAtRatioPositions":d.beginPosition&&(d.beginPosition*=t);d.endPosition&&(d.endPosition*=t);break;case "CIMMarkerPlacementPolygonCenter":d.offsetX&&(d.offsetX*=t);d.offsetY&&(d.offsetY*=t);break;case "CIMMarkerPlacementInsidePolygon":d.offsetX&& (d.offsetX*=t),d.offsetY&&(d.offsetY*=t),d.stepX&&(d.stepX*=t),d.stepY&&(d.stepY*=t)}}function f(d,t){switch(d.type){case "CIMGeometricEffectArrow":case "CIMGeometricEffectDonut":d.width&&(d.width*=t);break;case "CIMGeometricEffectBuffer":d.size&&(d.size*=t);break;case "CIMGeometricEffectCut":d.beginCut&&(d.beginCut*=t);d.endCut&&(d.endCut*=t);d.middleCut&&(d.middleCut*=t);break;case "CIMGeometricEffectDashes":d.customEndingOffset&&(d.customEndingOffset*=t);d.offsetAlongLine&&(d.offsetAlongLine*= t);if(d.dashTemplate&&d.dashTemplate.length){const w=d.dashTemplate.map(v=>v*t);d.dashTemplate=w}break;case "CIMGeometricEffectExtension":case "CIMGeometricEffectJog":case "CIMGeometricEffectRadial":d.length&&(d.length*=t);break;case "CIMGeometricEffectMove":d.offsetX&&(d.offsetX*=t);d.offsetY&&(d.offsetY*=t);break;case "CIMGeometricEffectOffset":case "CIMGeometricEffectOffsetTangent":d.offset&&(d.offset*=t);break;case "CIMGeometricEffectRegularPolygon":d.radius&&(d.radius*=t);break;case "CIMGeometricEffectTaperedPolygon":d.fromWidth&& (d.fromWidth*=t);d.length&&(d.length*=t);d.toWidth&&(d.toWidth*=t);break;case "CIMGeometricEffectWave":d.amplitude&&(d.amplitude*=t),d.period&&(d.period*=t)}}function c(d,t){if(d){var w="CIMTextSymbol"===d.type?d.symbol:d;d="CIMPolygonSymbol"===d.type;if(w?.symbolLayers)for(const v of w.symbolLayers)if(!(v.colorLocked||d&&(q.isCIMStroke(v)||q.isCIMMarker(v)&&v.markerPlacement&&q.isCIMMarkerStrokePlacement(v.markerPlacement))))switch(v.type){case "CIMPictureMarker":case "CIMPictureStroke":case "CIMPictureFill":v.tintColor&& e(t,v.tintColor);break;case "CIMVectorMarker":v.markerGraphics?.forEach(m=>{c(m.symbol,t)});break;case "CIMSolidStroke":case "CIMSolidFill":e(t,v.color);break;case "CIMHatchFill":c(v.lineSymbol,t)}}}function e(d,t){for(const w of d)if(w.join(".")===t.join("."))return;d.push(t)}function g(d,t,w){if(d){var v="CIMTextSymbol"===d.type?d.symbol:d;d="CIMPolygonSymbol"===v?.type;if(v?.symbolLayers)for(const m of v.symbolLayers)if(!m.colorLocked){if(d)if(w){if({layersToColor:v}=w,(q.isCIMStroke(m)||q.isCIMMarker(m)&& m.markerPlacement&&q.isCIMMarkerStrokePlacement(m.markerPlacement))&&"fill"===v||q.isCIMFill(m)&&"outline"===v)continue}else if(q.isCIMStroke(m)||q.isCIMMarker(m)&&m.markerPlacement&&q.isCIMMarkerStrokePlacement(m.markerPlacement))continue;v=t.toArray();switch(m.type){case "CIMPictureMarker":case "CIMPictureStroke":case "CIMPictureFill":m.tintColor=v;break;case "CIMVectorMarker":m.markerGraphics?.forEach(r=>{g(r.symbol,t,w)});break;case "CIMSolidStroke":case "CIMSolidFill":m.color=v;break;case "CIMHatchFill":g(m.lineSymbol, t,w)}}}}a.applyCIMSymbolColor=function(d,t,w){t instanceof b||(t=new b(t));(d=q.toCIMSymbolJSON(d))&&g(d,t,w)};a.applyCIMSymbolRotation=function(d,t,w=!1){d=q.toCIMSymbolJSON(d);w&&(t=360-t);if("CIMTextSymbol"===d?.type)d.angle=t;else if("CIMPointSymbol"===d?.type&&d.symbolLayers){w=t-(d.angle||0);for(const v of d.symbolLayers)if(q.isCIMMarker(v)){let m=v.rotation||0;m=v.rotateClockwise?m-w:m+w;v.rotation=m}d.angle=t}};a.getCIMSymbolColor=function(d){d=q.toCIMSymbolJSON(d);const t=[];c(d,t);return t.length? new b(q.normalizeAlpha(t[0])):null};a.getCIMSymbolRotation=function(d,t=!1){d=q.toCIMSymbolJSON(d);return"CIMTextSymbol"===d?.type||"CIMPointSymbol"===d?.type?(d=d.angle,null!=d&&t?360-d:d??0):0};a.getCIMSymbolSize=l;a.getCIMSymbolType=function(d){d=q.toCIMSymbolJSON(d);if(!d)return null;switch(d.type){case "CIMPointSymbol":return"CIMPointSymbol";case "CIMLineSymbol":return"CIMLineSymbol";case "CIMPolygonSymbol":return"CIMPolygonSymbol";case "CIMTextSymbol":return"CIMTextSymbol";case "CIMMeshSymbol":return"CIMMeshSymbol"; default:return null}};a.scaleCIMMarker=k;a.scaleCIMSymbol=p;a.scaleCIMSymbolTo=function(d,t,w){if(d){var v=q.toCIMSymbolJSON(d);d=l(d);if(0===d){if(v)if("CIMTextSymbol"===v.type)v.height=t;else if(v.symbolLayers)for(const m of v.symbolLayers)switch(m.type){case "CIMPictureMarker":case "CIMVectorMarker":m.size=t;break;case "CIMPictureStroke":case "CIMSolidStroke":m.width=t}}else p(v,t/d,!1,w)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/utils":function(){define("require exports ../../Color ../../symbols ../../core/asyncUtils ../../core/has ../../core/screenUtils ../../core/libs/gl-matrix-2/factories/vec3f64 ../../layers/effects/jsonUtils ./cimSymbolUtils ./gfxUtils ./Symbol3DMaterial".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){function t(B){B=B.symbolLayers;if(!B)return null;let C=null;B.forEach(D=>{"object"===D.type&&D.resource?.href||(C="water"===D.type?D.color:D.material?D.material.color:null)});return C?new q(C):null}function w(B,C){if(null==C||null==B)return B;B=B.toRgba();B[3]*=C;return new q(B)}function v(B,C,D){if(B=B.symbolLayers){var F=H=>{C=C??H??(null!=D?A:null);return w(C,D)};B.forEach(H=>{if("object"!==H.type||!H.resource?.href||C)if("water"===H.type)H.color=F(H.color);else{const N= F(null!=H.material?H.material.color:null);null==H.material?H.material=new d.Symbol3DMaterial({color:N}):H.material.color=N;null!=D&&"outline"in H&&null!=H.outline?.color&&(H.outline.color=w(H.outline.color,D))}})}}async function m(B,C){(B=B.symbolLayers)&&await p.forEach(B,async D=>r(D,C))}async function r(B,C){switch(B.type){case "extrude":B.size="number"===typeof C[2]?C[2]:0;break;case "icon":case "line":case "text":C=n(C);null!=C&&(B.size=C);break;case "path":const D=x(C,f.ONES,[B.width,void 0, B.height]);B.width=z(C[0],B.width,1,D);B.height=z(C[2],B.height,1,D);break;case "object":await u(B,C)}}function n(B){for(const C of B)if("number"===typeof C)return C;return null}async function u(B,C){const {resourceSize:D,symbolSize:F}=await y(B),H=x(C,D,F);B.width=z(C[0],F[0],D[0],H);B.depth=z(C[1],F[1],D[1],H);B.height=z(C[2],F[2],D[2],H)}function x(B,C,D){for(let F=0;3>F;F++){const H=B[F];switch(H){case "symbol-value":return B=D[F],null!=B?B/C[F]:1;case "proportional":break;default:if(H&&C[F])return H/ C[F]}}return 1}async function y(B){var {computeObjectLayerResourceSize:C}=await new Promise((G,I)=>a(["./symbolLayerUtils"],G,I));C=await C(B,10);const {width:D,height:F,depth:H}=B;B=[D,H,F];let N=1;for(var E=0;3>E;E++){const G=B[E];if(null!=G){N=G/C[E];break}}for(E=0;3>E;E++)null==B[E]&&(B[E]=C[E]*N);return{resourceSize:C,symbolSize:B}}function z(B,C,D,F){switch(B){case "proportional":return D*F;case "symbol-value":return null!=C?C:D;default:return B}}const A=new q("white");b.applyColorToSymbol= function(B,C,D){if(B&&(C||null!=D))if(C&&=new q(C),l.isSymbol3D(B))v(B,C,D);else if(l.isSymbol2D(B)){if(C=C??B.color)B.color=w(C,D);null!=D&&"outline"in B&&B.outline?.color&&(B.outline.color=w(B.outline.color,D))}};b.applyOpacityToColor=w;b.applyRotationToSymbol=function(B,C,D){B&&null!=C&&(l.isSymbol3D(B)?(B=B.symbolLayers)&&B.forEach(F=>{if(F&&"object"===F.type)switch(D){case "tilt":F.tilt=(F.tilt??0)+C;break;case "roll":F.roll=(F.roll??0)+C;break;default:F.heading=(F.heading??0)+C}}):!l.isSymbol2D(B)|| "simple-marker"!==B.type&&"picture-marker"!==B.type&&"text"!==B.type||(B.angle+=C))};b.applySizesToSymbol=async function(B,C){if(B&&C){if(l.isSymbol3D(B))return m(B,C);if(l.isSymbol2D(B)&&(C=n(C),null!=C))switch(B.type){case "simple-marker":B.size=C;break;case "picture-marker":const D=B.width/B.height;1"bloom"!==C.type).map(C=>C.toJSON());return c.effectFunctionsFromJSON(B)};b.getColorFromSymbol=function(B,C){if(!B)return null;let D=null;l.isSymbol3D(B)?D=t(B):l.isSymbol2D(B)&&(D="cim"===B.type?e.getCIMSymbolColor(B):B.color?new q(B.color):null);return D?w(D,C):null};b.getIconHref=function(B){return B.resource?.href??""};b.getSymbolOutlineSize=function(B){return B?l.isSymbol3D(B)?(B=(B=B.symbolLayers?.at(-1))&& "outline"in B?B?.outline?.size:void 0,null!=B?B:0):h.px2pt(g.getStroke(B)?.width):0};b.isVolumetricSymbol=function(B){if(null==B||!("symbolLayers"in B)||null==B.symbolLayers)return!1;switch(B.type){case "point-3d":return B.symbolLayers.some(C=>"object"===C.type);case "line-3d":return B.symbolLayers.some(C=>"path"===C.type);case "polygon-3d":return B.symbolLayers.some(C=>"object"===C.type||"extrude"===C.type);default:return!1}};b.symbolHasExtrudeSymbolLayer=function(B){return null!=B&&"polygon-3d"=== B.type&&B.symbolLayers.some(C=>"extrude"===C.type)};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/gfxUtils":function(){define("exports ../../assets ../../Color ../../request ../../core/LRUCache ../../core/screenUtils ./cimSymbolUtils".split(" "),function(a,b,q,l,p,k,h){function f(t){if(!t)return null;let w=null;switch(t.type){case "simple-fill":case "picture-fill":case "simple-marker":w=f(t.outline);break;case "simple-line":const v=k.pt2px(t.width);null!=t.style&& "none"!==t.style&&0!==v&&(w={color:t.color,style:d(t.style),width:v,cap:t.cap,join:"miter"===t.join?k.pt2px(t.miterLimit):t.join},w.dashArray=c(w).join(",")||"none");break;default:w=null}return w}function c(t){if(!t?.style)return[];const {dashArray:w,style:v,width:m}=t;if("string"===typeof w&&"none"!==w)return w.split(",").map(u=>Number(u));const r=m??0,n=e.has(v)?e.get(v).map(u=>u*r):[];if("butt"!==t.cap)for(const [u,x]of n.entries())n[u]=1===u%2?x+r:Math.max(x-r,1);return n}const e=new Map([["dash", [4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),g=new p.LRUCache(1E3),d=(()=>{const t={};return w=>{if(t[w])return t[w];const v=w.replaceAll("-","");return t[w]=v}})();q=new q([128,128,128]);a.defaultThematicColor=q;a.dekebabifyLineStyle=d;a.getDashArray=c;a.getFill=function(t){const w=t.style;let v=null;if(t)switch(t.type){case "simple-marker":"cross"!== w&&"x"!==w&&(v=t.color);break;case "simple-fill":w&&"solid"!==w?"none"!==w&&(v={type:"pattern",x:0,y:0,src:b.getAssetUrl(`esri/symbols/patterns/${w}.png`),width:5,height:5}):v=t.color;break;case "picture-fill":v={type:"pattern",src:t.url,width:k.pt2px(t.width)*t.xscale,height:k.pt2px(t.height)*t.yscale,x:k.pt2px(t.xoffset),y:k.pt2px(t.yoffset)};break;case "text":v=t.color;break;case "cim":v=h.getCIMSymbolColor(t)}return v};a.getPatternUrlWithColor=function(t,w){const v=t+"-"+w;return void 0!==g.get(v)? Promise.resolve(g.get(v)):l(t,{responseType:"image"}).then(m=>{m=m.data;const r=m.naturalWidth,n=m.naturalHeight,u=document.createElement("canvas");u.width=r;u.height=n;const x=u.getContext("2d");x.fillStyle=w;x.fillRect(0,0,r,n);x.globalCompositeOperation="destination-in";x.drawImage(m,0,0);m=u.toDataURL();g.put(v,m);return m})};a.getStroke=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/constants":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec4f64"], function(a,b){b=b.ZEROS;a.labelMarginPx=4;a.suspendResumeExtentOptimism=1.2;a.transparentUnit=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ./graphicUtils ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/ModelDirtyTypes".split(" "), function(a,b,q,l,p,k,h,f){class c{constructor(t,w,v,m){this.graphics3DSymbolLayer=t;this.renderGeometries=w;this.boundingBox=v;this._drapeSourceRenderer=m;this.type="draped";this.stage=null;this.isElevationSource=this._addedToStage=this._visible=!1}initialize(t){this.stage=t.stage}setVisibility(t){if(null!=this.stage&&this._visible!==t)if((this._visible=t)&&!this._addedToStage)this._addedToStage=!0,this._drapeSourceRenderer.addGeometries(this.renderGeometries,f.DirtyOperation.ADD);else if(t||this._addedToStage){for(const w of this.renderGeometries)w.visible= this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,f.DirtyState.VISIBILITY)}}destroy(){this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,f.DirtyOperation.REMOVE);this._visible=this._addedToStage=!1;this.stage=null}getCenterObjectSpace(t=q.create()){return b.set(t,0,0,0)}getBoundingBoxObjectSpace(t=l.create()){return l.empty(t)}addObjectState(t,w){t===h.Object3DState.Highlight&&(this.renderGeometries.forEach(v=>{const m=v.geometry.addHighlight(); w.addRenderGeometry(v,m,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,f.DirtyState.HIGHLIGHT))}removeObjectState(t){this.renderGeometries.forEach(w=>{t.removeRenderGeometry(w)})}removeRenderGeometryObjectState(t,w){t.geometry.removeHighlight(w);this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,f.DirtyState.HIGHLIGHT)}computeAttachmentOrigin(t){for(const w of this.renderGeometries)w.geometry.computeAttachmentOrigin(d)&& (t.draped.origin[0]+=d[0],t.draped.origin[1]+=d[1],t.draped.num++)}async getProjectedBoundingBox(t,w,v,m,r){l.empty(r);for(let n=0;n{x=g.measureText(x);const z=x.width/d,A=z+t;this._textWidths.push(z);this._lineWidths.push(A);w=Math.max(w,A);r=Math.max(r,x.actualBoundingBoxAscent/d);n=Math.max(n,x.actualBoundingBoxDescent/d);0===y&&(v=x.actualBoundingBoxAscent/d);y===this._lines.length-1&&(m=x.actualBoundingBoxDescent/d)});e=l.getFontMetrics(this._parameters);const u=Math.max(n,e.maxDescent);this._metricsCached=new c(v,"underline"===this._parameters.definition.font.decoration? u:m,Math.max(r,e.maxAscent),u,w)}return this._metricsCached}get _lineSpacing(){return(this._midLineHeight+this._linePadding)*this._parameters.definition.lineSpacingFactor}get _midLineHeight(){return this._metrics.midLineHeight}get _linePadding(){return.2*this._midLineHeight}get _midLineAscent(){return this._metrics.maxLineAscent}get _renderedFontSize(){return this._toRenderUnit(this._fontSize)}get _fontSize(){return this._parameters.definition.size}get _renderedHaloSize(){return this._toRenderUnit(this._haloSize)}get _haloSize(){return this._parameters.haloSize}get _horizontalPadding(){return this._hasBackground? this._parameters.definition.background.padding[0]:0}get _verticalPadding(){return Math.max(this._hasBackground?this._parameters.definition.background.padding[1]:0,1)}get _hasBackground(){return!!this._parameters.backgroundStyle}get renderPixelRatio(){null==this._renderPixelRatio&&(this._renderPixelRatio=Math.min(this._parameters.definition.pixelRatio,Math.min(this._maxSize[0]/this.displayWidth,this._maxSize[1]/this.displayHeight)));return this._renderPixelRatio}_getLineXOffset(e){switch(this._alignment){case a.TextRenderAlignment.Left:return this._horizontalPadding; case a.TextRenderAlignment.Center:return(this.displayWidth-this._lineWidths[e])/2;case a.TextRenderAlignment.Right:return this.displayWidth-this._horizontalPadding-this._lineWidths[e]}}render(e,g,d){e.save();g/=this.renderPixelRatio;d/=this.renderPixelRatio;const t=g,w=d;var v=this._haloSize;const m=this._firstLineYOffset+this._metrics.firstLineAscent;g+=v;d+=m;const r=0this._renderedHaloSize;n.lineJoin=u?"miter":"round";u?this._renderHaloEmulated(n,t,w):this._renderHaloNative(n,t,w);for(u=0;ur;r++)e.lineWidth=this._toRenderUnit((.6+.1*r)* t),this._strokeText(e,v,g+m,d);d+=this._lineSpacing}}get _displayWidth(){return this._metrics.displayWidth}_toRenderUnit(e){return e*this.renderPixelRatio}_toRoundedRenderUnit(e){return Math.round(e*this.renderPixelRatio)}_fillText(e,g,d,t){e.fillText(g,this._toRenderUnit(d),this._toRenderUnit(t))}_strokeText(e,g,d,t){e.strokeText(g,this._toRenderUnit(d),this._toRenderUnit(t))}_drawLine(e,g,d){e.beginPath();e.moveTo(this._toRoundedRenderUnit(g[0])+.5,this._toRoundedRenderUnit(g[1])+.5);e.lineTo(this._toRoundedRenderUnit(d[0])+ .5,this._toRoundedRenderUnit(d[1])+.5);e.stroke()}_drawBox(e,g,d){var t=this._toRenderUnit(g[0]);g=this._toRenderUnit(g[1]);var w=this._toRenderUnit(d[0]);const v=this._toRenderUnit(d[1]);d=Math.floor(t)+.5;t=Math.ceil(t+w)-.5;w=Math.floor(g)+.5;g=Math.ceil(g+v)-.5;e.beginPath();e.moveTo(d,w);e.lineTo(t,w);e.lineTo(t,g);e.lineTo(d,g);e.lineTo(d,w);e.stroke()}}const h=[];for(let e=0;360>e;e+=22.5)h.push([Math.cos(Math.PI*e/180),Math.sin(Math.PI*e/180)]);a.TextRenderAlignment=void 0;(function(e){e[e.Left= 0]="Left";e[e.Center=1]="Center";e[e.Right=2]="Right"})(a.TextRenderAlignment||(a.TextRenderAlignment={}));const f={canvas:null};class c{get firstLineHeight(){return this.firstLineAscent+this.maxLineDescent}get midLineHeight(){return this.maxLineAscent+this.maxLineDescent}get lastLineHeight(){return this.maxLineAscent+this.lastLineDescent}constructor(e,g,d,t,w){this.firstLineAscent=e;this.lastLineDescent=g;this.maxLineAscent=d;this.maxLineDescent=t;this.displayWidth=w}}a.TextRenderer=k;a.textVerticalPaddingPx= 1;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/FontMetrics":function(){define(["exports","./TextHelperCanvas"],function(a,b){const q=new Map;class l{get maxHeight(){return this.maxAscent+this.maxDescent}constructor(h,f){this.maxAscent=h;this.maxDescent=f}}const p={canvas:null},k=(()=>{let h="";for(let f=32;127>f;f++)h+=String.fromCharCode(f);return h})();a.getFontMetrics=function(h){const {size:f}=h.definition,c=h.fontString(f);var e=q.get(c);e|| (e=b.getTextHelperCanvas(p,0,0).getContext("2d"),h.setFontProperties(e,f),h=e.measureText(k),e=new l(h.actualBoundingBoxAscent,h.actualBoundingBoxDescent),q.set(c,e));return e};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextHelperCanvas":function(){define(["exports"],function(a){a.getTextHelperCanvas=function(b,q,l){b.canvas||(b.canvas=document.createElement("canvas"));b.canvas.width=q;b.canvas.height=l;return b.canvas};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderGeometry":function(){define("exports ../../../../core/uid ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../chunks/sphere ../../support/mathUtils".split(" "),function(a,b,q,l,p,k,h){class f{constructor(e,g={}){this.geometry=e;this.screenToWorldRatio=1;this._transformation=l.create();this._boundingSphere=this._shaderTransformation=null;this.id= b.generateUID();this.layerUid=g.layerUid;this.graphicUid=g.graphicUid;this.castShadow=g.castShadow??!1;null!=g.objectShaderTransformation&&this.objectShaderTransformationChanged(g.objectShaderTransformation)}get transformation(){return this._transformation}set transformation(e){q.copy(this._transformation,e);this._boundingSphere=null}get boundingInfo(){return this.geometry.boundingInfo}objectShaderTransformationChanged(e){null==e?this._shaderTransformation=null:(this._shaderTransformation??(this._shaderTransformation= l.create()),q.multiply(this._shaderTransformation,e,this.geometry.transformation));this._boundingSphere=null}get boundingSphere(){if(!this.boundingInfo)return k.NullSphere;null==this._boundingSphere&&(this._boundingSphere??(this._boundingSphere=k.create()),p.transformMat4(k.getCenter(this._boundingSphere),this.boundingInfo.center,this.shaderTransformation),this._boundingSphere[3]=this.boundingInfo.radius*h.maxScale(this.shaderTransformation));return this._boundingSphere}get material(){return this.geometry.material}get type(){return this.geometry.type}get shaderTransformation(){return this._shaderTransformation?? this.transformation}get attributes(){return this.geometry.attributes}get highlights(){return this.geometry.highlights}get occludees(){return this.geometry.occludees}get visible(){return this.geometry.visible}set visible(e){this.geometry.visible=e}}class c extends f{}a.RenderGeometry=f;a.ValidatedRenderGeometry=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DLineSymbolLayer":function(){define("exports ../../../../geometry ../../../../core/Error ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/aaBoundingBox ../../../../renderers/support/renderingInfoUtils ./ElevationAligners ./elevationAlignmentUtils ./Graphics3DDrapedGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./interfaces ./lineUtils ../support/FastSymbolUpdates ../../support/debugFlags ../../support/engineContent/line ../../support/renderInfoUtils/line ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/materials/LineMarkerMaterial ../../webgl-engine/materials/lineStippleUtils ../../webgl-engine/materials/RibbonLineMaterial ../../../../geometry/Extent ../../../../geometry/Polygon".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){function D(O){switch(O.type){case "extent":if(O instanceof B)return C.fromExtent(O);break;case "polygon":case "polyline":return O}return null}function F(O,L,P){null!=L&&P.symbolLayerStatePatches.push(()=>L.setParameters({color:O}))}const H=["polyline","polygon","extent"],N=new v.ConvertOptions({size:!0,color:!0,rotation:!1,opacity:!0});class E extends d.Graphics3DSymbolLayer{constructor(O,L,P,M){super(O,L,P,M)}async doLoad(){this._fastUpdates= v.initFastSymbolUpdatesState(this._context.renderer,N);if(!this._drivenProperties.size&&0>(null!=this.symbolLayer.size?this.symbolLayer.size:l.px2pt(1)))throw new q("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values");}_getMaterialParameters(O,L=!1){const P=this._getCombinedOpacityAndColor(L&&this._markerColor||this._materialColor);this._patternHidesLine&&!L&&(P[3]=0);O={width:this._computeMaterialWidth(this.symbolLayer?.size),color:P,hasPolygonOffset:!0,join:this.symbolLayer.join|| "miter",cap:w.parseCapType(this.symbolLayer.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:O,stipplePattern:z.getStipplePatternForLinePattern(this.symbolLayer.pattern)};return this._fastUpdates?.visualVariables?{...O,...this._fastUpdates.materialParameters}:O}get _materialColor(){return this.symbolLayer.material?.color}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){null==this._materials[I.Line]&&(this._materials[I.Line]=new A.RibbonLineMaterial(this._getMaterialParameters(!1)), this._context.stage.add(this._materials[I.Line]));return this._materials[I.Line]}get _ringMaterial(){null==this._materials[I.Ring]&&(this._materials[I.Ring]=new A.RibbonLineMaterial(this._getMaterialParameters(!0)),this._context.stage.add(this._materials[I.Ring]));return this._materials[I.Ring]}get _wireframeLineMaterial(){null==this._materials[I.LineWireframe]&&(this._materials[I.LineWireframe]=new A.RibbonLineMaterial({...this._getMaterialParameters(!1),wireframe:!0}),this._context.stage.add(this._materials[I.LineWireframe])); return this._materials[I.LineWireframe]}get _wireframeRingMaterial(){null==this._materials[I.RingWireframe]&&(this._materials[I.RingWireframe]=new A.RibbonLineMaterial({...this._getMaterialParameters(!0),wireframe:!0}),this._context.stage.add(this._materials[I.RingWireframe]));return this._materials[I.RingWireframe]}get _markerMaterial(){null==this._materials[I.Marker]&&null!=this.symbolLayer.marker&&(this._materials[I.Marker]=new y.LineMarkerMaterial({...this._getMaterialParameters(!1,!0),placement:this.symbolLayer.marker.placement, markerPrimitive:w.parseLineMarkerStyle(this.symbolLayer.marker.style)}),this._context.stage.add(this._materials[I.Marker]));return this._materials[I.Marker]}destroy(){super.destroy();this._forEachMaterial(O=>this._context.stage.remove(O));this._materials.length=0}_getDrivenSize(O){return this._drivenProperties.size&&O.size?l.pt2px(h.getDriverAxisSizeValueAny(O.size)):1}_getDrivenColor(O){const L=p.fromValues(1,1,1,1);this._drivenProperties.color&&O.color&&(L[0]=O.color[0],L[1]=O.color[1],L[2]=O.color[2], 0K?.setParameters(M.materialParameters));else return t.ApplyRendererDiffResult.RecreateSymbol;break;default:return t.ApplyRendererDiffResult.RecreateSymbol}return t.ApplyRendererDiffResult.FastUpdate}prepareSymbolLayerPatch(O){if("partial"===O.diff.type){var L=O.diff.diff,P={};"complete"===L.size?.type&&(P.width=this._computeMaterialWidth(L.size.newValue),delete L.size);"complete"===L.cap?.type&&(P.cap=w.parseCapType(L.cap.newValue?? "butt"),delete L.cap);var M=this._prepareMarkerPatch(O,L);this._prepareMaterialPatch(O,L,M);O.symbolLayerStatePatches.push(()=>this._forEachMaterial(K=>K?.setParameters(P)))}}layerOpacityChanged(){this._forEachMaterial((O,L)=>this._updateMaterialLayerOpacity(O,L===I.Marker))}_forEachMaterial(O){this._materials.forEach(O)}_updateMaterialLayerOpacity(O,L=!1){if(null!=O){var P=O.parameters.color,M=this.symbolLayer?.material?.color;L=this._patternHidesLine&&!L?0:this._getCombinedOpacity(M);P=p.fromValues(P[0], P[1],P[2],L);O.setParameters({color:P})}}layerElevationInfoChanged(O,L,P){const M=this._elevationContext.mode;P=c.elevationModeChangeUpdateType(E.elevationModeChangeTypes,P,M);if(P!==c.SymbolUpdateType.UPDATE)return P;const K=c.needsElevationUpdates2D(M);return this.updateGraphics3DGraphicElevationInfo(O,L,()=>K)}slicePlaneEnabledChanged(){const O={hasSlicePlane:this._context.slicePlaneEnabled};this._forEachMaterial(L=>L?.setParameters(O));return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(O, L,P){const M=D(O.graphic.geometry);var K="polygon"===M.type?M.rings:M.paths,J=[];const R=k.create(),Q=n.geometryToRenderInfo(M,this._context.elevationProvider,this._context.renderCoordsHelper,L);this._logGeometryCreationWarnings(Q,K,"polygon"===M.type?"rings":"paths","LineSymbol3DLayer");for(K=0;K{ha=this._createGeometry(ha,O,Y.position,void 0,M.type,G.DRAPED,P.uid);ha=new x.RenderGeometry(ha,{layerUid:L,graphicUid:P.uid});W.push(ha)},null!=Q&&(K(Q),T=this.symbolLayer.marker.placement,"begin"!==T&&"begin-end"!==T||k.expandWithBuffer(S,Y.position,0,1),"end"!==T&&"begin-end"!==T||k.expandWithBuffer(S, Y.position,Y.position.length-3,1)),K(J),m.debugFlags.LINE_WIREFRAMES&&K(R));return new e.Graphics3DDrapedGraphicLayer(this,W,V,this._context.drapeSourceRenderer)}get _patternHidesLine(){const O=this.symbolLayer.pattern;return null!=O&&"style"===O.type&&"none"===O.style}_computeMaterialWidth(O){O=O??l.px2pt(1);return this._drivenProperties.size?this._fastUpdates?.visualVariables.size?l.pt2px(1):1:l.pt2px(O)}_prepareMaterialPatch(O,L,P){var M=L.material;null==M?P.changed&&P.useMaterialColor&&F(this._getCombinedOpacityAndColor(this._materialColor), this._materials[I.Marker],O):"collection"!==M.type&&(M=this._getCombinedOpacityAndColor("complete"===M.type?M.newValue?.color:"complete"===M.diff.color?.type?M.diff.color.newValue:null),P.useMaterialColor&&F(p.clone(M),this._materials[I.Marker],O),this._patternHidesLine&&(M[3]=0),F(M,this._materials[I.Line],O),delete L.material)}_prepareMarkerPatch(O,L){const P=L.marker,M=this._markerMaterial;if(null==P||"partial"!==P.type||null==P.diff||null!=P.diff.placement||null!=P.diff.style&&"complete"!==P.diff.style.type|| null!=P.diff.color&&"complete"!==P.diff.color.type||null==M)return{changed:!1,useMaterialColor:null==this._markerColor};var K=P.diff.color;const J=null!=K;K=J?K.newValue:null;const R=null==K&&null==this._markerColor;K&&F(this._getCombinedOpacityAndColor(K),M,O);const Q=P.diff.style?.newValue;Q&&O.symbolLayerStatePatches.push(()=>M.setParameters({markerPrimitive:w.parseLineMarkerStyle(Q)}));delete L.marker;return{changed:J,useMaterialColor:R}}}E.elevationModeChangeTypes={definedChanged:c.SymbolUpdateType.RECREATE, staysOnTheGround:c.SymbolUpdateType.NONE,onTheGroundChanged:c.SymbolUpdateType.RECREATE};var G;(function(O){O[O.DRAPED=0]="DRAPED";O[O.ELEVATED=1]="ELEVATED"})(G||={});var I;(function(O){O[O.Line=0]="Line";O[O.Ring=1]="Ring";O[O.LineWireframe=2]="LineWireframe";O[O.RingWireframe=3]="RingWireframe";O[O.Marker=4]="Marker"})(I||={});a.Graphics3DLineSymbolLayer=E;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/lineUtils":function(){define(["exports","../../../../core/has", "../../webgl-engine/shaders/RibbonLineTechniqueConfiguration"],function(a,b,q){a.parseCapType=function(l){switch(l){case "butt":return q.CapType.BUTT;case "square":return q.CapType.SQUARE;case "round":return q.CapType.ROUND;default:return null}};a.parseLineMarkerStyle=function(l){return"diamond"===l?"kite":l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/engineContent/line":function(){define("exports ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/projection/projectors ../../../../geometry/support/DoubleArray ../../../../geometry/support/FloatArray ../../../../geometry/support/Indices ../../../ViewingMode ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){const v=q.create(),m=q.create();a.createGeometry=function(r,n,u=null){const x=[],y=n.mapPositions,{attributeData:{position:z},removeDuplicateStartEnd:A}=n;var B=z.length;B=z[0]===z[B-3]&&z[1]===z[B-2]&&z[2]===z[B-1]&&A;var C=z.length/3-(B?1:0),D=Array(2*(C-1)),F=B?z.slice(0,-3):z,H=0;for(var N=0;N{const y=h.newDoubleArray(3*x.length);x.forEach((z,A)=>{y[3*A]=z[0];y[3*A+1]=z[1];y[3*A+2]=z[2]}); u.push({attributeData:{position:y,normal:n},removeDuplicateStartEnd:!1})});return u};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/renderInfoUtils/line":function(){define("exports ../../../../geometry/projection/projectBuffer ../../../../geometry/support/DoubleArray ../../../../geometry/support/triangulationUtils ../../layers/graphics/elevationAlignmentUtils ../../terrain/OverlayRenderer".split(" "),function(a,b,q,l,p,k){function h(f,c,e=null){const g=[];for(const {index:d, count:t}of f){if(1>=t)continue;f=3*d;const w=3*t;g.push({position:q.doubleSubArray(c,3*d,3*t),mapPositions:null!=e?q.doubleSubArray(e,f,w):void 0})}return g}a.geometryToRenderInfo=function(f,c,e,g){const {position:d,outlines:t}=l.ringsToTriangulationInfo("polygon"===f.type?f.rings:f.paths,!!f.hasZ,"polygon"===f.type?l.CounterClockwiseMode.CCW_IS_HOLE:l.CounterClockwiseMode.NONE,f.spatialReference),w=q.newDoubleArray(d.length);f=p.applyPerVertexElevationAlignment(d,f.spatialReference,0,w,0,d,0,d.length/ 3,c,e,g);c=null!=f;return{lines:c?h(t,d,w):[],projectionSuccess:c,sampledElevation:f}};a.geometryToRenderInfoDraped=function(f,c){const {position:e,outlines:g}=l.ringsToTriangulationInfo("polygon"===f.type?f.rings:f.paths,!1,"polygon"===f.type?l.CounterClockwiseMode.CCW_IS_HOLE:l.CounterClockwiseMode.NONE);f=b.projectBuffer(e,f.spatialReference,0,e,c,0,e.length/3);for(c=2;cy===p.ShaderOutput.Highlight||p.isColor(y)&&this.parameters.renderOccluded===h.RenderOccludedFlag.OccludeAndTransparentStencil],[f.RenderSlot.OPAQUE_NO_SSAO_DEPTH,y=>p.isDepth(y)],[f.RenderSlot.OCCLUDER_MATERIAL,y=>p.isColorHighlightOrDepth(y)&&this.parameters.renderOccluded===h.RenderOccludedFlag.OccludeAndTransparentStencil],[f.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL, y=>p.isColorHighlightOrDepth(y)&&this.parameters.renderOccluded===h.RenderOccludedFlag.OccludeAndTransparentStencil],[f.RenderSlot.TRANSPARENT_MATERIAL,y=>p.isColor(y)&&this.parameters.writeDepth],[f.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,y=>p.isColor(y)&&!this.parameters.writeDepth],[f.RenderSlot.DRAPED_MATERIAL,y=>y===p.ShaderOutput.Color||y===p.ShaderOutput.Highlight]]);this._vertexAttributeLocations=g.vertexAttributeLocations;this._configuration=new d.LineMarkerTechniqueConfiguration; this._layout=this.createLayout()}getConfiguration(x,y){this._configuration.output=x;this._configuration.space=y.slot===f.RenderSlot.DRAPED_MATERIAL?d.LineMarkerSpace.Draped:this.parameters.worldSpace?d.LineMarkerSpace.World:d.LineMarkerSpace.Screen;this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments;this._configuration.hasCap=this.parameters.cap!==t.CapType.BUTT;this._configuration.anchor=this.parameters.anchor;this._configuration.hasTip=this.parameters.hasTip;this._configuration.hasSlicePlane= this.parameters.hasSlicePlane;this._configuration.hasOccludees=this.parameters.hasOccludees;this._configuration.writeDepth=this.parameters.writeDepth;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.vvOpacity=!!this.parameters.vvOpacity;this._configuration.occluder=this.parameters.renderOccluded===h.RenderOccludedFlag.OccludeAndTransparentStencil;this._configuration.transparencyPassType=y.transparencyPassType;this._configuration.multipassEnabled= y.multipassEnabled;this._configuration.cullAboveGround=y.multipassTerrain.cullAboveGround;return this._configuration}intersect(){}createLayout(){const x=l.newLayout().vec3f(c.VertexAttribute.POSITION).vec3f(c.VertexAttribute.PREVPOSITION).vec2f(c.VertexAttribute.UV0);this.parameters.worldSpace&&x.vec3f(c.VertexAttribute.NORMAL);this.parameters.vvSize?x.f32(c.VertexAttribute.SIZEFEATUREATTRIBUTE):x.f32(c.VertexAttribute.SIZE);this.parameters.vvColor?x.f32(c.VertexAttribute.COLORFEATUREATTRIBUTE):x.vec4f(c.VertexAttribute.COLOR); this.parameters.vvOpacity&&x.f32(c.VertexAttribute.OPACITYFEATUREATTRIBUTE);return x}createBufferWriter(){return new r(this._layout,this.parameters)}createGLMaterial(x){return new v(x)}}class v extends k.GLTextureMaterial{constructor(){super(...arguments);this._markerPrimitive=null}dispose(){super.dispose();this._markerTextures.release(this._markerPrimitive);this._markerPrimitive=null}_updateParameters(x){const y=this._material.parameters.markerPrimitive;y!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(y, this._markerPrimitive)}),this._markerPrimitive=y);this._material.setParameters(this.textureBindParameters);return this.ensureTechnique(g.LineMarkerTechnique,x)}_updateOccludeeState(x){x.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:x.hasOccludees})}beginSlot(x){this._output===p.ShaderOutput.Color&&this._updateOccludeeState(x);return this._updateParameters(x)}}class m extends e.VisualVariablePassParameters{constructor(){super(...arguments);this.width= 0;this.color=[1,1,1,1];this.markerPrimitive="arrow";this.placement="end";this.cap=t.CapType.BUTT;this.anchor=d.LineMarkerAnchor.Center;this.hideOnShortSegments=this.worldSpace=this.hasTip=!1;this.writeDepth=!0;this.hasOccludees=this.vvFastUpdate=this.hasSlicePlane=!1;this.markerTexture=null}}class r{constructor(x,y){this.vertexBufferLayout=x;this._parameters=y}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(x,y,z,A,B){const C=z.attributes.get(c.VertexAttribute.POSITION).data, D=C.length/3;let F=[1,0,0];y=z.attributes.get(c.VertexAttribute.NORMAL);this._parameters.worldSpace&&null!=y&&(F=y.data);let H=1,N=0;this._parameters.vvSize?N=z.attributes.get(c.VertexAttribute.SIZEFEATUREATTRIBUTE).data[0]:z.attributes.has(c.VertexAttribute.SIZE)&&(H=z.attributes.get(c.VertexAttribute.SIZE).data[0]);let E=[1,1,1,1],G=0;this._parameters.vvColor?G=z.attributes.get(c.VertexAttribute.COLORFEATUREATTRIBUTE).data[0]:z.attributes.has(c.VertexAttribute.COLOR)&&(E=z.attributes.get(c.VertexAttribute.COLOR).data); let I=0;this._parameters.vvOpacity&&(I=z.attributes.get(c.VertexAttribute.OPACITYFEATUREATTRIBUTE).data[0]);const O=new Float32Array(A.buffer);let L=this.vertexBufferLayout.stride/4*B;const P=(K,J,R,Q)=>{O[L++]=K[0];O[L++]=K[1];O[L++]=K[2];O[L++]=J[0];O[L++]=J[1];O[L++]=J[2];O[L++]=R[0];O[L++]=R[1];this._parameters.worldSpace&&(O[L++]=F[0],O[L++]=F[1],O[L++]=F[2]);this._parameters.vvSize?O[L++]=N:O[L++]=H;this._parameters.vvColor?O[L++]=G:(K=Math.min(4*Q,E.length-4),O[L++]=E[K],O[L++]=E[K+1],O[L++]= E[K+2],O[L++]=E[K+3]);this._parameters.vvOpacity&&(O[L++]=I)};let M;(function(K){K[K.ASCENDING=1]="ASCENDING";K[K.DESCENDING=-1]="DESCENDING"})(M||={});z=(K,J)=>{const R=b.set(n,C[3*K],C[3*K+1],C[3*K+2]),Q=u;let W=K+J;do b.set(Q,C[3*W],C[3*W+1],C[3*W+2]),W+=J;while(b.equals(R,Q)&&0<=W&&Wnew Promise((r,n)=>a(["./LineMarker.glsl"],r,n)));b.LineMarkerTechnique=m;b.vertexAttributeLocations=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/LineMarker.glsl":function(){define("exports ../views/3d/support/engineContent/marker ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute ../views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){function z(B){const C=new r.ShaderBuilder,D=B.multipassEnabled&&B.output===q.ShaderOutput.Color,F=B.space===y.LineMarkerSpace.World;C.include(p.RibbonVertexPosition,B);C.include(k.MarkerSizing,B);const {vertex:H,fragment:N}=C;N.include(e.RgbaFloatEncoding);g.addProjViewLocalOrigin(H,B);C.attributes.add(x.VertexAttribute.POSITION,"vec3");C.attributes.add(x.VertexAttribute.PREVPOSITION,"vec3");C.attributes.add(x.VertexAttribute.UV0,"vec2");C.varyings.add("vColor", "vec4");C.varyings.add("vpos","vec3");C.varyings.add("vUV","vec2");C.varyings.add("vSize","float");D&&C.varyings.add("depth","float");B.hasTip&&C.varyings.add("vLineWidth","float");H.uniforms.add(new d.Float2PassUniform("nearFar",(E,G)=>G.camera.nearFar),new t.Float4PassUniform("viewport",(E,G)=>G.camera.fullViewport));H.code.add(v.glsl`vec4 projectAndScale(vec4 pos) { vec4 posNdc = proj * pos; posNdc.xy *= viewport.zw / posNdc.w; return posNdc; }`);H.code.add(v.glsl`void clip(vec4 pos, inout vec4 prev) { float vnp = nearFar[0] * 0.99; if (prev.z > -nearFar[0]) { float interpolation = (-vnp - pos.z) / (prev.z - pos.z); prev = mix(pos, prev, interpolation); } }`);F?(C.attributes.add(x.VertexAttribute.NORMAL,"vec3"),g.addViewNormal(H),H.constants.add("tiltThreshold","float",.7),H.code.add(v.glsl`vec3 perpendicular(vec3 v) { vec3 n = (viewNormal * vec4(normal.xyz, 1.0)).xyz; vec3 n2 = cross(v, n); vec3 forward = vec3(0.0, 0.0, 1.0); float tiltDot = dot(forward, n); return abs(tiltDot) < tiltThreshold ? n : n2; }`)):H.code.add(v.glsl`vec2 perpendicular(vec2 v) { return vec2(v.y, -v.x); }`);H.code.add(v.glsl` #define vecN ${F?"vec3":"vec2"} vecN normalizedSegment(vecN pos, vecN prev) { vecN segment = pos - prev; float segmentLen = length(segment); // normalize or zero if too short return (segmentLen > 0.001) ? segment / segmentLen : ${F?"vec3(0.0, 0.0, 0.0)":"vec2(0.0, 0.0)"}; } vecN displace(vecN pos, vecN prev, float displacementLen) { vecN segment = normalizedSegment(pos, prev); vecN displacementDirU = perpendicular(segment); vecN displacementDirV = segment; ${B.anchor===y.LineMarkerAnchor.Tip?"pos -\x3d 0.5 * displacementLen * displacementDirV;":""} return pos + displacementLen * (uv0.x * displacementDirU + uv0.y * displacementDirV); } `);B.space===y.LineMarkerSpace.Screen&&(H.uniforms.add(new m.Matrix4PassUniform("inverseProjectionMatrix",(E,G)=>G.camera.inverseProjectionMatrix)),H.code.add(v.glsl`vec3 inverseProject(vec4 posScreen) { posScreen.xy = (posScreen.xy / viewport.zw) * posScreen.w; return (inverseProjectionMatrix * posScreen).xyz; }`),H.code.add(v.glsl`bool rayIntersectPlane(vec3 rayDir, vec3 planeOrigin, vec3 planeNormal, out vec3 intersection) { float cos = dot(rayDir, planeNormal); float t = dot(planeOrigin, planeNormal) / cos; intersection = t * rayDir; return abs(cos) > 0.001 && t > 0.0; }`),H.uniforms.add(new w.FloatPassUniform("perScreenPixelRatio",(E,G)=>G.camera.perScreenPixelRatio)),H.code.add(v.glsl` vec4 toFront(vec4 displacedPosScreen, vec3 posLeft, vec3 posRight, vec3 prev, float lineWidth) { // Project displaced position back to camera space vec3 displacedPos = inverseProject(displacedPosScreen); // Calculate the plane that we want the marker to lie in. Note that this will always be an approximation since ribbon lines are generally // not planar and we do not know the actual position of the displaced prev vertices (they are offset in screen space, too). vec3 planeNormal = normalize(cross(posLeft - posRight, posLeft - prev)); vec3 planeOrigin = posLeft; ${B.hasCap?"\n if(prev.z \x3e posLeft.z) {\n vec2 diff \x3d posLeft.xy - posRight.xy;\n planeOrigin.xy +\x3d perpendicular(diff) / 2.0;\n }\n ":""}; // Move the plane towards the camera by a margin dependent on the line width (approximated in world space). This tolerance corrects for the // non-planarity in most cases, but sharp joins can place the prev vertices at arbitrary positions so markers can still clip. float offset = lineWidth * perScreenPixelRatio; planeOrigin *= (1.0 - offset); // Intersect camera ray with the plane and make sure it is within clip space vec3 rayDir = normalize(displacedPos); vec3 intersection; if (rayIntersectPlane(rayDir, planeOrigin, planeNormal, intersection) && intersection.z < -nearFar[0] && intersection.z > -nearFar[1]) { return vec4(intersection.xyz, 1.0); } // Fallback: use depth of pos or prev, whichever is closer to the camera float minDepth = planeOrigin.z > prev.z ? length(planeOrigin) : length(prev); displacedPos *= minDepth / length(displacedPos); return vec4(displacedPos.xyz, 1.0); } `));g.addPixelRatio(H);H.code.add(v.glsl`void main(void) { if (uv0.y == 0.0) { gl_Position = vec4(1e038, 1e038, 1e038, 1.0); } else { float lineWidth = getLineWidth(); float screenMarkerSize = getScreenMarkerSize(); vec4 pos = view * vec4(position, 1.0); vec4 prev = view * vec4(prevPosition, 1.0); clip(pos, prev);`);F?(B.hideOnShortSegments&&H.code.add(v.glsl`if (areWorldMarkersHidden(pos, prev)) { gl_Position = vec4(1e038, 1e038, 1e038, 1.0); return; }`),H.code.add(v.glsl`pos.xyz = displace(pos.xyz, prev.xyz, getWorldMarkerSize(pos)); vec4 displacedPosScreen = projectAndScale(pos);`)):(H.code.add(v.glsl`vec4 posScreen = projectAndScale(pos); vec4 prevScreen = projectAndScale(prev); vec4 displacedPosScreen = posScreen; displacedPosScreen.xy = displace(posScreen.xy, prevScreen.xy, screenMarkerSize);`),B.space===y.LineMarkerSpace.Screen&&H.code.add(v.glsl`vec2 displacementDirU = perpendicular(normalizedSegment(posScreen.xy, prevScreen.xy)); vec3 lineRight = inverseProject(posScreen + lineWidth * vec4(displacementDirU.xy, 0.0, 0.0)); vec3 lineLeft = pos.xyz + (pos.xyz - lineRight); pos = toFront(displacedPosScreen, lineLeft, lineRight, prev.xyz, lineWidth); displacedPosScreen = projectAndScale(pos);`));H.code.add(v.glsl` ${D?"depth \x3d pos.z;":""} // Convert back into NDC displacedPosScreen.xy = (displacedPosScreen.xy / viewport.zw) * displacedPosScreen.w; // Convert texture coordinate into [0,1] vUV = (uv0 + 1.0) / 2.0; ${F?"":"vUV *\x3d displacedPosScreen.w;"} ${B.hasTip?"vLineWidth \x3d lineWidth;":""} vSize = screenMarkerSize; vColor = getColor(); // Use camera space for slicing vpos = pos.xyz; gl_Position = displacedPosScreen; } } `);D&&C.include(h.multipassTerrainTest,B);C.include(l.SliceDraw,B);N.uniforms.add(new t.Float4PassUniform("intrinsicColor",E=>E.color),new n.Texture2DPassUniform("tex",E=>E.markerTexture));N.include(c.ColorConversion);C.constants.add("texelSize","float",1/b.markerTextureSize);N.code.add(v.glsl`float markerAlpha(vec2 samplePos) { samplePos += vec2(0.5, -0.5) * texelSize; float sdf = rgba2float(texture(tex, samplePos)) - 0.5; float distance = sdf * vSize; distance -= 0.5; return clamp(0.5 - distance, 0.0, 1.0); }`);B.hasTip&&(C.constants.add("relativeMarkerSize","float",b.markerSymbolSize/b.markerTextureSize),C.constants.add("relativeTipLineWidth","float",b.markerTipThicknessFactor),N.code.add(v.glsl` float tipAlpha(vec2 samplePos) { // Convert coordinates s.t. they are in pixels and relative to the tip of an arrow marker samplePos -= vec2(0.5, 0.5 + 0.5 * relativeMarkerSize); samplePos *= vSize; float halfMarkerSize = 0.5 * relativeMarkerSize * vSize; float halfTipLineWidth = 0.5 * max(1.0, relativeTipLineWidth * vLineWidth); ${F?"halfTipLineWidth *\x3d fwidth(samplePos.y);":""} float distance = max(abs(samplePos.x) - halfMarkerSize, abs(samplePos.y) - halfTipLineWidth); return clamp(0.5 - distance, 0.0, 1.0); } `));B.transparencyPassType===u.TransparencyPassType.ColorAlpha&&(C.outputs.add("fragColor","vec4",0),C.outputs.add("fragAlpha","float",1));C.constants.add("symbolAlphaCutoff","float",f.symbolAlphaCutoff);N.code.add(v.glsl` void main() { discardBySlice(vpos); ${D?"terrainDepthTest(depth);":""} vec4 finalColor = intrinsicColor * vColor; ${F?"vec2 samplePos \x3d vUV;":"vec2 samplePos \x3d vUV * gl_FragCoord.w;"} ${B.hasTip?"finalColor.a *\x3d max(markerAlpha(samplePos), tipAlpha(samplePos));":"finalColor.a *\x3d markerAlpha(samplePos);"} ${B.output===q.ShaderOutput.ObjectAndLayerIdColor?v.glsl`finalColor.a = 1.0;`:""} if (finalColor.a < symbolAlphaCutoff) { discard; } ${B.output===q.ShaderOutput.Color?v.glsl`fragColor = highlightSlice(finalColor, vpos);`:""} ${B.output===q.ShaderOutput.Color&&B.transparencyPassType===u.TransparencyPassType.ColorAlpha?v.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""} ${B.output===q.ShaderOutput.Highlight?v.glsl`fragColor = vec4(1.0);`:""} } `);return C}const A=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}));a.LineMarker=A;a.build=z})},"esri/views/3d/webgl-engine/materials/lineStippleUtils":function(){define(["exports"],function(a){function b(p){null!=p?(p=l[p],p=null==p?p:{pattern:p.slice(),pixelRatio:8}):p=null;return p}const q={dash:[4,3],dot:[1,3],"long-dash":[8,3],"short-dash":[4,1],"short-dot":[1,1]},l={dash:q.dash,"dash-dot":[...q.dash,...q.dot],dot:q.dot,"long-dash":q["long-dash"], "long-dash-dot":[...q["long-dash"],...q.dot],"long-dash-dot-dot":[...q["long-dash"],...q.dot,...q.dot],none:null,"short-dash":q["short-dash"],"short-dash-dot":[...q["short-dash"],...q["short-dot"]],"short-dash-dot-dot":[...q["short-dash"],...q["short-dot"],...q["short-dot"]],"short-dot":q["short-dot"],solid:null};a.createStipplePatternSimple=function(p){return{pattern:[p,p],pixelRatio:2}};a.getStipplePatternForLinePattern=function(p){return null!=p&&"style"===p.type?b(p.style):null};a.getStipplePatternForPatternStyle= b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer":function(){define("exports ../../../../Color ../../../../core/has ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/projection ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/projection/projectBuffer ../../../../geometry/projection/projectVectorToPoint ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/FloatArray ../../../../geometry/support/Indices ../../../../geometry/support/MeshComponent ../../../../geometry/support/MeshMaterialMetallicRoughness ../../../../geometry/support/MeshTextureTransform ../../../../geometry/support/meshVertexSpaceUtils ../../../../geometry/support/spatialReferenceUtils ../../../../chunks/vec3 ../../../../geometry/support/meshUtils/projection ../../../../layers/graphics/dehydratedPoint ../../../../layers/graphics/sources/interfaces ../../../ViewingMode ../../glTF/internal/resourceUtils ../../glTF/internal/TextureTransformUtils ./ElevationAligners ./elevationAlignmentUtils ./Graphics3DMeshObject3DGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./MeshFastUpdateProcessor ../support/edgeUtils ../support/symbolColorUtils ../../support/debugFlags ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Texture ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/NativeLineMaterial ../../webgl-engine/materials/pbrUtils ../../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea){function da(wa,sa){const Ha=n.newFloatArray(sa.length),Ka=Array(3*sa.length);for(let Aa=0;AaYa;Ya++)Ha[Aa+Ya]=Sa[Ya],Ka[Aa+Ya]=Aa/3}return new ya(Ha,Ka,!1)}function ia(wa,sa,Ha,Ka,Aa,Sa){const Ya=3*sa[Ha],qa=3*sa[Ha+1];sa=3*sa[Ha+2];Ka[0]=wa[Ya];Ka[1]=wa[Ya+1];Ka[2]=wa[Ya+2];Aa[0]=wa[qa];Aa[1]=wa[qa+1];Aa[2]=wa[qa+2];Sa[0]=wa[sa]; Sa[1]=wa[sa+1];Sa[2]=wa[sa+2]}function ka(wa,sa,Ha,Ka){ia(wa,sa,Ha,xa,Ma,Ga);e.subtract(Ma,Ma,xa);e.subtract(Ga,Ga,xa);e.cross(xa,Ma,Ga);e.normalize(Ka,xa);return Ka}function fa(wa){if(!wa)return null;const {scale:sa,offset:Ha,rotation:Ka}=wa;return{scale:sa,offset:Ha,rotation:l.deg2rad(Ka)}}function X(wa="repeat"){return"string"===typeof wa?(wa=ja(wa),{s:wa,t:wa}):{s:ja(wa.horizontal),t:ja(wa.vertical)}}function ja(wa){switch(wa){case "clamp":return ea.TextureWrapMode.CLAMP_TO_EDGE;case "mirror":return ea.TextureWrapMode.MIRRORED_REPEAT; default:return ea.TextureWrapMode.REPEAT}}function la(wa){return null==wa?"-":wa instanceof b?wa.toHex():wa.contentHash}function na(wa){const {offset:sa,scale:Ha,rotation:Ka}=wa??Da;return`${sa[0]},${sa[1]},${Ka},${Ha[0]},${Ha[1]}`}const va=["mesh"];class za extends M.Graphics3DSymbolLayer{constructor(wa,sa,Ha,Ka){super(wa,sa,Ha,Ka);this._materialInfoCache=new K.MaterialInfoCache;this._fastUpdateProcessor=new K.MeshFastUpdateProcessor;this._textures=new Map;this.ensureDrapedStatus(!1)}async doLoad(){Q.debugFlags.DRAW_MESH_GEOMETRY_NORMALS&& (this._debugVertexNormalMaterial=new Z.NativeLineMaterial({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Z.NativeLineMaterial({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Z.NativeLineMaterial({color:[0,1,1,1]}))}destroy(){super.destroy();this._textures.forEach(wa=>wa.unload());this._context.stage.removeMany(this._materialInfoCache.materials);this._context.stage.removeMany(Array.from(this._textures.values()));this._materialInfoCache.clear();this._textures.clear();this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(wa){const sa= wa.graphic;if(!this._validateGeometry(sa.geometry,va,"fill on mesh-3d"))return null;const Ha=this.setGraphicElevationContext(sa);return this._createAs3DShape(sa,wa.renderingInfo,Ha,sa.uid)}onRemoveGraphic(wa){this._fastUpdateProcessor.onRemoveGraphic(wa,this._materialInfoCache,this._context)}layerOpacityChanged(wa,sa){const Ha=this._getLayerOpacity();this._updateMaterialParameters(Ka=>{Ka.material.setParameters({layerOpacity:Ha});const Aa=Ka.material.parameters;this._setMaterialTransparentParameter(Aa, Ka);Ka.material.setParameters({transparent:Aa.transparent})});wa.forEach(Ka=>sa(Ka)?.layerOpacityChanged(Ha,this._context.isAsync))}layerElevationInfoChanged(wa,sa){return this.updateGraphics3DGraphicElevationInfo(wa,sa,O.needsElevationUpdates3D)}slicePlaneEnabledChanged(wa,sa){this._updateMaterialParameters(({material:Ha})=>{Ha.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})});wa.forEach(Ha=>sa(Ha)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync));return!0}physicalBasedRenderingChanged(){const wa= this._usePBR();this._updateMaterialParameters(({material:sa})=>sa.setParameters({usePBR:wa}));return!0}updateTransform(wa,sa,Ha,Ka){if(!wa.fastTransformUpdatesAllowed)return!1;var Aa=wa.fastTransformUpdatesEnabled;switch(Ka){case H.MeshTransformUpdateAction.EnableFastUpdates:if(Aa)return!0;break;case H.MeshTransformUpdateAction.DisableFastUpdates:if(!Aa)return!0;break;default:if(!Aa)return this.updateTransform(wa,sa,Ha,H.MeshTransformUpdateAction.EnableFastUpdates)?(wa.autoDisableFastTransformUpdates(()=> this.updateTransform(wa,sa,Ha,H.MeshTransformUpdateAction.DisableFastUpdates)),!0):!1}Aa=this._context.renderCoordsHelper.spatialReference;const Sa=Ea,{origin:Ya,transform:qa}=Ha;if(!w.computeTranslationToOriginAndRotation(sa,e.set(xa,Ya.x,Ya.y,Ya.z??0),Sa,Aa))return!1;switch(Ka){case H.MeshTransformUpdateAction.EnableFastUpdates:this._fastUpdateProcessor.enable(wa,this._materialInfoCache,this._context);break;case H.MeshTransformUpdateAction.DisableFastUpdates:this._fastUpdateProcessor.disable(wa, this._materialInfoCache,this._context);break;case H.MeshTransformUpdateAction.UpdateFastLocalOrigin:wa.updateFastLocalOrigin(Sa,qa,this._context.localOriginFactory)}const {elevationContext:aa}=wa;aa.centerPointInElevationSR=this._getCenterPointInElevationSR(Sa);const {elevationProvider:Ja,renderCoordsHelper:Ta}=this._context;wa.alignedSampledElevation=I.perObjectElevationAligner(wa,aa,Ja.spatialReference,(Ra,$a)=>O.evaluateElevationInfoAtPoint(Ra,Ja,aa,Ta,$a),Ta,Sa);wa.updateTransform(Sa,qa,this._context.isAsync); wa.updateAutoDisableFastTransformUpdates(()=>this.updateTransform(wa,sa,Ha,H.MeshTransformUpdateAction.DisableFastUpdates));return!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_materialPropertiesDefault(wa,sa){const Ha=this._requiresSymbolVertexColors(),Ka=!!wa.vertexAttributes.color;wa=!!wa.vertexAttributes.tangent;return{hasSymbolVertexColors:Ha,hasVertexColors:Ka,hasVertexTangents:wa,uid:`vc:${Ka},vt:${wa},vct${sa},svc:${Ha}`}}_materialProperties(wa, sa,Ha){wa=this._materialPropertiesDefault(wa,Ha);if(!sa.material)return wa;const {color:Ka,colorTexture:Aa,colorTextureTransform:Sa,normalTexture:Ya,normalTextureTransform:qa,doubleSided:aa,alphaCutoff:Ja,alphaMode:Ta}=sa.material;Ha=la(Ka);var Ra=la(Aa),$a=na(Sa),bb=la(Ya),pa=na(qa);wa.color=Ka;wa.colorTexture=Aa;wa.normalTexture=Ya;wa.uid=`${wa.uid},cmuid:${Ha},ctmuid:${Ra},cttuid:${$a},ntmuid:${bb},nttuid:${pa},ds:${aa},ac:${Ja},am:${Ta}`;if(sa.material instanceof y){const {metallic:Ba,roughness:Ia, metallicRoughnessTexture:Wa,metallicRoughnessTextureTransform:gb,emissiveColor:ib,emissiveTexture:La,emissiveTextureTransform:Xa,occlusionTexture:eb,occlusionTextureTransform:db}=sa.material;sa=la(Wa);Ha=na(gb);Ra=la(ib);$a=la(La);bb=na(Xa);pa=la(eb);const jb=na(db);wa.metallic=Ba;wa.roughness=Ia;wa.metallicRoughnessTexture=Wa;wa.emissiveColor=ib;wa.emissiveTexture=La;wa.occlusionTexture=eb;wa.colorTextureTransform=fa(Sa);wa.normalTextureTransform=fa(qa);wa.emissiveTextureTransform=fa(Xa);wa.occlusionTextureTransform= fa(db);wa.metallicRoughnessTextureTransform=fa(gb);wa.uid=`${wa.uid},mrm:${Ba},mrr:${Ia},mrt:${sa},mrtt:${Ha},emuid:${Ra},etmuid:${$a},ett:${bb},otmuid:${pa},ott:${jb}`}return wa}_getInternalTextureId(wa){return this._getInternalTexture(wa,S.AlphaDiscardMode.Opaque)?.id}_getInternalTexture(wa,sa){const Ha=wa.data??wa.url;if(!Ha)return null;const Ka=`${wa.contentHash}/${sa}`;var Aa=this._textures.get(Ka);Aa||(Aa=null,Aa=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,wa= {wrap:X(wa.wrap),noUnpackFlip:!0,maxAnisotropy:Aa,mipmap:1Ha.a||Ka?.transparent||Sa}Ha=Aa;wa=this._materialProperties(wa,sa,Ha);if(Ka=this._materialInfoCache.byUid(wa.uid))return Ka.material;Ha={uid:wa.uid,material:null, isComponentTransparent:Ha,alphaMode:sa.material?sa.material.alphaMode:"opaque"};Ka=ca.useSchematicPBR({normalTexture:wa.normalTexture,metallicRoughnessTexture:wa.metallicRoughnessTexture,metallicFactor:wa.metallic,roughnessFactor:wa.roughness,emissiveTexture:wa.emissiveTexture,emissiveFactor:b.toUnitRGB(wa.emissiveColor),occlusionTexture:wa.occlusionTexture});Sa={usePBR:this._usePBR(),isSchematic:Ka,hasVertexColors:wa.hasVertexColors,hasSymbolColors:wa.hasSymbolVertexColors,hasVertexTangents:wa.hasVertexTangents, ambient:g.ZEROS,diffuse:g.ONES,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:S.CullFaceOptions.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,initTextureTransparent:!0};Sa.mrrFactors=Ka?[...ca.defaultSchematicMRRFactors]:[wa.metallic,wa.roughness,ca.defaultAdvancedMRRFactors[2]];sa.material&&(Sa.doubleSided=sa.material.doubleSided,Sa.cullFace=sa.material.doubleSided?S.CullFaceOptions.None:S.CullFaceOptions.Back,Sa.textureAlphaCutoff=sa.material.alphaCutoff); this._setExternalMaterialParameters(Sa);this._setMaterialTransparentParameter(Sa,Ha);this._setInternalMaterialParameters(wa,Sa);sa=new U.DefaultMaterial(Sa);Ha.material=sa;this._materialInfoCache.set(wa.uid,Ha);this._context.stage.add(sa);return sa}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(wa,sa){wa.transparent=this.needsDrivenTransparentPass||sa.isComponentTransparent||1>wa.layerOpacity||1>wa.opacity||wa.externalColor&&1>wa.externalColor[3];wa.textureAlphaMode= "auto"===sa.alphaMode?wa.transparent?S.AlphaDiscardMode.MaskBlend:S.AlphaDiscardMode.Opaque:"opaque"===sa.alphaMode?S.AlphaDiscardMode.Opaque:"mask"===sa.alphaMode?S.AlphaDiscardMode.Mask:S.AlphaDiscardMode.Blend}_createFaceDebugNormals(wa,sa){const Ha=sa.length;var Ka=wa.spatialReference.isGeographic?20015077/180:1;wa=.1*Math.max(wa.extent.width*Ka,wa.extent.height*Ka,wa.extent.zmax-wa.extent.zmin);Ka=[];const Aa=[],Sa=sa[0].transformation,Ya=p.normalFromMat4(k.create(),Sa);for(let aa=0;aaO.evaluateElevationInfoAtPoint(aa,Ya,Ha,qa,Ja),qa);return sa}_fastTransformUpdatesAllowed(wa){const {vertexSpace:sa,spatialReference:Ha}=wa;if(!A.isRelativeVertexSpace(sa))return!1; ({type:wa}=sa);var {view:Ka}=this._context.graphicsCoreOwner;const {viewingMode:Aa}=Ka.state;Ka=Ka.spatialReference;return Aa===N.ViewingMode.Global&&"local"===wa||Aa===N.ViewingMode.Local&&B.equals(Ka,Ha)&&"georeferenced"===wa&&!Ha.isGeographic}_getCenterPointInElevationSR(wa){const sa=F.makeDehydratedPoint(0,0,0,null!=this._context.elevationProvider.spatialReference?this._context.elevationProvider.spatialReference:null);m.projectVectorToPoint([wa[12],wa[13],wa[14]],this._context.renderCoordsHelper.spatialReference, sa);return sa}_passthroughReprojectionInfo(wa){return wa.reprojection===Ua.NONE&&!!wa.objectTransformation}_createPositionBuffer(wa,sa){const Ha=wa.vertexAttributes.position;let Ka=Ha,Aa=null;if(sa.reprojection===Ua.NONE)return{position:Ka,georeferencedPositionBuffer:Aa};const Sa=sa.reprojection===Ua.RENDER?sa.transformBeforeProject:null;Sa&&(Ka=C.transformMat4(new Float64Array(Ka.length),Ka,Sa));const {normal:Ya,tangent:qa}=wa.vertexAttributes;this._passthroughReprojectionInfo(sa)||!Ya&&!qa||(Aa= Ka);sa=Ka===Ha||Ka===Aa?new Float64Array(Ka.length):Ka;v.projectBuffer(Ka,wa.spatialReference,0,sa,this._context.renderCoordsHelper.spatialReference,0,Ka.length/3);return{position:sa,georeferencedPositionBuffer:Aa}}_createNormalBuffer(wa,sa,Ha,Ka){const Aa=wa.vertexAttributes.normal;if(null==Aa)return null;let Sa=Aa;const Ya=Ka.reprojection===Ua.RENDER?Ka.transformBeforeProject:null;Ya&&(Sa=D.transformNormal(Sa,new Float32Array(Sa.length),Ya));if(Ka.reprojection===Ua.NONE)return Sa;if("local"===this._context.graphicsCoreOwner.view.viewingMode)return B.isPlateCarree(this._context.renderCoordsHelper.spatialReference)? null==Ha?null:wa.spatialReference.isGeographic?(wa=Sa===Aa?new Float32Array(Sa.length):Sa,D.transformVectorENUPlateCarree(Sa,D.VectorType.NORMAL,Ha,wa)):wa.spatialReference.isWebMercator?(wa=Sa===Aa?new Float32Array(Sa.length):Sa,D.transformVectorWMPlateCarree(Sa,D.VectorType.NORMAL,Ha,wa)):Sa:Sa;if(null==Ha)return null;Ka=Sa===Aa?new Float32Array(Sa.length):Sa;return D.projectNormalToPCPF(Sa,Ha,sa,wa.spatialReference,Ka)}_createTangentBuffer(wa,sa,Ha,Ka){const Aa=wa.vertexAttributes.tangent;if(null== Aa)return null;let Sa=Aa;const Ya=Ka.reprojection===Ua.RENDER?Ka.transformBeforeProject:null;Ya&&(Sa=D.transformTangent(Sa,new Float32Array(Sa.length),Ya));if(Ka.reprojection===Ua.NONE)return Sa;if("local"===this._context.graphicsCoreOwner.view.viewingMode)return B.isPlateCarree(this._context.renderCoordsHelper.spatialReference)?null==Ha?null:wa.spatialReference.isGeographic?(wa=Sa===Aa?new Float32Array(Sa.length):Sa,D.transformVectorENUPlateCarree(Sa,D.VectorType.TANGENT,Ha,wa)):wa.spatialReference.isWebMercator? (wa=Sa===Aa?new Float32Array(Sa.length):Sa,D.transformVectorWMPlateCarree(Sa,D.VectorType.TANGENT,Ha,wa)):Sa:Sa;if(null==Ha)return null;Ka=Sa===Aa?new Float32Array(Sa.length):Sa;return D.projectTangentToPCPF(Sa,Ha,sa,wa.spatialReference,Ka)}_createSymbolColorBuffer(wa){if(this._requiresSymbolVertexColors()){wa=this._getVertexOpacityAndColor(wa);const sa=R.parseColorMixMode(this.symbolLayer?.material?.colorMixMode),Ha=new Uint8Array(4);R.encodeSymbolColor(wa,sa,Ha);return Ha}return null}_createBuffers(wa, sa){var Ha=wa.vertexAttributes&&wa.vertexAttributes.position;if(!Ha)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;var Ka=wa.vertexAttributes.normal;const Aa=wa.vertexAttributes.uv;var Sa=wa.vertexAttributes.tangent;if(Ka&&Ka.length!==Ha.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(Sa&&Sa.length/4!==Ha.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"), null;if(Aa&&Aa.length/2!==Ha.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;Ka=this._computeReprojectionInfo(wa);const {position:Ya,georeferencedPositionBuffer:qa}=this._createPositionBuffer(wa,Ka);Ha=wa.vertexAttributes.color;sa=this._createSymbolColorBuffer(sa);Sa=this._createNormalBuffer(wa,Ya,qa,Ka);const aa=this._createTangentBuffer(wa,Ya,qa,Ka),{transformation:Ja,position:Ta,normal:Ra,tangent:$a}=this._passthroughReprojectionInfo(Ka)? {transformation:Ka.objectTransformation,position:Ya,normal:Sa,tangent:aa}:this._transformOriginLocal(wa,Ya,Sa,aa);wa=Ka.reprojection===Ua.NONE&&Ka.geometryTransformation?Ka.geometryTransformation:f.create();return{positionBuffer:Ta,normalBuffer:Ra,tangentBuffer:$a,uvBuffer:Aa,colorBuffer:Ha,symbolColorBuffer:sa,objectTransformation:Ja,geometryTransformation:wa}}_computeReprojectionInfo(wa){var {vertexSpace:sa}=wa;const Ha="georeferenced"===sa.type?B.equals(this._context.renderCoordsHelper.spatialReference, wa.spatialReference)?Ua.NONE:Ua.RENDER:Ua.NONE;if(A.isAbsoluteVertexSpace(sa))return{reprojection:Ha};const Ka=sa.origin;sa=f.create();const Aa=wa.transform?.localMatrix??f.IDENTITY;if(Ha===Ua.NONE)return w.computeTranslationToOriginAndRotation(wa.spatialReference,Ka,sa,this._context.renderCoordsHelper.spatialReference),wa=f.clone(Aa),{reprojection:Ha,objectTransformation:sa,geometryTransformation:wa};wa=h.fromTranslation(f.create(),Ka);h.multiply(wa,wa,Aa);return{reprojection:Ha,transformBeforeProject:wa}}_transformOriginLocal(wa, sa,Ha,Ka){var Aa=this._context.renderCoordsHelper.spatialReference,Sa=wa.anchor;ra[0]=Sa.x;ra[1]=Sa.y;ra[2]=Sa.z??0;Sa=f.create();w.computeTranslationToOriginAndRotation(wa.spatialReference,ra,Sa,Aa);h.invert(Qa,Sa);const {position:Ya,normal:qa,tangent:aa}=wa.vertexAttributes;wa=sa===Ya?new Float64Array(sa.length):sa;C.transformMat4(wa,sa,Qa);sa=Ha?Ha===qa?new Float32Array(Ha.length):Ha:null;Aa=Ka?Ka===aa?new Float32Array(Ka.length):Ka:null;Ha&&sa&&D.transformNormal(Ha,sa,Qa);Ka&&Aa&&D.transformTangent(Ka, Aa,Qa);return{transformation:Sa,position:wa,normal:sa,tangent:Aa}}_validateFaces(wa,sa){wa=wa.vertexAttributes.position.length/3;if(sa=sa.faces){let Ha=-1;for(let Ka=0;KaHa&&(Ha=Aa)}if(wa<=Ha)return this.logger.warn(`Vertex index ${Ha} is out of bounds of the mesh position buffer`),!1}else if(0!==wa%3)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1; return!0}_isOutsideClippingArea(wa){if(!this._context.clippingExtent)return!1;var sa=wa.vertexAttributes?.position;if(!sa)return!1;wa=D.project({positions:sa,transform:wa.transform,vertexSpace:wa.vertexSpace,inSpatialReference:wa.spatialReference,outSpatialReference:this._context.elevationProvider.spatialReference??wa.spatialReference,localMode:this._context.stage.viewingMode===N.ViewingMode.Local});if(!wa)return!1;sa=wa.length/3;r.empty(ua);r.expandWithBuffer(ua,wa,0,sa);return!r.intersectsClippingArea(ua, this._context.clippingExtent)}_createGeometryInfo(wa,sa,Ha){if(!t.canProjectWithoutEngine(wa.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(wa)||this._isOutsideClippingArea(wa))return null;sa=this._createBuffers(wa,sa);if(null==sa)return null;const {positionBuffer:Ka,uvBuffer:Aa,colorBuffer:Sa,symbolColorBuffer:Ya,normalBuffer:qa,tangentBuffer:aa,objectTransformation:Ja, geometryTransformation:Ta}=sa;var Ra=wa.components??Na;sa=[];let $a=!1;var bb=h.getTranslation(xa,Ja);bb=this._context.localOriginFactory.getOrigin(bb);for(const Xa of Ra){if(!this._validateFaces(wa,Xa))return null;Ra=Xa.faces??u.getContinuousIndexArray(wa.vertexAttributes.position.length/3);if(0!==Ra.length){a:{var pa=Ka;var Ba=Ra;switch(Xa.shading||"flat"){default:case "source":var Ia=qa,Wa=Xa,gb=Ba;if(null==Ia)pa=da(pa,gb);else{Ba=!1;if(!Wa.trustSourceNormals)for(Wa=0;Waib;ib++){var La=3*gb[Wa+ib];xa[0]=Ia[La];xa[1]=Ia[La+1];xa[2]=Ia[La+2];0>e.dot(Pa,xa)&&(Ia[La]=-Ia[La],Ia[La+1]=-Ia[La+1],Ia[La+2]=-Ia[La+2],Ba=!0)}}pa=new ya(Ia,gb,Ba)}break a;case "flat":pa=da(pa,Ba);break a;case "smooth":gb=pa;pa=Ba;Ia={};for(Ba=0;Baib;ib++){La=pa[Ba+ib];let eb=Ia[La];eb||(eb={normal:g.create(),count:0},Ia[La]=eb);e.add(eb.normal,eb.normal,Wa);eb.count++}gb=n.newFloatArray(3*pa.length);Ba=Array(3*pa.length); for(Wa=0;WaLa;La++)gb[3*Wa+La]=ib.normal[La];Ba[Wa]=Wa}pa=new ya(gb,Ba,!1)}}pa.didFlipNormals&&($a=!0);pa=[[ba.VertexAttribute.POSITION,new W.Attribute(Ka,Ra,3,!0)],[ba.VertexAttribute.NORMAL,new W.Attribute(pa.normals,pa.indices,3,!0)]];Sa&&pa.push([ba.VertexAttribute.COLOR,new W.Attribute(Sa,Ra,4,!0)]);Ya&&pa.push([ba.VertexAttribute.SYMBOLCOLOR,new W.Attribute(Ya,u.getZeroIndexArray(Ra.length), 4,!0)]);Aa&&pa.push([ba.VertexAttribute.UV0,new W.Attribute(Aa,Ra,2,!0)]);aa&&pa.push([ba.VertexAttribute.TANGENT,new W.Attribute(aa,Ra,4,!0)]);Ra=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:Ha,layerUid:this._context.layer.uid});Ia=this._getOrCreateMaterial(wa,Xa);Ra=new T.Geometry(Ia,pa,null,V.ContentObjectType.Mesh,Ra);Ra.transformation=Ta;Ra.localOrigin=bb;sa.push(Ra)}}$a&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."); return{geometries:sa,objectTransformation:Ja}}_updateMaterialParameters(wa){this._materialInfoCache.forEachMaterialInfo(wa);this._fastUpdateProcessor.forEachMaterialInfo(wa);this._fastUpdateProcessor.forEachClonedMaterial((sa,Ha)=>{Ha.setParameters(sa.parameters)})}_validateVertexSpace(wa){const {_context:{graphicsCoreOwner:{view:{state:{viewingMode:sa}}}}}=this;({vertexSpace:wa}=wa);return sa===N.ViewingMode.Local&&"local"===wa.type?(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."), !1):!0}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class ya{constructor(wa,sa,Ha){this.normals=wa;this.indices=sa;this.didFlipNormals=Ha}}const Da=new z,ra=g.create(),xa=g.create(),Ma=g.create(),Ga=g.create(),Pa=g.create(),Qa=f.create(),Ea=f.create(),ua=r.create(),Na=[new x];var Ua;(function(wa){wa[wa.NONE=0]="NONE";wa[wa.RENDER=1]="RENDER"})(Ua||={});a.Graphics3DMeshFillSymbolLayer=za;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/MeshComponent":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/ensureType ./MeshMaterial ./MeshMaterialMetallicRoughness ./MeshVertexAttributes".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){var d;b=d=class extends b.JSONSupport{static from(t){return f.ensureClass(d,t)}constructor(t){super(t);this.material=this.faces=null;this.name=void 0;this.shading="source";this.trustSourceNormals=!1}castFaces(t){return g.castArray(t,Uint32Array,[Uint16Array],{loggerTag:".faces\x3d",stride:3},l.getLogger(this))}castMaterial(t){return t&&"object"===typeof t&&("metallic"in t||"roughness"in t||"metallicRoughnessTexture"in t)?f.ensureClass(e,t):f.ensureClass(c,t)}clone(){return new d({faces:q.clone(this.faces), shading:this.shading,material:q.clone(this.material),trustSourceNormals:this.trustSourceNormals,name:this.name})}cloneWithDeduplication(t,w){t={faces:q.clone(this.faces),shading:this.shading,material:this.material?this.material.cloneWithDeduplication(t,w):null,trustSourceNormals:this.trustSourceNormals,name:this.name};return new d(t)}get memoryUsage(){let t=0;null!=this.faces&&(t+=this.faces.byteLength);null!=this.material&&(t+=this.material.memoryUsage);return t}};a.__decorate([p.property({json:{write:!0}})], b.prototype,"faces",void 0);a.__decorate([k.cast("faces")],b.prototype,"castFaces",null);a.__decorate([p.property({type:c,json:{write:!0}})],b.prototype,"material",void 0);a.__decorate([k.cast("material")],b.prototype,"castMaterial",null);a.__decorate([p.property()],b.prototype,"name",void 0);a.__decorate([p.property({type:String,json:{write:!0}})],b.prototype,"shading",void 0);a.__decorate([p.property({type:Boolean})],b.prototype,"trustSourceNormals",void 0);return b=d=a.__decorate([h.subclass("esri.geometry.support.MeshComponent")], b)})},"esri/geometry/support/MeshMaterial":function(){define("../../chunks/tslib.es6 ../../Color ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./MeshTexture ./MeshTextureTransform".split(" "),function(a,b,q,l,p,k,h,f,c,e){var g;q=g=class extends q.JSONSupport{constructor(d){super(d);this.colorTextureTransform=this.colorTexture=this.color=null;this.normalTextureTransform=this.normalTexture= void 0;this.alphaMode="auto";this.alphaCutoff=.5;this.doubleSided=!0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(d,t){const w=null!=d?d.get(this):null;if(w)return w;t=new g(this.clonePropertiesWithDeduplication(t));null!=d&&d.set(this,t);return t}clonePropertiesWithDeduplication(d){return{color:null!=this.color?this.color.clone():null,colorTexture:this.colorTexture?.cloneWithDeduplication(d),normalTexture:this.normalTexture?.cloneWithDeduplication(d),alphaMode:this.alphaMode, alphaCutoff:this.alphaCutoff,doubleSided:this.doubleSided,colorTextureTransform:this.colorTextureTransform?.clone(),normalTextureTransform:this.normalTextureTransform?.clone()}}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let d;d=null!=this.color?16:0;null!=this.colorTexture&&(d+=this.colorTexture.memoryUsage);d+=null!=this.colorTextureTransform?20:0;null!=this.normalTexture&&(d+=this.normalTexture.memoryUsage);return d+=null!=this.normalTextureTransform?20:0}};a.__decorate([l.property({type:b, json:{write:!0}})],q.prototype,"color",void 0);a.__decorate([l.property({type:c,json:{write:!0}})],q.prototype,"colorTexture",void 0);a.__decorate([l.property({type:e,json:{write:!0}})],q.prototype,"colorTextureTransform",void 0);a.__decorate([l.property({type:c,json:{write:!0}})],q.prototype,"normalTexture",void 0);a.__decorate([l.property({type:e,json:{write:!0}})],q.prototype,"normalTextureTransform",void 0);a.__decorate([l.property({nonNullable:!0,json:{write:!0}})],q.prototype,"alphaMode",void 0); a.__decorate([l.property({nonNullable:!0,json:{write:!0}})],q.prototype,"alphaCutoff",void 0);a.__decorate([l.property({nonNullable:!0,json:{write:!0}})],q.prototype,"doubleSided",void 0);return q=g=a.__decorate([f.subclass("esri.geometry.support.MeshMaterial")],q)})},"esri/geometry/support/MeshTexture":function(){define("../../chunks/tslib.es6 ../../core/has ../../core/imageUtils ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../chunks/persistableUrlUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(n){let u="";for(let x=0;x`d:${x},t:${this.transparent},w:${n}`;if(null!=this.url)return u(this.url);if(null!=this.data){if(this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement)return u(this.data.src);m.has(this.data)||m.set(this.data,++r);return u(m.get(this.data))}return u()}get memoryUsage(){let n;n=0+(null!=this.url?this.url.length:0);if(null!= this.data){const u=this.data;"data"in u?n+=u.data.byteLength:u instanceof HTMLImageElement?n+=u.naturalWidth*u.naturalHeight*3:u instanceof HTMLCanvasElement&&(n+=u.width*u.height*3)}return n}clone(){const n={url:this.url,data:this.data,wrap:this._cloneWrap()};return new v(n)}cloneWithDeduplication(n){var u=n.get(this);if(u)return u;u=this.clone();n.set(this,u);return u}_cloneWrap(){return"string"===typeof this.wrap?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}static from(n){return"string"=== typeof n?new v({url:n}):n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof ImageData||n instanceof HTMLVideoElement?new v({data:n}):k.ensureClass(v,n)}};a.__decorate([p.property({type:String,json:{write:g.write}})],b.prototype,"url",null);a.__decorate([p.property({json:{write:{overridePolicy(){return{enabled:!this.url}}}}}),p.property()],b.prototype,"data",null);a.__decorate([e.writer("data")],b.prototype,"writeData",null);a.__decorate([f.reader("data")],b.prototype,"readData", null);a.__decorate([p.property({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],b.prototype,"transparent",null);a.__decorate([p.property({json:{write:!0}})],b.prototype,"wrap",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"contentHash",null);return b=v=a.__decorate([c.subclass("esri.geometry.support.MeshTexture")],b)})},"esri/core/imageUtils":function(){define("require exports ../request ./Error ./promiseUtils ./urlUtils ../support/base64Utils".split(" "), function(a,b,q,l,p,k,h){function f(t,w,v){v||(g||(g=document.createElement("canvas"),g.width=1,g.height=1),v=g);return v.getContext("2d").createImageData(t,w)}async function c(t,w){t=window.URL.createObjectURL(t);try{const {data:v}=await q(t,{...w,responseType:"image"});return v}catch(v){if(!p.isAbortError(v))throw new l("invalid-image",`Could not fetch requested image at ${t}`);throw v;}finally{window.URL.revokeObjectURL(t)}}async function e(t,w){const v=k.dataComponents(t);if(v?.isBase64)return{arrayBuffer:h.base64ToArrayBuffer(v.data), mediaType:v.mediaType};w=await q(t,{responseType:"array-buffer",...w});t=w.data;w=w.getHeader?.("Content-Type")??"";return{arrayBuffer:t,mediaType:w}}let g=null,d=!0;b.createEmptyImageData=function(t,w,v){if(!t||!w)throw Error("Cannot construct image data without dimensions");if(d)try{return new ImageData(t,w)}catch(m){d=!1}return f(t,w,v)};b.getImageData=async function(t,w){const {arrayBuffer:v,mediaType:m}=await e(t,w);t="image/png"===m;if("image/gif"===m){const {isAnimatedGIF:r,parseGif:n}=await new Promise((u, x)=>a(["./image/gif"],u,x));if(r(v))return n(v,w)}if(t){const {isAnimatedPNG:r,parseApng:n}=await new Promise((u,x)=>a(["./image/apng"],u,x));if(r(v))return n(v,w)}t=new Blob([v],{type:m});return c(t,w)};b.wrapImageData=function(t,w,v,m){if(!w||!v)throw Error("Cannot construct image data without dimensions");if(d)try{return new ImageData(t,w,v)}catch(r){d=!1}w=f(w,v,m);w.data.set(t,0);return w};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/MeshTextureTransform":function(){define("../../chunks/tslib.es6 ../../core/Clonable ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){b=class extends b.ClonableMixin(q.JSONSupport){constructor(c){super(c);this.offset=[0,0];this.rotation=0;this.scale=[1,1]}};a.__decorate([l.property({type:[Number],nonNullable:!0,json:{write:!0}})],b.prototype,"offset",void 0);a.__decorate([l.property({type:Number,nonNullable:!0,json:{write:!0}})],b.prototype,"rotation",void 0);a.__decorate([l.property({type:[Number],nonNullable:!0,json:{write:!0}})],b.prototype,"scale",void 0);return b=a.__decorate([f.subclass("esri.geometry.support.MeshTextureTransform")], b)})},"esri/geometry/support/MeshMaterialMetallicRoughness":function(){define("../../chunks/tslib.es6 ../../Color ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./MeshMaterial ./MeshTexture ./MeshTextureTransform".split(" "),function(a,b,q,l,p,k,h,f,c,e){var g;l=g=class extends f{constructor(d){super(d);this.emissiveTexture=this.emissiveColor=null;this.emissiveTextureTransform=void 0;this.occlusionTexture= null;this.occlusionTextureTransform=void 0;this.roughness=this.metallic=1;this.metallicRoughnessTexture=null;this.metallicRoughnessTextureTransform=void 0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(d,t){const w=null!=d?d.get(this):null;if(w)return w;t=new g(this.clonePropertiesWithDeduplication(t));null!=d&&d.set(this,t);return t}getMemoryUsage(){let d=super.getMemoryUsage();d+=null!=this.emissiveColor?16:0;null!=this.emissiveTexture&&(d+=this.emissiveTexture.memoryUsage); d+=null!=this.emissiveTextureTransform?20:0;null!=this.occlusionTexture&&(d+=this.occlusionTexture.memoryUsage);d+=null!=this.occlusionTextureTransform?20:0;null!=this.metallicRoughnessTexture&&(d+=this.metallicRoughnessTexture.memoryUsage);return d+=null!=this.metallicRoughnessTextureTransform?20:0}clonePropertiesWithDeduplication(d){return{...super.clonePropertiesWithDeduplication(d),emissiveColor:this.emissiveColor?.clone(),emissiveTexture:this.emissiveTexture?.cloneWithDeduplication(d),emissiveTextureTransform:this.emissiveTextureTransform?.clone(), occlusionTexture:this.occlusionTexture?.cloneWithDeduplication(d),occlusionTextureTransform:this.occlusionTextureTransform?.clone(),metallic:this.metallic,roughness:this.roughness,metallicRoughnessTexture:this.metallicRoughnessTexture?.cloneWithDeduplication(d),metallicRoughnessTextureTransform:this.metallicRoughnessTextureTransform?.clone()}}};a.__decorate([q.property({type:b,json:{write:!0}})],l.prototype,"emissiveColor",void 0);a.__decorate([q.property({type:c,json:{write:!0}})],l.prototype,"emissiveTexture", void 0);a.__decorate([q.property({type:e,json:{write:!0}})],l.prototype,"emissiveTextureTransform",void 0);a.__decorate([q.property({type:c,json:{write:!0}})],l.prototype,"occlusionTexture",void 0);a.__decorate([q.property({type:e,json:{write:!0}})],l.prototype,"occlusionTextureTransform",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],l.prototype,"metallic",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,json:{write:!0},range:{min:0, max:1}})],l.prototype,"roughness",void 0);a.__decorate([q.property({type:c,json:{write:!0}})],l.prototype,"metallicRoughnessTexture",void 0);a.__decorate([q.property({type:e,json:{write:!0}})],l.prototype,"metallicRoughnessTextureTransform",void 0);return l=g=a.__decorate([h.subclass("esri.geometry.support.MeshMaterialMetallicRoughness")],l)})},"esri/geometry/support/MeshVertexAttributes":function(){define("exports ../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){function c(t,w,v,m){const {loggerTag:r,stride:n}=w;return 0!==t.length%n?(m.error(r,`Invalid array length, expected a multiple of ${n}`),new v([])):t}function e(t,w,v,m,r){if(!t)return t;if(t instanceof w)return c(t,m,w,r);for(const n of v)if(t instanceof n)return c(new w(t),m,w,r);if(Array.isArray(t))return c(new w(t),m,w,r);v=v.map(n=>`'${n.name}'`);r.error(`Failed to set property, expected one of ${v}, but got ${t.constructor.name}`);return new w([])}function g(t,w,v){const m= Array(t.length);for(let r=0;r{P=Math.cos(b.deg2rad(P));M[0]=L?P:1/P;M[1]=1},O)};a.transformVectorWMPlateCarree=function(E,G,I,O){const L=G===a.VectorType.NORMAL;return x(E,G,I,(P,M)=>{P=Math.cosh(-P/w.earth.radius);M[0]=1;M[1]=L?P:1/P},O)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/vec4":function(){define(["exports","../core/has","../geometry/support/buffer/math/common"],function(a,b,q){function l(g,d,t){if(g.count===d.count){var w= g.count,v=t[0],m=t[1],r=t[2],n=t[3],u=t[4],x=t[5],y=t[6],z=t[7],A=t[8],B=t[9],C=t[10],D=t[11],F=t[12],H=t[13],N=t[14];t=t[15];var E=g.typedBuffer;g=g.typedBufferStride;var G=d.typedBuffer;d=d.typedBufferStride;for(let O=0;Ob.getLogger("esri.views.3d.support.buffer.math");Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/sources/interfaces":function(){define(["exports"],function(a){a.MeshTransformUpdateAction=void 0;var b=a.MeshTransformUpdateAction||(a.MeshTransformUpdateAction={});b[b.EnableFastUpdates=0]="EnableFastUpdates"; b[b.DisableFastUpdates=1]="DisableFastUpdates";b[b.UpdateFastLocalOrigin=2]="UpdateFastLocalOrigin";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/resourceUtils":function(){define(["exports","../../../../core/has","../../webgl-engine/lib/basicInterfaces"],function(a,b,q){class l{constructor(p){this.data=p;this.type="encoded-mesh-texture";this.encoding=q.TextureEncodingMimeType.KTX2_ENCODING}}a.EncodedMeshTexture=l;a.imageFromBinaryData=async function(p, k){if(k===q.TextureEncodingMimeType.KTX2_ENCODING)return new l(p);p=new Blob([p],{type:k});const h=URL.createObjectURL(p),f=new Image;if(b("esri-iPhone"))return new Promise((c,e)=>{const g=()=>{t();c(f)},d=w=>{t();e(w)},t=()=>{URL.revokeObjectURL(h);f.removeEventListener("load",g);f.removeEventListener("error",d)};f.addEventListener("load",g);f.addEventListener("error",d);f.src=h});try{f.src=h,await f.decode()}catch(c){console.warn("Failed decoding HTMLImageElement")}URL.revokeObjectURL(h);return f}; a.isEncodedMeshTexture=function(p){return"encoded-mesh-texture"===p?.type};a.jsonFromBinaryData=async function(p){p=await (new Blob([p])).text();return JSON.parse(p)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/TextureTransformUtils":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/mat3f64","../../../../core/libs/gl-matrix-2/factories/vec2f32","../../../../core/libs/gl-matrix-2/math/mat3"],function(a,b,q,l){a.getTransformMatrix= function(p){if(null==p)return null;var k=null!=p.offset?p.offset:q.ZEROS,h=null!=p.rotation?p.rotation:0;p=null!=p.scale?p.scale:q.ONES;k=b.fromValues(1,0,0,0,1,0,k[0],k[1],1);h=b.fromValues(Math.cos(h),-Math.sin(h),0,Math.sin(h),Math.cos(h),0,0,0,1);p=b.fromValues(p[0],0,0,0,p[1],0,0,0,1);const f=b.create();l.multiply(f,h,p);l.multiply(f,k,f);return f};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ./ElevationAligners ./elevationAlignmentUtils ./featureExpressionInfoUtils ./Graphics3DObject3DGraphicLayer ./meshAutoFastUpdateConstants".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g extends c.Graphics3DObject3DGraphicLayer{constructor(){super(...arguments);this.fastTransformUpdatesAllowed=!1;this._originalGeometries=[];this._fastTransformUpdatesEnabled=!1;this._autoDisableFastUpdatesTimeoutId=0}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}destroy(){super.destroy();this._cancelAutoDisableFastUpdates()}enableFastTransformUpdates(x,y){if(this.fastTransformUpdatesAllowed&&!this._fastTransformUpdatesEnabled){this._cancelAutoDisableFastUpdates(); this._fastTransformUpdatesEnabled=!0;var {stageObject:z}=this,A=z.geometries.slice();z.removeAllGeometries();var B=b.getTranslation(d,z.transformation);y=y.getOrigin(B);for(const C of A)B=x(C.material),B=C.instantiate({material:B}),B.localOrigin=y,z.addGeometry(B);this._originalGeometries=A}}autoDisableFastTransformUpdates(x){this._cancelAutoDisableFastUpdates();this._autoDisableFastUpdatesTimeoutId=setTimeout(()=>{this._autoDisableFastUpdatesTimeoutId=0;x()},e.meshAutoFastUpdateConstants.disableDelayMs)}updateAutoDisableFastTransformUpdates(x){this._autoDisableFastUpdatesTimeoutId&& this.autoDisableFastTransformUpdates(x)}_cancelAutoDisableFastUpdates(){clearTimeout(this._autoDisableFastUpdatesTimeoutId);this._autoDisableFastUpdatesTimeoutId=0}disableFastTransformUpdates(x){if(this._fastTransformUpdatesEnabled){this._cancelAutoDisableFastUpdates();this._fastTransformUpdatesEnabled=!1;var {stageObject:y}=this,z=y.geometries.map(A=>x(A.material));y.removeAllGeometries();for(let A=0;A{H.transformation=F;H.localOrigin=D})}}}}updateTransform(x,y,z){const {stageObject:A}= this,B=y?.localMatrix??q.IDENTITY;if(this._fastTransformUpdatesEnabled){var C=A.geometries[0].transformation;y=b.multiply(t,A.transformation,C);x=b.multiply(w,x,B);C=b.multiply(m,x,b.invert(m,C));A.shaderTransformation=C;this._setFastMaterialTransformation({matA:y,matB:x})}else A.shaderTransformation=null,A.transformation=x,A.geometries.forEach(D=>D.transformation=B);this._updateEdgeTransform(z)}alignWithElevation(x,y,z,A){if(this._fastTransformUpdatesEnabled){null!=z&&f.setContextFeature(this.elevationContext.featureExpressionInfoContext, z);var {stageObject:B}=this;if(B.geometries[0].material.parameters.modelTransformation){z=b.multiply(t,B.transformation,B.geometries[0].transformation);var C=b.copy(v,B.effectiveTransformation);this.alignedSampledElevation=k.perObjectElevationAligner(this,this.elevationContext,x.spatialReference,(D,F)=>h.evaluateElevationInfoAtPoint(D,x,this.elevationContext,y,F),y,C);B.shaderTransformation=C;B=b.multiply(w,C,B.geometries[0].transformation);this._setFastMaterialTransformation({matA:z,matB:B});this._updateEdgeTransform(A)}}else super.alignWithElevation(x, y,z,A)}_setFastMaterialTransformation({matA:x,matB:y}){const {stageObject:z}=this;if(0!==z.geometries.length){var A=b.fromTranslation(u,l.scale(d,z.geometries[0].localOrigin.vec3,-1));x=b.multiply(r,A,x);y=b.multiply(n,A,y);A=b.invert(r,x);y=b.multiply(n,y,A);for(const B of z.geometries)B.material.setParameters({modelTransformation:y})}}_updateEdgeTransform(x){const {stageObject:y,_stageLayer:z}=this;z.stage.renderer.withEdgeView(A=>{A.fastUpdateObject3DEdgesTransform(y)||this.resetEdgeObject(x)})}} const d=p.create(),t=q.create(),w=q.create(),v=q.create(),m=q.create(),r=q.create(),n=q.create(),u=q.create();a.Graphics3DMeshObject3DGraphicLayer=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/meshAutoFastUpdateConstants":function(){define(["exports"],function(a){a.meshAutoFastUpdateConstants={disableDelayMs:2E3};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/MeshFastUpdateProcessor":function(){define(["exports", "../../webgl-engine/materials/DefaultMaterial"],function(a,b){class q{constructor(){this._fastTransformOriginalMaterials=new Map;this._fastTransformClonedMaterials=new Map;this._graphicReferenceCount=0}enable(p,k,h){p.enableFastTransformUpdates(f=>{if(1>=this._graphicReferenceCount){if(this._fastTransformOriginalMaterials.has(f))return f;var c=k.byMaterial(f);this._fastTransformOriginalMaterials.set(f,c);k.delete(f);return f}c=new b.DefaultMaterial(f.parameters);h.stage.add(c);this._fastTransformClonedMaterials.set(c, f);return c},h.localOriginFactory)}disable(p,k,h){const f=new Set,c=new Set;p.disableFastTransformUpdates(e=>{if(!this._fastTransformClonedMaterials.has(e)){var g=this._fastTransformOriginalMaterials.get(e);if(k.has(g.uid))return f.add(e),k.byUid(g.uid).material;c.add(e);return g.material}g=this._fastTransformClonedMaterials.get(e);this._fastTransformClonedMaterials.delete(e);h.stage.remove(e);return g});for(const e of f)this._fastTransformOriginalMaterials.delete(e),h.stage.remove(e);for(const e of c)p= this._fastTransformOriginalMaterials.get(e),this._fastTransformOriginalMaterials.delete(e),k.set(p.uid,p)}onAddGraphic(){this._graphicReferenceCount++}onRemoveGraphic(p,k,h){this._graphicReferenceCount--;this.disable(p,k,h)}forEachMaterialInfo(p){this._fastTransformOriginalMaterials.forEach(p)}forEachClonedMaterial(p){this._fastTransformClonedMaterials.forEach(p)}destroy(p){p.removeMany(Array.from(this._fastTransformClonedMaterials.keys()));p.removeMany(Array.from(this._fastTransformOriginalMaterials.values(), ({material:k})=>k));this._fastTransformClonedMaterials.clear();this._fastTransformOriginalMaterials.clear()}}class l{constructor(){this._byUid=new Map;this._byMaterial=new Map}get materials(){return Array.from(this._byUid.values(),p=>p.material)}byUid(p){return this._byUid.get(p)}byMaterial(p){return this._byMaterial.get(p)}set(p,k){this._byUid.set(p,k);this._byMaterial.set(k.material,k)}delete(p){const k=this._byMaterial.get(p)?.uid;k&&(this._byUid.delete(k),this._byMaterial.delete(p))}has(p){return this._byUid.has(p)}forEachMaterialInfo(p){this._byUid.forEach(p)}clear(){this._byUid.clear(); this._byMaterial.clear()}}a.MaterialInfoCache=l;a.MeshFastUpdateProcessor=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/NativeLineMaterial":function(){define("exports ../../../../core/Logger ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/frustum ../../../../geometry/support/lineSegment ../../../../geometry/support/plane ../core/shaderLibrary/ShaderOutput ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/Util ../lib/VertexAttribute ./DefaultBufferWriter ./DefaultLayouts ../shaders/NativeLineTechnique ../shaders/NativeLineTechniqueConfiguration".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){class z extends w.Material{constructor(S){super(S,new B);this._configuration=new y.NativeLineTechniqueConfiguration;this.produces=new Map([[v.RenderSlot.OPAQUE_MATERIAL,V=>V===d.ShaderOutput.Color||V===d.ShaderOutput.Highlight||V===d.ShaderOutput.ObjectAndLayerIdColor]])}getConfiguration(S){this._configuration.output=S;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.hasVertexColors=this.parameters.hasVertexColors; this._configuration.transparent=1>this.parameters.color[3]||1>this.parameters.width;this._configuration.hasOccludees=this.parameters.hasOccludees;return this._configuration}intersect(S,V,T,Y,ha,ba){if(T.options.selectionMode&&S.visible)if(m.isTranslationMatrix(V)){ha=S.attributes.get(r.VertexAttribute.POSITION).data;var U=T.camera,Z=P;p.copy(Z,T.point);k.set(M[0],Z[0]-2,Z[1]+2,0);k.set(M[1],Z[0]+2,Z[1]+2,0);k.set(M[2],Z[0]+2,Z[1]-2,0);k.set(M[3],Z[0]-2,Z[1]-2,0);for(S=0;4>S;S++)if(!U.unprojectFromRenderScreen(M[S], K[S]))return;g.fromPoints(U.eye,K[0],K[1],J);g.fromPoints(U.eye,K[1],K[2],R);g.fromPoints(U.eye,K[2],K[3],Q);g.fromPoints(U.eye,K[3],K[0],W);Y=Number.MAX_VALUE;S=0;for(let ea=0;eag.signedDistance(J,C)&&0>g.signedDistance(J,D)||0>g.signedDistance(R,C)&&0>g.signedDistance(R,D)||0>g.signedDistance(Q,C)&&0>g.signedDistance(Q,D)||0>g.signedDistance(W,C)&&0>g.signedDistance(W, D))){U.projectToRenderScreen(C,N);U.projectToRenderScreen(D,E);if(0>N[2]&&0E[2])k.subtract(F,D,C),ca=U.frustum,ca=-g.signedDistance(ca[c.PlaneIndex.NEAR],D)/k.dot(F,g.getNormal(ca[c.PlaneIndex.NEAR])),k.scale(F,F,ca),k.add(D,D,F),U.projectToRenderScreen(D,E);else if(0>N[2]&&0>E[2])continue;N[2]= 0;E[2]=0;ca=e.distance2(e.fromPoints(N,E,O),Z);caY&&(Y=Number.MAX_VALUE,e.closestLineSegmentPoint(e.fromPoints(G,I,O),e.fromPoints(V,T,L),H)&&(k.subtract(H,H,V),Y=k.length(H),k.scale(H,H,1/Y),Y/=k.distance(V,T)),ba(Y,H,S,!1))}else b.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix")}intersectDraped(S,V,T,Y,ha,ba){if(T.options.selectionMode){V=S.attributes.get(r.VertexAttribute.POSITION).data; var U=S.attributes.get(r.VertexAttribute.SIZE);T=Y[0];Y=Y[1];S=(((U?U.data[0]:0)+1)/2+4)*S.screenToWorldRatio;U=Number.MAX_VALUE;var Z=0;for(let ka=0;kag.makePipelineState({blending:r,depthTest:f.depthCompareLess,depthWrite:n,colorWrite:g.defaultColorWriteParams,stencilWrite:t.hasOccludees? f.stencilWriteMaskOn:null,stencilTest:t.hasOccludees?m?f.stencilToolMaskBaseParams:f.stencilBaseAllZerosParams:null});return t.output===q.ShaderOutput.Color?(this._occludeePipelineState=v(!0,t.transparent?w:null,g.defaultDepthWriteParams),v(!1,t.transparent?w:null,g.defaultDepthWriteParams)):v(!1)}get primitiveType(){return e.PrimitiveType.LINES}getPipeline(t){return t?this._occludeePipelineState:super.getPipeline()}}d.shader=new l.ReloadableShaderModule(c.NativeLine,()=>new Promise((t,w)=>a(["./NativeLine.glsl"], t,w)));b.NativeLineTechnique=d;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/NativeLine.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(m){const r=new d.ShaderBuilder,{vertex:n,fragment:u}=r;r.include(l.Transform,m);r.include(p.VertexColor,m);f.addProjViewLocalOrigin(n,m);r.attributes.add(t.VertexAttribute.POSITION,"vec3");r.varyings.add("vpos","vec3");n.code.add(g.glsl`void main(void) { vpos = position; forwardNormalizedVertexColor(); gl_Position = transformPosition(proj, view, vpos); }`);m.output===b.ShaderOutput.Highlight&&r.include(k.OutputHighlight,m);r.include(q.SliceDraw,m);u.uniforms.add(new e.FloatPassUniform("alphaCoverage",(x,y)=>Math.min(1,x.width*y.camera.pixelRatio)));m.hasVertexColors||u.uniforms.add(new c.Float4PassUniform("constantColor",x=>x.color));u.code.add(g.glsl` void main() { discardBySlice(vpos); vec4 color = ${m.hasVertexColors?"vColor":"constantColor"}; ${m.output===b.ShaderOutput.ObjectAndLayerIdColor?g.glsl`color.a = 1.0;`:""} if (color.a < ${g.glsl.float(h.symbolAlphaCutoff)}) { discard; } ${m.output===b.ShaderOutput.Color?g.glsl`fragColor = highlightSlice(color, vpos);`:""} ${m.output===b.ShaderOutput.Highlight?g.glsl`outputHighlight();`:""} } `);return r}const v=Object.freeze(Object.defineProperty({__proto__:null,build:w},Symbol.toStringTag,{value:"Module"}));a.NativeLine=v;a.build=w})},"esri/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderLibrary/ShaderOutput","../core/shaderTechnique/ShaderTechniqueConfiguration","../materials/DefaultTechniqueConfiguration"],function(a,b,q,l,p){class k extends p.DefaultTechniqueConfiguration{constructor(){super(...arguments); this.output=q.ShaderOutput.Color;this.hasOccludees=this.transparent=this.hasVertexColors=this.hasSlicePlane=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],k.prototype,"output",void 0);b.__decorate([l.parameter()],k.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],k.prototype,"hasVertexColors",void 0);b.__decorate([l.parameter()],k.prototype,"transparent",void 0);b.__decorate([l.parameter()],k.prototype,"hasOccludees",void 0);a.NativeLineTechniqueConfiguration=k;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObjectSymbolLayer":function(){define("exports ../../../../Color ../../../../core/has ../../../../core/promiseUtils ../../../../core/screenUtils ../../../../core/typedArrayUtil ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/projection/projectPointToVector ../../../../geometry/support/aaBoundingBox ../../../../symbols/support/ObjectSymbol3DLayerResource ../../../../symbols/support/symbolLayerUtils3D ./defaultSymbolComplexity ./ElevationAligners ./elevationAlignmentUtils ./Graphics3DLodInstanceGraphicLayer ./Graphics3DSymbolLayer ./graphicUtils ./interfaces ./Loadable ./lodResourceUtils ./objectResourceUtils ./pointUtils ./primitiveObjectSymbolUtils ./SymbolComplexity ./webStyleUtils ../support/FastSymbolUpdates ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/lib/lodRendering/LodRenderer ../../webgl-engine/lib/lodRendering/LodResources ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/pbrUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K){function J(ha,ba,U){const Z=e.create();switch(U.anchor){case "center":c.copy(Z,w.center(ha));c.negate(Z,Z);break;case "top":ba=w.center(ha);c.set(Z,-ba[0],-ba[1],-ha[5]);break;case "bottom":ba=w.center(ha);c.set(Z,-ba[0],-ba[1],-ha[2]);break;case "relative":ba=w.center(ha);ha=w.size(ha);U=(U=U.anchorPosition)?e.fromValues(U.x,U.y,U.z):e.ZEROS;c.multiply(Z,ha,U);c.add(Z,Z,ba);c.negate(Z,Z);break;default:null!=ba?c.negate(Z, ba):c.copy(Z,e.ZEROS)}return Z}class R{constructor(ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja){this.lodResources=ha;this.lodRenderer=ba;this.stageResources=U;this.originalMaterialParameters=Z;this.resourceSize=ca;this.isEsriSymbolResource=ea;this.isWosr=da;this.resourceBoundingBox=ia;this.symbolSize=ka;this.extentPadding=fa;this.physicalBasedRenderingEnabled=X;this.pivotOffset=ja}}class Q extends y.Graphics3DSymbolLayer{getCachedSize(){const [ha,ba,U]=null!=this._resources?this._resources.symbolSize:[1,1,1]; return{width:ha,depth:ba,height:U}}constructor(ha,ba,U,Z){super(ha,ba,U,Z);this._resources=null;this._optionalFields=[];this._instanceIndexToGraphicUid=new Map;this._hasLoadedPBRTextures=!1;this._disposeResourceHandles=[];this.skipHighSymbolLodsChanged=!1;this.ensureDrapedStatus(!1);this._hasLoadedPBRTextures=U.physicalBasedRenderingEnabled}async doLoad(ha){if(!this._drivenProperties.size&&z.validateSymbolLayerSize(this.symbolLayer))throw Error();if(this._isPrimitive){var ba=this.symbolLayer.resource; ba=ba&&H.isValidPrimitive(ba?.primitive)?ba.primitive:v.defaultPrimitive;this._resources=await this._createResourcesForPrimitive(ba,ha)}else ba=(await E.getResourceUrlFromSymbolStyle(this.symbol.styleOrigin))?.href??this.symbolLayer.resource?.href,this._resources=await this._createResourcesForUrl(ba,ha);this.layerOpacityChanged();this.slicePlaneEnabledChanged();this.physicalBasedRenderingChanged();this.complexity=this.computeComplexity()}get extentPadding(){return null!=this._resources?this._resources.extentPadding: 0}get _isPrimitive(){return!this.symbolLayer.resource?.href}get lodRenderer(){return this._resources?.lodRenderer}get materials(){return this._resources?.stageResources.materials??[]}_setMaterialTransparencyParameters(ha,ba=this.symbolLayer?.material?.color){ba=this._getCombinedOpacity(ba);const U=1>ba||this.needsDrivenTransparentPass;ha.transparent=U;ha.opacity=ba;ha.cullFace=U?I.CullFaceOptions.None:I.CullFaceOptions.Back;return ha}async _createResourcesForPrimitive(ha,ba){var U=this.symbolLayer; const Z=w.create(m.objectSymbolLayerPrimitiveBoundingBox(ha)),ca=e.fromArray(w.size(Z)),ea=e.fromArray(m.objectSymbolLayerSizeWithResourceSize(ca,U)),da=c.length(ea);var ia={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:[...K.defaultSchematicMRRFactors],ambient:e.ONES,diffuse:e.ONES,hasSlicePlane:this._context.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!this.symbolLayer.isPrimitive};const ka=!!ia.usePBR; this._setMaterialTransparencyParameters(ia);const fa=this.symbol;if("point-3d"===fa.type&&fa.verticalOffset){const {screenLength:X,minWorldLength:ja,maxWorldLength:la}=fa.verticalOffset;ia.verticalOffset={screenLength:p.pt2px(X),minWorldLength:ja||0,maxWorldLength:null!=la?la:Infinity};ia.castShadows=!1}this._context.screenSizePerspectiveEnabled&&(ia.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);this._drivenProperties.color?ia.externalColor=g.ONES:(U=null!=U.material? U.material.color:null,U=null!=U?b.toUnitRGBA(U):g.ONES,ia.externalColor=U);this._fastUpdates=G.initFastSymbolUpdatesState(this._context.renderer,this._fastVisualVariableConvertOptions(Z,ea,ca,null));ia.isInstanced=!0;this._fastUpdates?(Object.assign(ia,this._fastUpdates.materialParameters),this._optionalFields.push(O.VertexAttribute.FEATUREATTRIBUTE)):this._hasPerInstanceColor()&&(ia.hasInstancedColor=!0,this._optionalFields.push(O.VertexAttribute.COLOR));q("enable-feature:objectAndLayerId-rendering")&& this._optionalFields.push(O.VertexAttribute.OBJECTANDLAYERIDCOLOR);ia=new M.DefaultMaterial(ia);ia=H.primitiveLodResources(ha,ia);if(!ia)throw Error(`Unknown object symbol primitive: ${ha}`);ha=P.materialsFromLodResources(ia).map(X=>({opacity:1,transparent:X.parameters.transparent}));U=await this._createStageResources(ia,ka,ba);ba=await this._createLodRenderer(ia,ba);return new R(ia,ba,U,ha,ca,!1,!1,Z,ea,da,ka,null)}async _createResourcesForUrl(ha,ba){var U={materialParameters:{isInstanced:!0,hasSlicePlane:this._context.slicePlaneEnabled, castShadows:this.symbolLayer.castShadows},streamDataRequester:this._context.streamDataRequester,cache:this._context.sharedResources.objectResourceCache};(this._fastUpdates=G.initFastSymbolUpdatesState(this._context.renderer,this._fastVisualVariableConvertOptions(null,null,null,null)))?(Object.assign(U.materialParameters,this._fastUpdates.materialParameters),this._optionalFields.push(O.VertexAttribute.FEATUREATTRIBUTE)):this._hasPerInstanceColor()&&(U.materialParameters.hasInstancedColor=!0,this._optionalFields.push(O.VertexAttribute.COLOR)); q("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(O.VertexAttribute.OBJECTANDLAYERIDCOLOR);var Z=this.symbol;if("point-3d"===Z.type&&Z.verticalOffset){const {screenLength:Da,minWorldLength:ra,maxWorldLength:xa}=Z.verticalOffset;U.materialParameters.verticalOffset={screenLength:p.pt2px(Da),minWorldLength:ra||0,maxWorldLength:null!=xa?xa:Infinity};U.materialParameters.castShadows=!1}Z=this._context.physicalBasedRenderingEnabled;U.signal=ba;U.usePBR=Z;U.skipHighLods=this._context.skipHighSymbolLods; var ca=await D.fetch(ha,U);ha=ca.isEsriSymbolResource;U=ca.isWosr;const ea=C.makeLodResources(ca.lods),da=this._context,ia=this._getExternalColorParameters(this.symbolLayer.material),ka=this._getCombinedOpacity(this.symbolLayer?.material?.color,{hasIntrinsicColor:!0}),fa=this.needsDrivenTransparentPass;var X=P.materialsFromLodResources(ea);const ja=P.materialsFromLodResources(ea).map(Da=>({opacity:Da.parameters.opacity||1,transparent:Da.parameters.transparent}));X.forEach(Da=>{const ra=Da.parameters; Da.setParameters(ia);const xa=ra.opacity*ka;Da.setParameters({opacity:xa,transparent:1>xa||fa||ra.transparent});da.screenSizePerspectiveEnabled&&Da.setParameters({screenSizePerspective:da.sharedResources.screenSizePerspectiveSettings})});ca=ca.referenceBoundingBox;const la=e.fromArray(w.size(ca)),na=e.fromArray(ea.levels[0].pivotOffset),va=e.fromArray(m.objectSymbolLayerSizeWithResourceSize(la,this.symbolLayer)),za=c.length(va),ya=this._fastUpdates;G.updateFastSymbolUpdatesState(ya,this._context.renderer, this._fastVisualVariableConvertOptions(ca,va,la,na))&&X.forEach(Da=>Da.setParameters(ya.materialParameters));X=await this._createStageResources(ea,Z,ba);ba=await this._createLodRenderer(ea,ba);return new R(ea,ba,X,ja,la,ha,U,ca,va,za,Z,na)}_addDisposeResource(ha){this._disposeResourceHandles.push(ha)}async _createStageResources(ha,ba,U){const Z=this._context.stage,ca=P.materialsFromLodResources(ha);ba!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged();Z.addMany(ca); this._addDisposeResource(()=>Z.removeMany(ca));const ea=P.texturesFromLodResources(ha);Z.addMany(ea);this._addDisposeResource(()=>{ea.forEach(ia=>ia.unload());Z.removeMany(ea)});await Promise.all(ea.map(ia=>this._context.stage.schedule(()=>ia.load(Z.renderView.renderingContext),U)));l.throwIfAborted(U);const da=P.geometriesFromLodResources(ha);Z.addMany(da);this._addDisposeResource(()=>Z.removeMany(da));return{materials:ca,textures:ea,geometries:da}}async _createLodRenderer(ha,ba){const U=this._context.stage, Z=this._fastUpdates,ca=new L.LodRenderer({symbol:ha,optionalFields:this._optionalFields,metadata:{layerUid:this._context.layer.uid,graphicUid:ea=>this._instanceIndexToGraphicUid.get(ea),notifyGraphicGeometryChanged:ea=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(ea)),notifyGraphicVisibilityChanged:ea=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(ea))},shaderTransformation:Z?{applyTransform:(ea,da,ia)=>{ea.getFeatureAttribute(da, T);h.copy(ia,G.evaluateModelTransform(Z.materialParameters,T,ia))},scaleFactor:(ea,da,ia)=>{da.getFeatureAttribute(ia,T);G.evaluateModelTransformScale(ea,Z.materialParameters,T)}}:null},this._context.scheduler);ca.slicePlaneEnabled=this._context.slicePlaneEnabled;this._addDisposeResource(()=>{U.removeRenderPlugin(ca);ca.destroy()});await U.addRenderPlugin(ca,ba);return ca}_getExternalColorParameters(ha){const ba={};this._drivenProperties.color?ba.externalColor=g.ONES:null!=ha?.color?ba.externalColor= b.toUnitRGBA(ha.color):(ba.externalColor=g.ONES,ba.colorMixMode="ignore");return ba}destroy(){super.destroy();this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach(ha=>ha());this._disposeResourceHandles.length=0;this._resources=null}createGraphics3DGraphic(ha){const ba=ha.graphic;if(!this._validateGeometry(ba.geometry))return null;const U=F.placePointOnGeometry(ba.geometry);if(null==U)return this.logger.warn(`unsupported geometry type for icon symbol: ${ba.geometry.type}`), null;const Z=this.setGraphicElevationContext(ba);return this._createAs3DShape(ba,U,ha.renderingInfo,Z,ba.uid,ha.layer.uid)}notifyDestroyGraphicLayer(ha){this._instanceIndexToGraphicUid.delete(ha.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(null!=this._resources){var ha=this._drivenProperties.opacity,ba=!this._isPrimitive,U=this._resources.stageResources.materials,Z=this._resources.originalMaterialParameters;for(let ea=0;eaia||ha||ca.transparent;da.setParameters({opacity:ia,transparent:ca});this._isPrimitive&&da.setParameters({cullFace:ca?I.CullFaceOptions.None:I.CullFaceOptions.Back})}}}layerElevationInfoChanged(ha,ba){return this.updateGraphics3DGraphicElevationInfo(ha,ba,u.needsElevationUpdates3D)}slicePlaneEnabledChanged(){if(null==this._resources)return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled; for(const ha of this._resources.stageResources.materials)ha.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(null==this._resources)return!0;const {stageResources:ha,isWosr:ba}=this._resources;for(const U of ha.materials)this._isPrimitive?U.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):ba||U.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return!1===this._hasLoadedPBRTextures&& !0===this._context.physicalBasedRenderingEnabled?(this._hasLoadedPBRTextures=!0,!1):!0}applyRendererDiff(ha,ba){if(null==this._resources)return A.ApplyRendererDiffResult.RecreateSymbol;const {stageResources:{materials:U},lodRenderer:Z,resourceBoundingBox:ca,symbolSize:ea,resourceSize:da,pivotOffset:ia}=this._resources;for(const ka in ha.diff)switch(ka){case "visualVariables":if(G.updateFastSymbolUpdatesState(this._fastUpdates,ba,this._fastVisualVariableConvertOptions(ca,ea,da,ia))){for(const fa of U)fa.setParameters(this._fastUpdates.materialParameters); Z.notifyShaderTransformationChanged()}else return A.ApplyRendererDiffResult.RecreateSymbol;break;default:return A.ApplyRendererDiffResult.RecreateSymbol}return A.ApplyRendererDiffResult.FastUpdate}computeComplexity(){if(null==this._resources)return super.computeComplexity();var ha=this._resources.lodResources;const ba=r.estimateNumVerticesForLods(ha.levels),U=ca=>Array.from(ca.attributes.values()).reduce((ea,da)=>ea+k.estimateSize(da.data,da.indices),0),Z=P.geometriesFromLodResources(ha).reduce((ca, ea)=>ca+U(ea),0);ha=P.texturesFromLodResources(ha).reduce((ca,ea)=>ca+ea.memoryEstimate,0)+Z;ha={...r.defaultSymbolLayerMemoryComplexity(this.symbol,this.symbolLayer),resourceBytes:ha};return new N.SymbolComplexity({verticesPerFeature:ba,memory:ha})}_hasLodRenderer(){return null!=this._resources}_createAs3DShape(ha,ba,U,Z,ca,ea){if(!this._hasLodRenderer()||null==this._resources)return null;ha=this.getFastUpdateAttrValues(ha);var da=this._context.clippingExtent;t.projectPointToVector(ba,W,this._context.elevationProvider.spatialReference); if(null!=da&&!w.containsPoint(da,W))return null;da="absolute-height"!==Z.mode;const ia=this._computeGlobalTransform(ba,Z,V,Y),ka=this._computeLocalTransform(this._resources,this.symbolLayer,U,S),fa=this._resources.lodRenderer.instanceData,X=fa.addInstance();this._instanceIndexToGraphicUid.set(X,ca);fa.setLocalTransform(X,ka,!1);fa.setGlobalTransform(X,ia);ha&&fa.setFeatureAttribute(X,ha);null==this._fastUpdates&&this._hasPerInstanceColor()&&fa.setColor(X,z.mixinColorAndOpacity(U.color,U.opacity,255)); null!=this._context.stage.renderView.objectAndLayerIdRenderHelper&&fa.setObjectAndLayerIdColor(X,this._context.stage.renderView.objectAndLayerIdRenderHelper.getObjectAndLayerIdColor({graphicUid:ca,layerUid:ea}));U=new x.Graphics3DLodInstanceGraphicLayer(this,X,n.perLodInstanceElevationAligner,Z);da&&(U.alignedSampledElevation=Y.sampledElevation);U.needsElevationUpdates=u.needsElevationUpdates3D(Z.mode);F.extendPointGraphicElevationContext(U,ba,this._context.elevationProvider);return U}_computeGlobalTransform(ha, ba,U,Z){u.evaluateElevationInfoAtPoint(ha,this._context.elevationProvider,ba,this._context.renderCoordsHelper,Z);W[0]=ha.x;W[1]=ha.y;W[2]=Z.z;d.computeTranslationToOriginAndRotation(ha.spatialReference,W,U,this._context.renderCoordsHelper.spatialReference);return U}_computeLocalTransform(ha,ba,U,Z){h.identity(Z);this._applyObjectRotation(U,!1,Z);this._applyObjectRotation(ba,!0,Z);this._applyObjectScale(ha,U,Z);this._applyAnchor(ha,ba,Z);return Z}_applyObjectScale(ha,ba,U){this._fastUpdates?.requiresShaderTransformation|| (ha=z.computeObjectScale(this._drivenProperties.size&&ba.size?ba.size:ha.symbolSize,ha.symbolSize,ha.resourceSize,this._context.renderCoordsHelper.unitInMeters),1===ha[0]&&1===ha[1]&&1===ha[2]||h.scale(U,U,ha))}prepareSymbolLayerPatch(ha){if("partial"===ha.diff.type){var ba=ha.diff.diff;this._preparePatchTransform(ha,ba);this._preparePatchColor(ha,ba)}}updateGeometry(ha,ba){if(null==this._resources)return!0;const U=ba&&F.placePointOnGeometry(ba);if(null==U)return!1;ba=this.getGeometryElevationMode(ba); if(ha.elevationContext.mode!==ba)return!1;this._computeGlobalTransform(U,ha.elevationContext,V,Y);"absolute-height"!==ha.elevationContext.mode&&(ha.alignedSampledElevation=Y.sampledElevation);this._resources.lodRenderer.instanceData.setGlobalTransform(ha.instanceIndex,V,!0);F.extendPointGraphicElevationContext(ha,U,this._context.elevationProvider);return!0}_preparePatchTransform(ha,ba){if((ba.heading||ba.tilt||ba.roll||ba.width||ba.height||ba.depth||ba.anchor||ba.anchorPosition)&&null!=this._resources){var U= (la,na,va)=>(null!=la&&"complete"===la.type?la.newValue:na)??va,Z=U(ba.heading,this.symbolLayer.heading,0),ca=U(ba.tilt,this.symbolLayer.tilt,0),ea=U(ba.roll,this.symbolLayer.roll,0),da=U(ba.width,this.symbolLayer.width,void 0),ia=U(ba.height,this.symbolLayer.height,void 0),ka=U(ba.depth,this.symbolLayer.depth,void 0),fa=U(ba.anchor,this.symbolLayer.anchor,void 0);U=U(ba.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete ba.heading;delete ba.tilt;delete ba.roll;delete ba.width;delete ba.height; delete ba.depth;delete ba.anchor;delete ba.anchorPosition;var X={heading:Z,tilt:ca,roll:ea,anchor:fa,anchorPosition:U},ja=this._resources;this.loadStatus===B.LoadStatus.LOADED&&ha.symbolLayerStatePatches.push(()=>{ja.symbolSize=e.fromArray(m.objectSymbolLayerSizeWithResourceSize(ja.resourceSize,{width:da,height:ia,depth:ka,isPrimitive:this.symbolLayer.isPrimitive}))});ha.graphics3DGraphicPatches.push((la,na)=>{na=this._computeLocalTransform(ja,X,na,S);ja.lodRenderer.instanceData.setLocalTransform(la.instanceIndex, na,!0)})}}_preparePatchColor(ha,ba){if(ba.material&&"partial"===ba.material.type&&(ba=ba.material.diff,ba.color&&"complete"===ba.color.type&&null!=ba.color.newValue&&null!=ba.color.oldValue)){var U=ba.color.newValue,Z=null!=U?b.toUnitRGBA(U):g.ONES;delete ba.color;var ca=this._resources;null!=ca&&ha.graphics3DGraphicPatches.push(ea=>{this._hasPerInstanceColor()?(ca.lodRenderer.instanceData.setColor(ea.instanceIndex,Z),ea=this._setMaterialTransparencyParameters({},U)):ea=this._setMaterialTransparencyParameters({externalColor:Z}, U);for(const da of ca.stageResources.materials)da.setParameters(ea)})}}_applyObjectRotation(ha,ba,U){if(!this._fastUpdates?.requiresShaderTransformation||!ba)return z.computeObjectRotation(ha.heading,ha.tilt,ha.roll,U)}_applyAnchor(ha,ba,U){this._fastUpdates?.requiresShaderTransformation||(ha=J(ha.resourceBoundingBox,ha.pivotOffset,ba))&&h.translate(U,U,ha)}_hasPerInstanceColor(){return this._drivenProperties.color||this._drivenProperties.opacity}_fastVisualVariableConvertOptions(ha,ba,U,Z){const ca= null!=ha?e.fromArray(w.size(ha)):e.ONES;ha=null!=ha?J(ha,Z,this.symbolLayer):e.ZEROS;Z=this._context.renderCoordsHelper.unitInMeters;U=z.computeObjectScale(null!=ba?ba:void 0,ba,U,Z);const ea=e.fromValues(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return new G.ConvertOptions({size:!0,color:!0,rotation:!0,opacity:!1},ca,ba??e.ONES,Z,ha,U,ea)}}const W=e.create(),S=f.create(),V=f.create(),T=g.create(),Y=new u.SampleElevationInfo;a.Graphics3DObjectSymbolLayer=Q;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ./elevationAlignmentUtils ./featureExpressionInfoUtils ./graphicUtils ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Object3DStateID".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g{constructor(r, n,u,x){this.graphics3DSymbolLayer=r;this.instanceIndex=n;this.elevationAligner=u;this.elevationContext=x;this.type="lod-instance";this._highlights=new Set;this.alignedSampledElevation=0;this.needsElevationUpdates=this.isElevationSource=!1}initialize(){}setVisibility(r){const n=this._lodRenderer.instanceData;r!==n.getVisible(this.instanceIndex)&&n.setVisible(this.instanceIndex,r)}destroy(){null!=this.instanceIndex&&(this._lodRenderer.instanceData.removeInstance(this.instanceIndex),this.graphics3DSymbolLayer.notifyDestroyGraphicLayer(this))}alignWithElevation(r, n,u){this.elevationAligner&&(h.setContextFeature(this.elevationContext.featureExpressionInfoContext,u),u=this.elevationAligner(this,this.elevationContext,r.spatialReference,(x,y)=>k.evaluateElevationInfoAtPoint(x,r,this.elevationContext,n,y),n),null!=u&&(this.alignedSampledElevation=u))}getCenterObjectSpace(r=l.create()){this._lodRenderer.instanceData.getCombinedLocalTransform(this.instanceIndex,m);return q.transformMat4(r,this._lodRenderer.baseBoundingSphere.center,m)}getBoundingBoxObjectSpace(r= p.create()){this._lodRenderer.instanceData.getCombinedLocalTransform(this.instanceIndex,m);const n=this._lodRenderer.baseBoundingBox;p.empty(r);for(let u=0;8>u;++u)q.set(t,0===(u&1)?n[0]:n[3],0===(u&2)?n[1]:n[4],0===(u&4)?n[2]:n[5]),q.transformMat4(t,t,m),p.expandWithVec3(r,t);return r}computeAttachmentOrigin(r){this._lodRenderer.instanceData.getGlobalTransform(this.instanceIndex,m);r.render.origin[0]+=m[12];r.render.origin[1]+=m[13];r.render.origin[2]+=m[14];r.render.num++}async getProjectedBoundingBox(r, n,u,x,y){y=this.getBoundingBoxObjectSpace(y);var z=v;const A=p.isPoint(y)?1:z.length;this._lodRenderer.instanceData.getGlobalTransform(this.instanceIndex,m);for(var B=0;BB;B++)y[B]=Math.min(y[B],d[z+B]),y[B+3]=Math.max(y[B+3],d[z+ B]);r&&u.push({location:d.slice(z,z+3),screenSpaceBoundingRect:r})}if(n&&(p.center(y,w),"absolute-height"!==this.elevationContext.mode)){let C;u=f.demResolutionForBoundingBox(y,n.service.spatialReference,n);try{C=await n.service.queryElevation(w[0],w[1],x,u,"ground")}catch(D){}null!=C&&p.offset(y,0,0,-this.alignedSampledElevation+C)}return y}addObjectState(r,n){r===c.Object3DState.Highlight&&(r=new e.Object3DStateID(r),this._addHighlightId(r),n.addExternal(u=>{this._removeHighlightId(u)},r))}removeObjectState(r){this._highlights.forEach(n=> r.remove(n))}_addHighlightId(r){this._highlights.add(r);this._lodRenderer.instanceData.setHighlight(this.instanceIndex,!0)}_removeHighlightId(r){this._highlights.delete(r);this._lodRenderer.instanceData.setHighlight(this.instanceIndex,0new b.LodComponentResources(f,p.stageResources.textures));k=null==p.lodThreshold||0===p.lodThreshold&&0k+h.indexCount/ 3,0);return Math.sqrt(20*p/Math.PI)}a.makeLodResources=function(p){return new b.LodResources(p.map((k,h)=>q(k,h)))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/objectResourceUtils":function(){define("exports ../../../../core/devEnvironmentUtils ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/FloatArray ../../../../geometry/support/buffer/BufferView ../../../../chunks/vec3 ../../../../chunks/vec4 ../../../../chunks/vec2 ../../../../chunks/vec33 ../../../../chunks/vec43 ../../glTF/DefaultLoadingContext ../../glTF/loader ../../glTF/internal/indexUtils ../../glTF/internal/resourceUtils ../../glTF/internal/TextureTransformUtils ./ProcessedObjectResource ./wosrLoader ../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Texture ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/DefaultMaterial_COLOR_GAMMA ../../webgl-engine/materials/pbrUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){function P(R){const Q=R.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return Q?{fileType:"gltf",url:Q[1],specifiedLodIndex:null!=Q[4]?Number(Q[4]):null}:R.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:R,specifiedLodIndex:null}:{fileType:"unknown",url:R,specifiedLodIndex:null}}function M(R,Q,W,S){const V=R.model,T=[],Y=new Map,ha=new Map,ba=V.lods.length,U=g.empty();V.lods.forEach((Z,ca)=>{const ea=!0===S.skipHighLods&& (1{const ka=ea?new I.DefaultMaterial({}):K(V,ia,da,Q,W,Y,ha);var fa=null!=ka?ka:new I.DefaultMaterial({});const X=ia.attributes.position.count,ja=y.convertPrimitiveToTriangles(ia.indices||X,ia.primitiveType);var la=d.newFloatArray(3*X);const {typedBuffer:na,typedBufferStride:va}=ia.attributes.position; w.transformMat4(la,na,ia.transform,3,va);la=[[G.VertexAttribute.POSITION,new F.Attribute(la,ja,3,!0)]];if(null!=ia.attributes.normal){var za=d.newFloatArray(3*X);const {typedBuffer:ra,typedBufferStride:xa}=ia.attributes.normal;l.normalFromMat4(J,ia.transform);w.transformMat3(za,ra,J,3,xa);q.hasScaling(J)&&w.normalize(za,za);la.push([G.VertexAttribute.NORMAL,new F.Attribute(za,ja,3,!0)])}if(null!=ia.attributes.tangent){za=d.newFloatArray(4*X);const {typedBuffer:ra,typedBufferStride:xa}=ia.attributes.tangent; l.fromMat4(J,ia.transform);v.transformMat3(za,ra,J,4,xa);q.hasScaling(J)&&w.normalize(za,za,4);la.push([G.VertexAttribute.TANGENT,new F.Attribute(za,ja,4,!0)])}if(null!=ia.attributes.texCoord0){za=d.newFloatArray(2*X);const {typedBuffer:ra,typedBufferStride:xa}=ia.attributes.texCoord0;m.normalizeIntegerBuffer(za,ra,2,xa);la.push([G.VertexAttribute.UV0,new F.Attribute(za,ja,2,!0)])}za=ia.attributes.color;if(null!=za){const ra=new Uint8Array(4*X);4===za.elementCount?za instanceof t.BufferViewVec4f? v.scale(ra,za,255):za instanceof t.BufferViewVec4u8?n.copy(ra,za):za instanceof t.BufferViewVec4u16&&v.scale(ra,za,1/256):(ra.fill(255),za instanceof t.BufferViewVec3f?w.scale(ra,za.typedBuffer,255,4,za.typedBufferStride):ia.attributes.color instanceof t.BufferViewVec3u8?r.copy(ra,za.typedBuffer,4,ia.attributes.color.typedBufferStride):ia.attributes.color instanceof t.BufferViewVec3u16&&w.scale(ra,za.typedBuffer,1/256,4,za.typedBufferStride));la.push([G.VertexAttribute.COLOR,new F.Attribute(ra,ja, 4,!0)])}ia={geometry:new N.Geometry(fa,la),vertexCount:X};const {geometry:ya,vertexCount:Da}=ia;ia=ya.boundingInfo;null!=ia&&0===ca&&(g.expandWithVec3(U,ia.bbMin),g.expandWithVec3(U,ia.bbMax));null!=ka&&(da.stageResources.geometries.push(ya),da.numberOfVertices+=Da)});ea||T.push(da)}});return{engineResources:T,referenceBoundingBox:U}}function K(R,Q,W,S,V,T,Y){const ha=Q.material+(Q.attributes.normal?"_normal":"")+(Q.attributes.color?"_color":"")+(Q.attributes.texCoord0?"_texCoord0":"")+(Q.attributes.tangent? "_tangent":""),ba=R.materials.get(Q.material);var U=null!=Q.attributes.texCoord0;const Z=null!=Q.attributes.normal;if(null==ba)return null;a:{switch(ba.alphaMode){case "BLEND":var ca=H.AlphaDiscardMode.Blend;break a;case "MASK":ca=H.AlphaDiscardMode.Mask;break a;case "OPAQUE":case null:case void 0:ca=H.AlphaDiscardMode.Opaque;break a}ca=void 0}if(!T.has(ha)){if(U){var ea=(va,za=!1)=>{if(null!=va&&!Y.has(va)){const ya=R.textures.get(va);if(null!=ya){const Da=ya.data;Y.set(va,new E.Texture(z.isEncodedMeshTexture(Da)? Da.data:Da,{...ya.parameters,preMultiplyAlpha:z.isEncodedMeshTexture(Da)?!1:za,encoding:z.isEncodedMeshTexture(Da)&&null!=Da.encoding?Da.encoding:void 0}))}}};ea(ba.textureColor,ca!==H.AlphaDiscardMode.Opaque);ea(ba.textureNormal);ea(ba.textureOcclusion);ea(ba.textureEmissive);ea(ba.textureMetallicRoughness)}ea=ba.color[0]**(1/O.colorGamma);const da=ba.color[1]**(1/O.colorGamma),ia=ba.color[2]**(1/O.colorGamma),ka=ba.emissiveFactor[0]**(1/O.colorGamma),fa=ba.emissiveFactor[1]**(1/O.colorGamma),X= ba.emissiveFactor[2]**(1/O.colorGamma),ja=null!=ba.textureColor&&U?Y.get(ba.textureColor):null,la=L.useSchematicPBR({normalTexture:ba.textureNormal,metallicRoughnessTexture:ba.textureMetallicRoughness,metallicFactor:ba.metallicFactor,roughnessFactor:ba.roughnessFactor,emissiveTexture:ba.textureEmissive,emissiveFactor:ba.emissiveFactor,occlusionTexture:ba.textureOcclusion}),na=null!=ba.normalTextureTransform?.scale?ba.normalTextureTransform?.scale:f.ONES;T.set(ha,new I.DefaultMaterial({...S,transparent:ca=== H.AlphaDiscardMode.Blend,customDepthTest:H.DepthTestFunction.Lequal,textureAlphaMode:ca,textureAlphaCutoff:ba.alphaCutoff,diffuse:[ea,da,ia],ambient:[ea,da,ia],opacity:ba.opacity,doubleSided:ba.doubleSided,doubleSidedType:"winding-order",cullFace:ba.doubleSided?H.CullFaceOptions.None:H.CullFaceOptions.Back,hasVertexColors:!!Q.attributes.color,hasVertexTangents:!!Q.attributes.tangent,normalType:Z?D.NormalType.Attribute:D.NormalType.ScreenDerivative,castShadows:!0,receiveShadows:ba.receiveShadows,receiveAmbientOcclusion:ba.receiveAmbientOcclustion, textureId:null!=ja?ja.id:void 0,colorMixMode:ba.colorMixMode,normalTextureId:null!=ba.textureNormal&&U?Y.get(ba.textureNormal).id:void 0,textureAlphaPremultiplied:null!=ja&&!!ja.parameters.preMultiplyAlpha,occlusionTextureId:null!=ba.textureOcclusion&&U?Y.get(ba.textureOcclusion).id:void 0,emissiveTextureId:null!=ba.textureEmissive&&U?Y.get(ba.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=ba.textureMetallicRoughness&&U?Y.get(ba.textureMetallicRoughness).id:void 0,emissiveFactor:[ka, fa,X],mrrFactors:la?[...L.defaultSchematicMRRFactors]:[ba.metallicFactor,ba.roughnessFactor,S.mrrFactors[2]],isSchematic:la,colorTextureTransformMatrix:A.getTransformMatrix(ba.colorTextureTransform),normalTextureTransformMatrix:A.getTransformMatrix(ba.normalTextureTransform),scale:[na[0],na[1]],occlusionTextureTransformMatrix:A.getTransformMatrix(ba.occlusionTextureTransform),emissiveTextureTransformMatrix:A.getTransformMatrix(ba.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:A.getTransformMatrix(ba.metallicRoughnessTextureTransform), ...V}))}Q=T.get(ha);W.stageResources.materials.push(Q);U&&(U=da=>{null!=da&&W.stageResources.textures.push(Y.get(da))},U(ba.textureColor),U(ba.textureNormal),U(ba.textureOcclusion),U(ba.textureEmissive),U(ba.textureMetallicRoughness));return Q}const J=p.create();a.fetch=async function(R,Q){R=P(b.adjustStaticAGOUrl(R));if("wosr"===R.fileType){R=await (Q.cache?Q.cache.loadWOSR(R.url,Q):C.load(R.url,Q));const {engineResources:Z,referenceBoundingBox:ca}=C.processLoadResult(R,Q);return{lods:Z,referenceBoundingBox:ca, isEsriSymbolResource:!1,isWosr:!0}}const W=await (Q.cache?Q.cache.loadGLTF(R.url,Q,!!Q.usePBR):x.loadGLTF(new u.DefaultLoadingContext(Q.streamDataRequester),R.url,Q,Q.usePBR)),S=W.model.meta?.ESRI_proxyEllipsoid,V=W.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===W.meta.ESRI_webstyle;if(V&&!W.customMeta.esriTreeRendering){W.customMeta.esriTreeRendering=!0;a:for(let Z=0;Z null!=h?.match(f))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/vec2":function(){define(["exports","../core/typedArrayUtil"],function(a,b){function q(h,f){l(h.typedBuffer,f.typedBuffer,h.typedBufferStride,f.typedBufferStride)}function l(h,f,c=2,e=c){const g=f.length/2;let d=0,t=0;if(b.isArray(f)||b.isFloat(f))for(var w=0;w{w=w.extras;null!=w&&(w.ESRI_proxyEllipsoid||w.ESRI_lod)&&(t=w)});return t}async function f(d,t){async function w(u,x){const y=v.nodes[u];u=d.getNodeTransform(u);null!=y.weights&&b.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."); if(null!=y.mesh){const z=v.meshes[y.mesh];for(const A of z.primitives)n.push(t(A,u,x,z.name))}for(const z of y.children||[])n.push(w(z,x))}const v=d.json;var m=v.scenes[v.scene||0].nodes;const r=1w(x,y+1));await Promise.all(n)}function c(d,t,w){const v=r=>{const n=`${w}_tex_${r&&r.id}${r?.name?"_"+r.name:""}`;r&&!d.textures.has(n)&& (r=l.makeTextureSource(r.data,{wrap:{s:r.wrapS,t:r.wrapT},mipmap:g.has(r.minFilter),noUnpackFlip:!0}),d.textures.set(n,r));return n},m=`${w}_mat_${t.id}_${t.name}`;d.materials.has(m)||(t=l.makeMaterialParameters({color:[t.color[0],t.color[1],t.color[2]],opacity:t.color[3],alphaMode:t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,colorMixMode:t.ESRI_externalColorMixMode,textureColor:t.colorTexture?v(t.colorTexture):void 0,textureNormal:t.normalTexture?v(t.normalTexture):void 0,textureOcclusion:t.occlusionTexture? v(t.occlusionTexture):void 0,textureEmissive:t.emissiveTexture?v(t.emissiveTexture):void 0,textureMetallicRoughness:t.metallicRoughnessTexture?v(t.metallicRoughnessTexture):void 0,emissiveFactor:[t.emissiveFactor[0],t.emissiveFactor[1],t.emissiveFactor[2]],colorTextureTransform:t.colorTextureTransform,normalTextureTransform:t.normalTextureTransform,occlusionTextureTransform:t.occlusionTextureTransform,emissiveTextureTransform:t.emissiveTextureTransform,metallicRoughnessTextureTransform:t.metallicRoughnessTextureTransform, metallicFactor:t.metallicFactor,roughnessFactor:t.roughnessFactor,receiveShadows:t.receiveShadows,receiveAmbientOcclustion:t.receiveAmbientOcclusion}),d.materials.set(m,t));return m}let e=0;const g=new Set([k.TextureSamplingMode.LINEAR_MIPMAP_LINEAR,k.TextureSamplingMode.LINEAR_MIPMAP_NEAREST]);a.loadGLTF=async function(d,t,w={},v=!0){const m=await p.GLTFResource.load(d,t,w),r=`gltf_${e++}`,n={lods:[],materials:new Map,textures:new Map,meta:h(m)};d=!(!m.json.asset.extras||"symbolResource"!==m.json.asset.extras.ESRI_type); t=m.json.asset.extras?.ESRI_webstyleSymbol?.webstyle;const u=new Map;await f(m,async(y,z,A,B)=>{const C=u.get(A)??0;u.set(A,C+1);var D=void 0!==y.mode?y.mode:k.PrimitiveType.TRIANGLES,F=D===k.PrimitiveType.TRIANGLES||D===k.PrimitiveType.TRIANGLE_STRIP||D===k.PrimitiveType.TRIANGLE_FAN?D:null;if(null==F)b.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+k.PrimitiveType[D]+"). Skipping primitive.");else if(m.hasPositions(y)){D=m.getPositionData(y,w);var H=m.getMaterial(y, w,v),N=m.hasNormals(y)?m.getNormalData(y,w):null,E=m.hasTangents(y)?m.getTangentData(y,w):null,G=m.hasTextureCoordinates(y)?m.getTextureCoordinates(y,w):null,I=m.hasVertexColors(y)?m.getVertexColors(y,w):null;y=m.getIndexData(y,w);z={name:B,transform:q.clone(z),attributes:{position:await D,normal:N?await N:null,texCoord0:G?await G:null,color:I?await I:null,tangent:E?await E:null},indices:await y,primitiveType:F,material:c(n,await H,r)};F=null;null!=n.meta?.ESRI_lod&&"screenSpaceRadius"===n.meta.ESRI_lod.metric&& (F=n.meta.ESRI_lod.thresholds[A]);n.lods[A]=n.lods[A]||{parts:[],name:B,lodThreshold:F};n.lods[A].parts[C]=z}else b.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.")});for(var x of n.lods)x.parts=x.parts.filter(y=>!!y);x=await m.getLoadedBuffersSize();return{model:n,meta:{isEsriSymbolResource:d,uri:m.uri,ESRI_webstyle:t},customMeta:{},size:x}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/LoaderResult":function(){define(["exports", "../../webgl/enums"],function(a,b){a.makeMaterialParameters=function(q={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclustion:!0,textureColor:null,textureNormal:null,textureOcclusion:null,textureEmissive:null,textureMetallicRoughness:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0, 0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...q}};a.makeTextureSource=function(q,l={}){return{data:q,parameters:{wrap:{s:b.TextureWrapMode.REPEAT,t:b.TextureWrapMode.REPEAT,...l.wrap},noUnpackFlip:!0,mipmap:!1,...l}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/Resource":function(){define("exports ../../../../core/Error ../../../../core/Logger ../../../../core/MapUtils ../../../../core/promiseUtils ../../../../core/urlUtils ../../../../core/Version ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/quat ../../../../core/libs/gl-matrix-2/factories/quatf64 ../../../../geometry/support/buffer/BufferView ../../../../chunks/scalar ../../../../core/has ./BinaryStreamReader ./enums ./fillDefaults ./pathUtils ./resourceUtils ../../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){function y(I){switch(I.componentType){case x.DataType.BYTE:return new d.BufferViewVec2i8(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.UNSIGNED_BYTE:return new d.BufferViewVec2u8(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.SHORT:return new d.BufferViewVec2i16(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.UNSIGNED_SHORT:return new d.BufferViewVec2u16(I.raw, I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.UNSIGNED_INT:return new d.BufferViewVec2u32(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.FLOAT:return new d.BufferViewVec2f(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount)}}function z(I,O){return new I(O.raw,O.byteOffset,O.byteStride,O.byteOffset+O.byteStride*(O.entryCount-1)+O.componentByteSize*O.componentCount)}function A(I){if(null!=I.extensions?.KHR_texture_basisu)return I.extensions.KHR_texture_basisu.source; if(null!==I.source)return I.source;throw new b("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.");}class B{constructor(I,O,L,P){this._context=I;this.uri=O;this.json=L;this._glbBuffer=P;this._bufferLoaders=new Map;this._textureLoaders=new Map;this._textureCache=new Map;this._materialCache=new Map;this._nodeParentMap=new Map;this._nodeTransformCache=new Map;this._supportedExtensions=["KHR_texture_basisu", "KHR_texture_transform"];this._baseUri=n.splitURI(this.uri).dirPart;this._checkVersionSupported();this._checkRequiredExtensionsSupported();if(null==L.scenes)throw new b("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==L.meshes)throw new b("gltf-loader-unsupported-feature","Meshes must be defined");if(null==L.nodes)throw new b("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(I,O,L){if(k.isDataProtocol(O)){var P=k.dataComponents(O); if(P&&"model/gltf-binary"!==P.mediaType)try{const M=JSON.parse(P.isBase64?atob(P.data):P.data);return new B(I,O,M)}catch{}P=k.dataToArrayBuffer(O);if(B._isGLBData(P))return this._fromGLBData(I,O,P)}if(E.test(O)||"gltf"===L?.expectedType)return L=await I.loadJSON(O,L),new B(I,O,L);P=await I.loadBinary(O,L);if(B._isGLBData(P))return this._fromGLBData(I,O,P);if(G.test(O)||"glb"===L?.expectedType)throw new b("gltf-loader-invalid-glb","This is not a valid glb file.");L=await I.loadJSON(O,L);return new B(I, O,L)}static _isGLBData(I){if(null==I)return!1;I=new v.BinaryStreamReader(I);return 4<=I.remainingBytes()&&1179937895===I.readUint32()}static async _fromGLBData(I,O,L){L=await B._parseGLBData(L);return new B(I,O,L.json,L.binaryData)}static async _parseGLBData(I){const O=new v.BinaryStreamReader(I);if(12>O.remainingBytes())throw new b("gltf-loader-error","glb binary data is insufficiently large.");var L=O.readUint32(),P=O.readUint32();const M=O.readUint32();if(1179937895!==L)throw new b("gltf-loader-error", "Magic first 4 bytes do not fit to expected glb value.");if(I.byteLengthL)throw new b("gltf-loader-error", "No JSON data found.");K=await u.jsonFromBinaryData(O.readUint8Array(L))}else if(1===I){if(5130562!==P)throw new b("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");J=O.readUint8Array(L)}else q.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");I+=1}if(!K)throw new b("gltf-loader-error","No glb JSON chunk detected.");return{json:K,binaryData:J}}async getBuffer(I,O){const L=this.json.buffers[I];if(null==L.uri){if(null==this._glbBuffer)throw new b("gltf-loader-error", "glb buffer not present");return this._glbBuffer}I=await this._getBufferLoader(I,O);if(I.byteLength!==L.byteLength)throw new b("gltf-loader-error","Buffer byte lengths should match.");return I}async _getBufferLoader(I,O){const L=this._bufferLoaders.get(I);if(L)return L;O=this._context.loadBinary(this._resolveUri(this.json.buffers[I].uri),O).then(P=>new Uint8Array(P));this._bufferLoaders.set(I,O);return O}async getAccessor(I,O){if(!this.json.accessors)throw new b("gltf-loader-unsupported-feature", "Accessors missing.");I=this.json.accessors[I];if(null==I?.bufferView)throw new b("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(I.type in[m.AttributeType.MAT2,m.AttributeType.MAT3,m.AttributeType.MAT4])throw new b("gltf-loader-unsupported-feature",`AttributeType ${I.type} is not supported`);const L=this.json.bufferViews[I.bufferView];O=await this.getBuffer(L.buffer,O);const P=H[I.type],M=N[I.componentType],K=P*M,J=L.byteStride||K;return{raw:O.buffer,byteStride:J, byteOffset:O.byteOffset+(L.byteOffset||0)+(I.byteOffset||0),entryCount:I.count,isDenselyPacked:J===K,componentCount:P,componentByteSize:M,componentType:I.componentType,min:I.min,max:I.max,normalized:!!I.normalized}}async getIndexData(I,O){if(null!=I.indices)if(I=await this.getAccessor(I.indices,O),I.isDenselyPacked)switch(I.componentType){case x.DataType.UNSIGNED_BYTE:return new Uint8Array(I.raw,I.byteOffset,I.entryCount);case x.DataType.UNSIGNED_SHORT:return new Uint16Array(I.raw,I.byteOffset,I.entryCount); case x.DataType.UNSIGNED_INT:return new Uint32Array(I.raw,I.byteOffset,I.entryCount)}else switch(I.componentType){case x.DataType.UNSIGNED_BYTE:return t.makeDense(z(d.BufferViewUint8,I));case x.DataType.UNSIGNED_SHORT:return t.makeDense(z(d.BufferViewUint16,I));case x.DataType.UNSIGNED_INT:return t.makeDense(z(d.BufferViewUint32,I))}}async getPositionData(I,O){if(null==I.attributes.POSITION)throw new b("gltf-loader-unsupported-feature","No POSITION vertex data found.");I=await this.getAccessor(I.attributes.POSITION, O);if(I.componentType!==x.DataType.FLOAT)throw new b("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+x.DataType[I.componentType]);if(3!==I.componentCount)throw new b("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+I.componentCount.toFixed());return z(d.BufferViewVec3f,I)}async getNormalData(I,O){if(null==I.attributes.NORMAL)throw new b("gltf-loader-error","No NORMAL vertex data found.");I=await this.getAccessor(I.attributes.NORMAL, O);if(I.componentType!==x.DataType.FLOAT)throw new b("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+x.DataType[I.componentType]);if(3!==I.componentCount)throw new b("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+I.componentCount.toFixed());return z(d.BufferViewVec3f,I)}async getTangentData(I,O){if(null==I.attributes.TANGENT)throw new b("gltf-loader-error","No TANGENT vertex data found.");I=await this.getAccessor(I.attributes.TANGENT, O);if(I.componentType!==x.DataType.FLOAT)throw new b("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+x.DataType[I.componentType]);if(4!==I.componentCount)throw new b("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+I.componentCount.toFixed());return new d.BufferViewVec4f(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount)}async getTextureCoordinates(I,O){if(null==I.attributes.TEXCOORD_0)throw new b("gltf-loader-error", "No TEXCOORD_0 vertex data found.");I=await this.getAccessor(I.attributes.TEXCOORD_0,O);if(2!==I.componentCount)throw new b("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+I.componentCount.toFixed());if(I.componentType===x.DataType.FLOAT)return z(d.BufferViewVec2f,I);if(!I.normalized)throw new b("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return y(I)}async getVertexColors(I, O){if(null==I.attributes.COLOR_0)throw new b("gltf-loader-error","No COLOR_0 vertex data found.");I=await this.getAccessor(I.attributes.COLOR_0,O);if(4!==I.componentCount&&3!==I.componentCount)throw new b("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+I.componentCount.toFixed());if(4===I.componentCount){if(I.componentType===x.DataType.FLOAT)return z(d.BufferViewVec4f,I);if(I.componentType===x.DataType.UNSIGNED_BYTE)return z(d.BufferViewVec4u8,I);if(I.componentType=== x.DataType.UNSIGNED_SHORT)return z(d.BufferViewVec4u16,I)}else if(3===I.componentCount){if(I.componentType===x.DataType.FLOAT)return z(d.BufferViewVec3f,I);if(I.componentType===x.DataType.UNSIGNED_BYTE)return z(d.BufferViewVec3u8,I);if(I.componentType===x.DataType.UNSIGNED_SHORT)return z(d.BufferViewVec3u16,I)}throw new b("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+x.DataType[I.componentType]);}hasPositions(I){return void 0!==I.attributes.POSITION}hasNormals(I){return void 0!== I.attributes.NORMAL}hasVertexColors(I){return void 0!==I.attributes.COLOR_0}hasTextureCoordinates(I){return void 0!==I.attributes.TEXCOORD_0}hasTangents(I){return void 0!==I.attributes.TANGENT}async getMaterial(I,O,L){var P=I.material?this._materialCache.get(I.material):void 0;if(!P){P=null!=I.material?r.material(this.json.materials[I.material]):r.material();const M=P.pbrMetallicRoughness,K=this.hasVertexColors(I),J=this.getTexture(M.baseColorTexture,O),R=this.getTexture(P.normalTexture,O),Q=L?this.getTexture(P.occlusionTexture, O):void 0,W=L?this.getTexture(P.emissiveTexture,O):void 0;O=L?this.getTexture(M.metallicRoughnessTexture,O):void 0;I=null!=I.material?I.material:-1;P={alphaMode:P.alphaMode,alphaCutoff:P.alphaCutoff,color:M.baseColorFactor,doubleSided:!!P.doubleSided,colorTexture:await J,normalTexture:await R,name:P.name,id:I,occlusionTexture:await Q,emissiveTexture:await W,emissiveFactor:P.emissiveFactor,metallicFactor:M.metallicFactor,roughnessFactor:M.roughnessFactor,metallicRoughnessTexture:await O,hasVertexColors:K, ESRI_externalColorMixMode:P.extras.ESRI_externalColorMixMode,colorTextureTransform:M?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:P.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:P.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:P.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:M?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:P.extras.ESRI_receiveAmbientOcclusion, receiveShadows:P.extras.ESRI_receiveShadows}}return P}async getTexture(I,O){if(I){if(0!==(I.texCoord||0))throw new b("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");var L=I.index;I=this.json.textures[L];var P=r.textureSampler(null!=I.sampler?this.json.samplers[I.sampler]:{}),M=A(I),K=this.json.images[M],J=await this._loadTextureImageData(L,I,O);return l.getOrCreateMapValue(this._textureCache,L,()=>{const R=W=>33071===W||33648===W||10497===W,Q=W=>{throw new b("gltf-loader-error", `Unexpected TextureSampler WrapMode: ${W}`);};return{data:J,wrapS:R(P.wrapS)?P.wrapS:Q(P.wrapS),wrapT:R(P.wrapT)?P.wrapT:Q(P.wrapT),minFilter:P.minFilter,name:K.name,id:L}})}}getNodeTransform(I){if(void 0===I)return C;var O=this._nodeTransformCache.get(I);if(!O){O=this.getNodeTransform(this._getNodeParent(I));const L=this.json.nodes[I];L.matrix?O=f.multiply(c.create(),O,L.matrix):L.translation||L.rotation||L.scale?(O=c.clone(O),L.translation&&f.translate(O,O,L.translation),L.rotation&&(F[3]=e.getAxisAngle(F, L.rotation),f.rotate(O,O,F[3],F)),L.scale&&f.scale(O,O,L.scale)):O=c.clone(O);this._nodeTransformCache.set(I,O)}return O}_resolveUri(I){return k.makeAbsolute(I,this._baseUri)}_getNodeParent(I){return this._nodeParentMap.get(I)}_checkVersionSupported(){const I=h.Version.parse(this.json.asset.version,"glTF");D.validate(I)}_checkRequiredExtensionsSupported(){const I=this.json;if(I.extensionsRequired&&!I.extensionsRequired.every(O=>this._supportedExtensions.includes(O)))throw new b("gltf-loader-unsupported-feature", "gltf loader was not able to load unsupported feature. Required extensions: "+I.extensionsRequired.join(", "));}_computeNodeParents(){this.json.nodes.forEach((I,O)=>{I.children&&I.children.forEach(L=>{this._nodeParentMap.set(L,O)})})}async _loadTextureImageData(I,O,L){const P=this._textureLoaders.get(I);if(P)return P;O=this._createTextureLoader(O,L);this._textureLoaders.set(I,O);return O}async _createTextureLoader(I,O){I=A(I);I=this.json.images[I];if(I.uri)return I.uri.endsWith(".ktx2")?(O=await this._context.loadBinary(this._resolveUri(I.uri), O),new u.EncodedMeshTexture(new Uint8Array(O))):this._context.loadImage(this._resolveUri(I.uri),O);if(null==I.bufferView)throw new b("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==I.mimeType)throw new b("gltf-loader-unsupported-feature","Image mimeType must be defined.");const L=this.json.bufferViews[I.bufferView];O=await this.getBuffer(L.buffer,O);if(null!=L.byteStride)throw new b("gltf-loader-unsupported-feature","byteStride not supported for image buffer");return u.imageFromBinaryData(new Uint8Array(O.buffer, O.byteOffset+(L.byteOffset||0),L.byteLength),I.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const I=await p.allSettledValues(Array.from(this._bufferLoaders.values())),O=await p.allSettledValues(Array.from(this._textureLoaders.values()));return I.reduce((L,P)=>L+(P?.byteLength??0),0)+O.reduce((L,P)=>L+(P?u.isEncodedMeshTexture(P)?P.data.byteLength:P.width*P.height*4:0),0)}}const C=f.fromXRotation(c.create(),Math.PI/2),D=new h.Version(2,0,"glTF"),F=g.create(), H={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},N={[x.DataType.BYTE]:1,[x.DataType.UNSIGNED_BYTE]:1,[x.DataType.SHORT]:2,[x.DataType.UNSIGNED_SHORT]:2,[x.DataType.HALF_FLOAT]:2,[x.DataType.FLOAT]:4,[x.DataType.INT]:4,[x.DataType.UNSIGNED_INT]:4},E=/\.gltf$/i,G=/\.glb$/i;a.GLTFResource=B;a.transformGltfToEngine=C;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/scalar":function(){define(["exports"],function(a){function b(l,p){const k=l.count;p||=new l.TypedArrayConstructor(k); for(let h=0;h{const c={...l,...f.pbrMetallicRoughness};var e={...k,...f.extras};switch(e.ESRI_externalColorMixMode){case "multiply":case "tint":case "ignore":case "replace":break;default:b.neverReached(e.ESRI_externalColorMixMode), e.ESRI_externalColorMixMode="tint"}return{...p,...f,pbrMetallicRoughness:c,extras:e}};a.textureSampler=f=>({...h,...f});Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/pathUtils":function(){define(["exports"],function(a){a.splitURI=function(b){let q,l;b.replace(/^(.*\/)?([^/]*)$/,(p,k,h)=>{q=k||"";l=h||"";return""});return{dirPart:q,filePart:l}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/indexUtils":function(){define(["exports", "../../../../core/typedArrayUtil","../../../../geometry/support/Indices","../../../webgl/enums"],function(a,b,q,l){a.convertPrimitiveToTriangles=function(p,k){switch(k){case l.PrimitiveType.TRIANGLES:return p="number"===typeof p?q.getContinuousIndexArray(p):b.isUint8Array(p)?new Uint16Array(p):p,p;case l.PrimitiveType.TRIANGLE_STRIP:k="number"===typeof p?p:p.length;if(3>k)p=[];else{k-=2;var h=q.newIndexArray(3*k);if("number"===typeof p){p=0;for(var f=0;fk)p=new Uint16Array(0);else{k-=2;h=65536>=k?new Uint16Array(3*k):new Uint32Array(3*k);if("number"===typeof p)for(p=0,f=0;f{O=O.boundingInfo;null!=O&&(g.expandWithVec3(I,O.bbMin),g.expandWithVec3(I,O.bbMax))});return I}async function D(G,I){const O=[];for(const M in G){var L=G[M],P=L.images[0].data;if(!P){N().warn("Externally referenced texture data is not yet supported");continue}P=L.encoding+";base64,"+P;const K="/textureDefinitions/"+M,J="rgba"===L.channels?L.alphaChannelUsage||"transparency":"none",R={noUnpackFlip:!0,wrap:{s:x.TextureWrapMode.REPEAT,t:x.TextureWrapMode.REPEAT},preMultiplyAlpha:F(J)!== v.AlphaDiscardMode.Opaque};L=I?.disableTextures?Promise.resolve(null):t.requestImage(P,I);O.push(L.then(Q=>({refId:K,image:Q,parameters:R,alphaChannelUsage:J})))}G=await Promise.all(O);I={};for(const M of G)I[M.refId]=M;return I}function F(G){switch(G){case "mask":return v.AlphaDiscardMode.Mask;case "maskAndTransparency":return v.AlphaDiscardMode.MaskBlend;case "none":return v.AlphaDiscardMode.Opaque;case "transparency":return v.AlphaDiscardMode.Blend;default:return v.AlphaDiscardMode.Blend}}function H(G){G= G.params;return{id:1,material:G.material,texture:G.texture,region:G.texture}}const N=()=>k.getLogger("esri.views.3d.layers.graphics.objectResourceUtils"),E=new c.Version(1,2,"wosr");a.createTextureResources=D;a.load=async function(G,I){G=await y(G,I);I=await D(G.textureDefinitions??{},I);let O=0;for(const L in I)if(I.hasOwnProperty(L)){const P=I[L];O+=P?.image?P.image.width*P.image.height*4:0}return{resource:G,textures:I,size:O+l.estimateNestedObjectSize(G)}};a.processLoadResult=function(G,I){const O= [],L=[],P=[],M=new h.NestedMap,K=G.resource;var J=c.Version.parse(K.version||"1.0","wosr");E.validate(J);J=K.model.name;const R=K.model.geometries,Q=K.materialDefinitions??{};G=G.textures;let W=0;const S=new Map;for(let ca=0;ca{if("PerAttributeArray"===ea.params.topology)return null;const ka=ea.params.faces;for(const fa in ka)if(fa===ia)return ka[fa].values;return null},ha=T[n.VertexAttribute.POSITION]; ha=ha.values.length/ha.valuesPerElement;for(const ia in T){var ba=T[ia],U=ba.values,Z=Y(ia)??d.getContinuousIndexArray(ha);da.push([ia,new w.Attribute(U,Z,ba.valuesPerElement,!0)])}T=V.texture;if((Y=G&&G[T])&&!S.has(T)){const {image:ia,parameters:ka}=Y;ha=new r.Texture(ia,ka);L.push(ha);S.set(T,ha)}ha=(ha=S.get(T))?ha.id:void 0;V=V.material;ba=M.get(V,T);null==ba&&(ba=V.substring(V.lastIndexOf("/")+1),ba=Q[ba].params,1===ba.transparency&&(ba.transparency=0),U=Y&&Y.alphaChannelUsage,U=0ia[0]===n.VertexAttribute.POSITION)?.[1]?.indices.length??0;O.push(T)}return{engineResources:[{name:J,stageResources:{textures:L,materials:P,geometries:O},pivotOffset:K.model.pivotOffset,numberOfVertices:W,lodThreshold:null}],referenceBoundingBox:C(O)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultMaterial_COLOR_GAMMA":function(){define(["exports"],function(a){a.colorGamma= 2.1;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/webStyleUtils":function(){define(["exports","../../../../core/Error","../../../../symbols/support/styleUtils","../../../../symbols/support/webStyleSymbolUtils"],function(a,b,q,l){a.getResourceUrlFromSymbolStyle=async function(p){if(null===p||null==p.styleName&&null==p.styleUrl)return null;var k=p.name;if(null==k)throw new b("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference"); const h={portal:p.portal};p=await q.fetchStyle(p,h).catch(()=>null);if(null===p)return null;const f=l.getStyleItemFromStyle(k,p.data);if(f&&!f.formatInfos?.some(c=>"gltf_basisu"===c.type))return null;k=await l.fetchSymbolFromStyle(p,k,h,"webRef",(c,e)=>q.symbolUrlFromStyleItem(c,e,["gltf_basisu","gltf"])).catch(()=>null);if(null===k||"point-3d"!==k.type)return null;k=k.symbolLayers.items[0];return"object"===k.type?k.resource:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/webStyleSymbolUtils":function(){define("exports ../../symbols ../../core/devEnvironmentUtils ../../core/Error ../../core/urlUtils ../../portal/Portal ../../chunks/persistableUrlUtils ./jsonUtils ./StyleOrigin ./styleUtils ./Thumbnail".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(v,m){return m.items.find(r=>r.name===v)}function t(v,m,r,n,u,x){const y=null!=r?.portal?r.portal:k.getDefault(),z={portal:y,url:p.urlToObject(v.baseUrl),origin:"portal-item"},A=d(m,v.data);if(!A)return Promise.reject(new l("symbolstyleutils:symbol-name-not-found",`The symbol name '${m}' could not be found`,{symbolName:m}));u=h.fromJSON(u(A,n),z);let B=A.thumbnail?.href??null;const C=A.thumbnail?.imageData;q.isDevEnvironment()&&(u=q.adjustStaticAGOUrl(u)?? "",B=q.adjustStaticAGOUrl(B));const D={portal:y,url:p.urlToObject(p.removeFile(u)),origin:"portal-item"};return e.requestJSON(u,x).then(F=>{F="cimRef"===n?e.makeCIMSymbolRef(F.data):F.data;if((F=f.fromJSON(F,D))&&b.isSymbol3D(F)){if(B){const H=h.fromJSON(B,z);F.thumbnail=new g.Thumbnail({url:H})}else C&&(F.thumbnail=new g.Thumbnail({url:`data:image/png;base64,${C}`}));v.styleUrl?F.styleOrigin=new c({portal:r.portal,styleUrl:v.styleUrl,name:m}):v.styleName&&(F.styleOrigin=new c({portal:r.portal,styleName:v.styleName, name:m}))}return F})}function w(v,m,r){const n=e.Style2DUrlTemplate.replaceAll(/\{SymbolName\}/gi,v),u=null!=m.portal?m.portal:k.getDefault();return e.requestJSON(n,r).then(x=>{x=e.makeCIMSymbolRef(x.data);return f.fromJSON(x,{portal:u,url:p.urlToObject(p.removeFile(n)),origin:"portal-item"})})}a.fetchSymbolFromStyle=t;a.getStyleItemFromStyle=d;a.resolveWebStyleSymbol=function(v,m,r,n){const u=v.name;return null==u?Promise.reject(new l("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")): v.styleName&&"Esri2DPointSymbolsStyle"===v.styleName?w(u,m,n):e.fetchStyle(v,m,n).then(x=>t(x,u,m,r,e.symbolUrlFromStyleItem,n))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/LodRenderer":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/arrayUtils ../../../../../core/maybe ../../../../../core/promiseUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../support/debugFlags ../../../support/buffer/glUtil ../../../support/buffer/InterleavedLayout ../../../webgl/RenderCamera ../../core/shaderLibrary/ShaderOutput ../../effects/RenderPlugin ../DefaultVertexAttributeLocations ../IntersectorInterfaces ../Octree ../RenderSlot ../Util ../VertexAttribute ./InstanceData ./InstanceOctree ./LevelSelector ./LodLevel ./RenderInstanceData ../../materials/internal/MaterialUtil ../../materials/renderers/utils ../../shaders/DefaultMaterialTechnique ../../../../support/Scheduler ../../../../webgl/Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P){function M(ha,ba,U){const Z=ha.allocateHead();ha=ha.view;I.encodeDoubleVec3(ba.modelOrigin,U,ha.modelOriginHi,ha.modelOriginLo,Z);ha.model.copyFrom(Z,ba.model,U);ha.modelNormal.copyFrom(Z,ba.modelNormal,U);ba.color&&ha.color&&ha.color.copyFrom(Z,ba.color,U);ba.objectAndLayerIdColor&&ha.objectAndLayerIdColor&&ha.objectAndLayerIdColor.copyFrom(Z,ba.objectAndLayerIdColor,U);ba.featureAttribute&&ha.featureAttribute&&ha.featureAttribute.copyFrom(Z, ba.featureAttribute,U)}function K(ha){let ba=m.newLayout().vec3f(C.VertexAttribute.INSTANCEMODELORIGINHI).vec3f(C.VertexAttribute.INSTANCEMODELORIGINLO).mat3f(C.VertexAttribute.INSTANCEMODEL).mat3f(C.VertexAttribute.INSTANCEMODELNORMAL);null!=ha&&ha.includes("featureAttribute")&&(ba=ba.vec4f(C.VertexAttribute.INSTANCEFEATUREATTRIBUTE));null!=ha&&ha.includes("color")&&(ba=ba.vec4u8(C.VertexAttribute.INSTANCECOLOR));null!=ha&&ha.includes("objectAndLayerIdColor")&&(ba=ba.vec4u8(C.VertexAttribute.INSTANCEOBJECTANDLAYERIDCOLOR)); return ba}const J=ha=>{const ba=ha.baseBoundingSphere.radius;ha=ha.levels.map(U=>U.minScreenSpaceRadius);return new H.LevelSelector(ba,ha)};a.LodRenderer=class extends u.ASyncPreparesRenderPlugin{constructor(ha,ba){super(ha);this.type=y.IntersectorType.LOD;this.isGround=!1;this._levels=[];this._defaultRenderInstanceData=[[]];this._highlightRenderInstanceData=[[]];this._allRenderInstanceData=[this._defaultRenderInstanceData[0],this._highlightRenderInstanceData[0]];this._cycleStartIndex=this._instanceIndex= 0;this._slicePlane=!1;this._camera=new r;this._updateCyclesWithStaticCamera=-1;this._needFullCycle=!1;this.produces=new Map([[A.RenderSlot.OPAQUE_MATERIAL,U=>this._produces(U)],[A.RenderSlot.TRANSPARENT_MATERIAL,U=>this._hasTransparentLevels()?this._produces(U):!1]]);this._instanceData=new D.InstanceData({shaderTransformation:ha.shaderTransformation},ha.optionalFields);this.addHandles(ba.registerTask(L.TaskPriority.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=K(this.optionalFields); this._glInstanceBufferLayout=v.glLayout(this._instanceBufferLayout,1);this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:ha})=>{this._requestUpdateCycle();this.metadata.notifyGraphicGeometryChanged(ha)}),this._instanceData.events.on("instance-visibility-changed",({index:ha})=>{this._requestUpdateCycle(!0);this.metadata.notifyGraphicVisibilityChanged(ha)}),this._instanceData.events.on("instance-highlight-changed", ()=>this._requestUpdateCycle(!0))])}get _enableLevelSelection(){return 1ba.reduce((U,Z)=>U+Z.usedMemory,ha),0)}get renderStats(){const ha=this._instanceData.size,ba=[];this._levels.forEach((U,Z)=>{Z=this._allRenderInstanceData[0][Z].size+this._allRenderInstanceData[1][Z].size;U=U.triangleCount;ba.push({renderedInstances:Z,renderedTriangles:Z*U,trianglesPerInstance:U})});return{totalInstances:ha,renderedInstances:ba.reduce((U,Z)=>U+Z.renderedInstances,0),renderedTriangles:ba.reduce((U,Z)=>U+Z.renderedTriangles,0),levels:ba}}async initializeRenderContext(ha,ba){this._context= ha;const U=ha.renderContext.rctx,Z=await Promise.allSettled(this.symbol.levels.map(ea=>{this._defaultRenderInstanceData[0].push(new E.RenderInstanceData(U,this._instanceBufferLayout));this._highlightRenderInstanceData[0].push(new E.RenderInstanceData(U,this._instanceBufferLayout));return N.LodLevel.create(ha,ea,ba)})),ca=Z.map(ea=>"fulfilled"===ea.status?ea.value:null).filter(q.isSome);if(p.isAborted(ba)||ca.length!==Z.length){ca.forEach(ea=>ea.destroy());p.throwIfAborted(ba);for(const ea of Z)if("rejected"=== ea.status)throw ea.reason;}this._levels=ca;this._levelSelector=J(this)}uninitializeRenderContext(){this._invalidateOctree();this._levels.forEach(ha=>ha.destroy());this._defaultRenderInstanceData[0].forEach(ha=>ha.destroy());this._highlightRenderInstanceData[0].forEach(ha=>ha.destroy())}_hasTransparentLevels(){return this._levels.some(ha=>ha.components.some(ba=>ba.material.produces.get(A.RenderSlot.TRANSPARENT_MATERIAL)?.(n.ShaderOutput.Color)))}hasHighlights(){return this._highlightRenderInstanceData[0].some(ha=> 0this.levels.forEach((ca,ea)=>{ca.components.forEach(da=>U.push(this._beginComponent(ha,Z[ea],da)))}));return U}renderNode(ha,ba){const U=this._getInstanceDatas(ha.output);if(U&&null!=ba){var Z=0;ha.rctx.bindVAO();U.forEach(ca=>this.levels.forEach((ea,da)=>{ea.components.forEach(ia=>this._renderComponent(ha,ba[Z++],ca[da],ia,da))}))}}_getInstanceDatas(ha){const ba= ha!==n.ShaderOutput.Highlight&&ha!==n.ShaderOutput.ShadowHighlight;ha=ha!==n.ShaderOutput.ShadowExcludeHighlight;return ba&&ha?this._allRenderInstanceData:ba?this._defaultRenderInstanceData:ha?this._highlightRenderInstanceData:null}intersect(ha,ba,U,Z){if(this.baseMaterial.isVisible()&&null!=this._octree){var ca=d.create();g.subtract(ca,Z,U);var ea=da=>{this._instanceData.getCombinedModelTransform(da,W);ha.transform.set(W);g.transformMat4(S,U,ha.transform.inverse);g.transformMat4(V,Z,ha.transform.inverse); const ia=this._instanceData.getState(da),ka=this._instanceData.getLodLevel(da),fa=this._levels.length;B.assert(0!==(ia&D.StateFlags.ACTIVE),"invalid instance state");B.assert(0<=ka&&kaha.forEach(ba=>ba.startUpdateCycle()))}get running(){return 0this._updateCyclesWithStaticCamera}runTask(ha){const {_enableLevelSelection:ba,_camera:U,_levelSelector:Z}=this;this._allRenderInstanceData.forEach(la=>la.forEach(na=>na.beginUpdate()));const ca=this._instanceData,ea=ca.view;let da=ca.size;const ia=ca.capacity;let ka=this._instanceIndex;const fa=Math.ceil(ia/500);for(let la=0;lala.forEach(na=>na.endUpdate()));this._context.requestRender()}_beginComponent(ha,ba,U){if(0===ba.size)return null;ba=U.glMaterials.load(ha.rctx,ha.bindParameters.slot,ha.output);return null!=ba?ba.beginSlot(ha.bindParameters):null}_renderComponent(ha, ba,U,Z,ca){if(ba){var {bindParameters:ea,rctx:da}=ha;da.runAppleAmdDriverHelper();var ia=da.bindTechnique(ba,ea,Z.material.parameters,Y);da.bindVAO(Z.vao);ba.ensureAttributeLocations(Z.vao);w.debugFlags.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&ha.output===n.ShaderOutput.Color&&(ia.setUniform4fv("externalColor",T[Math.min(ca,T.length-1)]),ia.setUniform1i("colorMixMode",G.colorMixModes.replace));ha=U.capacity;ca=U.headIndex;ia=U.tailIndex;var ka=U.firstIndex,fa=this._glInstanceBufferLayout,X=(ja,la)=> {P.bindVertexBufferLayout(da,x.Default3D,U.buffer,fa,ja);da.drawArraysInstanced(ba.primitiveType,0,Z.vertexCount,la-ja);P.unbindVertexBufferLayout(da,x.Default3D,U.buffer,fa)};Z.material.parameters.transparent&&null!=ka?ca>ia?(B.assert(ka>=ia&&ka<=ca,"invalid firstIndex"),X(ka,ca),X(ia,ka)):ca=ia&&ka<=ha,"invalid firstIndex"),X(ka,ha),X(0,ca),X(ia,ka))):ca>ia?X(ia,ca):cathis._capacity&&this._grow();const F=this._findSlot();this._view.state.set(F,a.StateFlags.ALLOCATED);this._size++;this.events.emit("instances-changed");return F}removeInstance(F){const H=this._view.state;u.assert(0<=F&&F=e?c-e:c+this._capacity-e}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get usedMemory(){return this._buffer?.usedMemory??0}reset(){this._tailIndex=this._headIndex=0;this._firstIndex=null}startUpdateCycle(){this._captureFirstIndex=!0}beginUpdate(){l.assert(!this._updating, "already updating");this._updating=!0;this._prevHeadIndex=this._headIndex}endUpdate(){l.assert(this._updating,"not updating");this.sizee?(this._buffer.copyRange(g,this._capacity,c),0e&&(0=this._capacity?(new Uint8Array(k)).set(new Uint8Array(this._array)):(new Uint8Array(k)).set((new Uint8Array(this._array)).subarray(0, l*this._elementSize)));this._array=k;this._buffer.setSize(p);this._capacity=l}}return q})},"esri/views/3d/webgl-engine/lib/lodRendering/InstanceOctree":function(){define("exports ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../chunks/vec32 ../../../../../chunks/sphere ../../../support/mathUtils ../Octree".split(" "),function(a,b,q,l,p,k){class h extends k{constructor(f,c){super(e=>l.wrap(this._instanceData.view.boundingSphere.getVec(e,this._tmpSphere)),{maximumDepth:25});this._instanceData= f;this._boundingSphere=c;this._tmpSphere=l.create();this._tmpMat4=b.create()}addInstance(f){const c=this._instanceData.view.boundingSphere,e=this._instanceData.getCombinedModelTransform(f,this._tmpMat4);q.transformMat4(l.getCenter(this._tmpSphere),this._boundingSphere.center,e);this._tmpSphere[3]=this._boundingSphere.radius*p.maxScale(e);c.setVec(f,this._tmpSphere);this.add([f])}removeInstance(f){this.remove([f])}}a.InstanceOctree=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/lib/lodRendering/LevelSelector":function(){define(["exports"],function(a){class b{constructor(q,l){this._worldSpaceRadius=q;this._minScreenSpaceRadii=l}selectLevel(q,l,p){q=p.computeScreenPixelSizeAt(q);l=this._worldSpaceRadius*l/q;q=0;for(p=1;p=this._minScreenSpaceRadii[p]&&(q=p);return q}}a.LevelSelector=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/LodLevel":function(){define("exports ../../../../../core/arrayUtils ../../../../../core/promiseUtils ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/aaBoundingBox ./LodComponentData".split(" "), function(a,b,q,l,p,k){class h{static async create(f,c,e){const g=await Promise.allSettled(c.components.map(t=>f.controller.schedule(()=>new k.LodComponentData(f,t),e))),d=g.map(t=>"fulfilled"===t.status?t.value:null).filter(b.isSome);if(q.isAborted(e)||d.length!==g.length){d.forEach(t=>t.destroy());q.throwIfAborted(e);for(const t of g)if("rejected"===t.status)throw t.reason;}return new h(c.minScreenSpaceRadius,d)}constructor(f,c){this.minScreenSpaceRadius=f;this.components=c}destroy(){this.components.forEach(f=> f.destroy())}intersect(f,c,e,g,d,t,w){this.components.forEach(v=>v.intersect(f,c,e,g,d,t,this.boundingSphere,w))}get boundingBox(){if(null==this._boundingBox){const f=p.empty();this.components.forEach(c=>{null!=c.boundingInfo&&(p.expandWithVec3(f,c.boundingInfo.bbMin),p.expandWithVec3(f,c.boundingInfo.bbMax))});this._boundingBox=f}return this._boundingBox}get boundingSphere(){if(null==this._boundingSphere){const f=this.boundingBox,c=l.create();p.center(f,c);this._boundingSphere={center:c,radius:.5* p.diameter(f)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((f,c)=>f+c.triangleCount,0)}}a.LodLevel=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/LodComponentData":function(){define("exports ../../../support/buffer/glUtil ../DefaultVertexAttributeLocations ../GLMaterials ../Intersector ../IntersectorInterfaces ../VertexArrayObject ./Intersector ../../../../webgl/BufferObject ../../../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g{constructor(d,t){const w=d.renderContext.rctx;t=t.geometry;this._materials=d.materials;t.material.setParameters({instancedDoublePrecision:!0});d=t.material.createBufferWriter();const v=d.vertexBufferLayout,m=d.elementCount(t),r=v.createBuffer(m);d.write(null,null,t,r,0);this.geometry=t;this.material=t.material;this.glMaterials=new l.GLMaterials(t.material,this._materials);this.vertexBufferLayout=v;this.vbo=c.BufferObject.createVertex(w,e.Usage.STATIC_DRAW,r.buffer); this.vao=new h.VertexArrayObject(w,q.Default3D,{geometry:b.glLayout(v)},{geometry:this.vbo});this.vertexCount=m}destroy(){this.glMaterials.dispose();this.vbo.dispose();this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}intersect(d,t,w,v,m,r,n,u){const x=this.geometry.id;this.material.intersect(this.geometry,d.transform.transform,d,w,v,(y,z,A,B,C)=>{0<=y&&(null==t||t(d.rayBegin,d.rayEnd,y))&&(A=new f.LodTarget(r.layerUid,r.graphicUid(m), x,A,n,u),(null==d.results.min.drapedLayerOrder||C>=d.results.min.drapedLayerOrder)&&(null==d.results.min.dist||y=d.results.max.drapedLayerOrder)&&(null==d.results.max.dist||y>d.results.max.dist)&&d.results.max.set(k.IntersectorType.LOD,A,y,z,d.transform.transform,C),d.options.store===k.StoreResults.ALL&&(B=p.newIntersectorResult(d.results.min.ray), B.set(k.IntersectorType.LOD,A,y,z,d.transform.transform,C),d.results.all.push(B)))})}}a.LodComponentData=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/Intersector":function(){define(["exports","../IntersectorInterfaces","../IntersectorTarget","../intersectorUtils"],function(a,b,q,l){class p extends q.Graphic3DTarget{constructor(k,h,f,c,e,g){super(k,h);this.layerUid=k;this.graphicUid=h;this.geometryId=f;this.triangleNr=c;this.baseBoundingSphere= e;this.numLodLevels=g}}a.LodTarget=p;a.isLodIntersectorResult=function(k){return l.isValidIntersectorResult(k)&&k.intersector===b.IntersectorType.LOD&&!!k.target};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DPathSymbolLayer":function(){define("exports ../../../../core/has ../../../../core/Error ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectBuffer ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/DoubleArray ./elevationAlignmentUtils ./Graphics3DObject3DGraphicLayer ./Graphics3DPathSymbolLayerConstants ./Graphics3DSymbolLayer ./graphicUtils ./interfaces ../support/FastSymbolUpdates ../../support/ElevationProvider ../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Path ../../webgl-engine/lib/PathBuilder ../../webgl-engine/lib/PathCapBuilder ../../webgl-engine/lib/PathExtruder ../../webgl-engine/lib/PathGeometry ../../webgl-engine/lib/PathGeometryData ../../webgl-engine/lib/pathGeometryUtils ../../webgl-engine/lib/PathProfile ../../webgl-engine/lib/PathVertex ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/PathMaterial".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P){function M(S,V,T){const {origin:Y,positions:ha}=S;let ba=S.offset;switch(V){default:case H.UpVectorAlignment.World:for(const U of S.vertices)Q[0]=ha[ba++]+Y[0],Q[1]=ha[ba++]+Y[1],Q[2]=ha[ba++]+Y[2],T.worldUpAtPosition(Q,Q),U.setFrameFromUpVector(Q);break;case H.UpVectorAlignment.Path:Q[0]=ha[ba]+Y[0],Q[1]=ha[ba+1]+Y[1],Q[2]=ha[ba+2]+Y[2],T.worldUpAtPosition(Q,Q),E.computeMinimumRotationTangentFrame(S,Q)}}function K(S, V,T){switch(S){case "symbol-value":return T;case "proportional":return V;default:return S}}const J=["polyline"];class R extends m.Graphics3DSymbolLayer{constructor(S,V,T,Y){super(S,V,T,Y);this._intrinsicSize=h.fromValues(1,1);this._upVectorAlignment=H.UpVectorAlignment.Path;this._stencilWidth=.1;this.usedMemory=0;this.ensureDrapedStatus(!1)}async doLoad(){var S=null!=this.symbolLayer.width?this.symbolLayer.width:this.symbolLayer.height;const V=null!=this.symbolLayer.height?this.symbolLayer.height: S;this._vvConvertOptions=new u.ConvertOptions({size:!0,color:!0,rotation:!1,opacity:!0},[1,1,1],[S,1,V],this._context.renderCoordsHelper.unitInMeters);this._fastUpdates=0ha||this.needsDrivenTransparentPass;T={diffuse:Y,ambient:Y,opacity:ha,transparent:ba,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,cullFace:ba||"none"===T?z.CullFaceOptions.None:z.CullFaceOptions.Back,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&& (k.set(this._intrinsicSize,S,V),!r.isValidSize(this._intrinsicSize[0])||!r.isValidSize(this._intrinsicSize[1])))throw new q("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");this._fastUpdates?.visualVariables.size||k.scale(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters);this._fastUpdates?(S={...T,...this._fastUpdates.materialParameters,size:h.fromArray(this._intrinsicSize)},this._materials[0]=new P.PathMaterial(S)):(T.hasVertexColors= this._drivenProperties.color||this._drivenProperties.opacity,T.normalType=y.NormalType.Compressed,this._materials[0]=new L.DefaultMaterial(T));this._materials[0].setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0});this._context.stage.add(this._materials[0])}destroy(){super.destroy();this._context.stage.remove(this._materials[0]);this._materials[0]=null;this._materials.length=0}createGraphics3DGraphic(S){const V=S.graphic;if(!this._validateGeometry(V.geometry,J,this.symbolLayer.type))return null; const T=this.setGraphicElevationContext(V);return this._createAs3DShape(V,S.renderingInfo,T,V.uid)}layerOpacityChanged(){const S=this._getCombinedOpacity(this.symbolLayer?.material?.color),V=1>S||this.needsDrivenTransparentPass;this._materials[0]?.setParameters({opacity:S,transparent:V})}layerElevationInfoChanged(S,V){return this.updateGraphics3DGraphicElevationInfo(S,V,t.needsElevationUpdates3D)}slicePlaneEnabledChanged(){this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}); return!0}physicalBasedRenderingChanged(){this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0});return!0}applyRendererDiff(S,V){for(const T in S.diff)switch(T){case "visualVariables":if(u.updateFastSymbolUpdatesState(this._fastUpdates,V,this._vvConvertOptions))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return n.ApplyRendererDiffResult.RecreateSymbol;break;default:return n.ApplyRendererDiffResult.RecreateSymbol}return n.ApplyRendererDiffResult.FastUpdate}_getVertexData(S){let V= 0;const T=S.paths,Y=[],ha=S.spatialReference,ba=this._context.elevationProvider.spatialReference,U=this._context.renderCoordsHelper.spatialReference;for(var Z of T)V+=Z.length;Z=d.newDoubleArray(3*V);let ca=0;for(const ea of T){Y.push({offset:ca,numVertices:ea.length});for(const da of ea)Z[ca++]=da[0],Z[ca++]=da[1],Z[ca++]=S.hasZ?da[2]:0}if(null!=ba&&!ha.equals(ba)&&!e.projectBuffer(Z,ha,0,Z,ba,0,V))return null;null==ba||ba.equals(U)?S=d.doubleArrayFrom(Z):(S=d.newDoubleArray(3*V),e.projectBuffer(Z, ba,0,S,U,0,V));return{pathVertexDataInfos:Y,vertexDataES:Z,vertexDataRS:S}}_createAs3DShape(S,V,T,Y){this.usedMemory=0;var ha=S.geometry;const ba=this._getVertexData(ha);if(null==ba)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===ba.pathVertexDataInfos.length)return 0!==ha.paths.length&&ha.paths.some(X=>0da)){var ia=X.offset;if(null!=this._context.clippingExtent&&(g.empty(Z),g.expandWithBuffer(Z,ba.vertexDataES,ia,da),!g.intersectsClippingArea(Z,this._context.clippingExtent)))continue;var ka=[];da=ia+3*da;for(var fa=ia;fa{ja=this._upVectorAlignment;X=X.stageObject;la=X.geometries;var za=0;for(const xa of la){if(!H.isPathGeometry(xa))continue;const Ma=xa.path,Ga=Ma.builder.path;var ya=Ga,Da=na,ra=va;let Pa=0;const {origin:Qa,vertices:Ea,positions:ua,positionsES:Na}=ya,Ua=ya.offset+3*Ea.length;for(let wa=ya.offset;wathis.emitCapVertex(c,d,t,w,v,m),g=(d,t,w,v)=>this.emitVertex(c,d,t,w,v);this.startCap.rebuildConnectingProfileGeometry(f[c],this.profile,e);for(c=1;c{e.push(t);e.push(w);e.push(v);g.push(t);g.push(w);g.push(v);d.push(this.pathVertexData[t]);d.push(this.pathVertexData[w]);d.push(this.pathVertexData[v])};for(let t=0;t=this.cutoffAngle){var z=v.rotationFrameUp;for(var A=0;AS){b.set(W,-I[1],I[0]);const T=b.dot(O,W);b.scale(I,I,S*Math.sign(V));b.scale(W,W,T);b.add(O,I,W)}l.set(P,0,0,0)}O=l.set(u,R[0]*O[0]+Q[0]*O[1],R[1]*O[0]+Q[1]*O[1],R[2]*O[0]+Q[2]*O[1]);I=3*L;this.vertexAttributePosition[I]=F[G]+O[0]+P[0]*M;this.vertexAttributePosition[I+1]=F[G+1]+O[1]+P[1]*M;this.vertexAttributePosition[I+2]=F[G+2]+O[2]+P[2]*M;G=b.set(m,E[J+2],E[J+3]);e.compressNormal(this.vertexAttributeNormal,L,R[0]*G[0]+Q[0]* G[1]+P[0]*K,R[1]*G[0]+Q[1]*G[1]+P[1]*K,R[2]*G[0]+Q[2]*G[1]+P[2]*K)}}createGeometryData(){const A=this.builder.vertexIndices.length,{normalIndices:B,vertexIndices:C}=this.builder;return[[d.VertexAttribute.POSITION,new c.Attribute(this.vertexAttributePosition,C,3,!0)],[d.VertexAttribute.NORMALCOMPRESSED,new c.Attribute(this.vertexAttributeNormal,B,2,!0)],[d.VertexAttribute.COLOR,new c.Attribute(this.vertexAttributeColor,f.getZeroIndexArray(A),4)]]}onPathChanged(A){super.onPathChanged(A);this.bake(this.size)}intersect(A, B,C,D){const F=this.builder.vertexIndices,H=new c.Vertices(this.vertexAttributePosition,3);g.intersectTriangles(A,B,0,F.length/3,F,H,void 0,C,(N,E,G)=>{D(N,G,E,!1)})}}class v extends t{constructor(A,B,C,D){super(A);this.sizeAttributeValue=B;this.colorAttributeValue=C;this.opacityAttributeValue=D;this.vvData=null;this.baked=new w(A);this.vvData=h.newFloatArray(4*this.builder.path.vertices.length);for(A=0;A=Math.abs(F))return D;F=b.reciprocalClamped(Math.cos(.5* F));return p.set(C,(1+(F-1))*D[0],D[1])}}class t extends g{get rotationFrameUp(){const C=Math.sign(h.dot(this.frame.right,this.vRight));h.cross(w,this.vRight,this.vLeft);h.scale(w,w,C);return h.normalize(w,w)}get rotationRight(){var C=this.rotationFrameUp,D=h.dot(C,this.frame.up);C=h.dot(C,this.frame.right);h.scale(m,this.frame.up,-C);h.scale(r,this.frame.right,D);h.add(m,m,r);h.normalize(m,m);D=this.frame;C=m;p.set(v,h.dot(C,D.right),h.dot(C,D.up));return v}get rotationAngle(){const C=Math.sign(h.dot(this.frame.right, this.vRight));h.negate(n,this.vLeft);return-C*(Math.PI-b.acosClamped(h.dot(n,this.vRight)))}get maxStretchDistance(){return Math.abs(this.vMinSiblingLength*b.reciprocalClamped(Math.cos(.5*this.foldingAngle)))}applyMiterStretch(C,D){var F=this.rotationAngle;if(0===Math.abs(F))return D;F=b.reciprocalClamped(Math.cos(.5*F));const H=this.rotationRight;F=q.set(B,1+(F-1)*H[0]*H[0],(F-1)*H[0]*H[1],(F-1)*H[0]*H[1],1+(F-1)*H[1]*H[1]);return p.transformMat2(C,D,F)}}const w=f.create(),v=k.create(),m=f.create(), r=f.create(),n=f.create(),u=f.create(),x=f.create(),y=f.create(),z=f.create(),A=f.create(),B=l.create();a.PathVertex=g;a.newPathVertex=function(C){switch(C){case e.UpVectorAlignment.World:return new d;case e.UpVectorAlignment.Path:return new t}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/math/mat2":function(){define(["exports","./common"],function(a,b){function q(C,D){C[0]=D[0];C[1]=D[1];C[2]=D[2];C[3]=D[3];return C}function l(C){C[0]=1;C[1]=0;C[2]= 0;C[3]=1;return C}function p(C,D,F,H,N){C[0]=D;C[1]=F;C[2]=H;C[3]=N;return C}function k(C,D){if(C===D){const F=D[1];C[1]=D[2];C[2]=F}else C[0]=D[0],C[1]=D[2],C[2]=D[1],C[3]=D[3];return C}function h(C,D){const F=D[0],H=D[1],N=D[2];D=D[3];let E=F*D-N*H;if(!E)return null;E=1/E;C[0]=D*E;C[1]=-H*E;C[2]=-N*E;C[3]=F*E;return C}function f(C,D){const F=D[0];C[0]=D[3];C[1]=-D[1];C[2]=-D[2];C[3]=F;return C}function c(C){return C[0]*C[3]-C[2]*C[1]}function e(C,D,F){const H=D[0],N=D[1],E=D[2];D=D[3];const G=F[0], I=F[1],O=F[2];F=F[3];C[0]=H*G+E*I;C[1]=N*G+D*I;C[2]=H*O+E*F;C[3]=N*O+D*F;return C}function g(C,D,F){const H=D[0],N=D[1],E=D[2];D=D[3];const G=Math.sin(F);F=Math.cos(F);C[0]=H*F+E*G;C[1]=N*F+D*G;C[2]=H*-G+E*F;C[3]=N*-G+D*F;return C}function d(C,D,F){const H=D[1],N=D[2],E=D[3],G=F[0];F=F[1];C[0]=D[0]*G;C[1]=H*G;C[2]=N*F;C[3]=E*F;return C}function t(C,D){const F=Math.sin(D);D=Math.cos(D);C[0]=D;C[1]=F;C[2]=-F;C[3]=D;return C}function w(C,D){C[0]=D[0];C[1]=0;C[2]=0;C[3]=D[1];return C}function v(C){return"mat2("+ C[0]+", "+C[1]+", "+C[2]+", "+C[3]+")"}function m(C){return Math.sqrt(C[0]**2+C[1]**2+C[2]**2+C[3]**2)}function r(C,D,F,H){C[2]=H[2]/H[0];F[0]=H[0];F[1]=H[1];F[3]=H[3]-C[2]*F[1];return[C,D,F]}function n(C,D,F){C[0]=D[0]+F[0];C[1]=D[1]+F[1];C[2]=D[2]+F[2];C[3]=D[3]+F[3];return C}function u(C,D,F){C[0]=D[0]-F[0];C[1]=D[1]-F[1];C[2]=D[2]-F[2];C[3]=D[3]-F[3];return C}function x(C,D){return C[0]===D[0]&&C[1]===D[1]&&C[2]===D[2]&&C[3]===D[3]}function y(C,D){const F=C[0],H=C[1],N=C[2];C=C[3];const E=D[0], G=D[1],I=D[2];D=D[3];const O=b.getEpsilon();return Math.abs(F-E)<=O*Math.max(1,Math.abs(F),Math.abs(E))&&Math.abs(H-G)<=O*Math.max(1,Math.abs(H),Math.abs(G))&&Math.abs(N-I)<=O*Math.max(1,Math.abs(N),Math.abs(I))&&Math.abs(C-D)<=O*Math.max(1,Math.abs(C),Math.abs(D))}function z(C,D,F){C[0]=D[0]*F;C[1]=D[1]*F;C[2]=D[2]*F;C[3]=D[3]*F;return C}function A(C,D,F,H){C[0]=D[0]+F[0]*H;C[1]=D[1]+F[1]*H;C[2]=D[2]+F[2]*H;C[3]=D[3]+F[3]*H;return C}const B=Object.freeze(Object.defineProperty({__proto__:null,LDU:r, add:n,adjoint:f,copy:q,determinant:c,equals:y,exactEquals:x,frob:m,fromRotation:t,fromScaling:w,identity:l,invert:h,mul:e,multiply:e,multiplyScalar:z,multiplyScalarAndAdd:A,rotate:g,scale:d,set:p,str:v,sub:u,subtract:u,transpose:k},Symbol.toStringTag,{value:"Module"}));a.LDU=r;a.add=n;a.adjoint=f;a.copy=q;a.determinant=c;a.equals=y;a.exactEquals=x;a.frob=m;a.fromRotation=t;a.fromScaling=w;a.identity=l;a.invert=h;a.mat2=B;a.mul=e;a.multiply=e;a.multiplyScalar=z;a.multiplyScalarAndAdd=A;a.rotate=g; a.scale=d;a.set=p;a.str=v;a.sub=u;a.subtract=u;a.transpose=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/mat2f64":function(){define(["exports"],function(a){function b(){return[1,0,0,1]}function q(h){return[h[0],h[1],h[2],h[3]]}function l(h,f,c,e){return[h,f,c,e]}function p(h,f){return new Float64Array(h,f,4)}const k=Object.freeze(Object.defineProperty({__proto__:null,clone:q,create:b,createView:p,fromValues:l},Symbol.toStringTag,{value:"Module"})); a.clone=q;a.create=b;a.createView=p;a.fromValues=l;a.mat2f64=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/PathMaterial":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../geometry/support/aaBoundingBox ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/shading/Normals.glsl ../lib/GLMaterial ../lib/Material ../lib/PathGeometry ../lib/RayIntersections ../lib/RenderSlot ../lib/VertexAttribute ./DefaultBufferWriter ./PathTechnique".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(x,y,z,A,B,C){x.baked.size&&x.baked.size[0]===y[0]&&x.baked.size[1]===y[1]||x.baked.bake(y);x.baked.intersect(z,A,B,C)}class r extends c.Material{constructor(x){super(x,new u);this.supportsEdges=!0;this.produces=new Map([[d.RenderSlot.OPAQUE_MATERIAL,y=>(this.parameters.castShadows&&k.isShadowRelatedOutput(y)||k.is3DGeometryOutput(y))&&!this.parameters.transparent],[d.RenderSlot.TRANSPARENT_MATERIAL,y=>(this.parameters.castShadows&&k.isShadowRelatedOutput(y)|| k.is3DGeometryOutput(y))&&this.parameters.transparent]]);this._vertexAttributeLocations=v.vertexAttributeLocations;this._configuration=new v.PathTechniqueConfiguration;this._vertexBufferLayout=r.getVertexBufferLayout()}getConfiguration(x,y){this._configuration.output=x;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.vvOpacity=!!this.parameters.vvOpacity;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.transparent= this.parameters.transparent;this._configuration.hasOccludees=this.parameters.hasOccludees;x===k.ShaderOutput.Color&&(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?h.NormalsDoubleSidedMode.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?h.NormalsDoubleSidedMode.WindingOrder:h.NormalsDoubleSidedMode.None,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.receiveAmbientOcclusion= null!=y.ssao);this._configuration.transparencyPassType=y.transparencyPassType;this._configuration.multipassEnabled=y.multipassEnabled;this._configuration.cullAboveGround=y.multipassTerrain.cullAboveGround;return this._configuration}isVisibleForOutput(x){return x===k.ShaderOutput.Shadow||x===k.ShaderOutput.ShadowExcludeHighlight||x===k.ShaderOutput.ShadowHighlight?this.parameters.castShadows:!0}isVisible(){return super.isVisible()&&0new Promise((D,F)=>a(["../shaders/Path.glsl"],D,F)));class C extends n.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=k.ShaderOutput.Color;this.doubleSidedMode=f.NormalsDoubleSidedMode.None;this.transparencyPassType=m.TransparencyPassType.NONE;this.objectAndLayerIdColorInstanced=this.doublePrecisionRequiresObfuscation= this.cullAboveGround=this.multipassEnabled=this.hasOccludees=this.transparent=this.hasSlicePlane=this.vvOpacity=this.vvColor=this.vvSize=this.receiveAmbientOcclusion=this.receiveShadows=this.spherical=!1}}q.__decorate([d.parameter({count:k.ShaderOutput.COUNT})],C.prototype,"output",void 0);q.__decorate([d.parameter({count:f.NormalsDoubleSidedMode.COUNT})],C.prototype,"doubleSidedMode",void 0);q.__decorate([d.parameter({count:m.TransparencyPassType.COUNT})],C.prototype,"transparencyPassType",void 0); q.__decorate([d.parameter()],C.prototype,"spherical",void 0);q.__decorate([d.parameter()],C.prototype,"receiveShadows",void 0);q.__decorate([d.parameter()],C.prototype,"receiveAmbientOcclusion",void 0);q.__decorate([d.parameter()],C.prototype,"vvSize",void 0);q.__decorate([d.parameter()],C.prototype,"vvColor",void 0);q.__decorate([d.parameter()],C.prototype,"vvOpacity",void 0);q.__decorate([d.parameter()],C.prototype,"hasSlicePlane",void 0);q.__decorate([d.parameter()],C.prototype,"transparent",void 0); q.__decorate([d.parameter()],C.prototype,"hasOccludees",void 0);q.__decorate([d.parameter()],C.prototype,"multipassEnabled",void 0);q.__decorate([d.parameter()],C.prototype,"cullAboveGround",void 0);q.__decorate([d.parameter()],C.prototype,"doublePrecisionRequiresObfuscation",void 0);q.__decorate([d.parameter({constValue:!1})],C.prototype,"occlusionPass",void 0);q.__decorate([d.parameter({constValue:c.PBRMode.Disabled})],C.prototype,"pbrMode",void 0);q.__decorate([d.parameter({constValue:!0})],C.prototype, "hasVvInstancing",void 0);q.__decorate([d.parameter({constValue:!1})],C.prototype,"useCustomDTRExponentForWater",void 0);q.__decorate([d.parameter({constValue:!1})],C.prototype,"useFillLights",void 0);q.__decorate([d.parameter({constValue:!1})],C.prototype,"hasColorTexture",void 0);b.PathPassParameters=A;b.PathTechnique=B;b.PathTechniqueConfiguration=C;b.vertexAttributeLocations=z;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ./PositionAttribute.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/Float3PassUniform ../../shaderModules/Float4sPassUniform ../../shaderModules/FloatsPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute ../../../materials/VisualVariablePassParameters".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g extends e.VisualVariablePassParameters{constructor(){super(...arguments);this.size=b.fromValues(1,1)}}a.PathVertexPosition=function(d,t){const w=c.VertexAttribute.FEATUREVALUE;d.attributes.add(w,"vec4");const v=d.vertex;v.code.add(f.glsl` bool isCapVertex() { return ${w}.w == 1.0; } `);v.uniforms.add(new l.Float2PassUniform("size",m=>m.size));t.vvSize?(v.uniforms.add(new p.Float3PassUniform("vvSizeMinSize",m=>m.vvSize.minSize),new p.Float3PassUniform("vvSizeMaxSize",m=>m.vvSize.maxSize),new p.Float3PassUniform("vvSizeOffset",m=>m.vvSize.offset),new p.Float3PassUniform("vvSizeFactor",m=>m.vvSize.factor)),v.code.add(f.glsl` vec2 getSize() { return size * clamp(vvSizeOffset + ${w}.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz; } `)):v.code.add(f.glsl`vec2 getSize(){ return size; }`);t.vvOpacity?(v.constants.add("vvOpacityNumber","int",8),v.uniforms.add(new h.FloatsPassUniform("vvOpacityValues",m=>m.vvOpacity.values,8),new h.FloatsPassUniform("vvOpacityOpacities",m=>m.vvOpacity.opacityValues,8)),v.code.add(f.glsl` vec4 applyOpacity(vec4 color) { float value = ${w}.z; if (value <= vvOpacityValues[0]) { return vec4( color.xyz, vvOpacityOpacities[0]); } for (int i = 1; i < vvOpacityNumber; ++i) { if (vvOpacityValues[i] >= value) { float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]); return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f)); } } return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]); } `)):v.code.add(f.glsl`vec4 applyOpacity(vec4 color){ return color; }`);t.vvColor?(v.constants.add("vvColorNumber","int",e.vvColorNumber),v.uniforms.add(new h.FloatsPassUniform("vvColorValues",m=>m.vvColor.values,e.vvColorNumber),new k.Float4sPassUniform("vvColorColors",m=>m.vvColor.colors,e.vvColorNumber)),v.code.add(f.glsl` vec4 getColor() { float value = ${w}.y; if (value <= vvColorValues[0]) { return applyOpacity(vvColorColors[0]); } for (int i = 1; i < vvColorNumber; ++i) { if (vvColorValues[i] >= value) { float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f)); } } return applyOpacity(vvColorColors[vvColorNumber - 1]); } `)):v.code.add(f.glsl`vec4 getColor(){ return applyOpacity(vec4(1, 1, 1, 1)); }`);d.include(q.PositionAttribute);d.attributes.add(c.VertexAttribute.PROFILERIGHT,"vec4");d.attributes.add(c.VertexAttribute.PROFILEUP,"vec4");d.attributes.add(c.VertexAttribute.PROFILEVERTEXANDNORMAL,"vec4");v.code.add(f.glsl`vec3 calculateVPos() { vec2 size = getSize(); vec3 origin = position; vec3 right = profileRight.xyz; vec3 up = profileUp.xyz; vec3 forward = cross(up, right); vec2 profileVertex = profileVertexAndNormal.xy * size; vec2 profileNormal = profileVertexAndNormal.zw; float positionOffsetAlongProfilePlaneNormal = 0.0; float normalOffsetAlongProfilePlaneNormal = 0.0;`);v.code.add(f.glsl`if(!isCapVertex()) { vec2 rotationRight = vec2(profileRight.w, profileUp.w); float maxDistance = length(rotationRight);`);v.code.add(f.glsl`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0); float rx = dot(profileVertex, rotationRight); if (abs(rx) > maxDistance) { vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x); float ry = dot(profileVertex, rotationUp); profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry; } }else{ positionOffsetAlongProfilePlaneNormal = profileRight.w * size[0]; normalOffsetAlongProfilePlaneNormal = profileUp.w; } vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal; return origin + offset; }`);v.code.add(f.glsl`vec3 localNormal() { vec3 right = profileRight.xyz; vec3 up = profileUp.xyz; vec3 forward = cross(up, right); vec2 profileNormal = profileVertexAndNormal.zw; vec3 normal = right * profileNormal.x + up * profileNormal.y; if(isCapVertex()) { normal += forward * profileUp.w; } return normal; }`)};a.PathVertexPositionPassParameters=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Path.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(D){const F=new z.ShaderBuilder,{vertex:H,fragment:N}=F;n.addProjViewLocalOrigin(H,D);F.varyings.add("vpos","vec3");F.include(h.PathVertexPosition,D);if(D.output===q.ShaderOutput.Color||D.output===q.ShaderOutput.ObjectAndLayerIdColor)F.include(p.Transform,D),F.include(m.ReadShadowMapDraw,D),F.include(b.ForwardLinearDepth,D),F.include(k.ObjectAndLayerIdColor,D),F.varyings.add("vnormal","vec3"),F.varyings.add("vcolor","vec4"),D.multipassEnabled&& F.varyings.add("depth","float"),H.code.add(y.glsl` void main() { vpos = calculateVPos(); vnormal = normalize(localNormal()); ${D.multipassEnabled?"depth \x3d (view * vec4(vpos, 1.0)).z;":""} gl_Position = transformPosition(proj, view, vpos); ${D.output===q.ShaderOutput.Color?"forwardLinearDepth();":""} forwardObjectAndLayerIdColor(); vcolor = getColor(); } `);F.include(t.multipassTerrainTest,D);switch(D.output){case q.ShaderOutput.Color:F.include(l.SliceDraw,D);F.include(g.EvaluateSceneLighting,D);F.include(e.EvaluateAmbientOcclusion,D);F.include(m.ReadShadowMapDraw,D);F.include(w.Normals,D);n.addCameraPosition(N,D);g.addAmbientBoostFactor(N);g.addLightingGlobalFactor(N);N.uniforms.add(H.uniforms.get("localOrigin"),new u.Float3PassUniform("ambient",E=>E.ambient),new u.Float3PassUniform("diffuse",E=>E.diffuse),new u.Float3PassUniform("specular", E=>E.specular),new x.FloatPassUniform("opacity",E=>E.opacity));N.include(r.ColorConversion);D.transparencyPassType===A.TransparencyPassType.ColorAlpha&&(F.outputs.add("fragColor","vec4",0),F.outputs.add("fragAlpha","float",1));d.addMainLightIntensity(N);N.code.add(y.glsl` void main() { discardBySlice(vpos); ${D.multipassEnabled?"terrainDepthTest(depth);":""} shadingParams.viewDirection = normalize(vpos - cameraPosition); shadingParams.normalView = vnormal; vec3 normal = shadingNormal(shadingParams); float ssao = evaluateAmbientOcclusionInverse(); float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; ${D.receiveShadows?"float shadow \x3d readShadowMap(vpos, linearDepth);":D.spherical?"float shadow \x3d lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow \x3d 0.0;"} vec3 albedo = vcolor.rgb * max(ambient, diffuse); // combine the old material parameters into a single one float combinedOpacity = vcolor.a * opacity; albedo += 0.25 * specular; // don't completely ignore specular for now vec3 shadedColor = evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight); fragColor = vec4(shadedColor, combinedOpacity); fragColor = highlightSlice(fragColor, vpos); ${D.transparencyPassType===A.TransparencyPassType.ColorAlpha?y.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""} } `);break;case q.ShaderOutput.Depth:F.include(p.Transform,D);H.code.add(y.glsl`void main() { vpos = calculateVPos(); gl_Position = transformPosition(proj, view, vpos); }`);F.include(l.SliceDraw,D);N.code.add(y.glsl`void main() { discardBySlice(vpos); }`);break;case q.ShaderOutput.Shadow:case q.ShaderOutput.ShadowHighlight:case q.ShaderOutput.ShadowExcludeHighlight:case q.ShaderOutput.ViewshedShadow:F.include(p.Transform,D);b.addNearFar(F);F.varyings.add("depth","float");H.code.add(y.glsl`void main() { vpos = calculateVPos(); gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); }`);F.include(l.SliceDraw,D);F.include(f.OutputDepth,D);N.code.add(y.glsl`void main() { discardBySlice(vpos); outputDepth(depth); }`);break;case q.ShaderOutput.ObjectAndLayerIdColor:F.include(l.SliceDraw,D);N.code.add(y.glsl`void main() { discardBySlice(vpos); outputObjectAndLayerIdColor(); }`);break;case q.ShaderOutput.Normal:F.include(p.Transform,D);F.include(v.NormalUtils,D);n.addViewNormal(H);F.varyings.add("vnormal","vec3");H.code.add(y.glsl`void main(void) { vpos = calculateVPos(); vnormal = normalize((viewNormal * vec4(localNormal(), 1.0)).xyz); gl_Position = transformPosition(proj, view, vpos); }`);F.include(l.SliceDraw,D);N.code.add(y.glsl`void main() { discardBySlice(vpos); vec3 normal = normalize(vnormal); if (gl_FrontFacing == false) normal = -normal; fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0); }`);break;case q.ShaderOutput.Highlight:F.include(p.Transform,D),F.include(v.NormalUtils,D),F.varyings.add("vnormal","vec3"),H.code.add(y.glsl`void main(void) { vpos = calculateVPos(); gl_Position = transformPosition(proj, view, vpos); }`),F.include(l.SliceDraw,D),F.include(c.OutputHighlight,D),N.code.add(y.glsl`void main() { discardBySlice(vpos); outputHighlight(); }`)}return F}const C=Object.freeze(Object.defineProperty({__proto__:null,build:B},Symbol.toStringTag,{value:"Module"}));a.Path=C;a.build=B})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.NormalUtils=function(q,l){l.spherical?q.vertex.code.add(b.glsl`vec3 getLocalUp(in vec3 pos, in vec3 origin) { return normalize(pos + origin); }`):q.vertex.code.add(b.glsl`vec3 getLocalUp(in vec3 pos, in vec3 origin) { return vec3(0.0, 0.0, 1.0); }`);l.spherical?q.vertex.code.add(b.glsl`mat3 getTBNMatrix(in vec3 n) { vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n)); vec3 b = normalize(cross(n, t)); return mat3(t, b, n); }`):q.vertex.code.add(b.glsl`mat3 getTBNMatrix(in vec3 n) { vec3 t = vec3(1.0, 0.0, 0.0); vec3 b = normalize(cross(n, t)); return mat3(t, b, n); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer":function(){define("exports ../../../../Color ../../../../core/screenUtils ../../../../chunks/earcut ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/DoubleArray ../../../../geometry/support/FloatArray ./elevationAlignmentUtils ./Graphics3DDrapedGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./graphicUtils ./interfaces ./lineUtils ./polygonUtils ../support/FastSymbolUpdates ../support/patternUtils ../support/uvUtils ../../support/engineContent/line ../../support/renderInfoUtils/polygon ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/materials/lineStippleUtils ../../webgl-engine/materials/PatternMaterial ../../webgl-engine/materials/RibbonLineMaterial".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){const D=["polyline","polygon","extent"],F=new m.ConvertOptions({size:!1,color:!0,rotation:!1,opacity:!1});class H extends g.Graphics3DSymbolLayer{constructor(O,L,P,M){super(O,L,P,M);this._needsUV=!1}async doLoad(){this._fastUpdates=m.initFastSymbolUpdatesState(this._context.renderer,F)}_createMaterials(){if(!(0K)}slicePlaneEnabledChanged(){this._materials[I.Fill]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});this._materials[I.Outline]&&this._materials[I.Outline].setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(O, L,P){const M=v.geometryAsPolygon(O.geometry);if(!M)return null;var K=x.geometryToRenderInfo(M,this._context.elevationProvider,this._context.renderCoordsHelper,P);L=new E(K,L,this._context.layer.uid,O.uid);K=L.renderData.position.length/3;this._needsUV&&(L.uvMapSpace=h.newFloatArray(4*K,!0),L.boundingRect=k.newDoubleArray(9*K,!0),n.createMapSpaceUVCoords(L.uvMapSpace,L.boundingRect,L.renderData.position,this._context.renderCoordsHelper));L.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(L); this._createAs3DShapeFill(O,L);this._materials[I.Outline]&&this._createAs3DShapeOutline(L);this._logGeometryCreationWarnings(L.renderData,M.rings,"rings","FillSymbol3DLayer");if(0===L.outGeometries.length)return null;O=new y.Object3D({geometries:L.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:O.uid});O=new e.Graphics3DObject3DGraphicLayer(this,O,L.outGeometries,null,null,r.uvElevationAligner,P);O.alignedSampledElevation=L.renderData.sampledElevation;O.needsElevationUpdates= f.needsElevationUpdates2D(P.mode);return O}_createAs3DShapeFill(O,L){var P=L.renderData.polygons;for(const {position:M,mapPositions:K,holeIndices:J,index:R,count:Q}of P){if(null!=this._context.clippingExtent&&(p.empty(N),p.expandWithBuffer(N,K),!p.intersectsClippingArea(N,this._context.clippingExtent)))continue;P=v.createIndices3D(K,J,this._context.elevationProvider.spatialReference);if(0===P.length)continue;const W=this._fastUpdates?.visualVariables.color;P=v.createColorGeometry({material:this._materials[I.Fill], indices:P,mapPositions:K,attributeData:{position:M,color:W?null:L.color,colorFeature:W?m.getAttributeValue(W.field,O):null,uvMapSpace:this._needsUV?h.floatSubArray(L.uvMapSpace,4*R,4*Q):null,boundingRect:this._needsUV?k.doubleSubArray(L.boundingRect,9*R,9*Q):null,objectAndLayerIdColor:L.objectAndLayerIdColor}});L.outGeometries.push(P)}}_createAs3DShapeOutline(O){if(null!=this._materials[I.Outline]){var L=O.renderData.outlines;for(const {mapPositions:P,position:M}of L){if(null!=this._context.clippingExtent&& (p.empty(N),p.expandWithBuffer(N,P),!p.intersectsClippingArea(N,this._context.clippingExtent)))continue;L=u.createGeometry(this._materials[I.Outline],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:P,attributeData:{position:M}},O.objectAndLayerIdColor);O.outGeometries.push(L)}}}_createAsOverlay(O,L){const P=v.geometryAsPolygon(O.geometry);if(null==P)return null;this._materials[I.Fill].renderPriority=this._renderPriority+this._renderPriorityStep/2;null!=this._materials[I.Outline]&&(this._materials[I.Outline].renderPriority= this._renderPriority);var M=x.geometryToRenderInfoDraped(P,this._context.overlaySR);L=new G(M,L,this._context.layer.uid,O.uid);M=L.renderData.position.length/3;this._needsUV&&(L.uvMapSpace=h.newFloatArray(4*M,!0),n.createMapSpaceUVCoordsDraped(L.uvMapSpace,L.renderData.position,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode));L.outBoundingBox=p.empty();L.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(L);this._createAsOverlayFill(O,L); this._materials[I.Outline]&&this._createAsOverlayOutline(L);this._logGeometryCreationWarnings(L.renderData,P.rings,"rings","FillSymbol3DLayer");return 0===L.outGeometries.length?null:new c.Graphics3DDrapedGraphicLayer(this,L.outGeometries,L.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(O,L){var P=L.renderData.polygons;for(const {position:K,holeIndices:J,index:R,count:Q}of P){var M=p.empty(N);p.expandWithBuffer(M,K);p.intersectsClippingArea(M,this._context.clippingExtent)&& (P=l.earcut(K,J,3),0!==P.length&&(p.expandWithAABB(L.outBoundingBox,M),M=this._fastUpdates?.visualVariables.color,P=v.createColorGeometry({material:this._materials[I.Fill],indices:P,attributeData:{position:K,color:M?null:L.color,colorFeature:M?m.getAttributeValue(M.field,O):null,uvMapSpace:this._needsUV?h.floatSubArray(L.uvMapSpace,4*R,4*Q):null,objectAndLayerIdColor:L.objectAndLayerIdColor}}),L.outGeometries.push(new z.RenderGeometry(P,L))))}}_createAsOverlayOutline(O){if(null!=this._materials[I.Outline]){var L= O.renderData.outlines;for(let M=0;Mthis._createAsOverlay(O,L),createAs3DShape:(O,L,P)=>this._createAs3DShape(O,L,P)}}}H.elevationModeChangeTypes={definedChanged:f.SymbolUpdateType.RECREATE,staysOnTheGround:f.SymbolUpdateType.NONE,onTheGroundChanged:f.SymbolUpdateType.RECREATE}; const N=p.create();class E extends v.PolygonCreationDataBase{constructor(O,L,P,M){super(O,P,M);this.color=L}}class G extends v.PolygonCreationDataBase{constructor(O,L,P,M){super(O,P,M);this.color=L}}var I;(function(O){O[O.Fill=0]="Fill";O[O.Outline=1]="Outline"})(I||={});a.Graphics3DPolygonFillSymbolLayer=H;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/patternUtils":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../graphics/ElevationAligners ./uvUtils ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/ColorMaterial ../../webgl-engine/materials/PatternMaterial ../../webgl-engine/materials/PatternStyle".split(" "), function(a,b,q,l,p,k,h,f,c){function e(t){switch(t){case "horizontal":return c.Style.Horizontal;case "vertical":return c.Style.Vertical;case "cross":return c.Style.Cross;case "forward-diagonal":return c.Style.ForwardDiagonal;case "backward-diagonal":return c.Style.BackwardDiagonal;case "diagonal-cross":return c.Style.DiagonalCross}}function g(t){return t.material instanceof f.PatternMaterial&&!t.material.parameters.draped}function d(t,w){if(g(t)){const v=t.attributes.get(k.VertexAttribute.POSITION).data, m=t.getMutableAttribute(k.VertexAttribute.UVMAPSPACE).data;t=t.getMutableAttribute(k.VertexAttribute.BOUNDINGRECT).data;p.createMapSpaceUVCoords(m,t,v,w)}}a.createMaterial=function(t,w){t=t?.pattern??null;if(null==t)return new h.ColorMaterial(w);if("none"===t.style||"solid"===t.style)return"none"===t.style&&(w.color=q.fromValues(0,0,0,0),w.forceTransparentMode=!0),new h.ColorMaterial(w);w.style=e(t.style);return new f.PatternMaterial(w)};a.parsePatternStyle=e;a.requiresUVUpdates=g;a.updateMapSpaceUVCoords= d;a.uvElevationAligner=function(t,w,v,m,r){w=l.perVertexElevationAligner(t,w,v,m,r);t=t.stageObject.geometries;for(const n of t)d(n,r);return w};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/uvUtils":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/projection/projectors ../../../../geometry/support/DoubleArray ../../../../geometry/support/plane ../../../ViewingMode".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(N,E,G,I,O,L,P){p.set(N,E*O[0]+G*L[0]+I*P[0],E*O[1]+G*L[1]+I*P[1],E*O[2]+G*L[2]+I*P[2])}const t=k.create(),w=k.create(),v=e.create(),m=k.create(),r=k.create(),n=k.create(),u=l.create(),x=l.create(),y=k.create(),z=k.create(),A=k.create(),B=b.create(),C=k.create(),D=k.create(),F=k.create(),H=k.create();a.createMapSpaceUVCoords=function(N,E,G,I,O=1){p.set(m,1,0,0);p.set(r,0,1,0);p.set(n,0,0,1);p.set(H,0,0,0);for(var L=0;Lp.dot(I,F)&&p.scale(I,I,-1);p.copy(n,I);L=p.dot(I,D);var P=p.dot(I,C);Math.abs(L)>Math.abs(P)?(p.scaleAndAdd(m,C,I,-P),p.normalize(m,m),p.cross(r,m,I),p.normalize(r,r),p.scale(r,r,-1)):(p.scaleAndAdd(r,D,I,-L),p.normalize(r,r),p.cross(m,r,I),p.normalize(m, m))}q.set(u,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);q.set(x,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(I=0;IK;K++)E[M+K]=y[K],E[M+K+3]=z[K],E[M+K+6]=A[K]}};a.createMapSpaceUVCoordsDraped=function(N,E,G,I,O=1){if(G.isGeographic&&I===g.ViewingMode.Global){I=c.newDoubleArray(E.length);var L=E.length;G=h.getReferenceEllipsoid(G);for(var P=0;Px===p.ShaderOutput.Highlight||p.isColorOrOID(x)&&!this._isTransparent],[c.RenderSlot.OPAQUE_NO_SSAO_DEPTH,x=>p.isDepth(x)&&this.parameters.writeLinearDepth&&!this._isTransparent],[c.RenderSlot.TRANSPARENT_MATERIAL,x=>p.isColorOrOID(x)&&this._isTransparent&&this.parameters.writeDepth],[c.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH, x=>p.isDepth(x)&&this.parameters.writeLinearDepth&&this._isTransparent&&this.parameters.writeDepth],[c.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,x=>(p.isColorOrOID(x)||p.isDepth(x)&&this.parameters.writeLinearDepth)&&this._isTransparent&&!this.parameters.writeDepth],[c.RenderSlot.DRAPED_MATERIAL,x=>p.is2DGeometryOutput(x)]]);this._configuration=new v.ColorMaterialTechniqueConfiguration}getConfiguration(u,x){this._configuration.output=u;this._configuration.cullFace=this.parameters.cullFace; this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.transparent=this._isTransparent;this._configuration.polygonOffset=this.parameters.polygonOffset;this._configuration.writeDepth=this.parameters.writeDepth;this._configuration.hasOccludees=this.parameters.hasOccludees;this._configuration.transparencyPassType=x.transparencyPassType;this._configuration.enableOffset=x.camera.relativeElevation< f.OITPolygonOffsetLimit;this._configuration.multipassEnabled=x.multipassEnabled;this._configuration.cullAboveGround=x.multipassTerrain.cullAboveGround;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.draped=this.parameters.draped;return this._configuration}createGLMaterial(u){return new r(u)}createBufferWriter(){const u=l.newLayout().vec3f(e.VertexAttribute.POSITION);b("enable-feature:objectAndLayerId-rendering")&&u.vec4u8(e.VertexAttribute.OBJECTANDLAYERIDCOLOR);this.parameters.vvColor? u.f32(e.VertexAttribute.COLORFEATUREATTRIBUTE):u.vec4u8(e.VertexAttribute.COLOR);return new g.DefaultBufferWriter(u)}get _isTransparent(){return 1>this.parameters.color[3]||this.parameters.forceTransparentMode}}class r extends h{_updateOccludeeState(u){u.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:u.hasOccludees})}beginSlot(u){this._output===p.ShaderOutput.Color&&this._updateOccludeeState(u);return this.ensureTechnique(w.ColorMaterialTechnique, u)}}class n extends t.VisualVariablePassParameters{constructor(){super(...arguments);this.color=q.ZEROS;this.forceTransparentMode=!1;this.writeDepth=!0;this.hasSlicePlane=this.polygonOffset=this.hasVertexColors=this.writeLinearDepth=!1;this.cullFace=k.CullFaceOptions.None;this.draped=this.hasOccludees=!1}}a.ColorMaterial=m;a.Parameters=n;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/TriangleMaterial":function(){define(["exports","../lib/Material", "../lib/RayIntersections"],function(a,b,q){class l extends b.Material{intersect(p,k,h,f,c,e){return q.intersectTriangleGeometry(p,h,f,c,void 0,e)}}a.TriangleMaterial=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ColorMaterialTechnique":function(){define("require exports ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../materials/VisualVariablePassParameters ../../../../chunks/ColorMaterial.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){class m extends d.VisualVariablePassParameters{constructor(){super(...arguments);this.color=q.ZEROS}}class r extends k.ShaderTechnique{initializeProgram(u){return new c.Program(u.rctx,r.shader.get().build(this.configuration),h.Default3D)}_createPipeline(u,x){const y=this.configuration,z=u===g.TransparencyPassType.NONE,A=u===g.TransparencyPassType.FrontFace;return v.makePipelineState({blending:y.output===l.ShaderOutput.Color&&y.transparent?z?f.blendingDefault: f.oitBlending(u):null,culling:v.cullingParams(y.cullFace),depthTest:y.draped?null:{func:f.oitDepthTest(u)},depthWrite:y.draped?null:z||A?y.writeDepth?v.defaultDepthWriteParams:null:null,drawBuffers:y.output===l.ShaderOutput.Depth?{buffers:[w.SpecialDrawBuffers.NONE]}:f.oitDrawBuffers(u),colorWrite:v.defaultColorWriteParams,stencilWrite:y.hasOccludees?e.stencilWriteMaskOn:null,stencilTest:y.hasOccludees?x?e.stencilToolMaskBaseParams:e.stencilBaseAllZerosParams:null,polygonOffset:z||A?y.polygonOffset? n:null:f.getOITPolygonOffset(y.enableOffset)})}initializePipeline(){this._occludeePipelineState=this._createPipeline(this.configuration.transparencyPassType,!0);return this._createPipeline(this.configuration.transparencyPassType,!1)}getPipeline(u){return u?this._occludeePipelineState:super.getPipeline()}}r.shader=new p.ReloadableShaderModule(t.ColorMaterial,()=>new Promise((u,x)=>a(["./ColorMaterial.glsl"],u,x)));const n={factor:1,units:1};b.ColorMaterialPassParameters=m;b.ColorMaterialTechnique= r;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ColorMaterial.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){function n(x){const y=new v.ShaderBuilder,{vertex:z,fragment:A,attributes:B,varyings:C}=y;d.addProjViewLocalOrigin(z,x);y.include(l.Transform,x);y.include(k.VertexColor,x);y.include(c.VisualVariables,x);y.include(p.ObjectAndLayerIdColor,x);B.add(r.VertexAttribute.POSITION,"vec3");x.vvColor&&B.add(r.VertexAttribute.COLORFEATUREATTRIBUTE,"float");C.add("vColor","vec4");C.add("vpos","vec3");const D=x.multipassEnabled&&x.output===b.ShaderOutput.Color;D&&C.add("depth", "float");z.uniforms.add(new t.Float4PassUniform("eColor",H=>H.color));z.code.add(w.glsl` void main(void) { vpos = position; forwardNormalizedVertexColor(); forwardObjectAndLayerIdColor(); ${x.hasVertexColors?"vColor *\x3d eColor;":x.vvColor?"vColor \x3d eColor * interpolateVVColor(colorFeatureAttribute);":"vColor \x3d eColor;"} ${D?"depth \x3d (view * vec4(vpos, 1.0)).z;":""} gl_Position = transformPosition(proj, view, vpos); } `);y.include(q.SliceDraw,x);D&&y.include(f.multipassTerrainTest,x);A.include(g.ColorConversion);const F=x.output===b.ShaderOutput.Highlight;F&&y.include(h.OutputHighlight,x);x.transparencyPassType===m.TransparencyPassType.ColorAlpha&&(y.outputs.add("fragColor","vec4",0),y.outputs.add("fragAlpha","float",1));A.code.add(w.glsl` void main() { discardBySlice(vpos); ${D?"terrainDepthTest(depth);":""} vec4 fColor = vColor; ${x.output===b.ShaderOutput.ObjectAndLayerIdColor?w.glsl`fColor.a = 1.0;`:""} if (fColor.a < ${w.glsl.float(e.symbolAlphaCutoff)}) { discard; } ${x.output===b.ShaderOutput.Color?w.glsl`fragColor = highlightSlice(fColor, vpos); ${x.transparencyPassType===m.TransparencyPassType.ColorAlpha?w.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""}`:""} ${F?w.glsl`outputHighlight();`:""}; ${x.output===b.ShaderOutput.ObjectAndLayerIdColor?w.glsl`outputObjectAndLayerIdColor();`:""} } `);return y}const u=Object.freeze(Object.defineProperty({__proto__:null,build:n},Symbol.toStringTag,{value:"Module"}));a.ColorMaterial=u;a.build=n})},"esri/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/basicInterfaces ../lib/TransparencyPassType ../materials/DefaultTechniqueConfiguration".split(" "),function(a,b,q,l,p,k,h){class f extends h.DefaultTechniqueConfiguration{constructor(){super(...arguments); this.output=q.ShaderOutput.Color;this.cullFace=p.CullFaceOptions.None;this.transparencyPassType=k.TransparencyPassType.NONE;this.polygonOffset=this.transparent=this.hasVertexColors=this.hasSlicePlane=!1;this.writeDepth=this.enableOffset=!0;this.draped=this.vvColor=this.objectAndLayerIdColorInstanced=this.cullAboveGround=this.multipassEnabled=this.hasOccludees=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],f.prototype,"output",void 0);b.__decorate([l.parameter({count:p.CullFaceOptions.COUNT})], f.prototype,"cullFace",void 0);b.__decorate([l.parameter({count:k.TransparencyPassType.COUNT})],f.prototype,"transparencyPassType",void 0);b.__decorate([l.parameter()],f.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],f.prototype,"hasVertexColors",void 0);b.__decorate([l.parameter()],f.prototype,"transparent",void 0);b.__decorate([l.parameter()],f.prototype,"polygonOffset",void 0);b.__decorate([l.parameter()],f.prototype,"enableOffset",void 0);b.__decorate([l.parameter()],f.prototype, "writeDepth",void 0);b.__decorate([l.parameter()],f.prototype,"hasOccludees",void 0);b.__decorate([l.parameter()],f.prototype,"multipassEnabled",void 0);b.__decorate([l.parameter()],f.prototype,"cullAboveGround",void 0);b.__decorate([l.parameter()],f.prototype,"objectAndLayerIdColorInstanced",void 0);b.__decorate([l.parameter()],f.prototype,"vvColor",void 0);b.__decorate([l.parameter()],f.prototype,"draped",void 0);b.__decorate([l.parameter({constValue:!1})],f.prototype,"occlusionPass",void 0);b.__decorate([l.parameter({constValue:!0})], f.prototype,"hasVvInstancing",void 0);b.__decorate([l.parameter({constValue:!1})],f.prototype,"vvSize",void 0);b.__decorate([l.parameter({constValue:!1})],f.prototype,"vvOpacity",void 0);a.ColorMaterialTechniqueConfiguration=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/PatternMaterial":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/buffer/BufferView ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../lib/basicInterfaces ../lib/GLMaterial ../lib/OrderIndependentTransparency ../lib/RenderSlot ../lib/Util ../lib/VertexAttribute ./DefaultBufferWriter ./PatternStyle ./TriangleMaterial ./VisualVariablePassParameters ./internal/bufferWriterUtils ../shaders/PatternTechnique".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){class u extends v.TriangleMaterial{constructor(A){super(A,new z);this.supportsEdges=!0;this.produces=new Map([[e.RenderSlot.OPAQUE_MATERIAL,B=>k.isOIDorHighlight(B)],[e.RenderSlot.TRANSPARENT_MATERIAL,B=>k.isColor(B)],[e.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH,B=>k.isDepth(B)&&this.parameters.writeLinearDepth],[e.RenderSlot.DRAPED_MATERIAL,B=>this.parameters.draped&&B===k.ShaderOutput.Color||k.isOIDorHighlight(B)]]);this._vertexAttributeLocations=b("enable-feature:objectAndLayerId-rendering")? n.vertexAttributeLocationsOID:n.vertexAttributeLocations;this._configuration=new n.PatternTechniqueConfiguration}getConfiguration(A,B){this._configuration.output=A;this._configuration.cullFace=this.parameters.cullFace;this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.polygonOffset=this.parameters.polygonOffset;this._configuration.style=this.parameters.style;this._configuration.patternSpacing= this.parameters.patternSpacing;this._configuration.lineWidth=this.parameters.lineWidth;this._configuration.draped=this.parameters.draped;this._configuration.transparencyPassType=B.transparencyPassType;this._configuration.enableOffset=B.camera.relativeElevationE;++E)L[B+E]=I[K+E];B+=N}}}}}}class z extends m.VisualVariablePassParameters{constructor(){super(...arguments); this.color=q.fromValues(1,1,1,1);this.hasSlicePlane=this.polygonOffset=this.hasVertexColors=this.writeLinearDepth=!1;this.cullFace=h.CullFaceOptions.None;this.hasOccludees=!1;this.style=w.Style.Cross;this.patternSpacing=10;this.lineWidth=1;this.draped=!0}}a.Parameters=z;a.PatternMaterial=u;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/PatternStyle":function(){define(["exports"],function(a){a.Style=void 0;var b=a.Style||(a.Style={});b[b.Horizontal= 0]="Horizontal";b[b.Vertical=1]="Vertical";b[b.Cross=2]="Cross";b[b.ForwardDiagonal=3]="ForwardDiagonal";b[b.BackwardDiagonal=4]="BackwardDiagonal";b[b.DiagonalCross=5]="DiagonalCross";b[b.COUNT=6]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/PatternTechnique":function(){define("require exports ../../../../chunks/tslib.es6 ../../../../core/has ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/basicInterfaces ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../lib/VertexAttribute ../materials/DefaultTechniqueConfiguration ../materials/PatternStyle ../../../../chunks/Pattern.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){class x extends h.ShaderTechnique{initializeProgram(C){return new g.Program(C.rctx,x.shader.get().build(this.configuration),l("enable-feature:objectAndLayerId-rendering")?B:A)}_setPipelineState(C,D){const F=this.configuration,H=C===t.TransparencyPassType.NONE,N=C===t.TransparencyPassType.FrontFace;return u.makePipelineState({blending:F.output===p.ShaderOutput.Color?H?e.blendingDefault:e.oitBlending(C):null,culling:u.cullingParams(F.cullFace),depthTest:F.draped? null:{func:e.oitDepthTest(C)},depthWrite:F.draped?null:H?u.defaultDepthWriteParams:e.oitDepthWrite(C),drawBuffers:F.output===p.ShaderOutput.Depth?{buffers:[n.SpecialDrawBuffers.NONE]}:e.oitDrawBuffers(C),colorWrite:u.defaultColorWriteParams,stencilWrite:F.hasOccludees?d.stencilWriteMaskOn:null,stencilTest:F.hasOccludees?D?d.stencilToolMaskBaseParams:d.stencilBaseAllZerosParams:null,polygonOffset:H||N?F.polygonOffset?y:null:e.getOITPolygonOffset(F.enableOffset)})}initializePipeline(){this._occludeePipelineState= this._setPipelineState(this.configuration.transparencyPassType,!0);return this._setPipelineState(this.configuration.transparencyPassType,!1)}getPipeline(C){return C?this._occludeePipelineState:super.getPipeline()}}x.shader=new k.ReloadableShaderModule(r.Pattern,()=>new Promise((C,D)=>a(["./Pattern.glsl"],C,D)));const y={factor:1,units:1};class z extends v.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=p.ShaderOutput.Color;this.cullFace=c.CullFaceOptions.None;this.transparencyPassType= t.TransparencyPassType.NONE;this.hasOccludees=this.polygonOffset=this.hasVertexColors=this.hasSlicePlane=!1;this.enableOffset=!0;this.objectAndLayerIdColorInstanced=this.vvColor=this.cullAboveGround=this.multipassEnabled=!1}}q.__decorate([f.parameter({count:p.ShaderOutput.COUNT})],z.prototype,"output",void 0);q.__decorate([f.parameter({count:c.CullFaceOptions.COUNT})],z.prototype,"cullFace",void 0);q.__decorate([f.parameter({count:m.Style.COUNT})],z.prototype,"style",void 0);q.__decorate([f.parameter({count:t.TransparencyPassType.COUNT})], z.prototype,"transparencyPassType",void 0);q.__decorate([f.parameter()],z.prototype,"hasSlicePlane",void 0);q.__decorate([f.parameter()],z.prototype,"hasVertexColors",void 0);q.__decorate([f.parameter()],z.prototype,"polygonOffset",void 0);q.__decorate([f.parameter()],z.prototype,"hasOccludees",void 0);q.__decorate([f.parameter()],z.prototype,"patternSpacing",void 0);q.__decorate([f.parameter()],z.prototype,"lineWidth",void 0);q.__decorate([f.parameter()],z.prototype,"enableOffset",void 0);q.__decorate([f.parameter()], z.prototype,"draped",void 0);q.__decorate([f.parameter()],z.prototype,"multipassEnabled",void 0);q.__decorate([f.parameter()],z.prototype,"cullAboveGround",void 0);q.__decorate([f.parameter()],z.prototype,"vvColor",void 0);q.__decorate([f.parameter({constValue:!0})],z.prototype,"writeDepth",void 0);q.__decorate([f.parameter({constValue:!1})],z.prototype,"occlusionPass",void 0);q.__decorate([f.parameter({constValue:!1})],z.prototype,"hasVvInstancing",void 0);q.__decorate([f.parameter({constValue:!1})], z.prototype,"vvSize",void 0);q.__decorate([f.parameter({constValue:!1})],z.prototype,"vvOpacity",void 0);const A=new Map([[w.VertexAttribute.POSITION,0],[w.VertexAttribute.COLOR,3],[w.VertexAttribute.UVMAPSPACE,4],[w.VertexAttribute.COLORFEATUREATTRIBUTE,5],[w.VertexAttribute.BOUNDINGRECT,6]]),B=new Map([[w.VertexAttribute.POSITION,0],[w.VertexAttribute.COLOR,3],[w.VertexAttribute.UVMAPSPACE,4],[w.VertexAttribute.COLORFEATUREATTRIBUTE,5],[w.VertexAttribute.BOUNDINGRECT,6],[w.VertexAttribute.OBJECTANDLAYERIDCOLOR, 9]]);b.PatternTechnique=x;b.PatternTechniqueConfiguration=z;b.vertexAttributeLocations=A;b.vertexAttributeLocationsOID=B;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Pattern.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute ../views/3d/webgl-engine/materials/PatternStyle".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){function x(A){const B=new m.ShaderBuilder,C=A.multipassEnabled&&A.output===b.ShaderOutput.Color,{vertex:D,fragment:F,attributes:H,varyings:N}=B;d.addProjViewLocalOrigin(D,A);B.include(l.Transform,A);B.include(k.VertexColor,A);B.include(c.VisualVariables,A);B.include(p.ObjectAndLayerIdColor,A);A.draped?D.uniforms.add(new w.FloatPassUniform("worldToScreenRatio",(G,I)=>1/I.screenToPCSRatio)):H.add(n.VertexAttribute.BOUNDINGRECT,"mat3");H.add(n.VertexAttribute.POSITION, "vec3");H.add(n.VertexAttribute.UVMAPSPACE,"vec4");A.vvColor&&H.add(n.VertexAttribute.COLORFEATUREATTRIBUTE,"float");N.add("vColor","vec4");N.add("vpos","vec3");N.add("vuv","vec2");C&&N.add("depth","float");D.uniforms.add(new t.Float4PassUniform("uColor",G=>G.color));const E=A.style===u.Style.ForwardDiagonal||A.style===u.Style.BackwardDiagonal||A.style===u.Style.DiagonalCross;E&&D.code.add(v.glsl` const mat2 rotate45 = mat2(${v.glsl.float(.70710678118)}, ${v.glsl.float(-.70710678118)}, ${v.glsl.float(.70710678118)}, ${v.glsl.float(.70710678118)}); `);A.draped||(d.addCameraPosition(D,A),D.uniforms.add(new w.FloatPassUniform("worldToScreenPerDistanceRatio",(G,I)=>1/I.camera.perScreenPixelRatio)),D.code.add(v.glsl`vec3 projectPointToLineSegment(vec3 center, vec3 halfVector, vec3 point) { float projectedLength = dot(halfVector, point - center) / dot(halfVector, halfVector); return center + halfVector * clamp(projectedLength, -1.0, 1.0); }`),D.code.add(v.glsl`vec3 intersectRayPlane(vec3 rayDir, vec3 rayOrigin, vec3 planeNormal, vec3 planePoint) { float d = dot(planeNormal, planePoint); float t = (d - dot(planeNormal, rayOrigin)) / dot(planeNormal, rayDir); return rayOrigin + t * rayDir; }`),D.code.add(v.glsl` float boundingRectDistanceToCamera() { vec3 center = vec3(boundingRect[0][0], boundingRect[0][1], boundingRect[0][2]); vec3 halfU = vec3(boundingRect[1][0], boundingRect[1][1], boundingRect[1][2]); vec3 halfV = vec3(boundingRect[2][0], boundingRect[2][1], boundingRect[2][2]); vec3 n = normalize(cross(halfU, halfV)); vec3 viewDir = - vec3(view[0][2], view[1][2], view[2][2]); float viewAngle = dot(viewDir, n); float minViewAngle = ${v.glsl.float(.08715574274)}; if (abs(viewAngle) < minViewAngle) { // view direction is (almost) parallel to plane -> clamp it to min angle float normalComponent = sign(viewAngle) * minViewAngle - viewAngle; viewDir = normalize(viewDir + normalComponent * n); } // intersect view direction with infinite plane that contains bounding rect vec3 planeProjected = intersectRayPlane(viewDir, cameraPosition, n, center); // clip to bounds by projecting to u and v line segments individually vec3 uProjected = projectPointToLineSegment(center, halfU, planeProjected); vec3 vProjected = projectPointToLineSegment(center, halfV, planeProjected); // use to calculate the closest point to camera on bounding rect vec3 closestPoint = uProjected + vProjected - center; return length(closestPoint - cameraPosition); } `));D.code.add(v.glsl` vec2 scaledUV() { vec2 uv = uvMapSpace.xy ${E?" * rotate45":""}; vec2 uvCellOrigin = uvMapSpace.zw ${E?" * rotate45":""}; ${A.draped?"":v.glsl` float distanceToCamera = boundingRectDistanceToCamera(); float worldToScreenRatio = worldToScreenPerDistanceRatio / distanceToCamera; `} // Logarithmically discretize ratio to avoid jittering float step = 0.1; float discreteWorldToScreenRatio = log(worldToScreenRatio); discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step; discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio); vec2 uvOffset = mod(uvCellOrigin * discreteWorldToScreenRatio, ${v.glsl.float(A.patternSpacing)}); return uvOffset + (uv * discreteWorldToScreenRatio); } `);D.code.add(v.glsl` void main(void) { vuv = scaledUV(); vpos = position; ${C?"depth \x3d (view * vec4(vpos, 1.0)).z;":""} forwardNormalizedVertexColor(); forwardObjectAndLayerIdColor(); ${A.hasVertexColors?"vColor *\x3d uColor;":A.vvColor?"vColor \x3d uColor * interpolateVVColor(colorFeatureAttribute);":"vColor \x3d uColor;"} gl_Position = transformPosition(proj, view, vpos); } `);B.include(q.SliceDraw,A);F.include(g.ColorConversion);A.draped&&F.uniforms.add(new w.FloatPassUniform("texelSize",(G,I)=>1/I.camera.pixelRatio));A.output===b.ShaderOutput.Highlight&&B.include(h.OutputHighlight,A);C&&B.include(f.multipassTerrainTest,A);A.output!==b.ShaderOutput.Highlight&&(F.code.add(v.glsl` const float lineWidth = ${v.glsl.float(A.lineWidth)}; const float spacing = ${v.glsl.float(A.patternSpacing)}; const float spacingINV = ${v.glsl.float(1/A.patternSpacing)}; float coverage(float p, float txlSize) { p = mod(p, spacing); float halfTxlSize = txlSize / 2.0; float start = p - halfTxlSize; float end = p + halfTxlSize; float coverage = (ceil(end * spacingINV) - floor(start * spacingINV)) * lineWidth; coverage -= min(lineWidth, mod(start, spacing)); coverage -= max(lineWidth - mod(end, spacing), 0.0); return coverage / txlSize; } `),A.draped||F.code.add(v.glsl`const int maxSamples = 5; float sampleAA(float p) { vec2 dxdy = abs(vec2(dFdx(p), dFdy(p))); float fwidth = dxdy.x + dxdy.y; ivec2 samples = 1 + ivec2(clamp(dxdy, 0.0, float(maxSamples - 1))); vec2 invSamples = 1.0 / vec2(samples); float accumulator = 0.0; for (int j = 0; j < maxSamples; j++) { if(j >= samples.y) { break; } for (int i = 0; i < maxSamples; i++) { if(i >= samples.x) { break; } vec2 step = vec2(i,j) * invSamples - 0.5; accumulator += coverage(p + step.x * dxdy.x + step.y * dxdy.y, fwidth); } } accumulator /= float(samples.x * samples.y); return accumulator; }`));A.transparencyPassType===r.TransparencyPassType.ColorAlpha&&(B.outputs.add("fragColor","vec4",0),B.outputs.add("fragAlpha","float",1));F.code.add(v.glsl` void main() { discardBySlice(vpos); ${C?"terrainDepthTest(depth);":""} vec4 color = vColor; color = highlightSlice(color, vpos); ${A.output!==b.ShaderOutput.Highlight?v.glsl`color.a *= ${y(A)};`:""} ${A.output===b.ShaderOutput.ObjectAndLayerIdColor?v.glsl`color.a = 1.0;`:""} if (color.a < ${v.glsl.float(e.symbolAlphaCutoff)}) { discard; } ${A.output===b.ShaderOutput.Color?v.glsl`fragColor = color; ${A.transparencyPassType===r.TransparencyPassType.ColorAlpha?v.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""}`:""} ${A.output===b.ShaderOutput.Highlight?v.glsl`outputHighlight();`:""} ${A.output===b.ShaderOutput.ObjectAndLayerIdColor?v.glsl`outputObjectAndLayerIdColor();`:""} } `);return B}function y(A){function B(C){return A.draped?v.glsl`coverage(vuv.${C}, texelSize)`:v.glsl`sampleAA(vuv.${C})`}switch(A.style){case u.Style.ForwardDiagonal:case u.Style.Horizontal:return B("y");case u.Style.BackwardDiagonal:case u.Style.Vertical:return B("x");case u.Style.DiagonalCross:case u.Style.Cross:return v.glsl` 1.0 - (1.0 - ${B("x")}) * (1.0 - ${B("y")}) `;default:return"0.0"}}const z=Object.freeze(Object.defineProperty({__proto__:null,build:x},Symbol.toStringTag,{value:"Module"}));a.Pattern=z;a.build=x})},"esri/views/3d/layers/graphics/Graphics3DTextSymbolLayer":function(){define("exports ../../../../core/Error ../../../../core/has ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../symbols/callouts/calloutUtils ./ElevationAligners ./elevationAlignmentUtils ./ElevationContext ./Graphics3DObject3DGraphicLayer ./Graphics3DObjectMetadata ./Graphics3DSymbolLayer ./graphicUtils ./LabelParameters ./placementUtils ./pointUtils ../../webgl-engine/lib/FontMetrics ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/lib/TextRenderParameters ../../webgl-engine/lib/TextTextureFactory ../../webgl-engine/materials/HUDMaterial".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){function C(E,G,I){E&&E.forEach(O=>{const L=G(O);null!=L&&I(L,O.graphic)})}function D(E,G){if("baseline"===G.verticalPlacement)return h.fromValues(n.horizontalPlacementToAnchorX[G.horizontalPlacement],null!=E?E.baselineAnchorY:0);E=n.anchorFromPlacements(G.horizontalPlacement,G.verticalPlacement);return n.namedAnchorToHUDMaterialAnchorPos[E]}const F=f.fromValues(0,0,1);class H extends v.Graphics3DSymbolLayer{constructor(E,G,I,O){super(E,G,I, O);this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1};this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const E=m.validateSymbolLayerSize(this.symbolLayer.size);if(E)throw new b("graphics3dtextsymbollayer:invalid-size",E);}await this._createTextRenderParameters()}async _createTextRenderParameters(){this._textRenderParameters=await z.TextRenderParameters.fromSymbol(this.symbolLayer,this._context.graphicsCoreOwner.view.state.rasterPixelRatio)}destroy(){super.destroy()}createGraphics3DGraphic(E){E= E.graphic;const G=u.placePointOnGeometry(E.geometry);if(null==G)return this.logger.warn(`unsupported geometry type for text symbol: ${E.geometry.type}`),null;const I=this.symbolLayer.text;if(null==I||""===I)return null;var O=c.hasCalloutSupport(this.symbol)&&this.symbol.hasVisibleVerticalOffset()?this.symbol.verticalOffset:null;if(null!=O&&!c.textSymbolLayerSupportsVerticalOffset(this.symbolLayer))return this.logger.errorOncePerTick("Callouts and vertical offset on text symbols are currently only supported with 'center' "+ `horizontal alignment (not with '${this.symbolLayer.horizontalAlignment}' alignment)`),null;var {verticalAlignment:L}=this.symbolLayer;O=new r.LabelPlacement(O);n.verticalScreenOffsetFromAlignment(L,O.screenOffset);L=new r.LabelParameters(O,this.symbolLayer.horizontalAlignment,n.verticalPlacementFromAlignment(L));return this._createAs3DShape(E,G,I,L)}createLabel(E,G,I,O,L){E=E.graphic;const P=u.placePointOnGeometry(E.geometry);if(null==P)return this.logger.warn(`unsupported geometry type for label: ${E.geometry.type}`), null;const M=G.text;return!M||/^\s+$/.test(M)?null:this._createAs3DShape(E,P,M,G,I,O,L)}setGraphicElevationContext(E,G,I=0){super.setGraphicElevationContext(E,G);G.addOffsetRenderUnits(I);return G}layerOpacityChanged(){this.logger.warn("layer opacity change not yet implemented in Graphics3DTextSymbolLayer");return!1}layerElevationInfoChanged(E,G){C(E,G,(I,O)=>{this.updateGraphicElevationContext(O,I)});return g.SymbolUpdateType.UPDATE}slicePlaneEnabledChanged(E,G){C(E,G,I=>{for(const O of I.stageObject.geometries)O.material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}); return!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return!1}updateGraphicElevationContext(E,G){const I=G.elevationContext;this.setGraphicElevationContext(E,I,null!=G.metadata?G.metadata.elevationOffset:0);G.needsElevationUpdates=g.needsElevationUpdates2D(I.mode)||"absolute-height"===I.mode}updateGeometry(E,G){if(this.draped||!this._validateGeometry(G))return!1;const {elevationContext:I,stageObject:O}=E;if(I.mode!==this.getGeometryElevationMode(G))return!1;G=u.placePointOnGeometry(G); if(!G)return!1;const L=u.updateStageObjectGeometry(O,this._context,G,I);if(null==L)return!1;const P=u.getLocalOriginForPoint(this._context,G);if(O.geometries[0].localOrigin!==P)return!1;E.alignedSampledElevation=L;u.extendPointGraphicElevationContext(E,G,this._context.elevationProvider);return!0}_defaultElevationInfoNoZ(){return N}_createAs3DShape(E,G,I,O,L=null,P=null,M=()=>O.placement.elevationOffset){const K=this.setGraphicElevationContext(E,new d.ElevationContext,O.placement.elevationOffset); var J="polyline"===E.geometry?.type,R=E.uid;let Q=null,W=null;if(null==P){var S=n.textRenderAlignmentFromHorizontalPlacement(O.horizontalPlacement);Q=new A(I,S,this._textRenderParameters);let Y=null;if(null!=this._context.sharedResources.textures){W=this._context.sharedResources.textures.fromData(Q.key,()=>Q.create());W.texture.events.on("unloaded",()=>Y=l.releaseMaybe(Y));S=this._context.stage.renderView.textures.acquire(W.texture.id);if(null==S||p.isPromiseLike(S))return W.release(),null;Y=S}}var V= D(Q,O);S={occlusionTest:!q("enable-feature:non-occluded-hud"),screenOffset:O.placement.screenOffset,anchorPosition:V,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:O.placement.centerOffsetUnits,drawInSecondSlot:!0};J&&(S.shaderPolygonOffset=1E-4);P?S.textureId=P.id:W&&(S.textureId=W.texture.id);if(null!=O.placement.verticalOffset){const {screenLength:Y,minWorldLength:ha,maxWorldLength:ba}=O.placement.verticalOffset;S.verticalOffset={screenLength:k.pt2px(Y),minWorldLength:ha||0,maxWorldLength:null!= ba?ba:Infinity}}P={screenOffset:S.screenOffset,anchorPosition:V,centerOffsetUnits:S.centerOffsetUnits,verticalOffset:S.verticalOffset,shaderPolygonOffset:S.shaderPolygonOffset};if(this._context.screenSizePerspectiveEnabled){const {screenSizePerspectiveSettings:Y,screenSizePerspectiveSettingsLabels:ha}=this._context.sharedResources;J=x.getFontMetrics(this._textRenderParameters);S.screenSizePerspective=ha.overrideFontHeight(J.maxHeight);S.screenSizePerspectiveAlignment=Y;P.fontHeight=J.maxHeight}S.hasSlicePlane= this._context.slicePlaneEnabled;J=(Y,ha,ba)=>{let U=Y.get(ba);null==U&&(U=new B.HUDMaterial(ha),Y.add(ba,U));return U};S=L?J(L,S,JSON.stringify(P)):new B.HUDMaterial(S);P=O.placement.translation;J=Q?h.fromValues(Q.displayWidth,Q.displayHeight):h.ZEROS;V=O.placement.centerOffset;const T=h.create();P=y.createPointGeometry(S,F,P,null,J,V,T,null);R=u.createStageObject(this._context,G,P,K,R);if(null==R)return null;L=new t.Graphics3DObject3DGraphicLayer(this,R.object,[P],null==L?[S]:null,W,(Y,ha,ba,U,Z, ca)=>{const ea=M()||O.placement.elevationOffset;ha=this.setGraphicElevationContext(E,ha,ea);return e.perObjectElevationAligner(Y,ha,ba,U,Z,ca)},K);L.alignedSampledElevation=R.sampledElevation;L.needsElevationUpdates=g.needsElevationUpdates2D(K.mode)||"absolute-height"===K.mode;L.getScreenSize=(Y=h.create())=>{Y[0]=Q?Q.displayWidth:O.displaySize[0];Y[1]=Q?Q.displayHeight:O.displaySize[1];return Y};I=new w.Graphics3DObjectMetadata(O.placement.elevationOffset,I);L.metadata=I;u.extendPointGraphicElevationContext(L, G,this._context.elevationProvider);return L}}const N={mode:"relative-to-ground",offset:0};a.Graphics3DTextSymbolLayer=H;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/LabelParameters":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a,b,q,l){class p{constructor(h,f="center",c=!1,e=b.create(),g=l.fromValues(0, 0,0,-1),d="world",t=q.create(),w=0){this.verticalOffset=h;this.anchor=f;this.hasLabelVerticalOffset=c;this.screenOffset=e;this.centerOffset=g;this.centerOffsetUnits=d;this.translation=t;this.elevationOffset=w}}class k{constructor(h,f="center",c="center",e=null,g=b.create()){this.placement=h;this.horizontalPlacement=f;this.verticalPlacement=c;this.text=e;this.displaySize=g}}a.LabelParameters=k;a.LabelPlacement=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextRenderParameters":function(){define("exports ../../../../Color ../../../../core/fontUtils ../../../../core/Logger ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec4f64".split(" "), function(a,b,q,l,p,k){function h(g){return`rgb(${g.slice(0,3).map(d=>Math.floor(255*d)).toString()})`}function f(g){return`rgba(${g.slice(0,3).map(d=>Math.floor(255*d)).toString()},${g[3]})`}class c{constructor(g){this.definition=g;this.key=JSON.stringify(g);this.haloSize=Math.round(g.halo.size);this.textStyle=f(g.color);this.haloStyle=h(g.halo.color);this.backgroundStyle=0!==g.background.color[3]?f(g.background.color):null}fontString(g){const d=this.definition.font;return`${d.style} ${d.weight} ${g}px ${d.family}, ${"sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"}`}setFontProperties(g, d){g.font=this.fontString(d);g.textAlign="left";g.textBaseline="alphabetic"}static async fromSymbol(g,d){var t=b.toUnitRGBA(g?.material?.color)??k.ZEROS,w=null!=g.size?p.pt2px(g.size):12;const v=g.lineHeight,m=null!=g.background?b.toUnitRGBA(g.background.color):k.ZEROS,r={family:g.font?.family??"sans-serif",decoration:g.font?.decoration??"none",weight:g.font?.weight??"normal",style:g.font?.style??"normal"};var n=g.halo;n=null!=n?.color&&0!q.isCachedFontFace(u))}catch(u){l.getLogger("esri.views.3d.webgl-engine.lib.TextRenderParameters").warnOnce(`Failed to preload font '${w}'. Some text symbology may be rendered using the default browser font.`)}if(!t&& !e.has(g.font.family))try{await q.loadFont(g.font)}catch(u){}}return d}}const e=new Set("Arial;Times New Roman;Courier New;serif;sans-serif;monospace;cursive;fantasy;system-ui;ui-serif;ui-sans-serif;ui-monospace;ui-rounded;math;emoji;fangsong".split(";"));a.TextRenderParameters=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextTextureFactory":function(){define(["./TextHelperCanvas","./TextRenderer","./TextTextureAtlas","./Texture","../../../webgl/enums"], function(a,b,q,l,p){class k{constructor(f,c,e){this._renderer=new b.TextRenderer(f,c,e,q.TextTextureAtlas.maxSize)}get key(){return this._renderer.key}get baselineAnchorY(){return 1-this._renderer.firstRenderedBaselinePosition/this._renderer.renderedHeight}get displayWidth(){return this._renderer.displayWidth}get displayHeight(){return this._renderer.displayHeight}create(){const f=a.getTextHelperCanvas(h,this._renderer.renderedWidth,this._renderer.renderedHeight),c=f.getContext("2d");c.save();this._renderer.render(c, 0,0);c.restore();return new l.Texture(f,{wrap:{s:p.TextureWrapMode.CLAMP_TO_EDGE,t:p.TextureWrapMode.CLAMP_TO_EDGE},noUnpackFlip:!1,mipmap:!0,preMultiplyAlpha:!0})}}const h={canvas:null};return k})},"esri/views/3d/webgl-engine/lib/TextTextureAtlas":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/has ../../../../core/maybe ../../../../core/uid ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ./ContentObjectType ./testUtils ./textureUtils ./VertexAttribute ../../../support/Scheduler ../../../support/Yield ../../../webgl/enums ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(H,N){H.geometries[0].setAttributeData(r.VertexAttribute.UV0,N.uv);H.geometryVertexAttributeUpdated(H.geometries[0],r.VertexAttribute.UV0,!0)}a.TextTextureAtlas=class extends q{constructor(H){super(H);this.type=w.ContentObjectType.Texture;this.id=h.generateUID();this.events=new l;this._glTexture=null;this._atlas=new C(256,256);this._needsRepack=!1;this._canRepack=!0;this._elementsToRender=new Map;this._elements=new Map;this._stageObjects= new Map;this.updating=!1}initialize(){this._canvas=document.createElement("canvas");this._canvas.setAttribute("id","textAtlasCanvas");this._canvas.setAttribute("style","display:none");this._ctx=this._canvas.getContext("2d");this._stage=this.view._stage;this._stage.add(this);this._updateCanvasElementSize(this._atlas);this._reset()}unload(){this._glTexture=k.disposeMaybe(this._glTexture);this.updating=!1;this.events.emit("unloaded")}get glTexture(){return this._glTexture}static get maxSize(){F=v.textTextureAtlas.stableRendering? 2:0;return[4094-F,4094-F-2]}load(H){if(this._glTexture)return this._glTexture;const N=new z.TextureDescriptor;N.wrapMode=x.TextureWrapMode.CLAMP_TO_EDGE;N.samplingMode=x.TextureSamplingMode.LINEAR_MIPMAP_LINEAR;N.hasMipmap=!0;N.preMultiplyAlpha=!0;N.maxAnisotropy=H.parameters.maxMaxAnisotropy;this._glTexture=new y.Texture(H,N,this._canvas);this._frameWorker=this.view.resourceController.scheduler.registerTask(n.TaskPriority.TEXT_TEXTURE_ATLAS,this);this.setDirty();return this._glTexture}dispose(){this._elements.clear(); this._elementsToRender.clear();this._frameWorker=k.removeMaybe(this._frameWorker);this._glTexture&&(this._stage.remove(this),this._glTexture=k.disposeMaybe(this._glTexture));this._canvas.width=0;this._canvas.height=0;this._ctx=this._canvas=null}_updateCanvasElementSize(H){this._canvas.setAttribute("width",H.width.toString());this._canvas.setAttribute("height",H.height.toString())}_resizeAtlas(H,N){const {width:E,height:G}=this._atlas;if(E!==H||G!==N)this._atlas.width=H,this._atlas.height=N,this._glTexture?.resize(H, N),this._glTexture?.updateData(0,0,0,E,G,this._canvas),this._updateCanvasElementSize(this._atlas),this._elements.forEach(I=>{this._stageObjects.get(I.textRenderer.key)?.forEach(O=>A(O,I))}),this._reset()}_reset(){this._elementsToRender.clear();this._atlas.reset();this._needsRepack=!0;this.setDirty()}_addAtlasElement(H,N,E,G){const I=this._atlas;if(I.width I.width>=P.x+E);if(null==L){if(I.heightE.height? this._resizeAtlas(E.width,G):4096>E.width&&(G=Math.min(m.applyTextureResizeModulo(1.5*E.width),4096),this._resizeAtlas(G,E.height))),this._elements.set(N,H))}}_renderElement(H){const N=H.commitNewPosition(),E=H.textRenderer;this._ctx.clearRect(N[0]-2,N[1]-2,E.renderedWidth+4,E.renderedHeight+4);E.render(this._ctx,N[0],N[1]);this._stageObjects.get(E.key)?.forEach(G=>A(G,H))}get running(){return this.updating}runTask(H){if(null==this._glTexture)return u.Yield;for(;this._needsRepack&&(this._canRepack|| 4096>this._atlas.height&&4096>this._atlas.height);){this._canRepack=this._needsRepack=!1;const N=this._elements;this._elements=new Map;N.forEach(E=>this._processAddition(E));H.madeProgress()}if(0O||this.needsDrivenTransparentPass;I.waveDirection=null!=this.symbolLayer.waveDirection?C.headingVectorFromAngle(this.symbolLayer.waveDirection):k.fromValues(0,0);O=z.wavePresets[this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize];I.waveStrength=O.waveStrength;I.waveTextureRepeat=O.textureRepeat;I.waveVelocity=O.waveVelocity;I.flowStrength=O.perturbationStrength;I.hasSlicePlane= this._context.slicePlaneEnabled;I.draped=this.draped;this._materials[0]=new y.WaterMaterial(I);this._context.stage.add(this._materials[0])}}layerOpacityChanged(){if(null!=this._materials[0]){var I=this._materials[0].parameters.color,O=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0});this._materials[0].setParameters({color:[I[0],I[1],I[2],O],transparent:1>O||this.needsDrivenTransparentPass})}}layerElevationInfoChanged(I,O,L){const P=this._elevationContext.mode;L=t.elevationModeChangeUpdateType(C.elevationModeChangeTypes, L,P);if(L!==t.SymbolUpdateType.UPDATE)return L;const M=t.needsElevationUpdates2D(P);return this.updateGraphics3DGraphicElevationInfo(I,O,()=>M)}slicePlaneEnabledChanged(){this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(I,O,L){const P=r.geometryAsPolygon(I.geometry);if(null==P)return null;const M=n.geometryToRenderInfo(P,this._context.elevationProvider,this._context.renderCoordsHelper,O),K=M.position.length/ 3,J=g.newDoubleArray(2*K);A(J,M.mapPositions,K,this._context.elevationProvider.spatialReference);I=new E(M,J,this._context.layer.uid,I.uid);I.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(I);this._create3DShapeGeometries(I);this._logGeometryCreationWarnings(I.renderData,P.rings,"rings","WaterSymbol3DLayer");if(0===I.outGeometries.length)return null;L=new u.Object3D({geometries:I.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:L});L=new v.Graphics3DObject3DGraphicLayer(this, L,I.outGeometries,null,null,d.perVertexElevationAligner,O);L.alignedSampledElevation=I.renderData.sampledElevation;L.needsElevationUpdates=t.needsElevationUpdates2D(O.mode);return L}_create3DShapeGeometries(I){var O=I.renderData.polygons;const L=I.uvCoords;for(const {count:P,index:M,position:K,mapPositions:J,holeIndices:R}of O){if(null!=this._context.clippingExtent&&(c.empty(N),c.expandWithBuffer(N,J),!c.intersectsClippingArea(N,this._context.clippingExtent)))continue;O=l.earcut(J,R,3);if(0===O.length)continue; const Q=g.doubleSubArray(L,2*M,2*P);O=r.createWaterGeometry({material:this._materials[0],indices:O,mapPositions:J,attributeData:{position:K,uv0:Q}},I.objectAndLayerIdColor);I.outGeometries.push(O)}}_createAsOverlay(I){const O=r.geometryAsPolygon(I.geometry);if(null==O)return null;this._materials[0].renderPriority=this._renderPriority;const L=n.geometryToRenderInfoDraped(O,this._context.overlaySR),P=L.position.length/3,M=g.newDoubleArray(2*P);A(M,L.position,P,this._context.overlaySR);I=new G(L,M,this._context.layer.uid, I.uid);I.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(I);I.outBoundingBox=c.empty();this._createAsOverlayWater(I);this._logGeometryCreationWarnings(I.renderData,O.rings,"rings","WaterSymbol3DLayer");return 0===I.outGeometries.length?null:new w.Graphics3DDrapedGraphicLayer(this,I.outGeometries,I.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayWater(I){const O=I.uvCoords;var L=I.renderData.polygons;for(const {position:P,holeIndices:M,index:K,count:J}of L){c.empty(N); c.expandWithBuffer(N,P);if(!c.intersectsClippingArea(N,this._context.clippingExtent))continue;c.expandWithAABB(I.outBoundingBox,N);L=l.earcut(P,M,3);if(0===L.length)continue;const R=g.doubleSubArray(O,2*K,2*J);L=r.createWaterGeometry({material:this._materials[0],indices:L,attributeData:{position:P,uv0:R}},I.objectAndLayerIdColor);I.outGeometries.push(new x.RenderGeometry(L,I))}}static headingVectorFromAngle(I){const O=k.create();I=f.toRadian(I);O[0]=Math.sin(I);O[1]=Math.cos(I);return O}test(){return{...super.test(), create3DShape:I=>this._createAs3DShape(I.graphic,I.elevationContext,I.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}C.unitSizeOfTexture=100;C.elevationModeChangeTypes={definedChanged:t.SymbolUpdateType.RECREATE,staysOnTheGround:t.SymbolUpdateType.NONE,onTheGroundChanged:t.SymbolUpdateType.RECREATE};const D=k.create(),F=e.create(),H=k.create(),N=c.create();class E extends r.PolygonCreationDataBase{constructor(I,O,L,P){super(I,L,P);this.uvCoords=O}}class G extends r.PolygonCreationDataBase{constructor(I, O,L,P){super(I,L,P);this.uvCoords=O}}a.Graphics3DWaterSymbolLayer=C;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/WaterMaterial":function(){define("exports ../../../../core/has ../../../../core/time ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../core/shaderLibrary/ShaderOutput ../lib/AnimationTimer ../lib/Material ../lib/OrderIndependentTransparency ../lib/RenderSlot ./DefaultBufferWriter ./DefaultLayouts ./TriangleMaterial ./WaterGLMaterial ./WaterTechnique".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){class r extends w.TriangleMaterial{constructor(u){super(u,new n);this._configuration=new m.WaterTechniqueConfiguration;this._animation=new f.AnimationTimer;this.produces=new Map([[g.RenderSlot.OPAQUE_MATERIAL,x=>h.isColor(x)&&!this.parameters.transparent||h.isOIDorHighlight(x)],[g.RenderSlot.TRANSPARENT_MATERIAL,x=>h.isColor(x)&&this.parameters.transparent||h.isOIDorHighlight(x)],[g.RenderSlot.DRAPED_MATERIAL,x=>this.parameters.draped&&x===h.ShaderOutput.Color|| h.isOIDorHighlight(x)],[g.RenderSlot.DRAPED_WATER,x=>x===h.ShaderOutput.Normal]])}getConfiguration(u,x){this._configuration.output=u;this._configuration.writeDepth=!0;this._configuration.receiveShadows=this.parameters.receiveShadows;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.transparent=this.parameters.transparent;this._configuration.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections;this._configuration.hasCloudsReflections=this.parameters.hasCloudsReflections; this._configuration.draped=this.parameters.draped;this._configuration.transparencyPassType=x.transparencyPassType;this._configuration.enableOffset=x.camera.relativeElevationMath.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*Math.min(u.camera.relativeElevation, u.camera.distance);u=this._animation.advance(u);this.setParameters({timeElapsed:q.secondsFromMilliseconds(this._animation.time)*this.parameters.animationSpeed},!1);return this._animation.enabled&&u}createGLMaterial(u){return new v.WaterGLMaterial(u)}createBufferWriter(){return new d.DefaultBufferWriter(b("enable-feature:objectAndLayerId-rendering")?t.PositionUVLayoutObjectAndLayerId:t.PositionUVLayout)}get test(){}}class n extends c.MaterialParameters{constructor(){super(...arguments);this.waveStrength= .06;this.waveTextureRepeat=32;this.waveDirection=l.fromValues(1,0);this.waveVelocity=.05;this.flowStrength=.015;this.flowOffset=-.5;this.animationSpeed=.35;this.timeElapsed=0;this.color=k.fromValues(0,0,0,0);this.transparent=!0;this.draped=this.hasSlicePlane=!1;this.receiveShadows=!0;this.hasCloudsReflections=this.hasScreenSpaceReflections=!1;this.origin=p.create();this.modelTransformation=null}}a.WaterMaterial=r;a.WaterMaterialParameters=n;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/materials/WaterGLMaterial":function(){define(["exports","../core/shaderLibrary/ShaderOutput","../lib/GLMaterial","./WaterTechnique"],function(a,b,q,l){class p extends q{_updateShadowState(k){k.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:k.shadowMap.enabled})}_updateSSRState(k){k=null!=k.ssr.lastFrameColor;k!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:k})}_updateCloudsReflectionState(k){k= null!=k.cloudsFade.data;k!==this._material.parameters.hasCloudsReflections&&this._material.setParameters({hasCloudsReflections:k})}ensureResources(k){return this._techniques.constructionContext.waterTextures.ensureResources(k)}beginSlot(k){this._output===b.ShaderOutput.Color&&(this._updateShadowState(k),this._updateSSRState(k),this._updateCloudsReflectionState(k));this._material.setParameters(this._techniques.constructionContext.waterTextures.passParameters);return this.ensureTechnique(l.WaterTechnique, k)}}a.WaterGLMaterial=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/WaterTechnique":function(){define("require exports ../../../../chunks/tslib.es6 ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../core/shaderLibrary/shading/WaterDistortion.glsl ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../lib/TransparencyPassType ./DefaultTechniqueConfiguration ../../../../chunks/WaterSurface.glsl ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){class n extends h.WaterDistortionPassParameters{}class u extends c.ShaderTechnique{initializeConfiguration(y,z){z.spherical=y.viewingMode===l.ViewingMode.Global;z.doublePrecisionRequiresObfuscation=y.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(y){return new t.Program(y.rctx,u.shader.get().build(this.configuration),g.Default3D)}_setPipelineState(y){const z=this.configuration,A=y===w.TransparencyPassType.NONE,B=y===w.TransparencyPassType.FrontFace; return r.makePipelineState({blending:z.output!==p.ShaderOutput.Normal&&z.output!==p.ShaderOutput.Highlight&&z.output!==p.ShaderOutput.ObjectAndLayerIdColor&&z.transparent?A?d.blendingDefault:d.oitBlending(y):null,depthTest:z.draped?null:{func:d.oitDepthTest(y)},depthWrite:z.draped?null:A?z.writeDepth?r.defaultDepthWriteParams:null:d.oitDepthWrite(y),drawBuffers:d.oitDrawBuffers(y),colorWrite:r.defaultColorWriteParams,polygonOffset:A||B?null:d.getOITPolygonOffset(z.enableOffset)})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}} u.shader=new f.ReloadableShaderModule(m.WaterSurface,()=>new Promise((y,z)=>a(["../shaders/WaterSurface.glsl"],y,z)));class x extends v.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=p.ShaderOutput.Color;this.transparencyPassType=w.TransparencyPassType.NONE;this.transparent=this.hasSlicePlane=this.receiveShadows=this.spherical=!1;this.enableOffset=!0;this.cullAboveGround=this.multipassEnabled=this.draped=this.objectAndLayerIdColorInstanced=this.hasCloudsReflections=this.doublePrecisionRequiresObfuscation= this.hasScreenSpaceReflections=this.writeDepth=!1}}q.__decorate([e.parameter({count:p.ShaderOutput.COUNT})],x.prototype,"output",void 0);q.__decorate([e.parameter({count:w.TransparencyPassType.COUNT})],x.prototype,"transparencyPassType",void 0);q.__decorate([e.parameter()],x.prototype,"spherical",void 0);q.__decorate([e.parameter()],x.prototype,"receiveShadows",void 0);q.__decorate([e.parameter()],x.prototype,"hasSlicePlane",void 0);q.__decorate([e.parameter()],x.prototype,"transparent",void 0);q.__decorate([e.parameter()], x.prototype,"enableOffset",void 0);q.__decorate([e.parameter()],x.prototype,"writeDepth",void 0);q.__decorate([e.parameter()],x.prototype,"hasScreenSpaceReflections",void 0);q.__decorate([e.parameter()],x.prototype,"doublePrecisionRequiresObfuscation",void 0);q.__decorate([e.parameter()],x.prototype,"hasCloudsReflections",void 0);q.__decorate([e.parameter()],x.prototype,"objectAndLayerIdColorInstanced",void 0);q.__decorate([e.parameter()],x.prototype,"draped",void 0);q.__decorate([e.parameter()], x.prototype,"multipassEnabled",void 0);q.__decorate([e.parameter()],x.prototype,"cullAboveGround",void 0);q.__decorate([e.parameter({constValue:!1})],x.prototype,"occlusionPass",void 0);q.__decorate([e.parameter({constValue:k.PBRMode.Water})],x.prototype,"pbrMode",void 0);q.__decorate([e.parameter({constValue:!0})],x.prototype,"useCustomDTRExponentForWater",void 0);q.__decorate([e.parameter({constValue:!0})],x.prototype,"highStepCount",void 0);q.__decorate([e.parameter({constValue:!1})],x.prototype, "useFillLights",void 0);b.WaterMaterialPassParameters=n;b.WaterTechnique=u;b.WaterTechniqueConfiguration=x;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/vec2 ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ./FoamRendering.glsl ./ReadShadowMap.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/Float4PassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){class d extends h.ReadShadowMapPassParameters{}const t=p.create(),w=q.create();a.WaterDistortion=function(v){v.fragment.uniforms.add(new g.Texture2DPassUniform("texWaveNormal",m=>m.waveNormal),new g.Texture2DPassUniform("texWavePerturbation",m=>m.wavePerturbation),new c.Float4PassUniform("waveParams",m=>l.set(t,m.waveStrength,m.waveTextureRepeat,m.flowStrength,m.flowOffset)),new f.Float2PassUniform("waveDirection",m=>b.set(w,m.waveDirection[0]*m.waveVelocity,m.waveDirection[1]* m.waveVelocity)));v.include(k.FoamIntensity);v.fragment.code.add(e.glsl`const vec2 FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0); vec2 textureDenormalized2D(sampler2D _tex, vec2 _uv) { return 2.0 * texture(_tex, _uv).rg - 1.0; } float sampleNoiseTexture(vec2 _uv) { return texture(texWavePerturbation, _uv).b; } vec3 textureDenormalized3D(sampler2D _tex, vec2 _uv) { return 2.0 * texture(_tex, _uv).rgb - 1.0; } float computeProgress(vec2 uv, float time) { return fract(time); } float computeWeight(vec2 uv, float time) { float progress = computeProgress(uv, time); return 1.0 - abs(1.0 - 2.0 * progress); } vec3 computeUVPerturbedWeigth(sampler2D texFlow, vec2 uv, float time, float phaseOffset) { float flowStrength = waveParams[2]; float flowOffset = waveParams[3]; vec2 flowVector = textureDenormalized2D(texFlow, uv) * flowStrength; float progress = computeProgress(uv, time + phaseOffset); float weight = computeWeight(uv, time + phaseOffset); vec2 result = uv; result -= flowVector * (progress + flowOffset); result += phaseOffset; result += (time - progress) * FLOW_JUMP; return vec3(result, weight); } const float TIME_NOISE_TEXTURE_REPEAT = 0.3737; const float TIME_NOISE_STRENGTH = 7.77; vec3 getWaveLayer(sampler2D _texNormal, sampler2D _dudv, vec2 _uv, vec2 _waveDir, float time) { float waveStrength = waveParams[0]; vec2 waveMovement = time * -_waveDir; float timeNoise = sampleNoiseTexture(_uv * TIME_NOISE_TEXTURE_REPEAT) * TIME_NOISE_STRENGTH; vec3 uv_A = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.0); vec3 uv_B = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.5); vec3 normal_A = textureDenormalized3D(_texNormal, uv_A.xy) * uv_A.z; vec3 normal_B = textureDenormalized3D(_texNormal, uv_B.xy) * uv_B.z; vec3 mixNormal = normalize(normal_A + normal_B); mixNormal.xy *= waveStrength; mixNormal.z = sqrt(1.0 - dot(mixNormal.xy, mixNormal.xy)); return mixNormal; } vec4 getSurfaceNormalAndFoam(vec2 _uv, float _time) { float waveTextureRepeat = waveParams[1]; vec3 normal = getWaveLayer(texWaveNormal, texWavePerturbation, _uv * waveTextureRepeat, waveDirection, _time); float foam = normals2FoamIntensity(normal, waveParams[0]); return vec4(normal, foam); }`)};a.WaterDistortionPassParameters=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/WaterSurface.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){function C(F){const H=new z.ShaderBuilder,{vertex:N,fragment:E}=H;n.addProjViewLocalOrigin(N,F);H.include(p.Transform,F);H.attributes.add(B.VertexAttribute.POSITION,"vec3");H.attributes.add(B.VertexAttribute.UV0,"vec2");const G=new u.Float4PassUniform("waterColor",I=>I.color);if(F.output===q.ShaderOutput.Color&&F.draped)return H.varyings.add("vpos","vec3"),N.uniforms.add(G),N.code.add(y.glsl` void main(void) { if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) { // Discard this vertex gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } vpos = position; gl_Position = transformPosition(proj, view, vpos); } `),E.uniforms.add(G),E.code.add(y.glsl`void main() { fragColor = waterColor; }`),H;F.output===q.ShaderOutput.Color&&(H.include(g.NormalUtils,F),H.include(b.ForwardLinearDepth,F),H.varyings.add("vuv","vec2"),H.varyings.add("vpos","vec3"),H.varyings.add("vnormal","vec3"),H.varyings.add("vtbnMatrix","mat3"),F.multipassEnabled&&H.varyings.add("depth","float"),N.uniforms.add(G),N.code.add(y.glsl` void main(void) { if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) { // Discard this vertex gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } vuv = uv0; vpos = position; vnormal = getLocalUp(vpos, localOrigin); vtbnMatrix = getTBNMatrix(vnormal); ${F.multipassEnabled?"depth \x3d (view * vec4(vpos, 1.0)).z;":""} gl_Position = transformPosition(proj, view, vpos); ${F.output===q.ShaderOutput.Color?"forwardLinearDepth();":""} } `));H.include(e.multipassTerrainTest,F);switch(F.output){case q.ShaderOutput.Color:H.include(c.MainLighting);H.include(f.EvaluateAmbientLighting,{pbrMode:d.PBRMode.Disabled,lightingSphericalHarmonicsOrder:2});H.include(v.WaterDistortion);H.include(l.SliceDraw,F);H.include(t.ReadShadowMapDraw,F);H.include(w.Water,F);E.uniforms.add(G,new x.FloatPassUniform("timeElapsed",I=>I.timeElapsed),N.uniforms.get("view"),N.uniforms.get("localOrigin"));n.addCameraPosition(E,F);E.include(r.ColorConversion); F.transparencyPassType===A.TransparencyPassType.ColorAlpha&&(H.outputs.add("fragColor","vec4",0),H.outputs.add("fragAlpha","float",1));c.addMainLightDirection(E);c.addMainLightIntensity(E);E.code.add(y.glsl` void main() { discardBySlice(vpos); ${F.multipassEnabled?"terrainDepthTest(depth);":""} vec3 localUp = vnormal; // the created normal is in tangent space vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed); // we rotate the normal according to the tangent-bitangent-normal-Matrix vec3 n = normalize(vtbnMatrix * tangentNormalFoam.xyz); vec3 v = -normalize(vpos - cameraPosition); float shadow = ${F.receiveShadows?y.glsl`1.0 - readShadowMap(vpos, linearDepth)`:"1.0"}; vec4 vPosView = view * vec4(vpos, 1.0); vec4 final = vec4(getSeaColor(n, v, mainLightDirection, waterColor.rgb, mainLightIntensity, localUp, shadow, tangentNormalFoam.w, vPosView.xyz, vpos + localOrigin), waterColor.w); // gamma correction fragColor = delinearizeGamma(final); fragColor = highlightSlice(fragColor, vpos); ${F.transparencyPassType===A.TransparencyPassType.ColorAlpha?y.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""} } `);break;case q.ShaderOutput.Normal:H.include(g.NormalUtils,F);H.include(v.WaterDistortion,F);H.include(l.SliceDraw,F);H.varyings.add("vpos","vec3");H.varyings.add("vuv","vec2");N.uniforms.add(G);N.code.add(y.glsl` void main(void) { if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) { // Discard this vertex gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } vuv = uv0; vpos = position; gl_Position = transformPosition(proj, view, vpos); } `);E.uniforms.add(new x.FloatPassUniform("timeElapsed",I=>I.timeElapsed));E.code.add(y.glsl`void main() { discardBySlice(vpos); vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed); tangentNormalFoam.xyz = normalize(tangentNormalFoam.xyz); fragColor = vec4((tangentNormalFoam.xyz + vec3(1.0)) * 0.5, tangentNormalFoam.w); }`);break;case q.ShaderOutput.Highlight:H.include(h.OutputHighlight,F);H.varyings.add("vpos","vec3");N.uniforms.add(G);N.code.add(y.glsl` void main(void) { if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) { // Discard this vertex gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } vpos = position; gl_Position = transformPosition(proj, view, vpos); } `);H.include(l.SliceDraw,F);E.code.add(y.glsl`void main() { discardBySlice(vpos); outputHighlight(); }`);break;case q.ShaderOutput.ObjectAndLayerIdColor:H.include(k.ObjectAndLayerIdColor,F),H.varyings.add("vpos","vec3"),N.uniforms.add(G),N.code.add(y.glsl` void main(void) { if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) { // Discard this vertex gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } vpos = position; gl_Position = transformPosition(proj, view, vpos); forwardObjectAndLayerIdColor(); } `),H.include(l.SliceDraw,F),E.code.add(y.glsl`void main() { discardBySlice(vpos); outputObjectAndLayerIdColor(); }`)}return H}const D=Object.freeze(Object.defineProperty({__proto__:null,build:C},Symbol.toStringTag,{value:"Module"}));a.WaterSurface=D;a.build=C})},"esri/views/3d/webgl-engine/materials/internal/waterMaterialUtils":function(){define(["exports"],function(a){a.wavePresets={"calm-small":{waveStrength:.005,perturbationStrength:.02,textureRepeat:12,waveVelocity:.01},"rippled-small":{waveStrength:.02,perturbationStrength:.09,textureRepeat:32,waveVelocity:.07},"slight-small":{waveStrength:.05,perturbationStrength:.07, textureRepeat:28,waveVelocity:.1},"moderate-small":{waveStrength:.075,perturbationStrength:.07,textureRepeat:24,waveVelocity:.1},"calm-medium":{waveStrength:.003125,perturbationStrength:.01,textureRepeat:8,waveVelocity:.02},"rippled-medium":{waveStrength:.035,perturbationStrength:.015,textureRepeat:12,waveVelocity:.07},"slight-medium":{waveStrength:.06,perturbationStrength:.015,textureRepeat:8,waveVelocity:.12},"moderate-medium":{waveStrength:.09,perturbationStrength:.03,textureRepeat:4,waveVelocity:.12}, "calm-large":{waveStrength:.01,perturbationStrength:0,textureRepeat:4,waveVelocity:.05},"rippled-large":{waveStrength:.025,perturbationStrength:.01,textureRepeat:8,waveVelocity:.11},"slight-large":{waveStrength:.06,perturbationStrength:.02,textureRepeat:3,waveVelocity:.13},"moderate-large":{waveStrength:.14,perturbationStrength:.03,textureRepeat:2,waveVelocity:.15}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DWebStyleSymbol":function(){define(["exports", "./defaultSymbolComplexity","./interfaces","./Loadable"],function(a,b,q,l){class p extends l.Loadable{constructor(k,h,f){super(h);this.symbol=k;this._convert=f;this.symbologySnappingSupported=!1;this.graphics3DSymbol=null;this.referenced=0}getSymbolLayerSize(k){return null!=this.graphics3DSymbol?this.graphics3DSymbol.getSymbolLayerSize(k):null}get symbolLayers(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.symbolLayers:[]}get extentPadding(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.extentPadding: 0}async doLoad(k){k=await this.symbol.fetchSymbol({signal:k});k.id=this.symbol.id;this.graphics3DSymbol=this._convert(k);null!=this.graphics3DSymbol&&await this.graphics3DSymbol.load()}createGraphics3DGraphic(k){return null!=this.graphics3DSymbol?this.graphics3DSymbol.createGraphics3DGraphic(k,this):null}get complexity(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.complexity:b.emptySymbolComplexity}globalPropertyChanged(k,h){return null!=this.graphics3DSymbol?this.graphics3DSymbol.globalPropertyChanged(k, h):!1}applyRendererDiff(k,h){return null!=this.graphics3DSymbol?this.graphics3DSymbol.applyRendererDiff(k,h):q.ApplyRendererDiffResult.RecreateSymbol}prepareSymbolPatch(k){null!=this.graphics3DSymbol&&this.graphics3DSymbol.prepareSymbolPatch(k)}updateGeometry(k,h){return null!=this.graphics3DSymbol?this.graphics3DSymbol.updateGeometry(k,h):!1}updateTransform(k,h,f,c){return this.graphics3DSymbol?.updateTransform(k,h,f,c)??!1}onRemoveGraphic(){}getFastUpdateStatus(){return null!=this.graphics3DSymbol? this.graphics3DSymbol.getFastUpdateStatus():{loading:1,fast:0,slow:0}}destroy(){null!=this.graphics3DSymbol&&this.graphics3DSymbol.destroy();this.graphics3DSymbol=void 0;super.destroy()}get destroyed(){return void 0===this.graphics3DSymbol}}a.Graphics3DWebStyleSymbol=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/labelPlacement":function(){define("exports ../../../../core/has ../../../../core/Logger ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ./constants ./graphicSymbolUtils ./LabelParameters ../../webgl-engine/lib/TextRenderer ../../webgl-engine/materials/HUDMaterial".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(B){B=f.getGraphics3DSymbol(B.graphics3DGraphic.graphics3DSymbol);return null!=B?B.symbol.symbolLayers.at(0):null}function t(B,C){var D=C.graphics3DGraphic.graphic.geometry;if(null==D)return null;if(null!=C.disablePlacement)return C.labelClass.labelPlacement?(u().warnOncePerTick(w(B?.placement,C.disablePlacement.logEntityDescription)),v(C)):B;D=D.type;switch(D){case "polyline":case "polygon":case "extent":case "multipoint":if(C.labelClass.labelPlacement)return u().warnOncePerTick(w(B?.placement, `'${D}' geometries`)),v(C)}return B}function w(B,C){return`the requested label placement '${B}' is currently unsupported for ${C} in SceneView.`}function v(B){const C=B.graphics3DGraphic.graphic.geometry;if(null==C)return null;switch(C.type){case "polyline":case "extent":case "multipoint":return{placement:"center-center",normalizedOffset:p.ZEROS,anchor:"center"};case "polygon":return B=d(B),null!=B&&"extrude"===B.type?y["above-center"]:{placement:"center-center",normalizedOffset:p.ZEROS,anchor:"center"}; case "point":return y["above-center"];case "mesh":return y["above-center"]}}function m(B,C=z){({graphics3DGraphic:B}=B);(B=B.layers[0]?.stageObject.geometries[0].material??null)&&B instanceof g.HUDMaterial?(B=B.parameters.anchorPosition,C[0]=2*(B[0]-.5),C[1]=2*(B[1]-.5)):(C[0]=0,C[1]=0);return C}function r(B,C,D){D=null!=D?D.getBoundingBoxObjectSpace(A):A;D=p.fromValues(D[3]-D[0],D[4]-D[1],D[5]-D[2]);B.centerOffset[0]=Math.sqrt(D[0]*D[0]+D[1]*D[1])/2*C.normalizedOffset[0];const F=B.translation[2], H=D[2]/2*C.normalizedOffset[1];B.translation[2]=0;B.elevationOffset=F+H;D=l.length(D);B.centerOffset[2]=D/2*C.normalizedOffset[2]}function n(B){const C=B.labelClass.labelPlacement,{labelSymbol:D,graphics3DGraphic:F}=B;var H=f.getGraphics3DSymbol(F.graphics3DSymbol);H="point-3d"===H?.symbol.type?H.symbol:null;B=y[C]||v(B);if(null!=H&&H.supportsCallout()&&H.hasVisibleVerticalOffset()&&!F.isDraped)return{placement:null,hasLabelVerticalOffset:!1,verticalOffset:H.verticalOffset.clone(),anchor:null,normalizedOffset:null}; if(D&&D.hasVisibleVerticalOffset()&&(null==H||!H.supportsCallout()||!H.verticalOffset||F.isDraped)){if(!(H=!B)){a:switch(B.placement){case "above-center":H=!0;break a;default:H=!1}H=!H}return H?(u().errorOncePerTick("Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with "+C+" placement)"),null):{placement:"above-center",verticalOffset:D.verticalOffset.clone(),anchor:"bottom",normalizedOffset:[0,B.normalizedOffset[1],0],hasLabelVerticalOffset:!0}}return{placement:null, verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}}const u=()=>q.getLogger("esri.views.3d.layers.graphics.labelPlacement");class x{constructor(B,C,D,F=null){this.graphics3DGraphic=B;this.labelSymbol=C;this.labelClass=D;this.disablePlacement=F}}const y={"above-center":{placement:"above-center",normalizedOffset:[0,1,0],anchor:"bottom"},"above-left":{placement:"above-left",normalizedOffset:[-1,1,0],anchor:"bottom-right"},"above-right":{placement:"above-right",normalizedOffset:[1, 1,0],anchor:"bottom-left"},"below-center":{placement:"below-center",normalizedOffset:[0,-1,2],anchor:"top"},"below-left":{placement:"below-left",normalizedOffset:[-1,-1,0],anchor:"top-right"},"below-right":{placement:"below-right",normalizedOffset:[1,-1,0],anchor:"top-left"},"center-center":{placement:"center-center",normalizedOffset:[0,0,1],anchor:"center"},"center-left":{placement:"center-left",normalizedOffset:[-1,0,0],anchor:"right"},"center-right":{placement:"center-right",normalizedOffset:[1, 0,0],anchor:"left"}};b={"above-center":["default","esriServerPointLabelPlacementAboveCenter"],"above-left":["esriServerPointLabelPlacementAboveLeft"],"above-right":["esriServerPointLabelPlacementAboveRight"],"below-center":["esriServerPointLabelPlacementBelowCenter"],"below-left":["esriServerPointLabelPlacementBelowLeft"],"below-right":["esriServerPointLabelPlacementBelowRight"],"center-center":["esriServerPointLabelPlacementCenterCenter"],"center-left":["esriServerPointLabelPlacementCenterLeft"], "center-right":["esriServerPointLabelPlacementCenterRight"]};for(const B in b){const C=y[B];b[B].forEach(D=>{y[D]=C})}Object.freeze&&(Object.freeze(y),Object.keys(y).forEach(B=>{Object.freeze(y[B]);Object.freeze(y[B]?.normalizedOffset)}));const z=[0,0],A=k.create();a.LabelInfo=x;a.getLabelPlacement=function(B){var C=n(B);if(null==C)return null;if(C.anchor)var D=C;else{D=B.labelClass.labelPlacement;var F=y[D],H=F||v(B);D&&!F&&u().warnOncePerTick(`the requested label placement '${D}' is currently unsupported in SceneView.`); D=t(H,B)}if(null==D)return null;C=new c.LabelPlacement(C.verticalOffset,D.anchor,!!C.hasLabelVerticalOffset);F=B.graphics3DGraphic.graphic.geometry;if(null==F)B=null;else{switch(F.type){case "point":case "mesh":H=d(B);if(null!=H)switch(F=B.graphics3DGraphic.layers[0],null!=F?F.getCenterObjectSpace(C.translation):l.set(C.translation,0,0,0),H.type){case "icon":case "text":({graphics3DGraphic:H}=B);F=null!=F?F.getScreenSize():null;H.isDraped||null==F?C.hasLabelVerticalOffset||"center"===C.anchor||(y[B.labelClass.labelPlacement]&& u().warnOncePerTick(`the requested placement '${D.placement}' is currently unsupported for draped graphics`),C.anchor="center"):(B=m(B),C.screenOffset[0]=F[0]/2*(D.normalizedOffset[0]-B[0]),B=F[1]/2*(D.normalizedOffset[1]-B[1]),C.hasLabelVerticalOffset?(C.centerOffset[1]=B,C.centerOffsetUnits="screen"):C.screenOffset[1]=B);break;case "object":case "fill":r(C,D,F)}break;case "polygon":if(F=d(B),null!=F)switch(F.type){case "extrude":B=B.graphics3DGraphic.layers[0],null!=B?(B.getBoundingBoxObjectSpace(A), k.center(A,C.translation),C.translation[2]=k.height(A)/2):l.set(C.translation,0,0,0),r(C,D,B)}}B=h.labelMarginPx-e.textVerticalPaddingPx;C.screenOffset[0]+=B*D.normalizedOffset[0];C.screenOffset[1]+=B*D.normalizedOffset[1];B=C}return B};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/MaterialCollection":function(){define(["exports"],function(a){class b{constructor(q){this._stage=q;this._materials=new Map}get(q){return this._materials.get(q)}add(q,l){this._materials.set(q, l);this._stage.add(l)}dispose(){this._stage.removeMany(Array.from(this._materials.values()));this._materials.clear()}}a.MaterialCollection=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileTree3D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Collection ../../../../core/handleUtils ../../../../core/Logger ../../../../core/maybe ../../../../core/PooledArray ../../../../core/reactiveUtils ../../../../core/uid ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/aaBoundingRect ./FeatureTileDescriptor3D ./FeatureTileMeasurements3D ../../support/extentUtils ../../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){a.FeatureTileTree3D=class extends q{get tilingScheme(){const y=this.tilingSchemeOwner.tilingScheme;return y?y.clone():null}set filterExtent(y){if(null==y||y.spatialReference.equals(this.viewState.spatialReference)){var z=this._get("filterExtent");z===y||null!=z&&y&&z.equals(y)||(y=null!=y?y.clone():null,this._set("filterExtent",y),this._setDirty())}else k.getLogger(this).error("#extent","extent spatial reference needs to be in the same spatial reference as the view")}get _filterExtentRect(){if(null== this.filterExtent)return null;const y=v.create();n.toBoundingRect(this.filterExtent,y,this.tilingScheme.spatialReference);return y}get _rootTileIds(){const {tilingScheme:y}=this;return this._filterExtentRect&&y?y.rootTilesInExtent(this._filterExtentRect):[[0,0,0]]}set suspended(y){y!==this._get("suspended")&&(this._set("suspended",y),this._setDirty())}get updating(){return this._dirty||!!this._pendingTiles}constructor(y){super(y);this.tiles=new l;this.tileSize=512;this._idToTile=new Map;this._clients= new Set;this._dirty=!1;this._pendingTiles=null;this._newTiles=new f}initialize(){this.addHandles([c.watch(()=>[this.tilingScheme,this.tileSize],()=>this._reset(),c.sync),c.watch(()=>[this.tileSize,this.cameraOnSurface?.location,this.tilingScheme,this.viewState?.contentCamera,this.focus?.location],()=>this._setDirty(),c.syncAndInitial),c.watch(()=>this.terrain?.baseOpacity??1,()=>this._setDirty())]);this.scheduler&&(this._frameWorker=this.scheduler.registerTask(u.TaskPriority.FEATURE_TILE_TREE,this))}destroy(){this._frameWorker= h.removeMaybe(this._frameWorker)}addClient(){const y=e.generateUID();this._clients.add(y);1===this._clients.size&&this._setDirty();return p.makeHandle(()=>this._removeClient(y))}_removeClient(y){this._clients.delete(y);this._hasClients||this._clear()}get _hasClients(){return 01===(this.terrain?.baseOpacity??1)})),this._tileMeasurements.begin(this.viewState.contentCamera,this.focus.location,this.cameraOnSurface.location.z??0),this._pendingTiles=this._getRootTiles()):this._clear())}_reset(){this._newTiles.clear();this._pendingTiles=this._tileMeasurements=null;this._setDirty()}_getRootTiles(){const {tilingScheme:y}=this;return this._rootTileIds.map(z=> new m.FeatureTileDescriptor3D(z[0],z[1],z[2],y))}_purgeHorizonTiles(y){y.sort((z,A)=>{z=z.measures.screenRect;A=A.measures.screenRect;return z[1]+z[3]-(A[1]+A[3])});if(!(50{const B=this._idToTile.get(A.id);B?(B.copyMeasurementsFrom(A),B.used=!0):this._idToTile.set(A.id,A);return!B});z=this.tiles.items.filter(A=>A.used?!1:(this._idToTile.delete(A.id),!0));this.tiles.removeMany(z);this.tiles.addMany(y);this._sortTiles()}_sortTiles(){this.viewState.fixedContentCamera||this.tiles.sort((y,z)=>y.measures.visibility!==z.measures.visibility?y.measures.visibility===m.Visibility.VISIBLE_ON_SURFACE?-1:1:y.measures.distance-z.measures.distance);this.tiles.forEach((y, z)=>y.loadPriority=z)}};b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"scheduler",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"renderCoordsHelper",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"tilingSchemeOwner",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"cameraOnSurface",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype, "focus",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"viewState",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"terrain",void 0);b.__decorate([g.property()],a.FeatureTileTree3D.prototype,"tiles",void 0);b.__decorate([g.property()],a.FeatureTileTree3D.prototype,"tileSize",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileTree3D.prototype,"tilingScheme",null);b.__decorate([g.property()],a.FeatureTileTree3D.prototype, "filterExtent",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileTree3D.prototype,"_filterExtentRect",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileTree3D.prototype,"_rootTileIds",null);b.__decorate([g.property({value:!1})],a.FeatureTileTree3D.prototype,"suspended",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileTree3D.prototype,"updating",null);a.FeatureTileTree3D=b.__decorate([w.subclass("esri.views.3d.layers.support.FeatureTileTree3D")],a.FeatureTileTree3D); const x=v.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileDescriptor3D":function(){define(["exports","../../../../geometry/support/aaBoundingRect"],function(a,b){class q{constructor(l,p,k,h=null){this.lij=[0,0,0];this.extent=b.create();this.loadPriority=this.resolution=0;this.measures={visibility:a.Visibility.VISIBLE_ON_SURFACE,screenRect:b.create(),distance:0,shouldSplit:!1};this.used=!1;h&&this.acquire(l,p,k,h)}acquire(l,p,k,h){this.tilingScheme= h;this.id=q.id(l,p,k);this.lij[0]=l;this.lij[1]=p;this.lij[2]=k;h.getExtent(l,p,k,this.extent);this.resolution=h.resolutionAtLevel(l)}release(){this.tilingScheme=null}getChildren(l){const p=this.lij[0]+1,k=2*this.lij[1],h=2*this.lij[2];if(!l)return[new q(p,k,h,this.tilingScheme),new q(p,k+1,h,this.tilingScheme),new q(p,k,h+1,this.tilingScheme),new q(p,k+1,h+1,this.tilingScheme)];l[0].acquire(p,k,h,this.tilingScheme);l[1].acquire(p,k+1,h,this.tilingScheme);l[2].acquire(p,k,h+1,this.tilingScheme);l[3].acquire(p, k+1,h+1,this.tilingScheme);return l}copyMeasurementsFrom(l){this.measures.visibility=l.measures.visibility;this.measures.shouldSplit=l.measures.shouldSplit;this.measures.distance=l.measures.distance;b.copy(l.measures.screenRect,this.measures.screenRect)}static id(l,p,k){return`${l}/${p}/${k}`}}a.Visibility=void 0;(function(l){l[l.INVISIBLE=0]="INVISIBLE";l[l.VISIBLE_WHEN_EXTENDED=1]="VISIBLE_WHEN_EXTENDED";l[l.VISIBLE_ON_SURFACE=2]="VISIBLE_ON_SURFACE"})(a.Visibility||(a.Visibility={}));a.FeatureTileDescriptor3D= q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileMeasurements3D":function(){define("exports ../../../../core/screenUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/frustum ../../../../geometry/support/plane ../../../../geometry/support/triangle ../../../ViewingMode ./FeatureTileDescriptor3D ./FeatureTileVisibility3D ../../webgl/RenderCamera".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){function t(A,B,C,D){const F=h.signedDistance(D,B);D=h.signedDistance(D,C);const H=Math.abs(D-F);q.scale(A,B,Math.abs(D)/H);q.scaleAndAdd(A,A,C,Math.abs(F)/H)}class w{constructor(A){this._camera=new d;this._focusOnMap=[0,0];this._screenRect=p.create();this._tileSize=A.tileSize;this._renderCoordsHelper=A.renderCoordsHelper;this._tilingScheme=A.tilingScheme;this._visibility=new g.FeatureTileVisibility3D(A.renderCoordsHelper,A.getIsGroundOpaque)}begin(A,B,C){this._camera.copyFrom(A); this._surfaceElevation=C;this._focusOnMap[0]=B.x;this._focusOnMap[1]=B.y;p.fromValues(0,0,A.fullWidth,A.fullHeight,this._screenRect);this._visibility.begin(this._camera,C)}end(){this._visibility.end()}updateTile(A){A.measures.visibility=this._visibility.calculate(A);A.measures.distance=p.distance(A.extent,this._focusOnMap);A.measures.visibility!==e.Visibility.INVISIBLE&&this._updateScreenMeasure(A)}_updateScreenMeasure(A){const B=A.measures.screenRect;p.empty(B);let C=0;var D=A.lij,F=D[0];const H= F+2,N=D[1]<<2,E=D[2]<<2;var G=this._tileSizeWithBias(A);G*=G;var I=this._camera;const {frustum:O,viewport:L}=I;if(this._renderCoordsHelper.viewingMode===c.ViewingMode.Local||F>g.globalTileLevelThreshold){F=m;this._tilingScheme.getExtent(D[0],D[1],D[2],F);const P=v,M=y;D=p.empty();for(let K=0;4>K;++K)this._toRenderCoords(F,z[K][0],z[K][1],M[K]),I.projectToScreen(M[K],P[K]),p.expandPointInPlace(D,P[K]);I=g.isConvexHullOutsideOfFrustum(O,M,4);F=D[0]>L[2]||D[1]>L[3]||D[2]I;I++)for(F=0;4>F;F++)if(C+=this._computeScreenArea(H,N+I,E+F,B),C>G){A.measures.shouldSplit=!0;return}A.measures.shouldSplit=!1}_tileSizeWithBias(A){return A.measures.visibility===e.Visibility.VISIBLE_WHEN_EXTENDED?5*this._tileSize:this._tileSize}_computeScreenArea(A,B,C,D){this._tilingScheme.ensureMaxLod(A);const F=m;this._tilingScheme.getExtent(A,B,C,F);A=n;this._toRenderCoords(F,0,3,A[0]);this._toRenderCoords(F,2,3,A[1]);this._toRenderCoords(F,2,1,A[2]);this._toRenderCoords(F, 0,1,A[3]);return this._computeTriangleScreenArea([A[0],A[1],A[2]],D)+this._computeTriangleScreenArea([A[2],A[1],A[3]],D)}_computeTriangleScreenArea(A,B){const C=this._camera.frustum[k.PlaneIndex.NEAR];var D=0,F=-1,H=-1;for(var N=0;3>N;++N)0C;C++)this._camera.projectToRenderScreen(A[C],u),this._camera.renderToScreen(u,v[C]),p.expand(B,v[C],B);return f.areaPoints2d(v[0],v[1],v[2])}_toRenderCoords(A,B,C,D){r[0]=A[B];r[1]=A[C];r[2]=this._surfaceElevation;this._renderCoordsHelper.toRenderCoords(r,this._tilingScheme.spatialReference, D);return D}}const v=[b.createScreenPointArray(),b.createScreenPointArray(),b.createScreenPointArray(),b.createScreenPointArray()],m=p.create(),r=l.create(),n=[l.create(),l.create(),l.create(),l.create()],u=b.createRenderScreenPointArray3(),x=[l.create(),l.create(),l.create()],y=[l.create(),l.create(),l.create(),l.create()],z=[[0,3],[2,3],[2,1],[0,1]];a.FeatureTileMeasurements3D=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileVisibility3D":function(){define("exports ../../../../core/mathUtils ../../../../core/ObjectPool ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/spatialReferenceEllipsoidUtils ../../../../geometry/projection/projectBuffer ../../../../geometry/projection/projectVec3Array ../../../../geometry/support/frustum ../../../../geometry/support/plane ../../../../geometry/support/ray ../../../ViewingMode ./FeatureTileDescriptor3D ../../state/Frustum ../../support/FrustumExtentIntersection".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(Ea){var ua=v.Frustum.nearFarLineIndices;const Na=Ea.mutablePoints;for(const Ua of ua){const [wa,sa]=Ua;ua=Na[wa];l.subtract(C,Na[sa],ua);l.scale(C,C,.95);l.add(Na[sa],ua,C)}Ea.updatePoints(Na)}function n(Ea,ua,Na){l.cross(Ea,ua,Na);l.normalize(Ea,Ea);return Ea}function u(Ea,ua,Na){l.sub(Ea,ua,Na);l.normalize(Ea,Ea);return Ea}function x(Ea,ua){l.scale(Ea,Ea,ua/l.len(Ea));return Ea}function y(Ea,ua,Na){for(const Ha of N){a:{var Ua=Ea[Ha];var wa=ua, sa=Na;for(let Ka=0;Ka=g.signedDistance(Ua,wa[Ka])){Ua=!1;break a}Ua=!0}if(Ua)return!0}return!1}function z(Ea,ua,Na){for(const Ua of ua)if(l.dot(Ua,Ea)=Ha){wa=!1;break a}wa=!0}return wa}class B{constructor(Ea,ua){this._renderCoordsHelper=Ea;this._getIsGroundOpaque=ua;this._surfaceElevation=0;this._isGroundOpaque=!1;this._cache=new Map;this._frustumBoundingSphereCenter=p.create();this._frustumBoundingSphereRadius=0;this._frustum=new v.Frustum(Ea);this._extendedFrustum=new v.Frustum(Ea);this._intersector=new m.FrustumExtentIntersection({renderCoordsHelper:Ea});this._renderSR=Ea.spatialReference; ua=h.getSphericalPCPF(this._renderSR);this._renderSREllipsoidRadius=k.getReferenceEllipsoid(ua).radius;this._renderCoordsHelper=Ea}begin(Ea,ua){this._surfaceElevation=ua;this._aboveGround=Ea.aboveGround;this._isGroundOpaque=this._getIsGroundOpaque();this._frustum.update(Ea);r(this._frustum);this._updateExtendedFrustum(Ea);this._updateFrustumBoundingSphere()}end(){this._cache.clear()}calculate(Ea){const ua=this._renderCoordsHelper.viewingMode===t.ViewingMode.Global&&2<=Ea.lij[0]&&6>Ea.lij[0],Na=this._getOrCalculateSingleTileVisibility(Ea, !ua);return Na!==w.Visibility.INVISIBLE&&ua?this._calculateAggregatedChildrenVisibility(Ea):Na}_calculateAggregatedChildrenVisibility(Ea){let ua=w.Visibility.INVISIBLE;var Na=this._cache.get(Ea.id);if(null!=Na)return Na;Na=H.acquire();Ea.getChildren(Na);for(const Ua of Na){const wa=this.calculate(Ua);if(wa!==w.Visibility.INVISIBLE&&(ua=wa,wa===w.Visibility.VISIBLE_ON_SURFACE))break}H.release(Na);this._cache.set(Ea.id,ua);return ua}_getOrCalculateSingleTileVisibility(Ea,ua){var Na=this._cache.get(Ea.id); if(null!=Na)return Na;Na=this._calculateSingleTileVisibility(Ea);ua&&this._cache.set(Ea.id,Na);return Na}_calculateSingleTileVisibility(Ea){if(!this._aboveGround&&this._renderCoordsHelper.viewingMode===t.ViewingMode.Global&&12>Ea.lij[0]){if(this._calculateSingleTileVisibilitySided(Ea,!1)===w.Visibility.INVISIBLE)return this._calculateSingleTileVisibilitySided(Ea,!0)}else return this._calculateSingleTileVisibilitySided(Ea,this._aboveGround)}_isTileVisibleInFrustum(Ea){return this._renderCoordsHelper.viewingMode=== t.ViewingMode.Local?this._isTileVisibleInFrustumLocal(Ea):this._isTileVisibleInFrustumGlobal(Ea)}_updateFrustumBoundingSphere(){var Ea=this._frustum;const ua=Ea.origin,Na=W;l.normalize(Na,Ea.direction);var Ua=S;l.sub(Ua,Ea.points[4],ua);Ea=l.dot(Ua,Ua);Ua=l.dot(Na,Ua);Ua=.5*Ea/Ua;l.scaleAndAdd(this._frustumBoundingSphereCenter,ua,Na,Ua);this._frustumBoundingSphereRadius=1+Ua}_isTileVisibleInFrustumLocal(Ea){var ua=Ea.tilingScheme.spatialReference,Na=Ea.extent,Ua=this._renderSR;Ea=G;Ea[0]=Na[0];Ea[1]= Na[1];Ea[2]=0;Ea[3]=Na[2];Ea[4]=Na[3];Ea[5]=0;if(!f.projectBuffer(Ea,ua,0,Ea,Ua,0,2))return!1;ua=I;l.set(ua[0],Ea[0],Ea[1],0);l.set(ua[1],Ea[3],Ea[1],0);l.set(ua[2],Ea[3],Ea[4],0);l.set(ua[3],Ea[0],Ea[4],0);var wa=O;l.set(wa,.5*(Ea[0]+Ea[3]),.5*(Ea[1]+Ea[4]),.5*(Ea[2]+Ea[5]));Ea=L;l.set(Ea,0,0,1);var sa=.5*l.dist(ua[0],ua[2]);Na=this._frustum;Ua=this._frustumBoundingSphereRadius;const Ha=this._frustumBoundingSphereCenter;var Ka=T;l.sub(Ka,Ha,wa);Ka=l.dot(Ea,Ka);const Aa=V;l.scaleAndAdd(Aa,wa,Ea,Ka); if(l.dist(Aa,Ha)>sa+Ua)return!1;wa=E;sa=Math.min(this._isGroundOpaque&&!this._aboveGround?430:Infinity,Ka+Ua);Ua=Math.max(this._isGroundOpaque&&this._aboveGround?-430:-Infinity,Ka-Ua);for(Ka=0;4>Ka;++Ka)l.scaleAndAdd(wa[Ka],ua[Ka],Ea,sa),l.scaleAndAdd(wa[Ka+4],ua[Ka],Ea,Ua);return!y(Na.planes,wa,8)}_isTileVisibleInFrustumGlobal(Ea){var ua=Ea.tilingScheme.spatialReference,Na=Ea.extent;const Ua=this._isGroundOpaque&&this._aboveGround,wa=this._isGroundOpaque&&!this._aboveGround;if(4>Ea.lij[0])return!0; var sa=I,Ha=.5*(Na[0]+Na[2]);l.set(sa[0],Na[0],Na[1],0);l.set(sa[1],Na[2],Na[1],0);l.set(sa[2],Na[2],Na[3],0);l.set(sa[3],Na[0],Na[3],0);l.set(sa[4],Ha,Na[1],0);l.set(sa[5],Ha,Na[3],0);if(!c.projectVec3Array(sa,ua,0,sa,this._renderSR,0,6))return!1;var Ka=0sa[3][2];Na=this._renderSREllipsoidRadius;if(Ka||Aa){var Sa=p.fromValues(0,0,1),Ya=M;n(Ya,Sa,sa[0]);Ha=K;n(Ha,Sa,sa[1]);if(Ka){Ka=P;Aa=sa[4];var qa=J;n(qa,Aa,Sa);n(Ka,qa,Aa);Sa=sa[0];l.cross(Sa,Ya,Ka);x(Sa,Na);Ya=sa[1];l.cross(Ya, Ha,Ka);x(Ya,Na)}else Aa&&(Ka=P,Aa=sa[5],qa=J,n(qa,Aa,Sa),n(Ka,Aa,qa),Sa=sa[3],l.cross(Sa,Ka,Ya),x(Sa,Na),Ya=sa[2],l.cross(Ya,Ka,Ha),x(Ya,Na))}Aa=O;Ha=l.sub(Z,sa[3],sa[0]);l.normalize(Ha,Ha);Ya=l.add(ca,sa[0],sa[3]);l.scale(Ya,Ya,.5);Sa=-l.dot(Ya,Ha);Ya=l.add(ea,sa[0],sa[1]);l.scale(Ya,Ya,.5);Ka=l.add(da,sa[2],sa[3]);l.scale(Ka,Ka,.5);Ka=l.sub(ia,Ka,Ya);l.normalize(Ka,Ka);Ha=-(Sa+l.dot(Ha,Ya))/l.dot(Ha,Ka);l.scaleAndAdd(Aa,Ya,Ka,Ha);x(Aa,Na);Ka=this._frustumBoundingSphereRadius;qa=this._frustumBoundingSphereCenter; const aa=this._frustum;Ya=aa.planes;var Ja=R;l.normalize(Ja,Aa);Sa=l.dot(sa[0],Ja)/l.len(sa[0]);var Ta=aa.origin;Ha=aa.points;var Ra=!1;if(Ua){Ra=!0;var $a=l.normalize(p.create(),Ta);for(var bb=0;4>bb;++bb){var pa=Ha[4+bb];pa=l.sub(p.create(),pa,Ta);l.normalize(pa,pa);var Ba=l.cross(p.create(),$a,pa);l.normalize(Ba,Ba);pa=l.cross(p.create(),pa,Ba);l.normalize(pa,pa);if(l.dot(Ta,pa)>Na){Ra=!1;break}}if(Ra&&l.dot(Ta,Ja)l.dot(Ta,Ja))return!1;Ta=l.normalize(Pa, aa.direction);if(l.dot(Ta,Ja)>Qa)return!1}$a=Math.sqrt(1-Sa*Sa);if(.9<$a)return!0;Ta=!1;pa=l.dot(Ja,qa);Ba=l.len(qa);if(Ba<=Ka&&!Ya.some(Wa=>0=pa&&-pa>Ka)return!1;pa=Ka/Ba;if(Math.sqrt(1-bb*bb)*Math.sqrt(1-pa*pa)-pa*bb>$a)return!1;if(!Ra&&(sa.some(Wa=>aa.intersectsPoint(Wa))||aa.intersectsPoint(Aa)))return!0;Aa=ha;l.sub(Aa,qa,Y);Aa=l.dot(Aa,Ja);Ra=Q;l.scale(Ra,Ja,Aa);qa=l.dist(Ra,qa);ua=ua.isWGS84;Ja=Ea.lij;Ea=ua&&Ja[2]===2**Ja[0]- 1;ua=(Ja=ua&&0===Ja[2])?Da:Ea?za:na;Ea=Ja?ra:Ea?ya:va;if(!Ta){Ja=xa;Ta=ka;Ra=fa;$a=Y;for(var Ia of ua)if(ua=sa[Ia],u(Ta,sa[(Ia+1)%4],ua),u(Ra,$a,ua),n(Ja,Ra,Ta),z(Ja,Ha,1))return!1}Ia=null;if(!Ua&&Aa<1.01*Ka){Ia=2.5*Ka;if(qa>Sa*Ia+Ka)return!1;ua=U;Ia/=Sa;for(Sa=0;4>Sa;++Sa)l.scale(ua[Sa],sa[Sa],Ia/Na);l.set(ua[4],0,0,0);Ia=ua}else{Ia=(wa?Na+430:Aa+Ka)/Sa;ua=Ua?Na-430:(Aa-Ka)/Sa;Sa=ba;for(Ka=0;4>Ka;++Ka)Aa=sa[Ka],l.scale(Sa[Ka],Aa,ua/Na),l.scale(Sa[Ka+4],Aa,Ia/Na);Ia=Sa}if(y(Ya,Ia,Ia.length))return!1; ua=aa.lines;sa=X;Na=ja;for(const Wa of ua){l.normalize(Na,Wa.direction);for(const gb of Ea){ua=Ia[gb];l.normalize(sa,ua);if(A(Na,sa,Ia,Ha))return!1;Ya=(gb+1)%4;if(Ua&&(l.sub(sa,Ia[Ya],ua),l.normalize(sa,sa),A(Na,sa,Ia,Ha))||wa&&(l.sub(sa,Ia[4+Ya],Ia[4+gb]),l.normalize(sa,sa),A(Na,sa,Ia,Ha)))return!1}}return!0}_calculateSingleTileVisibilitySided(Ea,ua){return this._isTileVisibleInFrustum(Ea)?(this._intersector.update(Ea.extent,Ea.tilingScheme.spatialReference,this._surfaceElevation,ua),this._intersector.isVisibleInFrustum(this._frustum, this._renderSREllipsoidRadius,!0)?w.Visibility.VISIBLE_ON_SURFACE:w.Visibility.VISIBLE_WHEN_EXTENDED):w.Visibility.INVISIBLE}_updateExtendedFrustum(Ea){this._extendedFrustum.update(Ea);r(this._extendedFrustum);var ua=this._renderCoordsHelper.worldUpAtPosition(Ea.eye,C);this._aboveGround||l.negate(ua,ua);if(this._hasExtendedFrustum=b.acosClamped(-l.dot(ua,Ea.viewForward))>Ea.fovY/2){Ea=this._extendedFrustumParameters();ua=this._extendedFrustum.mutablePoints;for(let Na=0;4>Na;Na++){const Ua=Ea.pointIndices[Na], wa=ua[Ua],sa=this._renderCoordsHelper.getAltitude(wa);if(Ea.needsAltitudeAdjustment(sa)){this._renderCoordsHelper.worldUpAtPosition(wa,C);switch(Ua){case e.PointIndex.FAR_BOTTOM_LEFT:case e.PointIndex.FAR_TOP_LEFT:case e.PointIndex.NEAR_BOTTOM_LEFT:case e.PointIndex.NEAR_TOP_LEFT:g.projectVector(this._extendedFrustum.planes[e.PlaneIndex.LEFT],C,C);break;case e.PointIndex.FAR_BOTTOM_RIGHT:case e.PointIndex.FAR_TOP_RIGHT:case e.PointIndex.NEAR_BOTTOM_RIGHT:case e.PointIndex.NEAR_TOP_RIGHT:g.projectVector(this._extendedFrustum.planes[e.PlaneIndex.RIGHT], C,C)}l.scale(C,C,Ea.direction);this._renderCoordsHelper.intersectInfiniteManifold(d.wrap(wa,C),Ea.zWithMargin,wa)}}this._extendedFrustum.updatePoints(ua);g.fromPoints(ua[e.PointIndex.NEAR_BOTTOM_LEFT],ua[e.PointIndex.NEAR_BOTTOM_RIGHT],ua[e.PointIndex.NEAR_TOP_RIGHT],D);g.fromPoints(ua[e.PointIndex.NEAR_BOTTOM_RIGHT],ua[e.PointIndex.NEAR_TOP_RIGHT],ua[e.PointIndex.NEAR_TOP_LEFT],F);0>l.dot(g.getNormal(D),g.getNormal(F))&&(Ea=this._extendedFrustum.mutablePoints,this._aboveGround?[Ea[e.PointIndex.NEAR_BOTTOM_LEFT], Ea[e.PointIndex.NEAR_BOTTOM_RIGHT]]=[Ea[e.PointIndex.NEAR_BOTTOM_RIGHT],Ea[e.PointIndex.NEAR_BOTTOM_LEFT]]:[Ea[e.PointIndex.NEAR_TOP_LEFT],Ea[e.PointIndex.NEAR_TOP_RIGHT]]=[Ea[e.PointIndex.NEAR_TOP_RIGHT],Ea[e.PointIndex.NEAR_TOP_LEFT]],this._extendedFrustum.updatePoints(Ea))}}_extendedFrustumParameters(){return this._aboveGround?this._extendedFrustumParametersAboveSurface():this._extendedFrustumParametersBelowSurface()}_extendedFrustumParametersAboveSurface(){const Ea=this._surfaceElevation-1;return{zWithMargin:Ea, pointIndices:v.Frustum.planePointIndices.bottom,direction:-1,needsAltitudeAdjustment(ua){return ua>Ea}}}_extendedFrustumParametersBelowSurface(){const Ea=this._surfaceElevation+1;return{zWithMargin:Ea,pointIndices:v.Frustum.planePointIndices.top,direction:1,needsAltitudeAdjustment(ua){return ua{4!==Ea.length&&(Ea[0]=new w.FeatureTileDescriptor3D,Ea[1]=new w.FeatureTileDescriptor3D,Ea[2]=new w.FeatureTileDescriptor3D,Ea[3]=new w.FeatureTileDescriptor3D)}, Ea=>{Ea[0].release();Ea[1].release();Ea[2].release();Ea[3].release()}),N=[e.PlaneIndex.LEFT,e.PlaneIndex.RIGHT,e.PlaneIndex.BOTTOM,e.PlaneIndex.TOP,e.PlaneIndex.FAR],E=[p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create()],G=[0,0,0,0,0,0],I=[p.create(),p.create(),p.create(),p.create(),p.create(),p.create()],O=p.create(),L=p.create(),P=p.create(),M=p.create(),K=p.create(),J=p.create(),R=p.create(),Q=p.create(),W=p.create(),S=p.create(),V=p.create(),T=p.create(),Y= p.fromValues(0,0,0),ha=p.create(),ba=[p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create()],U=[p.create(),p.create(),p.create(),p.create(),p.create()],Z=p.create(),ca=p.create(),ea=p.create(),da=p.create(),ia=p.create(),ka=p.create(),fa=p.create(),X=p.create(),ja=p.create(),la=p.create(),na=[0,1,2,3],va=[0,1,2,3],za=[0,1,3],ya=[0,1,3],Da=[1,2,3],ra=[1,2,3],xa=p.create(),Ma=[0,0],Ga=p.create(),Pa=p.create(),Qa=Math.cos(.25*Math.PI);a.FeatureTileVisibility3D=B;a.globalTileLevelThreshold= 4;a.isConvexHullOutsideOfFrustum=y;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectVec3Array":function(){define(["exports","../../chunks/vec32","./projectors"],function(a,b,q){a.projectVec3Array=function(l,p,k,h,f,c,e=1){p=q.getProjector(p,f,q.projectorCache);if(null==p)return!1;if(p===q.copy3){if(l===h&&k===c)return!0;e=k+e;for(let g=k,d=c;gE;E++)this._extent[E]={origin:h.create(),direction:h.create(),cap:{next:null,direction:h.create()}},this._planes[E]=m.create();this._planes[w.PlaneIndex.NEAR]=m.create();this._planes[w.PlaneIndex.FAR]=m.create();this._planesWithoutFar= this._planes.slice(0,5)}update(E,G,I,O=!0){const L=this._extent;this._toRenderBoundingExtent(E,G,I);k.add(this._center.origin,L[0].origin,L[2].origin);k.scale(this._center.origin,this._center.origin,.5);this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction);O||k.scale(this._center.direction,this._center.direction,-1);for(I=0;4>I;I++){const P=L[I];this._renderCoordsHelper.worldUpAtPosition(P.origin,P.direction);const M=L[3===I?0:I+1];P.cap.next=M.origin;k.direction(P.cap.direction, P.origin,M.origin);m.fromVectorsAndPoint(P.direction,P.cap.direction,P.origin,this._planes[I]);O||k.scale(P.direction,P.direction,-1)}m.fromVectorsAndPoint(L[0].cap.direction,L[1].cap.direction,L[0].origin,this._planes[w.PlaneIndex.NEAR]);O?m.negate(this._planes[w.PlaneIndex.NEAR],this._planes[w.PlaneIndex.FAR]):(m.copy(this._planes[w.PlaneIndex.FAR],this._planes[w.PlaneIndex.NEAR]),m.negate(this._planes[w.PlaneIndex.NEAR],this._planes[w.PlaneIndex.NEAR]));this._maxSpan=Math.max(Math.abs(E[0]-E[2]), Math.abs(E[1]-E[3]));this._maxSpanSpatialReference=G;this._minGlobalAltitude=.9*f.getReferenceEllipsoid(this._maxSpanSpatialReference).radius}isVisibleInFrustum(E,G,I=!1){if(null==E)return!1;if(this._renderCoordsHelper.viewingMode===n.ViewingMode.Global){if(this._maxSpan>(this._maxSpanSpatialReference.isGeographic?y:x*G))return!0;if(null!=E.altitude&&E.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(E)}if(0===this._maxSpan)return G=this._extent[0],!I&&E.intersectsRay(r.wrap(G.origin, G.direction))?!0:!1;for(G=0;GK;K++){const J=K/4;B[0]=q.lerp(E[O],E[L],J);B[1]=q.lerp(E[P],E[M],J);B[2]=I;g.projectVectorToVector(B,G,B,this._renderCoordsHelper.spatialReference);k.transformMat4(B,B,D);d.expandWithVec3(F,B)}k.set(this._extent[0].origin,F[0],F[1],F[2]);k.set(this._extent[1].origin,F[3],F[1],F[2]);k.set(this._extent[2].origin,F[3],F[4],F[2]);k.set(this._extent[3].origin,F[0],F[4],F[2]);for(E=0;4>E;++E)k.transformMat4(this._extent[E].origin, this._extent[E].origin,C)}_toRenderBoundingExtentLocal(E,G,I){e.projectBoundingRect(E,G,H,this._renderCoordsHelper.spatialReference);k.set(this._extent[0].origin,H[0],H[1],I);k.set(this._extent[1].origin,H[2],H[1],I);k.set(this._extent[2].origin,H[2],H[3],I);k.set(this._extent[3].origin,H[0],H[3],I)}_toRenderBoundingExtent(E,G,I){switch(this._renderCoordsHelper.viewingMode){case n.ViewingMode.Global:this._toRenderBoundingExtentGlobal(E,G,I);break;case n.ViewingMode.Local:this._toRenderBoundingExtentLocal(E, G,I);break;default:b.neverReached(this._renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(E){if(0>m.signedDistance(E.planes[w.PlaneIndex.NEAR],this._center.origin)&&0>k.dot(this._center.direction,E.direction))return!0;for(let G=0;4>G;G++){const I=this._extent[G];if(0>m.signedDistance(E.planes[w.PlaneIndex.NEAR],I.origin)&&0>k.dot(I.direction,E.direction))return!0}return!1}}const A=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],B=h.create(),C=p.create(), D=p.create(),F=d.create(),H=t.create(),N=v.create();a.FrustumExtentIntersection=z;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/extentUtils":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/vec3f64","../../../geometry/projection/projectBuffer"],function(a,b,q){const l=b.create();a.projectToBoundingBox=function(p,k,h){if(null==p||null==h)return!1;let f;l[0]=null!=p.xmin?p.xmin:0;l[1]=null!=p.ymin?p.ymin:0;l[2]=null!=p.zmin?p.zmin:0;f=q.projectBuffer(l, p.spatialReference,0,k,h,0,1);l[0]=null!=p.xmax?p.xmax:0;l[1]=null!=p.ymax?p.ymax:0;l[2]=null!=p.zmax?p.zmax:0;f=f&&q.projectBuffer(l,p.spatialReference,0,k,h,3,1);null==p.xmin&&(k[0]=-Infinity);null==p.ymin&&(k[1]=-Infinity);null==p.zmin&&(k[2]=-Infinity);null==p.xmax&&(k[3]=Infinity);null==p.ymax&&(k[4]=Infinity);null==p.zmax&&(k[5]=Infinity);return f};a.toBoundingRect=function(p,k,h){if(null==p||null==h)return!1;let f;l[0]=null!=p.xmin?p.xmin:0;l[1]=null!=p.ymin?p.ymin:0;l[2]=null!=p.zmin?p.zmin: 0;f=q.projectBuffer(l,p.spatialReference,0,l,h,0,1);k[0]=l[0];k[1]=l[1];l[0]=null!=p.xmax?p.xmax:0;l[1]=null!=p.ymax?p.ymax:0;l[2]=null!=p.zmax?p.zmax:0;f=f&&q.projectBuffer(l,p.spatialReference,0,l,h,0,1);k[2]=l[0];k[3]=l[1];null==p.xmin&&(k[0]=-Infinity);null==p.ymin&&(k[1]=-Infinity);null==p.xmax&&(k[2]=Infinity);null==p.ymax&&(k[3]=Infinity);return f};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/ViewState":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Evented ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/watch ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../ViewAnimation ../../ViewingMode ./Constraints ./controllers/AnimationController ./controllers/CameraController ../support/PropertiesPool ../webgl/RenderCamera ../webgl-engine/lib/rendererUtils ../../support/RenderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){function z(B,C){return B.fov!==C.fov||B.fullViewport[0]!==C.fullViewport[0]||B.fullViewport[1]!==C.fullViewport[1]||B.fullViewport[2]!==C.fullViewport[2]||B.fullViewport[3]!==C.fullViewport[3]||B.padding[x.PaddingSide.TOP]!==C.padding[x.PaddingSide.TOP]||B.padding[x.PaddingSide.RIGHT]!==C.padding[x.PaddingSide.RIGHT]||B.padding[x.PaddingSide.BOTTOM]!==C.padding[x.PaddingSide.BOTTOM]||B.padding[x.PaddingSide.LEFT]!==C.padding[x.PaddingSide.LEFT]? !0:!1}b=class extends b{constructor(){super(...arguments);this._propertiesPool=new n.PropertiesPool({camera:u},this);this._lastSeenCameraProjectionValues=new u;this.mode=y.RenderState.ANIMATING;this._cssCamera=new u;this._camera=new u;this.contentPixelRatio=this.rasterPixelRatio=1;this.events=new q;this.viewingMode=w.ViewingMode.Global;this._cameraChanged=!1;this._updateQueue=[];this._processingUpdates=!1}init(B,C){this._set("viewingMode",B);this._set("spatialReference",C);this._set("constraints", new v.Constraints({mode:this.viewingMode}))}exit(){this.cameraController=null;this._propertiesPool.destroy();this._propertiesPool=new n.PropertiesPool({camera:u},this)}destroy(){this.cameraController=null;this._propertiesPool?.destroy();this._propertiesPool=null}createInitialCamera(){if(this.viewingMode===w.ViewingMode.Global){const B=d.getReferenceEllipsoid(this.spatialReference).radius;this.camera=new u({eye:g.fromValues(4*B,0,0),center:g.fromValues(B,0,0),up:g.fromValues(0,0,1)})}else this.camera= new u({eye:g.fromValues(0,0,100),center:g.fromValues(0,0,0),up:g.fromValues(0,1,0)})}get animation(){return this.cameraController instanceof m.AnimationController&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get cssCamera(){const B=this._cssCamera.copyFrom(this.camera),{height:C,width:D,pixelRatio:F}=this.camera;B.pixelRatio=1;B.height=Math.round(C/F);B.width=Math.round(D/F);return B}get camera(){return this._camera}set camera(B){B!==A&&A.copyFrom(B);A.computeUp(this.viewingMode); this.events.emit("before-camera-change",A);B=this._camera;z(this._lastSeenCameraProjectionValues,A)&&(this._lastSeenCameraProjectionValues.copyFrom(A),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues));if(!B.equals(A)&&(this._camera=this._propertiesPool.get("camera").copyFrom(A),this._cameraChanged=!B.almostEquals(A))){const C=e.afterDispatch(()=>{this._cameraChanged=!1;C.remove()})}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio=== this.rasterPixelRatio&&this.mode===y.RenderState.IDLE}get updating(){return this.mode!==y.RenderState.IDLE}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(B){this._contentCamera=null!=B?B.clone():null}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return this.viewingMode===w.ViewingMode.Global}get isLocal(){return this.viewingMode===w.ViewingMode.Local}get navigating(){return!!this.cameraController?.isInteractive}get stationary(){return!this._cameraChanged&& !this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(B){this.stopActiveCameraController()?(this.cameraController?.destroy(),B&&(this.removeHandles("ViewStateHandles"),this.addHandles(l.when(()=>B.state===r.State.Finished||B.state===r.State.Stopped,()=>{this._set("cameraController",null);this.updateCamera(C=>B.onControllerEnd(C))},{sync:!0,once:!0}),"ViewStateHandles"),B.onControllerStart(this.camera)),this._set("cameraController",B)):B&&(B.state=r.State.Rejected)}switchCameraController(B){this.cameraController= B;return B.state!==r.State.Rejected}stopActiveCameraController(){return this.cameraController&&!this.cameraController.stopController()?!1:!0}updateCamera(B){this._updateQueue.push(B);this._processUpdateQueue()}_processUpdateQueue(){if(0!==this._updateQueue.length&&!this._processingUpdates){this._processingUpdates=!0;var B=this._updateQueue.shift();A.copyFrom(this._get("camera"));B(A);this.camera=A;this._processingUpdates=!1;this._processUpdateQueue()}}};a.__decorate([p.property()],b.prototype,"mode", void 0);a.__decorate([p.property({readOnly:!0,type:t})],b.prototype,"animation",null);a.__decorate([p.property({type:u})],b.prototype,"cssCamera",null);a.__decorate([p.property()],b.prototype,"_cssCamera",void 0);a.__decorate([p.property({type:u})],b.prototype,"camera",null);a.__decorate([p.property()],b.prototype,"_camera",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"pixelRatio",null);a.__decorate([p.property()],b.prototype,"rasterPixelRatio",void 0);a.__decorate([p.property()], b.prototype,"contentPixelRatio",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"alignPixelEnabled",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"updating",null);a.__decorate([p.property({})],b.prototype,"_contentCamera",void 0);a.__decorate([p.property({type:u})],b.prototype,"contentCamera",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"fixedContentCamera",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"constraints",void 0);a.__decorate([p.property({readOnly:!0})], b.prototype,"events",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"isGlobal",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"isLocal",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"viewingMode",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"spatialReference",void 0);a.__decorate([p.property()],b.prototype,"navigating",null);a.__decorate([p.property()],b.prototype,"stationary",null);a.__decorate([p.property()],b.prototype,"_cameraChanged",void 0); a.__decorate([p.property()],b.prototype,"cameraController",null);a=b=a.__decorate([c.subclass("esri.views.3d.state.ViewState")],b);const A=new u;return a})},"esri/views/3d/state/helpers/SceneIntersectionHelper":function(){define("exports ../../../../core/PooledArray ../../../../core/screenUtils ../../../../core/unitUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/ray ../../../../geometry/support/vectorStacks ../../../../support/elevationInfoUtils ../../../ViewingMode ../../support/hitTest ../../support/geometryUtils/ray ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces ../../webgl-engine/lib/intersectorUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(D){y&&y.viewingMode===D||(y=w.newIntersector(D));return y}class n{constructor(D,F,H){this.viewingMode=D;this._forEachLayer=F;this._view=H;this._externalIntersectionHandlers=new b;this._tolerance=w.defaultTolerance;this._tmpRay=f.create();this._tmpRegion=h.create();this._validateHUDIntersector=w.newIntersector(this.viewingMode);this._validateHUDIntersector.options.hud=!1}intersectScreen(D,F,H){return this.intersectRay(this._getPickRay(D,this._tmpRay), r(this.viewingMode),F,H)}intersectScreenFreePointFallback(D,F,H){return this.intersectRayFreePointFallback(this._getPickRay(D,this._tmpRay),F,H)}intersectRayFreePointFallback(D,F,H){return this.intersectRay(D,r(this.viewingMode),F,H)||this._intersectRayFreePointLocal(D,F)}intersectRay(D,F,H,N){F.options.selectionMode=!1;F.options.store=v.StoreResults.MIN;this.computeIntersection(D,F,N);return F.results.min?F.results.min.getIntersectionPoint(H):!1}getCenterRayWithSubpixelOffset(D,F,H=.5,N=.5){D.getRenderCenter(C, H,N);C[0]+=.0466;C[1]-=.0123;return t.fromRenderAtEye(D,C,F)}intersectIntersectorScreen(D,F,H){this.computeIntersection(this._getPickRay(D,this._tmpRay),F,H)}intersectToolIntersectorScreen(D,F,H){D=this._getPickRay(D,this._tmpRay);this.intersectToolIntersectorRay(D,F,H)}intersectToolIntersectorRay(D,F,H){F.options.selectionMode=!0;this.computeIntersection(D,F,H);const N=F.results.min;this._view.basemapTerrain&&this._view.basemapTerrain.opaque||m.isValidIntersectorResult(N)&&N.intersector!==v.IntersectorType.TERRAIN|| (F.options.selectionMode=!1,this.computeIntersection(D,F,H))}setTolerance(D=w.defaultTolerance){this._tolerance=D}addIntersectionHandler(D){this._externalIntersectionHandlers.push(D);this._externalIntersectionHandlers.sort((F,H)=>F.type===v.IntersectorType.TERRAIN?1:H.type===v.IntersectorType.TERRAIN?-1:0)}removeIntersectionHandler(D){null!=this._externalIntersectionHandlers.removeUnordered(D)&&this._externalIntersectionHandlers.sort((F,H)=>F.type===v.IntersectorType.TERRAIN?1:H.type===v.IntersectorType.TERRAIN? -1:0)}_getPickRay(D,F){return t.fromScreen(this._view.state.camera,D,F)}_intersectRayFreePointLocal(D,F){if(this.viewingMode!==g.ViewingMode.Local||null==D)return!1;p.add(F,D.origin,p.normalize(c.sv3d.get(),D.direction));return!1}intersectElevationFromScreen(D,F,H=0,N=null){return this._intersectElevation(this._getPickRay(D,this._tmpRay),F,H,N)}_intersectElevation(D,F,H=0,N=null){if(null==D)return null;var E=this._view,{renderCoordsHelper:G}=E,I=l.getMetersPerVerticalUnitForSR(E.spatialReference), O=null!=F?F.mode:"absolute-height";F=e.getElevationOffsetInMeters(F)/I;const L=("on-the-ground"!==O?F+H:0)*I/G.unitInMeters;({camera:I}=E.state);if("absolute-height"===O)return H=G?.getAltitude(I.eye),O=p.dot(p.normalize(A,D.direction),G.worldUpAtPosition(I.eye,B)),HO||H>=L&&0R.layerUid!==N.uid:R=>R.graphicUid!==N.uid:null;switch(O){case "relative-to-scene":K.intersect(G.layers,P,this._tolerance,null,R=>(!J||J(R))&&!!R.lastValidElevationBB);this._externalIntersectionHandlers.forAll(R=> {R.type!==v.IntersectorType.I3S&&R.type!==v.IntersectorType.TERRAIN&&R.type!==v.IntersectorType.TILES3D||R.intersect(K,R.slicePlaneEnabled?M:null,K.rayBegin,K.rayEnd,P)});break;case "on-the-ground":case "relative-to-ground":this._externalIntersectionHandlers.forAll(R=>{R.isGround&&R.intersect(K,R.slicePlaneEnabled?M:null,K.rayBegin,K.rayEnd,P)})}return K.results.min.getIntersectionPoint(A)?(E=d.computeMapPointFromVec3d(E,A),E.z=H,E):null}computeIntersection(D,F,H,N){if(null!=D){var E=this._view.state.camera, G=q.castRenderScreenPointArray3(c.sv3d.get());E.projectToRenderScreen(D.origin,G);var I=new z(H,this._forEachLayer);F.options.selectOpaqueTerrainOnly=!H||!("include"in H||"exclude"in H);var O=D.origin,L=p.add(c.sv3d.get(),D.origin,D.direction);F.reset(O,L,E);F.intersect(I.layers,G,this._tolerance);D=this._view.slicePlane;var P=null!=D?m.sliceFilterPredicate(D):null;F.intersect(I.sliceableLayers,G,this._tolerance,P);var M=H&&(H.requiresGroundFeedback||H.enableDraped);this._externalIntersectionHandlers.forAll(K=> {var J=K.layerUid;const R=Array.isArray(J);J=R?J:[J];R&&(F.options.filteredLayerUids=[]);let Q=!1;for(const W of J)I.filterLayerUid(W)?Q=!0:R&&F.options.filteredLayerUids.push(W);F.options.isFiltered=!Q;(K.isGround&&M||!F.options.isFiltered)&&K.intersect(F,K.slicePlaneEnabled?P:null,O,L,G,N)});D=c.sv3d.get();E=this._view.basemapTerrain;if(H&&H.enableDraped&&null!=E.spatialReference&&F.results.ground.getIntersectionPoint(D)){H=E.overlayManager.renderer;const K=this._view.renderCoordsHelper.spatialReference, J=c.sv3d.get();this._view.renderCoordsHelper.fromRenderCoords(D,J,E.spatialReference);J[2]=this._view.elevationProvider?.getElevation(D[0],D[1],D[2],K,"ground")??0;H.intersect(F,J,F.results.ground,R=>I.filterRenderGeometry(R))}F.sortResults();this._processHUDResults(F)}}_processHUDResults(D){var F=D.results.hud;h.copy(this._tmpRegion,h.negativeInfinity);const H=this._view.state.camera,N=[],E=this._tmpRegion;var G=K=>{const J=new x(K);H.projectToRenderScreen(K.target.center,J.screenPoint);J.screenPoint[0]= Math.floor(J.screenPoint[0]);J.screenPoint[1]=Math.floor(J.screenPoint[1]);N.push(J);h.expandPointInPlace(E,J.screenPoint)};D.sortResults(F.all);null!=F.min.dist&&G(F.min);for(var I of F.all)F.min.target.object!==I.target.object&&F.max.target.object!==I.target.object&&G(I);null!=F.max.dist&&F.max.target.object!==F.min.target.object&&G(F.max);if(N.length){E[0]===E[2]&&(E[2]+=1);E[1]===E[3]&&(E[3]+=1);F=H.fullWidth;G=H.fullHeight;var O=Math.max(0,E[0]-1),L=Math.max(0,E[1]-1);I=Math.min(h.width(E)+2, F-O);var P=Math.min(h.height(E)+2,G-L);if(!(0>=I||0>=P)){var M=new Uint8Array(I*P*4);this._view._stage.renderer.readHUDVisibility(O,L,I,P,M);O=!0;L=null==D.results.max.dist;P=0;for(const K of N)for(const J of u){const R=4*(Math.min(K.screenPoint[0]+J[0],F)-E[0]+(Math.min(K.screenPoint[1]+J[1],G)-E[1])*I);if(!(0>R||R>=M.length)&&M[R]){O&&(D.results.min.copy(K.result),O=!1);L&&D.results.max.copy(K.result);D.options.store===v.StoreResults.ALL&&D.results.all.splice(P++,0,K.result);break}}}}}}const u= (()=>{const D=[];for(let F=-1;1>=F;F++)for(let H=-1;1>=H;H++)D.push([H+1,F+1]);return D})();class x{constructor(D){this.result=D;this.screenPoint=q.createRenderScreenPointArray3()}}let y;class z{constructor(D,F){this.layers=[];this.sliceableLayers=[];this.include=D?.include;this.exclude=D?.exclude;F(H=>{H.pickable&&this.filterLayerUid(H.apiLayerUid)&&(H.sliceable?this.sliceableLayers:this.layers).push(H)})}filterLayerUid(D){const {include:F,exclude:H}=this;return null==D?null==F&&null==H:(null==F|| F.has(D))&&(null==H||!H.has(D))}filterRenderGeometry(D){return this.filterLayerUid(D.layerUid)}}const A=k.create(),B=k.create(),C=q.createRenderScreenPointArray3();a.SceneIntersectionHelper=n;a.isIntersectionHandler=function(D){return"object"===typeof D&&"intersect"in D};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/elevationInfoUtils":function(){define(["exports","../core/unitUtils","../symbols/support/unitConversionUtils"],function(a,b,q){function l(r,n){return n?.mode? n.mode:(r?v:m).mode}function p(r,n){return null!=n?n:r?v:m}function k(r,n){return l(null!=r?r.hasZ:!1,n)}function h(r){const n=e(r);r=k(r.geometry,n);const u=null!=n&&"on-the-ground"!==r?w(n):0;return{mode:r,offset:u,featureExpressionInfo:n?.featureExpressionInfo}}function f(r){return"0"===r?.featureExpressionInfo?.expression}function c(r){if(!r||"on-the-ground"===r.mode)return!1;r=r?.featureExpressionInfo?r.featureExpressionInfo.expression:null;return!(!r||"0"===r)}function e(r){return r.layer&& "elevationInfo"in r.layer?r.layer.elevationInfo:null}function g(r,n){if(!r?.offset)return 0;const {offset:u,unit:x}=r;if("decimal-degrees"===x)return 0;r="unknown"!==x&&x?x:"meters";return(n=b.verticalLengthUnitFromSpatialReference(n))?b.convertUnit(u,r,n):0}function d(r,n,u,x,y,z,A=null){if(null!=z){var B=null!=A?A.mode:"absolute-height";if("on-the-ground"===B)return 0;({absoluteZ:z}=t(n,u,x,y,r,z));a:{A=g(A,y);switch(B){case "absolute-height":r=z-A;break a;case "relative-to-ground":r=z-((r.elevationProvider.getElevation(n, u,x,y,"ground")??0)+A);break a;case "relative-to-scene":r=z-((r.elevationProvider.getElevation(n,u,x,y,"scene")??0)+A);break a}r=void 0}return r}}function t(r,n,u,x,y,z){const A=g(z,x);switch(z.mode){case "absolute-height":return{absoluteZ:u+A,elevation:0};case "on-the-ground":return u=y.elevationProvider.getElevation(r,n,0,x,"ground")??0,{absoluteZ:u,elevation:u};case "relative-to-ground":return r=y.elevationProvider.getElevation(r,n,u,x,"ground")??0,{absoluteZ:u+r+A,elevation:r};case "relative-to-scene":return r= y.elevationProvider.getElevation(r,n,u,x,"scene")??0,{absoluteZ:u+r+A,elevation:r}}}function w(r){return(r?.offset??0)*q.getMetersPerUnit(r?.unit)}const v={mode:"absolute-height",offset:0},m={mode:"on-the-ground",offset:null};a.absoluteHeightElevationInfo=v;a.elevationContextAffectsAlignment=function(r,n){if(null==n)return!1;({mode:n}=n);return null!=n&&("scene"===r&&"relative-to-scene"===n||"ground"===r&&"absolute-height"!==n)};a.elevationModeRequiredMessage=function(r,n,u){return u&&u.mode!==n? `${r} only support ${n} elevation mode`:null};a.elevationModeUnsupportedMessage=function(r,n,u){return u?.mode===n?`${r} do not support ${n} elevation mode`:null};a.featureExpressionInfoIsZero=f;a.featureExpressionUnsupportedMessage=function(r,n){return null!=n?.featureExpressionInfo&&"0"!==n.featureExpressionInfo.expression?`${r} do not support featureExpressionInfo`:null};a.getConvertedElevation=function(r,n,u,x=null){return d(r,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,u,x)};a.getConvertedElevationFromVector= function(r,n,u,x,y=null){return d(r,n[0],n[1],2x.layer===u);return!n||n.suspended||null==r.graphicUid?null:"getHit"in n?n.getHit(r.graphicUid):null}function d(r,n){const u=v(r,n);return null==u?null:(n=n.allLayerViews.find(x=>x.layer===u))&&!n.suspended&&"getGraphicFromIntersectorTarget"in n?w(n.getGraphicFromIntersectorTarget(r)):null}function t(r, n){const u=v(r,n);return null==u?null:(n=n.allLayerViews.find(x=>x.layer===u))&&!n.suspended&&"getAABBFromIntersectorTarget"in n?n.getAABBFromIntersectorTarget(r):null}function w(r){return null!=r?{type:"graphic",graphic:r,layer:r.layer}:null}function v(r,n){return null==r?.layerUid?null:null!=n.graphicsView&&r.layerUid===n.graphicsView.processor.layer.id?n.graphics:n.map.allLayers.find(u=>u.uid===r.layerUid)}const m=q.create();a.getIntersectedFeatureBSRadius=function(r,n){return f.isObjectIntersectorResult(r)|| f.isHudIntersectorResult(r)?p.getRadius(r.target.object.boundingVolumeWorldSpace.bounds):c.isLodIntersectorResult(r)?(b.getScaling(m,r.transformation),r.target.baseBoundingSphere.radius*Math.max(m[0],m[1],m[2])):k.isI3sIntersectorResult(r)?(r=t(r.target,n))?.5*l.diameter(r):null:null};a.hasLod=function(r){return f.isObjectIntersectorResult(r)||f.isHudIntersectorResult(r)?!1:c.isLodIntersectorResult(r)?1{u.getRootElevationBounds&&(u=u.getRootElevationBounds(),null!=u&&r.expandElevationRangeValues(u.elevationRangeMin,u.elevationRangeMax))});return r}async queryElevation(r,n, u,x,y,z=null,A=0){const B=this._getElevationQuery(x);try{const C=await B.queryElevation(r,n,z,A);return"scene"===y?m(C,this._scene,r,n,u,x,y):C}catch(C){return k.throwIfAbortError(C),this.getElevation(r,n,u,x,y)}}register(r,n){this.addHandles(n.on("elevation-change",u=>this.emit("elevation-change",u)),n);this._providersFromContext(r).push(n)}unregister(r){this.removeHandles(r);for(const n of[this._im,this._ground,this._scene]){const u=n.indexOf(r);-1this.view.map?.ground,{maximumAutoTileRequests:4})}};b.__decorate([h.property({constructOnly:!0})],a.CombinedElevationProvider.prototype, "view",void 0);b.__decorate([h.property()],a.CombinedElevationProvider.prototype,"spatialReference",null);a.CombinedElevationProvider=b.__decorate([g.subclass("esri.views.3d.support.CombinedElevationProvider")],a.CombinedElevationProvider);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/ElevationQuery":function(){define("exports ../../../../geometry ../../../../core/arrayUtils ../../../../core/has ../../../../core/promiseUtils ../../../support/Scheduler ../../../../geometry/Multipoint".split(" "), function(a,b,q,l,p,k,h){class f{constructor(e,g){this.spatialReference=e;this._view=g}getElevation(e,g,d){return this._view.elevationProvider.getElevation(e,g,0,this.spatialReference,d)}async queryElevation(e,g,d,t,w){return this._view.elevationProvider.queryElevation(e,g,0,this.spatialReference,w,d,t)}}class c{constructor(e,g,d,t){this.spatialReference=g;this._getElevationQueryProvider=d;this._queries=[];this._queryOptions={...t,ignoreInvisibleLayers:!0};this._frameTask=e.registerTask(k.TaskPriority.ELEVATION_QUERY, this)}destroy({completeTasks:e}={completeTasks:!1}){this._frameTask.remove();if(this.running)if(e)this.runTask(k.noBudget);else for(const g of this._queries)g.result.reject(p.createAbortError())}queryElevation(e,g,d,t=0){const w=p.createResolver(),v={x:e,y:g,minDemResolution:t,result:w,signal:d};this._queries.push(v);p.onAbort(d,()=>{q.remove(this._queries,v);w.reject(p.createAbortError())});return w.promise}get running(){return 0[r.x,r.y]),w=g.reduce((r,n)=>Math.min(r,n.minDemResolution),Infinity);t=new h({points:t,spatialReference:this.spatialReference});var v=1!!r.signal)?new AbortController:null,m=null!=v?v.signal:g[0].signal;if(null!=v){let r=0;g.forEach(n=>p.onAbort(n.signal,()=>{r++;n.result.reject(p.createAbortError());r===g.length&&v.abort()}))}d.queryElevation(t,{...this._queryOptions,minDemResolution:w,signal:m}).then(r=>{g.forEach((n, u)=>{null!=n.signal&&n.signal.aborted?n.result.reject(p.createAbortError()):n.result.resolve(r.geometry.points[u][2])})}).catch(r=>{g.forEach(n=>n.result.reject(r))})}else g.forEach(r=>r.result.reject());e.madeProgress()}get test(){}}a.ElevationQuery=c;a.ViewElevationProvider=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/ElevationRange":function(){define(["exports"],function(a){class b{constructor(q=Infinity,l=-Infinity){this.elevationRangeMin=q;this.elevationRangeMax= l}get elevationRangeValid(){return!Number.isNaN(this.elevationRangeMin)}invalidateElevationRange(){this.elevationRangeMin=NaN}expandElevationRangeValues(q,l){this.elevationRangeMin=Math.min(this.elevationRangeMin,q);this.elevationRangeMax=Math.max(this.elevationRangeMax,l)}expandElevationRange(q){this.elevationRangeMin=Math.min(this.elevationRangeMin,q.elevationRangeMin);this.elevationRangeMax=Math.max(this.elevationRangeMax,q.elevationRangeMax)}setElevationRange(q){this.elevationRangeMin=q.elevationRangeMin; this.elevationRangeMax=q.elevationRangeMax}}a.ElevationRange=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/DisplayQualityProfile":function(){define(["../../../core/has","../../../core/time"],function(a,b){function q(){const k=!!a("esri-mobile"),h=!!a("ios"),f=b.Milliseconds(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:25E3,maxNumberOfDrawCalls:8E3,maxTotalNumberOfVertices:255E4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0, uncompressedTextureDownsamplingEnabled:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:5E4},sceneService:{object:{lodFactor:.2},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5},uncompressedTextureDownsamplingEnabled:!0},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:b.Milliseconds(0),antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1, reflections:!1,ambientOcclusion:!1,memoryLimit:200+p.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:1E5,maxNumberOfDrawCalls:17E3,maxTotalNumberOfVertices:625E4,polygonLodFactor:k?.8:1,polylineLodFactor:k?1.2:1.5,snapshotAvailable:!h,skipHighSymbolLods:!1,uncompressedTextureDownsamplingEnabled:k},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:13E4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1}, pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:k},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!a("disable-feature:reduce-map-tile-levels")},fadeDuration:f,antialiasingEnabled:!1,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:k?600+p.GalaxyS20:750+p.FullHD,additionalCacheMemory:k?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:1E5, maxNumberOfDrawCalls:17E3,maxTotalNumberOfVertices:125E5,polygonLodFactor:k?1.2:2,polylineLodFactor:k?1.2:2,snapshotAvailable:!h,skipHighSymbolLods:!1,uncompressedTextureDownsamplingEnabled:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:23E4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!a("disable-feature:reduce-map-tile-levels")}, fadeDuration:f,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,memoryLimit:k?900+p.SurfacePro7:1500+p.FullHDRetina,additionalCacheMemory:k?-150:0,frameRate:0,maximumPixelRatio:k?1:Infinity}}}class l{static isValidProfile(k){return k in l.profiles}static getDefaultProfile(){return a("esri-iPhone")?"low":"medium"}static apply(k,h){k=l.profiles[k];h.graphics3D.maxTotalNumberOfFeatures=k.graphics3D.maxTotalNumberOfFeatures; h.graphics3D.maxNumberOfDrawCalls=k.graphics3D.maxNumberOfDrawCalls;h.graphics3D.maxTotalNumberOfVertices=k.graphics3D.maxTotalNumberOfVertices;h.graphics3D.polygonLodFactor=k.graphics3D.polygonLodFactor;h.graphics3D.polylineLodFactor=k.graphics3D.polylineLodFactor;h.graphics3D.snapshotAvailable=k.graphics3D.snapshotAvailable;h.graphics3D.skipHighSymbolLods=k.graphics3D.skipHighSymbolLods;h.graphics3D.uncompressedTextureDownsamplingEnabled=k.graphics3D.uncompressedTextureDownsamplingEnabled;h.sceneService.object.lodFactor= k.sceneService.object.lodFactor;h.sceneService.point.lodFactor=k.sceneService.point.lodFactor;h.sceneService.integratedMesh.lodFactor=k.sceneService.integratedMesh.lodFactor;h.sceneService.pointCloud.lodFactor=k.sceneService.pointCloud.lodFactor;h.sceneService.uncompressedTextureDownsamplingEnabled=k.sceneService.uncompressedTextureDownsamplingEnabled;h.tiledSurface.lodBias=k.tiledSurface.lodBias;h.tiledSurface.angledSplitBias=k.tiledSurface.angledSplitBias;h.tiledSurface.vtlContentZoom=k.tiledSurface.vtlContentZoom; h.tiledSurface.elevationLevelDelta=k.tiledSurface.elevationLevelDelta;h.tiledSurface.reduceTileLevelDifferences=k.tiledSurface.reduceTileLevelDifferences;h.heatmap.pixelRatio=k.heatmap.pixelRatio;h.heatmap.maxTotalNumberOfFeatures=k.heatmap.maxTotalNumberOfFeatures;h.fadeDuration=k.fadeDuration;h.antialiasingEnabled=k.antialiasingEnabled;h.physicallyBasedRenderingEnabled=k.physicalBasedRenderingEnabled;h.highQualityTransparency=k.highQualityTransparency;h.highResolutionAtmosphere=k.highResolutionAtmosphere; h.reflections=k.reflections;h.ambientOcclusion=k.ambientOcclusion;h.memoryLimit=k.memoryLimit;h.additionalCacheMemory=k.additionalCacheMemory;h.frameRate=k.frameRate;h.maximumPixelRatio=k.maximumPixelRatio}}l.test={reset(){const k=q();for(const h of Object.keys(k))l.profiles[h]=k[h]}};const p={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};(l||={}).profiles=q();return l})},"esri/views/3d/support/HighlightOptions":function(){define("../../../chunks/tslib.es6 ../../../Color ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../webgl-engine/effects/highlight/HighlightDefaults".split(" "), function(a,b,q,l,p,k,h,f,c){q=class extends q{constructor(){super(...arguments);this.color=c.defaultColor.clone();this.haloColor=null;this.haloOpacity=c.defaultHaloOpacity;this.fillOpacity=c.defaultFillOpacity;this.shadowOpacity=c.defaultShadowOpacity;this.shadowColor=c.defaultShadowColor.clone();this.shadowDifference=c.defaultShadowDifference}};a.__decorate([l.property({type:b})],q.prototype,"color",void 0);a.__decorate([l.property({type:b})],q.prototype,"haloColor",void 0);a.__decorate([l.property()], q.prototype,"haloOpacity",void 0);a.__decorate([l.property()],q.prototype,"fillOpacity",void 0);a.__decorate([l.property()],q.prototype,"shadowOpacity",void 0);a.__decorate([l.property({type:b})],q.prototype,"shadowColor",void 0);a.__decorate([l.property()],q.prototype,"shadowDifference",void 0);return q=a.__decorate([f.subclass("esri.views.3d.support.HighlightOptions")],q)})},"esri/views/3d/webgl-engine/effects/highlight/HighlightDefaults":function(){define(["exports","../../../../../Color"],function(a, b){const q=new b([0,255,255]);b=new b([0,0,0]);a.defaultColor=q;a.defaultFillOpacity=.25;a.defaultHaloOpacity=1;a.defaultShadowColor=b;a.defaultShadowDifference=.2;a.defaultShadowOpacity=.4;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/MapCoordsHelper":function(){define("exports ../../../geometry ../../../core/Error ../../../core/unitUtils ../../../geometry/ellipsoidUtils ../../../portal/support/geometryServiceUtils ../../../rest/geometryService/project ../../../rest/support/ProjectParameters ../../../geometry/Point ../../../geometry/SpatialReference".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g{constructor(d,t){this.spatialReference=t;this.unitInMeters=l.getMetersPerUnitForSR(this.spatialReference,p.getReferenceEllipsoid(this.spatialReference).metersPerDegree);this._geometryServiceURLPromise=k.getGeometryServiceURL(d&&"portalItem"in d?d.portalItem:void 0).catch(()=>{throw new q("mapcoordshelper:missing-geometry-service","Must specify geometryService in esri/config");})}async toGeographic(d){var t=await this._geometryServiceURLPromise;let w=!0;Array.isArray(d[0])&& "number"!==typeof d[0]||(d=[d],w=!1);d=d.map(v=>v instanceof c?v:new c(v,this.spatialReference));d=new f({geometries:d,outSpatialReference:e.WGS84});t=(await h.project(t,d)).map(v=>"point"===v.type?[v.x,v.y]:void 0).filter(v=>!!v);return w?t:t[0]}}a.MapCoordsHelper=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/portal/support/geometryServiceUtils":function(){define("exports ../../config ../../core/Error ../Portal ../../rest/geometryService/project ../../rest/support/ProjectParameters".split(" "), function(a,b,q,l,p,k){async function h(f=null,c){if(b.geometryServiceUrl)return b.geometryServiceUrl;if(!f)throw new q("internal:geometry-service-url-not-configured");f="portal"in f?f.portal||l.getDefault():f;await f.load({signal:c});c=f.helperServices?.geometry?.url;if(!c)throw new q("internal:geometry-service-url-not-configured");return c}a.getGeometryServiceURL=h;a.projectGeometry=async function(f,c,e=null,g){e=await h(e,g);f=new k({geometries:[f],outSpatialReference:c});if((g=await p.project(e, f,{signal:g}))&&Array.isArray(g)&&1===g.length)return g[0];throw new q("internal:geometry-service-projection-failed");};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/rest/geometryService/project":function(){define("exports ../../request ../../core/accessorSupport/ensureType ../../geometry/support/jsonUtils ../utils ./utils ../support/ProjectParameters".split(" "),function(a,b,q,l,p,k,h){const f=q.ensureType(h);a.project=async function(c,e,g){e=f(e);c=p.parseUrl(c);const d= {...c.query,f:"json",...e.toJSON()},t=e.outSpatialReference,w=l.getJsonType(e.geometries[0]);e=p.asValidOptions(d,g);return b(c.path+"/project",e).then(({data:{geometries:v}})=>k.decodeGeometries(v,w,t))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/rest/support/ProjectParameters":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../geometry/support/jsonUtils ../../geometry/support/spatialReferenceUtils".split(" "), function(a,b,q,l,p,k,h,f,c){b=class extends b.JSONSupport{constructor(e){super(e);this.geometries=[];this.transformForward=this.transformation=this.outSpatialReference=null}toJSON(){const e=this.geometries.map(t=>t.toJSON()),g=this.geometries[0],d={};d.outSR=c.srToRESTValue(this.outSpatialReference);d.inSR=c.srToRESTValue(g.spatialReference);d.geometries=JSON.stringify({geometryType:f.getJsonType(g),geometries:e});this.transformation&&(d.transformation=this.transformation.wkid||JSON.stringify(this.transformation)); null!=this.transformForward&&(d.transformForward=this.transformForward);return d}};a.__decorate([q.property()],b.prototype,"geometries",void 0);a.__decorate([q.property({json:{read:{source:"outSR"}}})],b.prototype,"outSpatialReference",void 0);a.__decorate([q.property()],b.prototype,"transformation",void 0);a.__decorate([q.property()],b.prototype,"transformForward",void 0);return b=a.__decorate([h.subclass("esri.rest.support.ProjectParameters")],b)})},"esri/views/3d/support/popupHitTest":function(){define(["exports", "../../../layers/support/layerUtils","../terrain/LayerClass","../../support/hitTestSelectUtils"],function(a,b,q,l){function p(f,c){const e=new Set,g=[];var d=f.basemapTerrain.numLayers(q.LayerClass.MAP);for(--d;0<=d;d--){const t=f.basemapTerrain.layerViewByIndex(d,q.LayerClass.MAP);e.add(t.layer.uid);g.push(t)}f=f.basemapTerrain.overlayManager.renderer.layers;for(const {uid:t}of f)if(f=c.get(t))e.add(t),g.push(f);g.reverse();return{layerUids:e,layerViews:g}}function k(f){const c=new Map;for(const e of f.allLayerViews)c.set(e.layer.uid, e);return c}const h={layerUids:new Set,layerViews:[]};a.popupHitTest=async function(f,c){const {results:e,ground:g}=await l.hitTestSelectSimilarDistance(f,c),d=(!g.layer||!b.isIntegratedMeshLayer(g.layer.type))&&g.mapPoint,t=[];c=k(f);const w=d?p(f,c):h;let v=0,m=0;const r=()=>{const u=w.layerViews[m];d&&u&&"fetchPopupFeaturesAtLocation"in u&&t.push({mapPoint:g.mapPoint,layerView:u});++m};let n=null;for(;vg.distance)&&w.layerViews[m]!==y?r():(t.push({graphic:u.graphic,layerView:y}),++v)}else r()}n??=g.mapPoint;return{hits:t,location:n}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/LayerClass":function(){define(["exports"],function(a){a.LayerClass=void 0; var b=a.LayerClass||(a.LayerClass={});b[b.ELEVATION=0]="ELEVATION";b[b.MAP=1]="MAP";a.LayerClasses=[a.LayerClass.ELEVATION,a.LayerClass.MAP];Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/hitTestSelectUtils":function(){define(["exports"],function(a){function b(q){return"graphic"===q?.type}a.filterGraphicHits=function(q){return q.filter(b)};a.findFirstGraphicHit=function(q){return q.find(b)??null};a.hitTestSelectSimilarDistance=async function(q,l){if("2d"===q.type)return q.hitTest(l); q=await q.hitTest(l);if(0===q.results.length)return q;l=q.results[0];const p=1.05*(l.distance??0),k=q.results.findIndex(h=>(h.distance??0)>p);-1!==k&&(q.results=q.results.slice(0,k));l&&q.ground.distance>p&&(q.ground.mapPoint=null);return q};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/QualitySettings":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/time ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){let c=class extends b{constructor(){super(...arguments);this.minTotalNumberOfFeatures=2E3;this.maxTotalNumberOfFeatures=5E4;this.maxNumberOfDrawCalls=17E3;this.maxTotalNumberOfVertices=17E5;this.snapshotAvailable=!0;this.polylineLodFactor=this.polygonLodFactor=1;this.uncompressedTextureDownsamplingEnabled=this.skipHighSymbolLods=!1}};a.__decorate([l.property()],c.prototype,"minTotalNumberOfFeatures",void 0);a.__decorate([l.property()],c.prototype,"maxTotalNumberOfFeatures", void 0);a.__decorate([l.property()],c.prototype,"maxNumberOfDrawCalls",void 0);a.__decorate([l.property()],c.prototype,"maxTotalNumberOfVertices",void 0);a.__decorate([l.property()],c.prototype,"snapshotAvailable",void 0);a.__decorate([l.property()],c.prototype,"polygonLodFactor",void 0);a.__decorate([l.property()],c.prototype,"polylineLodFactor",void 0);a.__decorate([l.property()],c.prototype,"skipHighSymbolLods",void 0);a.__decorate([l.property()],c.prototype,"uncompressedTextureDownsamplingEnabled", void 0);c=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.Graphics3DSettings")],c);let e=class extends b{constructor(){super(...arguments);this.lodFactor=1}};a.__decorate([l.property()],e.prototype,"lodFactor",void 0);e=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.LoDFactorSettings")],e);let g=class extends b{constructor(){super(...arguments);this.object=new e;this.point=new e;this.integratedMesh=new e;this.pointCloud=new e;this.uncompressedTextureDownsamplingEnabled= !1}};a.__decorate([l.property({type:e})],g.prototype,"object",void 0);a.__decorate([l.property({type:e})],g.prototype,"point",void 0);a.__decorate([l.property({type:e})],g.prototype,"integratedMesh",void 0);a.__decorate([l.property({type:e})],g.prototype,"pointCloud",void 0);a.__decorate([l.property()],g.prototype,"uncompressedTextureDownsamplingEnabled",void 0);g=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.SceneServiceSettings")],g);let d=class extends b{constructor(){super(...arguments); this.lodBias=0;this.vtlContentZoom=this.angledSplitBias=1;this.elevationLevelDelta=3;this.reduceTileLevelDifferences=!0}};a.__decorate([l.property()],d.prototype,"lodBias",void 0);a.__decorate([l.property()],d.prototype,"angledSplitBias",void 0);a.__decorate([l.property()],d.prototype,"vtlContentZoom",void 0);a.__decorate([l.property()],d.prototype,"elevationLevelDelta",void 0);a.__decorate([l.property()],d.prototype,"reduceTileLevelDifferences",void 0);d=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")], d);let t=class extends b{constructor(){super(...arguments);this.pixelRatio=1;this.maxTotalNumberOfFeatures=5E4}};a.__decorate([l.property()],t.prototype,"pixelRatio",void 0);a.__decorate([l.property()],t.prototype,"maxTotalNumberOfFeatures",void 0);t=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.HeatmapSettings")],t);b=class extends b{constructor(){super(...arguments);this.graphics3D=new c;this.sceneService=new g;this.tiledSurface=new d;this.heatmap=new t;this.fadeDuration=q.Milliseconds(400); this.antialiasingEnabled=!0;this.physicallyBasedRenderingEnabled=!1;this.highQualityTransparency=!0;this.ambientOcclusion=this.reflections=this.highResolutionAtmosphere=!1;this.memoryLimit=750;this.additionalCacheMemory=0;this.frameRate=void 0;this.maximumPixelRatio=Infinity}};a.__decorate([l.property({type:c})],b.prototype,"graphics3D",void 0);a.__decorate([l.property({type:g})],b.prototype,"sceneService",void 0);a.__decorate([l.property({type:d})],b.prototype,"tiledSurface",void 0);a.__decorate([l.property({type:t})], b.prototype,"heatmap",void 0);a.__decorate([l.property()],b.prototype,"fadeDuration",void 0);a.__decorate([l.property()],b.prototype,"antialiasingEnabled",void 0);a.__decorate([l.property()],b.prototype,"physicallyBasedRenderingEnabled",void 0);a.__decorate([l.property()],b.prototype,"highQualityTransparency",void 0);a.__decorate([l.property()],b.prototype,"highResolutionAtmosphere",void 0);a.__decorate([l.property()],b.prototype,"reflections",void 0);a.__decorate([l.property()],b.prototype,"ambientOcclusion", void 0);a.__decorate([l.property()],b.prototype,"memoryLimit",void 0);a.__decorate([l.property()],b.prototype,"additionalCacheMemory",void 0);a.__decorate([l.property()],b.prototype,"frameRate",void 0);a.__decorate([l.property()],b.prototype,"maximumPixelRatio",void 0);return b=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings")],b)})},"esri/views/3d/support/RenderCoordsHelper":function(){define("exports ../../../core/mathUtils ../../../core/unitUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../chunks/vec32 ../../../geometry/ellipsoidUtils ../../../geometry/spatialReferenceEllipsoidUtils ../../../geometry/projection/projectPointToVector ../../../geometry/projection/projectVectorToPoint ../../../geometry/projection/projectVectorToVector ../../../geometry/support/Axis ../../../geometry/support/coordinateSystem ../../../geometry/support/plane ../../../geometry/support/vector ../../../geometry/support/vectorStacks ../../../layers/graphics/dehydratedFeatureUtils ../../ViewingMode".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){class n{constructor(u,x,y,z){this.viewingMode=u;this.spatialReference=x;this.unitInMeters=y;this._coordinateSystem=z;this._tmpCoordinateSystem=d.create(z);this.referenceEllipsoid=k.getReferenceEllipsoid(x);this.sphericalPCPF=h.getSphericalPCPF(x)}set extent(u){u&&d.setExtent(this._coordinateSystem,u,this._coordinateSystem)}getAltitude(u){return d.altitudeAt(this._coordinateSystem,u)}setAltitude(u,x,y=u){return d.setAltitudeAt(this._coordinateSystem,y,x, u)}setAltitudeOfTransformation(u,x){d.setAltitudeOfTransformation(this._coordinateSystem,x,u,x)}worldUpAtPosition(u,x){return d.normalAt(this._coordinateSystem,u,x)}worldBasisAtPosition(u,x,y){return d.axisAt(this._coordinateSystem,u,x,y)}basisMatrixAtPosition(u,x){const y=this.worldBasisAtPosition(u,g.Axis.X,v.sv3d.get()),z=this.worldBasisAtPosition(u,g.Axis.Y,v.sv3d.get());u=this.worldBasisAtPosition(u,g.Axis.Z,v.sv3d.get());l.set(x,y[0],y[1],y[2],0,z[0],z[1],z[2],0,u[0],u[1],u[2],0,0,0,0,1);return x}headingAtPosition(u, x){const y=this.worldUpAtPosition(u,v.sv3d.get());u=this.worldBasisAtPosition(u,g.Axis.Y,v.sv3d.get());x=w.angleAroundAxis(x,u,y);return b.rad2deg(x)}intersectManifoldClosestSilhouette(u,x,y){d.elevate(this._coordinateSystem,x,this._tmpCoordinateSystem);d.intersectRayClosestSilhouette(this._tmpCoordinateSystem,u,y);return y}intersectManifold(u,x,y){d.elevate(this._coordinateSystem,x,this._tmpCoordinateSystem);x=v.sv3d.get();return d.intersectRay(this._tmpCoordinateSystem,u,x)?p.copy(y,x):null}intersectInfiniteManifold(u, x,y){if(this.viewingMode===r.ViewingMode.Global)return this.intersectManifold(u,x,y);d.elevate(this._coordinateSystem,x,this._tmpCoordinateSystem);x=this._tmpCoordinateSystem.value;const z=v.sv3d.get();return t.intersectRay(x.plane,u,z)?p.copy(y,z):null}toRenderCoords(u,x,y){return m.isDehydratedPoint(u)?f.projectPointToVector(u,x,this.spatialReference):e.projectVectorToVector(u,x,y,this.spatialReference)}fromRenderCoords(u,x,y=null){return m.isDehydratedPoint(x)?(null!=y&&(x.spatialReference=y), c.projectVectorToPoint(u,this.spatialReference,x)?x:null):e.projectVectorToVector(u,this.spatialReference,x,y)?x:null}static create(u,x){switch(u){case r.ViewingMode.Local:return new n(r.ViewingMode.Local,x,q.getMetersPerUnitForSR(x),d.createLocal());case r.ViewingMode.Global:return new n(r.ViewingMode.Global,x,1,d.createGlobal(x))}}static renderUnitScaleFactor(u,x){return q.getMetersPerCartesianUnitForSR(u)/q.getMetersPerCartesianUnitForSR(x)}}a.RenderCoordsHelper=n;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/support/ResourceController":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/handleUtils ../../../core/has ../../../core/maybe ../../../core/reactiveUtils ../../../core/scheduling ../../../core/signal ../../../core/time ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./index ./MemoryController ./StreamDataLoader ../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){q=class extends q{constructor(){super(...arguments);this.updating=!1}};b.__decorate([g.property({readOnly:!0})],q.prototype,"updating",void 0);q=b.__decorate([w.subclass("esri.views.3d.support.ResourceController.ResourceControllerMain")],q);let u=class extends q{constructor(){super(...arguments);this._normalTask=this._immediateTask=n.ImmediateTask;this._updatingObjects=c.signal([]);this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler= n.newScheduler();this._memoryController=m.newMemoryController(this.view);this._streamDataLoader=new r.StreamDataLoader;this._streamDataLoader.setup(v.maxDownloadSlots,v.downloadSlotsPerClient,this._scheduler);this.addHandles([h.watch(()=>this.view.state?.mode,x=>{null!=x&&(this._scheduler.state=x)},h.sync),h.watch(()=>this.view.stationary,()=>this._stationaryChangedHandler())]);this._frameTask=f.addFrameTask({update:x=>this._frame(x)});this._immediateTask=this._scheduler.registerTask(n.TaskPriority.RESOURCE_CONTROLLER_IMMEDIATE); this._normalTask=this._scheduler.registerTask(n.TaskPriority.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove();this._normalTask.remove();this._frameTask=k.removeMaybe(this._frameTask);this._streamDataLoader=k.destroyMaybe(this._streamDataLoader);this._memoryController=k.destroyMaybe(this._memoryController);this._scheduler=k.destroyMaybe(this._scheduler);this.view=null}get updating(){return!!(this._memoryController?.updating||this._streamDataLoader?.updating||this._immediateTask?.updating)|| this._updatingObjects?.value.some(x=>x.updating)}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}createStreamDataRequester(x){const y=this._streamDataLoader;return{request(z,A,B){return y.request(z,A,x,B)},get busy(){return!y.hasDownloadSlots(x)}}}addUpdatingObject(x){const y=this._updatingObjects;y.value=[...y.value,x];return l.makeHandle(()=>{y.value=y.value.filter(z=>z!==x)})}_frame(x){if(!this.view.suspended){if(this.view.stateManager&&(this.view.stateManager.step(e.secondsFromMilliseconds(x.deltaTime)), !this._scheduler))return;this._memoryController.update();this._scheduler.updateBudget(x)&&this._scheduler.frame()}}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}get test(){}};b.__decorate([g.property()],u.prototype,"view",void 0);b.__decorate([g.property()],u.prototype,"_scheduler",void 0);b.__decorate([g.property()],u.prototype,"_memoryController",void 0);b.__decorate([g.property()],u.prototype,"_streamDataLoader",void 0);b.__decorate([g.property()],u.prototype,"_immediateTask", void 0);b.__decorate([g.property()],u.prototype,"_normalTask",void 0);b.__decorate([g.property()],u.prototype,"_updatingObjects",void 0);b.__decorate([g.property({readOnly:!0})],u.prototype,"updating",null);u=b.__decorate([w.subclass("esri.views.3d.support.ResourceController")],u);a.newResourceController=function(x){return new u({view:x})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/index":function(){define(["exports"],function(a){a.ClientType=void 0;(function(q){q[q.ELEVATION= 0]="ELEVATION";q[q.BASEMAP=1]="BASEMAP";q[q.I3S_INDEX=2]="I3S_INDEX";q[q.I3S_DATA=3]="I3S_DATA";q[q.SYMBOLOGY=4]="SYMBOLOGY"})(a.ClientType||(a.ClientType={}));const b=(()=>{const q=[];q[a.ClientType.ELEVATION]=10;q[a.ClientType.BASEMAP]=10;q[a.ClientType.I3S_INDEX]=10;q[a.ClientType.I3S_DATA]=10;q[a.ClientType.SYMBOLOGY]=5;return q})();a.downloadSlotsPerClient=b;a.maxDownloadSlots=30;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/MemoryController":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/Logger ../../../core/MemCache ../../../core/scheduling ../../../core/accessorSupport/decorators/property ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./MemoryManagedView".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){let d=class extends q{constructor(t){super(t);this._quality=1;this._usedMemory=0;this._updating=!1;this._downscaleMemoryUsed=this._stableQuality=0;this._canFastRecover=!1;this._memoryPredicted=0;this._cacheStorage=new k.MemCacheStorage;this._warnMemoryUsage=null;this._numQualityChanges=0;this._maxMemory=750;this._additionalCacheMemory=0;this.addHandles(h.addFrameTask({prepare:()=>this._updateMemory()}))}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(t){null== t||0>=t||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory=this._memoryPredicted)||this._updating){var t=this._layersUpdating();if(.6>this._memoryPredicted&&this._canFastRecover)this._stableQuality=this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._updateQuality(1);else if(t){if(1.1this._usedMemory&&1>this._quality?(this._stableQuality=this._quality,t=this._updateQuality(this._quality+.05)):1>this._quality&&(this._canFastRecover=!0));this._updating=t}}_updateQuality(t){t=Math.min(Math.max(t, .1),1);if(t===this._quality)return!1;this._quality=t;++this._numQualityChanges;return!0}_layersUpdating(){return this.view.allLayerViews.some(t=>!!t.updating)}_updateMemory(){if(this.view){this.view._stage?.renderer?.tick();var t=this.view._stage?.renderer?.usedMemory,w=(this.view.basemapTerrain?.usedMemory??0)+(t?t.fbos+t.edges+t.plugins:0),v=0;this.view.allLayerViews&&this.view.allLayerViews.forEach(r=>{if(g.isMemoryManagedView(r)){const n=r.ignoresMemoryFactor?this._quality:1;w+=r.usedMemory*n; v+=r.unloadedMemory*n}});var m=null==this._warnMemoryUsage||Math.round(10*w)!==Math.round(10*this._warnMemoryUsage);t=1048576*this.maxMemory;if(w>t&&m){this._warnMemoryUsage=w;m=n=>(n/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+" MB";const r=Math.round(100*this._quality);p.getLogger(this).warn(`Memory Limit exceeded! Limit: ${m(t)} Current: ${m(w)} Projected: ${m(w+v)} Quality: ${r}%`)}this._usedMemory=w/t;this._memoryPredicted=(w+v)/t;this._cacheStorage.maxSize=Math.max(0,t-w+1048576* this.additionalCacheMemory)}}get test(){}};b.__decorate([f.property({constructOnly:!0})],d.prototype,"view",void 0);b.__decorate([f.property()],d.prototype,"maxMemory",null);b.__decorate([f.property()],d.prototype,"additionalCacheMemory",null);b.__decorate([f.property({readOnly:!0})],d.prototype,"memoryFactor",null);b.__decorate([f.property({readOnly:!0})],d.prototype,"updating",null);b.__decorate([f.property({readOnly:!0})],d.prototype,"usedMemory",null);b.__decorate([f.property({readOnly:!0})], d.prototype,"usedCacheMemory",null);b.__decorate([f.property()],d.prototype,"_quality",void 0);b.__decorate([f.property()],d.prototype,"_usedMemory",void 0);b.__decorate([f.property()],d.prototype,"_updating",void 0);b.__decorate([f.property()],d.prototype,"_stableQuality",void 0);b.__decorate([f.property()],d.prototype,"_maxMemory",void 0);b.__decorate([f.property()],d.prototype,"_additionalCacheMemory",void 0);d=b.__decorate([e.subclass("esri.views.3d.support.MemoryController")],d);a.minQuality= .1;a.newMemoryController=function(t){return new d({view:t})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/MemoryManagedView":function(){define(["exports"],function(a){a.isMemoryManagedView=function(b){return"usedMemory"in b&&"unloadedMemory"in b&&"ignoresMemoryFactor"in b};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/StreamDataLoader":function(){define("exports ../../../chunks/tslib.es6 ../../../request ../../../core/Accessor ../../../core/arrayUtils ../../../core/Error ../../../core/has ../../../core/lang ../../../core/maybe ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ./AsyncWorkerQueue ./ImageWithType ../terrain/TerrainData ../webgl-engine/lib/Util ../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(z){if(2>z.byteLength)return"unknown";z=new Uint8Array(z,0,z.byteLength);return 137===z[0]&&80===z[1]?"image/png":71===z[0]&&73===z[1]?"image/gif":66===z[0]&&77===z[1]?"image/bmp":255===z[0]&&216===z[1]?"image/jpeg":"unknown"}a.StreamDataLoader=class extends l{constructor(){super(...arguments);this._tasks=new Map;this._onLoadQueue=[];this._doneQueue=[];this.updating=!1}setup(z,A,B){this._loadQueue=new w.AsyncWorkerQueue((C,D)=>this._startLoading(C, D),(C,D)=>this._doneLoadingCB(C,D),z,A);B&&(this._frameTask=B.registerTask(n.TaskPriority.STREAM_DATA_LOADER,this))}destroy(){this._frameTask=c.removeMaybe(this._frameTask);this._tasks.forEach(z=>c.abortMaybe(z.abortController));this._loadQueue=c.destroyMaybe(this._loadQueue);this._tasks=this._doneQueue=this._onLoadQueue=null}hasDownloadSlots(z){return this._loadQueue.hasQuota(z)}request(z,A,B,C={}){const D=e.createResolver();D.__signal=null!=C?C.signal:null;const F=this._createOrUpdateTask(z,A,B, C,D);e.onAbort(C,()=>this._cancelRequest(F,D));return D.promise}_createTask(z,A,B,C,D,F){z=new y(z,A,B,C,D);this._updateTask(z,F);this._tasks.set(D,z);1===this._tasks.size&&this._set("updating",!0);this._loadQueue.push(z);return z}_cancelRequest(z,A){p.removeUnordered(z.resolvers,A);A.reject(e.createAbortError());0===z.resolvers.length&&(z.status===a.TaskStatus.DOWNLOADING&&(z.status=a.TaskStatus.CANCELLED,this._loadQueue.cancel(z),z.abortController?.abort(),z.request=null,z.abortController=null), z.status=a.TaskStatus.CANCELLED,this._tasks.delete(z.key),0===this._tasks.size&&this._set("updating",!1))}_updateTask(z,A){z.resolvers.push(A)}_createOrUpdateTask(z,A,B,C,D){const F=`${C?.uid||z}:${A}:${B}`,H=this._tasks.get(F);return H?(this._updateTask(H,D),H):this._createTask(z,C,A,B,F,D)}_doneLoadingCB(z,A){this._loadQueue&&(r.assert(z.status===a.TaskStatus.DOWNLOADING),z.status=a.TaskStatus.DOWNLOADED,this._frameTask?this._doneQueue.push({task:z,err:A}):this._doneLoading(z,A))}get running(){return 0< this._doneQueue.length||0{z.duration=performance.now()-z.startTime;z.size=N instanceof ArrayBuffer?N.byteLength:z.size||0;z.result=N;this._frameTask?this._onLoadQueue.push({callback:A, task:z}):(z.abortController=null,A(z))},H=N=>{z.status===a.TaskStatus.DOWNLOADING&&A(z,N)};if("image+type"!==z.docType)return z.request.then(N=>F(N.data),H),!0;z.request.then(N=>{N=N.data;const E=u(N);C="image";z.size=N.byteLength;if("unknown"===E)z.request=q(z.url,{responseType:C,timeout:B,signal:D}),z.request.then(I=>F(I.data),H);else{N=new Blob([N],{type:E});var G=window.URL.createObjectURL(N);z.request=q(G,{responseType:C,timeout:B,signal:D});z.request.then(I=>F(new v.ImageWithType(I.data,E)), H).finally(()=>window.URL.revokeObjectURL(G))}},H);return!0}get test(){}};b.__decorate([g.property({readOnly:!0})],a.StreamDataLoader.prototype,"updating",void 0);a.StreamDataLoader=b.__decorate([t.subclass("esri.views.3d.support.StreamDataLoader")],a.StreamDataLoader);const x={numRetries:0};class y extends w.BaseTask{constructor(z,A,B,C,D){super(C);this.url=z;this.options=A;this.docType=B;this.key=D;this.result=null;this.status=a.TaskStatus.QUEUED;this.abortController=this.request=null;this.resolvers= [];this.startTime=0;this.numRetries=x.numRetries}}a.TaskStatus=void 0;(function(z){z[z.QUEUED=1]="QUEUED";z[z.DOWNLOADING=2]="DOWNLOADING";z[z.DOWNLOADED=3]="DOWNLOADED";z[z.CANCELLED=4]="CANCELLED"})(a.TaskStatus||(a.TaskStatus={}));a.test=x;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/AsyncWorkerQueue":function(){define(["exports","../../../core/has","../webgl-engine/lib/Util"],function(a,b,q){class l{constructor(f){this.client=f;this._cancelled=!1;this.duration= this.size=0}}class p{constructor(f){this.typeWorkerQuota=f;this.tasks=[];this.numWorkers=0;this.statistics=new k}}class k{constructor(){this.speed=this.duration=this.size=this.requests=0}}class h{constructor(f,c,e,g){this._workerFunc=f;this._callbackFunc=c;this._maxTotalNumWorkers=e;this._totalNumWorkers=0;this._clients=g.map(d=>new p(d))}destroy(){this._clients.length=0}hasQuota(f){return(f=this._clients[f])?this._totalNumWorkersthis._taskCallback(e,g))):c.tasks.push(f))}cancel(f){this._taskFinished(f);f._cancelled=!0}_taskFinished(f){const c=this._clients[f.client];this._totalNumWorkers--;c&&(c.numWorkers--,c.statistics.requests++,c.statistics.size+=f.size||0,c.statistics.duration+=f.duration||0,c.statistics.speed=0this._taskCallback(c,e)))return f.numWorkers++,this._totalNumWorkers++,!0;return!1}_taskCallback(f,c){f._cancelled||(this._callbackFunc(f,c),this._taskFinished(f))}getStatsForType(f){return(f=this._clients[f])? {quota:f.typeWorkerQuota,workers:f.numWorkers,queueSize:f.tasks.length,requestStats:f.statistics}:null}get test(){}}a.AsyncWorkerQueue=h;a.BaseTask=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/ImageWithType":function(){define(["exports"],function(a){class b{constructor(q,l){this.element=q;this.type="image+type";this.isOpaque="image/jpeg"===l}}a.ImageWithType=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainData":function(){define(["exports"], function(a){a.isImageWithType=function(b){return null!=b&&"type"in b&&"image+type"===b.type};a.isRasterTile=function(b){return null!=b&&"type"in b&&"raster-tile"===b.type};a.isTileTexture=function(b){return null!=b&&"type"in b&&"tile-texture"===b.type};a.isVectorTile=function(b){return null!=b&&"type"in b&&"vector-tile"===b.type};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/SceneViewPerformanceInfo":function(){define(["../../../core/ByteSizeUnit","../layers/support/LayerViewPerformanceInfo", "./LayerPerformanceInfo"],function(a,b,q){class l{constructor(p){this.usedMemory=this.totalMemory=0;this.quality=1;this.edgesMemory=this.terrainMemory=this.load=0;this.layerPerformanceInfos=[];this.fboMemory=this.cachedMemory=0;if(null!=p.resourceController){const k=p.resourceController.memoryController;this.totalMemory=(k.maxMemory??0)*a.ByteSizeUnit.MEGABYTES;this.usedMemory=Math.round(k.usedMemory*this.totalMemory);this.quality=p.quality;this.load=p.resourceController.scheduler.load;this.cachedMemory= k.usedCacheMemory}this.terrainMemory=p.basemapTerrain?.usedMemory??0;this.edgesMemory=p._stage?.renderer.usedMemory.edges??0;this.fboMemory=p._stage?.renderer.usedMemory.fbos??0;p.allLayerViews?.items.forEach(k=>{b.isPerformanceInfoLayerView(k)&&this.layerPerformanceInfos.push(new q(k))});this.layerPerformanceInfos.sort((k,h)=>h.memory-k.memory)}}return l})},"esri/core/ByteSizeUnit":function(){define(["exports"],function(a){a.ByteSizeUnit=void 0;var b=a.ByteSizeUnit||(a.ByteSizeUnit={});b[b.KILOBYTES= 1024]="KILOBYTES";b[b.MEGABYTES=1048576]="MEGABYTES";b[b.GIGABYTES=1073741824]="GIGABYTES";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/LayerViewPerformanceInfo":function(){define(["exports"],function(a){class b{constructor(q,l=0,p=0,k=0,h=0,f=null){this.usedMemory=q;this.displayedFeatures=l;this.totalFeatures=p;this.maximumFeatures=k;this.nodes=h;this.core=f}}a.LayerViewPerformanceInfo=b;a.isPerformanceInfoLayerView=function(q){return"performanceInfo"in q};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/LayerPerformanceInfo":function(){define(function(){class a{constructor(b){this.layer=null;this.displayedNumberOfFeatures=this.memory=0;this.totalNumberOfFeatures=this.maximumNumberOfFeatures=null;this.layer=b.layer;b=b.performanceInfo;this.memory=b.usedMemory;this.displayedNumberOfFeatures=b.displayedFeatures;this.maximumNumberOfFeatures=b.maximumFeatures;this.totalNumberOfFeatures=b.totalFeatures}}return a})}, "esri/views/3d/support/SharedSymbolResources":function(){define("exports ../../../core/arrayUtils ../../../core/Handles ../../../core/handleUtils ../../../core/has ../../../core/maybe ../../../core/reactiveUtils ../../../geometry/ellipsoidUtils ../layers/graphics/ObjectResourceCache ./index ./StreamTextureCollection ../webgl-engine/lib/screenSizePerspectiveUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(v){this.streamDataRequester=null;this._graphicsOwners=[];this.cimSymbolRasterizer= this._screenSizePerspectiveHandles=null;this._viewState=v.viewState;this._view=v.view;this._pointsOfInterest=v.pointsOfInterest;this.streamDataRequester=v.resourceController.createStreamDataRequester(e.ClientType.SYMBOLOGY);this.objectResourceCache=new c.ObjectResourceCache((r,n)=>v.resourceController.memoryController.newCache(r,n));this.textures=new g.StreamTextureCollection(this.streamDataRequester,v.view._stage,v.resourceController.scheduler);const m=f.getReferenceEllipsoid(this._view.spatialReference).radius; this.screenSizePerspectiveSettings=d.getSettings(v.viewingMode,m);this.screenSizePerspectiveSettingsLabels=d.getLabelSettings(v.viewingMode,m)}destroy(){this.textures.destroy();this.streamDataRequester=null}addGraphicsOwner(v){if(!v)return l.makeHandle();this._graphicsOwners.push(v);const m=h.watch(()=>v.layer?.screenSizePerspectiveEnabled,()=>this._updateScreenSizePerspectiveEnabled());this._updateScreenSizePerspectiveEnabled();return l.makeHandle(()=>{m.remove();b.removeUnordered(this._graphicsOwners, v);this._updateScreenSizePerspectiveEnabled()})}_updateScreenSizePerspectiveEnabled(){var v=this._graphicsOwners.some(m=>!0===m.layer?.screenSizePerspectiveEnabled);v&&!this._screenSizePerspectiveHandles?(this._screenSizePerspectiveHandles=new q,v=()=>this._updateScreenSizePerspectiveSettings(),this._screenSizePerspectiveHandles.add([h.watch(()=>this._pointsOfInterest.centerOnSurfaceInfrequent.distance,v,h.sync),this._viewState.events.on("camera-projection-changed",v)]),this._updateScreenSizePerspectiveSettings()): v||(this._screenSizePerspectiveHandles=k.destroyMaybe(this._screenSizePerspectiveHandles))}_updateScreenSizePerspectiveSettings(){w.distance=this._pointsOfInterest.centerOnSurfaceInfrequent.distance;w.fovY=this._viewState.camera.fovY;this.screenSizePerspectiveSettings.update(w);this.screenSizePerspectiveSettingsLabels.update(w);this._view._stage.renderView.requestRender()}get test(){}}const w={distance:0,fovY:0};a.SharedSymbolResources=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/layers/graphics/ObjectResourceCache":function(){define("exports ../../../../core/maybe ../../../../core/promiseUtils ../../glTF/DefaultLoadingContext ../../glTF/loader ./wosrLoader".split(" "),function(a,b,q,l,p,k){async function h(c,e,g,d,t){q.throwIfAborted(t);const w=q.onAbort(t,()=>{{const m=c.get(g);null!=m&&0<--m.refCount||(c.delete(g),null!=m&&m.abortController.abort())}});var v=c.get(g);v?v.refCount++:(v=new AbortController,d=d({...t,signal:v.signal}),v={refCount:1,abortController:v, promise:d},c.set(g,v));try{const m=await v.promise;e.put(g,m,m.size);c.delete(g);q.throwIfAborted(t);return m}finally{b.removeMaybe(w)}}class f{constructor(c){this._gltfLoading=new Map;this._wosrLoading=new Map;this._gltfMemCache=c("gltf-resources",()=>{});this._wosrMemCache=c("wosr-resources",()=>{})}destroy(){this._gltfLoading.forEach(c=>c.abortController.abort());this._wosrLoading.forEach(c=>c.abortController.abort());this._gltfMemCache.destroy();this._wosrMemCache.destroy()}loadGLTF(c,e,g){const d= g?`gltfPBR:${c}`:`gltf:${c}`,t=this._gltfMemCache.get(d);return null!=t?Promise.resolve(t):h(this._gltfLoading,this._gltfMemCache,d,w=>p.loadGLTF(new l.DefaultLoadingContext(w.streamDataRequester),c,w,g),e)}loadWOSR(c,e){const g=`wosr:${c}:${e.disableTextures}`,d=this._wosrMemCache.get(g);return null!=d?Promise.resolve(d):h(this._wosrLoading,this._wosrMemCache,g,t=>k.load(c,t),e)}}a.ObjectResourceCache=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/StreamTextureCollection":function(){define("exports ../../../core/promiseUtils ../../../core/urlUtils ./TextureCollection ../webgl-engine/lib/Texture ../../webgl/enums".split(" "), function(a,b,q,l,p,k){class h extends l.TextureCollection{constructor(f,c,e){super(c,e);this._streamDataRequester=f}async fromUrl(f,c,e){b.throwIfAborted(e);e=e?.signal;const g=this.makeUid(f,c);let d=this._textureRequests.get(g);if(!d){const t=new AbortController,w=this._streamDataRequester.request(f,"image",{uid:g,signal:t.signal});d=new l.TextureRequest;d.abortController=t;const v=d;this._textureRequests.set(g,d);d.textureAsync=w.then(async m=>{m=this._createTexture(f,m,c);v.texture=m;v.abortController= null;await m.load(this._stage.renderView.renderingContext);this._stage.add(m);return new l.TextureResult(g,m,()=>this._release(g))},m=>{v.abortController=null;throw m;})}d.referenceCount++;try{return await b.whenOrAbort(d.textureAsync,e)}catch(t){throw this._release(g),t;}}_createTexture(f,c,e){const g={width:c.width,height:c.height,wrap:{s:k.TextureWrapMode.CLAMP_TO_EDGE,t:k.TextureWrapMode.CLAMP_TO_EDGE},preMultiplyAlpha:!0,reloadable:!0};if(q.isSVG(f)){if(e||0===c.width&&0===c.height)f=c.width? c.height/c.width:1,e=e||64,1this._releaseTextureRequest(d));this._textureRequests?.clear()}get updating(){return this._frameTask.updating}fromData(d,t){const w=this.makeUid(d);d=this._textureRequests.get(w); d||(d=new g,d.texture=t(),this._stage&&(d.texture.load(this._stage.renderView.renderingContext),this._stage.add(d.texture)),this._textureRequests.set(w,d));d.referenceCount++;return new e(w,d.texture,()=>this._release(w))}_release(d){const t=this._textureRequests.get(d);t?(1>t.referenceCount&&console.warn("TextureCollection: reference count is \x3c 1 for "+d),t.referenceCount--,1>t.referenceCount&&this._frameTask.schedule(()=>this._releaseNow(d))):console.warn(`TextureCollection: texture doesn't exist: '${d}'`)}get test(){}_releaseNow(d){if(this._textureRequests){var t= this._textureRequests.get(d);!t||0this._estimateSurfaceAltitudeAtCenter();const M=this.view.resourceController.scheduler,K=this.view.basemapTerrain?.elevationQueryCache,J={state:G,scheduler:M,surface:I,renderCoordsHelper:O}; this._set("centerOnSurfaceInfrequent",new n.CenterOnSurface({...J,task:D.TaskPriority.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:P}));this._set("centerOnSurfaceFrequent",new n.CenterOnSurface({...J,task:D.TaskPriority.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:P}));this._set("centerOnContent",new n.CenterOnSurface({...J,task:D.TaskPriority.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()}));this._set("cameraOnSurface", new r.CameraOnSurface({...J,cache:K,task:D.TaskPriority.POINT_OF_INTEREST_INFREQUENT,map:L}));this._set("surfaceGeometryUpdates",new z.SurfaceGeometryUpdates({...J,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]}));this._set("contentGeometryUpdates",new u.ContentGeometryUpdates({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:O}));this._set("surfaceOrigin",new y.StableSurfaceCenter({cache:K,view:this.view}));this._set("focus",new x.Focus({state:G, scheduler:M,surface:I,renderCoordsHelper:O,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(R,Q)=>this._estimateSurfaceIntersectionAtRenderPoint(R,this.view.state.contentCamera,Q)}));this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus);P=this.view.graphics;this._debugCenters.set(this.centerOnContent,new w.PointGraphics(P,"red","CenterOnContent"));this._debugCenters.set(this.centerOnSurfaceFrequent, new w.PointGraphics(P,"red","CenterOnSurface"));this._debugCenters.set(this.centerOnSurfaceInfrequent,new w.PointGraphics(P,"red","CenterOnSurface"));this._debugCenters.set(this.cameraOnSurface,new w.PointGraphics(P,"blue","CameraOnSurface"));this._debugCenters.set(this.focus,new w.PointGraphics(P,"green","Focus"));this.addHandles([p.watch(()=>G.contentCamera,R=>this._cameraChanged(R),p.sync),p.watch(()=>I.extent,()=>this._updateCenterPointsOfInterest()),p.when(()=>!I.updating,()=>this._updateCenterPointsOfInterest(), p.sync),p.on(()=>this.surfaceGeometryUpdates.events,"request-update",()=>this._updateCenterPointsOfInterest()),p.on(()=>this.contentGeometryUpdates.events,"request-update",()=>this._updateCenterOnContent()),p.when(()=>t.debugFlags.SHOW_POI,R=>this._setDebug(R),p.initial)]);this._cameraChanged(this.view.state.contentCamera);for(const R of this._pois)R.runTask()}destroy(){this._setDebug(!1);this._propertiesPool.destroy();for(const G of this._pois)G.destroy();this.surfaceOrigin.destroy()}get updating(){return!(!this.surfaceGeometryUpdates?.updating&& !this._pois.some(G=>G.updating))}get _centerRay(){this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1);return this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const G=this._centerRay;if(null==G)return this._contentAltitudeAtCenter;this.view.sceneIntersectionHelper.intersectRay(G, this._contentIntersector,H,E)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter();return this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const G=this._centerRay;if(null==G)return this._surfaceAltitudeAtCenter;const I=G.origin,O=e.add(H,G.origin, G.direction);this._surfaceIntersector.resetWithRay(G,this.view.state.contentCamera);this.view.basemapTerrain.intersect(this._surfaceIntersector,null,I,O);this._surfaceIntersector.results.min.getIntersectionPoint(H)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H));return this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(G,I,O){G=m.fromRenderAtEye(I,G,N);if(null==G)return null;const L=G.origin,P=e.add(H,G.origin,G.direction);this._surfaceIntersector.resetWithRay(G, I);this.view.basemapTerrain.intersect(this._surfaceIntersector,null,L,P);return this._surfaceIntersector.results.min.getIntersectionPoint(O)?O:null}_cameraChanged(G){this._updateCenterPointsOfInterest();G=G.eye;e.exactEquals(this.renderPointOfView,G)||this._set("renderPointOfView",e.copy(this._propertiesPool.get("renderPointOfView"),G))}_updateCenterPointsOfInterest(){this._contentAltitudeAtCenterDirty=this._surfaceAltitudeAtCenterDirty=this._centerRayDirty=!0;for(const G of this._pois)G.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty= !0;this.centerOnContent.updateRenderLocation()}_setDebug(G){if(G)for(const I of this._pois)this.addHandles(p.watch(()=>I.renderLocation,O=>this._debugCenters.get(I)?.show(O,I.renderCoordsHelper.spatialReference),p.initial),"debug");else this._debugCenters.forEach(I=>I.hide()),this.removeHandles("debug")}get test(){}};b.__decorate([k.property()],a.PointsOfInterest.prototype,"centerOnContent",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"centerOnSurfaceFrequent",void 0);b.__decorate([k.property()], a.PointsOfInterest.prototype,"centerOnSurfaceInfrequent",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"cameraOnSurface",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"focus",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"renderPointOfView",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"surfaceOrigin",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"contentGeometryUpdates",void 0);b.__decorate([k.property()], a.PointsOfInterest.prototype,"surfaceGeometryUpdates",void 0);b.__decorate([k.property({constructOnly:!0})],a.PointsOfInterest.prototype,"view",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"updating",null);a.PointsOfInterest=b.__decorate([c.subclass("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],a.PointsOfInterest);const F=Array,H=g.create(),N=d.create(),E={exclude:new Set([C.terrainId])};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/debugUtils":function(){define("exports ../../../geometry ../../../Graphic ../../../symbols ../../../core/Collection ../../../symbols/PointSymbol3D ../../../symbols/IconSymbol3DLayer ../../../symbols/TextSymbol3DLayer ../../../geometry/Point".split(" "), function(a,b,q,l,p,k,h,f,c){class e{constructor(g,d,t=""){this.graphics=g;this._symbol=new k({symbolLayers:new p([new h({material:{color:d},outline:{color:[255,255,255],size:1},resource:{primitive:"circle"}}),new f({text:t,halo:{color:"white",size:1/.75},material:{color:d},size:12})])})}show(g,d){null!=d&&(this.hide(),g=new c({x:g[0],y:g[1],z:g[2],spatialReference:d}),this._graphic=new q({geometry:g,symbol:this._symbol}),this.graphics.add(this._graphic))}hide(){null!=this._graphic&&(this.graphics.remove(this._graphic), this._graphic=null)}}a.PointGraphics=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/CameraOnSurface":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/Point ../../../ViewingMode ../cameraUtils ../PropertiesPool ./PointOfInterest ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){const u=Array;a.CameraOnSurface=class extends r.PointOfInterest{constructor(y){super(y);this._dirty=!1;this._propertiesPool=new m.PropertiesPool({location:t,renderLocation:u},this);this._estimatedSurfaceAltitude=0;this._pendingElevationQueryController=null;this.renderLocation=d.create();this._tmpPoint=new t}initialize(){this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this));this.runTask();if(this.map){const y=()=>this._setDirty(); this.addHandles(p.on(()=>this.map?.ground?.layers,"change",y,{onListenerAdd:y,onListenerRemove:y}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest();this._propertiesPool=q.destroyMaybe(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const y=this._propertiesPool.get("location");y.spatialReference=this.state.spatialReference;this.renderCoordsHelper.fromRenderCoords(this.renderLocation,y);return y}get scale(){const y=this._camera,z=g.distance(y.eye, this.renderLocation);return v.distanceToScale({renderCoordsHelper:this.renderCoordsHelper,state:{camera:y}},z,0)}get updating(){return this._dirty||null!=this._pendingElevationQueryController}updateRenderLocation(){this._setDirty();this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const y=this._pendingElevationQueryController;y&&(this._pendingElevationQueryController=null,y.abort(),this.notifyChange("updating"))}get running(){return!this._pendingElevationQueryController&& this._dirty}runTask(){this._cancelPendingRequest();this._dirty=!1;this.notifyChange("updating");if(!this.map?.ground)return this._updateSurfaceAltitude(0),n.Yield;var y=this.state.spatialReference;this._tmpPoint.spatialReference=y;this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);y=1E5<(this._tmpPoint.z??0)&&this.renderCoordsHelper.viewingMode===w.ViewingMode.Global&&(y.isWGS84||y.isWebMercator);let z=new AbortController;this.map.ground.queryElevation(this._tmpPoint,{signal:z.signal, cache:this.cache,minDemResolution:y?1E6:0}).then(A=>this._updateSurfaceAltitude(A.geometry.z??0)).catch(A=>{l.isAbortError(A)||this._updateSurfaceAltitude(0)}).catch(()=>{}).then(()=>{this._pendingElevationQueryController===z&&(this._pendingElevationQueryController=null,this.notifyChange("updating"));z=null});this._pendingElevationQueryController=z;return n.Yield}_updateSurfaceAltitude(y){this._estimatedSurfaceAltitude!==y&&(this._estimatedSurfaceAltitude=y,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(x, this._estimatedSurfaceAltitude,this._camera.eye);g.exactEquals(this._get("renderLocation"),x)||(this._set("renderLocation",g.copy(this._propertiesPool.get("renderLocation"),x)),this.notifyChange("renderLocation"))}};b.__decorate([k.property({constructOnly:!0})],a.CameraOnSurface.prototype,"scheduler",void 0);b.__decorate([k.property({constructOnly:!0})],a.CameraOnSurface.prototype,"cache",void 0);b.__decorate([k.property({constructOnly:!0})],a.CameraOnSurface.prototype,"task",void 0);b.__decorate([k.property()], a.CameraOnSurface.prototype,"location",null);b.__decorate([k.property({constructOnly:!0})],a.CameraOnSurface.prototype,"map",void 0);b.__decorate([k.property()],a.CameraOnSurface.prototype,"renderLocation",void 0);b.__decorate([k.property()],a.CameraOnSurface.prototype,"scale",null);b.__decorate([k.property()],a.CameraOnSurface.prototype,"updating",null);a.CameraOnSurface=b.__decorate([e.subclass("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],a.CameraOnSurface);const x=d.create();Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/PointOfInterest":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){a.PointOfInterest=class extends q{constructor(c){super(c)}};b.__decorate([l.property({constructOnly:!0})], a.PointOfInterest.prototype,"renderCoordsHelper",void 0);b.__decorate([l.property({constructOnly:!0})],a.PointOfInterest.prototype,"surface",void 0);b.__decorate([l.property({constructOnly:!0})],a.PointOfInterest.prototype,"state",void 0);a.PointOfInterest=b.__decorate([f.subclass("esri.views.3d.support.pointsOfInterest.PointOfInterest")],a.PointOfInterest);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/CenterOnSurface":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/maybe ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/Point ../../../../geometry/projection/projectBoundingRect ../../../../geometry/support/aaBoundingRect ../debugFlags ../PropertiesPool ./PointOfInterest ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){const x=Array;a.CenterOnSurface=class extends n.PointOfInterest{constructor(B){super(B);this._propertiesPool=new r.PropertiesPool({location:t,renderLocation:x},this);this.distance=this._latestSurfaceAltitude=this._currentSurfaceAltitude=0;this.renderLocation=g.create();this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this);this.runTask()}destroy(){this._frameWorker=l.removeMaybe(this._frameWorker);this._propertiesPool= l.destroyMaybe(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const B=this._propertiesPool.get("location");B.spatialReference=this.state.spatialReference;this.renderCoordsHelper.fromRenderCoords(this.renderLocation,B);return B}updateRenderLocation(){this.updating=!0;this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get running(){return this.updating}runTask(){this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(); this._updateRenderLocation();this.updating=!1;return u.Yield}_updateRenderLocation(){const B=y;let C=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,B);var D=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!C&&D&&(C=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,B))&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude);D=z;C&&this._latestSurfaceAltitudeChangesDistanceSignificantly(B,D)&&(e.copy(B,D),this._currentSurfaceAltitude=this._latestSurfaceAltitude); C?this.distance=e.distance(this._camera.eye,B):(e.scale(B,this._camera.viewForward,this._get("distance")),e.add(B,B,this._camera.eye));e.exactEquals(this._get("renderLocation"),B)||this._set("renderLocation",e.copy(this._propertiesPool.get("renderLocation"),B))}_calculateSurfaceIntersection(B,C){var D=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(D.ray,B,C))return!1;if(this.state.isGlobal){const F=d.getReferenceEllipsoid(this.renderCoordsHelper.spatialReference).radius;B=F+B; const H=e.squaredLength(D.eye),N=HF/4&&(e.scale(C,D.viewForward,B-Math.sqrt(H)),e.add(C,C,D.eye))}else D=this.surface?.ready?this.surface.extent:null,null!=D&&w.projectBoundingRect(D,this.surface?.spatialReference,A,this.renderCoordsHelper.spatialReference)&&(C[0]=q.clamp(C[0],A[0],A[2]),C[1]=q.clamp(C[1],A[1],A[3]));return!0}_latestSurfaceAltitudeChangesDistanceSignificantly(B,C){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||null==B)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude, C)){if(m.debugFlags.TESTS_DISABLE_OPTIMIZATIONS)return!0;const D=this._camera.eye;B=e.distance(D,B);C=e.distance(D,C);if(.05this._layerViewsChanged(f)));this._layerViewsChanged({added:this._contentLayerViews.toArray(),removed:[],moved:[],target:this._contentLayerViews})}destroy(){this._handles=l.destroyMaybe(this._handles);this._contentLayerViews.destroy()}_layerViewsChanged(h){h.added.forEach(f=> {"esri.views.3d.layers.SceneLayerView3D"===f.declaredClass&&this._handles.add(f.on("visible-geometry-changed",()=>this._contentChanged()),f.uid)});h.removed.forEach(f=>this._handles.remove(f.uid))}_contentChanged(){this.events.emit("request-update",k)}}const k={};a.ContentGeometryUpdates=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/Focus":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/screenUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/Point ../../../../geometry/support/ray ../PropertiesPool ./PointOfInterest ../../webgl-engine/lib/rendererUtils ../../../support/Scheduler ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){const y=Array;a.Focus=class extends r.PointOfInterest{constructor(C){super(C);this._propertiesPool=new m.PropertiesPool({location:w,renderLocation:y},this);this._dirty=!0;this.renderLocation=this._propertiesPool.get("renderLocation")}initialize(){this.addHandles([p.watch(()=>this.centerOnSurface.renderLocation,()=>this.updateRenderLocation()),p.watch(()=>this.state.contentCamera,()=>this.updateRenderLocation())]);this.scheduler&&this.addHandles(this.scheduler.registerTask(u.TaskPriority.POINT_OF_INTEREST_FREQUENT, this))}destroy(){this._propertiesPool=l.destroyMaybe(this._propertiesPool)}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){const C=this._propertiesPool.get("location");C.spatialReference=this.state.spatialReference;this.renderCoordsHelper.fromRenderCoords(this.renderLocation,C);return C}get worldUnitsPerContentPixel(){const {camera:C,contentPixelRatio:D}=this.state;return C.computeRenderPixelSizeAt(this.renderLocation)*(C.pixelRatio/D)}get running(){return this._dirty}runTask(){var C= this._get("renderLocation");const D=this.centerOnSurface.renderLocation;var F=this.renderCoordsHelper,H=this.state.contentCamera;this._dirty=!1;F.worldUpAtPosition(D,z);F=Math.max(0,(Math.acos(d.dot(z,H.viewForward))-.5*Math.PI)*(H.aboveGround?1:-1));if(Number.isNaN(F))return C&&d.equals(C,D)||(C=this._propertiesPool.get("renderLocation"),d.copy(C,D),this._set("renderLocation",C)),x.Yield;F=1-q.clamp(F/(.5*Math.PI),0,1);F*=F*F;this._calculateScreenHorizontalEdgeOnSurface(B);H=this._propertiesPool.get("renderLocation"); d.lerp(H,D,B,F);C&&d.equals(C,H)||this._set("renderLocation",H);return x.Yield}_calculateScreenHorizontalEdgeOnSurface(C){const D=this.state.contentCamera;var F=D.getRenderCenter(k.createRenderScreenPointArray3());F[1]=D.aboveGround?D.padding[n.PaddingSide.BOTTOM]:D.fullHeight-D.padding[n.PaddingSide.TOP];if(this.estimateSurfaceIntersectionAtRenderPoint(F,C))return C;const H=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);return D.unprojectFromRenderScreen(F,A)&&(d.subtract(A, A,D.eye),F=d.normalize(A,A),this.renderCoordsHelper.intersectInfiniteManifold(v.wrap(D.eye,F),H,C))?C:this.renderCoordsHelper.setAltitude(C,H,D.eye)}updateRenderLocation(){this._dirty=!0}};b.__decorate([h.property()],a.Focus.prototype,"_dirty",void 0);b.__decorate([h.property({constructOnly:!0})],a.Focus.prototype,"scheduler",void 0);b.__decorate([h.property({constructOnly:!0})],a.Focus.prototype,"centerOnSurface",void 0);b.__decorate([h.property({constructOnly:!0})],a.Focus.prototype,"estimateSurfaceIntersectionAtRenderPoint", void 0);b.__decorate([h.property()],a.Focus.prototype,"updating",null);b.__decorate([h.property()],a.Focus.prototype,"location",null);b.__decorate([h.property()],a.Focus.prototype,"renderLocation",void 0);b.__decorate([h.property()],a.Focus.prototype,"worldUnitsPerContentPixel",null);a.Focus=b.__decorate([g.subclass("esri.views.3d.support.pointsOfInterest.Focus")],a.Focus);const z=t.create(),A=t.create(),B=t.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/StableSurfaceCenter":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/Error ../../../../core/Logger ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/Point ../../../../geometry/support/aaBoundingRect".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.StableSurfaceCenter=class extends q{get surface(){return this.view.map?.ground}get surfaceView(){return this.view.basemapTerrain}get renderLocation(){if(!this.location)return null;const w=g.create();this.view.renderCoordsHelper.toRenderCoords(this.location,w);return w}constructor(w){super(w);this._updateController=this.location=null}initialize(){this.view.state.isLocal&&(this.addHandles([h.watch(()=>[this.surfaceView?.spatialReference,this.surfaceView?.extent], ()=>this._update()),h.on(()=>this.surface?.layers,"change",()=>this._update())]),this._update())}_update(){this._updateController&&(this._updateController.abort(),this._updateController=null);if(null==this.surfaceView?.extent||null==this.surfaceView.spatialReference)this._set("location",null);else{var w=t.center(this.surfaceView.extent);w=new d({x:w[0],y:w[1],z:0,spatialReference:this.surfaceView.spatialReference});this.surface&&0{this._updateController=null;this._set("location",v.geometry)}).catch(v=>{})):this._set("location",w)}}};b.__decorate([f.property({constructOnly:!0})],a.StableSurfaceCenter.prototype,"view",void 0);b.__decorate([f.property({constructOnly:!0})],a.StableSurfaceCenter.prototype,"cache",void 0);b.__decorate([f.property()],a.StableSurfaceCenter.prototype,"surface",null);b.__decorate([f.property()], a.StableSurfaceCenter.prototype,"surfaceView",null);b.__decorate([f.property({readOnly:!0})],a.StableSurfaceCenter.prototype,"location",void 0);b.__decorate([f.property({readOnly:!0})],a.StableSurfaceCenter.prototype,"renderLocation",null);a.StableSurfaceCenter=b.__decorate([e.subclass("esri.views.3d.support.pointsOfInterest.StableSurfaceCenter")],a.StableSurfaceCenter);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingRect ../../../support/Scheduler ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.SurfaceGeometryUpdates=class extends q{constructor(n){super(n);this._tileGeometryUpdateExtent=g.empty();this._tileGeometryUpdateSpatialReference=null;this.events=new l;this.updating=!1}initialize(){this.addHandles([this.surface.on("elevation-change",n=>this._tileGeometryChanged(n)),this.scheduler.registerTask(d.TaskPriority.SURFACE_GEOMETRY_UPDATES,this)])}get running(){return this.updating}runTask(){if(!this.updating)return t.Yield;this._tileGeometryUpdateSpatialReference&& this._centerIntersectsExtent(this._tileGeometryUpdateExtent,this._tileGeometryUpdateSpatialReference)&&this.events.emit("request-update",w);g.empty(this._tileGeometryUpdateExtent);this._set("updating",!1);return t.Yield}_tileGeometryChanged(n){this._tileGeometryUpdateSpatialReference=n.spatialReference;g.expand(this._tileGeometryUpdateExtent,n.extent,this._tileGeometryUpdateExtent);this._set("updating",!0)}_furthestCenterOnSurface(){let n=this.centerOnSurfaces[0];for(let u=1;un.distance&&(n=x)}return n}_centerIntersectsExtent(n,u){const x=this.state.contentCamera.eye,y=r,z=this._furthestCenterOnSurface();this.renderCoordsHelper.fromRenderCoords(x,v,u);this.renderCoordsHelper.fromRenderCoords(z.renderLocation,m,u);v[0]qa.extentMidX?1:0)+(Ja {aa&&ua(Ja);var Ta=0===Ja.maxLevelDeltaNeighborCount&&0===Ja.unmergableChildCount;Ja.maxLevelDeltaNeighborCount++;if(Ta)for(Ja=Ja.parent;Ja;)if(Ta=0===Ja.maxLevelDeltaNeighborCount&&0===Ja.unmergableChildCount,Ja.unmergableChildCount++,Ta)Ja=Ja.parent;else break})}function ua(qa){if(!qa.hasPendingUpdate(na.TileUpdate.SPLIT)){for(var aa=qa.parent;aa?.resetPendingUpdate(na.TileUpdate.MERGE);)aa=aa.parent;qa.resetPendingUpdate(na.TileUpdate.MERGE);qa.isLeaf&&qa.setPendingUpdate(na.TileUpdate.SPLIT); qa.level{ua(Ja)})}}function Na(qa){qa.level{aa.maxLevelDeltaNeighborCount--;if(0===aa.maxLevelDeltaNeighborCount&&0===aa.unmergableChildCount)for(aa=aa.parent;aa;)if(aa.unmergableChildCount--,0===aa.maxLevelDeltaNeighborCount&&0===aa.unmergableChildCount)aa=aa.parent;else break})}function Ua(qa,aa){if(!(qa.level>ia.maxTileNeighborLevelDelta, Ra=qa.lij[2]>>ia.maxTileNeighborLevelDelta,$a=bb=>bb.isLeaf||bb.level===Ja;for(let bb=0;4>bb;++bb){const pa=qa.findNeighborTile(X.neighborEdgeIndices[bb],$a);if(!pa||pa.level!==Ja)continue;const Ba=pa.lij;Ba[1]===Ta&&Ba[2]===Ra||aa(pa)}}}var wa;l=wa=class extends h.EventedMixin(l){constructor(qa){super(qa);this._scaleRangeQueries=new ca.ScaleRangeQueries;this._iteratorPool=new t(va.IteratorPreorder,aa=>aa.remove=()=>this._iteratorPool.release(aa));this._postorderIterator=new va.IteratorPostorder; this._hasPendingUpdates=!1;this._asyncWorkItems=this._pendingUpdates=0;this._allTilesSorted=this._allTilesDirty=!0;this._usedMemory=null;this._performanceInfo=new fa;this._viewChanged=!1;this.heading=0;this._viewChangeUpdateDirty=this._inFrameTask=!1;this._eyePosRenderSR=z.create();this._eyePosSurfaceSR=z.create();this._splitLimits=new da.SplitLimits;this._frustum=E.create();this._viewProjectionMatrix=x.create();this._layerViews=[[],[]];this._layerIndexByUid=[new Map,new Map];this._basemapLayerViewHandles= new Map;this._watchUpdatingTracking=new A.UpdatingHandles;this._frameTask=Ga.ImmediateTask;this._allTiles=new w;this._upsampleInfoPool=new t(ya.UpsampleInfo);this._shouldEmitChangeEvent=!1;this._rootTilesExtent=N.create();this.updatingProgress=.5;this._maxNumUpdating=1;this.maxTextureScale=1.2;this._spatialReference=C.WebMercator;this._elevationProjectorCache=new Map;this.visibleElevationBounds=new S.ElevationBounds(Infinity,-Infinity);this.rootTileElevationBounds=new S.ElevationBounds(Infinity,-Infinity); this._sebProjectorMap=new Map;this._sebProjectorCache=D.createEmptyProjectorCache();this._tilingSchemeSpatialReference=null;this._updatingRootTiles=!1;this._pendingTilesForElevationUpdateEvent=new Set;this._pendingTilesToUpdate=new Set;this.totalTileUpdates=this.totalGeometryUpdates=0;this._oneBatchPerFrameTask=!0;this._layerViewsDirty=!1;this.unloadedMemory=0;this._isWebMercatorOnPlateCarree=this._isWebMercator=this.ignoresMemoryFactor=!1;this.overlayManager=new ba.OverlayManager({...qa,surface:this}); this._isGlobal=!qa.view?.state?.isLocal;this._isGeographic=this._spatialReference?.isGeographic??!1;this._tileConstructor=this._isGlobal?ea.SphericalPatch:U.PlanarPatch}initialize(){const qa=this.view,aa=qa.resourceController,Ja=aa.memoryController;this._tileCache=new d.MemCachePool((bb,pa)=>Ja.newCache(bb,pa),"terrain-tile");this._upsampleMapCache=Ja.newCache("terrain-upsample",bb=>bb.unloadMapData());this._elevationQueryCache=new O.ElevationQueryTileCache(Ja.newCache("elevation-query"));const Ta= this.overlayManager;this._renderer=new ka.TerrainRenderer(Ta.renderer,qa._stage,this._allTiles,B.getReferenceEllipsoid(qa.spatialReference).radius,Ja);this.addHandles([m.watch(()=>Ta.renderer.isEmpty,()=>this._evaluateTransparency()),m.watch(()=>this.renderer.visible,bb=>this.suspended=!bb),m.watch(()=>this.heading,bb=>{this._renderer.updateHeading(bb);this._updateTileTextures(Y.TextureUpdate.FADING)}),m.watch(()=>({heading:qa.camera?.heading,state:qa.state?.mode}),({heading:bb,state:pa})=>{if(null!= bb)if(this.isGlobal&&this.isGeographic||this.isWebMercatorOnPlateCarree)this.heading=90*Math.round(bb/90)%360;else{bb=Math.round(bb)%360;var Ba=Math.abs(bb-this.heading);if(pa===Ma.RenderState.IDLE||30<=Math.min(Ba,360-Ba))this.heading=bb}})],"overlayManager");this.addHandles([m.watch(()=>this.baseOpacity,()=>{this._handleLayerViewChanges();this._updateTileTextures(this._evaluateTransparency()?Y.TextureUpdate.UNFADED:Y.TextureUpdate.IMMEDIATE)},m.syncAndInitial),m.watch(()=>this.hasCompositeBlendMode, ()=>this._updateTileTextures(this._evaluateTransparency()?Y.TextureUpdate.UNFADED:Y.TextureUpdate.IMMEDIATE),m.syncAndInitial),m.watch(()=>this.backgroundColor,(bb,pa)=>{bb?.equals(pa)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(bb))},m.sync),m.watch(()=>this.snapLevel,()=>this._viewChanged=!0,m.sync),m.watch(()=>this.view.pointsOfInterest,bb=>{this._renderer.pointsOfInterest=bb;this._watchUpdatingTracking.removeAll();bb&&this._watchUpdatingTracking.add(()=>bb.focus.renderLocation, ()=>this._allTilesSorted=!1)}),m.watch(()=>M.debugFlags.TERRAIN_TILE_TREE_SHOW_TILES,bb=>{bb&&!this._treeDebugger?(new Promise((pa,Ba)=>a(["../layers/support/TerrainTileTree3DDebugger"],pa,Ba))).then(({TerrainTileTree3DDebugger:pa})=>{!this._treeDebugger&&M.debugFlags.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new pa({view:qa}))}):bb||(this._treeDebugger=g.destroyMaybe(this._treeDebugger))},m.initial)]);var {spatialReference:Ra}=qa;this._extentHelper=T.create(this.viewingMode,{layers:qa.map.allLayers, layerViews:qa.allLayerViews,viewSpatialReference:Ra});const $a=new k({getCollections:()=>qa.defaultsFromMap?.mapCollections?.map(({layers:bb})=>bb),getChildrenFunction:bb=>bb&&"layers"in bb?bb.layers:null});Ra=new za.TilingSchemeLogic({layers:$a,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:Ra});this._set("tilingSchemeLogic",Ra);this._updateTilingScheme();this._elevationDataRequester=aa.createStreamDataRequester(Q.ClientType.ELEVATION);this._mapDataRequester=aa.createStreamDataRequester(Q.ClientType.BASEMAP); this._frameTask=aa.scheduler.registerTask(Ga.TaskPriority.TERRAIN_SURFACE,this);this.addHandles([m.watch(()=>this._extentHelper.stencilEnabledExtents,bb=>this._renderer.setStencilEnabledLayerExtents(bb),m.initial),m.watch(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),m.sync),m.watch(()=>this.extent,()=>this._updateRootTiles(),m.initial),qa.on("resize",()=>this._viewChangeUpdate()),m.watch(()=>{const bb=qa.state;return[this._lodBias,this.lodSnapping,qa.quality,bb.camera,bb.contentCamera, bb.fixedContentCamera]},()=>this._viewChangeUpdate(),m.syncAndInitial),m.watch(()=>qa.qualitySettings?.fadeDuration,bb=>this._renderer.textureFadingEnabled=0qa.qualitySettings?.physicallyBasedRenderingEnabled,bb=>this._renderer.pbrMode=bb?ra.PBRMode.Simplified:ra.PBRMode.Disabled,m.initial),m.watch(()=>qa.qualitySettings?.tiledSurface.elevationLevelDelta,()=>this._updateAllTileGeometries()),m.watch(()=>this._userClippingExtent,()=>this._updateClippingExtent(),m.sync)]); this.addHandles(qa.allLayerViews.on("after-changes",()=>this._layerViewsDirty=!0));this._layerViewsDirty=!0;this._handleLayerViewChanges();this._renderer.updateTileBackground(this.backgroundColor)}destroy(){this._frameTask.remove();this._watchUpdatingTracking.destroy();this._removeAllTiles();this._set("tilingSchemeLogic",g.destroyMaybe(this.tilingSchemeLogic));this._basemapLayerViewHandles.forEach((qa,aa)=>this._unregisterTiledLayerView(aa));this._mapDataRequester=this._elevationDataRequester=null; this._set("overlayManager",g.destroyMaybe(this.overlayManager));this._tileCache=g.destroyMaybe(this._tileCache);ja.Tile.prune();this._treeDebugger=g.destroyMaybe(this._treeDebugger);this._renderer=g.destroyMaybe(this._renderer);this._iteratorPool=g.destroyMaybe(this._iteratorPool);this._upsampleMapCache=g.destroyMaybe(this._upsampleMapCache);this._elevationQueryCache=g.destroyMaybe(this._elevationQueryCache);this._set("view",null);this._extentHelper=g.destroyMaybe(this._extentHelper);this._upsampleInfoPool= g.destroyMaybe(this._upsampleInfoPool);P.printAllocations();la.printAllocations()}get renderer(){return this._renderer}get frustum(){return this._frustum}get snapLevel(){if(this.lodSnapping===Y.LODSnapping.ON){var qa=this.view,aa=this.tilingScheme;const Ja=qa.terrainScale;if(aa&&Ja)return qa=aa.levelAtScale(Ja)+qa.qualitySettings.tiledSurface.lodBias,aa=aa.getMaxLod(),Math.min(qa,aa||Infinity)}return null}get lodSnapping(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences?Y.LODSnapping.ON: Y.LODSnapping.OFF}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get _userClippingExtent(){var {spatialReference:qa}=this,{clippingArea:aa}=this.view;if(null==aa||null==qa)return null;const Ja=N.create();qa=R.toBoundingRect(aa,Ja,qa)?Ja:null;aa=this._get("extent");return N.equals(qa,aa)?aa:qa}get rootTilesExtent(){return this._rootTilesExtent}get extent(){const qa=N.intersection(this.groundExtent, this._userClippingExtent,N.create()),aa=this._get("extent");return N.equals(qa,aa)?aa:qa}get groundExtent(){return null!=this._tilingSchemeExtent?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){this._hasPendingUpdates||(this._maxNumUpdating=1);return!!((this.running||this._watchUpdatingTracking?.updating||0qa?3:this.view.qualitySettings.tiledSurface.elevationLevelDelta}getElevation(qa, aa,Ja,Ta){const Ra=this._rootTiles;if(!Ra?.length||0===Ra[0].layerInfo[ha.LayerClass.ELEVATION].length)return null;let $a=this._elevationProjectorCache.get(Ta);void 0===$a&&($a=D.getProjector(Ta,this._spatialReference)??null,this._elevationProjectorCache.set(Ta,$a));if(null==$a)return c.getLogger(this).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;qa=y.set(sa,qa,aa,Ja);$a(qa,0,qa,0);return Qa(Ra,qa[0],qa[1])}getElevations(qa,aa,Ja){const Ta= this._rootTiles;var Ra=Ta?Ta[0].layerInfo[ha.LayerClass.ELEVATION].length:0;if(Ta?.length&&0!==Ra)for(Ra=0;Raqa[2]&&(Ja+=1);sa[1]{if(Ra&&N.intersectsSphere(Ra.extent,Ha)){const $a=Ra.children;if($a[0]&&!Ra.rendered)for(const bb of $a)Ta(bb);else Ra=this._getLodBiasCorrectedScale(Ra.level),Ja=null==Ja?Ra:Math.min(Ja,Ra)}};qa=this._rootTiles;if(null!=qa)for(const Ra of qa)Ta(Ra); return Ja}queryVisibleScaleRange(qa,aa,Ja,Ta){aa=aa?this.tilingScheme.levelAtScale(aa):0;Ja=Ja?this.tilingScheme.levelAtScale(Ja):Infinity;const Ra=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(qa,aa+Ra,Ja+Ra,Ta)}_evaluateTransparency(){var qa=this.baseOpacity;const aa=this.overlayManager.renderer.isEmpty;var Ja=this._renderer.transparency;qa=this._allSurfaceLayersTransparent()?aa?ka.TransparencyMode.Empty:ka.TransparencyMode.TransparentWithDraped:1<=qa&&!this.hasCompositeBlendMode&& !this._renderer.slicePlaneEnabled?ka.TransparencyMode.Opaque:ka.TransparencyMode.Semitransparent;if(Ja=Ja!==qa)this._renderer.transparency=qa,this.view?._stage?.renderer.setParameters({terrainTransparency:this._renderer.transparency});return Ja}_updateTilingScheme(){const qa=this.tilingSchemeLogic.tilingScheme;if(qa!==this.tilingScheme){X.weakAssert(!!qa,"tiling scheme cannot be reset to undefined");this._isGlobal=!this.view?.state?.isLocal;this.tilingScheme&&this._removeAllTiles();var aa=qa?.spatialReference?? C.WebMercator;this._spatialReference=aa;this._isWebMercatorOnPlateCarree=(this._isWebMercator=!!aa?.isWebMercator)&&G.isPlateCarree(this.view?.renderSpatialReference);this._isGeographic=aa?.isGeographic??!1;this._set("tilingScheme",qa);this._tilingSchemeSpatialReference=this.tilingScheme?.spatialReference;this._sebProjectorMap.clear();this._updateClippingExtent();qa&&(this._updateTiledLayers(),this._renderer.setTileSize(qa.pixelSize),this.overlayManager.setSpatialReference(qa.spatialReference),this._updateRootTiles())}}_acquireTile(qa, aa,Ja,Ta){const Ra=this._tileCache.pop(wa._tileMemcacheKey);return Ra?(Ra.init(qa,aa,Ja,Ta,this),Ra):new this._tileConstructor(qa,aa,Ja,Ta,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const {extent:qa,tilingScheme:aa}=this;if(aa){var Ja=Ka,Ta=aa.rootTilesInExtent(qa,Ja,5*ia.maxRootTiles);if(null!=this._rootTiles){if(Ta.length>ia.maxRootTiles){c.getLogger(this).warn(ia.tooManyRootTilesAfterChangeError);return}const Ra=this._rootTiles.map(bb=>bb.lij),$a=p.difference(Ra, Ta,ja.lijEquals);this._updatingRootTiles=!0;if(0<$a.removed.length||0<$a.added.length){const bb=this._rootTiles.filter(pa=>-1<$a.removed.findIndex(Ba=>ja.lijEquals(Ba,pa.lij))?(this._purgeTile(pa),!1):!0);$a.added.forEach(pa=>bb.push(this._newRootTile(pa)));this._setRootTiles(bb)}}else this._updatingRootTiles=!0,Ta.length>ia.maxRootTiles&&(c.getLogger(this).warn(ia.tooManyRootTilesForLayerError),Ta=aa.rootTilesInExtent(qa,Ja,ia.maxRootTiles)),this._setRootTiles(Ta.map(Ra=>this._newRootTile(Ra))); N.equals(Ja,this._rootTilesExtent)||(this._rootTilesExtent=N.create(Ja));this.renderer.visible=!0;this._viewChangeUpdate();this.overlayManager.setPlacementDirty();this.notifyChange("ready");this._updateAllTileGeometries();this._updatingRootTiles=!1;this.checkAllTilesWaterproofness()}}_updateAllTileGeometries(){const qa=this._allTiles.filter(aa=>aa.isLoaded&&aa.intersectsClippingArea);qa.sort(va.compareTilesByLij);qa.forEach(aa=>this._renderer.updateTileGeometryState(aa));qa.forEach(aa=>aa.renderData.updateNeighborData()); this._updateTilesGeometries(qa);this._pendingTilesToUpdate.clear()}_updateTilesGeometries(qa){if(0!==qa.length){qa.sort(va.compareTilesByLij);var aa=this.renderer;qa.forEach(Ja=>aa.updateGeometryIfNeeded(Ja));qa.forEach(Ja=>this._pendingTilesForElevationUpdateEvent.add(Ja))}}_shouldSplit(qa){return qa.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)===na.TileUpdate.SPLIT}_newRootTile(qa){qa=this._acquireTile(0,qa[1],qa[2],null);this._shouldSplit(qa)&&qa.setPendingUpdate(na.TileUpdate.SPLIT); this._loadTile(qa);this._markTileToUpdate(qa);this._updateRootTileElevationBounds();return qa}_setRootTiles(qa){this._rootTiles=qa;this._allTiles.clear();if(null!=qa){const aa=this._iteratorPool.acquire();for(aa.reset(qa);!aa.done;)this._allTiles.push(aa.next());aa.remove()}this._renderer.setRootTiles(this._rootTiles);this._updateTilesVisibility(qa)}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&& this.tilingScheme&&this.renderer.visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(qa){qa.updateClippingStatus(this.extent)&&qa.resetPendingUpdate(na.TileUpdate.GEOMETRY)&&this._updateTileGeometryState(qa)}_updateTilesVisibility(qa){if(null!=qa){var aa=va.hasLoadableSiblings(qa),Ja=this.visibleElevationBounds,Ta=aa?Ja.min:Infinity;aa=aa?Ja.max:-Infinity; var Ra=this.extent,$a=this._viewProjectionMatrix;this.setTileTreeDirty();var bb=this._iteratorPool.acquire();for(bb.reset(qa);!bb.done;)qa=bb.next(),qa.updateClippingStatus(Ra)&&qa.resetPendingUpdate(na.TileUpdate.GEOMETRY)&&this._updateTileGeometryState(qa),qa.computeVisibility(),qa.updateScreenDepth($a),qa.renderData&&(Ta=Math.min(qa.elevationBoundsMin,Ta),aa=Math.max(qa.elevationBoundsMax,aa));bb.remove();this._allTilesDirty=this._viewChanged=!0;this._updatePendingTileGeometries();isFinite(Ta)&& isFinite(aa)&&(Ja.min!==Ta||Ja.max!==aa)&&(this.visibleElevationBounds=new S.ElevationBounds(Ta,aa))}}_updateRootTileElevationBounds(){let qa=Infinity,aa=-Infinity;var Ja=this._rootTiles;null!=Ja&&Ja.forEach(({elevationBoundsMin:Ta,elevationBoundsMax:Ra})=>{qa=Math.min(qa,Ta);aa=Math.max(aa,Ra)});Ja=this.rootTileElevationBounds;if(Ja.min!==qa||Ja.max!==aa)this.rootTileElevationBounds=new S.ElevationBounds(qa,aa)}_updateViewDependentParameters(){const {camera:qa,contentCamera:aa}=this.view.state,Ja= Math.tan(.5*aa.fovX),Ta=Math.tan(.5*aa.fovY),Ra=this.tilingScheme.pixelSize,$a=2**-this._lodBias*qa.pixelRatio;this._splitLimits.aboveGround=qa.aboveGround;this._splitLimits.fovX=Ja;this._splitLimits.fovY=Ta;this._splitLimits.relativeWidthLimit=Ra/qa.width*this.maxTextureScale*$a;this._splitLimits.relativeHeightLimit=Ra/qa.height*this.maxTextureScale*$a;this._splitLimits.maxLod=this.tilingScheme.getMaxLod();this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias;this._splitLimits.frustum= this.view.state.fixedContentCamera?E.copy(this._splitLimits.frustum??E.create(),aa.frustum):null;E.copy(this._frustum,qa.frustum);u.multiply(this._viewProjectionMatrix,aa.projectionMatrix,aa.viewMatrix);y.copy(this._eyePosRenderSR,aa.eye);H.projectVectorToVector(qa.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateTileGeometryState(qa){qa.updateVisibility();this._renderer.updateTileGeometryState(qa)&&this._markTileToUpdate(qa);this._usedMemory=null}_markAllTileNeighborsForUpdate(qa){qa.forEachLoadedNeighbor(aa=> {this._layerViews[ha.LayerClass.MAP].some(X.isVectorTileLayerView)&&aa.setPendingUpdate(na.TileUpdate.TEXTURE_FADING);this._pendingTilesToUpdate.add(aa)})}_updateTileTexture(qa,aa){const Ja=qa.resetPendingUpdate(na.TileUpdate.TEXTURE_FADING)?na.TileUpdate.TEXTURE_FADING:qa.resetPendingUpdate(na.TileUpdate.TEXTURE_NOFADING)?na.TileUpdate.TEXTURE_NOFADING:!1;Ja&&(this._renderer.updateTileTexture(qa,Ja),this._usedMemory=null,aa.madeProgress())}_emitElevationUpdateEventForTiles(){if(this._shouldEmitChangeEvent){var qa= Aa.extent;N.empty(qa);this._pendingTilesForElevationUpdateEvent.forEach(aa=>N.expand(qa,aa.extent,qa));this._pendingTilesForElevationUpdateEvent.clear();Aa.spatialReference=this.spatialReference;this.emit("elevation-change",Aa);this._shouldEmitChangeEvent=!1}}runTask(qa){this._handleLayerViewChanges(qa);this._frameTask.processQueue(qa);this.renderer.processScaleRangeQueries(this._scaleRangeQueries,qa);this._inFrameTask=!0;this._pendingUpdates=0;this._hasPendingUpdates=!1;this._updateAllTilesStatus(qa); this._sortTiles(qa);const aa=!this.view.state.fixedContentCamera;this._mergeAndSplit(qa,aa);this._updateElevation(qa);this._updateTextures(qa);aa||this._mergeAndSplit(qa,!0);this._inFrameTask=!1;this._runViewChangeUpdateIfDirty();this._updatePendingTileGeometries();this._emitElevationUpdateEventForTiles();qa.done&&qa.hasProgressed&&this.requestUpdate();this.notifyChange("updatingProgressValue");X.enableTerrainInternalChecks&&this._checkTileInvariant();if(!qa.hasProgressed)return Pa.Yield}_checkTileInvariant(){const qa= new Map;this._allTiles.forAll(aa=>qa.set(aa,new Set));this._allTiles.forAll(aa=>{X.weakAssert(aa.rendered===aa.isLeaf,` rendered ${aa.rendered} != ${aa.isLeaf} leaf`);if(!aa.isLeaf){var Ja=aa.children.reduce(($a,bb)=>$a+(0===bb.unmergableChildCount&&0===bb.maxLevelDeltaNeighborCount?0:1),0);X.weakAssert(aa.unmergableChildCount===Ja,` Tile[${aa.lij.toString()}] unmergeable child count mismatch:`+` actual ${aa.unmergableChildCount} vs ${Ja}`);if(aa.hasPendingUpdate(na.TileUpdate.MERGE)){X.weakAssert(!aa.hasPendingUpdate(na.TileUpdate.SPLIT), "Tile can be both split and merge at the same time");for(var Ta of aa.children)X.weakAssert(Ta.isLeaf||Ta.hasPendingUpdate(na.TileUpdate.MERGE),"Child of tile to merge must also merge")}}for(Ja=0;4>Ja;++Ja){if(aa.rendered&&(Ta=aa.renderData?.geometryState.edgePeerNeighbors[Ja],null!=Ta)){var Ra=aa.level-Ta.level<=ia.maxTileNeighborLevelDelta;Ra||(console.log(`tile level delta [${aa.lij.toString()}] vs [${Ta.lij.toString()}] > ${ia.maxTileNeighborLevelDelta} (edge[${Ja}])`),X.weakAssert(Ra,`tile level delta [${aa.level}] vs [${Ta.level}] > ${ia.maxTileNeighborLevelDelta}`)); X.weakAssert(aa.level-Ta.level<=ia.maxTileNeighborLevelDelta,`Max tile lod delta exceeded: [${aa.lij.toString()}] vs [${Ta.lij.toString()}]`)}Ra=aa.level-ia.maxTileNeighborLevelDelta;Ta=aa.findNeighborTile(X.neighborEdgeIndices[Ja],$a=>$a.isLeaf||$a.level===aa.level);if(null!=Ta){if(aa.isLeaf&&aa.level>=ia.maxTileNeighborLevelDelta){let $a=Ta;for(;aa.level-$a.level>ia.maxTileNeighborLevelDelta,aa.lij[2]>>ia.maxTileNeighborLevelDelta], $a.lij)||(Ra=qa.get($a),X.weakAssert(!Ra.has(aa),"Cannot already have neighbor"),Ra.add(aa))}X.weakAssert(Ta.rendered||Ta.level===aa.level,"Non-same-level-neighbor of rendered must be rendered");X.weakAssert(aa.level-Ta.level<=ia.maxTileNeighborLevelDelta,`Tile level delta [${aa.level}] vs [${Ta.level}] > ${ia.maxTileNeighborLevelDelta}`)}}});this._allTiles.forAll(aa=>{const Ja=aa.maxLevelDeltaNeighborCount,Ta=qa.get(aa);X.weakAssert(Ja===Ta.size,`Tile[${aa.lij.toString()}] merge-blocker mismatch: actual ${Ja} vs ${Ta.size}`)})}_updateAllTilesStatus(qa){if(this._viewChanged&& this._rootTiles&&!qa.done){this._viewChanged=!1;var aa=new Ya(this._allTiles.length);aa.pushAll(this._rootTiles);var Ja=this.snapLevel,Ta=this._splitLimits,Ra=this._eyePosRenderSR;this._allTiles.forAll(pa=>{pa.maxLevelDeltaNeighborCount=0;pa.unmergableChildCount=0});for(var $a=this._viewProjectionMatrix;!aa.empty;){const pa=aa.pop();var bb=pa.parent;const Ba=(bb=null!=bb&&bb.hasPendingUpdate(na.TileUpdate.MERGE))?na.TileUpdate.MERGE:pa.shouldSplit(Ta,Ra,Ja),Ia=Ba===na.TileUpdate.SPLIT;pa.isLeaf?Ea(pa, Ia):aa.pushAll(pa.children);bb?(pa.resetPendingUpdate(na.TileUpdate.SPLIT),pa.isLeaf||pa.setPendingUpdate(na.TileUpdate.MERGE),this._updateClippingStatus(pa),pa.updateVisibility(),pa.updateScreenDepth($a)):Ia?(pa.resetPendingUpdate(na.TileUpdate.MERGE),pa.isLeaf&&pa.setPendingUpdate(na.TileUpdate.SPLIT)):(pa.resetPendingUpdate(na.TileUpdate.SPLIT)&&pa.updateAgentSuspension(),Ba===na.TileUpdate.ELEVATION&&pa.updateAgents(ha.LayerClass.ELEVATION),pa.isLeaf||(pa.setPendingUpdate(na.TileUpdate.MERGE), pa.resetPendingUpdate(na.TileUpdate.SPLIT)))}this.requestUpdate();!this._shortBatches&&this._oneBatchPerFrameTask||this._updatePendingTileGeometries();qa.madeProgress()}}_sortTiles(qa){qa.done||this._allTilesSorted||(va.sortTilesByPOI(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger&&this._treeDebugger.update(),qa.madeProgress())}_markTileToUpdate(qa){X.internalAssert(qa.isLoaded);qa.intersectsClippingArea&&(this._pendingTilesToUpdate.add(qa), this._markAllTileNeighborsForUpdate(qa))}_updatePendingTileGeometries(){const qa=this._pendingTilesToUpdate,aa=Array.from(qa.keys()).filter(Ra=>Ra.isLoaded&&Ra.intersectsClippingArea);if(0===aa.length)qa.clear();else{var Ja=(Ra,$a)=>{!$a?.isLoaded||!$a.intersectsClippingArea||$a.level{const gb=X.neighborCornerIndices[Wa];Ja($a,Ba.cornerPeerNeighbors[Wa]?.findCorner(X.oppositeCorner(gb),ib=>ib.isLoaded))};for(let Wa=0;4>Wa;++Wa)if(pa&1<=$a.level&&gb.forAllSubtreeOnSide(X.oppositeEdge(X.neighborEdgeIndices[Wa]),ib=>ib.isLoaded&&ib.intersectsClippingArea?(X.internalAssert(qa.has(ib)||0>va.compareTilesByLij($a, ib)),Ja($a,ib),!0):!1);Ia((Wa+1)%4);Ia(Wa)}}qa.clear();this._updateTilesGeometries(aa);this._shouldEmitChangeEvent=!0;X.enableTerrainInternalChecks&&X.enableWaterproofTests&&this.checkAllTilesWaterproofness()}}_mergeAndSplit(qa,aa){if(!this.suspended&&!qa.done&&this._allTilesDirty){this._allTilesDirty=!1;this.requestUpdate();for(var Ja=!1,Ta=this.view.state.fixedContentCamera,Ra=!1;!qa.done;){Ra=!0;let $a=!1;const bb=!this._allTiles.some(pa=>{if(!Ja&&!Ta&&!pa.visible)return qa.done;var Ba=pa;if(pa.hasPendingUpdate(na.TileUpdate.MERGE)){if(!aa|| 0=ia.maxTileNeighborLevelDelta){const Wa=gb=>gb.isLeaf||Ia-gb.levelgb;++gb){const ib=pa.findNeighborTile(X.neighborEdgeIndices[gb], Wa);null!=ib&&Ia-ib.level===ia.maxTileNeighborLevelDelta&&(Ba=!1,X.enableTerrainInternalChecks&&(X.internalAssert(ib.isLeaf),X.internalAssert(ib.hasPendingUpdate(na.TileUpdate.SPLIT))))}}Ba?(this._splitTile(pa),qa.madeProgress(),$a=!0):pa.setPendingUpdate(na.TileUpdate.SPLIT)}return qa.done});$a&&(this._allTilesSorted=!1,this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries());if(bb)if(!Ja)Ja=!0;else{if(!$a)break}else this._allTilesDirty=!0}Ra?qa.madeProgress():this._allTilesDirty= !0;!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries();this._sortTiles(qa)}}_updateElevation(qa){qa.done||(this._allTiles.some(aa=>{aa.resetPendingUpdate(na.TileUpdate.GEOMETRY)&&(this._updateTileGeometryState(aa),this._shortBatches&&this._updatePendingTileGeometries(),qa.madeProgress());return qa.done}),!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries())}_updateTextures(qa){qa.done||this._allTiles.some(aa=>{this._updateTileTexture(aa,qa);return qa.done})}_updateClippingExtent(){this.spatialReference&& (this.updateTileOverlayParams(xa.RenderRequestType.UPDATE),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){return this.view.qualitySettings.tiledSurface.lodBias-(1-this.view.quality)*ia.maxMemoryLodBias}_getLodBiasCorrectedScale(qa){const aa=this.tilingScheme.levels;qa=e.clamp(qa-this._lodBias,0,aa.length-1);const Ja=qa-Math.floor(qa);return aa[Math.floor(qa)].scale*(1-Ja)+aa[Math.ceil(qa)].scale*Ja}_removeAllTiles(){null!=this._rootTiles&&(this._rootTiles.forEach(qa=> this._purgeTile(qa)),this._setRootTiles(null),this.notifyChange("ready"));this._allTiles.clear();this.renderer.visible=!1}_purgeDescendantTiles(qa){if(qa.children[0]){var aa=qa.children.slice();qa.unsetChildren();for(qa=0;4>qa;++qa)this._purgeTile(aa[qa])}}_purgeTile(qa){qa.isLeaf?Na(qa):this._purgeDescendantTiles(qa);this._allTiles.removeUnordered(qa);this._unloadTile(qa);this._tileCache.put(wa._tileMemcacheKey,qa)}_unloadTile(qa){this._pendingTilesToUpdate.delete(qa);this._pendingTilesForElevationUpdateEvent.delete(qa); qa.unload(this._renderer)}_splitTile(qa){X.weakAssert(qa.isLeaf,"Tile that is already split should not be split again!");X.weakAssert(qa.rendered,"Tile marked to split is not rendered");Na(qa);var aa=qa.level+1;const Ja=2*qa.lij[1],Ta=2*qa.lij[2];aa=qa.setChildren(this._createTile(aa,Ja,Ta,qa),this._createTile(aa,Ja,Ta+1,qa),this._createTile(aa,Ja+1,Ta,qa),this._createTile(aa,Ja+1,Ta+1,qa));this._allTiles.pushArray(aa);qa.updateAgentSuspension();X.weakAssert(qa.rendered,"parent should be rendered"); this._unloadTile(qa);aa.forEach(Ra=>this._loadTile(Ra));aa.forEach(Ra=>this._pendingTilesToUpdate.add(Ra));this._markAllTileNeighborsForUpdate(qa);this._emitTileScaleChange(qa,qa.level+1);this._allTilesDirty=!0;this._shortBatches&&this._updatePendingTileGeometries();aa.forEach(Ra=>Ea(Ra,Ra.hasPendingUpdate(na.TileUpdate.SPLIT)));++this._performanceInfo.numSplit}_emitTileScaleChange(qa,aa=qa.level){Sa.spatialReference=this.spatialReference;Sa.extent=qa.extent;Sa.scale=this._getLodBiasCorrectedScale(aa); this.emit("scale-change",Sa)}_createTile(qa,aa,Ja,Ta){X.weakAssert(!!Ta,"_createTile sanity check");qa=this._acquireTile(qa,aa,Ja,Ta);qa.updateClippingStatus(this.extent);qa.updateScreenDepth(this._viewProjectionMatrix);this._shouldSplit(qa)&&qa.setPendingUpdate(na.TileUpdate.SPLIT);return qa}get _shortBatches(){return this.view.state.mode!==Ma.RenderState.IDLE}_mergeTile(qa){X.weakAssert(!qa.hasPendingUpdate(na.TileUpdate.SPLIT),"_mergeTile sanity check");X.weakAssert(!qa.isLeaf,"Cannot merge a leaf"); qa.isLeaf||(this._purgeDescendantTiles(qa),X.weakAssert(!qa.renderData,"_mergeTile sanity check"),this._loadTile(qa),this._markTileToUpdate(qa),this._emitTileScaleChange(qa),this._shortBatches&&this._updatePendingTileGeometries(),Ea(qa,!1),this._allTilesDirty=!0,++this._performanceInfo.numMerged)}_loadTile(qa){qa.load();this.requestUpdate();this._allTilesDirty=!0;this.overlayManager&&this.overlayManager.hasOverlays&&this.overlayManager.setTileParameters(qa)}_handleLayerViewChanges(qa=Ga.noBudget){if(this._layerViewsDirty){var aa= this._layerViewsDirty=!1,Ja=new Set,Ta=-1;for(let $a=this.view.allLayerViews.length-1;0<=$a;$a--){var Ra=this.view.allLayerViews.items[$a];Ja.add(Ra.uid);if(X.isSurfaceLayerView(Ra)||X.isGroupLayerView(Ra))if(this._basemapLayerViewHandles.has(Ra.uid)&&!X.isGroupLayerView(Ra)){const bb=this._layerClassFromLayerView(Ra);Ra=this._getLayerIdxByUID(bb,Ra.uid);if(null!=Ra){if(Ra{Ja.has(bb)||(this._unregisterTiledLayerView(bb),aa=!0)});aa&&this._updateTiledLayers();this.hasCompositeBlendMode=this._hasCompositeBlendMode();this._evaluateTransparency();qa.madeProgress()}}_allSurfaceLayersTransparent(){let qa=0===this.view.map?.ground?.opacity;for(const aa of this.view.allLayerViews.items)if(X.isMapTileLayerView(aa)&&!L.isBaseLayer(aa.layer)&&0!==aa.fullOpacity){qa=!1;break}return qa}_hasCompositeBlendMode(){for(const qa of this.view.allLayerViews.items)if((X.isBlendableLayerView(qa)|| X.isGroupLayerView(qa))&&Da.isCompositeBlendMode(Da.blendModeFromString[qa.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(qa){return X.isElevationLayerView(qa)?ha.LayerClass.ELEVATION:ha.LayerClass.MAP}_registerTiledLayerView(qa){const aa=[];(X.isBlendableLayerView(qa)||X.isGroupLayerView(qa))&&aa.push(m.watch(()=>qa.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode();this._updateTileTextures(Y.TextureUpdate.UNFADED)}));if(!X.isGroupLayerView(qa)){const Ja= this._layerClassFromLayerView(qa);aa.push(m.watch(()=>qa.suspended,()=>this._updateTiledLayers()));aa.push(m.watch(()=>qa.fullOpacity,()=>this._updateTileTextures(Y.TextureUpdate.UNFADED)));aa.push(m.watch(()=>"effectiveScaleRange"in qa.layer?qa.layer.effectiveScaleRange:null,()=>this._restartAllAgents(Ja)));aa.push(qa.on("data-changed",()=>{const Ta=this._getLayerIdxByUID(Ja,qa.uid);null!=Ta&&this._invalidateLayerData(Ta,Ja)}))}this._unregisterTiledLayerView(qa.uid);this._basemapLayerViewHandles.set(qa.uid, aa)}_unregisterTiledLayerView(qa){const aa=this._basemapLayerViewHandles.get(qa);if(aa){for(const Ja of aa)Ja.remove();this._basemapLayerViewHandles.delete(qa)}}_updateTiledLayers(){if(this.tilingScheme&&!this.view.suspended){var qa=[[],[]],aa=null;this.view.allLayerViews.forEach(Ta=>{if(Ta.layer&&!Ta.suspended&&X.isSurfaceLayerView(Ta)&&Ta.fullExtent){var Ra=this._layerClassFromLayerView(Ta);if(Ra===ha.LayerClass.MAP){const $a=Ta.displayLevelRange.maxLevel;Infinity!==$a&&(null===aa||$a>aa)&&(aa= $a)}qa[Ra].push(Ta)}});for(const Ta of ha.LayerClasses){var Ja=this._layerViews[Ta];const Ra=qa[Ta];Ra.reverse();const $a=Ra.length;let bb=Ja.length!==$a;const pa=Array($a),Ba=Array(Ja.length);this._layerIndexByUid[Ta].clear();for(let Ia=0;Ia<$a;Ia++){this._layerIndexByUid[Ta].set(Ra[Ia].uid,Ia);const Wa=Ja.indexOf(Ra[Ia]);pa[Ia]=Wa;Ia!==Wa&&(bb=!0);-1 {aa.updateAgents(ha.LayerClass.MAP);qa===Y.TextureUpdate.IMMEDIATE?this.renderer.updateTileTexture(aa,na.TileUpdate.TEXTURE_NOFADING):aa.updateRenderData(ha.LayerClass.MAP,qa)});this._evaluateTransparency()}_invalidateLayerData(qa,aa){this._allTiles.forAll(Ja=>Ja.removeLayerAgent(qa,aa));this._allTiles.forAll(Ja=>Ja.invalidateLayerData(qa,aa))}setTileTreeDirty(){this._allTilesDirty=!0}requestRender(qa=xa.RenderRequestType.UPDATE){this.renderer.setNeedsRender(qa)}requestUpdate(){1===++this._pendingUpdates&& (this._hasPendingUpdates=!0)}requestTileData(qa,aa,Ja,Ta){const Ra=this.layerViewByIndex(aa,Ja);aa=Ra.layer;if(!aa.tilemapCache||X.isVectorTileLayerView(Ra))return this._requestTileData(qa,Ja,Ra,Ta);++this._asyncWorkItems;return aa.tilemapCache.fetchAvailability(qa.lij[0],qa.lij[1],qa.lij[2],{...Ta,timeout:6E3}).then(()=>--this._asyncWorkItems).catch($a=>{--this._asyncWorkItems;v.throwIfAborted(Ta);v.isAbortError($a)||this._dataMissing(qa,Ja,Ra);throw $a;}).then(()=>this._frameTask.schedule(()=>this._requestTileData(qa, Ja,Ra,Ta),Ta.signal))}_requestTileData(qa,aa,Ja,Ta){aa=aa===ha.LayerClass.ELEVATION;Ta.requester??(Ta.requester=aa?this._elevationDataRequester:this._mapDataRequester);return aa?X.isElevationLayerView(Ja)?this._requestElevationTileData(qa,Ja,Ta):Promise.reject():X.isMapTileLayerView(Ja)?this._requestMapTileData(qa,Ja,Ta):Promise.reject()}_requestElevationTileData(qa,aa,Ja){++this._asyncWorkItems;const Ta=Ra=>{!v.isAborted(Ja)&&Ra&&(this._usedMemory=null,this.requestUpdate(),this._elevationDataArrived(qa, aa,Ra))};return aa.fetchTile(qa.lij,Ja).then(Ra=>this._frameTask.schedule(()=>Ta(Ra)),Ra=>{v.isAbortError(Ra)||(c.getLogger(this).error(`Tile ${qa.lij.toString()} layer ${ha.LayerClass.ELEVATION}/${aa.uid} error ${Ra}`),this._dataMissing(qa,ha.LayerClass.ELEVATION,aa),this.requestUpdate())}).finally(()=>--this._asyncWorkItems)}_elevationDataArrived(qa,aa,Ja){aa=this._layerIndexByUid[ha.LayerClass.ELEVATION].get(aa.uid);if(null==aa)c.getLogger(this).warn("TerrainSurface: received data from unknown layer %d %s", ha.LayerClass.ELEVATION,qa.lij.toString());else{Ja=new V.ElevationData(qa.lij,qa.extent,Ja);qa.dataArrived(aa,ha.LayerClass.ELEVATION,Ja);Ja=[qa];qa=qa.level;var Ta=this._iteratorPool.acquire();for(Ta.reset(Ja);!Ta.done;){const Ra=Ta.next();Ra.findElevationBoundsForLayer(aa,qa);Ra.computeElevationBounds()}0===qa&&this._updateRootTileElevationBounds();Ta.remove();this._updateTilesVisibility(Ja)}}_requestMapTileData(qa,aa,Ja){++this._asyncWorkItems;const Ta=($a,bb)=>{X.releaseTerrainData(bb);v.isAborted(Ja)|| (console.error(`Tile ${qa.lij.toString()} layer ${ha.LayerClass.MAP}/${aa.uid} error ${$a}`),this._dataMissing(qa,ha.LayerClass.MAP,aa),this.requestUpdate())},Ra=$a=>bb=>Ta(bb,$a);return aa.fetchTile(qa.lij,Ja).then($a=>this._frameTask.schedule(()=>{this.requestUpdate();v.isAborted(Ja)?X.releaseTerrainData($a):this._mapTileDataArrived(qa,aa,$a)},Ja.signal,Ra($a)).catch(Ra($a)),($a,bb=null)=>this._frameTask.schedule(()=>Ta($a,bb))).finally(()=>--this._asyncWorkItems)}_mapTileDataArrived(qa,aa,Ja){aa= this._getLayerIdxByUID(ha.LayerClass.MAP,aa.uid);null==aa?(X.releaseTerrainData(Ja),c.getLogger(this).warn("TerrainSurface: received data from unknown layer")):qa.dataArrived(aa,ha.LayerClass.MAP,Ja)}_getLayerIdxByUID(qa,aa){return this._layerIndexByUid[qa].get(aa)}_dataMissing(qa,aa,Ja){Ja=this._getLayerIdxByUID(aa,Ja.uid);null!=Ja?qa.dataMissing(Ja,aa):c.getLogger(this).warn("TerrainSurface: received data from unknown layer")}updateTileOverlayParams(qa){this._rootTiles&&this.overlayManager&&(this._allTiles.forAll(aa=> {aa.renderData&&this.overlayManager.setTileParameters(aa)}),this._renderer.setNeedsRender(qa))}get performanceInfo(){const qa=this._performanceInfo;qa.numNodes=this._allTiles.length;qa.numLeaves=qa.numVisible=qa.numRendered=qa.numLoadedPerLevel.length=qa.numRenderedPerLevel.length=0;this._allTiles.forAll(aa=>{aa.isLeaf&&qa.numLeaves++;const Ja=aa.level;aa.renderData&&(qa.numLoadedPerLevel[Ja]=(qa.numLoadedPerLevel[Ja]||0)+1);aa.visible&&(qa.numVisible++,aa.rendered&&(qa.numRenderedPerLevel[Ja]=(qa.numRenderedPerLevel[Ja]|| 0)+1,qa.numRendered++))});return qa}get usedMemory(){if(!this.tilingScheme)return 0;null==this._usedMemory&&(this._usedMemory=this._recalculateUsedMemory());return this._usedMemory??0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((qa,aa)=>qa+aa.usedMemory,0)):null}getUsedMemoryForLayerView(qa){let aa=0;const Ja=this._layerClassFromLayerView(qa),Ta=this._getLayerIdxByUID(Ja,qa.uid);null!=Ta&&this._allTiles.forAll(Ra=>aa+=Ra.getUsedMemoryForLayer(Ja,Ta));return aa}getTile(qa){if(null== qa||null==this._rootTiles)return null;const aa=qa.split("/").map($a=>+$a);if(0===aa[0])return this._rootTiles.find($a=>$a.lij[1]===aa[1]&&$a.lij[2]===aa[2]);qa=aa[0];const Ja=aa[1]>>qa,Ta=aa[2]>>qa;let Ra;this._rootTiles.some($a=>$a.lij[1]===Ja&&$a.lij[2]===Ta?(Ra=$a,!0):!1);if(Ra){for(qa=1<>=1}X.weakAssert(Ra.lij[0]===aa[0]&&Ra.lij[1]===aa[1]&&Ra.lij[2]===aa[2],"not the right tile?"); return Ra}return null}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(qa){this._renderer.renderPatchBorders=qa}get visualizeNormals(){return this._renderer.visualizeNormals}set visualizeNormals(qa){this._renderer.visualizeNormals=qa}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(qa){this._renderer.renderingDisabled=qa}get test(){}checkAllTilesWaterproofness(){if(X.enableWaterproofTests){var qa=this._rootTiles;if(null!= qa){var aa=Ra=>0{if(Ra.intersectsClippingArea)if(Ra.renderData&&!Ra.renderData.geometryState&&console.error("Tile[",Ra.lij,"] has renderData but not geometryState"),Ra.renderData&&!Ra.renderData.geometry&&console.error("Tile[",Ra.lij,"] has renderData but not geometryInfo"),!Ra.renderData?.geometry||0<(Ra.renderData.geometry.indices?.length??0)||console.error("Tile[",Ra.lij,"] has renderData but no indices - geometryInfo: ",Ra.renderData.geometry), aa(Ra)){Ra.checkGeometryWaterproofness();for(const pa of Ra.children){var $a=pa,bb=Ra;aa($a)&&console.error("Tile[",$a.lij,"] has geometry although parent[",bb.lij,"] has geom")}}else if(Ra.isLeaf)console.error("Tile[",Ra.lij,"] has no geometry and no children, from root to leaf");else for($a of Ra.children)Ja($a)},Ta=Ra=>{const $a=Ra.parent?.visible??!0,bb=Ra.visible;Ra.computeVisibility();const pa=Ra.visible;bb!==pa&&$a&&console.error(" Tile[",Ra.lij,"] has out of date visibility: ",bb," instead of ", pa);if(!Ra.isLeaf)for(const Ba of Ra.children)Ta(Ba)};for(const Ra of qa)Ja(Ra),Ta(Ra)}}}get isGlobal(){return this._isGlobal}get isGeographic(){return this._isGeographic}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateCarree(){return this._isWebMercatorOnPlateCarree}isEastEndWrap(qa){return this._isGlobal&&qa[2]===this.lijEastEnd(qa[0])-1}isWestEndWrap(qa){return this._isGlobal&&0===qa[2]}lijEastEnd(qa){return 1<Ja?aa:0))%aa]:null}enableInternalChecks(qa){X.enableInternalTerrainChecks(qa)}enableWaterproofnessChecks(qa){X.enableTerrainWaterproofChecks(qa)}};l._tileMemcacheKey="TerrainTileMemcache";b.__decorate([r.property()],l.prototype,"_renderer",void 0);b.__decorate([r.property({constructOnly:!0})],l.prototype,"_scaleRangeQueries",void 0);b.__decorate([r.property({constructOnly:!0})],l.prototype,"view",void 0);b.__decorate([r.property({constructOnly:!0})], l.prototype,"overlayManager",void 0);b.__decorate([r.property()],l.prototype,"_hasPendingUpdates",void 0);b.__decorate([r.property()],l.prototype,"_asyncWorkItems",void 0);b.__decorate([r.property()],l.prototype,"_allTilesDirty",void 0);b.__decorate([r.property()],l.prototype,"_allTilesSorted",void 0);b.__decorate([r.property()],l.prototype,"_viewChanged",void 0);b.__decorate([r.property({type:Number})],l.prototype,"heading",void 0);b.__decorate([r.property()],l.prototype,"_splitLimits",void 0);b.__decorate([r.property({readOnly:!0})], l.prototype,"_watchUpdatingTracking",void 0);b.__decorate([r.property()],l.prototype,"_frameTask",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"snapLevel",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"lodSnapping",null);b.__decorate([r.property()],l.prototype,"_userClippingExtent",null);b.__decorate([r.property()],l.prototype,"_rootTilesExtent",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"extent",null);b.__decorate([r.property({readOnly:!0})],l.prototype, "groundExtent",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"_tilingSchemeExtent",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"updating",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"running",null);b.__decorate([r.property(W.updatingProgress)],l.prototype,"updatingProgress",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"updatingProgressValue",null);b.__decorate([r.property()],l.prototype,"_maxNumUpdating",void 0);b.__decorate([r.property()], l.prototype,"baseOpacity",null);b.__decorate([r.property()],l.prototype,"hasCompositeBlendMode",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"viewingMode",null);b.__decorate([r.property()],l.prototype,"maxTextureScale",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"ready",null);b.__decorate([r.property({value:Z.RenderOrder.FRONT_TO_BACK})],l.prototype,"renderOrder",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"rootTiles",null);b.__decorate([r.property()], l.prototype,"_rootTiles",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"spatialReference",null);b.__decorate([r.property({type:q})],l.prototype,"backgroundColor",null);b.__decorate([r.property({value:!1})],l.prototype,"slicePlaneEnabled",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"tilingScheme",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"tilingSchemeLocked",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"tilingSchemeLogic",void 0);b.__decorate([r.property()], l.prototype,"wireframe",null);b.__decorate([r.property({value:!1})],l.prototype,"suspended",null);b.__decorate([r.property()],l.prototype,"fadeDuration",null);b.__decorate([r.property()],l.prototype,"visibleElevationBounds",void 0);b.__decorate([r.property()],l.prototype,"rootTileElevationBounds",void 0);b.__decorate([r.property()],l.prototype,"_layerViewsDirty",void 0);b.__decorate([r.property()],l.prototype,"renderPatchBorders",null);b.__decorate([r.property()],l.prototype,"visualizeNormals",null); b.__decorate([r.property()],l.prototype,"renderingDisabled",null);b=l=wa=b.__decorate([n.subclass("esri.views.3d.terrain.TerrainSurface")],l);const sa=z.create(),Ha=I.create(),Ka=N.create();new w;const Aa=new J.ElevationUpdateEvent("ground"),Sa={spatialReference:null,extent:null,scale:0};class Ya{constructor(qa){this.capacity=qa;this._tail=this._head=0;this._data=Array(qa)}push(qa){const aa=this._tail;if(aa=this._tail}get full(){return this._tail>=this._data.length}}return b})},"esri/layers/support/ElevationQueryTileCache":function(){define(["exports"],function(a){class b{constructor(q){this._store=q}destroy(){this._store.destroy()}get(q){return this._store.get(q)}put(q, l){this._store.put(q,l,l.values.byteLength+256)}}a.ElevationQueryTileCache=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/VectorTile":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f32 ./enums ./RenderBucket ./decluttering/config ../webgl/TiledDisplayObject".split(" "),function(a,b,q,l,p,k,h,f){class c extends f.TiledDisplayObject{constructor(g,d,t,w,v, m,r,n=null){super(g,d,t,w,v,m,4096,4096);this.styleRepository=r;this._memCache=n;this.type="vector-tile";this._referenced=0;this._hasSymbolBuckets=!1;this._memoryUsedByLayerData=0;this.layerData=new Map;this.status="loading";this.allSymbolsFadingOut=!1;this.lastOpacityUpdate=0;this.symbols=new Map;this.decluttered=this.neededForCoverage=this.isCoverage=!1;this.parentTile=null;this.childrenTiles=new Set;this.featureIndex=null;this.triangleCount=0;this._processed=!1;this._referenced=1;this.id=g.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&& performance.now()-this.lastOpacityUpdate{console.log(`\n${d.key}:`);g[0].forEach(t=>console.log(t));console.log("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");g[1].forEach(t=>console.log(t))})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/mat3f32":function(){define(["exports"], function(a){function b(){const h=new Float32Array(9);h[0]=1;h[4]=1;h[8]=1;return h}function q(h){const f=new Float32Array(9);f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[3];f[4]=h[4];f[5]=h[5];f[6]=h[6];f[7]=h[7];f[8]=h[8];return f}function l(h,f,c,e,g,d,t,w,v){const m=new Float32Array(9);m[0]=h;m[1]=f;m[2]=c;m[3]=e;m[4]=g;m[5]=d;m[6]=t;m[7]=w;m[8]=v;return m}function p(h,f){return new Float32Array(h,f,9)}const k=Object.freeze(Object.defineProperty({__proto__:null,clone:q,create:b,createView:p,fromValues:l}, Symbol.toStringTag,{value:"Module"}));a.clone=q;a.create=b;a.createView=p;a.fromValues=l;a.mat3f32=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/enums":function(){define(["exports"],function(a){a.BucketType=void 0;(function(b){b[b.FILL=1]="FILL";b[b.LINE=2]="LINE";b[b.SYMBOL=3]="SYMBOL";b[b.CIRCLE=4]="CIRCLE"})(a.BucketType||(a.BucketType={}));a.ShaderProgramType=void 0;(function(b){b[b.BACKGROUND=0]="BACKGROUND";b[b.FILL=1]="FILL";b[b.OUTLINE= 2]="OUTLINE";b[b.LINE=3]="LINE";b[b.ICON=4]="ICON";b[b.CIRCLE=5]="CIRCLE";b[b.TEXT=6]="TEXT";b[b.TILEINFO=7]="TILEINFO"})(a.ShaderProgramType||(a.ShaderProgramType={}));a.StyleUpdateType=void 0;(function(b){b[b.PAINTER_CHANGED=0]="PAINTER_CHANGED";b[b.LAYOUT_CHANGED=1]="LAYOUT_CHANGED";b[b.LAYER_CHANGED=2]="LAYER_CHANGED";b[b.LAYER_REMOVED=3]="LAYER_REMOVED";b[b.SPRITES_CHANGED=4]="SPRITES_CHANGED"})(a.StyleUpdateType||(a.StyleUpdateType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/vectorTiles/RenderBucket":function(){define("exports ../../../../core/maybe ../../../../core/typedArrayUtil ../../tiling/TileInfoView ../../tiling/TileKey ../../tiling/TileQueue ../../tiling/TileStrategy ./enums ./decluttering/util ../../../webgl/BufferObject ../../../webgl/enums ../../../webgl/VertexArrayObject".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(n,u){this.layerUIDs=[];this.isDestroyed=!1;this._data=n;let x=1;n=new Uint32Array(n);this.layerUIDs= [];const y=n[x++];for(let z=0;zg[1]&&([e,g]=[g,e]);const [d,t]=e,[w,v]=g;e=w-d;g=v-t;g=0!==g?e/g:0;const m=(Math.ceil(t)-t)*g,r=(Math.floor(t)-t)*g;return new h(d,Math.floor(t),Math.ceil(v),g,0>e?m:r,0>e?r:m,0>e?w:d,0>e?d:w)}constructor(e,g,d,t,w,v,m,r){this.x=e;this.ymin=g;this.ymax=d;this.invM=t;this.leftAdjust=w;this.rightAdjust=v;this.leftBound=m;this.rightBound=r}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+ this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const f=[[0,0],[0,0],[0,0],[0,0]];class c{constructor(e,g=null,d=e.lods[0].level,t=e.lods[e.lods.length-1].level){this.tileInfo=e;this.fullExtent=g;this.scales=[];this._infoByScale={};this._infoByLevel={};const w=e.lods.filter(m=>m.level>=d&&m.level<=t);this.minScale=w[0].scale;this.maxScale=w[w.length-1].scale;const v=this._lodInfos=w.map(m=>b.create(e,m,g));w.forEach((m,r)=>{this._infoByLevel[m.level]= v[r];this._infoByScale[m.scale]=v[r];this.scales[r]=m.scale},this);this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel["number"===typeof e?e:e.level]}getTileBounds(e,g,d=!1){k.set(g);return(g=this._infoByLevel[k.level])?g.getTileBounds(e,k,d):e}getTileCoords(e,g,d=!1){k.set(g);return(g=this._infoByLevel[k.level])?g.getTileCoords(e,k,d):e}getTileCoverage(e,g=192,d=!0,t="closest"){if(!d&&(e.scale>this.minScale||e.scaleg;g++)f[g][1]===f[n][1]?n=g:(n=h.create(f[g],f[n]),v=Math.min(n.ymin,v),m=Math.max(n.ymax,m),void 0===e[n.ymin]&&(e[n.ymin]=[]),e[n.ymin].push(n), n=g);if(null==v||null==m||100=d.first[1]&&v<=d.last[1])if(w)if(d.size[0]d.last[0]||u=v?u.incrRow():g.splice(n,1)}return t}getTileParentId(e){k.set(e);e=this._lodInfos.indexOf(this._infoByLevel[k.level])-1;if(0>e)return null;this._getTileIdAtLOD(k,this._lodInfos[e],k);return k.id}getTileResolution(e){return(e=this._infoByLevel["object"===typeof e?e.level:e])?e.resolution:-1}getTileScale(e){return(e=this._infoByLevel[e.level])?e.scale: -1}intersects(e,g){k.set(g);g=this._infoByLevel[k.level];const d=e.lodInfo;if(d.resolution>g.resolution){this._getTileIdAtLOD(k,d,k);var t=d.denormalizeCol(k.col,k.world);for(var w of e.spans)if(w.row===k.row&&w.colFrom<=t&&w.colTo>=t)return!0}if(d.resolution{x[0]=Math.min(x[0],y.row);x[1]=Math.max(x[1],y.row);x[2]=Math.min(x[2],y.colFrom);x[3]=Math.max(x[3],y.colTo);return x},[Infinity,-Infinity,Infinity,-Infinity]);t=g.denormalizeCol(k.col,k.world); e=d.getColumnForX(g.getXForColumn(t));w=d.getRowForY(g.getYForRow(k.row));t=d.getColumnForX(g.getXForColumn(t+1))-1;g=d.getRowForY(g.getYForRow(k.row+1))-1;return!(e>u||tr||gm.row===k.row&&m.colFrom<=v&&m.colTo>=v)}normalizeBounds(e,g,d){e[0]=g[0];e[1]=g[1];e[2]=g[2];e[3]=g[3];this._wrap&&(g=a.getInfo(this.tileInfo.spatialReference),d=-d*(g.valid[1]-g.valid[0]),e[0]+=d,e[2]+=d);return e}getSmallestInfoForScale(e){const g=this.scales; if(this._infoByScale[e])return this._infoByScale[e];if(e>g[0])return this._infoByScale[g[0]];for(let d=1;dg[d]+1E-6)return this._infoByScale[g[d-1]];return this._infoByScale[g[g.length-1]]}getClosestInfoForScale(e){const g=this.scales;if(this._infoByScale[e])return this._infoByScale[e];e=g.reduce((d,t)=>Math.abs(t-e)k?h-1-Math.abs((k+1)%h):k%h}denormalizeCol(k,h){return this.wrap?this.worldSize[0]*h+k:k}getWorldForColumn(k){return this.wrap?Math.floor(k/this.worldSize[0]):0}getFirstColumnForWorld(k){return k* this.worldSize[0]+this.first[0]}getLastColumnForWorld(k){return k*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(k){return(k-this.origin[0])/this.norm[0]}getXForColumn(k){return this.origin[0]+k*this.norm[0]}getRowForY(k){return(this.origin[1]-k)/this.norm[1]}getYForRow(k){return this.origin[1]-k*this.norm[1]}getTileBounds(k,h,f=!1){l.set(h);var c=f?l.col:this.denormalizeCol(l.col,l.world),e=l.row;h=this.getXForColumn(c);f=this.getYForRow(e+1);c=this.getXForColumn(c+1);e=this.getYForRow(e); k[0]=h;k[1]=f;k[2]=c;k[3]=e;return k}getTileCoords(k,h,f=!1){l.set(h);h=f?l.col:this.denormalizeCol(l.col,l.world);Array.isArray(k)?q(k,this.getXForColumn(h),this.getYForRow(l.row)):(k.x=this.getXForColumn(h),k.y=this.getYForRow(l.row));return k}}return p})},"esri/views/2d/tiling/TileKey":function(){define(["../../../core/ObjectPool"],function(a){class b{static getId(q,l,p,k){return"object"===typeof q?`${q.level}/${q.row}/${q.col}/${q.world}`:`${q}/${l}/${p}/${k}`}constructor(q,l,p,k){this.set(q, l,p,k)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(q){this.set(q)}get hash(){return(this.world&3)<<30|(this.col&4095)<<22|(this.row&4095)<<8|this.level&63}acquire(q,l,p,k){this.set(q,l,p,k)}contains(q){const l=q.level-this.level;return 0<=l&&this.row===q.row>>l&&this.col===q.col>>l&&this.world===q.world}containsChild(q){const l=q.level-this.level;return 0>l&&this.col===q.col>>l&&this.world===q.world}equals(q){return this.level=== q.level&&this.row===q.row&&this.col===q.col&&this.world===q.world}clone(){return new b(this)}release(){this.world=this.col=this.row=this.level=0}set(q,l,p,k){if(null==q)this.world=this.col=this.row=this.level=0;else if("object"===typeof q)this.level=q.level||0,this.row=q.row||0,this.col=q.col||0,this.world=q.world||0;else if("string"===typeof q){const [h,f,c,e]=q.split("/");this.level=parseFloat(h);this.row=parseFloat(f);this.col=parseFloat(c);this.world=parseFloat(e)}else this.level=+q,this.row= +l,this.col=+p,this.world=+k||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return 0>=this.level?null:new b(this.level-1,this.row>>1,this.col>>1,this.world)}getNeighborId(q,l){return`${this.level}/${this.row+l}/${this.col+q}/${this.world}`}getChildKeys(){const q=this.level+1,l=this.row<<1,p=this.col<<1,k=this.world;return[new b(q,l,p,k),new b(q,l,p+1,k),new b(q,l+1,p,k),new b(q,l+1,p+1,k)]}compareRowMajor(q){return this.rowq.row? 1:this.colq.col?1:0}}b.pool=new a(b,null,null,25,50);return b})},"esri/views/2d/tiling/TileCoverage":function(){define(["../../../core/ObjectPool","./TileKey"],function(a,b){class q{constructor(){this.spans=[]}acquire(l){this.lodInfo=l}release(){this.lodInfo=null;this.spans.length=0}*keys(){const l=this.lodInfo;for(const {row:p,colFrom:k,colTo:h}of this.spans)for(let f=k;f<=h;f++){const c=l.getWorldForColumn(f);yield new b(l.level,p,l.normalizeCol(f),c)}}forEach(l,p){const {spans:k, lodInfo:h}=this,{level:f}=h;if(0!==k.length)for(const {row:c,colFrom:e,colTo:g}of k)for(let d=e;d<=g;d++)l.call(p,f,c,h.normalizeCol(d),h.getWorldForColumn(d))}}q.pool=new a(q);return q})},"esri/views/2d/tiling/TileSpan":function(){define(function(){class a{constructor(b,q,l){this.row=b;this.colFrom=q;this.colTo=l}}return a})},"esri/views/2d/tiling/TileQueue":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/maybe ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/vec2 ../../support/QueueProcessor".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(m,r){m.length=0;r.forEach(n=>m.push(n));return m}const d=new Set,t=[],w=new Map,v=[0,0];b=class extends b{constructor(m){super(m);this._keyToItem=new Map;this.concurrency=6;this.strategy="scale-first";this.tileInfoView=null}initialize(){const {concurrency:m,process:r,strategy:n}=this;this._queue=new e.QueueProcessor({concurrency:m,process:(u,x)=>{u=this._keyToItem.get(u);return r(u,{signal:x})},peeker:"scale-first"===n?u=>this._peekByScaleFirst(u):u=>this._peekByCenterFirst(u)})}destroy(){this.clear(); this._queue=q.destroyMaybe(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}abort(m){this._queue.abort("string"===typeof m?m:m.id)}clear(){this._queue.clear();this._keyToItem.clear()}has(m){return"string"===typeof m?this._keyToItem.has(m):this._keyToItem.has(m.id)}isOngoing(m){m="string"===typeof m?m:m.id;return this.has(m)&&this._queue.isOngoing(m)}pause(){this._queue.pause()}push(m){const r=m.key.id;if(this._queue.has(r))return this._queue.get(r); const n=this._queue.push(r),u=()=>{this._keyToItem.delete(r)};this._keyToItem.set(r,m);n.then(u,u);return n}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(m){if(!this.state)return m.values().next().value;const r=this.tileInfoView;let n=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;m.forEach(B=>{B=this._keyToItem.get(B);const C=this.tileInfoView.getTileScale(B.key);w.has(C)||(w.set(C,[]),n=Math.max(C,n),u=Math.min(C,u));w.get(C).push(B.key);d.add(C)});let x=this.state.scale; w.has(x)||(g(t,d),t.sort((B,C)=>B-C),x=t.reduce((B,C)=>Math.abs(C-x){const D=y.denormalizeCol(B.col,B.world),F=y.denormalizeCol(C.col,C.world);return Math.sqrt((z-D)*(z-D)+(A-B.row)*(A-B.row))-Math.sqrt((z-F)*(z-F)+(A-C.row)*(A-C.row))});d.clear();w.clear();return m[0].id}_peekByCenterFirst(m){if(!this.state)return m.values().next().value; const r=this.tileInfoView,n=this.state.center;let u=Number.POSITIVE_INFINITY,x;m.forEach(y=>{y=this._keyToItem.get(y);r.getTileCoords(v,y.key);const z=c.distance(v,n);zg.push(d));this._controllers.clear();g.forEach(d=>d.abort());this._processingItems.clear();this._cancelNext()}forEach(g){this._deferreds.forEach((d,t)=>g(t))}get(g){return(g=this._deferreds.get(g))?g.promise:void 0}isOngoing(g){return this._processingItems.has(g)}has(g){return this._deferreds.has(g)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(g,d){const t= this.get(g);if(t)return t;const w=new AbortController;let v=null;d&&(v=l.onAbort(d,()=>w.abort()));const m=()=>{r.remove();null!=v&&v.remove();this._removeItem(g);this._queue.remove(g);this._scheduleNext()},r=l.onAbortOrThrow(w.signal,()=>{const u=this._processingItems.get(g);u&&u.controller.abort();m();n.reject(l.createAbortError())}),n=l.createResolver();this._deferreds.set(g,n);this._controllers.set(g,w);n.promise.then(m,m);this._queue.push(g);this._scheduleNext();return n.promise}last(){return this._queue.last()}lastPromise(){const g= this.last();return g?this.get(g):null}peek(){return this._queue.peek()}popLast(){const g=this._queue.popLast();g&&(this._deferreds.get(g)?.reject(l.createAbortError("Removed from queue")),this._removeItem(g));return g}reset(){const g=[];this._processingItems.forEach(d=>g.push(d));this._processingItems.clear();for(const d of g)this._queue.push(d.item),d.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const g=[]; for(;this._queue.length;)g.push(this._queue.pop());this.clear();return g}get running(){return!this._pausedSignal.value&&0{this._schedule=null;this._next()}))}_next(){for(;0this._processResult(t,v),v=>this._processError(t,v))):this._processResult(t,w)}}get test(){}}a.QueueProcessor=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/tiling/TileStrategy":function(){define(["../../../geometry/support/aaBoundingRect", "./TileCache","./TileCoverage","./TileKey"],function(a,b,q,l){const p=new l(0,0,0,0),k=new Map,h=[],f=[];class c{constructor(e){this._previousScale=Number.POSITIVE_INFINITY;this.cachePolicy="keep";this.coveragePolicy="closest";this.resampling=!0;this.tileIndex=new Map;this.tiles=[];this.buffer=192;this.acquireTile=e.acquireTile;this.releaseTile=e.releaseTile;this.tileInfoView=e.tileInfoView;null!=e.resampling&&(this.resampling=e.resampling);e.cachePolicy&&(this.cachePolicy=e.cachePolicy);e.coveragePolicy&& (this.coveragePolicy=e.coveragePolicy);null!=e.buffer&&(this.buffer=e.buffer);e.cacheSize&&(this._tileCache=new b(e.cacheSize,this.tileInfoView,g=>{this.releaseTile(g)}))}destroy(){this.tileIndex.clear()}update(e){const {resampling:g,tileIndex:d}=this,{scale:t,center:w,resolution:v}=e.state,{minScale:m,maxScale:r}=this.tileInfoView,n=!e.stationary&&t>this._previousScale;this._previousScale=t;if(!g&&(t>m||tC.visible=!0);var z=0,A=0;if(0y,!A||!n&&z?!B&&A||h.push(D):D.isReady?B&&"purge"===this.cachePolicy&&this._hasReadyAncestor(p,y)?h.push(D):f.push(D):B&&h.push(D));for(const C of f)C.isReady&&k.set(C.key.id,C);for(const C of h)this._tileCache?this._tileCache.add(C):this.releaseTile(C),d.delete(C.key.id);for(const C of k.values())this.tiles.push(C); for(const C of d.values())k.has(C.key.id)||(C.visible=!1);this._tileCache?.prune(y,w,v);q.pool.release(e);f.length=0;h.length=0;k.clear()}else this.tiles.length=0,this.clear()}clear(){const {tileIndex:e}=this;for(const g of e.values())this.releaseTile(g);e.clear()}refresh(e){for(const g of this.tileIndex.values())this.tiles.includes(g)?e(g):h.push(g);for(const g of h)this.releaseTile(g),this.tileIndex.delete(g.key.id);this._tileCache?.clear()}updateCacheSize(e){this._tileCache&&(this._tileCache.maxSize= e)}_addParentTile(e,g){let d=null;for(;;){e=this.tileInfoView.getTileParentId(e);if(!e)break;if(this.tileIndex.has(e)){if(d=this.tileIndex.get(e),d?.isReady){g.has(d.key.id)||g.set(d.key.id,d);break}}else if(this._tileCache?.has(e)&&(d=this._tileCache.pop(e),this.tileIndex.set(e,d),d?.isReady)){g.has(d.key.id)||g.set(d.key.id,d);break}}}_hasReadyAncestor(e,g){const d=a.create();this.tileInfoView.getTileBounds(d,e,!0);for(const t of this.tileIndex.values())if(t.isReady&&t.key.level>=g&&t.key.level< e.level){const w=a.create();this.tileInfoView.getTileBounds(w,t.key,!0);if(a.contains(w,d))return!0}return!1}}return c})},"esri/views/2d/tiling/TileCache":function(){define(["../../../core/libs/gl-matrix-2/math/vec2"],function(a){class b{constructor(q,l,p){this.maxSize=q;this._tileInfoView=l;this._removedFunc=p;this._tilePerId=new Map;this._tileKeysPerLevel=[]}clear(){this._tilePerId.clear();this._tileKeysPerLevel=[]}has(q){return this._tilePerId.has(q)}get(q){return this._tilePerId.get(q)}pop(q){const l= this._tilePerId.get(q);if(l){var p=this._tileKeysPerLevel[l.key.level];this._tilePerId["delete"](q);for(let k=0;kthis.maxSize&& 0<=h;)h!==q&&(k=this._pruneAroundCenterTile(k,l,p,h)),h--;k>this.maxSize&&(k=this._pruneAroundCenterTile(k,l,p,q))}}_pruneAroundCenterTile(q,l,p,k){k=this._tileKeysPerLevel[k];if(!k||0===k.length)return q;const {size:h,origin:f}=this._tileInfoView.tileInfo,c=p*h[0],e=p*h[1],g=[0,0],d=[0,0];for(k.sort((t,w)=>{g[0]=f.x+c*(t.col+.5);g[1]=f.y-e*(t.row+.5);d[0]=f.x+c*(w.col+.5);d[1]=f.y-e*(w.row+.5);return a.squaredDistance(g,l)-a.squaredDistance(d,l)});0>f)+(c-(g<>f);f=-f;return h-(g-(c<> f)<h?Math.max(h,c-k):Math.min(h,c+k),this.computedVisible=0=f)return g;var d=2**f;if(Math.floor(c/d)!==this.i||Math.floor(e/d)!==this.j)return g;var t=Infinity,w=-Infinity,v=this.samplerData.data.width, m=this.samplerData.data.values,r=.5*p.elevationNoDataValue;f=(v-1)/d;e=(e-this.j*d)*f;let n=(c-this.i*d)*f;if(1>f){const y=Math.floor(e),z=Math.floor(n);var u=y+z*v;c=m[u];d=m[u+1];var x=m[u+v];u=m[u+v+1];if(c+d+x+uthis.notifyChange("stencilEnabledExtents"))])}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}get stencilEnabledExtents(){return this._computeStencilEnabledExtents()}_computeStencilEnabledExtents(){const n= [];this.layerViews.forEach(u=>{u=u.layer;"operationalLayerType"in u&&g.isIntegratedMeshOperationalLayer(u.operationalLayerType)&&null!=this.viewSpatialReference&&(u=v(u.fullExtent,this.viewSpatialReference),null!=u&&n.push(e.fromExtent(u)))});return n}};b.__decorate([l.property({readOnly:!0})],a.ExtentHelper.prototype,"layerViewsExtent",null);b.__decorate([l.property({readOnly:!0})],a.ExtentHelper.prototype,"tiledLayersExtent",null);b.__decorate([l.property({readOnly:!0})],a.ExtentHelper.prototype, "stencilEnabledExtents",null);b.__decorate([l.property()],a.ExtentHelper.prototype,"viewSpatialReference",void 0);b.__decorate([l.property()],a.ExtentHelper.prototype,"tilingScheme",void 0);b.__decorate([l.property()],a.ExtentHelper.prototype,"defaultTiledLayersExtent",void 0);b.__decorate([l.property({constructOnly:!0})],a.ExtentHelper.prototype,"layers",void 0);b.__decorate([l.property({constructOnly:!0})],a.ExtentHelper.prototype,"layerViews",void 0);a.ExtentHelper=b.__decorate([f.subclass("esri.views.3d.terrain.ExtentHelper")], a.ExtentHelper);let m=class extends a.ExtentHelper{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?t.webMercatorWorldExtent:t.geographicWorldExtent}};m=b.__decorate([f.subclass("esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal")],m);let r=class extends a.ExtentHelper{_computeLayerViewsExtent(){const n=e.empty(),u=this.viewSpatialReference;this.layerViews.forEach(z=>{const A= z.layer;!z.isResolved()||"graphics"===A.type&&A.internal||(z=v("fullExtentInLocalViewSpatialReference"in z&&z.fullExtentInLocalViewSpatialReference||z.layer.fullExtent,u),e.expand(n,z,n))});const x=e.allFinite(n)?n:null,y=this._get("layerViewsExtent");return e.equals(x,y)?y:x}_computeTiledLayersExtent(){const n=this.tilingScheme;if(!n)return null;const u=this.viewSpatialReference,x=e.empty();this.layers.forEach(A=>{if(A.loaded&&g.isTiledLayer(A)){var B=w.getTiledLayerInfo(A,u,d.ViewingMode.Local); if(null!=B){var {tileInfo:C,fullExtent:D}=B;B="tilemapCache"in A?A.tilemapCache?.effectiveMaxLOD:void 0;null!=C&&null!=D&&(w.isProjectableRasterLayer(A)||n.compatibleWith(C,B)&&D.spatialReference.equals(n.spatialReference))&&e.expand(x,D,x)}}});e.expand(x,this.defaultTiledLayersExtent,x);const y=e.allFinite(x)?x:null,z=this._get("tiledLayersExtent");return e.equals(y,z)?z:y}};r=b.__decorate([f.subclass("esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal")],r);a.create=function(n,u){return n===d.ViewingMode.Global? new m(u):new r(u)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/terrainUtils":function(){define("exports ../../../core/Collection ../../../geometry/support/spatialReferenceUtils ../../../layers/support/layerUtils ../../ViewingMode ./NeighborIndex ./TerrainData ../../../chunks/terrainUtilsPlanar ../../../chunks/terrainUtilsSpherical".split(" "),function(a,b,q,l,p,k,h,f,c){function e(A){return"imagery-tile"===A?.type||"wcs"===A?.type}function g(A){return"imagery-tile-3d"=== A?.type}function d(A){return"tile-3d"===A?.type}function t(A){return"vector-tile-3d"===A?.type}function w(A){return"wmts-3d"===A?.type}function v(A){return"elevation-3d"===A?.type}function m(A){return A&&(d(A)||g(A)||t(A)||w(A))}function r(A){return h.isVectorTile(A?.data)}function n(A,B,C,D,F){return y[D].checkIfTileInfoSupportedForViewSR(A,C,B,F)}function u(A,B,C){A=l.getTileMaxtrixSetFromActiveLayer(A);if(null!=A)if(b.isCollection(A)){if(A=A.find(D=>null==n(D.tileInfo,D.fullExtent,B,C)))return{tileInfo:A.tileInfo, fullExtent:A.fullExtent}}else return{tileInfo:A.tileInfo,fullExtent:A.fullExtent};return{tileInfo:null,fullExtent:null}}function x(A){return A.isWGS84||A.isWebMercator||q.isCGCS2000(A)||!q.isEarth(A)}const y={[p.ViewingMode.Global]:c.terrainUtilsSpherical,[p.ViewingMode.Local]:f.terrainUtilsPlanar};a.enableTerrainInternalChecks=!1;a.enableWaterproofTests=!1;const z={force512VTL:!1};f=[k.NeighborIndex.NORTH,k.NeighborIndex.EAST,k.NeighborIndex.SOUTH,k.NeighborIndex.WEST];c=[k.NeighborIndex.NORTH_EAST, k.NeighborIndex.SOUTH_EAST,k.NeighborIndex.SOUTH_WEST,k.NeighborIndex.NORTH_WEST];a.almostEquals=function(A,B,C=1E-5){return Math.abs(A-B)=y?n:z<=y?u:q.add(t,n,q.scale(x,x,y/z));r=q.subtract(t,r,n);return Math.PI/2-Math.atan(r[2]/Math.sqrt(r[0]*r[0]+r[1]*r[1]))}function g(r,n,u){r=r.extent;if(null==r)return 0;v[0]=r[0];v[1]=r[1];v[2]=u;m[0]=r[2];m[1]=r[3];m[2]=u;r=u=Infinity;n[0]m[0]&&(u=e(n,m,v,0));n[1]m[1]&&(r=e(n,m,v,1));return Math.min(u,r)}function d(r,n,u,x){if(null==r)return f.getMissingTileInfoError(); x=r.spatialReference;if(x.isGeographic&&!k.isSupportedEarthGCS(x))return new b("tilingscheme:local-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in local scenes");var y=f.TilingScheme.checkUnsupported(r);if(null!=y)return y;if(null==u)return new b("tilingscheme:extent-not-exist","The layer does not provide a layer extent.");{var z=r.lods;y=z[0].resolution*2**z[0].level;var A=[y*r.size[0],y*r.size[1]];const B=[r.origin.x,r.origin.y];u=p.fromExtent(u);const C= p.create();f.TilingScheme.computeRowColExtent(u,A,B,C);A=(C[2]-C[0])*(C[3]-C[1]);A>h.maxRootTiles?(z=z[0].scale*2**z[0].level,r=Math.max((u[3]-u[1])/r.size[1],(u[2]-u[0])/r.size[0])*z/y,y=Math.floor(Math.log(r)/Math.log(10)),r=Math.ceil(r/10**y)*10**y,r=new b("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+Math.floor(z).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+r.toLocaleString()+".",{level0Scale:z,suggestedLevel0Scale:r,requiredNumRootTiles:A, allowedNumRootTiles:h.maxRootTiles})):r=null}return r?r:null==n||x.equals(n)||n.isWGS84&&x.isWebMercator?null:new b("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene")}const t=l.create(),w=l.create(),v=l.create(),m=l.create();l=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:d,isInsideExtent:c,tiltToExtentEdge:g},Symbol.toStringTag,{value:"Module"}));a.checkIfTileInfoSupportedForViewSR=d;a.isInsideExtent= c;a.terrainUtilsPlanar=l;a.tiltToExtentEdge=g})},"esri/views/3d/support/supportedSpatialReference":function(){define(["exports","../../../geometry/support/spatialReferenceUtils"],function(a,b){function q(l){return b.isWGS84(l)||b.isCGCS2000(l)}a.isSupportedEarthGCS=q;a.isSupportedGCSOnGlobe=function(l){return q(l)||b.isMars(l)||b.isMoon(l)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/terrainUtilsSpherical":function(){define(["exports","../core/Error","../views/3d/support/supportedSpatialReference", "../views/3d/terrain/TilingScheme"],function(a,b,q,l){function p(){return!0}function k(){return 0}function h(c,e,g,d){if(null==c)return l.getMissingTileInfoError();g=c?.lods.length-1;const t=c.spatialReference;if(t.isWebMercator){if(!l.TilingScheme.makeWebMercatorAuxiliarySphere(g).compatibleWith(c,d))return new b("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else if(q.isSupportedGCSOnGlobe(t)){if(!l.TilingScheme.makeGCSWithTileSize(c.spatialReference, c.size[0],g).compatibleWith(c,d))return c.spatialReference.isWGS84?new b("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme"):new b("tilingscheme:incompatible-global","The tiling scheme is not compatible with the ArcGIS Online tiling scheme")}else return new b("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");return null==e||c.spatialReference.equals(e)? null:new b("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}const f=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:h,isInsideExtent:p,tiltToExtentEdge:k},Symbol.toStringTag,{value:"Module"}));a.checkIfTileInfoSupportedForViewSR=h;a.isInsideExtent=p;a.terrainUtilsSpherical=f;a.tiltToExtentEdge=k})},"esri/views/3d/terrain/OverlayManager":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Cyclical ../../../core/has ../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/time ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/vec2 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/ellipsoidUtils ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingRect ../../../geometry/support/ray ../../../chunks/sphere ../../../geometry/support/vector ../../../geometry/support/webMercatorUtils ../state/utils/viewUtils ../support/debugFlags ../support/debugUtils ./interfaces ./OverlayRenderer ../webgl-engine/lib/basicInterfaces ../webgl-engine/lib/Intersector ../webgl-engine/lib/LocalOriginFactory ../webgl-engine/lib/Material ../webgl-engine/lib/SortedRenderGeometryRenderer ../webgl-engine/lib/textureUtils ../webgl-engine/parts/requireUtils ../../support/Scheduler ../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R){const Q=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let W;a.OverlayManager=class extends q{constructor(ca){super(ca);this._renderSR=this._spatialReference=null;this._overlaySREqualsRenderSR=!0;this._drapeSources=new Set;this._drapeTargets=new Set;this._drawTexturesAnimateDirty=this._drawTexturesDirty=this._contentUpdated= this._placementDirty=!1;this._longitudeCyclical=null;this._latestOriginId=0;this._maxResolution=p("esri-mobile")?2048:4096;this._animationTimeLast=0}initialize(){const ca=this.view;this.renderer=new E.OverlayRenderer({view:ca,worldToPCSRatio:this._worldToPCSRatio,spatialReference:this._spatialReference});ca._stage.renderer.plugins.add(this.renderer);const ea=()=>this.setDrawTexturesDirty();this._groundIntersector=I.newIntersector(this.view.state.viewingMode);this._groundIntersector.options.backfacesTerrain= !0;this._groundIntersector.options.invisibleTerrain=!0;this._groundIntersector.options.hud=!1;this.addHandles([f.watch(()=>this.renderer.hasHighlights,ea),this.renderer.events.on("has-water",da=>ca._stage?.renderer.setParameters({hasOverlayWater:da})),this.renderer.events.on("content-changed",ea),f.watch(()=>ca.state.camera.pixelRatio,ea),f.watch(()=>ca.state.alignPixelEnabled,ea),this.renderer.events.on("textures-disposed",()=>this.surface.requestRender()),f.watch(()=>[ca.pointsOfInterest?.renderPointOfView, ca.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),f.watch(()=>[ca.state?.pixelRatio,ca.state?.contentPixelRatio],()=>this.setPlacementDirty(),f.sync),this.surface.on("elevation-change",()=>this.setPlacementDirty()),ca.on("resize",()=>this.setPlacementDirty()),ca.resourceController.scheduler.registerTask(J.TaskPriority.OVERLAY,this),ca._stage.renderView.events.on("force-camera-for-screenshot",da=>{this._updateOverlays(J.noBudget,da.camera,G.RenderRequestType.BACKGROUND); this.renderer.hasOverlays&&this._drawOverlays(G.RenderRequestType.BACKGROUND,da)})]);ca._stage.renderer.renderOverlay=da=>this._renderOverlay(da)}destroy(){this.view?._stage&&(this.view._stage.renderer.plugins.remove(this.renderer),this.view._stage.renderer.renderOverlay=()=>{});W&&(W.hide(),W=null);this.renderer=h.destroyMaybe(this.renderer)}get running(){return this._placementDirty&&(0this._updateDrapeSourceExtent(fa)),this.surface.updateTileOverlayParams(da); ea===Z.NONE&&ia===Z.NONE||this.setDrawTexturesDirty();this._placementDirty=!1;ca.madeProgress()}_computeOverlayResolution(ca){const ea=this.view.state.contentPixelRatio*this.view.resolutionScale;return Math.min(M.applyTextureResizeModulo(Math.ceil(1.5*Math.max(ca.fullWidth/ca.pixelRatio*ea,ca.fullHeight/ca.pixelRatio*ea))),this._maxResolution)}_updateOverlay(ca,ea,da,ia,ka){if(0===this.renderer.overlays.length)return Z.NONE;ca=this.renderer.overlays[ca];const fa=ca.mapUnitsPerPixel;ca.mapUnitsPerPixel= ka;ca.pixelRatio=ia;ia=ca.extent;const X=F.debugFlags.TESTS_DISABLE_OPTIMIZATIONS?0:1E-5*Math.max(ea[2]-ea[0],ea[3]-ea[1],ia[2]-ia[0],ia[3]-ia[1]);if(Math.abs(ia[0]-ea[0])<=X&&Math.abs(ia[1]-ea[1])<=X&&Math.abs(ia[2]-ea[2])<=X&&Math.abs(ia[3]-ea[3])<=X&&da===ca.resolution)return fa===ka?Z.NONE:Z.RERENDER_ONLY;y.copy(ca.extent,ea);ca.resolution=da;ea=y.center(ca.extent);ca.renderLocalOrigin=O.fromValues(ea[0],ea[1],0,`OV_${this._latestOriginId++}`);return Z.EXTENT}setTileParameters(ca){const ea=ca.renderData.overlay; if(0ja&&(X=ja-(ca[2]-ca[0]))}da.setScale(ea,y.width(ca)/ka,y.height(ca)/fa);da.setOffset(ea,(X-ia[0])/ka,(ca[1]-ia[1])/fa)}}_clearTileOverlayData(ca,ea){ea.setScale(ca,-1,-1);ea.setOffset(ca,-1,-1)}async reloadShaders(){K.removeLoadedShaderModules();await this.renderer.reloadShaders();this.setDrawTexturesDirty();this.runTask(J.noBudget)}_dispatchAnimationUpdate(ca){var ea=c.Milliseconds(ca- this._animationTimeLast);if(ea>=this.surface.view._stage.renderer.animationTimestep||null!=this.view.state.forcedAnimationTime||this._drawTexturesDirty||this._drawTexturesAnimateDirty)ea=c.Milliseconds(ea/this.surface.view._stage.renderer.animationTimeDilation),ea=new L.UpdateParameters(this.view.state.camera,ea,this.view.state.forcedAnimationTime),this.renderer.updateAnimation(ea)&&(this._drawTexturesAnimateDirty=!0),this._animationTimeLast=ca}setDrawTexturesDirty(){this.renderer.hasOverlays?(this._drawTexturesDirty= this._contentUpdated=!0,this.view._stage.renderView.requestRender()):this.setPlacementDirty()}_intersectGroundFromView(ca,ea,da,ia){da=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(ca,U,ea,da);if(null==da)return!1;ea=da.origin;da=v.add(T,da.origin,da.direction);this._groundIntersector.reset(ea,da,ca);this._groundIntersector.intersect([]);this.view.basemapTerrain.intersect(this._groundIntersector,null,ea,da);return this._groundIntersector.results.min.getIntersectionPoint(ia)}_findHorizonBasedPointOfInterest(ca, ea){var da=.5;da=this.view.renderCoordsHelper.getAltitude(ca.eye);const ia=this.view.pointsOfInterest.centerOnSurfaceFrequent;var ka=k.clamp(ia.estimatedSurfaceAltitude,ca.aboveGround?-Infinity:da+1E-5,ca.aboveGround?da-1E-5:Infinity);da=ca.aboveGround;if("global"===this.view.viewingMode){var fa=T;A.closestPointOnSilhouette(A.fromRadius(A.tmpSphere,u.getReferenceEllipsoid(this.view.spatialReference).radius+ka),z.wrap(ca.eye,ca.viewForward),fa);v.subtract(fa,fa,ca.eye);ka=l.cyclicalPI.normalize(B.angleAroundAxis(ca.viewForward, fa,ca.viewRight))/ca.fovY+.5;fa=0>=ka||1<=ka?.5:.55;da=da?fa*ka:ka+fa*(1-ka)}else ka=n.fromValues(0,Math.tan(.5*Math.PI-Math.acos(-ca.viewForward[2])),1,0),ka=r.transformMat4(ka,ka,ca.projectionMatrix)[1],ka=k.clamp(.5+.5*ka,0,1),da=1===ka||0===ka?.5:da?.55*ka:1-.55*(1-ka);return this._intersectGroundFromView(ca,.5,da,ea)?v.sqrDist(ea,ca.eye)=ja&&(fa=ja,ka[1]=0,this._spatialReference.isWebMercator&&(ka[0]=0)));la=1;na&&(la=1/Math.max(.2, Math.cos(Math.abs(k.deg2rad(ka[1])))),180y.width(ia)?y.copy(za,ia):Math.PI/2-Math.abs(X-Math.PI/2)<=.25*Math.PI?(za[0]=na[0]-va, za[1]=na[1]-fa,za[2]=na[2]+va,za[3]=na[3]+fa):(x.projectVectorToVector(ca.eye,this._renderSR,T,this._spatialReference),w.subtract(V,ka,T),ca=-Math.atan2(V[1],V[0])+.125*Math.PI,0>ca&&(ca+=2*Math.PI),r.scale(V,Q[Math.floor(ca/(.25*Math.PI))],2*fa),V[0]*=la,V[2]*=la,r.add(za,na,V));this._isSpherical?(za[0]=this._longitudeCyclical.clamp(za[0]),za[2]=this._longitudeCyclical.clamp(za[2]),za[1]=Math.max(za[1],-ja),za[3]=Math.min(za[3],ja)):(ca=y.intersection(na,ia,ha),ia=y.intersection(za,ia,ba),y.contains(ca, ia)&&(za[2]=za[0],za[3]=za[1]));ea=Math.abs(na[2]-na[0])/ea;da.mapUnitsPerPixel=Math.max(da.mapUnitsPerPixel,ea);da.pixelRatioAdjustment=da.mapUnitsPerPixel/ea}_drawOverlays(ca,ea){if(this.renderer.hasOverlays){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;var da=this._drawTexturesDirty;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;var ia=this.renderer.computeValidity();this.renderer.releaseRenderTargets();this.renderer.drawOverlays(ea);ea=this.renderer.computeValidity(); ia!==ea&&this.surface.updateTileOverlayParams(G.RenderRequestType.UPDATE);da?(this.surface.requestRender(ca),ca===G.RenderRequestType.UPDATE&&this.surface.requestUpdate()):this.surface.requestRender(G.RenderRequestType.BACKGROUND);return this.renderer}}_rectanglesOverlap(ca,ea){return null==ca?!1:this._longitudeCyclical?(this._longitudeCyclical.contains(ea[0],ea[2],ca[0])||this._longitudeCyclical.contains(ea[0],ea[2],ca[2])||this._longitudeCyclical.contains(ca[0],ca[2],ea[0]))&&!(ca[1]>ea[3]||ca[3]< ea[1]):y.intersects(ca,ea)}_rectInsideRect(ca,ea){return null==ea?!1:this._longitudeCyclical?this._longitudeCyclical.contains(ca[0],ca[2],ea[0])&&this._longitudeCyclical.contains(ca[0],ca[2],ea[2])&&ea[1]>ca[1]&&ea[3]=ea[1]&&ca.y<=ea[3];const da=ca.x;ca=ca.y;return da>ea[0]&&daea[1]&&caea&&(ia=ea-ca[2]);ca[1]<-da?ka=ca[1]+da:ca[3]>da&&(ka=da-ca[3]);y.offset(ca,ia,ka)}get test(){}};b.__decorate([e.property()],a.OverlayManager.prototype,"_spatialReference",void 0);b.__decorate([e.property({readOnly:!0})],a.OverlayManager.prototype,"running",null);b.__decorate([e.property()],a.OverlayManager.prototype,"_placementDirty",void 0);b.__decorate([e.property()],a.OverlayManager.prototype,"_contentUpdated",void 0);b.__decorate([e.property()],a.OverlayManager.prototype,"_isSpherical", null);b.__decorate([e.property()],a.OverlayManager.prototype,"_worldToPCSRatio",null);b.__decorate([e.property()],a.OverlayManager.prototype,"renderer",void 0);b.__decorate([e.property({constructOnly:!0})],a.OverlayManager.prototype,"view",void 0);b.__decorate([e.property({constructOnly:!0})],a.OverlayManager.prototype,"surface",void 0);b.__decorate([e.property()],a.OverlayManager.prototype,"suspended",null);b.__decorate([e.property()],a.OverlayManager.prototype,"updating",null);b.__decorate([e.property({type:Boolean})], a.OverlayManager.prototype,"rendersOccludedDraped",null);a.OverlayManager=b.__decorate([t.subclass("esri.views.3d.terrain.OverlayManager")],a.OverlayManager);class S{constructor(){this.inner=y.create();this.outer=y.create();this.mapUnitsPerPixel=0;this.pixelRatioAdjustment=1;this.stretch=1.3}}const V=n.create(),T=m.create(),Y=new S,ha=y.create(),ba=y.create(),U=z.create();var Z;(function(ca){ca[ca.NONE=0]="NONE";ca[ca.EXTENT=1]="EXTENT";ca[ca.RERENDER_ONLY=2]="RERENDER_ONLY"})(Z||={});Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/parts/requireUtils":function(){define(["exports"],function(a){a.removeLoadedShaderModules=function(){const b=globalThis.require?.modules;if(b){const q=Object.keys(b);for(const l of q)l.includes(".glsl")&&delete b[l]}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/PlanarPatch":function(){define("exports ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/SpatialReference ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/spatialReferenceUtils ./PatchGeometryFactory ./Tile ./TileFrustumVisibility ../webgl-engine/lib/RayIntersections".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){class d extends c.Tile{constructor(w,v,m,r,n){super();this._horizontalScaleFactor=1;this._extentInRenderSR=k.create();this._baseUsedMemory=900;this._subtreeGeometryElevationBoundMax=this._subtreeGeometryElevationBoundMin=0;this.init(w,v,m,r,n)}init(w,v,m,r,n){super.init(w,v,m,r,n);w=n.view.renderSpatialReference;v=n.spatialReference;this._horizontalScaleFactor=w=null!=w&&h.isPlateCarree(w)&&null!=v&&v.isGeographic?this.ellipsoid.radius*Math.PI/180:1;({isWebMercatorOnPlateCarree:m}= n);n=this._extentInRenderSR;v=this.extent;if(m)w=b.fromValues(v[0],v[1],0),l.projectVectorToVector(w,q.WebMercator,w,q.PlateCarree),v=b.fromValues(v[2],v[3],0),l.projectVectorToVector(v,q.WebMercator,v,q.PlateCarree),n[0]=w[0],n[1]=w[1],n[2]=v[0],n[3]=v[1];else for(m=0;4>m;++m)n[m]=v[m]*w;this.centerAtSeaLevel[0]=.5*(n[0]+n[2]);this.centerAtSeaLevel[1]=.5*(n[1]+n[3]);this.centerAtSeaLevel[2]=0;this._edgeLen=Math.max(n[2]-n[0],n[3]-n[1]);this._edgeLen2=this._edgeLen*this._edgeLen;this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter(); var w=this._extentInRenderSR;const v=.5*(w[2]-w[0]);w=.5*(w[3]-w[1]);this._center[c.CenterPosition.MIDDLE][3]=Math.max(Math.sqrt(v*v+w*w),.5*(this.elevationBoundsMax-this.elevationBoundsMin))}_calculateFrustumVisibilityStatus(w){var v=this._aabb();const m=v[0],r=v[1],n=v[2],u=v[3],x=v[4];v=v[5];let y=!0;for(let A=0;6>A;A++){var z=w[A];const B=z[0],C=z[1],D=z[2];z=z[3];if(0<=B*(0=B*(0>B?m:u)+C*(0>C?r:x)+D*(0>D?n:v)+z}return y? e.TileFrustumVisibility.INSIDE:e.TileFrustumVisibility.INTERSECTS}_aabb(){const w=this._extentInRenderSR;return p.wrap(w[0],w[1],Math.min(this.elevationBoundsMin,this._subtreeGeometryElevationBoundMin),w[2],w[3],Math.max(this.elevationBoundsMax,this._subtreeGeometryElevationBoundMax))}intersectsRay(w,v,m,r){t[0]=1/v[0];t[1]=1/v[1];t[2]=1/v[2];return g.intersectAabbInvDirBefore(this._aabb(),w,t,m,r)}createGeometry(){f.createPlanarGlobePatch(this.renderData,this._horizontalScaleFactor);this._updateSubtreeGeometryElevationsBounds(); this.setMemoryDirty()}_updateSubtreeGeometryElevationsBounds(){var w=this.renderData;let v=this._subtreeGeometryElevationBoundMin,m=this._subtreeGeometryElevationBoundMax;if(w)w=w.geometry.boundingBox,v=w[2],m=w[5];else if(!this.isLeaf){v=Infinity;m=-Infinity;for(const r of this.children)v=Math.min(v,r._subtreeGeometryElevationBoundMin),m=Math.max(m,r._subtreeGeometryElevationBoundMax)}if(v!==this._subtreeGeometryElevationBoundMin||m!==this._subtreeGeometryElevationBoundMax)this._subtreeGeometryElevationBoundMin= v,this._subtreeGeometryElevationBoundMax=m,this.parent?._updateSubtreeGeometryElevationsBounds()}getDefaultVerticesPerSide(){return 9>this.level?3:2}updateCornerElevations(){f.updateCornersPlanar(this.renderData,this._horizontalScaleFactor);this._updateSubtreeGeometryElevationsBounds()}updateEdgeElevations(){f.updateEdgesAndCornersPlanar(this.renderData,this._horizontalScaleFactor);this._updateSubtreeGeometryElevationsBounds()}updateEdgeElevationsAndResolutions(){f.updateEdgeElevationsAndResolutionsPlanar(this.renderData, this._horizontalScaleFactor);this._updateSubtreeGeometryElevationsBounds()}get horizontalScale(){return this._horizontalScaleFactor}}const t=b.create();a.PlanarPatch=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/PatchGeometryFactory":function(){define("exports ../../../core/mathUtils ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ./ElevationData ./interfaces ./NeighborIndex ./PatchGeometry ./PatchGeometryLUT ./PatchRenderData ./terrainUtils ./Tile ./tileUtils ../webgl-engine/lib/Normals".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(U,Z,ca){const {tile:ea,localOrigin:da,geometry:ia}=U,{extent:ka,ellipsoid:fa}=ea,{boundingBox:X,numVerticesPerSide:ja,vertexAttributes:la,poleVerticesStartIndex:na}=ia,va=ja-1,za=da[0],ya=da[1],Da=da[2],ra=fa.radius,xa=ka[1],Ma=ka[3],Ga=[];let Pa=na;U=(Qa,Ea)=>{Ea*=ja;K(-za,-ya,-Da+Qa*ra,X);Ga.push(new W(1===Qa,Ea,1===Qa?0:2,Pa,6));Ea=Math.PI/2-2*Math.atan(Math.exp(-(-1===Qa?xa:Ma)/ra));const ua=Qa*Math.PI/2-Ea;Qa=.99*(1===Qa?1:-1);const Na=ra+0,{position:Ua, uv0:wa}=la,{typedBuffer:sa,typedBufferStride:Ha}=la.normalCompressed;for(let Aa=1;6>=Aa;++Aa){var Ka=Ea+Aa/6*ua;const Sa=Math.cos(Ka);Ka=Math.sin(Ka);for(let Ya=0;Ya<=va;Ya++){const qa=Ya/va,aa=V.cosLonLUT[Ya]*Sa,Ja=V.sinLonLUT[Ya]*Sa,Ta=Ka,Ra=aa*Na-za,$a=Ja*Na-ya,bb=Ta*Na-Da;K(Ra,$a,bb,X);Ua.setValues(Pa,Ra,$a,bb);f.encodeUVInBuffer(wa,Pa,qa,Qa);w.compressNormal(sa,Pa,aa,Ja,Ta,Ha);++Pa}}};Z&&U(-1,0);ca&&U(1,va);return Ga}function m(U){U.tile.intersectsClippingArea&&(I(U),r(U))}function r(U,Z=!1){const {geometry:ca, geometryState:ea,tile:da,localOrigin:ia}=U,{level:ka,extent:fa,extentInRadians:X,ellipsoid:ja}=da,la=ja.radius,na=X[0],va=X[2],za=X[1],ya=X[3],{samplerData:Da}=ea,ra=fa[0],xa=fa[2],Ma=fa[1],Ga=fa[3],Pa=n(U),{boundingBox:Qa,vertexAttributes:Ea}=ca,ua=ia[0],Na=ia[1],Ua=ia[2];var wa=Ea.position;const sa=wa.typedBuffer,Ha=wa.typedBufferStride,Ka=Ea.uv0;for(let aa=0;4>aa;++aa){const Ja=1===aa||3===aa;wa=ea.edgeResolutions[aa];g.internalAssert(b.isPowerOfTwo(wa));const Ta=wa+1;var Aa=e.neighborTileIfLoadedOrSelf(da, ea.edgePeerNeighbors[aa]);if(M(da,Aa,aa)){G(U,aa,Aa);continue}const Ra=null!=Aa;g.internalAssert(!Ra||Aa.level===da.level);g.internalAssert(!Ra||0>=t.compareTilesByLij(da,Aa));var Sa=Aa?.renderData?.geometryState;if(g.enableTerrainInternalChecks){var Ya=da.surface;if(!Aa&&Ya&&!Ya.updatingRootTiles){var qa=g.neighborEdgeIndices[aa];const pb=da.findNeighborTile(qa,Bb=>Bb.isLoaded||Bb.isLeaf||Bb.level===da.level);pb?pb.intersectsClippingArea&&(g.internalAssert(!pb.isLoaded),g.internalAssert(!pb.isLeaf), g.internalAssert(pb.level===ka)):g.internalAssert(null==Ya?.rootTiles||!da.shouldHaveNeighbor(qa))}}const $a=1===aa?fa[2]:fa[0],bb=(Aa=Aa?.extent)&&Ja?1===aa?Aa[0]:Aa[2]:$a,pa=0===aa?fa[3]:fa[1],Ba=1===aa?1:0,Ia=0===aa?1:0,Wa=1===aa?va:na,gb=0===aa?ya:za,ib=Math.sin(Wa),La=Math.cos(Wa),Xa=Math.sin(gb),eb=Math.cos(gb),db=Sa?.samplerData;Sa=(pb,Bb,Kb)=>p.sampleElevation(pb,Bb,Da);Ya=(pb,Bb,Kb)=>.5*(p.sampleElevation(pb,Bb,Da)+p.sampleElevation(Kb,Bb,db));const jb=Ra?Ya:Sa;Sa=ca.outerEdgesOffsetAndLength[2* aa];const nb=Z&&3null!=pb);qa=null!=db&&db.some(pb=>null!=pb);const qb=Ya||qa,ub=1/wa,xb=Sa;g.internalAssert(!Aa||g.almostEquals(Aa[2]-Aa[0],fa[2]-fa[0]));(()=>{const pb=1===aa?-1:3===aa?1:0,Bb=0===aa?-1:2===aa?1:0,Kb=(fa[2]-fa[0])*ub,bc=pb*Kb,Ib=Bb*Kb,$b=va-na,kc=Ja?pb*$b*ub:0,fc=Ja?0:Bb*ub,Pb=Ia,Cb=Ja?Wa+kc:Wa,Vb=Ja?Math.sin(Cb):ib,gc=Ja?Math.cos(Cb):La,Lb=Ja?Wa-kc:Wa,lb=Ja?Math.sin(Lb):ib,oa=Ja?Math.cos(Lb):La,Fa=Ja?gb:Pa(Pb+fc),Va=Ja?Xa:Math.sin(Fa),Za=Ja?eb: Math.cos(Fa),fb=Ja?gb:Pa(Pb-fc),kb=Ja?Xa:Math.sin(fb),mb=Ja?eb:Math.cos(fb);let rb=0,tb=0,yb=0;const zb=0*ub,Ab=Ja?$a:ra*(1-zb)+xa*zb,Fb=Ja?bb:Ab,Qb=Ja?Ma*(1-zb)+Ga*zb:pa,sb=Ja?Wa:na*(1-zb)+va*zb,vb=Ja?ib:Math.sin(sb),Gb=Ja?La:Math.cos(sb),Hb=Ja?Pa(zb):gb,Tb=Ja?Math.sin(Hb):Xa,lc=Ja?Math.cos(Hb):eb,Ub=la+jb(Ab,Qb,Fb);rb=Gb*lc*Ub;tb=vb*lc*Ub;yb=Tb*Ub;let Zb=0,ac=0,Mb=0;const Jb=1*ub,Wb=Ja?$a:ra*(1-Jb)+xa*Jb,cc=Ja?bb:Wb,Db=Ja?Ma*(1-Jb)+Ga*Jb:pa,Nb=Ja?Wa:na*(1-Jb)+va*Jb,hc=Ja?ib:Math.sin(Nb),xc=Ja?La: Math.cos(Nb),nc=Ja?Pa(Jb):gb,Xb=Ja?Math.sin(nc):Xa,tc=Ja?Math.cos(nc):eb,Yb=la+jb(Wb,Db,cc);Zb=xc*tc*Yb;ac=hc*tc*Yb;Mb=Xb*Yb;for(let dc=1;dcud*ud){let Id=0,Ac=0,gd=0;const hd=0===aa?-1:1;Id=hd*(rd-td);Ac=hd*(Pd-xe);gd=hd*(ed-ad);const Ec=dc*ub,id=Ja?$a:ra*(1-Ec)+xa*Ec,Jd=Ja?bb:id,jd=Ja?Ma*(1-Ec)+Ga*Ec:pa,ye=Ja?Wa:na*(1-Ec)+va*Ec,kd=Ja?ib:Math.sin(ye), vd=Ja?La:Math.cos(ye),bd=Ja?Pa(Ec):gb,Kd=Ja?Math.sin(bd):Xa,wd=Ja?Math.cos(bd):eb;let Ld=vc,Td=Rc,Ud=Pc;if(Ra){const Vd=la+p.sampleElevation(Jd-bc,jd-Ib,db),Be=Ja?lb:kd,Wd=Ja?Kd:kb,Xd=Ja?wd:mb;Ld=(Ja?oa:vd)*Xd*Vd;Td=Be*Xd*Vd;Ud=Wd*Vd}const xd=la+p.sampleElevation(id+bc,jd+Ib,Da),Vc=Ja?wd:Za,ld=(Ja?gc:vd)*Vc*xd,Zc=(Ja?Vb:kd)*Vc*xd,Md=(Ja?Kd:Va)*xd;Ra||(Ld=2*vc-ld,Td=2*Rc-Zc,Ud=2*Pc-Md);const Nd=3===aa?-1:1,ze=Nd*(Ld-ld),Ae=Nd*(Td-Zc),yd=Nd*(Ud-Md);Tc=gd*Ae-Ac*yd;Uc=Id*yd-gd*ze;Qc=Ac*ze-Id*Ae;const zd= 1/Math.sqrt(Tc*Tc+Uc*Uc+Qc*Qc);Tc*=zd;Uc*=zd;Qc*=zd}else Tc=vc*Sc,Uc=Rc*Sc,Qc=Pc*Sc;ca.setEdgeNormalFromValues(aa,dc,Tc,Uc,Qc)}})()}}function n(U){({tile:U}=U);if(U.surface.isWebMercator){const ca=U.extent,ea=U.ellipsoid.radius;return da=>Math.PI/2-2*Math.atan(Math.exp(-(ca[1]*(1-da)+ca[3]*da)/ea))}const Z=U.extentInRadians;return ca=>Z[1]*(1-ca)+Z[3]*ca}function u(U,Z){U.tile.intersectsClippingArea&&(I(U),x(U,!1))}function x(U,Z){const {geometry:ca,geometryState:ea,localOrigin:da}=U,ia=U.tile,{surface:ka, extent:fa}=ia,{clippingArea:X,samplerData:ja}=ea,la=null!=X?X:T,na=fa[0],va=fa[2],za=fa[1],ya=fa[3],Da=[ya>la[3],va>la[2],zaAa;++Aa){const Sa=1===Aa||3===Aa,Ya=ea.edgeResolutions[Aa];g.internalAssert(b.isPowerOfTwo(Ya));const qa= Ya+1,aa=Da[Aa],Ja=e.neighborTileIfLoadedOrSelf(ia,ea.edgePeerNeighbors[Aa]);if(!aa&&M(ia,Ja,Aa)){G(U,Aa,Ja);continue}const Ta=null!=Ja&&!aa,Ra=Ja?.renderData?.geometryState;if(g.enableTerrainInternalChecks&&(g.internalAssert(!Ta||Ja.level===ia.level),g.internalAssert(!Ta||0>=t.compareTilesByLij(ia,Ja)),ia&&!Ja&&!ka.updatingRootTiles)){const oa=g.neighborEdgeIndices[Aa],Fa=ia.findNeighborTile(oa,Va=>Va.isLoaded||Va.isLeaf||Va.level===ia.level);ka.updatingRootTiles||(Fa?Fa.intersectsClippingArea&&(g.internalAssert(!Fa.isLoaded), g.internalAssert(!Fa.isLeaf),g.internalAssert(Fa.level===ia.level)):g.internalAssert(null==ka?.rootTiles||!ia.shouldHaveNeighbor(oa)))}const $a=b.clamp(1===Aa?va:na,ua,Na),bb=b.clamp(0===Aa?ya:za,Ua,wa),pa=Ra?.samplerData,Ba=Z&&3p.sampleElevation(oa,Fa,ja),ib=(oa,Fa)=>.5*(p.sampleElevation(oa,Fa,pa)+p.sampleElevation(oa,Fa,ja)),La=Ta?ib:gb,Xa=(va-na)/Ya,eb=Sa?1===Aa?Xa:-Xa:0,db=Sa?0:0===Aa?Xa:-Xa,jb=-eb,nb=-db;let qb= 0,ub=0,xb=0;const pb=0/Ya,Bb=Sa?$a:b.clamp(na*(1-pb)+va*pb,ua,Na),Kb=Sa?b.clamp(za*(1-pb)+ya*pb,Ua,wa):bb,bc=La(Bb,Kb);qb=Bb*ra;ub=xa(Kb);xb=bc;let Ib=0,$b=0,kc=0;const fc=1/Ya,Pb=Sa?$a:b.clamp(na*(1-fc)+va*fc,ua,Na),Cb=Sa?b.clamp(za*(1-fc)+ya*fc,Ua,wa):bb,Vb=La(Pb,Cb),gc=Pb*ra,Lb=xa(Cb),lb=Vb;Ib=gc;$b=Lb;kc=lb;for(let oa=1;oa(Math.PI/2-2*Math.atan(Math.exp(-ea/Z)))*Z:ea=>ea*ca}function z(U,Z,ca){const {numVerticesPerSide:ea,vertexAttributes:da,maxEdgeVertexCount:ia}=U,ka=ea-1;var fa=da.count;const X=2*(ea-3)*(ea-3);var ja=4*(ka+ia-3);const la=e.zeroToFour.reduce((za,ya)=>za+(ka+U.getEdgeCount(ya)-3),0),na=Z.reduce((za,ya)=>za+ka*(2*(ya.latitudeResolution-1)+1),0),va=3*(ca?2:1);ja=(X+ja+na)*va;fa=65536<=fa?new Uint32Array(ja):new Uint16Array(ja);for(let za=0;zala;++la){var fa=ba[la];let na=0,va=0;const za=U.getEdgeCount(la),ya=fa.count;g.internalAssert(ya===da-1);var X=1===la||2===la;const Da=X?1:2;X=X?2:1;const ra=U.getEdgeFirstVertexIndex(la),xa=fa.vertex0Index;for(fa=fa.stride;nala;++la){var fa=ba[la];let na=0,va=0;const za=U.getEdgeCount(la),ya=fa.count;g.internalAssert(ya===da-1);var X=1===la||2===la;const Da=X?1:3;X=X?3:1;const ra=U.getEdgeFirstVertexIndex(la),xa=fa.vertex0Index;for(fa=fa.stride;naX;++X){var fa=0===X||2===X;fa=(fa?0:1)*ia+(fa?1:0);const ja=ba[X];ja.vertex0Index=(0===X?ia-1:0)*ia+(1===X?ia-1:0);ja.stride=fa;ja.count=ia;fa=U[X]+1;Z.outerEdgesOffsetAndLength[2*X]=ka;Z.outerEdgesOffsetAndLength[2*X+1]=fa;ka+=fa}}function E(U){N(U);U.geometryState.wireframe? H(U.geometry):C(U.geometry)}function G(U,Z,ca){const {geometryState:ea,geometry:da,tile:ia,localOrigin:ka}=U;U=1===Z||3===Z;const fa=ea.edgeResolutions[Z];g.internalAssert(b.isPowerOfTwo(fa));const X=fa+1,{boundingBox:ja,minu:la,minv:na,maxu:va,maxv:za,vertexAttributes:ya}=da,Da=b.clamp(1===Z?1:0,la,va),ra=b.clamp(0===Z?1:0,na,za);var xa=ca.renderData,Ma=xa.geometryState,Ga=xa.geometry,Pa=(Z+2)%4,Qa=Ga.getEdgeCount(Pa);const Ea=ia.getNeighborEdgeStartVertexIndex(Z,ca)*fa;ca=fa*2**(ia.level-ca.level); g.internalAssert(Ma.edgeResolutions[Pa]===ca);g.internalAssert(Qa-1===ca);ca=xa.localOrigin[0]-ka[0];Ma=xa.localOrigin[1]-ka[1];xa=xa.localOrigin[2]-ka[2];Z=da.getEdgeFirstVertexIndex(Z);var ua=ya.position;Qa=ua.typedBuffer;ua=ua.typedBufferStride;var Na=ya.normalCompressed;const Ua=Na.typedBuffer;Na=Na.typedBufferStride;const wa=ya.uv0;var sa=Ga.vertexAttributes;Ga=Ga.getEdgeFirstVertexIndex(Pa);Pa=sa.position.typedBuffer;const Ha=sa.position.typedBufferStride,Ka=sa.normalCompressed.typedBuffer; sa=sa.normalCompressed.typedBufferStride;for(let qa=1;qa{const db=null!=da&&(Da[3]>da[3]||Da[2]>da[2]||Da[1]{nb=0===nb?Da[0]:Da[2];qb=0===qb?Da[1]:Da[3];nb=db?b.clamp(nb,da[0],da[2]):nb;qb=db?b.clamp(qb,da[1],da[3]):qb;Pa=nb*xa;Qa=jb(qb);Ea=ub}},Na=(db,jb,nb)=>{var qb=ra[0===jb?1:3];db= ra[0===db?0:2];jb=Math.cos(qb);qb=Math.sin(qb);const ub=Math.sin(db);nb=Ga+nb;Pa=Math.cos(db)*jb*nb;Qa=ub*jb*nb;Ea=qb*nb},Ua=Ma?ua():Na;let wa=0,sa=0,Ha=0,Ka=0,Aa=0,Sa=0,Ya=0,qa=0,aa=0;const Ja=Ma&&za.isWebMercatorOnPlateCarree,Ta=(db,jb,nb,qb,ub)=>{var xb=0,pb=0;let Bb=0;Ma?(nb=Ja?(Math.PI/2-2*Math.atan(Math.exp(-nb/Ga)))*Ga:nb*xa,xb=jb*xa-Pa,pb=nb-Qa,Bb=qb-Ea):(xb=n(db),db=db.tile,pb=db.extent,db=db.extentInRadians,jb=(jb-pb[0])/(pb[2]-pb[0]),jb=db[0]*(1-jb)+db[2]*jb,xb=xb((nb-pb[1])/(pb[3]-pb[1])), nb=Math.cos(xb),db=Math.sin(xb),pb=Math.sin(jb),qb=Ga+qb,xb=Math.cos(jb)*nb*qb-Pa,pb=pb*nb*qb-Qa,Bb=db*qb-Ea);switch(ub){case 0:Ya+=xb;qa+=pb;aa+=Bb;break;case 1:Ka-=xb;Aa-=pb;Sa-=Bb;break;case 2:Ya-=xb;qa-=pb;aa-=Bb;break;case 3:Ka+=xb,Aa+=pb,Sa+=Bb}},Ra=da??T,$a=Da[0],bb=Da[2],pa=Da[1],Ba=Da[3],Ia=[Ba>Ra[3],bb>Ra[2],pa{var jb=ca.cornerNeighborCornerTiles;sa=wa=0;Ha=1;aa=qa=Ya=Sa=Aa=Ka= 0;var nb=Infinity;for(var qb=0;4>qb;++qb)nb=Math.min(nb,jb[4*db+qb]?.level??Infinity);for(qb=0;4>qb;++qb){var ub=jb[4*db+qb];Y[qb]=ub?.level===nb?ub:null}db=1;jb=0;for(nb=0;4>nb;++nb)if(qb=Y[nb])db=Math.max(db,qb?.renderData.geometryState.numVerticesPerSide),jb=qb.extent[2]-qb.extent[0];g.internalAssert(1jb;++jb){ub=Y[(jb+3)%4];var xb=Y[jb%4];if(ub||xb){qb=0===jb?1:1===jb?2:2===jb?3:0;var pb=0===jb?2:1===jb?3:2===jb?0:1;if(ub&&xb){var Bb=S[jb][0]*db,Kb=S[jb][1]*db,bc=ub.extent; nb=Math.max(Ra[0],Math.min(Ra[2],bc[0===qb||1===qb?2:0]+Bb));qb=Math.max(Ra[1],Math.min(Ra[3],bc[0===qb||3===qb?3:1]+Kb));bc=xb.extent;Bb=Math.max(Ra[0],Math.min(Ra[2],bc[0===pb||1===pb?2:0]+Bb));pb=Math.max(Ra[1],Math.min(Ra[3],bc[0===pb||3===pb?3:1]+Kb));ub=ub.renderData;Kb=xb.renderData;xb=p.sampleElevation(nb,qb,ub.geometryState.samplerData);pb=p.sampleElevation(Bb,pb,Kb.geometryState.samplerData);Ta(ub,nb,qb,.5*(xb+pb),jb)}else nb=ub??xb,ub=ub?qb:pb,xb=nb.extent,pb=S[jb],qb=Math.max(Ra[0],Math.min(Ra[2], xb[0===ub||1===ub?2:0]+pb[0]*db)),ub=Math.max(Ra[1],Math.min(Ra[3],xb[0===ub||3===ub?3:1]+pb[1]*db)),nb=nb.renderData,xb=p.sampleElevation(qb,ub,nb.geometryState.samplerData),Ta(nb,qb,ub,xb,jb)}}Ma||(db=Math.sqrt(Pa*Pa+Qa*Qa+Ea*Ea),wa=Pa/db,sa=Qa/db,Ha=Ea/db);if(Ma||.999>Ha*Ha)db=Math.sqrt(Ka*Ka+Aa*Aa+Sa*Sa),Ka/=db,Aa/=db,Sa/=db,db=Math.sqrt(Ya*Ya+qa*qa+aa*aa),Ya/=db,qa/=db,aa/=db,wa=Sa*qa-Aa*aa,sa=Ka*aa-Sa*Ya,Ha=Aa*Ya-Ka*qa,db=1/Math.sqrt(wa*wa+sa*sa+Ha*Ha),wa*=db,sa*=db,Ha*=db},eb=ca.cornerNeighborCornerTiles; for(let db=0;4>db;++db){const jb=db,nb=(db+1)%4,qb=0===db||1===db?1:0,ub=0===db||3===db?1:0,xb=b.clamp(qb,ka,X),pb=b.clamp(ub,fa,ja),Bb=Z.getEdgeFirstVertexIndex(jb),Kb=Z.getEdgeCount(jb),bc=0===db||3===db?Kb-1:0,Ib=Z.getEdgeFirstVertexIndex(nb),$b=Z.getEdgeCount(nb),kc=0===db||1===db?$b-1:0;let fc=-1;for(let Vb=0;4>Vb;++Vb){const gc=eb[4*db+Vb],Lb=eb[4*db+fc];gc&&(-1===fc||0Db+(Nb?1:0),0);g.internalAssert(1===oa||2===oa);let Fa=-1,Va=-1;const Za=Cb.renderData;if(1===oa){const Db=lb.findIndex(hc=>hc);g.internalAssert(0<=Db&&3>=Db);Fa=(Db+2)%4;const Nb=ca.edgeResolutions[Db];Va=va.getNeighborEdgeStartVertexIndex(Db, Cb)*Nb+Nb*(0===Db&&0===db||1===Db&&0===db||2===Db&&1===db||3===Db&&3===db?1:0)}else{g.internalAssert(lb[1]||lb[3]);Fa=lb[1]?3:1;const Db=Za.geometryState.edgeResolutions[Fa];Va=0===db||3===db?0:Db}const fb=Za.geometry,kb=Bb+bc,mb=Ib+kc,rb=fb.getEdgeFirstVertexIndex(Fa)+Va,tb=fb.vertexAttributes,yb=Za.localOrigin,zb=tb.position,Ab=zb.typedBuffer,Fb=rb*zb.typedBufferStride,Qb=Ab[Fb]+yb[0]-ea[0],sb=Ab[Fb+1]+yb[1]-ea[1],vb=Ab[Fb+2]+yb[2]-ea[2];K(Qb,sb,vb,la);const Gb=na.position,Hb=Gb.typedBuffer,Tb= kb*Gb.typedBufferStride;Hb[Tb]=Qb;Hb[Tb+1]=sb;Hb[Tb+2]=vb;const lc=mb*Gb.typedBufferStride;Hb[lc]=Qb;Hb[lc+1]=sb;Hb[lc+2]=vb;const Ub=na.uv0;f.encodeUVInBuffer(Ub,kb,xb,pb);f.encodeUVInBuffer(Ub,mb,xb,pb);const Zb=tb.normalCompressed.typedBuffer,ac=rb*tb.normalCompressed.typedBufferStride,Mb=na.normalCompressed,Jb=Mb.typedBuffer,Wb=kb*Mb.typedBufferStride;Jb[Wb]=Zb[ac];Jb[Wb+1]=Zb[ac+1];const cc=mb*Mb.typedBufferStride;Jb[cc]=Zb[ac];Jb[cc+1]=Zb[ac+1]}else{const Vb=Ia[nb];let gc=void 0;if(Ia[jb]|| Vb){const Fa=b.clamp($a*(1-qb)+bb*qb,Wa,gb),Va=b.clamp(pa*(1-ub)+Ba*ub,ib,La);gc=p.sampleElevation(Fa,Va,ia)}else gc=O(eb,db);Ua(qb,ub,gc);Xa(db);const Lb=Pa-ea[0],lb=Qa-ea[1],oa=Ea-ea[2];K(Lb,lb,oa,la);Z.setEdgeVertexFromValuesRawPositionUVNormal(jb,bc,Lb,lb,oa,xb,pb,wa,sa,Ha);Z.setEdgeVertexFromValuesRawPositionUVNormal(nb,kc,Lb,lb,oa,xb,pb,wa,sa,Ha)}}for(let db=0;4>db;++db)Y[db]=null}function O(U,Z){const ca=4*Z;Z=e.zeroToFour.reduce((ka,fa)=>Math.min(ka,U[ca+fa]?.level??Infinity),Infinity);g.enableTerrainInternalChecks&& (g.internalAssert(!U[ca+0]||!U[ca+2]||d.isCornerNeighbor(U[ca+0],U[ca+2],h.NeighborIndex.SOUTH_WEST)),g.internalAssert(!U[ca+1]||!U[ca+3]||d.isCornerNeighbor(U[ca+1],U[ca+3],h.NeighborIndex.NORTH_WEST)));let ea=0,da=0;for(let ka=0;4>ka;++ka){var ia=U[ca+ka];if(ia&&ia.level===Z){const fa=ia.extent;ia=p.sampleElevation(fa[0===ka||1===ka?0:2],fa[0===ka||3===ka?1:3],ia.renderData?.geometryState?.samplerData);da+=ia;ea++}}Z=ea?da/ea:0;g.internalAssert(null!=Z);return Z}function L(U){const {vao:Z,geometry:ca}= U,{vertexAttributes:ea,edgeVerticesStartIndex:da}=ca;U=ea.position.typedBuffer;Z.vertexBuffers.geometry.setSubData(U,da,da,U.length)}function P(U){const {vao:Z,geometry:ca}=U,{indices:ea,indexCount:da,edgeIndicesStartIndex:ia}=ca;Z.indexBuffer.setSubData(ea,ia,ia,da)}function M(U,Z,ca){if(!Z)return!1;U=t.compareTilesByLij(U,Z);return 0ea[3]&&(ea[3]=U);Zea[4]&&(ea[4]=Z);caea[5]&&(ea[5]=ca)}function J(U){const {edgeResolutions:Z, numVerticesPerSide:ca}=U;U=1+Math.max(...Z);return Math.max(ca,U)}function R(U,Z,ca,ea,da,ia){var ka=U*da;U=ia[ka];const fa=ia[ka+1];ka=ia[ka+2];var X=Z*da;Z=ia[X];const ja=ia[X+1];X=ia[X+2];var la=ca*da;ca=ia[la];const na=ia[la+1];la=ia[la+2];const va=ea*da;ea=ia[va];da=ia[va+1];ia=ia[va+2];return(Z-ea)*(Z-ea)+(ja-da)*(ja-da)+(X-ia)*(X-ia)>(U-ca)*(U-ca)+(fa-na)*(fa-na)+(ka-la)*(ka-la)}function Q(U,Z,ca,ea,da){U[Z]=ca;U[Z+1]=ea;U[Z+2]=ea;U[Z+3]=da;U[Z+4]=da;U[Z+5]=ca}class W{constructor(U,Z,ca,ea, da){this.isNorth=U;this.connectedRowOffset=Z;this.connectedOuterEdgeOffset=ca;this.rowOffset=ea;this.latitudeResolution=da}}const S=[[0,1],[1,0],[0,-1],[-1,0]],V=new c.PatchGeometryLUT,T=l.fromValues(-Infinity,-Infinity,Infinity,Infinity),Y=[null,null,null,null];class ha{constructor(){this.vertex0Index=0;this.stride=1;this.count=0}getVertexIndex(U){g.internalAssert(0<=U&&UWb*Wb&&(Mb=Fb*Zb-Ab*ac,Jb=zb*ac-Fb*Ub,Wb=Ab*Ub-zb*Zb);const cc=1/Math.sqrt(Mb*Mb+Jb*Jb+Wb*Wb);w.compressNormal(Sa,ib,Mb*cc,Jb*cc,Wb*cc,Ya);++ib}}}}ea.poleVerticesStartIndex=va;const La=v(U,za,ya);ea.edgeVerticesStartIndex=va+Da;N(U);m(U);z(ea,La,la);U.intersectionData=null};a.updateCornerSpherical=function(U){U.tile.intersectsClippingArea&&(I(U),r(U,!0),L(U),U.intersectionData=null)};a.updateCornersPlanar=function(U,Z){U.tile.intersectsClippingArea&&(I(U),x(U,!0),L(U),U.intersectionData= null)};a.updateEdgeElevationsAndResolutionsPlanar=function(U,Z){U.tile.intersectsClippingArea&&(E(U),u(U),L(U),P(U),U.intersectionData=null)};a.updateEdgeElevationsAndResolutionsSpherical=function(U){U.tile.intersectsClippingArea&&(E(U),m(U),L(U),P(U),U.intersectionData=null)};a.updateEdgesAndCornersPlanar=function(U,Z){U.tile.intersectsClippingArea&&(u(U),L(U),U.intersectionData=null)};a.updateEdgesAndCornersSpherical=function(U){U.tile.intersectsClippingArea&&(m(U),L(U),U.intersectionData=null)}; Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/PatchGeometry":function(){define("exports ../../../core/maybe ../../../chunks/vec32 ../../../geometry/support/aaBoundingBox ./terrainUtils ../webgl-engine/lib/Normals".split(" "),function(a,b,q,l,p,k){function h(c,e,g,d){c.setValues(e,16384*g,16384*d)}class f{constructor(){this.indices=null;this.poleIndicesStartIndex=this.edgeIndicesStartIndex=this.indexCount=0;this.vertexAttributes=null;this.maxEdgeVertexCount= this.poleVerticesStartIndex=this.edgeVerticesStartIndex=0;this.boundingBox=l.empty();this.minv=this.minu=this.numVerticesPerSide=0;this.maxv=this.maxu=1;this.outerEdgesOffsetAndLength=[0,0,0,0,0,0,0,0]}release(){this.vertexAttributes=b.releaseMaybe(this.vertexAttributes);this.indices=null}reset(){this.vertexAttributes=this.indices=null;l.empty(this.boundingBox);this.numVerticesPerSide=0}getEdgeFirstVertexIndex(c){return this.outerEdgesOffsetAndLength[2*c]}getEdgeCount(c){return this.outerEdgesOffsetAndLength[2* c+1]}getEdgeVertexIndex(c,e){return this.getEdgeAttributeIndex(c,e)}getEdgeVertexPosition(c,e,g,d){this._getEdgeVertexRaw(this.getEdgeAttributeIndex(c,d),e);q.add(e,e,g)}getEdgeNormal(c,e,g){const {typedBuffer:d,typedBufferStride:t}=this.vertexAttributes.normalCompressed;k.decompressNormal(e,d,this.getEdgeAttributeIndex(c,g),t)}setEdgeNormalFromValues(c,e,g,d,t){this._setNormal(this.getEdgeAttributeIndex(c,e),g,d,t)}setEdgeVertexFromValuesRawPositionUV(c,e,g,d,t,w,v){c=this.getEdgeAttributeIndex(c, e);this.vertexAttributes.position.setValues(c,g,d,t);this._setUV(c,w,v)}setEdgeVertexFromValuesRawPositionUVNormal(c,e,g,d,t,w,v,m,r,n){c=this.getEdgeAttributeIndex(c,e);this.vertexAttributes.position.setValues(c,g,d,t);this._setUV(c,w,v);this._setNormal(c,m,r,n)}_getEdgeVertexRaw(c,e){this.vertexAttributes.position.getVec(c,e)}_setNormal(c,e,g,d){const {typedBuffer:t,typedBufferStride:w}=this.vertexAttributes.normalCompressed;k.compressNormal(t,c,e,g,d,w)}_setUV(c,e,g){h(this.vertexAttributes.uv0, c,e,g)}getEdgeAttributeIndex(c,e){p.internalAssert(0<=e&&ethis.tile.surface.fadeDuration);this.overlay=new u;this._localOrigin=null;this._geometryStateChangedSinceLastUpdate=!0;this._hasGeometry=!1;this._modifiedFlags=0}get tile(){return this._tile}get localOrigin(){return this._localOrigin}init(P, M){this.clear();this._tile=P;this.geometry.reset();this.intersectionData=null;this.geometryState=new g.GeometryState;this._localOrigin=M;this.overlay.clear()}clear(){this.releaseGeometry();this.releaseTexture();this._textureRef.clear();this.geometryState=this.intersectionData=this._tile=null}updateGeometryIfNeeded(P){if(!this._vao||this._geometryStateChangedSinceLastUpdate||this.wireframeChanged||this.clippingAreaChanged||this.samplerDataChanged||this.numVerticesPerSideChanged||this.dirtyCorners|| this.dirtyEdgeResolutions||this.dirtyEdges)this._updateGeometry(P),this._geometryStateChangedSinceLastUpdate=!1;if(m.enableTerrainInternalChecks&&this.tile.intersectsClippingArea)for(P=0;4>P;++P)m.internalAssert(this.geometry.getEdgeCount(P)===this.geometryState.edgeResolutions[P]+1)}_calculateEdgeResolution(P,M){const K=this.tile,J=this.geometryState.numVerticesPerSide-1;if(!K.surface.isGlobal){var R=K.surface.extent;if(null!=R&&(0===P&&K.extent[3]>R[3]||1===P&&K.extent[2]>R[2]||2===P&&K.extent[1]< R[1]||3===P&&K.extent[0]{if(S===K)return!0;if(S.isLoaded)return W=Math.max(W,2** (S.level-Q)),!0;m.internalAssert(!S.isLeaf);return!1});return W}updateNeighborData(){const P=this.tile;if(P.intersectsClippingArea){var M=P.renderData.geometryState,K=Y=>(Y.isLoaded||Y.level===P.level)&&Y?.intersectsClippingArea,J=M.edgePeerNeighbors,R=M.edgePeerNeighborSamplerVersions;for(var Q=0;4>Q;++Q){var W=P.findNeighborTile(m.neighborEdgeIndices[Q],K),S=C(P,W),V=S?.renderData?.geometryState.samplerDataVersion??-1,T=C(P,J[Q]);S=S!==T;T=R[Q]!==V;m.enableTerrainInternalChecks&&W&&(m.internalAssert(P.level>= W.level),m.internalAssert(P.level-W.level<=v.maxTileNeighborLevelDelta));J[Q]=W;if(S||T)R[Q]=V,this._markEdgeDirty(Q);V=M.edgeResolutions[Q];W=this._calculateEdgeResolution(Q,W);m.internalAssert(l.isPowerOfTwo(W));m.internalAssert(1<=W);M.edgeResolutions[Q]=W;V!==W&&this._markEdgeResolutionDirty(Q)}for(let Y=0;4>Y;++Y){W=P.findNeighborTile(m.neighborCornerIndices[Y],K);M.cornerPeerNeighbors[Y]=W;R=C(P,J[Y]);Q=C(P,J[(Y+1)%4]);W=C(P,W);O[Y]=W;O[(Y+1)%4]=Q;O[(Y+2)%4]=P;O[(Y+3)%4]=R;m.internalAssert(O.some(U=> U?.isLoaded||U===P));const ha=O.reduce((U,Z)=>Math.min(U,Z?.level??Infinity),Infinity);O.forEach((U,Z)=>{U&&U?.level>ha&&(O[Z]=null)});m.internalAssert(O.some(U=>U?.isLoaded||U===P));const ba=M.cornerNeighborCornerTiles;R=M.cornerNeighborCornerTileSamplerVersions;for(Q=0;4>Q;++Q){W=O[Q];V=W?.renderData.geometryState.samplerDataVersion??-1;S=4*Y+Q;T=ba[S]!==W;const U=!T&&R[S]!==V;if(T||U)ba[S]=W,R[S]=V,this._markCornerDirty(Y)}m.enableTerrainInternalChecks&&m.internalAssert(L.some(U=>ba[4*Y+U]?.isLoaded|| ba[4*Y+U]===P))}m.enableTerrainInternalChecks&&m.internalAssert(this.geometryState.edgeResolutions.every(Y=>0M;++M)O[M]=null}}_updateGeometry(P){if(this.tile.intersectsClippingArea){m.enableTerrainInternalChecks&&m.internalAssert(!this.tile.intersectsClippingArea||this.geometryState.edgeResolutions.every(T=>0T+Y+1,0);W=W||Q&&S>(J?.maxEdgeVertexCount??0);S=!W&&Q;Q=!S&&(0!==this.dirtyEdges||Q);var V=!Q&&0!==this.dirtyCorners;W?(this.releaseGeometry(),this._createGeometry(P)):S?M.updateEdgeElevationsAndResolutions():Q||V?M.updateEdgeElevations():V?M.updateCornerElevations():console.warn("Update for no reason?");this._modifiedFlags=0}}get hasGeometry(){return this._hasGeometry}releaseGeometry(){this._hasGeometry= !1;this.intersectionData=null;if(!this._vao)return!1;this._vao=p.disposeMaybe(this._vao);this.geometry.release();return!0}ensureTexture(P,M,K){M=M?B.PixelFormat.RGBA:B.PixelFormat.RGB;null==this._texture||this._texture.descriptor.width===P&&this._texture.descriptor.pixelFormat===M||this.releaseTexture();null==this._texture&&(this._texture=K(),this.tile.setMemoryDirty());return this._texture}releaseTexture(){null!=this._texture&&(this._texture.release(),this._texture=null,this.tile.setMemoryDirty())}get numVerticesPerSideChanged(){return 0!== (this._modifiedFlags&1)}get samplerDataChanged(){return 0!==(this._modifiedFlags&2)}get clippingAreaChanged(){return 0!==(this._modifiedFlags&4)}get wireframeChanged(){return 0!==(this._modifiedFlags&8)}get dirtyEdges(){return this._modifiedFlags>>4&15}get dirtyCorners(){return this._modifiedFlags>>8&15}get dirtyEdgeResolutions(){return this._modifiedFlags>>12&15}_markCornerDirty(P){this._modifiedFlags|=1<null!=M?0>(2>S?-1:1)*(P.extent[3-S]-M[3-S]):!1),J=P.level;m.internalAssert(0===this.dirtyCorners);m.internalAssert(0===this.dirtyEdges);m.internalAssert(0===this.dirtyEdgeResolutions);m.internalAssert(!this.numVerticesPerSideChanged);m.internalAssert(!this.samplerDataChanged);m.internalAssert(!this.clippingAreaChanged);m.internalAssert(!this.wireframeChanged);var R=m.neighborCornerIndices.map(W=>P.findNeighborCornerTileExact(W, S=>!S.intersectsClippingArea||S.isLoaded||S.level===P.level)??null).map(W=>W?.intersectsClippingArea?W:null),Q=this.geometryState;for(let W=0;4>W;++W){const S=Q.cornerPeerNeighbors[W],V=R[W];m.internalAssert(V===S,`Tile[${P.lij}].corner[${W}] out of date: cur=[${S?.lij}] exp=[${V?.lij}]`)}m.neighborEdgeIndices.forEach((W,S)=>{if(!K[S]){var V=P.findNeighborTile(W,Ma=>(Ma.level===J||Ma?.isLoaded)&&Ma?.intersectsClippingArea);if(V){m.internalAssert(V.isLoaded||V.level===P.level);m.internalAssert(V=== this.geometryState.edgePeerNeighbors[S]);var T=J-V.level;if(V.isLoaded){var Y=V.renderData;m.internalAssert(n.isEdgeNeighbor(P,V,W));m.internalAssert(0<=T);var ha=2**T;if(0>T)m.internalAssert(!1);else{var ba=P.renderData,U=ba.geometry,Z=ba.localOrigin,ca=U.getEdgeCount(S),ea=U.numVerticesPerSide-1,da=Y.geometry;if(da){var ia=Y.localOrigin,ka=this.geometryState.edgePeerNeighbors[S];ka?.isLoaded&&(ka=ka.renderData,m.internalAssert(ba.geometryState.edgePeerNeighborSamplerVersions[S]===ka.geometryState.samplerDataVersion), m.internalAssert(this.geometryState.edgePeerNeighborSamplerVersions[S]===ka.geometryState.samplerDataVersion));var fa=(S+2)%4,X=da.getEdgeCount(fa);ka=ca-1;var ja=X-1;m.internalAssert(ka*ha===ja,`Tile[${P.lij}]:e${S},res=${ka} edgeRes mismatch with`+` Neighbor[${V.lij}]:e${fa},res=${ja} (expected:${ka*ha})`);ka=P.extent;ja=W===t.NeighborIndex.NORTH||W===t.NeighborIndex.SOUTH;var la=X-1,na=la>>T,va=ca-1;if(1>na)m.internalAssert(1===va);else{m.internalAssert(na===va);m.internalAssert(l.isPowerOfTwo(na)); va=da.numVerticesPerSide-1;m.internalAssert(0{const Pa=h.clone(F),Qa=h.clone(H);P.updateEdgeElevations();V.updateEdgeElevations();U.getEdgeVertexPosition(S,F,Z,za);da.getEdgeVertexPosition(fa,H,ia,ya);const Ea=h.create();k.sub(Ea,F,Pa);01-Ga||P===V;if(!ea){const Pa=h.create();k.sub(Pa,N,E);la=()=>`Mismatch in tile edge normal ${m.lij2s(P.lij)} (${za}/${ca-1}) edge ${S} vs neighbor ${m.lij2s(V.lij)} (${ya}/${X-1}) nedge ${fa} :`+`${m.v32s(N)} vs ${m.v32s(E)} dot = ${Ga} : ${m.v32s(Pa)}`; console.warn("Mismatch in tile edge normal: ",la());P.updateEdgeElevations();V.updateEdgeElevations();va=h.create();xa=h.create();U.getEdgeNormal(S,va,za);da.getEdgeNormal(fa,xa,ya);k.equals(N,va)||console.warn("Missing update in tile normal: ",m.v32s(N)," \x3d\x3e ",m.v32s(va));k.equals(E,xa)||console.warn("Missing update in neighbor normal: ",m.v32s(E)," \x3d\x3e ",m.v32s(xa));m.internalAssert(ea,la())}}za+=1;ya+=1}}}else m.internalAssert(!1)}}else m.internalAssert(!V.isLeaf),m.internalAssert(0=== T)}else W=!P.surface.updatingRootTiles&&null!=P.surface.rootTiles&&0r.ActivationTime});a.PatchRenderData=D;a.neighborTileIfLoadedOrSelf=C;a.zeroToFour=L;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/terrain/GeometryState":function(){define(["exports"],function(a){class b{constructor(){this.numVerticesPerSide=0;this.samplerData=null;this.samplerDataVersion=0;this.clippingArea=null;this.wireframe=!1;this.cornerPeerNeighbors=[null,null,null,null];this.cornerNeighborCornerTiles=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];this.cornerNeighborCornerTileSamplerVersions=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];this.edgeResolutions=[-1,-1,-1, -1];this.edgePeerNeighbors=[null,null,null,null];this.edgePeerNeighborSamplerVersions=[-1,-1,-1,-1]}}a.GeometryState=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TextureFader":function(){define(["exports","../../../core/maybe","./interfaces"],function(a,b,q){class l{constructor(p){this._getFadeDuration=p;this._delayedTime=this._fadeStart=0}clear(){this._current=b.destroyMaybe(this._current);this._next=b.destroyMaybe(this._next);this._waiting=b.destroyMaybe(this._waiting); this._delayed=b.destroyMaybe(this._delayed)}get current(){if(null==this._current)return null;if(!this._isFadingEnabled){var p=this._delayed||this._waiting||this._next||this._current;p!==this._current&&(this._current=null,this.clear(),this._current=p)}p=l.test.fadeMoment;null!=this._delayed&&(p=p||performance.now(),p>=this._delayedTime&&(this._push(this._delayed,a.ActivationTime.Immediate),this._delayed=null));if(null!=this._next){p=p||performance.now();const k=this._next.type!==q.TextureUpdate.FADING, h=p-this._fadeStart>=this._fadeDuration;if(null!=this._current&&this._next.texture===this._current.texture||k||h)b.destroyMaybe(this._current),this._current=this._next,this._next=this._waiting,this._waiting=null,this._fadeStart=this._alignFadeStart(p)}return this._current}get next(){return this._next}get fadeFactor(){if(null==this._next)return 1;var p=l.test.fadeMoment||performance.now();p=Math.max(0,p-this._fadeStart);const k=this._fadeDuration;return p>k?0:1-p/k}get isFading(){return null!=this._next|| null!=this._delayed}push(p,k=a.ActivationTime.Immediate){this._delayed=b.destroyMaybe(this._delayed);this._push(p,k)}_push(p,k){this._isFadingEnabled||this.clear();if(null==this._current)this._current=p;else{var h=l.test.fadeMoment||performance.now();k!==a.ActivationTime.Immediate?(this._delayed=p,this._delayedTime=h+k):null==this._next?(this._next=p,this._fadeStart=this._alignFadeStart(h)):null!=p&&(b.destroyMaybe(this._waiting),this._waiting=p)}}get _fadeDuration(){return null==this._waiting?this._getFadeDuration(): .5*this._getFadeDuration()}_alignFadeStart(p){const k=this._getFadeDuration();return p+k-p%k}get _isFadingEnabled(){return 0=R.level?N(J,R,Q):N(R,J,x.oppositeCorner(Q))}function N(J,R,Q){x.internalAssert(J.level>=R.level);var W=x.isWestCorner(Q),S=x.isNorthCorner(Q),V=J.extent;Q=R.extent;var T=[W?V[0]:V[2],S?V[3]:V[1]];const Y=[W?Q[2]:Q[0],S?Q[1]: Q[3]];W=1E-5*(V[2]-V[0]);S=x.almostEquals(T[0],Y[0],W)||J.surface.isGlobal&&x.almostEquals(T[0],-Y[0],W);T=x.almostEquals(T[1],Y[1],W);if(S&&T)return!0;if(J.level===R.level||!S&&!T)return x.internalAssert(!1),!1;S?(J=V[1],V=V[3],Q=Q[1]-W<=J&&J<=V&&V<=Q[3]+W):(J=V[0],V=V[2],Q=Q[0]-W<=J&&J<=V&&V<=Q[2]+W);x.internalAssert(Q);return Q}class E{constructor(){this._lij=[0,0,0];this._children=[null,null,null,null];this._pendingUpdates=0;this.renderData=null;this._dirty=!0;this._previouslyRendered=!1;this.extent= c.create();this._elevationBoundsMin=NaN;this._elevationBoundsMax=0;this.layerInfo=[[],[]];this.extentInRadians=c.create();this.centerAtSeaLevel=k.create();this._center=[k.create(),e.create(),k.create()];this.up=k.unitZ();this._intersectsClippingArea=this._isWithinClippingArea=!0;this._maxTesselation=0;this._usedMemory=null;this.extentMidY=this.extentMidX=this._curvatureHeight=this._edgeLen2=this._edgeLen=this.renderOrder=this.screenDepth=this._mapDataRefCount=this._mapTileMemoryInternal=0;this.distanceToPOI= -1;this._lastPOI=k.create();this.unmergableChildCount=this.maxLevelDeltaNeighborCount=0}get lij(){return this._lij}get elevationLevelDelta(){return this._surface.getElevationLevelDelta(this.level)}static prune(){G.prune(0);I.prune(0);A.TilePerLayerInfo.prune()}get _isCached(){return!this.isLeaf&&0>=this._mapDataRefCount}get maxTesselation(){return this._maxTesselation}get isWithinClippingArea(){return this._isWithinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBoundsMin(){return this._elevationBoundsMin}get elevationBoundsMax(){return this._elevationBoundsMax}get level(){return this._lij[0]}get key(){return`${this._lij[0]}/${this._lij[1]}/${this._lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[a.CenterPosition.MIDDLE][3]}get visible(){this._dirty&& this.computeVisibility();return this._visible}get frustumVisibility(){this._dirty&&this.computeVisibility();return this._frustumVisibility}computeVisibility(){this._dirty=!1;var J=this.parent?.frustumVisibility??z.TileFrustumVisibility.INTERSECTS;this._frustumVisibility=J===z.TileFrustumVisibility.INSIDE?z.TileFrustumVisibility.INSIDE:J===z.TileFrustumVisibility.OUTSIDE?z.TileFrustumVisibility.OUTSIDE:this._calculateFrustumVisibilityStatus(this.surface.frustum);J=this._frustumVisibility!==z.TileFrustumVisibility.OUTSIDE&& this._intersectsClippingArea;J!==this._visible&&(this._visible=J,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setDirty(),this.updateAgentSuspension())}get loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const J=!!this.renderData;J!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=J,this._surface.renderer.setDirty());return J}init(J,R,Q,W,S){this._lij[0]=J;this._lij[1]=R;this._lij[2]= Q;this.ellipsoid=f.getReferenceEllipsoid(S.tilingScheme.spatialReference);S.tilingScheme.getExtent(J,R,Q,this.extent);S.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians);this.extentMidX=.5*(this.extent[0]+this.extent[2]);this.extentMidY=.5*(this.extent[1]+this.extent[3]);this._intersectsClippingArea=this._isWithinClippingArea=!0;this._clippingArea=null;this._mapDataRefCount=0;S.upsampleMapCache.pop(this.key);this._edgeLen2=this._edgeLen=0;this._center[a.CenterPosition.MIDDLE][3]= 0;this.elevationLevel=J;W&&!Number.isNaN(W.elevationBoundsMin)?(this._elevationBoundsMin=W.elevationBoundsMin,this._elevationBoundsMax=W.elevationBoundsMax):this._elevationBoundsMax=this._elevationBoundsMin=0;this._pendingUpdates=0;this.renderData=null;this.screenDepth=0;this._previouslyRendered=this._visible=!1;this._parent=W;this.unsetChildren();this._surface=S;this.updateVisibility();this.unmergableChildCount=this.maxLevelDeltaNeighborCount=0;for(const V of v.LayerClasses){J=S.numLayers(V);R=this.layerInfo[V]; for(const T of R)T.release();R.length=J;for(Q=0;QJ;++J)this._children[J]=null;this._surface=null;this.setMemoryDirty()}refMapData(){++this._mapDataRefCount;this._isCached||this._surface.upsampleMapCache.pop(this.key)}unrefMapData(){--this._mapDataRefCount;if(this._isCached){this.setMemoryDirty();const J=this._cachedMemory;0J+(u.isVectorTile(R)?R.usedMemory/R.referenced:0),this._mapTileMemoryInternal)}get _cpuImageMemorySize(){const J=this._surface.tilingScheme.pixelSize;return J*J*4}_ensureUsedMemory(){if(null!=this._usedMemory)return this._usedMemory;this._usedMemory=this._baseUsedMemory;let J=this._mapTileMemoryInternal=0;for(var {data:R}of this.layerInfo[v.LayerClass.MAP])u.isVectorTile(R)? J+=this._getTerrainDataMemory(R):this._mapTileMemoryInternal+=this._getTerrainDataMemory(R);R=this._cpuImageMemorySize;for(const Q of this.layerInfo[v.LayerClass.ELEVATION])this._usedMemory+=Q.data?R:0;this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._mapTileMemoryInternal+=this.renderData.texture?.usedMemory??0);this._isCached&&this._surface.upsampleMapCache.updateSize(this.key,this,this._mapTileMemoryInternal+J);return this._usedMemory}getUsedMemoryForLayer(J, R){R=this.layerInfo[J][R];return R?.data?J===v.LayerClass.MAP?this._isCached?0:this._getTerrainDataMemory(R.data):J===v.LayerClass.ELEVATION?this._cpuImageMemorySize:0:0}_getTerrainDataMemory(J){return u.isTileTexture(J)?J.texture.usedMemory:u.isRasterTile(J)?J.memoryUsage:u.isVectorTile(J)?J.usedMemory/J.referenced:u.isImageWithType(J)||J instanceof HTMLImageElement?this._cpuImageMemorySize:0}updateScreenDepth(J){var R=this._center[a.CenterPosition.MIDDLE];const Q=R[0],W=R[1];R=R[2];const S=J[2]* Q+J[6]*W+J[10]*R+J[14];this.screenDepth=0>S?0:S/(J[3]*Q+J[7]*W+J[11]*R+J[15])}shouldSplit(J,R,Q){if(!this.visible||J.frustum&&(!this._intersectsClippingArea||this._calculateFrustumVisibilityStatus(J.frustum)===z.TileFrustumVisibility.OUTSIDE))return B.TileUpdate.NONE;const W=this.level;p.subtract(L,e.getCenter(this._center[a.CenterPosition.MIDDLE]),R);var S=p.squaredLength(L),V=L;let T=e.getCenter(this._center[a.CenterPosition.MIDDLE]);p.subtract(P,this._center[a.CenterPosition.TOP],R);var Y=p.squaredLength(P); YS&&W{if(W=U)return ba();const Z=p.dot(this.up,L);Y=this._elevationBoundsMax-this._elevationBoundsMin;const ca=Y/this.edgeLen;if(J.aboveGround&&0ca&&0=J.maxLod)return ba();if(7>W)return B.TileUpdate.SPLIT;p.scale(K,this.up,Z);p.subtract(K,K,V);V=p.squaredLength(K);if(V<=this.radius*this.radius)return B.TileUpdate.SPLIT; p.scale(K,K,this.radius/Math.sqrt(V));p.add(K,K,T);p.subtract(K,R,K);return Math.min(1,(Math.abs(p.dot(K,this.up))+.5*Y+this._curvatureHeight)/p.length(K))*(this._edgeLen/(J.fovY*S*2))*Q<.1/J.angledSplitBias*J.relativeHeightLimit?B.TileUpdate.NONE:B.TileUpdate.SPLIT}setChildren(J,R,Q,W){x.weakAssert(!!(J&&R&&Q&&W),"Null child passed");const S=this._children;S[0]=J;S[1]=R;S[2]=Q;S[3]=W;return S}unsetChildren(){this._children[0]=null;this._children[1]=null;this._children[2]=null;this._children[3]=null}get isLoaded(){return this.renderData?.hasGeometry?? !1}load(){this.refMapData();for(const J of v.LayerClasses)this._createOrUpdateAgents(0,J);this.surface.renderer.loadTile(this)}unload(J){J.unloadTile(this);for(const R of v.LayerClasses){J=this.layerInfo[R];for(const Q of J)Q.loadingAgent&&Q.loadingAgent!==y.tileAgentDone&&(D(Q.loadingAgent),Q.loadingAgent=null),Q.pendingUpdates=0}this.resetPendingUpdate(B.TileUpdate.GEOMETRY);this.resetPendingUpdate(B.TileUpdate.TEXTURE_NOFADING);this.resetPendingUpdate(B.TileUpdate.TEXTURE_FADING);this.unrefMapData()}unloadMapData(){const J= this.layerInfo[v.LayerClass.MAP];for(const R of J)R.loadingAgent&&R.loadingAgent!==y.tileAgentDone&&(D(R.loadingAgent),R.loadingAgent=null),R.pendingUpdates=0;this.renderData&&this.renderData.releaseTexture();this.setMemoryDirty()}updateClippingStatus(J){if(c.equals(J,this._clippingArea))return!1;var R=this._intersectsClippingArea;const Q=this._isWithinClippingArea;null!=J?(this._intersectsClippingArea=this.intersectsExtent(J),this._isWithinClippingArea=this._isWithinExtent(J)):this._isWithinClippingArea= this._intersectsClippingArea=!0;this._clippingArea=J;this.updateVisibility();J=Q&&this._isWithinClippingArea;R=!Q&&!R&&!this._isWithinClippingArea&&!this._intersectsClippingArea;!this.renderData||J||R||this.setPendingUpdate(B.TileUpdate.GEOMETRY);return!0}updateVisibility(){this._dirty=!0;this._surface.setTileTreeDirty()}getLayerInfo(J,R){return this.layerInfo[R][J]}hasLayerData(J,R){J=this.layerInfo[R][J];return!(!J?.data||J.dataInvalidated)}get updating(){if(this.hasPendingUpdates)return!0;for(const J of v.LayerClasses){const R= this.layerInfo[J];for(const Q of R)if(Q.loadingAgent&&Q.loadingAgent!==y.tileAgentDone&&Q.loadingAgent.updating)return!0}return!1}_isSuspended(J){return this.hasPendingUpdate(B.TileUpdate.SPLIT)?!0:J===v.LayerClass.ELEVATION?!1:!this.loadable}get hasPendingUpdates(){return 0!==this._pendingUpdates}hasPendingUpdate(J){return(this._pendingUpdates&J)===J}setPendingUpdate(J){const R=this._pendingUpdates;this._pendingUpdates|=J;J===B.TileUpdate.SPLIT||J===B.TileUpdate.MERGE?this._surface.setTileTreeDirty(): this._surface.requestUpdate();return R!==this._pendingUpdates}resetPendingUpdate(J){return this.hasPendingUpdate(J)?(this._pendingUpdates&=~J,!0):!1}requestLayerData(J,R,Q){const W=this.layerInfo[R][J];if(W.waitingAgents.has(Q))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),Q.tile.lij.toString(),R,J),!0;W.waitingAgents.push(Q);if(W.data&&!W.dataInvalidated)return console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)", this._lij.toString(),Q.tile.lij.toString(),R,J),J=u.isVectorTile(W.data),Q.dataArrived(this,J),!0;if(W.requestPromise)return!0;q.abortMaybe(W.requestAbort);W.requestAbort=new AbortController;const S=this._surface.requestTileData(this,J,R,W.requestAbort);if(!S)return W.requestAbort=null,!1;Q=()=>{W.requestPromise===S&&(W.requestPromise=null,W.requestAbort=null)};W.requestPromise=S;S.then(Q,Q);return!0}get isLeaf(){return null==this._children[0]}hasLij(J){return this._lij[0]===J[0]&&this._lij[1]=== J[1]&&this._lij[2]===J[2]}findByLij(J){if(this.hasLij(J))return this;const R=this._children;return R[0]?R[0].findByLij(J)||R[1].findByLij(J)||R[2].findByLij(J)||R[3].findByLij(J):null}distanceToSquared(J){return p.squaredLength(p.subtract(K,e.getCenter(this._center[a.CenterPosition.MIDDLE]),J))}containsPoint(J){const R=this.extent;return J[0]>=R[0]&&J[1]>=R[1]&&J[0]<=R[2]&&J[1]<=R[3]}containsPointXY(J,R){const Q=this.extent;return J>=Q[0]&&R>=Q[1]&&J<=Q[2]&&R<=Q[3]}unrequestLayerData(J,R,Q){J=this.layerInfo[R][J]; R=J.waitingAgents;Q=null!=R.removeUnordered(Q);x.weakAssert(Q,"agent has not requested this piece of map data");1>R.length&&(J.abortRequest(),this.setMemoryDirty())}dataArrived(J,R,Q){const W=u.isVectorTile(Q);J=this.layerInfo[R][J];J.data=Q;J.dataInvalidated=!1;J.waitingAgents.forAll(S=>S.dataArrived(this,W));J.waitingAgents.clear();this.setMemoryDirty()}dataMissing(J,R){J=this.layerInfo[R][J];J.dataMissing=!0;J.waitingAgents.forAll(Q=>Q.dataMissing());J.waitingAgents.clear();this.setMemoryDirty()}updateRenderData(J, R,Q){Q&&this.forEachLoadedNeighbor(W=>W.updateRenderData(J,R));switch(J){case v.LayerClass.MAP:return this._updateTexture(R);case v.LayerClass.ELEVATION:return this._updateGeometry()}}_updateTexture(J){this.renderData&&(this.resetPendingUpdate(J===w.TextureUpdate.FADING?B.TileUpdate.TEXTURE_NOFADING:B.TileUpdate.TEXTURE_FADING),this.setPendingUpdate(J===w.TextureUpdate.FADING?B.TileUpdate.TEXTURE_FADING:B.TileUpdate.TEXTURE_NOFADING))}_updateGeometry(){this.setPendingUpdate(B.TileUpdate.GEOMETRY); for(const J of this.layerInfo[v.LayerClass.ELEVATION])J.pendingUpdates|=B.TileUpdate.GEOMETRY}invalidateLayerData(J,R){this.layerInfo[R][J].invalidateSourceData();this.restartAgents(R)}computeElevationBounds(){const J=this._elevationBoundsMin,R=this._elevationBoundsMax;let Q=Infinity,W=-Infinity;const S=this.layerInfo[v.LayerClass.ELEVATION];let V=!0;for(const T of S)null!=T.elevationBounds&&(Q=Math.min(Q,T.elevationBounds.min),W=Math.max(W,T.elevationBounds.max),T.elevationBounds.hasNoDataValues|| (V=!1));V&&(Q=Math.min(Q,0),W=Math.max(W,0));if(J!==Q||R!==W)this._elevationBoundsMin=Q,this._elevationBoundsMax=W,this.updateRadiusAndCenter(),this._surface.setTileTreeDirty()}_updateCenter(){const J=this._elevationBoundsMin,R=this._elevationBoundsMax,Q=this._center;p.scale(K,this.up,.5*(J+R));p.add(e.getCenter(Q[a.CenterPosition.MIDDLE]),this.centerAtSeaLevel,K);p.scale(K,this.up,J);p.add(Q[a.CenterPosition.TOP],this.centerAtSeaLevel,K);p.scale(K,this.up,R);p.add(Q[a.CenterPosition.BOTTOM],this.centerAtSeaLevel, K)}findElevationBoundsForLayer(J,R){const Q=this.layerInfo[v.LayerClass.ELEVATION][J],W=this.elevationLevelDelta,S=Math.max(this.elevationLevel-W,0);var V=Q.elevationBounds;if(!(null!=V&&V.level>=R&&V.level<=S)&&(R=this._surface.layerViewByIndex(J,v.LayerClass.ELEVATION),R=x.getLayerWithExtentRange(R),C.fallsWithinLayer(this,R,!1))){R=O;V=!1;var T=Q.data;if(T&&T.level<=S)J=Q.data,R.min=J.samplerData.data.minValue,R.max=J.samplerData.data.maxValue,R.hasNoDataValues=J.samplerData.data.hasNoDataValues, R.level=this.level,V=!0;else{T=0;let Y,ha;for(let ba=this._parent;ba&&(!ha||T=J[0]&&J[2]>=R[2]&&R[1]>=J[1]&&J[3]>=R[3]}intersectsExtent(J){const R=this.extent;return R[2]>= J[0]&&J[2]>=R[0]&&R[3]>=J[1]&&J[3]>=R[1]}getElevationVerticesPerSide(J){J=b.clamp((this.maxTesselation>>Math.max(this.level-J,this.elevationLevelDelta-(this.elevationLevel-this.level)))+1,2,this.maxTesselation+1);const R=this.getDefaultVerticesPerSide();return Math.max(J,R)}_findLIJ(J,R){if(!J)return null;var Q=this.surface.rootTiles;if(null!=Q)for(var W of Q){{Q=W.lij;const S=J[0]-Q[0];Q=0>S?!1:J[1]>>S===Q[1]&&J[2]>>S===Q[2]}if(Q){for(Q=J[0]-W.level-1;0<=Q&&!W.isLeaf&&!R(W);)W=W.children[2*(J[1]>> Q&1)+(J[2]>>Q&1)],Q--;return R(W)?W:null}}return null}findNeighborTile(J,R){const Q=this._lij;return(J=this.getNeighborLIJ(Q,J))?F(Q,J)?R(this)?this:null:this._findLIJ(J,R):null}findCorner(J,R){J=J===r.NeighborIndex.NORTH_EAST?1:J===r.NeighborIndex.NORTH_WEST?0:J===r.NeighborIndex.SOUTH_WEST?2:3;let Q=this;for(;Q.children[0]&&(!R||!R(Q));)Q=Q.children[J];return Q}findNeighborCornerTileExact(J,R){return this.findNeighborTile(J,Q=>R(Q)||Q.level===this.level)?.findCorner(x.oppositeCorner(J),R)||null}forAllSubtreeOnSide(J, R){const Q=J===r.NeighborIndex.NORTH?[0,1]:J===r.NeighborIndex.NORTH_EAST?[1]:J===r.NeighborIndex.EAST?[1,3]:J===r.NeighborIndex.SOUTH_EAST?[3]:J===r.NeighborIndex.SOUTH?[2,3]:J===r.NeighborIndex.SOUTH_WEST?[2]:J===r.NeighborIndex.WEST?[0,2]:[0],W=S=>{const V=S.children;!R(S)&&V[0]&&Q.forEach(T=>W(V[T]))};W(this)}getNeighborEdgeStartVertexIndex(J,R){if(!R)return 0;var Q=this.level-R.level;x.internalAssert(!x.enableTerrainInternalChecks||0<=Q);if(0===Q)return 0;Q=2**Q;var W=(J=1===(J&1))?0:1;R=R.lij[W+ 1]*Q;W=this._lij[W+1];const S=W-R;J=J?Q-1-S:S;x.enableTerrainInternalChecks&&(x.internalAssert(R<=W&&WW.level===R||W.isLoaded;x.neighborEdgeIndices.forEach(W=>{const S=this.findNeighborTile(W,Q);null!=S&&S!==this&&S.forAllSubtreeOnSide(x.oppositeEdge(W),V=>V.isLoaded?(J(V,W),!0):!1)});x.neighborCornerIndices.forEach(W=>{const S=this.findNeighborTile(W,Q)?.findCorner(x.oppositeCorner(W),V=>V.isLoaded);x.internalAssert(!S|| H(this,S,W));S?.isLoaded&&J(S,W)})}getNeighborLIJ(J,R){const Q=x.isNorth(R)?-1:x.isSouth(R)?1:0;R=x.isWest(R)?-1:x.isEast(R)?1:0;J=[J[0],J[1]+Q,J[2]+R];return 0>J[1]?null:this.surface.isGlobal?this.wrapLIJ(J):0>J[2]?null:J}wrapLIJ(J){return!J||0>J[1]||J[1]>=2**J[0]?null:this.surface.wrapEastWest(J)}get westNeighborWestExtent(){return this.extent[0]*(this.isWestEnd?-1:1)}get eastNeighborEastExtent(){return this.extent[2]*(this.isEastEnd?-1:1)}get isEastEnd(){return this._lij[2]===this.surface.lijEastEnd(this.level)- 1}get isWestEnd(){return 0===this._lij[2]}get isNorthEnd(){return 0===this._lij[1]}get isSouthEnd(){const J=this.surface.extent?.[1]??null;return null!=J&&this.extent[1]+h.getEpsilon()>=J}checkGeometryWaterproofness(){x.enableWaterproofTests&&(x.internalAssert(this.isLoaded),this.renderData?.checkGeometryWaterproofness())}shouldHaveNeighbor(J){const R=this.extent,Q=this.surface.rootTilesExtent,W=.25*(R[2]-R[0]);if(x.isNorth(J)&&R[3]+W>=Q[3]||x.isSouth(J)&&R[1]-W<=Q[1])return!1;const S=this.surface.isGlobal; return!S&&x.isWest(J)&&R[0]-W<=Q[0]||!S&&x.isEast(J)&&R[2]+W>=Q[2]?!1:!0}updateDistanceToPOI(J){var R=this._lastPOI;if(!(0<=this.distanceToPOI&&R[0]===J[0]&&R[1]===J[1]&&R[2]===J[2])){p.copy(this._lastPOI,J);var Q=this._center[a.CenterPosition.MIDDLE];R=J[0]-Q[0];var W=J[1]-Q[1];J=J[2]-Q[2];this.distanceToPOI=R*R+W*W+J*J}}get test(){return{cachedMemory:this._cachedMemory}}}const G=new l(m.MapTileAgent),I=new l(t.ElevationTileAgent),O=new d.ElevationBounds;a.CenterPosition=void 0;(function(J){J[J.TOP= 0]="TOP";J[J.MIDDLE=1]="MIDDLE";J[J.BOTTOM=2]="BOTTOM"})(a.CenterPosition||(a.CenterPosition={}));const L=k.create(),P=k.create(),M=k.create(),K=k.create();a.Tile=E;a.isCornerNeighbor=H;a.isEdgeNeighbor=function(J,R,Q){if(null==J||null==R)return!1;if(0===J.level&&0===R.level&&(J.isEastEnd&&R.isWestEnd&&Q===r.NeighborIndex.EAST||J.isWestEnd&&R.isEastEnd&&Q===r.NeighborIndex.WEST))return!0;const W=Math.max(1E-6*(J.extent[2]-J.extent[0]),1);switch(Q){case r.NeighborIndex.NORTH:return x.almostEquals(J.extent[3], R.extent[1],W);case r.NeighborIndex.SOUTH:return x.almostEquals(J.extent[1],R.extent[3],W);case r.NeighborIndex.EAST:return x.almostEquals(J.extent[2],R.extent[0],W)||x.almostEquals(J.extent[2],-R.extent[0],W);case r.NeighborIndex.WEST:return x.almostEquals(J.extent[0],R.extent[2],W)||x.almostEquals(J.extent[0],-R.extent[2],W)}};a.lijEquals=F;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/ElevationTileAgent":function(){define(["exports","./TileAgent"],function(a, b){class q extends b.TileAgent{constructor(){super(...arguments);this.type="elevation";this._scaleRangeEnabled=!1}get _desiredMinLevelDelta(){return this.tile.elevationLevelDelta-(this.tile.elevationLevel-this.tile.level)}get _progressiveLevelModulo(){return 0}}a.ElevationTileAgent=q;a.isElevationTileAgent=function(l){return"elevation"===l.type};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileAgent":function(){define("exports ../../../core/has ./interfaces ./TerrainConst ./terrainUtils ./tileUtils".split(" "), function(a,b,q,l,p,k){class h{get updating(){return!!this._tileRequested}init(e,g,d,t){this.tile=e;this._layerIdx=g;this._layerClass=d;this._suspended=t;this._tileLayerInfo=e.getLayerInfo(g,d);this._tileRequested=null;e=this._findAncestorWithData();this._setUpsampleTile(e)}startLoading(){return this._requestNext()}dispose(){this._tileRequested&&(this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null);this._tileLayerInfo=this.tile=null}setSuspension(e){e!== this._suspended&&((this._suspended=e)?this._tileRequested&&(this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null):this._tileLayerInfo.data||this.update())}update(){const e=this._findAncestorWithData();this._setUpsampleTile(e);return this._requestNext()}dataArrived(e,g){this._setUpsampleTile(e,g);this._tileRequested=null;e===this.tile?this.tile.updateRenderData(this._layerClass,q.TextureUpdate.FADING,g):this._requestNext()}dataMissing(){this._tileRequested= null;this._tileLayerInfo.data=null;this._requestNext()}_agentDone(){this.tile.agentDone(this._layerIdx,this._layerClass);this.dispose()}_requestNext(){if(this._suspended)return!0;const e=this._findNextDownload();if(this._tileRequested){if(e===this._tileRequested)return!0;this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this);this._tileRequested=null}null!=e?e.requestLayerData(this._layerIdx,this._layerClass,this)&&(this._tileRequested=e):this._agentDone();return!!this._tileRequested}_findNextDownload(){const e= this._layerIdx,g=this._layerClass;var d=this.tile.surface.layerViewByIndex(e,g),t=p.getLayerWithExtentRange(d);const {minLevel:w,maxLevel:v}=d.dataLevelRange,m=this._desiredMinLevelDelta,r=this._progressiveLevelModulo+m,n=this._scaleRangeEnabled?k.fallsWithinLayer:()=>!0;let u=this.tile;const x=u.level;let y;const z=this._tileLayerInfo.upsampleInfo,A=null!=z?z.tile.level:-1,B=null!=z?A-x>=m:!1,C=t?.tilemapCache;for(d="vector-tile-3d"===d.type?d.schemaHelper:null;u&&n(u,t,!1)&&u.level>=w;){const D= u.level,F=x-D,H=u.layerInfo[g][e];if(H.data&&F>=m){(!B||D>A)&&this._setUpsampleTile(u);H.dataInvalidated&&(y=u);break}const N=d?.getLevelRowColumn(u.lij)??u.lij;if("unavailable"!==C?.getAvailability(N[0],N[1],N[2])&&D<=v&&!H.data&&!H.dataMissing){if(!y||u.level===w||0===D%l.progressiveLoadingModulo||x-y.level=r)break}u=u.parent}null!=y&&x-y.level=g)return t;d=t}return d}_setUpsampleTile(e,g){this._tileLayerInfo.setUpsampleInfo(this.tile,e);this.tile.updateRenderData(this._layerClass,q.TextureUpdate.FADING,g)}get test(){}}class f extends h{constructor(){super(...arguments);this.type="none"}get _desiredMinLevelDelta(){throw c;}get _progressiveLevelModulo(){throw c;}dispose(){}}const c= Error("Abstract method called on TileAgent");b=new f;a.TileAgent=h;a.tileAgentDone=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/tileUtils":function(){define(["exports","../../../core/PooledArray","./RenderOrder"],function(a,b,q){function l(w,v){v(w);if(!w.isLeaf)for(const m of w.children)l(m,v)}function p(w,v){w=w.lij;v=v.lij;return w[0]-v[0]||w[1]-v[1]||w[2]-v[2]}function k(w,v){const m=v.screenDepth-w.screenDepth;if(0!==m)return m;w=w.lij;v=v.lij;return w[0]- v[0]||w[1]-v[1]||w[2]-v[2]}function h(w,v){const m=w.screenDepth-v.screenDepth;if(0!==m)return m;w=w.lij;v=v.lij;return w[0]-v[0]||w[1]-v[1]||w[2]-v[2]}function f(w,v,m){const r=w.screenDepth,n=v.screenDepth;return rn?m:p(w,v)}function c(w,v,m,r){const n=e(w,r);r=e(v,r);return n===r?f(w,v,m):w?m:-m}function e(w,v){for(const m of v)if(w.intersectsExtent(m))return!0;return!1}function g(w,v){const m=w.distanceToPOI-v.distanceToPOI;if(0!==m)return m;w=w.lij;v=v.lij;return w[0]-v[0]||w[1]-v[1]|| w[2]-v[2]}class d{constructor(){this._queue=new b;this.remove=()=>{}}get done(){return 0===this._queue.length&&(!this._last||this._last.isLeaf)}resetOne(w){this._queue.clear();this._queue.push(w);this._last=void 0}reset(w=null){this._queue.clear();null!=w&&this._queue.pushArray(w);this._last=void 0}skipSubtree(){this._last=void 0}next(){const w=this._last?.children;w?.[0]&&this._queue.pushArray(w);return this._last=this._queue.pop()}}class t{constructor(){this._q=new b}get done(){return 0===this._q.length}reset(w){this._q.clear(); if(null!=w)for(this._q.pushArray(w),w=0;wr.xmax||n[3]>r.ymax)return!1}else if(r.xmin>n[2]||r.ymin>n[3]||r.xmax1.00000001*m)return!1;v=v.maxScale;return 0n;n++){const u=r.children[n];if(u&&u!==m)return!0}}return!1}; a.sortTiles=function(w,v,m=null){null==m||0===m.length?w===q.RenderOrder.BACK_TO_FRONT?v.sort(k):v.sort(h):v.sort((r,n)=>c(r,n,w,m))};a.sortTilesByPOI=function(w,v){const m=w.length;for(let r=0;r{}),c=new Map;a.TilePerLayerInfo=h;a.printAllocations=function(){0console.log(e,"\n")))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileUpdate":function(){define(["exports"], function(a){a.TileUpdate=void 0;var b=a.TileUpdate||(a.TileUpdate={});b[b.NONE=0]="NONE";b[b.SPLIT=1]="SPLIT";b[b.ELEVATION=2]="ELEVATION";b[b.MERGE=4]="MERGE";b[b.GEOMETRY=8]="GEOMETRY";b[b.TEXTURE_NOFADING=16]="TEXTURE_NOFADING";b[b.TEXTURE_FADING=32]="TEXTURE_FADING";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileOverlayData":function(){define(["../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a){class b{constructor(){this._scales=a.fromValues(-1, -1,-1,-1);this._offsets=a.fromValues(-1,-1,-1,-1)}clear(){this._scales[0]=this._scales[1]=this._scales[2]=this._scales[3]=-1;this._offsets[0]=this._offsets[1]=this._offsets[2]=this._offsets[3]=-1}setScale(q,l,p){this._scales[2*q]=l;this._scales[2*q+1]=p}setOffset(q,l,p){this._offsets[2*q]=l;this._offsets[2*q+1]=p}get scales(){return this._scales}get offsets(){return this._offsets}}return b})},"esri/views/3d/webgl-engine/shaders/TerrainTechnique":function(){define("require exports ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../../../../chunks/Terrain.glsl ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/basicInterfaces ../lib/Program ../lib/StencilUtils ../lib/VertexAttribute ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w extends h.ShaderTechnique{constructor(){super(...arguments);this.useStencil=!1}initializeConfiguration(m,r){r.spherical=m.viewingMode===q.ViewingMode.Global}initializeProgram(m){return new c.Program(m.rctx,w.shader.get().build(this.configuration),v)}initializePipeline(){this._stencilPipelineState=this._createPipeline(!0);return this._createPipeline(!1)}_createPipeline(m){const r=this.configuration,n=r.backfaceCullingEnabled&&!r.renderOccluded;return t.makePipelineState({blending:r.renderOccluded? t.simpleBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ONE_MINUS_SRC_ALPHA):null,culling:n?t.backFaceCullingParams:null,depthTest:r.renderOccluded?null:{func:d.CompareFunction.LESS},depthWrite:r.renderOccluded?null:t.defaultDepthWriteParams,colorWrite:t.defaultColorWriteParams,stencilTest:m?e.renderWhenBitIsNotSet(f.StencilBits.IntegratedMeshMaskExcluded):null,drawBuffers:r.output===l.ShaderOutput.Depth?{buffers:[d.SpecialDrawBuffers.NONE]}:null})}getPipeline(){return this.useStencil?this._stencilPipelineState: super.getPipeline()}}w.shader=new k.ReloadableShaderModule(p.Terrain,()=>new Promise((m,r)=>a(["../core/shaderLibrary/terrain/Terrain.glsl"],m,r)));const v=new Map([[g.VertexAttribute.POSITION,0],[g.VertexAttribute.UV0,1],[g.VertexAttribute.NORMALCOMPRESSED,2]]);b.TerrainTechnique=w;b.terrainVertexAttributeLocations=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Terrain.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/terrain/OverlayContent ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E){function G(P){const M=new N.ShaderBuilder,{vertex:K,fragment:J,varyings:R}=M;M.include(d.PositionAttribute);M.include(g.NormalAttribute,P);M.include(t.TextureCoordinateAttribute,P);var Q=()=>{M.include(x.NormalUtils,P);K.code.add(F.glsl`vec3 getNormal() { float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y); vec3 n = vec3(normalCompressed + vec2(normalCompressed.x >= 0.0 ? 1.0 : -1.0, normalCompressed.y >= 0.0 ? 1.0 : -1.0) * min(z, 0.0), z); return normalize(n); }`)};C.addProjViewLocalOrigin(K,P);M.include(e.Transform,P);const W=P.overlayMode!==A.OverlayMode.Disabled;var S=W&&P.invisible;switch(P.output){case f.ShaderOutput.Color:M.include(B.TerrainTexture,P);M.include(n.EvaluateSceneLighting,P);W&&M.include(A.OverlayTerrain,{...P,pbrMode:P.pbrMode===y.PBRMode.Simplified?y.PBRMode.TerrainWithWater:y.PBRMode.Water});(S=P.overlayMode===A.OverlayMode.EnabledWithWater)&&M.include(w.VertexTangent,P);R.add("vnormal","vec3");R.add("vpos","vec3");R.add("vup","vec3"); Q();P.screenSizePerspective&&C.addViewNormal(K);(Q=P.receiveShadows&&!P.renderOccluded)&&M.include(h.ForwardLinearDepth,P);P.screenSizePerspective&&(R.add("screenSizeDistanceToCamera","float"),R.add("screenSizeCosAngle","float"));K.code.add(F.glsl` void main(void) { //Position vpos = position; vec3 positionWorld = position + localOrigin; gl_Position = transformPosition(proj, view, vpos); //Normal vnormal = getNormal(); //Up vup = getLocalUp(position, localOrigin); ${S?F.glsl`forwardVertexTangent(vnormal);`:F.glsl``} //Texture UV vec2 uv = getUV0(); forwardTextureCoordinatesWithTransform(uv); ${W?F.glsl`setOverlayVTC(uv);`:""} ${P.tileBorders?F.glsl`forwardTextureCoordinates();`:""} ${P.screenSizePerspective?F.glsl` vec3 viewPos = (view * vec4(vpos, 1.0)).xyz; screenSizeDistanceToCamera = length(viewPos); vec3 viewSpaceNormal = (viewNormal * vec4(normalize(positionWorld), 1.0)).xyz; screenSizeCosAngle = abs(viewSpaceNormal.z);`:""} ${Q?F.glsl`forwardLinearDepth();`:""} } `);M.include(c.SliceDraw,P);M.include(n.EvaluateSceneLighting,P);M.include(r.EvaluateAmbientOcclusion,P);M.include(z.ReadShadowMapDraw,P);C.addCameraPosition(J,P);n.addAmbientBoostFactor(J);n.addLightingGlobalFactor(J);J.uniforms.add(K.uniforms.get("localOrigin"),new D.Float3PassUniform("viewDirection",(V,T)=>l.normalize(L,l.set(L,T.camera.viewMatrix[12],T.camera.viewMatrix[13],T.camera.viewMatrix[14]))));S&&J.uniforms.add(new E.Texture2DPassUniform("ovWaterTex",(V,T)=>T.overlay?.getTexture(k.OverlayContent.WaterNormal)), new H.Matrix4DrawUniform("view",(V,T)=>b.translate(O,T.camera.viewMatrix,V.origin)));J.code.add(F.glsl`const float sliceOpacity = 0.2; float lum(vec3 c) { return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5; }`);u.addMainLightDirection(J);u.addMainLightIntensity(J);J.code.add(F.glsl` void main() { vec3 normal = normalize(vnormal); float vndl = dot(normal, mainLightDirection); float additionalAmbientScale = smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0)); float shadow = ${P.receiveShadows&&!P.renderOccluded?"readShadowMap(vpos, linearDepth)":P.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; float ssao = evaluateAmbientOcclusionInverse(); vec4 tileColor = getTileColor(); ${W?F.glsl` vec4 overlayColorOpaque = getOverlayColor(ovColorTex, vtcOverlay); vec4 overlayColor = overlayOpacity * overlayColorOpaque; ${P.invisible?F.glsl`if (overlayColor.a == 0.0) { discard; }`:""} vec4 groundColor = tileColor; tileColor = tileColor * (1.0 - overlayColor.a) + overlayColor;`:""} // If combined alpha is 0 we can discard pixel. The performance impact by having a discard here // is neglectable because terrain typically renders first into the framebuffer. if(tileColor.a <= 0.0) { discard; } bool sliced = rejectBySlice(vpos); if (sliced) { tileColor *= sliceOpacity; } vec3 albedo = tileColor.rgb; // heuristic shading function used in the old terrain, now used to add ambient lighting vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; ${P.pbrMode===y.PBRMode.Simplified||P.pbrMode===y.PBRMode.TerrainWithWater?F.glsl`fragColor = vec4(evaluatePBRSimplifiedLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, normalize(vpos - cameraPosition), vup), tileColor.a);`:F.glsl`fragColor = vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), tileColor.a);`} ${S?F.glsl` vec4 overlayWaterMask = getOverlayColor(ovWaterTex, vtcOverlay); float waterNormalLength = length(overlayWaterMask); if (waterNormalLength > 0.95) { mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, vnormal); vec4 waterOverlayColor = vec4(overlayColor.w > 0.0 ? overlayColorOpaque.xyz/overlayColor.w : vec3(1.0), overlayColor.w); vec4 viewPosition = view*vec4(vpos, 1.0); vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, waterOverlayColor, -normalize(vpos - cameraPosition), shadow, vnormal, tbnMatrix, viewPosition.xyz, vpos + localOrigin); vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0)); float opacity = sliced ? sliceOpacity : 1.0; // un-gamma the ground color to mix in linear space fragColor = mix(groundColor, waterColorNonLinear, waterColorLinear.w) * opacity; }`:""} ${P.screenSizePerspective?F.glsl` float perspectiveScale = screenSizePerspectiveScaleFloat(1.0, screenSizeCosAngle, screenSizeDistanceToCamera, vec4(0.0, 0.0, 0.0, 0.0)); if (perspectiveScale <= 0.25) { fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), perspectiveScale * 4.0); } else if (perspectiveScale <= 0.5) { fragColor = mix(fragColor, vec4(0.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.25) * 4.0); } else if (perspectiveScale >= 0.99) { fragColor = mix(fragColor, vec4(0.0, 1.0, 0.0, 1.0), 0.2); } else { fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.5) * 2.0); }`:""} ${P.visualizeNormals?P.spherical?F.glsl` vec3 localUp = normalize(vpos + localOrigin); vec3 right = normalize(cross(vec3(0.0, 0.0, 1.0), localUp)); vec3 forward = normalize(cross(localUp, right)); mat3 tbn = mat3(right, forward, localUp); vec3 tNormal = normalize(normal * tbn); fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0); `:F.glsl` vec3 tNormal = normalize(normal); fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0); `:""} ${P.tileBorders?F.glsl` vec2 dVuv = fwidth(vuv0); vec2 edgeFactors = smoothstep(vec2(0.0), 1.5 * dVuv, min(vuv0, 1.0 - vuv0)); float edgeFactor = 1.0 - min(edgeFactors.x, edgeFactors.y); fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);`:""} fragColor = highlightSlice(fragColor, vpos); } `);break;case f.ShaderOutput.Depth:S&&M.include(A.OverlayTerrain,P);K.code.add(F.glsl` void main(void) { ${S?F.glsl`setOverlayVTC(getUV0());`:""} gl_Position = transformPosition(proj, view, position); } `);J.code.add(F.glsl` void main() { ${S?F.glsl`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} } `);break;case f.ShaderOutput.Shadow:case f.ShaderOutput.ShadowHighlight:case f.ShaderOutput.ShadowExcludeHighlight:case f.ShaderOutput.ViewshedShadow:M.include(v.OutputDepth,P);h.addLinearDepth(M);h.addNearFar(M);K.code.add(F.glsl`void main(void) { gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth); }`);J.code.add(F.glsl`void main() { outputDepth(linearDepth); }`);break;case f.ShaderOutput.Normal:S&&M.include(A.OverlayTerrain,P);R.add("vnormal","vec3");C.addViewNormal(K);Q();K.code.add(F.glsl` void main(void) { ${S?F.glsl`setOverlayVTC(getUV0());`:""} gl_Position = transformPosition(proj, view, position); vnormal = normalize((viewNormal * vec4(getNormal(), 1.0)).xyz); } `);J.code.add(F.glsl` void main() { ${S?F.glsl`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} vec3 normal = normalize(vnormal); if (gl_FrontFacing == false) { normal = -normal; } fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0); } `);break;case f.ShaderOutput.Highlight:W&&M.include(A.OverlayTerrain,P),K.code.add(F.glsl` void main() { ${W?F.glsl`setOverlayVTC(getUV0());`:""} gl_Position = transformPosition(proj, view, position); } `),M.include(m.OutputHighlight,P),J.code.add(F.glsl` void main() { ${W?F.glsl`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} outputHighlight(); } `)}P.output===f.ShaderOutput.ObjectAndLayerIdColor&&(W?(M.include(A.OverlayTerrain,{...P,pbrMode:y.PBRMode.Disabled}),K.code.add(F.glsl`void main(void) { gl_Position = transformPosition(proj, view, position); setOverlayVTC(getUV0()); }`),J.code.add(F.glsl`void main() { fragColor = getOverlayColorTexel(vtcOverlay); }`)):(K.code.add(F.glsl`void main(void) { ${P.opaque?F.glsl` gl_Position = transformPosition(proj, view, position);`:""} }`),J.code.add(F.glsl`void main() { fragColor = vec4(0.0); }`)));return M}class I extends B.OverlayTerrainPassParameters{}const O=q.create(),L=p.create();q=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:I,build:G},Symbol.toStringTag,{value:"Module"}));a.Terrain=q;a.TerrainPassParameters=I;a.build=G})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.VertexTangent=function(q,l){q.varyings.add("tbnTangent","vec3");q.varyings.add("tbnBiTangent", "vec3");l.spherical?q.vertex.code.add(b.glsl`void forwardVertexTangent(vec3 n) { tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), n)); tbnBiTangent = normalize(cross(n, tbnTangent)); }`):q.vertex.code.add(b.glsl`void forwardVertexTangent(vec3 n) { tbnTangent = vec3(1.0, 0.0, 0.0); tbnBiTangent = normalize(cross(n, tbnTangent)); }`);q.fragment.code.add(b.glsl`mat3 getTBNMatrix(vec3 n) { return mat3(tbnTangent, tbnBiTangent, n); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl":function(){define("exports ../shading/ReadShadowMap.glsl ./BackgroundGrid.glsl ./TileBlendInput ../../shaderModules/interfaces ../../shaderModules/Uniform".split(" "),function(a,b,q,l,p,k){class h extends b.ReadShadowMapPassParameters{constructor(){super(...arguments);this.overlayOpacity=1}}class f extends k.Uniform{constructor(d){super(d,"float")}}class c extends k.Uniform{constructor(d){super(d, "vec3")}}class e extends k.Uniform{constructor(d){super(d,"vec4")}}class g extends k.Uniform{constructor(d){super(d,"sampler2D")}}a.Float3Uniform=c;a.OverlayTerrainPassParameters=h;a.TerrainTexture=function(d,t){const {vertex:w,fragment:v,varyings:m}=d;m.add("vtc","vec2");w.uniforms.add(new e("texOffsetAndScale"));v.uniforms.add(new g("tex"));v.uniforms.add(new c("textureOpacities"));if(d=t.textureFadingEnabled&&!t.renderOccluded)w.uniforms.add(new e("nextTexOffsetAndScale")),m.add("nvtc","vec2"), v.uniforms.add(new g("texNext")),v.uniforms.add(new c("nextTexOpacities")),v.uniforms.add(new f("fadeFactor"));const r=t.tileBlendInput===l.TileBlendInput.ColorComposite;(t=t.tileBlendInput===l.TileBlendInput.GridComposite)&&v.include(q.BackgroundGrid);r&&v.uniforms.add(new c("backgroundColor"));w.code.add(p.glsl` void forwardTextureCoordinatesWithTransform(in vec2 uv) { vtc = uv * texOffsetAndScale.zw + texOffsetAndScale.xy; ${d?p.glsl`nvtc = uv * nextTexOffsetAndScale.zw + nextTexOffsetAndScale.xy;`:p.glsl``} }`);v.code.add(p.glsl` vec4 getColor(vec4 color, vec2 uv, vec3 opacities) { ${t||r?p.glsl` if (opacities.y <= 0.0) { return color * opacities.z * opacities.x; } vec4 bg = vec4(${r?p.glsl`backgroundColor`:p.glsl`gridColor(uv)`} * opacities.y, opacities.y); vec4 layer = color * opacities.z; return (bg * (1.0 - layer.a) + layer) * opacities.x;`:p.glsl`return color;`} }`);d?v.code.add(p.glsl`vec4 getTileColor() { vec4 color = getColor(texture(tex, vtc), vtc, textureOpacities); if (fadeFactor >= 1.0) { return color; } vec4 nextColor = getColor(texture(texNext, nvtc), nvtc, nextTexOpacities); return mix(nextColor, color, fadeFactor); }`):v.code.add(p.glsl`vec4 getTileColor() { return getColor(texture(tex, vtc), vtc, textureOpacities); }`)};a.Texture2DUniform=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/BackgroundGrid.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.BackgroundGrid=function(q){q.code.add(b.glsl` float lineFactorAtPosition(float value) { float pos = value * ${b.glsl.float(257)}; if(pos < 0.5 || pos > ${b.glsl.float(256.5)}) { return 1.0; } pos = pos + 0.5; float modulo = mod(pos, 16.0); return modulo <= 2.0 ? 1.0 - abs(modulo - 1.0) : 0.0; } float lineFactorAtUV(vec2 uv) { return max(lineFactorAtPosition(uv.x), lineFactorAtPosition(uv.y)); } float lineFactor(vec2 uv) { vec2 offset = fwidth(uv) * 0.25; return (lineFactorAtUV(vec2(uv.x + offset.x, uv.y + offset.y)) + lineFactorAtUV(vec2(uv.x - offset.x, uv.y + offset.y)) + lineFactorAtUV(vec2(uv.x + offset.x, uv.y - offset.y)) + lineFactorAtUV(vec2(uv.x - offset.x, uv.y - offset.y))) / 4.0; } vec3 gridColor(vec2 uv) { float line = lineFactor(uv) * 0.1 + 0.9; return vec3(1.0, 0.972, 0.918) * line; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBlendInput":function(){define(["exports"],function(a){a.TileBlendInput=void 0;var b=a.TileBlendInput||(a.TileBlendInput={});b[b.LayerOnly=0]="LayerOnly";b[b.ColorComposite=1]="ColorComposite";b[b.GridComposite=2]="GridComposite";b[b.COUNT=3]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/ScaleRangeQueries":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/ObjectPool ../../../core/PooledArray ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(){this.extent=d.create();this.maxLevel=this.minLevel=0;this.callback=null}}a.ScaleRangeQueries=class extends q{constructor(){super(...arguments);this._queries=new p({initialSize:10});this._queriesInvPtr=0;this._queryQueue=new p({initialSize:30});this._queryPool=new l(t)}queryVisibleLevelRange(w,v,m,r){const n=this._queryPool.acquire();g.copy(n.extent,w);n.minLevel=null==v?-Number.MAX_VALUE:v;n.maxLevel=null==m?Number.MAX_VALUE:m;n.callback=r;this._queryQueue.push(n); this.notifyChange("updating")}get updating(){return 0!==this._queryQueue.length}prepare(){for(;this._queries.length=this._queriesInvPtr);v.callback=null}this._queries.clear();this.notifyChange("updating")}queriesForTile(w){const v= w.level;let m=0;for(;m=r.minLevel&&v<=r.maxLevel&&n[0]<=w.extent[2]&&n[2]>=w.extent[0]&&n[1]<=w.extent[3]&&n[3]>=w.extent[1]?(this._queries.swapElements(m,this._queriesInvPtr-1),this._queriesInvPtr--):m++}}};b.__decorate([k.property()],a.ScaleRangeQueries.prototype,"updating",null);a.ScaleRangeQueries=b.__decorate([e.subclass("esri.views.3d.terrain.ScaleRangeQueries")],a.ScaleRangeQueries);Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/terrain/SphericalPatch":function(){define("exports ../../../core/mathUtils ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection/lonLatToSphericalPCPF ../../../geometry/support/DoubleArray ../../../geometry/support/frustum ../../../chunks/sphere ./interfaces ./PatchGeometryFactory ./terrainUtils ./Tile ./TileFrustumVisibility ./tileUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(z,A,B,C,D,F){z=C-z; A=D-A;B=F-B;return z*z+A*A+B*B}class m extends d.Tile{constructor(z,A,B,C,D){super();this._convexHull=Array(24);this._boundingSphere=f.create();this._baseUsedMemory=1816;this.init(z,A,B,C,D)}init(z,A,B,C,D){super.init(z,A,B,C,D);A=this.ellipsoid.radius;B=this.extentInRadians[0];C=this.extentInRadians[1];D=this.extentInRadians[2];const F=this.extentInRadians[3],H=b.lerp(C,F,.5),N=b.lerp(B,D,.5);this._edgeLen=(D-B)*Math.cos(0===z?0:Math.min(Math.abs(C),Math.abs(F)))*A;this._edgeLen2=this._edgeLen*this._edgeLen; this._curvatureHeight=A-Math.sqrt(A*A-this._edgeLen2/4);p.lonLatToSphericalPCPF(this.centerAtSeaLevel,N,H,this.ellipsoid.radius);q.normalize(this.up,this.centerAtSeaLevel);this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateBoundingVolumes();const z=this._center;if(0===this.lij[0])q.set(f.getCenter(z[d.CenterPosition.MIDDLE]),0,0,0),q.set(z[d.CenterPosition.TOP],0,0,0),q.set(z[d.CenterPosition.BOTTOM],0,0,0),z[d.CenterPosition.MIDDLE][3]=this.ellipsoid.radius+this.elevationBoundsMax; else{this._updateCenter();const H=z[d.CenterPosition.MIDDLE],N=this.convexHull;var A=0;for(let E=0;8>E;++E){var B=Math,C=B.max;var D=f.getCenter(H);var F=3*E;D=v(D[0],D[1],D[2],N[F],N[F+1],N[F+2]);A=C.call(B,A,D)}z[d.CenterPosition.MIDDLE][3]=Math.sqrt(A)}}_calculateFrustumVisibilityStatus(z){if(!h.intersectsSphere(z,this._boundingSphere))return t.TileFrustumVisibility.OUTSIDE;if(10>this.lij[0])return t.TileFrustumVisibility.INTERSECTS;const A=this.convexHull,B=this.surface.view.state.camera.near; let C=!0;for(let F=0;FI;++I){const O=3*I;if(0>H*A[O]+N*A[O+1]+E*A[O+2]+D){if(G=!0,!C)break}else C=!1}if(!G)return t.TileFrustumVisibility.OUTSIDE}return C?t.TileFrustumVisibility.INSIDE:t.TileFrustumVisibility.INTERSECTS}computeElevationBounds(){super.computeElevationBounds();this._updateBoundingVolumes()}createGeometry(){e.createSphericalGlobePatch(this.renderData,this._getPatchType()); this._updateBoundingVolumes();this.setMemoryDirty()}_updateBoundingVolumes(){this._updateConvexHull();this._updateBoundingSphere();g.enableTerrainInternalChecks&&this._checkBVs()}_updateBoundingSphere(){const z=this._boundingSphere,A=f.getCenter(z);var B=this.elevationBoundsMin,C=this.elevationBoundsMax,D=this.ellipsoid.radius;if(0===this.level)q.set(A,0,0,0),z[3]=D+C;else{var F=this.extentInRadians,H=.5*(F[0]+F[2]),N=F[3];n(x,H,F[1],D);n(y,H,N,D);q.add(A,x,y);q.scale(A,A,(D+.5*(B+C))/q.len(A));B= this.convexHull;C=0;for(D=0;8>D;++D)F=A[0]-B[3*D],H=A[1]-B[3*D+1],N=A[2]-B[3*D+2],C=Math.max(C,Math.sqrt(F*F+H*H+N*N));z[3]=C+2}}_updateConvexHull(){var z=this.extentInRadians,A=this.ellipsoid.radius;if(0!==this.level){var B=this.elevationBoundsMin,C=this.elevationBoundsMax,D=this._getPatchType(),F=this.surface.isWebMercator,H=F&&D===c.PatchType.HAS_NORTH_POLE,N=(D=F&&D===c.PatchType.HAS_SOUTH_POLE)||H;F=Math.PI/2;var E=z[0],G=z[2];D=D?-F:z[1];var I=H?F:z[3],O=.5*(E+G),L=A+(N?Math.min(0,B-1):B);B= l.create();z=l.create();H=l.create();F=l.create();n(B,E,D,L);n(z,E,I,L);n(H,G,I,L);n(F,G,D,L);E=(R,Q)=>{for(let W=0;3>W;++W)this._convexHull[3*Q+W]=R[W]};E(B,0);E(z,1);E(H,2);E(F,3);var P=A+(N?Math.max(0,C+1):C),M=l.create();A=l.create();C=l.create();n(A,O,I,L);n(C,O,D,L);q.add(M,A,C);q.normalize(M,M);var K=l.create(),J=l.create();D=(R,Q)=>{q.sub(J,R,Q);q.normalize(J,J);Q=-q.dot(R,K)/q.dot(J,K);g.internalAssert(0<=Q);q.scale(J,J,Q);q.add(R,R,J)};2**this.lij[0]>2*this.lij[1]?(A=l.create(),q.cross(A, u,C),q.normalize(A,A),q.cross(K,C,A),q.normalize(K,K),g.internalAssert(g.almostEquals(q.dot(K,C)/q.len(C),0)),D(B,z),D(F,H),E(B,0),E(F,3)):2**this.lij[0]!==2*this.lij[1]&&(C=l.create(),q.cross(C,u,A),q.normalize(C,C),q.cross(K,C,A),q.normalize(K,K),D(z,B),D(H,F),E(z,1),E(H,2));A=(R,Q)=>{const W=P/q.dot(Q,M);for(let S=0;3>S;++S)this._convexHull[3*R+S]=Q[S]*W};A(4,B);A(5,z);A(6,H);A(7,F)}}_getPatchType(){const z=this.lij[1],A=z===(1<=this.level)){var z=this._boundingSphere,A=z[3],B=f.getCenter(z);z=l.create();var C=this.ellipsoid.radius,D=this.elevationBoundsMin,F=this.elevationBoundsMax,H=C+D,N=this._center[d.CenterPosition.MIDDLE][3],E=this.convexHull,G=(za,ya)=>{for(let Da=0;3>Da;++Da)za[Da]=E[3*ya+Da]},I=l.create(), O=l.create(),L=l.create(),P=l.create(),M=l.create(),K=(za,ya,Da,ra)=>{G(O,za);G(L,ya);G(P,Da);q.sub(O,O,L);q.sub(P,P,L);q.cross(I,O,P);q.normalize(I,I);var xa=q.dot(I,L);G(M,ra);const Ma=q.dot(I,M);xa=Math.abs(Ma-xa);g.internalAssert(g.almostEquals(xa,0),`Non coplanar ${za},${ya},${Da},${ra} diff = ${xa}`)};K(0,1,2,3);K(4,5,6,7);K(0,1,4,5);K(1,2,5,6);K(2,3,6,7);K(3,0,7,4);var J=k.newDoubleArray(24),R=l.create(),Q=l.create(),W=l.create(),S=l.create();K=(za,ya,Da,ra)=>{G(R,ya);G(Q,Da);G(W,ra);q.sub(R, R,Q);q.normalize(R,R);q.sub(W,W,Q);q.normalize(W,W);q.cross(S,R,W);q.normalize(S,S);ya=q.dot(S,Q);za*=4;for(Da=0;3>Da;++Da)J[za+Da]=S[Da];J[za+3]=ya};K(0,0,1,2);K(1,1,0,4);K(2,1,5,2);K(3,3,2,6);K(4,4,0,3);K(5,4,6,5);var V=(za,ya,Da,ra)=>{za*=4;return J[za]*ya+J[za+1]*Da+J[za+2]*ra-J[za+3]},T=(za,ya,Da,ra)=>-1<=V(za,ya,Da,ra),Y=2**this.lij[0]>2*this.lij[1];K=(za,ya,Da)=>Math.sqrt(v(za,ya,Da,B[0],B[1],B[2]))ba;++ba){for(U=0;8>U;++U)Z=3*U,Z=-1<=V(ba,E[Z],E[Z+1],E[Z+2]),Y&&=Z,g.internalAssert(Z,`Tile[${this.lij}] Convex hull point ${U} outside of plane ${ba}`);g.internalAssert(T(ba,ca[0],ca[1],ca[2]),`Tile[${this.lij}] (${H}) bottom mid outside of plane ${ba}`);g.internalAssert(T(ba,ha[0],ha[1],ha[2]),`Tile[${this.lij}] (${H}) top mid outside of plane ${ba}`)}g.internalAssert(Y,"Not all convex hull points are inside convex hull polyhedron"); g.internalAssert(K(ca[0],ca[1],ca[2]),`Tile[${this.lij}] (${H}) bottom mid outside of bounding sphere`);g.internalAssert(K(ha[0],ha[1],ha[2]),`Tile[${this.lij}] (${H}) top mid outside of bounding sphere`);for(T=0;8>T;++T)ha=3*T,ha=K(E[ha],E[ha+1],E[ha+2]),g.internalAssert(ha,`Tile[${this.lij}] Convex hull point ${T} outside of bounding sphere`);for(K=0;6>K;++K)for(T=0;8>T;++T)ha=3*T,-1<=V(K,E[ha],E[ha+1],E[ha+2])||console.error(`Tile[${this.lij}] Convex hull point ${T} outside of plane ${K}`);({extentInRadians:K}= this);K=Math.round(Math.max(K[2]-K[0],K[3]-K[1])*C);({renderData:T}=this);if(T){var {geometry:ea,geometryState:da,localOrigin:ia}=T;if(T=ea.vertexAttributes?.position){ha=l.create();ca=ea.numVerticesPerSide-2;var {indices:ka,indexCount:fa,edgeVerticesStartIndex:X,poleVerticesStartIndex:ja}=ea;if(ka)for(H=new Set,Y=0;Y=X;let ra=!1;ba=-1;if(Da)for(U=X,Z=0;4>Z;++Z){var la=da.edgeResolutions[Z];if(za===U||za===U+la-1){ra=!0; break}U+=la;if(za{const Ea=Da&&!ra;return`Tile[${this.lij}].vertex[${za}]:${ya?"internal":Ea?"edge":ra?"corner":"pole"}`+(Ga?"(below)":Pa?"(above)":"")+(xa?"(Neighbor)":"")};var va=q.dist(ha,B);va>=A+0&&(va-=A,na||(console.error(`${Qa()} is out of the bounding sphere by ${va.toFixed(0)} / ${A.toFixed(0)}`+ "[tol\x3d0]"+` h=${ba.toFixed(0)} / [${D.toFixed(0)}..${F.toFixed(0)}] (${(va/A).toFixed(0)})`),Z=!0));for(na=0;6>na;++na)if(!(-1<=V(na,ha[0],ha[1],ha[2]))){va=V(na,ha[0],ha[1],ha[2]);const Ea=za%ca,ua=(za-Ea)/ca;0===na&&la||5===na&&Ma||(console.error(`${Qa()} (${Ea},${ua})|${ca}] is out of the bounding trapezoid plane ${na}`+` h=${Math.round(ba)} / [${Math.round(D)}..${Math.round(F)}] dist=${Math.round(va)}`+` radii = ${Math.round(A)}/${Math.round(N)}} : maxL = ${K}`),++U)}if(Z||0{const D=Math.sin(A),F=Math.cos(B);B=Math.sin(B);z[0]=C*F*Math.cos(A);z[1]=C*F*D;z[2]=C*B},u=[0,0,1],x=l.create(),y=l.create();a.SphericalPatch=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/lonLatToSphericalPCPF":function(){define(["exports"],function(a){a.lonLatToSphericalPCPF=function(b,q,l,p){const k=Math.cos(l);b[0]=Math.cos(q)*k*p;b[1]=Math.sin(q)*k*p;b[2]=Math.sin(l)*p};Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/terrain/SplitLimits":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){a.SplitLimits=class extends q{constructor(){super(...arguments);this.angledSplitBias=this.maxLod=this.relativeHeightLimit=this.relativeWidthLimit=this.fovY=this.fovX=0; this.aboveGround=!0}};b.__decorate([l.property()],a.SplitLimits.prototype,"fovX",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"fovY",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"relativeWidthLimit",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"relativeHeightLimit",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"maxLod",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"angledSplitBias",void 0);b.__decorate([l.property()],a.SplitLimits.prototype, "aboveGround",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"frustum",void 0);a.SplitLimits=b.__decorate([f.subclass("esri.views.3d.terrain.SplitLimits")],a.SplitLimits);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainRenderer":function(){define("exports ../../../chunks/tslib.es6 ../../../Color ../../../core/has ../../../core/maybe ../../../core/MemCachePool ../../../core/ObjectPool ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/support/aaBoundingBox ../../../geometry/support/buffer/BufferView ../../ViewingMode ./interfaces ./LayerClass ./OverlayContent ./OverlayRenderer ./PatchRenderData ./RenderOrder ./TerrainAttributesCache ./terrainUtils ./TileRenderer ./TileUpdate ./tileUtils ../webgl-engine/collections/Component/ComponentIntersectionData ../webgl-engine/core/shaderLibrary/ShaderOutput ../../../chunks/Terrain.glsl ../webgl-engine/core/shaderLibrary/terrain/TileBlendInput ../webgl-engine/effects/RenderPlugin ../webgl-engine/lib/Attribute ../webgl-engine/lib/basicInterfaces ../webgl-engine/lib/glUtil3D ../webgl-engine/lib/Intersector ../webgl-engine/lib/IntersectorInterfaces ../webgl-engine/lib/Material ../webgl-engine/lib/RayIntersections ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/screenSizePerspectiveUtils ../webgl-engine/lib/VertexAttribute ../webgl-engine/lib/verticalOffsetUtils ../webgl-engine/materials/DrawParameters ../webgl-engine/shaders/TerrainTechnique ../webgl-engine/shaders/TerrainTechniqueConfiguration ../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca){const ea=r.create();a.TransparencyMode=void 0;(function(X){X[X.Opaque=0]="Opaque";X[X.Semitransparent=1]="Semitransparent";X[X.TransparentWithDraped=2]="TransparentWithDraped";X[X.Empty=3]="Empty"})(a.TransparencyMode||(a.TransparencyMode={}));a.TerrainRenderer=class extends P.SyncPrepareRenderPlugin{get _isGlobal(){return this._stage.viewingMode===u.ViewingMode.Global}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(X, ja,la,na,va){super({});this._overlayRenderer=X;this._stage=ja;this._allTiles=la;this._ellipsoidRadius=na;this.type=Q.IntersectorType.TERRAIN;this.isGround=!0;this._tileSize=256;this._techniqueConfiguration=new Z.TerrainTechniqueConfiguration;this._passParameters=new O.TerrainPassParameters;this._drawParameters=new ba.DrawParameters;this._renderDataPool=new h(B.PatchRenderData);this._visiblePatchesByOrigin=new Map;this._allPatchesByOrigin=new Map;this._patchSortingDirty=this._patchesByOriginDirty= !0;this._tileIterator=new E.IteratorPreorder;this._transparencyState=a.TransparencyMode.Opaque;this._inViewshed=this._castShadows=!1;this._tileRenderer=this._emptyTex=null;this._stencilEnabledLayerExtents=[];this._numOriginsRendered=this._numTilesCulled=this._numTilesRendered=0;this.renderOccludedFlags=W.RenderOccludedFlag.Occlude;this.produces=new Map([[V.RenderSlot.OPAQUE_TERRAIN,()=>this._produces()],[V.RenderSlot.TRANSPARENT_TERRAIN,()=>this._produces()],[V.RenderSlot.OCCLUDED_TERRAIN,()=>this._produces()]]); this._tileTextureCache=new k.MemCachePool((za,ya)=>va.newCache(za,ya),"TileTexture");this.tileGeometryCache=new D.TerrainAttributesCache(va)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this);this.addHandles(f.watch(()=>this._overlayRenderer.rendersOccludedDraped,X=>{this.renderOccludedFlags=X?A.overlayRenderOccludedFlag:W.RenderOccludedFlag.Occlude;this.setNeedsRender()},f.sync))}destroy(){this._stage.removeRenderPlugin(this);this._tileTextureCache.destroy();this.tileGeometryCache.destroy()}_produces(){return this.visible&& !!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?P.ConsumesDepth:P.ConsumesNone}set renderingDisabled(X){this._set("renderingDisabled",!!X);this.setDirty()}set visible(X){this._set("visible",!!X);this.setDirty()}updateHeading(X){this._tileRenderer?.updateHeading(X)}set transparency(X){this._transparencyState!==X&&(this._techniqueConfiguration.invisible=X===a.TransparencyMode.TransparentWithDraped||X===a.TransparencyMode.Empty,this._techniqueConfiguration.opaque= X===a.TransparencyMode.Opaque,this._transparencyState=X,this.setNeedsRender())}get transparency(){return this._transparencyState}get renderPatchBorders(){return!!this._techniqueConfiguration.tileBorders}set renderPatchBorders(X){this._techniqueConfiguration.tileBorders!==X&&(this._techniqueConfiguration.tileBorders=X,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return!!this._techniqueConfiguration.visualizeNormals}set visualizeNormals(X){this._techniqueConfiguration.visualizeNormals!== X&&(this._techniqueConfiguration.visualizeNormals=X,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._techniqueConfiguration.backfaceCullingEnabled}set cullBackFaces(X){this._techniqueConfiguration.backfaceCullingEnabled!==X&&(this._techniqueConfiguration.backfaceCullingEnabled=X,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(X){this._set("renderOrder",X);this._setSortingDirty()}get layerUid(){return ha.terrainId}get slicePlaneEnabled(){return this._techniqueConfiguration.hasSlicePlane}set slicePlaneEnabled(X){this._techniqueConfiguration.hasSlicePlane!== X&&(this._techniqueConfiguration.hasSlicePlane=X,this.setNeedsRender())}set textureFadingEnabled(X){this._techniqueConfiguration.textureFadingEnabled!==X&&(this._techniqueConfiguration.textureFadingEnabled=X,this.setNeedsRender())}set pbrMode(X){this._techniqueConfiguration.pbrMode!==X&&(this._techniqueConfiguration.pbrMode=X,this.setNeedsRender())}setDebugScreenSizePerspective(X){this._techniqueConfiguration.screenSizePerspective!==X&&(this._techniqueConfiguration.screenSizePerspective=X,this.setNeedsRender())}setRootTiles(X){this._rootTiles= X;this.setDirty()}setStencilEnabledLayerExtents(X){this._stencilEnabledLayerExtents=X;this._setSortingDirty()}setTileSize(X){this._tileSize=X;null!=this._tileRenderer&&(this._tileRenderer.tileSize=X);this.setDirty()}_prepareTileForLoading(X){X.renderData||(X.renderData=this._renderDataPool.acquire(),X.renderData.init(X,this._getLocalOriginOfTile(X)))}loadTile(X){this._prepareTileForLoading(X);this.updateTileGeometryState(X);this.updateTileTexture(X,N.TileUpdate.TEXTURE_FADING)}updateTileTexture(X, ja){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(X,ja===N.TileUpdate.TEXTURE_FADING?x.TextureUpdate.FADING:x.TextureUpdate.UNFADED),this.setNeedsRender(),X.resetPendingUpdate(ja))}updateTileGeometryState(X){for(const ja of X.layerInfo[y.LayerClass.ELEVATION])ja.pendingUpdates&=~N.TileUpdate.GEOMETRY;X.resetPendingUpdate(N.TileUpdate.GEOMETRY);(X=X.renderData.updateGeometryState())&&this.setDirty();return X}updateGeometryIfNeeded(X){X.isLoaded&&X.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(X){const ja= X.renderData;ja&&(ja.releaseGeometry(),this._renderDataPool.release(ja),ja.clear(),X.renderData=null,X.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(X){const ja=Math.max(0,7*Math.floor((X.level-3)/7));if(this._isGlobal&&0===ja)return v.ZEROS;for(;X.parent&&X.level>ja;)X=X.parent;return X.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(X){this._get("wireframe")!==X&&(this._set("wireframe", X),this.setNeedsRender())}setDirty(X=K.RenderRequestType.UPDATE){this._patchesByOriginDirty=!0;this._context.requestRender(X)}_setSortingDirty(X=K.RenderRequestType.UPDATE){this._patchSortingDirty=!0;this._context.requestRender(X)}setNeedsRender(X=K.RenderRequestType.UPDATE){this._context.requestRender(X)}initializeRenderContext(X){this._context=X;this._tileRenderer=new H.TileRenderer(this._rctx,this._tileSize,this._techniques,this._tileTextureCache);this.updateTileBackground();this._emptyTex=J.createEmptyTexture(this._rctx)}uninitializeRenderContext(){this._emptyTex= p.disposeMaybe(this._emptyTex);this._tileRenderer=p.disposeMaybe(this._tileRenderer)}intersect(X,ja,la,na){if(!(!this._rootTiles||X.options.selectOpaqueTerrainOnly&&X.options.selectionMode&&this.transparency!==a.TransparencyMode.Opaque)){var va=da,za=ia;w.subtract(va,na,la);w.set(za,1/va[0],1/va[1],1/va[2]);var ya=X.results.min,Da=X.results.max,ra=X.results.ground,xa=X.options.store===Q.StoreResults.MIN,Ma=!!X.results.ground.target,Ga=ha.getVerticalOffsetTerrain(X.verticalOffset),Pa=X.tolerance,Qa, Ea=xa&&null!=ya.dist?ya.dist:Infinity,ua=X.options,Na=ua.normalRequired||!ua.backfacesTerrain,Ua=new S.MeshIntersectionOptions(!1,Na),wa=Ha=>{var Ka=Ha.renderData;if(Ka?.vao){var Aa=Ka.geometry;r.set(ea,Aa.boundingBox);var Sa=Ka.localOrigin;null!=Ga&&(Ga.localOrigin=Sa,Ga.applyToAabb(ea));ka[0]=la[0]-Sa[0];ka[1]=la[1]-Sa[1];ka[2]=la[2]-Sa[2];if(S.intersectAabbInvDirBefore(ea,ka,za,Pa,Ea)){var Ya=(Ta,Ra,$a)=>{Ta.set(this.type,Ha,Ra,$a,t.IDENTITY);Ea=xa&&null!=ya.dist?ya.dist:Infinity};Ka=(Ta,Ra,$a)=> {(!Na||null!=$a)&&0<=Ta&&(ua.backfacesTerrain||0>w.dot($a,va))&&(ua.invisibleTerrain||!ua.selectionMode||null==ja||ja(la,na,Ta))&&((null==ra.dist||TaDa.dist)&&Ya(Da,Ta,$a)))};var qa=fa;w.subtract(qa,na,Sa);var {indices:aa,indexCount:Ja}= Aa;Aa=Aa.vertexAttributes;Sa=Aa.getField(Y.VertexAttribute.POSITION,n.BufferViewVec3f);Aa=new M.Vertices(Sa.typedBuffer,3,Aa.stride/4);Sa=Ja/3;if(!Ga&&Sa>G.componentMinimalSizeForIntersectionData){const Ta=Ha.renderData;null==Ta.intersectionData&&(Ta.intersectionData=new G.ComponentIntersectionData(aa,0,Sa,Aa));Ta.intersectionData.intersectRay(ka,qa,Ua,Ka)}else S.intersectTriangles(ka,qa,0,Sa,aa,Aa,Ga,Ua,Ka)}}},sa=this._rootTiles;null!=sa&&(()=>{const Ha=this._tileIterator;Ha.reset(sa);const Ka=X.options.invisibleTerrain; for(let Aa=Ha.next();Aa;Aa=Ha.next())!(Aa.visible||Ka&&Aa.intersectsClippingArea)||null==Ga&&!Aa.intersectsRay(la,va,Pa,Ea)||Ma&&this._useStencilForTile(Aa)?Ha.skipSubtree():wa(Aa)})()}}processScaleRangeQueries(X,ja){if(!ja.done)for(this._updatePatchGroups();X.updating&&!ja.done;){X.prepare();for(const la of this._visiblePatchesByOrigin.values())for(const na of la)null!=na.renderData?.textureReference&&X.queriesForTile(na);X.process();ja.madeProgress()}}prepareTechnique(X){var ja=l("enable-feature:terrain-shadows")&& X.bindParameters.shadowMap.enabled;ja!==this._castShadows&&(this._castShadows=ja,this._patchesByOriginDirty=!0);ja=X.bindParameters.viewshedEnabled;this._inViewshed!==ja&&(this._inViewshed=ja,this._patchesByOriginDirty=!0);if(X.bindParameters.slot===V.RenderSlot.OCCLUDED_TERRAIN){if(0===(X.renderOccludedMask&A.overlayRenderOccludedFlag))return null}else if(X.bindParameters.slot!==(this.transparency===a.TransparencyMode.Opaque?V.RenderSlot.OPAQUE_TERRAIN:V.RenderSlot.TRANSPARENT_TERRAIN))return null; if(this.transparency===a.TransparencyMode.Empty)return null;switch(X.output){case I.ShaderOutput.Color:return this._techniqueConfiguration.hasScreenSpaceReflections=null!=X.bindParameters.ssr.lastFrameColor,this._techniqueConfiguration.hasCloudsReflections=null!=X.bindParameters.cloudsFade.data,this._techniqueConfiguration.receiveShadows=X.bindParameters.shadowMap.ready,this._techniqueConfiguration.receiveAmbientOcclusion=null!=X.bindParameters.ssao,this._techniqueConfiguration.overlayMode=this._overlayRenderer.mode, this._updateTechnique(I.ShaderOutput.Color,X.bindParameters.slot===V.RenderSlot.OCCLUDED_TERRAIN);case I.ShaderOutput.Shadow:case I.ShaderOutput.ShadowExcludeHighlight:if(this._castShadows)return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(I.ShaderOutput.Shadow,!1);break;case I.ShaderOutput.ViewshedShadow:if(this._inViewshed)return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion= !1,this._updateTechnique(I.ShaderOutput.ViewshedShadow,!1);break;case I.ShaderOutput.Depth:return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(I.ShaderOutput.Depth,!1);case I.ShaderOutput.Normal:return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(I.ShaderOutput.Normal,!1);case I.ShaderOutput.ObjectAndLayerIdColor:return this._updateTechnique(I.ShaderOutput.ObjectAndLayerIdColor, !1);case I.ShaderOutput.Highlight:if(this._overlayRenderer.hasHighlights)return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(I.ShaderOutput.Highlight,!1)}return null}renderNode(X,ja){this._updatePatchGroups();ja.useStencil=!1;switch(X.output){case I.ShaderOutput.Color:this._renderMaterialPass(X,ja,X.bindParameters.slot===V.RenderSlot.OCCLUDED_TERRAIN?z.OverlayContent.Occluded:z.OverlayContent.Color);break;case I.ShaderOutput.Depth:case I.ShaderOutput.Normal:this._renderAuxiliaryPass(X, ja,z.OverlayContent.Color,this._visiblePatchesByOrigin);break;case I.ShaderOutput.Highlight:this._renderAuxiliaryPass(X,ja,z.OverlayContent.Highlight,this._visiblePatchesByOrigin);break;case I.ShaderOutput.Shadow:case I.ShaderOutput.ShadowExcludeHighlight:case I.ShaderOutput.ViewshedShadow:this._renderAuxiliaryPass(X,ja,null,this._allPatchesByOrigin);break;case I.ShaderOutput.ObjectAndLayerIdColor:this._renderAuxiliaryPass(X,ja,z.OverlayContent.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(X){if(null!= this._tileRenderer){var ja=this._tileRenderer;if(null!=X){X=q.toUnitRGBA(X);var la=v.fromValues(X[0]||0,X[1]||0,X[2]||0)}ja.setBackground(la);this._allTiles.forAll(na=>ja.updateTileTexture(na,x.TextureUpdate.FADING));this._techniqueConfiguration.tileBlendInput=ja.backgroundIsGrid?L.TileBlendInput.GridComposite:null!=ja.backgroundColor?L.TileBlendInput.ColorComposite:L.TileBlendInput.LayerOnly;this.setNeedsRender()}}_updatePatchGroups(){this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty= !1,this._patchSortingDirty=!0);if(this._patchSortingDirty&&this.renderOrder!==C.RenderOrder.NONE){const X=Array.from(this._visiblePatchesByOrigin.values()),ja=this._stencilEnabledLayerExtents;for(const la of X)E.sortTiles(this.renderOrder,la,ja);X.sort((la,na)=>E.compareTiles(la[0],na[0],this.renderOrder));this._visiblePatchesByOrigin=new Map(X.map(la=>[la[0].renderData.localOrigin,la]));this._patchSortingDirty=!1}}_rebuildPatchGroups(){const X=this._rootTiles;if(null!=X){X[0]?.surface.checkAllTilesWaterproofness(); this._visiblePatchesByOrigin.clear();this._allPatchesByOrigin.clear();for(const ja of X)this._rebuildPatchGroupsForRootTile(ja)}}_rebuildPatchGroupsForRootTile(X){const ja=this._tileIterator;for(ja.resetOne(X);!ja.done;){X=ja.next();var la=X.renderData;if(la){la=la.localOrigin;if(this._castShadows||this._inViewshed){var na=this._allPatchesByOrigin.get(la);na||(na=[],this._allPatchesByOrigin.set(la,na));na.push(X)}X.visible?(na=this._visiblePatchesByOrigin.get(la),na||(na=[],this._visiblePatchesByOrigin.set(la, na)),na.push(X),ja.skipSubtree()):(this._numTilesCulled++,ja.skipSubtree())}else this._numTilesCulled++}}_useStencilForTile(X){for(const ja of this._stencilEnabledLayerExtents)if(X.intersectsExtent(ja))return!0;return!1}_renderAuxiliaryPass(X,ja,la,na){const va=X.rctx;this._passParameters.overlayContent=la;va.bindTechnique(ja,X.bindParameters,this._passParameters);const za=0{this._drawParameters.origin=ya[0].renderData.localOrigin;ja.program.bindDraw(this._drawParameters, X.bindParameters,this._passParameters);for(let Da=0;DaGa?Da.nextTextureReference:null;this._techniqueConfiguration.textureFadingEnabled&&null!=Pa&&1>Ga?(na.setUniform1f("fadeFactor",Ga),na.setUniform4fv("nextTexOffsetAndScale",Pa.offsetAndScale),na.setUniform3fv("nextTexOpacities",Pa.opacities),na.bindTexture("texNext",Pa.texture.texture)):na.setUniform1f("fadeFactor",1);Da.textureIsFading&&this.setNeedsRender();na.setUniform3fv("textureOpacities",Ma.opacities)}this._renderPatch(X, ja,xa,ya,va,la);xa.renderOrder=this._numTilesRendered;this._numTilesRendered++}}}X.rctx.bindVAO(null)}_renderPatch(X,ja,la,na,va,za){const ya=la.renderData,Da=ya.vao,ra=Da?.indexBuffer;if(Da&&null!=ra){var xa=ja.program;null==za||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(xa,ya.overlay);va&&(ja.useStencil=this._useStencilForTile(la),X.rctx.setPipelineState(ja.getPipeline()));ja=ya.geometry.indexCount;X.rctx.bindVAO(Da);xa.assertCompatibleVertexAttributeLocations(Da);X.rctx.drawElements(na, ja,ra.indexType,0)}else F.enableTerrainInternalChecks&&console.error("Rendered tile with no indices: ",la.lij," : ",ya)}_bindOverlayPatchData(X,ja){X.setUniform4fv("overlayTexOffset",ja.offsets);X.setUniform4fv("overlayTexScale",ja.scales)}_updateTechnique(X,ja){this._techniqueConfiguration.output=X;this._techniqueConfiguration.renderOccluded=ja;return this._shaderTechnique=this._techniques.releaseAndAcquire(U.TerrainTechnique,this._techniqueConfiguration,this._shaderTechnique)}get test(){}};b.__decorate([c.property({readOnly:!0})], a.TerrainRenderer.prototype,"_isGlobal",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,"renderOccludedFlags",void 0);b.__decorate([c.property({value:!1})],a.TerrainRenderer.prototype,"renderingDisabled",null);b.__decorate([c.property({value:!0})],a.TerrainRenderer.prototype,"visible",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,"renderPatchBorders",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,"visualizeNormals",null);b.__decorate([c.property()],a.TerrainRenderer.prototype, "cullBackFaces",null);b.__decorate([c.property({value:C.RenderOrder.FRONT_TO_BACK})],a.TerrainRenderer.prototype,"renderOrder",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,"wireframe",null);a.TerrainRenderer=b.__decorate([d.subclass("esri.views.3d.terrain.TerrainRenderer")],a.TerrainRenderer);const da=v.create(),ia=v.create(),ka=v.create(),fa=v.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainAttributesCache":function(){define(["exports", "../../../core/MemCachePool","./TerrainAttributes"],function(a,b,q){class l{constructor(p){this._storage=new b.MemCachePool((k,h)=>p.newCache(k,h),"TileGeometry")}acquire(p){p=4*Math.ceil(p/4);const k=this._storage,h=p.toString(),f=k.pop(h);if(f)return f;const c=q.terrainAttributesLayout.createBuffer(p);c.release=()=>k.put(h,c);return c}clear(){this._storage.clear()}destroy(){this._storage.destroy()}}a.TerrainAttributesCache=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainAttributes":function(){define(["exports", "../support/buffer/InterleavedLayout","../webgl-engine/lib/VertexAttribute"],function(a,b,q){b=b.newLayout().vec3f(q.VertexAttribute.POSITION).vec2i16(q.VertexAttribute.UV0).vec2i16(q.VertexAttribute.NORMALCOMPRESSED,{glNormalized:!0});a.terrainAttributesLayout=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileRenderer":function(){define("exports ../../../core/has ../../../core/maybe ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../layers/support/layerUtils ./BlendLayersTechnique ./interfaces ./LayerClass ./NeighborIndex ./TerrainData ./terrainUtils ./TextureFader ./TextureReference ./TileCompositor ./TileRenderInfo ./TileTexture ./TileUpdate ../webgl-engine/core/shaderLibrary/output/BlendOptions ../webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput ../webgl-engine/lib/glUtil3D ../../webgl/enums ../../webgl/Texture ../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){function C(M,K,J){O.layerIndex=K;O.vtlNeighborInfos.clear();const R=M.layerInfo[c.LayerClass.MAP][K];l.set(O.offset,0,0);O.tile=M;O.scale=1;O.sourceLod=M.lij;O.sourceLayerInfo=R;O.isVTLBackground=J;if(R.data)return J&&M.forEachLoadedNeighbor((W,S)=>{if(W.level===M.level){var V=W.layerInfo[c.LayerClass.MAP][K];if(d.isVectorTilePerLayerInfo(V)&&R.data!==V.data){var T=O.vtlNeighborInfos.pushNew();T.offset=P[S];T.sourceLod=W.lij;T.sourceLayerInfo= V}}}),O;const Q=R.upsampleInfo;return Q?(J=Q.tile.layerInfo[c.LayerClass.MAP][K],O.tile=Q.tile,l.copy(O.offset,Q.offset),O.scale=Q.scale,O.sourceLod=Q.tile.lij,O.sourceLayerInfo=J,O):J?O:null}function D(M){M=M.sourceLayerInfo.data;return M.source?"nearest"===M.interpolation:!1}function F(M){let K="normal"!==M.blendMode;k.isGroupLayer(M.parent)&&(K=F(M.parent)||K);return K}function H(M,K){k.isGroupLayer(M.parent)&&H(M.parent,K);const J=M.uid;if(null!=J&&""!==J){const R=G.get(J);R?R.start=K:G.set(J, new N(K,K,M.blendMode,M.opacity,x.BlendLayersOutput.Composite,1))}}class N{constructor(M,K,J,R,Q,W){this.start=M;this.end=K;this.blendMode=J;this.opacity=R;this.output=Q;this.baseOpacity=W}}class E{constructor(M,K,J,R){this._rctx=M;this.tileSize=K;this._techniques=J;this._cache=R;this._passParameters=new h.BlendLayersPassParameters;this._backgroundColor=this._backgroundTexture=null;this._backgroundDirty=!1;this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy;this._compositor=new v.TileCompositor(this._rctx, this._techniques);this._ensureBackgroundTexture(this.tileSize)}dispose(){this._compositor=q.disposeMaybe(this._compositor);this._backgroundTexture=q.releaseMaybe(this._backgroundTexture)}get backgroundIsGrid(){return null==this._backgroundColor}get backgroundColor(){return this._backgroundColor}updateHeading(M){this._compositor?.updateHeading(M)}updateTileTexture(M,K){if(M.renderData){var J=M.surface,R=J.baseOpacity,Q=0,W=0,S=this.tileSize,V=!1,T=!1,Y=J.view.state.contentPixelRatio,ha=!1;G.clear(); I.length=0;for(var ba=M.layerInfo[c.LayerClass.MAP],U=0,Z=null;U{ja.start===ia&&(ja.output=R?x.BlendLayersOutput.Composite:S&&fa?this.backgroundIsGrid?x.BlendLayersOutput.GridComposite:x.BlendLayersOutput.ColorComposite:x.BlendLayersOutput.Composite,ja.baseOpacity=fa?Y:1,I.push(ja),this._compositor.openGroup(Q),X=!0)});var ea=0===Z;ea=X?x.BlendLayersOutput.GroupBackgroundComposite:S&&ea?this.backgroundIsGrid?x.BlendLayersOutput.GridComposite: x.BlendLayersOutput.ColorComposite:x.BlendLayersOutput.Composite;J=u.blendModeFromString[d.isBlendableLayerView(J)?J.layer.blendMode:"normal"];this._passParameters.baseOpacity=fa&&!X&&1>Y?Y:1;this._passParameters.opacity=ka;d.isVectorTileRenderInfo(ca)?U=this._compositor.drawVectorData(this._passParameters,ea,Q,J,ca,W,this.tileSize,U):d.isImageryTileRenderInfo(ca)?(this._compositor.drawRasterData(this._passParameters,ea,Q,J,ca),D(ca)&&(ba=z.TextureSamplingMode.NEAREST)):this._dataToTexture(ca)&&(this._passParameters.texture= ca.sourceLayerInfo.data.texture,this._passParameters.offset=ca.offset,this._passParameters.scale=ca.scale,this._compositor.drawImageData(this._passParameters,ea,Q,J));for(;0 Y;T=M.ensureTexture(Q,da,()=>this._buildTexture(Q,da,ba));this._compositor.copyFBOToTexture(T);this._compositor.unbind();M.setTextureReference(new w.TextureReference(T,K,L,ha?1:Y,0,1))}_dataToTexture(M){if(d.isImageSourceRenderInfo(M)){const K=M.sourceLayerInfo;K.data=this._buildTexture(K.data,!0);M.tile.setMemoryDirty()}return d.isTextureTileRenderInfo(M)}setBackground(M){this._backgroundColor!==M&&(this._backgroundColor=M,this._backgroundDirty=!0)}_buildTexture(M,K,J=z.TextureSamplingMode.LINEAR_MIPMAP_LINEAR){if(null== M)return null;const R=new B.TextureDescriptor;R.wrapMode=z.TextureWrapMode.CLAMP_TO_EDGE;R.samplingMode=J;R.maxAnisotropy=this._maxAnisotropy;R.preMultiplyAlpha=!0;R.flipped=!0;R.hasMipmap=!0;K||(R.pixelFormat=z.PixelFormat.RGB);K=this._rctx;let Q;if("number"===typeof M)R.width=R.height=M,Q=this._buildTileTexture(R,M);else if(g.isImageWithType(M))R.isOpaque=M.isOpaque,R.isOpaque&&(R.pixelFormat=z.PixelFormat.RGB),Q=this._buildTileTexture(R,M.element.width,M.element);else try{R.width=M.width,R.height= M.height,Q=this._buildTileTexture(R,M.width,M)}catch(W){Q=new r(y.createEmptyTexture(K)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}M=K.bindTexture(Q.texture,A.Texture.TEXTURE_UNIT_FOR_UPDATES);Q.generateMipmap();K.bindTexture(M,A.Texture.TEXTURE_UNIT_FOR_UPDATES);return Q}_buildTileTexture(M,K,J){K=this._cache.pop(`${K} ${M.pixelFormat}`);if(!K)return new r(new A.Texture(this._rctx,M,J),this._cache);K.retain();K.texture.setData(J);return K}get test(){}} const G=new Map,I=[],O=new m.TileRenderInfo,L={offset:[0,0],scale:1},P=[];P[e.NeighborIndex.NORTH]=[0,-1];P[e.NeighborIndex.NORTH_EAST]=[-1,-1];P[e.NeighborIndex.EAST]=[-1,0];P[e.NeighborIndex.SOUTH_EAST]=[-1,1];P[e.NeighborIndex.SOUTH]=[0,1];P[e.NeighborIndex.SOUTH_WEST]=[1,1];P[e.NeighborIndex.WEST]=[1,0];P[e.NeighborIndex.NORTH_WEST]=[1,-1];a.GroupInfo=N;a.TileRenderer=E;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/BlendLayersTechnique":function(){define("require exports ../../../chunks/tslib.es6 ../../../core/libs/gl-matrix-2/factories/vec3f64 ./TileBlendTechniqueConfiguration ../webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl ../../../chunks/BlendLayers.glsl ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){class v extends k.TileCompositePassParameters{constructor(){super(...arguments);this.baseOpacity=this.opacity=1;this.fboTexture=this.texture=null;this.backgroundColor=l.ZEROS}}class m extends c.ShaderTechnique{initializeProgram(n){return new d.Program(n.rctx,m.shader.get().build(this.configuration),g.Default3D)}initializePipeline(){return w.makePipelineState({blending:w.simpleBlendingParams(t.BlendFactor.ONE,t.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:w.defaultColorWriteParams})}} m.shader=new f.ReloadableShaderModule(h.BlendLayers,()=>new Promise((n,u)=>a(["../webgl-engine/core/shaderLibrary/util/BlendLayers.glsl"],n,u)));class r extends p.TileBlendTechniqueConfiguration{constructor(){super(...arguments);this.background=h.BackgroundMode.BelowLayer}}q.__decorate([e.parameter()],r.prototype,"background",void 0);b.BlendLayersPassParameters=v;b.BlendLayersTechnique=m;b.BlendLayersTechniqueConfiguration=r;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileBlendTechniqueConfiguration":function(){define("exports ../../../chunks/tslib.es6 ./BlendModeTechniqueConfiguration ../webgl-engine/core/shaderLibrary/terrain/BaseOpacityMode ../webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput ../webgl-engine/core/shaderLibrary/terrain/PremultipliedAlphaSource ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration".split(" "), function(a,b,q,l,p,k,h){class f extends q.BlendModeTechniqueConfiguration{constructor(){super(...arguments);this.output=p.BlendLayersOutput.Composite;this.baseOpacityMode=l.BaseOpacityMode.NotRequired;this.premultipliedSource=k.PremultipliedAlphaSource.Off}}b.__decorate([h.parameter({count:p.BlendLayersOutput.COUNT})],f.prototype,"output",void 0);b.__decorate([h.parameter({count:l.BaseOpacityMode.COUNT})],f.prototype,"baseOpacityMode",void 0);b.__decorate([h.parameter()],f.prototype,"premultipliedSource", void 0);a.TileBlendTechniqueConfiguration=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/BlendModeTechniqueConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderLibrary/output/BlendOptions","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q,l){class p extends l.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.blendMode=q.LayerBlendMode.Normal}}b.__decorate([l.parameter({count:q.LayerBlendMode.COUNT})], p.prototype,"blendMode",void 0);a.BlendModeTechniqueConfiguration=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/output/BlendOptions":function(){define(["exports"],function(a){a.LayerBlendMode=void 0;(function(b){b[b.Normal=0]="Normal";b[b.Average=1]="Average";b[b.Lighten=2]="Lighten";b[b.Lighter=3]="Lighter";b[b.Plus=4]="Plus";b[b.Screen=5]="Screen";b[b.ColorDodge=6]="ColorDodge";b[b.Darken=7]="Darken";b[b.Multiply=8]="Multiply";b[b.ColorBurn= 9]="ColorBurn";b[b.Overlay=10]="Overlay";b[b.SoftLight=11]="SoftLight";b[b.HardLight=12]="HardLight";b[b.VividLight=13]="VividLight";b[b.Hue=14]="Hue";b[b.Saturation=15]="Saturation";b[b.Luminosity=16]="Luminosity";b[b.Color=17]="Color";b[b.DestinationOver=18]="DestinationOver";b[b.DestinationAtop=19]="DestinationAtop";b[b.DestinationIn=20]="DestinationIn";b[b.DestinationOut=21]="DestinationOut";b[b.SourceAtop=22]="SourceAtop";b[b.SourceIn=23]="SourceIn";b[b.SourceOut=24]="SourceOut";b[b.Xor=25]= "Xor";b[b.Difference=26]="Difference";b[b.Exclusion=27]="Exclusion";b[b.Minus=28]="Minus";b[b.Invert=29]="Invert";b[b.Reflect=30]="Reflect";b[b.COUNT=31]="COUNT"})(a.LayerBlendMode||(a.LayerBlendMode={}));a.blendModeFromString={normal:a.LayerBlendMode.Normal,average:a.LayerBlendMode.Average,lighten:a.LayerBlendMode.Lighten,lighter:a.LayerBlendMode.Lighter,screen:a.LayerBlendMode.Screen,plus:a.LayerBlendMode.Plus,"color-dodge":a.LayerBlendMode.ColorDodge,darken:a.LayerBlendMode.Darken,multiply:a.LayerBlendMode.Multiply, "color-burn":a.LayerBlendMode.ColorBurn,overlay:a.LayerBlendMode.Overlay,"soft-light":a.LayerBlendMode.SoftLight,"hard-light":a.LayerBlendMode.HardLight,"vivid-light":a.LayerBlendMode.VividLight,hue:a.LayerBlendMode.Hue,saturation:a.LayerBlendMode.Saturation,luminosity:a.LayerBlendMode.Luminosity,color:a.LayerBlendMode.Color,difference:a.LayerBlendMode.Difference,exclusion:a.LayerBlendMode.Exclusion,minus:a.LayerBlendMode.Minus,invert:a.LayerBlendMode.Invert,reflect:a.LayerBlendMode.Reflect,"destination-over":a.LayerBlendMode.DestinationOver, "destination-atop":a.LayerBlendMode.DestinationAtop,"destination-in":a.LayerBlendMode.DestinationIn,"destination-out":a.LayerBlendMode.DestinationOut,"source-atop":a.LayerBlendMode.SourceAtop,"source-in":a.LayerBlendMode.SourceIn,"source-out":a.LayerBlendMode.SourceOut,xor:a.LayerBlendMode.Xor};a.isCompositeBlendMode=function(b){return b===a.LayerBlendMode.DestinationOver||b===a.LayerBlendMode.DestinationAtop||b===a.LayerBlendMode.DestinationIn||b===a.LayerBlendMode.DestinationOut||b===a.LayerBlendMode.SourceAtop|| b===a.LayerBlendMode.SourceIn||b===a.LayerBlendMode.SourceOut||b===a.LayerBlendMode.Xor};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/BaseOpacityMode":function(){define(["exports"],function(a){a.BaseOpacityMode=void 0;var b=a.BaseOpacityMode||(a.BaseOpacityMode={});b[b.NotRequired=0]="NotRequired";b[b.Required=1]="Required";b[b.COUNT=2]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput":function(){define(["exports"], function(a){a.BlendLayersOutput=void 0;var b=a.BlendLayersOutput||(a.BlendLayersOutput={});b[b.Composite=0]="Composite";b[b.ColorComposite=1]="ColorComposite";b[b.GridComposite=2]="GridComposite";b[b.GroupBackgroundComposite=3]="GroupBackgroundComposite";b[b.COUNT=4]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/PremultipliedAlphaSource":function(){define(["exports"],function(a){a.PremultipliedAlphaSource=void 0;var b= a.PremultipliedAlphaSource||(a.PremultipliedAlphaSource={});b[b.Off=0]="Off";b[b.On=1]="On";b[b.COUNT=2]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../shaderModules/Float2PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute".split(" "),function(a,b,q,l, p,k){class h extends p.NoParameters{constructor(){super(...arguments);this.scale=1;this.offset=b.ZEROS}}a.TileComposite=function(f){f.attributes.add(k.VertexAttribute.POSITION,"vec2");f.attributes.add(k.VertexAttribute.UV0,"vec2");f.varyings.add("uv","vec2");f.varyings.add("vuv","vec2");f.vertex.uniforms.add(new l.FloatPassUniform("scale",c=>c.scale),new q.Float2PassUniform("offset",c=>c.offset)).code.add(p.glsl`void main(void) { gl_Position = vec4(position, 0.0, 1.0); uv = uv0 * scale + offset; vuv = uv0; }`)};a.TileCompositePassParameters=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/BlendLayers.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/terrain/BackgroundGrid.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput ../views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(t){const w=new c.ShaderBuilder,v=w.fragment;w.include(p.TileComposite);if(t.background===a.BackgroundMode.Only)return(t=t.output===q.BlendLayersOutput.ColorComposite)?v.uniforms.add(new k.Float3PassUniform("backgroundColor",m=>m.backgroundColor)):v.include(b.BackgroundGrid),v.code.add(f.glsl` void main() { fragColor = vec4(${t?f.glsl`backgroundColor`:f.glsl`gridColor(uv)`}, 1.0); } `),w;w.include(l.TileBackground,t);v.uniforms.add(new e.Texture2DPassUniform("tex",m=>m.texture),new h.FloatPassUniform("opacity",m=>m.opacity)).code.add(f.glsl`void main() { fragColor = blendLayers(uv, texture(tex, uv), opacity); }`);return w}a.BackgroundMode=void 0;(function(t){t[t.BelowLayer=0]="BelowLayer";t[t.Only=1]="Only";t[t.COUNT=2]="COUNT"})(a.BackgroundMode||(a.BackgroundMode={}));const d=Object.freeze(Object.defineProperty({__proto__:null,get BackgroundMode(){return a.BackgroundMode},build:g},Symbol.toStringTag,{value:"Module"}));a.BlendLayers=d;a.build=g})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../output/BlendOptions ./BackgroundGrid.glsl ./BaseOpacityMode ./BlendLayersOutput ./PremultipliedAlphaSource ../util/BlendModes.glsl ../../shaderModules/Float3PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends g.NoParameters{constructor(){super(...arguments);this.baseOpacity=1;this.backgroundColor=b.ZEROS;this.fboTexture=null}}a.TileBackground=function(w,v){const m=v.output===k.BlendLayersOutput.GridComposite,r=v.output===k.BlendLayersOutput.ColorComposite,n=v.output===k.BlendLayersOutput.GroupBackgroundComposite;var u=v.output===k.BlendLayersOutput.Composite;const x=v.baseOpacityMode===p.BaseOpacityMode.Required;w=w.fragment;x&&w.uniforms.add(new e.FloatPassUniform("baseOpacity", A=>A.baseOpacity));m?w.include(l.BackgroundGrid):r?w.uniforms.add(new c.Float3PassUniform("backgroundColor",A=>A.backgroundColor)):u&&w.uniforms.add(new d.Texture2DPassUniform("fboColor",A=>A.fboTexture));const y=v.blendMode!==q.LayerBlendMode.Normal,z=v.premultipliedSource===h.PremultipliedAlphaSource.On;u=!y&&!z&&(u&&!x||n);w.include(f.BlendModes,v);w.code.add(g.glsl` vec4 getBackground(vec2 uv) { return ${x?g.glsl`baseOpacity *`:""} ${n?g.glsl`vec4(0.0, 0.0, 0.0, 0.0)`:r?g.glsl`vec4(backgroundColor, 1.0)`:m?g.glsl`vec4(gridColor(uv), 1.0)`:g.glsl`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`}; } vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) { ${y?g.glsl` vec3 cl = colorLayer.a == 0.0 ? colorLayer.rgb : colorLayer.rgb / colorLayer.a; vec4 bgColor = getBackground(bgUV); vec3 cb = bgColor.a == 0.0 ? bgColor.rgb : bgColor.rgb / bgColor.a; return applyBlendMode(clamp(cl, vec3(0.0), vec3(1.0)), colorLayer.a * opacity, cb, bgColor.a);`:g.glsl` float composeAlpha = colorLayer.a * opacity; ${u?g.glsl`return colorLayer * opacity;`:g.glsl` vec4 bgColor = getBackground(bgUV); return bgColor * (1.0 - composeAlpha) + colorLayer * opacity;`}`} }`)};a.TileBackgroundPassParameters=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl":function(){define(["exports","../output/BlendOptions","../../shaderModules/interfaces"],function(a,b,q){a.BlendModes=function(l,p){p=p.blendMode;if(p!==b.LayerBlendMode.Normal){p===b.LayerBlendMode.Reflect&&l.code.add(q.glsl`float reflectBlend(in float cb, in float cl) { return (cl == 1.0) ? cl : min(cb * cb / (1.0 - cl), 1.0); }`);p!==b.LayerBlendMode.ColorDodge&&p!==b.LayerBlendMode.VividLight||l.code.add(q.glsl`float colorDodge(in float cb, in float cl) { return (cb == 0.0) ? 0.0 : (cl == 1.0) ? 1.0 : min(1.0, cb / (1.0 - cl)); }`);p!==b.LayerBlendMode.ColorBurn&&p!==b.LayerBlendMode.VividLight||l.code.add(q.glsl`float colorBurn(in float cb, in float cl) { return (cb == 1.0) ? 1.0 : (cl == 0.0) ? 0.0 : 1.0 - min(1.0, (1.0 - cb) / cl); }`);p===b.LayerBlendMode.Overlay&&l.code.add(q.glsl`float overlay(in float cb, in float cl) { return (1.0 - step(0.5, cl)) * (1.0 - 2.0 * (1.0 - cl ) * (1.0 - cb)) + step(0.5, cl) * (2.0 * cl * cb); }`);p===b.LayerBlendMode.HardLight&&l.code.add(q.glsl`float hardLight(in float cb, in float cl) { return (1.0 - step(0.5, cl)) * (2.0 * cl * cb) + step(0.5, cl) * (1.0 - 2.0 * (1.0 - cl) * (1.0 - cb)); }`);p===b.LayerBlendMode.SoftLight&&l.code.add(q.glsl`float softLight(in float cb, in float cl) { if (cl <= 0.5) { return cb - (1.0 - 2.0 * cl) * cb * (1.0 - cb); } if (cb <= 0.25) { return cb + (2.0 * cl - 1.0) * cb * ((16.0 * cb - 12.0) * cb + 3.0); } return cb + (2.0 * cl - 1.0) * (sqrt(cb) - cb); }`);p===b.LayerBlendMode.VividLight&&l.code.add(q.glsl`float vividLight(in float cb, in float cl) { return (1.0 - step(0.5, cl)) * colorBurn(cb, 2.0 * cl) + step(0.5, cl) * colorDodge(cb, (2.0 * (cl - 0.5))); }`);if(p===b.LayerBlendMode.Hue||p===b.LayerBlendMode.Saturation||p===b.LayerBlendMode.Color||p===b.LayerBlendMode.Luminosity)l.code.add(q.glsl`float minv3(in vec3 c) { return min(min(c.r, c.g), c.b); } float maxv3(in vec3 c) { return max(max(c.r, c.g), c.b); } float lumv3(in vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } vec3 clipColor(vec3 color) { float lum = lumv3(color); float mincol = minv3(color); float maxcol = maxv3(color); if (mincol < 0.0) { color = lum + ((color - lum) * lum) / (lum - mincol); } if (maxcol > 1.0) { color = lum + ((color - lum) * (1.0 - lum)) / (maxcol - lum); } return color; } vec3 setLum(vec3 cbase, vec3 clum) { return clipColor(cbase + vec3(lumv3(clum) - lumv3(cbase))); }`),p!==b.LayerBlendMode.Hue&&p!==b.LayerBlendMode.Saturation||l.code.add(q.glsl`float satv3(vec3 c) { return maxv3(c) - minv3(c); } vec3 setLumSat(vec3 cbase, vec3 csat, vec3 clum) { float minbase = minv3(cbase); float sbase = satv3(cbase); float ssat = satv3(csat); return setLum(sbase > 0.0 ? (cbase - minbase) * ssat / sbase : vec3(0.0), clum); }`);l.code.add(q.glsl` vec4 applyBlendMode(vec3 cl, float ol, vec3 cb, float ob) { ${p===b.LayerBlendMode.Multiply?q.glsl`return vec4(cl * ol * cb * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Average?q.glsl`return vec4((cb + cl) * 0.5 * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Lighten?q.glsl`return vec4(max(cb, cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Darken?q.glsl`return vec4(min(cl, cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`: p===b.LayerBlendMode.Lighter?q.glsl`return vec4(cl * ol + cb * ob, ol + ob);`:p===b.LayerBlendMode.Plus?q.glsl`return clamp(vec4(cl.rgb + cb.rgb, ol + ob), 0.0, 1.0);`:p===b.LayerBlendMode.Minus?q.glsl`return vec4(clamp(vec3(cb.rgb - cl.rgb), 0.0, 1.0), ob * ol);`:p===b.LayerBlendMode.Screen?q.glsl`return vec4((cl + cb - cl * cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Difference?q.glsl`return vec4(abs(cb - cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`: p===b.LayerBlendMode.Invert?q.glsl`return vec4((1.0 - cb) * ol * ob + cb * ob * (1.0 - ol), ob);`:p===b.LayerBlendMode.DestinationOver?q.glsl`return vec4(cl * ol * (1.0 - ob) + cb * ob, ol + ob - ol * ob);`:p===b.LayerBlendMode.DestinationAtop?q.glsl`return vec4(cl * ol * (1.0 - ob) + cb * ob * ol, ol);`:p===b.LayerBlendMode.DestinationOut?q.glsl`return vec4(cb * ob * (1.0 - ol), ob * (1.0 - ol));`:p===b.LayerBlendMode.SourceAtop?q.glsl`return vec4(cl * ol * ob + cb * ob * (1.0 - ol), ob);`:p===b.LayerBlendMode.SourceOut? q.glsl`return vec4(cl * ol * (1.0 - ob), ol * (1.0 - ob));`:p===b.LayerBlendMode.Xor?q.glsl`return vec4(cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), ol * (1.0 - ob) + ob * (1.0 - ol));`:p===b.LayerBlendMode.DestinationIn?q.glsl`return vec4(cb * ob * ol, ol * ob);`:p===b.LayerBlendMode.SourceIn?q.glsl`return vec4(cl * ol * ob, ol * ob);`:p===b.LayerBlendMode.Hue?q.glsl` vec3 f = setLumSat(cl, cb, cb); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Saturation?q.glsl` vec3 f = setLumSat(cb, cl, cb); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Color?q.glsl` vec3 f = setLum(cl, cb); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Luminosity?q.glsl` vec3 f = setLum(cb, cl); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Exclusion?q.glsl` vec3 f = cl + cb - 2.0 * cl * cb; return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Reflect?q.glsl` vec3 f = vec3(reflectBlend(cb.r, cl.r), reflectBlend(cb.g, cl.g), reflectBlend(cb.b, cl.b)); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.ColorDodge?q.glsl` vec3 f = vec3(colorDodge(cb.r, cl.r), colorDodge(cb.g, cl.g), colorDodge(cb.b, cl.b)); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.ColorBurn?q.glsl` vec3 f = vec3(colorBurn(cb.r, cl.r), colorBurn(cb.g, cl.g), colorBurn(cb.b, cl.b)); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Overlay?q.glsl` vec3 f = vec3(overlay(cb.r, cl.r), overlay(cb.g, cl.g), overlay(cb.b, cl.b)); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.SoftLight?q.glsl` vec3 f = vec3(softLight(cb.r, cl.r), softLight(cb.g, cl.g), softLight(cb.b, cl.b)); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.HardLight?q.glsl` vec3 f = vec3(hardLight(cb.r, cl.r), hardLight(cb.g, cl.g), hardLight(cb.b, cl.b)); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.VividLight?q.glsl` vec3 f = vec3(vividLight(cb.r, cl.r), vividLight(cb.g, cl.g), vividLight(cb.b, cl.b)); return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:q.glsl``} } `)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TextureReference":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/vec3f64","../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a,b,q){class l{constructor(p,k,h,f,c,e){this.texture=p;this.type=k;p.retain();this.offsetAndScale=q.fromValues(h.offset[0],h.offset[1],h.scale,h.scale);this.opacities=b.fromValues(f,c,e)}destroy(){this.texture.release()}}a.TextureReference=l;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileCompositor":function(){define("exports ../../../core/Logger ../../../core/maybe ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../2d/engine/imagery/enums ../../2d/engine/vectorTiles/VectorTileRendererHelper3D ./BlendLayersTechnique ./LayerClass ./RasterColorizerTechnique ./support/MultiSizeFramebuffer ../webgl-engine/core/shaderLibrary/output/BlendOptions ../webgl-engine/core/shaderLibrary/terrain/BaseOpacityMode ../webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput ../webgl-engine/core/shaderLibrary/terrain/PremultipliedAlphaSource ../../../chunks/BlendLayers.glsl ../webgl-engine/lib/BindParameters ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/glUtil3D ../../webgl/enums ../../webgl/Texture ../../webgl/Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){class z{constructor(A,B){this._rctx=A;this._techniques=B;this._fbos=[];this._vectorTileHelper=new k.VectorTileRendererHelper3D;this._bindParameters=new m.BindParameters(null,null);this._blendLayersTechniqueConfig=new h.BlendLayersTechniqueConfiguration;this._current=0;this._lastUsedIds=[];this._lastCreatedBufferId=0;this._onHoldIds=[];this._vaoQuad=n.createQuadVAO(this._rctx,r.Pos2Tex)}dispose(){this._fbos.forEach(q.disposeMaybe);this._fbos=null; this._vtFBO=q.disposeMaybe(this._vtFBO);this._vaoQuad=q.disposeMaybe(this._vaoQuad);this._vectorTileHelper=q.disposeMaybe(this._vectorTileHelper);this._backgroundTechnique=q.releaseMaybe(this._backgroundTechnique);this._applyOpacityTechnique=q.releaseMaybe(this._applyOpacityTechnique);this._blendLayersTechnique=q.releaseMaybe(this._blendLayersTechnique)}updateHeading(A){this._vectorTileHelper?.updateHeading(A)}_getBlendLayersTechnique(A,B,C,D=w.PremultipliedAlphaSource.Off,F=v.BackgroundMode.BelowLayer){this._blendLayersTechniqueConfig.output= B;this._blendLayersTechniqueConfig.blendMode=A;this._blendLayersTechniqueConfig.baseOpacityMode=C;this._blendLayersTechniqueConfig.premultipliedSource=D;this._blendLayersTechniqueConfig.background=F;return this._blendLayersTechnique=this._techniques.releaseAndAcquire(h.BlendLayersTechnique,this._blendLayersTechniqueConfig,this._blendLayersTechnique)}drawBackground(A,B){B=this._getBlendLayersTechnique(g.LayerBlendMode.Normal,B?t.BlendLayersOutput.ColorComposite:t.BlendLayersOutput.GridComposite,d.BaseOpacityMode.NotRequired, w.PremultipliedAlphaSource.Off,v.BackgroundMode.Only);A=this._rctx.bindTechnique(B,this._bindParameters,A);this._render(A)}_render(A){this._rctx.bindVAO(this._vaoQuad);A.assertCompatibleVertexAttributeLocations(this._vaoQuad);this._rctx.drawArrays(u.PrimitiveType.TRIANGLE_STRIP,0,y.vertexCount(this._vaoQuad,"geometry"))}drawGroup(A,B,C,D,F=w.PremultipliedAlphaSource.On){B===t.BlendLayersOutput.Composite&&(A.fboTexture=this._fbos[this.getLastOnHoldId()].get(C).colorTexture);A.texture=this.currentFBO(C).colorTexture; this.closeGroup(C);B=this._getBlendLayersTechnique(D,B,1>A.baseOpacity?d.BaseOpacityMode.Required:d.BaseOpacityMode.NotRequired,F);A=this._rctx.bindTechnique(B,this._bindParameters,A);this._render(A)}drawImageData(A,B,C,D,F=w.PremultipliedAlphaSource.Off){if(null!=A.texture){var H=1>A.baseOpacity?d.BaseOpacityMode.Required:d.BaseOpacityMode.NotRequired;A.fboTexture=B===t.BlendLayersOutput.GroupBackgroundComposite||D===g.LayerBlendMode.Normal&&H===d.BaseOpacityMode.NotRequired&&F===w.PremultipliedAlphaSource.Off? null:this.switch(C).colorTexture;B=this._getBlendLayersTechnique(D,B,H,F);A=this._rctx.bindTechnique(B,this._bindParameters,A);this._render(A)}}drawRasterData(A,B,C,D,F){var H=F.sourceLayerInfo.data;if(H.source&&(F.tile.surface.layerViewByIndex(F.layerIndex,f.LayerClass.MAP).ensureSymbolizerParameters(H),H.bind(this._rctx))){var N=1>A.baseOpacity?d.BaseOpacityMode.Required:d.BaseOpacityMode.NotRequired;A.fboTexture=D===g.LayerBlendMode.Normal&&N===d.BaseOpacityMode.NotRequired?null:this.switch(C).colorTexture; B=this._getRasterColorizerTechnique(H,B,D,N);H.opacity=A.opacity;H=H.getUniforms();H.scale=F.scale;H.offset=F.offset;H.backgroundColor=A.backgroundColor;H.fboTexture=A.fboTexture;H.baseOpacity=A.baseOpacity;A=this._rctx.bindTechnique(B,null,H);this._render(A)}}_getRasterColorizerTechnique(A,B,C,D){const F=A.symbolizerParameters,H=["stretch","lut","hillshade"].indexOf(F.type);null==this._rasterColorizerConfig&&(this._rasterColorizerConfig=new c.RasterColorizerTechniqueConfiguration,this._rctx.gl.getExtension("WEBGL_color_buffer_float"), this._rctx.gl.getExtension("OES_texture_float"));this._rasterColorizerConfig.output=B;this._rasterColorizerConfig.blendMode=C;this._rasterColorizerConfig.baseOpacityMode=D;this._rasterColorizerConfig.colorizerType=H;this._rasterColorizerConfig.applyColormap=!!F.colormap;this._rasterColorizerConfig.requireBilinearWithNN=A.isBilinearWithStretchColorRamp;this._rasterColorizerConfig.stretchType=A.hasStretchTypeNone()?p.RasterColorizerStretchType.Noop:p.RasterColorizerStretchType.PerBand;return this._rasterColorizerTechnique= this._techniques.releaseAndAcquire(c.RasterColorizerTechnique,this._rasterColorizerConfig,this._rasterColorizerTechnique)}drawVectorData(A,B,C,D,F,H,N,E){const G=this._rctx,I=F.sourceLayerInfo.data,O=F.tile.surface.layerViewByIndex(F.layerIndex,f.LayerClass.MAP);var L=1>A.baseOpacity?d.BaseOpacityMode.Required:d.BaseOpacityMode.NotRequired;const P=L===d.BaseOpacityMode.Required||1>A.opacity||D!==g.LayerBlendMode.Normal||B!==t.BlendLayersOutput.Composite,M=P?w.PremultipliedAlphaSource.On:w.PremultipliedAlphaSource.Off; L=this._getBlendLayersTechnique(D,B,L,M);G.setPipelineState(L.getPipeline());let K=L=null;P?(K=this.currentFBO(C),null==this._vtFBO&&(this._vtFBO=new e.MultiSizeFramebuffer(this._rctx)),L=this._vtFBO.get(C),G.bindFramebuffer(L),this._clearCurrentFBO()):E&&G.clear(u.ClearBufferBit.DEPTH_BUFFER_BIT);try{this._vectorTileHelper.renderBackground(G,F.sourceLod,O.painter,O.layer.styleRepository,O.schemaHelper,Math.round(1/F.scale),F.offset,N,H,O.contentZoom),I&&this._vectorTileHelper.renderContent(G,F.sourceLod, I,F.vtlNeighborInfos,O.painter,O.layer.styleRepository,O.schemaHelper,Math.round(1/F.scale),F.offset,N,H,O.contentZoom)}catch(J){b.getLogger("esri.views.3d.terrain").warnOnce("A render call containing vector tiles did not resolve correctly.",J)}return null!=L?(G.bindFramebuffer(K),A.texture=L.colorTexture,A.offset=l.ZEROS,A.scale=1,this.drawImageData(A,B,C,D,M),E):!0}copyFBOToTexture(A){const B=this._rctx,C=B.bindTexture(A.texture,x.Texture.TEXTURE_UNIT_FOR_UPDATES),D=A.descriptor;B.gl.copyTexImage2D(u.TextureType.TEXTURE_2D, 0,D.pixelFormat,0,0,D.width,D.height,0);A.generateMipmap();B.bindTexture(C,x.Texture.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255);this._rctx.setClearColor(0,0,0,0);this._rctx.setClearDepth(1);this._rctx.setClearStencil(0);this._rctx.clear(u.ClearBufferBit.COLOR_BUFFER_BIT|u.ClearBufferBit.DEPTH_BUFFER_BIT|u.ClearBufferBit.STENCIL_BUFFER_BIT)}_initFBO(A,B,C){this._rctx.bindFramebuffer(A);C&&(this._rctx.setViewport(0,0,B,B),this._clearCurrentFBO())}ensureBuffer(A){this._lastUsedIds.length= 0;this._lastUsedIds.push(1);this._lastCreatedBufferId=1;this._onHoldIds.length=0;this.bind(A)}bind(A,B=0,C=!0){this._current=B;if(B>=this._fbos.length)for(let D=this._fbos.length;D<=B;D++)this._fbos.push(new e.MultiSizeFramebuffer(this._rctx));this._initFBO(this._fbos[B].get(A),A,C)}_bindNextFreeBuffer(A){0this._declutter(N.sourceLayerInfo.data));this._stencilSymbols(m,r,n,u,x,y,z,Math.round(1/A),B,C,D,F);let H=1;n.stencilRef=H++;m.setStencilFunction(t.CompareFunction.EQUAL,n.stencilRef,255);this._render(m,r,n,x,y,z,A,B,C,D,F);u.forAll(N=>{N.sourceLayerInfo.data.stencilRef=H++;this._renderSymbols(m,N.sourceLod,N.sourceLayerInfo.data,x,y,z,Math.round(1/A),N.offset,C,D,F)})}_stencilSymbols(m,r,n,u,x,y,z,A,B,C,D,F){let H=1;n.stencilRef=H++;m.setDepthTestEnabled(!1); m.setDepthWriteEnabled(!1);m.setStencilTestEnabled(!0);m.setBlendingEnabled(!1);m.setColorMask(!1,!1,!1,!1);m.setStencilOp(t.StencilOperation.KEEP,t.StencilOperation.KEEP,t.StencilOperation.REPLACE);m.setStencilWriteMask(255);m.setStencilFunction(t.CompareFunction.ALWAYS,n.stencilRef,255);this._stencilTileSymbols(m,r,n,x,y,z,A,B,C,D,F);for(const N of u.toArray()){const {sourceLod:E,offset:G,sourceLayerInfo:I}=N;I.data.stencilRef=H++;m.setStencilFunction(t.CompareFunction.ALWAYS,I.data.stencilRef, 255);this._stencilTileSymbols(m,E,I.data,x,y,z,A,G,C,D,F)}m.setStencilWriteMask(0);m.setBlendingEnabled(!0);m.setDepthTestEnabled(!0);m.setColorMask(!0,!0,!0,!0)}_renderSymbols(m,r,n,u,x,y,z,A,B,C,D){m.setStencilFunction(t.CompareFunction.EQUAL,n.stencilRef,255);this._render(m,r,n,u,x,y,z,A,B,C,D,e.StyleLayerType.SYMBOL)}_render(m,r,n,u,x,y,z,A,B,C,D,F){this._updateRenderParameters(m,r,n,u,y,z,A,B,C,D);this._renderParams.stencilSymbols=!1;u.drawTile(this._renderParams,n,x,F)}_stencilTileSymbols(m, r,n,u,x,y,z,A,B,C,D){this._updateRenderParameters(m,r,n,u,y,z,A,B,C,D);this._renderParams.stencilSymbols=!0;n.triangleCount=0;u.drawSymbols(this._renderParams,n,x)}_updateRenderParameters(m,r,n,u,x,y,z,A,B,C){"type"in n&&"vector-tile"===n.type&&!n.stage&&n.attachWithContext(m);const D=r[0]-x.getLevelShift(r[0]),F=this._renderParams;F.context=m;F.painter=u;F.glyphMosaic=u.glyphMosaic;F.spriteMosaic=u.spriteMosaic;F.pixelRatio=B*C;F.displayLevel=D;F.requiredLevel=D;m=x.getScale(r[0]);const [H,N]=x.getOffset(r, y*m);r=.125*y*m/A;n=n.transforms.displayViewScreenMat3;n[0]=r;n[4]=-r;n[6]=-1-H-z[0]*y*2;n[7]=1+N+(1-z[1])*y*2-2;y=F.state;A/=C;y.size[0]=A;y.size[1]=A;y.pixelRatio=C;y.rotation=(360-this._heading)%360;C=2/A;b.set(y.displayViewMat3,C,0,0,0,-C,0,-1,1,1);C=b.identity(y.displayMat3);z=l.toRadian(this._heading);b.translate(C,C,[A/2,A/2]);b.rotate(C,C,z);b.translate(C,C,[-A/2,-A/2]);b.multiply(C,y.displayViewMat3,C)}updateHeading(m){this._heading=m}_declutter(m){this._declutteredForHeading.get(m)!==this._heading&& (c.declutterSingleTile(m,(360-this._heading)%360),this._declutteredForHeading.set(m,this._heading))}}class v{constructor(){this.size=[0,0];this.pixelRatio=1;this.rotation=0;this.displayMat3=q.create();this.displayViewMat3=q.create();this.viewMat3=this.viewMat2d=this.inverseTransform=this.transform=null;this.id=0;this.center=this.extent=null;this.scale=1;this.worldScreenWidth=this.resolution=0;this.toJSON=this.copy=this.clone=this.toScreen=this.toMap=this.getScreenTransform=this.viewpoint=this.spatialReference= null}}a.VectorTileRendererHelper3D=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/jobsUtil":function(){define("exports ../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../../../core/libs/gl-matrix-2/math/common ./core ./jobs ./SymbolDeclutterer ./SymbolRepository ./util ../style/StyleDefinition".split(" "),function(a,b,q,l,p,k,h,f,c,e){const g=q.create();a.declutterSingleTile= function(d,t){const w=d.transforms.tileUnitsToPixels;var v=l.toRadian(t);const m=Math.ceil(512*(Math.abs(Math.sin(v))+Math.abs(Math.cos(v))));b.identity(g);b.translate(g,g,[m/2,m/2]);b.rotate(g,g,v);b.translate(g,g,[-256,-256]);b.scale(g,g,[.125,.125,1]);d.transforms.tileUnitsToPixels=g;v=[];const r=new f.SymbolRepository(4096,v,()=>new p.VTLUniqueSymbol),n=new h.SymbolDeclutterer(v,r,(u,x,y)=>new k.CollisionJob(u,x,y,d.styleRepository,d.key.level,t),(u,x)=>{c.writeOpacityToBuffers(u,x,!1)},()=>0, u=>(u=d.styleRepository.getStyleLayerByUID(u).getLayoutProperty("visibility"))&&u.getValue()===e.Visibility.NONE?!1:!0);v.push(d);r.add(d);n.setScreenSize(m,m);n.continue(Infinity);r.removeTile(d);d.transforms.tileUnitsToPixels=w};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/jobs":function(){define(["exports","../../../../../core/libs/gl-matrix-2/factories/mat3f32","./config","./util","../style/StyleDefinition"],function(a,b,q,l,p){class k{constructor(h, f,c,e,g,d){this._symbols=h;this._styleRepository=e;this._zoom=g;this._currentSymbolCursor=this._currentLayerCursor=0;this._styleProps=new Map;this._allNeededMatrices=new Map;this._gridIndex=new l.GridIndex(f,c,q.collisionGridCellSize);this._si=Math.sin(Math.PI*d/180);this._co=Math.cos(Math.PI*d/180);for(const t of h)for(const w of t.symbols)this._allNeededMatrices.has(w.tile)||this._allNeededMatrices.set(w.tile,b.clone(w.tile.transforms.tileUnitsToPixels))}work(h){const f=this._gridIndex,c=performance.now(); for(;this._currentLayerCursorh)return!1;var e=x.symbols[this._currentSymbolCursor];if(!e.unique.show)continue;var g=e,d=this._si,t=this._co,w=this._allNeededMatrices.get(e.tile),v=this._zoom;const {iconRotationAlignment:z, textRotationAlignment:A,iconTranslate:B,iconTranslateAnchor:C,textTranslate:D,textTranslateAnchor:F}=y;var m=0;for(const I of g.colliders){const [O,L]=0===I.partIndex?B:D;var r=0===I.partIndex?C:F,n=I.minLod<=v&&v<=I.maxLod;m+=n?0:1;I.enabled=n;I.xScreen=I.xTile*w[0]+I.yTile*w[3]+w[6];I.yScreen=I.xTile*w[1]+I.yTile*w[4]+w[7];r===p.TranslateAnchor.MAP?(I.xScreen+=t*O-d*L,I.yScreen+=d*O+t*L):(I.xScreen+=O,I.yScreen+=L);p.RotationAlignment.VIEWPORT===(0===I.partIndex?z:A)?(I.dxScreen=I.dxPixels,I.dyScreen= I.dyPixels):(I.dxScreen=t*(I.dxPixels+I.width/2)-d*(I.dyPixels+I.height/2)-I.width/2,I.dyScreen=d*(I.dxPixels+I.width/2)+t*(I.dyPixels+I.height/2)-I.height/2)}0R||mQ)){t=!0;break a}}}t=!1}t&&(I.hard?g.show=!1:d.show=!1)}if(g.show)for(const I of e.colliders){if(!I.enabled)continue;if(I.partIndex?G:N)continue;if(!g.parts[I.partIndex].show)continue;e=I.xScreen+I.dxScreen;d=I.yScreen+I.dyScreen;const [O,L,P,M]=this._gridIndex.getCellSpan(e,d, e+I.width,d+I.height);for(e=L;e<=M;e++)for(d=O;d<=P;d++)this._gridIndex.cells[e][d].push(I)}}}return!0}_getProperties(h){var f=this._styleProps.get(h);if(f)return f;f=this._zoom;const c=this._styleRepository.getStyleLayerByUID(h);var e=c.getLayoutValue("symbol-placement",f)!==p.SymbolPlacement.POINT;let g=c.getLayoutValue("icon-rotation-alignment",f);g===p.RotationAlignment.AUTO&&(g=e?p.RotationAlignment.MAP:p.RotationAlignment.VIEWPORT);let d=c.getLayoutValue("text-rotation-alignment",f);d===p.RotationAlignment.AUTO&& (d=e?p.RotationAlignment.MAP:p.RotationAlignment.VIEWPORT);e=c.getPaintValue("icon-translate",f);const t=c.getPaintValue("icon-translate-anchor",f),w=c.getPaintValue("text-translate",f),v=c.getPaintValue("text-translate-anchor",f);f={iconAllowOverlap:c.getLayoutValue("icon-allow-overlap",f),iconIgnorePlacement:c.getLayoutValue("icon-ignore-placement",f),textAllowOverlap:c.getLayoutValue("text-allow-overlap",f),textIgnorePlacement:c.getLayoutValue("text-ignore-placement",f),iconRotationAlignment:g, textRotationAlignment:d,iconTranslateAnchor:t,iconTranslate:e,textTranslateAnchor:v,textTranslate:w};this._styleProps.set(h,f);return f}}a.CollisionJob=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/style/StyleDefinition":function(){define(["exports","../../../../../symbols/cim/enums"],function(a,b){a.StyleLayerType=void 0;(function(l){l[l.BACKGROUND=0]="BACKGROUND";l[l.FILL=1]="FILL";l[l.LINE=2]="LINE";l[l.SYMBOL=3]="SYMBOL";l[l.CIRCLE=4]="CIRCLE"})(a.StyleLayerType|| (a.StyleLayerType={}));a.Visibility=void 0;(function(l){l[l.VISIBLE=0]="VISIBLE";l[l.NONE=1]="NONE"})(a.Visibility||(a.Visibility={}));a.SymbolPlacement=void 0;(function(l){l[l.POINT=0]="POINT";l[l.LINE=1]="LINE";l[l.LINE_CENTER=2]="LINE_CENTER"})(a.SymbolPlacement||(a.SymbolPlacement={}));a.RotationAlignment=void 0;(function(l){l[l.MAP=0]="MAP";l[l.VIEWPORT=1]="VIEWPORT";l[l.AUTO=2]="AUTO"})(a.RotationAlignment||(a.RotationAlignment={}));a.TextJustification=void 0;(function(l){l[l.AUTO=0]="AUTO"; l[l.LEFT=1]="LEFT";l[l.CENTER=2]="CENTER";l[l.RIGHT=3]="RIGHT"})(a.TextJustification||(a.TextJustification={}));a.SymbolAnchor=void 0;(function(l){l[l.CENTER=0]="CENTER";l[l.LEFT=1]="LEFT";l[l.RIGHT=2]="RIGHT";l[l.TOP=3]="TOP";l[l.BOTTOM=4]="BOTTOM";l[l.TOP_LEFT=5]="TOP_LEFT";l[l.TOP_RIGHT=6]="TOP_RIGHT";l[l.BOTTOM_LEFT=7]="BOTTOM_LEFT";l[l.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"})(a.SymbolAnchor||(a.SymbolAnchor={}));a.TextTransform=void 0;(function(l){l[l.NONE=0]="NONE";l[l.UPPERCASE=1]="UPPERCASE";l[l.LOWERCASE= 2]="LOWERCASE"})(a.TextTransform||(a.TextTransform={}));a.TranslateAnchor=void 0;(function(l){l[l.MAP=0]="MAP";l[l.VIEWPORT=1]="VIEWPORT"})(a.TranslateAnchor||(a.TranslateAnchor={}));a.TextWritingMode=void 0;(function(l){l[l.HORIZONTAL=0]="HORIZONTAL";l[l.VERTICAL=1]="VERTICAL"})(a.TextWritingMode||(a.TextWritingMode={}));class q{}q.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.Visibility.VISIBLE}};q.fillLayoutDefinition={visibility:{type:"enum",values:["visible", "none"],default:a.Visibility.VISIBLE}};q.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.Visibility.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:b.CapType.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:b.JoinType.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}};q.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.Visibility.VISIBLE}, "symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:a.SymbolPlacement.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),default:a.SymbolAnchor.CENTER},"icon-ignore-placement":{type:"boolean",default:!1}, "icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:a.RotationAlignment.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum", values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),default:a.SymbolAnchor.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:a.TextJustification.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0}, "text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:a.RotationAlignment.AUTO},"text-size":{type:"number",minimum:0,default:16}, "text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:a.TextTransform.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[a.TextWritingMode.HORIZONTAL]}};q.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.Visibility.VISIBLE}};q.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}}; q.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP}};q.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color", default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP},"line-width":{type:"number",minimum:0,default:1}};q.symbolPaintDefinition={"icon-color":{type:"color", default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0}, "text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP}};q.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number", minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}};q.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number", minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP}};a.StyleDefinition=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer":function(){define(["exports", "./config"],function(a,b){function q(p,k){if(p.priority-k.priority)return p.priority-k.priority;const h=p.tile.key,f=k.tile.key;return h.world-f.world?h.world-f.world:h.level-f.level?h.level-f.level:h.row-f.row?h.row-f.row:h.col-f.col?h.col-f.col:p.xTile-k.xTile?p.xTile-k.xTile:p.yTile-k.yTile}class l{get running(){return this._running}constructor(p,k,h,f,c,e){this._visibleTiles=p;this._symbolRepository=k;this._createCollisionJob=h;this._assignTileSymbolsOpacity=f;this._symbolLayerSorter=c;this._isLayerVisible= e;this._selectionJob=null;this._selectionJobCompleted=!1;this._collisionJob=null;this._collisionJobCompleted=!1;this._opacityJob=null;this._opacityJobCompleted=!1;this._running=!0}setScreenSize(p,k){this._screenWidth===p&&this._screenHeight===k||this.restart();this._screenWidth=p;this._screenHeight=k}restart(){this._selectionJob=null;this._selectionJobCompleted=!1;this._collisionJob=null;this._collisionJobCompleted=!1;this._opacityJob=null;this._opacityJobCompleted=!1;this._running=!0}continue(p){this._selectionJob|| (this._selectionJob=this._createSelectionJob());if(!this._selectionJobCompleted){var k=performance.now();if(!this._selectionJob.work(p))return!1;this._selectionJobCompleted=!0;p=Math.max(0,p-(performance.now()-k));if(0===p)return!1}this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight));if(!this._collisionJobCompleted){k=performance.now();if(!this._collisionJob.work(p))return!1;this._collisionJobCompleted=!0;p=Math.max(0, p-(performance.now()-k));if(0===p)return!1}this._opacityJob||(this._opacityJob=this._createOpacityJob());if(!this._opacityJobCompleted){k=performance.now();if(!this._opacityJob.work(p))return!1;this._opacityJobCompleted=!0;p=Math.max(0,p-(performance.now()-k));if(0===p)return!1}this._running=!1;return!0}_createSelectionJob(){const p=this._symbolRepository.uniqueSymbols;for(let g=0;gg)return!1;let m=null,r=!1,n=!1;for(const u of t.tileSymbols)if(!n||!r){const x=u.tile;if(!m||x.isCoverage|| x.neededForCoverage&&!r){m=u;if(x.neededForCoverage||x.isCoverage)n=!0;x.isCoverage&&(r=!0)}}m.selectedForRendering=!0;if(n){v.symbols.push(m);t.show=!0;for(const u of t.parts)u.show=!0}else t.show=!1}}for(const w of k)w.symbols.sort(q);return!0},get sortedSymbols(){return k.sort(e)}}}_createOpacityJob(){function p(c,e){var g=c.symbols;for(const [,t]of g){var d=t;g=e;for(const w of d){d=w.unique;for(const v of d.parts)v.startOpacity+=(g-v.startTime)/b.fadeDuration*(.5c)return!1;const g=h[f];if(null!=g.parentTile)continue;const d=performance.now();p(g,d)}return!0}}}}a.SymbolDeclutterer=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/SymbolRepository":function(){define(["exports", "./util"],function(a,b){class q{constructor(l,p,k){this.tileCoordRange=l;this._visibleTiles=p;this._createUnique=k;this._tiles=new Map;this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){null==this._uniqueSymbolLayerArray&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray());return this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(l,p){this._uniqueSymbolLayerArray=null;let k=this._tiles.get(l.id);k||(k={symbols:new Map},this._tiles.set(l.id, k));var h=new Map;if(p)for(var f of p)k.symbols.has(f)&&(h.set(f,k.symbols.get(f)),k.symbols.delete(f));else for(var [c]of l.layerData)k.symbols.has(c)&&(h.set(c,k.symbols.get(c)),k.symbols.delete(c));this._removeSymbols(h);p=l.symbols;h=new Map;for(const [e,g]of p)if(f=g.length,32<=f){c=this.tileCoordRange;do c/=2,f/=4;while(8d.selectedForRendering))&&b.isSearchCircleOverlapingSymbol(c,l,p*(window.devicePixelRatio||1),k)&&h.push({vtlSymbol:c,styleLayerUID:f,tileKey:c.tile.key})}return h}_removeSymbols(l){for(const [k,{flat:h}]of l)for(const f of h){l=f.unique;var p=l.tileSymbols;const c=p.length-1;for(let e= 0;ep.level){var h=l.key.level-p.level;if(l.key.row>>h!==p.row||l.key.col>>h!==p.col)return}if(p.level>l.key.level&&(h=p.level-l.key.level,p.row>>h!==l.key.row||p.col>>h!==l.key.col))return;if(p.equals(l.key))for(var f of l.childrenTiles)this._matchSymbols(f,p,k);else{f=new Map;for(const [g,d]of k){var c=[];for(const w of d)k=b.tileCoordChange(this.tileCoordRange,w.xTile,p.level,p.col,l.key.level,l.key.col), h=b.tileCoordChange(this.tileCoordRange,w.yTile,p.level,p.row,l.key.level,l.key.row),0<=k&&knew Promise((m,r)=>a(["../webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl"],m,r))); class v extends p.TileBlendTechniqueConfiguration{constructor(){super(...arguments);this.colorizerType=l.RasterColorizerType.Stretch;this.stretchType=l.RasterColorizerStretchType.Noop;this.applyColormap=!0;this.requireBilinearWithNN=!1}}q.__decorate([c.parameter({count:l.RasterColorizerType.COUNT})],v.prototype,"colorizerType",void 0);q.__decorate([c.parameter({count:l.RasterColorizerStretchType.COUNT})],v.prototype,"stretchType",void 0);q.__decorate([c.parameter()],v.prototype,"applyColormap",void 0); q.__decorate([c.parameter()],v.prototype,"requireBilinearWithNN",void 0);b.RasterColorizerTechnique=w;b.RasterColorizerTechniqueConfiguration=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/RasterColorizer.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec3f64 ../views/2d/engine/imagery/enums ../views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl ../views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderModules/BooleanPassUniform ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform ../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(B){const C=new v.ShaderBuilder;C.include(h.TileComposite);C.include(p.Common,B);C.include(l.Colormap,B);C.include(k.TileBackground,B);C.fragment.code.add(w.glsl`vec4 applyBackgroundBlend(vec4 layerColor) { return blendLayers(vuv, layerColor, u_opacity); }`);B.colorizerType===q.RasterColorizerType.Stretch?n(C,B):B.colorizerType===q.RasterColorizerType.Lut?C.fragment.code.add(w.glsl`void main() { vec2 pixelLocation = getPixelLocation(uv); if (isOutside(pixelLocation)) { fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); return; } vec4 currentPixel = getPixel(pixelLocation); fragColor = applyBackgroundBlend(colormap(currentPixel, true)); }`):B.colorizerType===q.RasterColorizerType.Hillshade&&u(C,B);return C}function n(B,C){B.fragment.uniforms.add(new t.IntegerPassUniform("u_bandCount",F=>F.symbolizer.u_bandCount),new d.FloatsPassUniform("u_minCutOff",F=>F.symbolizer.u_minCutOff,3),new d.FloatsPassUniform("u_maxCutOff",F=>F.symbolizer.u_maxCutOff,3),new d.FloatsPassUniform("u_factor",F=>F.symbolizer.u_factor,3),new g.FloatPassUniform("u_minOutput",F=>F.symbolizer.u_minOutput),new g.FloatPassUniform("u_maxOutput",F=>F.symbolizer.u_maxOutput), new c.BooleanPassUniform("u_useGamma",F=>F.symbolizer.u_useGamma),new d.FloatsPassUniform("u_gamma",F=>F.symbolizer.u_gamma,3),new d.FloatsPassUniform("u_gammaCorrection",F=>F.symbolizer.u_gammaCorrection,3),new g.FloatPassUniform("u_opacity",F=>F.common.u_opacity));B.fragment.code.add(w.glsl`float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) { if (val >= maxCutOff) { return maxOutput; } else if (val <= minCutOff) { return minOutput; } float stretchedVal; if (useGamma) { float tempf = 1.0; float outRange = maxOutput - minOutput; float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); if (gamma > 1.0) { tempf -= pow(1.0 / outRange, relativeVal * gammaCorrection); } stretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0; } else { stretchedVal = minOutput + (val - minCutOff) * factor; } return stretchedVal; }`);const D=C.applyColormap?w.glsl`fragColor = applyBackgroundBlend(colormap(vec4(grayVal, grayVal, grayVal, currentPixel.a), !u_useGamma));`:w.glsl`fragColor = applyBackgroundBlend(vec4(grayVal, grayVal, grayVal, currentPixel.a));`;B.fragment.code.add(w.glsl` void main() { vec2 pixelLocation = getPixelLocation(uv); if (isOutside(pixelLocation)) { fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); return; } vec4 currentPixel = getPixel(pixelLocation); ${C.stretchType===q.RasterColorizerStretchType.Noop?w.glsl` fragColor = applyBackgroundBlend(currentPixel);`:w.glsl` if (currentPixel.a == 0.0) { fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); return; } if (u_bandCount == 1) { float grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); ${D} } else { float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]); float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]); fragColor = applyBackgroundBlend(vec4(redVal, greenVal, blueVal, currentPixel.a)); }`} }`)}function u(B,C){B=B.fragment;B.uniforms.add(new m.Texture2DPassUniform("u_image",D=>D.u_image),new t.IntegerPassUniform("u_hillshadeType",D=>D.symbolizer.u_hillshadeType),new d.FloatsPassUniform("u_sinZcosAs",D=>D.symbolizer.u_sinZcosAs,6),new d.FloatsPassUniform("u_sinZsinAs",D=>D.symbolizer.u_sinZsinAs,6),new d.FloatsPassUniform("u_cosZs",D=>D.symbolizer.u_cosZs,6),new d.FloatsPassUniform("u_weights",D=>D.symbolizer.u_weights,6),new e.Float2PassUniform("u_factor",D=>D.symbolizer.u_factor), new g.FloatPassUniform("u_minValue",D=>D.symbolizer.u_minValue),new g.FloatPassUniform("u_maxValue",D=>D.symbolizer.u_maxValue),new e.Float2PassUniform("u_srcImageSize",D=>D.common.u_srcImageSize));B.include(f.ColorConversion);B.code.add(w.glsl`vec4 overlay(float val, float minValue, float maxValue, float hillshade, float alpha) { val = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0); vec4 color = colormap(vec4(val, val, val, 1.0), false); vec3 hsv = rgb2hsv(color.rgb); hsv.z = hillshade; return vec4(hsv2rgb(hsv), 1.0) * alpha * color.a; }`);B.code.add(w.glsl`float getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){ if (a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0) { return 0.0; } else { return e; } }`);C=C.applyColormap?w.glsl`fragColor = applyBackgroundBlend(overlay(ve.r, u_minValue, u_maxValue, hillshade, alpha));`:w.glsl`hillshade *= alpha; fragColor = applyBackgroundBlend(vec4(hillshade, hillshade, hillshade, alpha));`;B.code.add(w.glsl` void main() { vec2 pixelLocation = getPixelLocation(uv); if (isOutside(pixelLocation)) { fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); return; } vec4 currentPixel = getPixel(pixelLocation); if (currentPixel.a == 0.0) { fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); return; } //mirror edge pixels vec2 axy = vec2(-1.0, -1.0); vec2 bxy = vec2(0.0, -1.0); vec2 cxy = vec2(1.0, -1.0); vec2 dxy = vec2(-1.0, 0.0); vec2 fxy = vec2(1.0, 0.0); vec2 gxy = vec2(-1.0, 1.0); vec2 hxy = vec2(0.0, 1.0); vec2 ixy = vec2(1.0, 1.0); vec2 onePixel = 1.0 / u_srcImageSize; if (pixelLocation.s < onePixel.s) { axy[0] = 1.0; dxy[0] = 1.0; gxy[0] = 1.0; } if (pixelLocation.t < onePixel.t) { axy[1] = 1.0; bxy[1] = 1.0; cxy[1] = 1.0; } if (pixelLocation.s > 1.0 - onePixel.s) { cxy[0] = -1.0; fxy[0] = -1.0; ixy[0] = -1.0; } if (pixelLocation.t > 1.0 - onePixel.t) { gxy[1] = -1.0; hxy[1] = -1.0; ixy[1] = -1.0; } // calculate hillshade vec4 va = texture(u_image, pixelLocation + onePixel * axy); vec4 vb = texture(u_image, pixelLocation + onePixel * bxy); vec4 vc = texture(u_image, pixelLocation + onePixel * cxy); vec4 vd = texture(u_image, pixelLocation + onePixel * dxy); vec4 ve = texture(u_image, pixelLocation); vec4 vf = texture(u_image, pixelLocation + onePixel * fxy); vec4 vg = texture(u_image, pixelLocation + onePixel * gxy); vec4 vh = texture(u_image, pixelLocation + onePixel * hxy); vec4 vi = texture(u_image, pixelLocation + onePixel * ixy); // calculate the rate of z change along the x, y, and diagonal direction float dzx = (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r * u_factor.s; float dzy = (vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r * u_factor.t; float dzd = sqrt(1.0 + dzx * dzx + dzy * dzy); float hillshade = 0.0; // traditional single light source if (u_hillshadeType == 0){ float cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx; float z = (u_cosZs[0] + cosDelta) / dzd; if (z < 0.0) z = 0.0; hillshade = z; } else { // multi-directional with 6 light sources for (int k = 0; k < 6; k++) { float cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx; float z = (u_cosZs[k] + cosDelta) / dzd; if (z < 0.0) z = 0.0; hillshade = hillshade + z * u_weights[k]; if (k == 5) break; } } // set color float alpha = getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a); alpha *= u_opacity; ${C} } `)}class x extends p.CommonPassParameters{constructor(B,C,D,F,H,N){super(B,F,H);this.colormap=C;this.symbolizer=D;this.u_colormap=N;this.backgroundColor=b.ZEROS;this.fboTexture=null;this.baseOpacity=1}}class y extends x{}class z extends x{}const A=Object.freeze(Object.defineProperty({__proto__:null,ColorizerHillshadeUniforms:z,ColorizerStretchUniforms:y,ColorizerUniforms:x,build:r},Symbol.toStringTag,{value:"Module"}));a.ColorizerHillshadeUniforms=z;a.ColorizerStretchUniforms=y;a.ColorizerUniforms= x;a.RasterColorizer=A;a.build=r})},"esri/views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl":function(){define(["exports","../../shaderModules/FloatPassUniform","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){a.Colormap=function(p){p.fragment.uniforms.add(new l.Texture2DPassUniform("u_colormap",k=>k.u_colormap),new b.FloatPassUniform("u_colormapOffset",k=>k.colormap.u_colormapOffset),new b.FloatPassUniform("u_colormapMaxIndex",k=>k.colormap.u_colormapMaxIndex), new b.FloatPassUniform("u_opacity",k=>k.common.u_opacity));p.fragment.code.add(q.glsl`vec4 colormap(vec4 currentPixel, bool isFloat) { float colorIndex = isFloat ? currentPixel.r - u_colormapOffset : currentPixel.r * 255.0 - u_colormapOffset; vec4 result; if (currentPixel.a == 0.0 || colorIndex > u_colormapMaxIndex) { result = vec4(0.0, 0.0, 0.0, 0.0); } else { vec2 texelCoordinates = vec2((colorIndex + 0.5), 0.5); result = texelFetch(u_colormap, ivec2(texelCoordinates), 0); } return result; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl":function(){define("exports ./Projection.glsl ../terrain/TileComposite.glsl ../../shaderModules/BooleanPassUniform ../../shaderModules/Float2PassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform".split(" "),function(a,b,q,l,p,k,h){class f extends q.TileCompositePassParameters{constructor(c,e,g){super();this.common=c;this.u_image=e;this.u_transformGrid= g}}a.Common=function(c,e){c.include(b.Projection);c.fragment.uniforms.add(new h.Texture2DPassUniform("u_image",g=>g.u_image),new l.BooleanPassUniform("u_flipY",g=>g.common.u_flipY),new l.BooleanPassUniform("u_applyTransform",g=>g.common.u_applyTransform));({requireBilinearWithNN:e}=e);e&&c.fragment.uniforms.add(new p.Float2PassUniform("u_srcImageSize",g=>g.common.u_srcImageSize));c.fragment.code.add(k.glsl`vec2 getPixelLocation(vec2 coords) { vec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords; if (!u_applyTransform) { return targetLocation; } return projectPixelLocation(targetLocation); } bool isOutside(vec2 coords){ if (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) { return true; } else { return false; } }`);e?c.fragment.code.add(k.glsl`vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) { vec2 texelStart = floor(coords * texSize); vec2 coord0 = texelStart / texSize; vec2 coord1 = (texelStart + vec2(1.0, 0.0)) / texSize; vec2 coord2 = (texelStart + vec2(0.0, 1.0)) / texSize; vec2 coord3 = (texelStart + vec2(1.0, 1.0)) / texSize; vec4 color0 = texture(sampler, coord0); vec4 color1 = texture(sampler, coord1); vec4 color2 = texture(sampler, coord2); vec4 color3 = texture(sampler, coord3); vec2 blend = fract(coords * texSize); vec4 color01 = mix(color0, color1, blend.x); vec4 color23 = mix(color2, color3, blend.x); vec4 color = mix(color01, color23, blend.y); float alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5); color = color * alpha + (1.0 - alpha) * texture(sampler, coords); return color; } vec4 getPixel(vec2 pixelLocation) { return sampleBilinear(u_image, pixelLocation, u_srcImageSize); }`):c.fragment.code.add(k.glsl`vec4 getPixel(vec2 pixelLocation) { return texture(u_image, pixelLocation); }`)};a.CommonPassParameters=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl":function(){define(["exports","../../shaderModules/Float2PassUniform","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){a.Projection=function(p){p.fragment.uniforms.add(new l.Texture2DPassUniform("u_transformGrid",k=>k.u_transformGrid),new b.Float2PassUniform("u_transformSpacing",k=>k.common.u_transformSpacing), new b.Float2PassUniform("u_targetImageSize",k=>k.common.u_targetImageSize));p.fragment.code.add(q.glsl`vec2 projectPixelLocation(vec2 coords) { vec2 index_image = floor(coords * u_targetImageSize); vec2 oneTransformPixel = vec2(4.0, 1.0); vec2 index_transform = floor(index_image / u_transformSpacing) * oneTransformPixel; vec2 pos = fract((index_image + 0.5) / u_transformSpacing); vec2 transform_location = index_transform + 0.5; vec2 srcLocation; if (pos.s <= pos.t) { vec3 ll_abc = texelFetch(u_transformGrid, ivec2(transform_location), 0).rgb; vec3 ll_def = texelFetch(u_transformGrid, ivec2(transform_location.s + 1.0, transform_location.t), 0).rgb; srcLocation.s = dot(ll_abc, vec3(pos, 1.0)); srcLocation.t = dot(ll_def, vec3(pos, 1.0)); } else { vec3 ur_abc = texelFetch(u_transformGrid, ivec2(transform_location.s + 2.0, transform_location.t), 0).rgb; vec3 ur_def = texelFetch(u_transformGrid, ivec2(transform_location.s + 3.0, transform_location.t), 0).rgb; srcLocation.s = dot(ur_abc, vec3(pos, 1.0)); srcLocation.t = dot(ur_def, vec3(pos, 1.0)); } return srcLocation; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/support/MultiSizeFramebuffer":function(){define(["exports","../../../webgl/enums","../../../webgl/FramebufferObject","../../../webgl/RenderbufferDescriptor","../../../webgl/TextureDescriptor"],function(a,b,q,l,p){class k{constructor(h){this._rctx=h;this._fbos=new Map}get(h){return this._getPool(h)}dispose(){this._fbos.forEach(h=>h.dispose());this._fbos.clear()}_getPool(h){var f=this._fbos.get(h);if(f)return f; f=new q.FramebufferObject(this._rctx,new p.TextureDescriptor(h),new l.RenderbufferDescriptor(b.RenderbufferFormat.DEPTH24_STENCIL8,h));this._fbos.set(h,f);return f}}a.MultiSizeFramebuffer=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileRenderInfo":function(){define(["exports","../../../core/PooledArray"],function(a,b){class q{constructor(){this.sourceLod=[0,0,0];this.offset=[0,0];this.scale=1;this.layerIndex=0;this.isVTLBackground=!1;this.vtlNeighborInfos= new b({allocator:p=>p||new l})}}class l{constructor(){this.sourceLayerInfo=null;this.sourceLod=[0,0,0];this.offset=[-1,0]}}a.TileRenderInfo=q;a.VTLNeighhborInfo=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileTexture":function(){define(function(){class a{constructor(b,q){this._texture=b;this._cache=q;this.type="tile-texture";this._refCount=1}retain(){++this._refCount}release(){--this._refCount;0===this._refCount&&(this._cache?this._cache.put(`${this._texture.descriptor.width} ${this._texture.descriptor.pixelFormat}`, this):this.dispose())}dispose(){this._texture.dispose()}get texture(){return this._texture}generateMipmap(){this._texture.generateMipmap()}get descriptor(){return this._texture.descriptor}get usedMemory(){return this._texture.usedMemory}}return a})},"esri/views/3d/webgl-engine/collections/Component/ComponentIntersectionData":function(){define(["exports","../../../../../core/mathUtils","../../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../../geometry/support/aaBoundingBox","../../lib/RayIntersections"], function(a,b,q,l,p){function k(r,n,u){let x=0,y=Infinity;for(let A=0;3>A;++A){var z=r[A];if(n[A]=u[A])return!1;x=Math.max(x,(z-n[A])/u[A])}else-1E-6>=u[A]&&(y=Math.min(y,(z-n[A])/u[A]));if(x>y)return!1;z=r[A+3];if(n[A]>z){if(-1E-6<=u[A])return!1;x=Math.max(x,(z-n[A])/u[A])}else 1E-6<=u[A]&&(y=Math.min(y,(z-n[A])/u[A]));if(x>y)return!1}return!0}function h(r,n,u,x,y,z){let A=x;for(;u=z?--A:(r[A-1]= r[B],r[B]=x,++B);return{next:u,mid:B}}function f(r,n,u,x){if(x<=u)return l.fromValues(NaN,NaN,NaN,NaN,NaN,NaN);var y=6*r[u];for(var z=0;3>z;++z)t[z]=n[y+0+z],w[z]=n[y+3+z];for(u+=1;uz;++z)t[z]=Math.min(t[z],n[y+0+z]),w[z]=Math.max(w[z],n[y+3+z]);return l.fromValues(t[0],t[1],t[2],w[0],w[1],w[2])}function c(r){var n=r[3]-r[0];const u=r[4]-r[1],x=r[5]-r[2];n=n>u?n>x?0:u>x?1:2:u>x?1:x>n?2:0;return{axis:n,midValue:(r[n]+r[n+3])/2}}function e(r,n,u,x,y){u-=n;const z=new Float32Array(6* u);for(let B=0;BF;++F){const H=x[C+F],N=x[D+F],E=x[A+F];z[6*B+F]=Math.min(H,N,E);z[6*B+3+F]=Math.max(H,N,E)}}return z}class g{constructor(r,n,u,x,y){this.aabb=r;this.axis=n;this.d=u;this.midStartIndex=x;this.rightStartIndex=y}}class d{constructor(r,n,u,x){this.globalTriangleVertexIndices=r;this.firstTriangleIndex=n;this.positions=x;this._rayDirection=q.create();this._callback=m;this._intersectionOptions=v;this.bspNodeTree=[]; const y=u-n,z=new (255>y?Uint8Array:65535>y?Uint16Array:Uint32Array)(y);this.triangleIndexMap=z;for(let D=0;D{var N=f(z,A,D,F);const E=F-D;if(40>=E)return D=new g(N,void 0,0,D,F),this.bspNodeTree.push(D),D;const {axis:G,midValue:I}=c(N),O=h(z,A,D,F,G,I),L=(P,M)=>{if(!(H>B)){var K=M-P;if(!(40>K||K>=.8*E))return C(P,M,H+1)}};N=new g(N,G,I,O.next,O.mid);this.bspNodeTree.push(N);N.leftNode=L(D,O.next);N.rightNode= L(O.mid,F);return N};C(0,y,0)}intersectRayTriangleRange(r,n){if(!(r>=n)){var u=this.positions;p.intersectRayTriangles(this._rayFrom,this._rayDirection,r,n,this.globalTriangleVertexIndices,u.data,u.stride,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap,this.firstTriangleIndex);d.numFacesTested+=n-r}}intersectRay(r,n,u,x){d.numFacesTested=0;var y=n[0]-r[0];const z=n[1]-r[1];n=n[2]-r[2];1E-6>y*y+z*z+n*n||(this._rayFrom=r,r=this._rayDirection,r[0]=y,r[1]=z,r[2]=n,y=this.triangleIndexMap.length, this._callback=x,this._intersectionOptions=u,this.intersectRayBSP(this.bspNodeTree[0],0,y),this._callback=m,this._intersectionOptions=v)}intersectRayBSP(r,n,u){const x=this._rayFrom,y=this._rayDirection;if(k(r.aabb,x,y)){var z=r.axis,A=r.d;if(x[z]y[z]){const B=r.midStartIndex;if(nA||0{};a.ComponentIntersectionData=d;a.componentMinimalSizeForIntersectionData=200;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../core/shaderLibrary/terrain/Overlay.glsl ../core/shaderLibrary/terrain/TileBlendInput ../core/shaderTechnique/ShaderTechniqueConfiguration ../materials/DefaultTechniqueConfiguration".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g extends e.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.overlayMode=h.OverlayMode.Disabled;this.tileBlendInput=f.TileBlendInput.LayerOnly;this.invisible=this.hasCloudsReflections=this.hasScreenSpaceReflections=this.renderOccluded=this.textureFadingEnabled=this.backfaceCullingEnabled=this.hasSlicePlane=this.receiveShadows=this.doublePrecisionRequiresObfuscation=this.spherical=!1;this.opaque=!0;this.receiveAmbientOcclusion= this.screenSizePerspective=this.visualizeNormals=this.tileBorders=!1;this.pbrMode=k.PBRMode.Simplified}}b.__decorate([c.parameter({count:q.ShaderOutput.COUNT})],g.prototype,"output",void 0);b.__decorate([c.parameter({count:h.OverlayMode.COUNT})],g.prototype,"overlayMode",void 0);b.__decorate([c.parameter({count:f.TileBlendInput.COUNT})],g.prototype,"tileBlendInput",void 0);b.__decorate([c.parameter()],g.prototype,"spherical",void 0);b.__decorate([c.parameter()],g.prototype,"doublePrecisionRequiresObfuscation", void 0);b.__decorate([c.parameter()],g.prototype,"receiveShadows",void 0);b.__decorate([c.parameter()],g.prototype,"hasSlicePlane",void 0);b.__decorate([c.parameter()],g.prototype,"backfaceCullingEnabled",void 0);b.__decorate([c.parameter()],g.prototype,"textureFadingEnabled",void 0);b.__decorate([c.parameter()],g.prototype,"renderOccluded",void 0);b.__decorate([c.parameter()],g.prototype,"hasScreenSpaceReflections",void 0);b.__decorate([c.parameter()],g.prototype,"hasCloudsReflections",void 0);b.__decorate([c.parameter()], g.prototype,"invisible",void 0);b.__decorate([c.parameter()],g.prototype,"opaque",void 0);b.__decorate([c.parameter()],g.prototype,"tileBorders",void 0);b.__decorate([c.parameter()],g.prototype,"visualizeNormals",void 0);b.__decorate([c.parameter()],g.prototype,"screenSizePerspective",void 0);b.__decorate([c.parameter()],g.prototype,"receiveAmbientOcclusion",void 0);b.__decorate([c.parameter({count:k.PBRMode.COUNT})],g.prototype,"pbrMode",void 0);b.__decorate([c.parameter({constValue:l.NormalType.Compressed})], g.prototype,"normalType",void 0);b.__decorate([c.parameter({constValue:p.TextureCoordinateAttributeType.Compressed})],g.prototype,"textureCoordinateType",void 0);b.__decorate([c.parameter({constValue:!1})],g.prototype,"highStepCount",void 0);b.__decorate([c.parameter({constValue:!1})],g.prototype,"useCustomDTRExponentForWater",void 0);b.__decorate([c.parameter({constValue:!1})],g.prototype,"useFillLights",void 0);b.__decorate([c.parameter({constValue:!0})],g.prototype,"hasColorTexture",void 0);a.TerrainTechniqueConfiguration= g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainSurfacePerformanceInfo":function(){define(function(){class a{constructor(){this.numMerged=this.numSplit=this.numRendered=this.numVisible=this.numLeaves=this.numNodes=0;this.numRenderedPerLevel=[];this.numLoadedPerLevel=[]}}return a})},"esri/views/3d/terrain/TilingSchemeLogic":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/aaBoundingRect ../../../layers/support/layerUtils ../../ViewingMode ../support/supportedSpatialReference ./terrainUtils ./TilingScheme".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){a.TilingSchemeLogic=class extends q{constructor(m){super(m)}initialize(){this.addHandles([this.layers.on("change",()=>this._update()),p.watch(()=>this.extentHelper.layerViewsExtent,()=>this._setAdHocTilingScheme())]);this._update();this.tilingSchemeLocked||this._setAdHocTilingScheme()}destroy(){this._waitTask=null;this.layers.destroy()}_update(){this._waitTask=null;if(!this.tilingSchemeLocked){var m;this.layers.some(n=>!g.isTiledLayer(n)||n.isRejected()?!1: n.isFulfilled()&&null==w.getTiledLayerInfo(n,this.viewSpatialReference,this.viewingMode)?!1:(m=n,"vector-tile"!==n?.type&&!w.isProjectableRasterLayer(n)));if(m)if(m.isResolved()){var r=w.getTiledLayerInfo(m,this.viewSpatialReference,this.viewingMode);null!=r&&(r=new v.TilingScheme(r.tileInfo),this._lockTilingScheme(r))}else this._updateWhen(m)}}_updateWhen(m){const r=m.when().catch(()=>{}).then(()=>{r!==this._waitTask||this.destroyed||this._update()});this._waitTask=r}_lockTilingScheme(m){if(this.viewingMode=== d.ViewingMode.Global){const r=m.levels.length-1,n=m.spatialReference;n.isWebMercator?m=v.TilingScheme.makeWebMercatorAuxiliarySphere(r):t.isSupportedEarthGCS(n)&&(m=v.TilingScheme.makeGCSWithTileSize(m.spatialReference,m.pixelSize,r))}this.tilingSchemeLocked=!0;this.tilingScheme=m;this.extentHelper.tilingScheme=this.tilingScheme;this._updateTiledLayerExtent();this.removeAllHandles();this.addHandles(p.watch(()=>this.extentHelper.tiledLayersExtent,()=>this._updateTiledLayerExtent()))}_updateTiledLayerExtent(){this._set("extent", this.extentHelper.tiledLayersExtent)}_setAdHocTilingScheme(){if(this.viewingMode===d.ViewingMode.Global){var m=this.extentHelper.viewSpatialReference;m.isWebMercator?this.tilingScheme=v.TilingScheme.WebMercatorAuxiliarySphere:t.isSupportedGCSOnGlobe(m)&&(this.tilingScheme=v.TilingScheme.makeGCSWithTileSize(m,256));this._set("extent",this.extentHelper.layerViewsExtent)}else m=this.extentHelper.layerViewsExtent,null==m||e.equals(m,this.extent)||(this.tilingScheme=v.TilingScheme.fromExtent(m,this.extentHelper.viewSpatialReference), this._set("extent",m))}get test(){}};b.__decorate([k.property()],a.TilingSchemeLogic.prototype,"tilingScheme",void 0);b.__decorate([k.property({readOnly:!0})],a.TilingSchemeLogic.prototype,"extent",void 0);b.__decorate([k.property({value:!1})],a.TilingSchemeLogic.prototype,"tilingSchemeLocked",void 0);b.__decorate([k.property({constructOnly:!0})],a.TilingSchemeLogic.prototype,"viewSpatialReference",void 0);b.__decorate([k.property({constructOnly:!0})],a.TilingSchemeLogic.prototype,"layers",void 0); b.__decorate([k.property({constructOnly:!0})],a.TilingSchemeLogic.prototype,"extentHelper",void 0);b.__decorate([k.property({constructOnly:!0})],a.TilingSchemeLogic.prototype,"viewingMode",void 0);a.TilingSchemeLogic=b.__decorate([c.subclass("esri.views.3d.terrain.TilingSchemeLogic")],a.TilingSchemeLogic);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/UpsampleInfo":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/vec2f64"],function(a,b){class q{constructor(){this.offset= b.create();this.scale=0;this.tile=null}init(l,p,k,h){this.tile=l;this.offset[0]=p;this.offset[1]=k;this.scale=h}dispose(){this.tile=null;this.offset[0]=0;this.scale=this.offset[1]=0}}a.UpsampleInfo=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/Stage":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/PooledArray ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../state/helpers/SceneIntersectionHelper ./lib/ChangeSet ./lib/UpdatePolicy ./lib/WebGLLayer ./parts/Model ./parts/RenderView ../../support/Scheduler ../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){a.Stage=class extends q{constructor(u){super(u);this._model=new v.Model;this._layers=new p;this._asyncChangeSet=new d.ChangeSet;this._syncChangeSet=new d.ChangeSet;this._layerSyncSet=new Set}initialize(){this._set("renderView",new m.RenderView(this));this._frameTask=this.view.resourceController.scheduler.registerTask(r.TaskPriority.STAGE,this);this.addHandles(this._frameTask)}destroy(){this.renderView.destroy()}get viewingMode(){return this.view.state.viewingMode}get updating(){return this.running|| this.renderView.updating||this._frameTask.updating}get renderer(){return this.renderView?.renderer}add(u){this._model.add(u);w.isWebGLLayer(u)&&this._addLayer(u);this.renderView.requestRender()}remove(u){null!=u&&!this.destroyed&&this._model.remove(u)&&(w.isWebGLLayer(u)&&this._removeLayer(u),this.renderView.requestRender())}addMany(u){null!=u&&(this._model.addMany(u),this.renderView.requestRender())}removeMany(u){null!=u&&(this._model?.removeMany(u),this.renderView?.requestRender())}forEachOfType(u, x){this._model.forEachOfType(u,x)}handleEvent(u,x){this.destroyed||(this._model.dirtySet[u](x),this.renderView.requestRender())}get running(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty}runTask(u){this._frameTask.processQueue(u);this._commit(u);if(!u.hasProgressed)return n.Yield}_commit(u){const x=this._model.dirtySet;this._asyncChangeSet.empty||u.done||(this.renderer.modify(this._asyncChangeSet,u),this.renderView.requestRender(),u.madeProgress());this._layers.forAll(y=>{if(!u.done){var z= this._layerSyncSet.has(y.id)||y.updatePolicy===t.UpdatePolicy.SYNC,A=z?this._syncChangeSet:this._asyncChangeSet;x.commitLayer(y.id,A);this._layerSyncSet.delete(y.id);A.empty||(this.renderer.modify(A,z?r.noBudget:u),this.renderView.requestRender(),u.madeProgress())}});this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,r.noBudget),this.renderView.requestRender(),u.madeProgress());this._layers.forAll(y=>{u.done||this._layerSyncSet.has(y.id)||y.updatePolicy!==t.UpdatePolicy.ASYNC||(x.commitLayer(y.id, this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.modify(this._asyncChangeSet,u),this.renderView.requestRender(),u.madeProgress()))});this._layerSyncSet.clear();this.notifyChange("running")}commitSyncLayers(){const u=this._model.dirtySet;this._layers.forAll(x=>{this._layerSyncSet.has(x.id)||x.updatePolicy===t.UpdatePolicy.SYNC?(u.commitLayer(x.id,this._syncChangeSet),this._layerSyncSet.delete(x.id)):u.commitSyncUpdates(x.id,this._syncChangeSet)});for(const x of this._layerSyncSet)u.commitLayer(x, this._syncChangeSet);this._layerSyncSet.clear();this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,r.noBudget),this.renderView.requestRender())}_commitLayer(u){this._model.dirtySet.commitLayer(u.id,this._syncChangeSet);this._layerSyncSet.delete(u.id);this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,r.noBudget),this.renderView.requestRender())}schedule(u,x){return this._frameTask.schedule(u,x)}reschedule(u,x){return this._frameTask.reschedule(u,x)}syncLayer(u){this._layerSyncSet.add(u); this.renderView.requestRender()}getObject(u){return this._model.getObject(u)}get layers(){return this._layers}_addLayer(u){this._layers.includes(u)||this._layers.push(u)}_removeLayer(u){this._commitLayer(u);null!=this._layers.removeUnordered(u)&&(this._model.dirtySet.getResidentRenderGeometries(u.id,this._syncChangeSet.removes),this.renderer.modify(this._syncChangeSet,r.noBudget))}addRenderPlugin(u,x){x=this.renderer.plugins.add(u,x);const y=()=>{g.isIntersectionHandler(u)&&this.view.sceneIntersectionHelper.addIntersectionHandler(u)}; if(k.isPromiseLike(x))return x.then(y);y()}removeRenderPlugin(u){this.destroyed||(g.isIntersectionHandler(u)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(u),this.renderer.plugins.remove(u))}get performanceInfo(){return this._model.getStats()}get test(){}};a.Stage.DebugSettings={endFrameContentValidation:!1};b.__decorate([h.property({constructOnly:!0})],a.Stage.prototype,"view",void 0);b.__decorate([h.property({constructOnly:!0})],a.Stage.prototype,"options",void 0);b.__decorate([h.property({readOnly:!0})], a.Stage.prototype,"viewingMode",null);b.__decorate([h.property({constructOnly:!0})],a.Stage.prototype,"container",void 0);b.__decorate([h.property({readOnly:!0})],a.Stage.prototype,"updating",null);b.__decorate([h.property({constructOnly:!0})],a.Stage.prototype,"_model",void 0);b.__decorate([h.property()],a.Stage.prototype,"renderView",void 0);b.__decorate([h.property({readOnly:!0})],a.Stage.prototype,"renderer",null);b.__decorate([h.property({readOnly:!0})],a.Stage.prototype,"running",null);a.Stage= b.__decorate([e.subclass("esri.views.3d.webgl-engine.Stage")],a.Stage);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/parts/Model":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/sphere ../lib/ContentObjectType ../lib/GridLocalOriginFactory ../lib/ModelDirtySet ../lib/RenderGeometry ../lib/Util ../lib/WebGLLayer".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){a.Model=class extends q{constructor(){super(...arguments);this.dirtySet=new t({model:this});this._content=new Map;this._originFactory=new d.GridLocalOriginFactory(null)}getObject(n){return this._content.get(n)}add(n){const u=n.id;v.assert(!this._content.has(u),"Model/Stage already contains object to be added");this._content.set(u,n);m.isWebGLLayer(n)&&this.dirtySet.layerAdded(n)}remove(n){if(!this._content.has(n.id))return!1;this._content.delete(n.id);m.isWebGLLayer(n)&& this.dirtySet.layerRemoved(n);return!0}addMany(n){for(const u of n)u&&(v.assert(!this._content.has(u.id),"Model/Stage already contains object to be added"),this._content.set(u.id,u))}removeMany(n){for(const u of n)u&&(v.assert(this._content.has(u.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(u.id))}has(n){return this._content.has(n.id)}forEachOfType(n,u){this._content.forEach(x=>{x.type===n&&u(x)})}getRenderGeometry(n,u){const x=new w.RenderGeometry(u,{castShadow:n.castShadow, objectShaderTransformation:n.shaderTransformation});x.transformation=n.getCombinedStaticTransformation(u,r);({localOrigin:n}=u);x.localOrigin=null!=n?n:this._originFactory.getOrigin(e.getCenter(x.boundingSphere));return x}updateRenderGeometryTransformation(n,u,x){if(null==n)return!1;x.transformation=n.getCombinedStaticTransformation(u,r);n=this._originFactory.getOrigin(e.getCenter(x.boundingSphere));return x.localOrigin!==n}getStats(){const n={},u=Array.from(this._content.values());for(let x=0;x< g.ContentObjectType.COUNT;++x)n[x]=u.filter(y=>y.type===x).length;return{contentTypes:n,dirtySet:this.dirtySet.formatDebugInfo()}}get test(){}};b.__decorate([p.property({constructOnly:!0})],a.Model.prototype,"dirtySet",void 0);a.Model=b.__decorate([f.subclass("esri.views.3d.webgl-engine.parts.Model")],a.Model);const r=c.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ModelDirtySet":function(){define("../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/uid ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./ModelDirtyTypes ./Util".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g{constructor(d,t,w,v){this.operation=d;this.geometry=t;this.states=w;this.sync=v}}b=class extends b{constructor(d){super(d);this._residentGeomRecords=new Map;this._dirtyGeomRecords=new Map;this.dirty=!1}commitLayer(d,t){const w=this._dirtyGeomRecords.get(d);w&&(w.forEach((v,m)=>{const r=this._ensureGeomRecord(d,m);v.forEach(({geometry:n,operation:u,states:x},y)=>{let z=!1;if(u===c.DirtyOperation.UPDATE){const A=r.get(y);if(A){if(x&c.DirtyState.TRANSFORMATION){const B= this.model.getObject(m);this.model.updateRenderGeometryTransformation(B,n,A)&&(z=!0)}z||t.updates.push({renderGeometry:A,updateType:x})}else e.assert(!1,"ModelDirtySet.commitLayer: invalid update")}if(u===c.DirtyOperation.REMOVE||z)(x=r.get(y))?(t.removes.push(x),r.delete(y)):u===c.DirtyOperation.REMOVE&&e.assert(!1,"ModelDirtySet.commitLayer: invalid remove");if(u===c.DirtyOperation.ADD||z)u=this.model.getObject(m),null!=u&&(n=this.model.getRenderGeometry(u,n),t.adds.push(n),r.set(y,n))});0===r.size&& this._residentGeomRecords.get(d).delete(m)}),0===this._residentGeomRecords.get(d).size&&this._residentGeomRecords.delete(d),this._dirtyGeomRecords.delete(d),this.dirty=this._hasDirtyGeometryRecords)}commitSyncUpdates(d,t){const w=this._dirtyGeomRecords.get(d);w&&w.forEach((v,m)=>{const r=this._ensureGeomRecord(d,m);v.forEach(({geometry:n,operation:u,states:x,sync:y},z)=>{let A=!1;u===c.DirtyOperation.UPDATE&&y&&((u=r.get(z))?(x&c.DirtyState.TRANSFORMATION&&(y=this.model.getObject(m),this.model.updateRenderGeometryTransformation(y, n,u)&&(A=!0)),A||t.updates.push({renderGeometry:u,updateType:x})):e.assert(!1,"ModelDirtySet.commitSyncUpdates: invalid update"))})})}getResidentRenderGeometries(d,t){(d=this._residentGeomRecords.get(d))&&d.forEach(w=>w.forEach(v=>t.push(v)))}_objectStateChanged(d,t){for(const w of t.geometries)this._updateOrCreateDirtyRecord(t,w,null,c.DirtyOperation.UPDATE,d)}visibilityChanged(d){this._objectStateChanged(c.DirtyState.VISIBILITY,d)}highlightChanged(d){this._objectStateChanged(c.DirtyState.HIGHLIGHT, d)}occlusionChanged(d){this._objectStateChanged(c.DirtyState.OCCLUDEE,d)}attributesChanged({object:d,geometry:t,sync:w}){this._updateOrCreateDirtyRecord(d,t,null,c.DirtyOperation.UPDATE,c.DirtyState.GEOMETRY,w)}layerAdded(d){d.objects.forAll(t=>this._layerObjectAdded(d,t))}layerRemoved(d){d.objects.forAll(t=>this._layerObjectRemoved(d,t))}layerObjectAdded(d){this._layerObjectAdded(d.layer,d.object)}_layerObjectAdded(d,t){d=d.id;for(const w of t.geometries)this._geometryAdded(t,w,d)}layerObjectRemoved(d){this._layerObjectRemoved(d.layer, d.object)}layerObjectsAdded(d){for(const t of d.objects)this._layerObjectAdded(d.layer,t)}layerObjectsRemoved(d){for(const t of d.objects)this._layerObjectRemoved(d.layer,t)}_layerObjectRemoved(d,t){d=d.id;for(const w of t.geometries)this._geometryRemoved(t,w,d)}transformationChanged(d){const t=this._getParentLayerId(d);this._ensureGeomRecord(t,d.id).forEach(w=>{this._updateOrCreateDirtyRecord(d,w.geometry,t,c.DirtyOperation.UPDATE,c.DirtyState.TRANSFORMATION)})}shaderTransformationChanged(d){const t= this._getParentLayerId(d);this._ensureGeomRecord(t,d.id).forEach(w=>{w.objectShaderTransformationChanged(d.shaderTransformation)})}geometryAdded(d){this._geometryAdded(d.object,d.geometry)}_geometryAdded(d,t,w=null){this._updateOrCreateDirtyRecord(d,t,w,c.DirtyOperation.ADD)}geometryRemoved(d){this._geometryRemoved(d.object,d.geometry)}_geometryRemoved(d,t,w=null){this._updateOrCreateDirtyRecord(d,t,w,c.DirtyOperation.REMOVE)}_updateOrCreateDirtyRecord(d,t,w,v,m=c.DirtyState.NONE,r=!1){w=w??this._getParentLayerId(d); const n=t.id;d=this._ensureDirtyRecord(w,d.id);w=d.get(n);let u=!1;w?(t=w.operation,t===c.DirtyOperation.REMOVE&&v===c.DirtyOperation.ADD&&w.states!==c.DirtyState.NONE?w.operation=c.DirtyOperation.UPDATE:t===c.DirtyOperation.REMOVE&&v===c.DirtyOperation.ADD||t===c.DirtyOperation.ADD&&v===c.DirtyOperation.REMOVE?(d.delete(n),u=!0):(t!==c.DirtyOperation.UPDATE||v!==c.DirtyOperation.REMOVE&&v!==c.DirtyOperation.UPDATE?e.assert((t===c.DirtyOperation.REMOVE||t===c.DirtyOperation.ADD)&&v===c.DirtyOperation.UPDATE, "ModelDirtySet.objectGeometryAdded: inconsistent state"):w.operation=v,w.states|=m),w.sync=w.sync||r):d.set(n,new g(v,t,m,r));this.dirty=u?this._hasDirtyGeometryRecords:!0}_ensureGeomRecord(d,t){let w=this._residentGeomRecords.get(d);w||(w=new Map,this._residentGeomRecords.set(d,w));d=w.get(t);d||(d=new Map,w.set(t,d));return d}get _hasDirtyGeometryRecords(){for(const d of this._dirtyGeomRecords.values())for(const t of d.values())if(0{w.forEach((m,r)=>{0{const x=u.operation;n[x]||(n[x]=[]);n[x].push(u.geometry.id)});for(m=0;mS.view.resourceController.memoryController.newCache(Y,ha);if(M.contextCache.enabled){let Y=Q.get(W);if(Y)return Y.configure(V),Y.newCache=T,Y.ref(),Y;Y=new H.RenderingContext(W,V,T);Q.set(W,Y);Y.ref();return Y}return new H.RenderingContext(W,V,T)} a.RenderView=class extends q{constructor(W){super({});this.events=new l;this.waterTextures=new I.WaterTextureRepository;this.objectAndLayerIdRenderHelper=p("enable-feature:objectAndLayerId-rendering")?new D.ObjectAndLayerIdRenderHelper:null;this._idleSuspend=this._needsRender=this._needsUpdate=!0;this._needsWaterReflectionUpdate=!1;this._lastAnimationUpdate=0;this._container=W.container;this._viewingMode=W.viewingMode;try{this._initializeContext(W)}catch(V){console.error("Failed to initialize context", V);return}const {memoryController:S}=W.view.resourceController;this.stippleTextures=G.createStippleTextureRepository(this._rctx,S);this.markerTextures=E.createMarkerTextureRepository(this._rctx,S);this._techniques=new v.ShaderTechniqueRepository({rctx:this._rctx,viewingMode:W.viewingMode,stippleTextures:this.stippleTextures,waterTextures:this.waterTextures,markerTextures:this.markerTextures});this._textures=new N.TextureRepository(W,this._techniques,this._rctx);this.addHandles(this._textures.events.on("changed", V=>this.requestRender(V)));this._materials=new B.GLMaterialRepository(this._textures,this._techniques,()=>this.requestRender(),()=>this.requestRender());this._compositingHelper=new z(this._rctx,this._techniques);this.renderer=new F.Renderer(W,this._materials,this._techniques,this._rctx,this._compositingHelper,V=>this.requestRender(V));this.addHandles([f.watch(()=>W.view.ready,V=>{V&&this._createRenderNodes(W.view,W.viewingMode)},f.initial),f.watch(()=>this.waterTextures?.updating,()=>this.requestRender(), f.initial),f.watch(()=>W.view.qualityProfile,V=>this.renderer?.updateRenderFeatures(V),f.syncAndInitial)]);this._screenshotManager=new P.ScreenshotManager(this._rctx,{renderScene:(V,T,Y,ha)=>this.renderer.render(V,T,Y,ha),requestRenderScene:V=>this.requestRender(V),prepareOverlay:()=>W.options.screenshot.prepareOverlay(),renderOverlay:(V,T,Y)=>W.options.screenshot.renderOverlay(V,T,Y)},V=>this.events.emit("force-camera-for-screenshot",V));this._registerFrameTask(W)}normalizeCtorArgs(){return{}}destroy(){this._container.contains(this._canvas)&& this._container.removeChild(this._canvas);this._frameTask=h.removeMaybe(this._frameTask);this._techniques=h.destroyMaybe(this._techniques);this._componentObjects=h.destroyMaybe(this._componentObjects);this._screenshotManager=h.destroyMaybe(this._screenshotManager);h.destroyMaybe(this.renderer);this._textures=h.destroyMaybe(this._textures);h.destroyMaybe(this.waterTextures);h.destroyMaybe(this.markerTextures);h.destroyMaybe(this.stippleTextures);this._container=this._canvas=null;this._rctx=h.destroyMaybe(this._rctx)}_createRenderNodes(W, S){new x.SSAO({view:W,isEnabled:()=>this.renderer.hasSSAO,techniques:this._techniques});new u.SMAA({view:W,isEnabled:()=>this.renderer.hasSMAA,techniques:this._techniques});new n.MagnifierRenderNode({view:W,techniques:this._techniques});new m.Highlight({view:W,techniques:this._techniques});new r.ShadowHighlight({view:W,viewingMode:S,techniques:this._techniques})}requestRender(W=y.RenderRequestType.UPDATE){this._needsRender=!0;W===y.RenderRequestType.UPDATE&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate|| this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get compositingHelper(){return this._compositingHelper}setIdleSuspend(W){this._idleSuspend!==W&&(this._idleSuspend=W,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(W){return this._screenshotManager.takeScreenshot(W).then(S=>S[0])}takeScreenshotWithOID(W){W.objectAndLayerIdColor= !0;return this._screenshotManager.takeScreenshot(W)}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(W,S,V,T,Y,ha=Y){ha=T.constrainWindowSize(S,V,Y*T.pixelRatio,ha*T.pixelRatio);const ba=this._ensureDepthBuffer(ha);this.renderer.readDepthPixels(ha,ba);Y=Number.MAX_VALUE;for(let U=0;UZ&&Z!==T.nearFar[0]&&Z!==T.nearFar[1]&&(Y=Z)}W&&(W=W.pickDepth(S*T.pixelRatio,V*T.pixelRatio,T),null!=W&&Y>W&&W!==T.nearFar[0]&& W!==T.nearFar[1]&&(Y=W));return Y===Number.MAX_VALUE?void 0:Y}_ensureDepthBuffer(W){W=4*W[2]*W[3];if(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength{V=this.updating;T= this._needsUpdate?y.RenderRequestType.UPDATE:y.RenderRequestType.BACKGROUND;W.commitSyncLayers();var ba=e.Milliseconds(ha-this._lastAnimationUpdate);if(ba>this.renderer.animationTimestep||null!=S.forcedAnimationTime||V||this._needsRender)ba=e.Milliseconds(ba/this.renderer.animationTimeDilation),ba=new C.UpdateParameters(S.camera,ba,S.forcedAnimationTime),this.renderer.updateAnimation(ba)&&this.requestRender(y.RenderRequestType.BACKGROUND),this._lastAnimationUpdate=ha},render:({time:ha})=>{if((this._needsRender|| !this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&0{const ba=new P.ScreenshotContext(S,this.renderer.hasSlicePlane|| this.renderer.hasDecorations||this.renderer.hasHighlights,this.renderer.fboCache);this._textures.update();this._screenshotManager.update(ba,ha)},finish:()=>{Y&&(this.renderer.finish(S.mode===K.RenderState.IDLE?T:y.RenderRequestType.UPDATE),Y=!1)}})}_initializeContext(W){const S=W.options;this._canvas=S.canvas;this._canvas||(this._canvas=document.createElement("canvas"));this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const V=J.createContext(this._canvas,{alpha:S.alpha|| !1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:S.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:S.preserveDrawingBuffer??!1});null==V?k.getLogger(this).error("A WebGL2 context could not be created."):(this._rctx=R(V,W),this._loadShaderOnlyExtensions(),!S.alpha&&this._rctx.contextAttributes.alpha&&k.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&11<=p("safari")&&(this._container.style.backgroundColor= "black"),this._container.appendChild(this._canvas))}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}getObjectAndLayerIdColor(W){return null!=this.objectAndLayerIdRenderHelper?this.objectAndLayerIdRenderHelper.getObjectAndLayerIdColor(W):null}get componentObjectCollection(){null==this._componentObjects&&(this._componentObjects=new w.ComponentObjectCollection(this.renderer.renderPassManager,this._viewingMode));return this._componentObjects}set componentObjectCollection(W){this._componentObjects= W}};b.__decorate([g.property({type:Boolean,readOnly:!0})],a.RenderView.prototype,"updating",null);b.__decorate([g.property()],a.RenderView.prototype,"_rctx",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_container",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_canvas",void 0);b.__decorate([g.property()],a.RenderView.prototype,"stippleTextures",void 0);b.__decorate([g.property()],a.RenderView.prototype,"markerTextures",void 0);b.__decorate([g.property()],a.RenderView.prototype, "waterTextures",void 0);b.__decorate([g.property({readOnly:!0})],a.RenderView.prototype,"objectAndLayerIdRenderHelper",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_textures",void 0);b.__decorate([g.property({readOnly:!0})],a.RenderView.prototype,"renderer",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_screenshotManager",void 0);b.__decorate([g.property()],a.RenderView.prototype,"componentObjectCollection",null);b.__decorate([g.property()],a.RenderView.prototype,"_componentObjects", void 0);b.__decorate([g.property()],a.RenderView.prototype,"_needsUpdate",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_needsWaterReflectionUpdate",void 0);a.RenderView=b.__decorate([t.subclass("esri.views.3d.webgl-engine.parts.RenderView")],a.RenderView);const Q=O.getContextCache();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ComponentObjectCollection":function(){define("exports ../../../../../core/has ../../../../../core/Logger ../../../../../core/PooledArray ../../../../../core/typedArrayUtil ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/aaBoundingBox ../../../../../geometry/support/Indices ../../../../../chunks/vec3 ../../../../../chunks/vec33 ../../../../ViewingMode ../../../layers/support/symbolColorUtils ../../../support/orientedBoundingBox ../../../support/buffer/glUtil ../../../support/buffer/InterleavedLayout ./ComponentData ./ComponentObject ./IntersectionGeometry ./Renderable ./RenderGeometry ./RenderSubmitSystem ./SourceGeometry ./UniformComponentParameters ./Material/ComponentMaterial ./Material/ComponentTechnique ./Material/shader/ComponentData.glsl ../../lib/ComponentUtils ../../lib/Util ../../lib/VertexAttribute ../../lib/verticalOffsetUtils ../../lib/edgeRendering/bufferLayouts ../../lib/edgeRendering/edgeProcessing ../../lib/TextureBackedBuffer/BufferManager ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/VertexArrayObject".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K){function J(V,T){return V===T?C.ComponentParameterSummary.All:0===V?C.ComponentParameterSummary.None:C.ComponentParameterSummary.Some}const R=()=>q.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class Q{constructor(V,T){this._renderManager=V;this._viewingMode=T;this._elevationRangeCacheMax=this._elevationRangeCacheMin=this._elevationRangeCacheVerticalOffset=NaN;this._visible= new l;this._hidden=new l;this._renderSubmit=new z.RenderSubmitSystem(this);this._renderManager.register(this._renderSubmit);this._hasObjectAndLayerId=b("enable-feature:objectAndLayerId-rendering");this._componentBufferManager=new L.BufferManager(V.rctx,2+(this._hasObjectAndLayerId?1:0))}destroy(){N.assert(0===this._hidden.length&&0===this._visible.length,"ObjectCollection should be empty upon disposal");this._componentBufferManager.destroy();this._visible.forAll(V=>V.destroy());this._hidden.forAll(V=> V.destroy());this._visible.clear();this._hidden.clear()}createObject(V){var T=V.geometry;const Y=new r(this._componentBufferManager,c.compactIndices(T.componentOffsets)),ha=this._createRenderable(V,Y);T=new u.IntersectionGeometry(this._viewingMode,T.positionData,Y);V=new n.ComponentObject(V.transform,V.toMapSpace,V.obb.clone(),Y,ha,T);(V.visible?this._visible:this._hidden).push(V);return V}destroyObject(V){(V.visible?this._visible:this._hidden).removeUnordered(V);V.destroy();this._notifyDirty()}setObjectVisibility(V, T){T!==V.visible&&(T?(this._hidden.removeUnordered(V),this._visible.push(V)):(this._visible.removeUnordered(V),this._hidden.push(V)),V.visible=T,this._notifyDirty())}preSubmit(V){const T=V.camera.eye;this.visibleObjects.forAll(Y=>Y.renderable.meta.cameraDepthSquared=k.squaredDistance(T,Y.obb.center))}getMaterial(V){return V.renderable.material}updateMaterial(V,T){V=V.renderable.material;T(V);V.dirty&&this._notifyDirty()}setAllComponentVisibilities(V,T){V.components.visibility.reset(T);V.components.visibilityDirty(); this._notifyDirty()}forEachVisibleComponent(V,T){return V.components.visibility.forEachComponent(T)}getComponentCount(V){const T=V.components.visibility.componentCount;return{visible:T,invisible:V.components.count-T}}setComponentData(V,T){const Y=V.renderable.material,ha=V.components;var ba=ha.materialDataBuffer;const U=ha.materialDataIndices,Z=new B.UniformComponentParameters;ba=ba.textureBuffer;const ca=new Uint8Array(4),ea=new Uint32Array(ca.buffer);let da=0,ia=0,ka=0,fa=ha.verticalOffsets,X=Infinity, ja=-Infinity,la=!1,na=!1,va=0;for(let za=0;zaZ.externalColor[3]);ia+=+(Z.externalColorMixMode===t.ColorMixModeEnum.Replace&&1===Z.externalColor[3]);ka+=+Z.castShadows;t.encodeSymbolColor(Z.externalColor,Z.externalColorMixMode,ca);ca[2]=ca[2]&254|+Z.castShadows;ba.setData(U[za],0,ca[0],ca[1],ca[2],ca[3]);la||=0{ba+=Y[ea]-Y[ca];return!0});const U=p.isArray(V)?Array(ba):2===V?.BYTES_PER_ELEMENT||65536>=ha?new Uint16Array(ba):new Uint32Array(ba);let Z=0;T.forEachComponentRange((ca, ea)=>{ca=Y[ca];for(ea=Y[ea];ca{0q||q>=this._totalCount)return!1;if(this.allVisible())return!0;const l=this._indexRanges;let p=0,k=l.length/2;if(ql[2*k]+l[2*k+1])return!1; for(;0{A(H,D,N?l.transformMat3(w,N,C):null,F)},n,z)}_computePerComponentAabbs(){var m=this._aabb;const r=.5*(m[0]+m[3]),n=.5*(m[1]+m[4]);m=.5*(m[2]+m[5]);const u=this._components.count,x=k.newFloatArray(6* u),y=this._indices,z=this._positions,A=this._components.offsets;let B=0,C=Infinity,D=Infinity,F=Infinity,H=-Infinity,N=-Infinity,E=-Infinity;for(let O=0;O{this._callback(W,S,r,V)};var {vertexData:M,vertexStride:K,indexData:J,_intersectionOptions:R}=this,{normalRequired:Q}=R;if(40{},m=new f.MeshIntersectionOptions;a.ComponentObjectElevationAgnosticComponentBVH=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH":function(){define("exports ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./ElevationAgnosticBVH ../../lib/RayIntersections ../../lib/triangleIntersectionUtils".split(" "), function(a,b,q,l,p,k){function h(e,g,d,t,w,v,m,r,n,u,x,y=null,z=0){0!==r?p.intersectRayTrianglesWithVerticalOffsetENUGlobal(e,g,d,t,w,v,m,r,n,u,x,y,z):p.intersectRayTriangles(e,g,d,t,w,v,m,u,x,y,z)}function f(){}class c{constructor(e,g,d,t,w,v,m,r,n){this.componentIndex=e;this.vertexData=g;this.vertexStride=d;this.indexData=t;this.startTriangleNumber=w;this.endTriangleNumber=v;this.geometryMinZ=m;this.planetCenterZ=r;this.localMode=n;this.maxBspNodeDepth=8;this.minElementCountForBVH=20;this.minBspNodeElementCount= 10;this.rayDirection=q.create();this.ray0=q.create();this.isVerticalRay=!1;this._triangleHitCallback=f;this.totalElevationOffset=0;this.normalRequired=!1;this._bvh=new l.ElevationAgnosticBVH(v-w,this)}getAabbs2D(){return this.localMode?k.generateTriangleAabbsLocal(this.startTriangleNumber,this.endTriangleNumber,this.indexData,this.vertexData,this.vertexStride):k.generateTriangleAabbsGlobal(this.startTriangleNumber,this.endTriangleNumber,this.indexData,this.vertexData,this.vertexStride,this.geometryMinZ, this.planetCenterZ)}get numTriangles(){return this.endTriangleNumber-this.startTriangleNumber}intersectRay(e,g,d,t,w,v){b.copy(this.ray0,e);b.sub(this.rayDirection,g,e);this.isVerticalRay=d;this.totalElevationOffset=t;this.normalRequired=v;this._triangleHitCallback=w;this._bvh.intersectRay(e,g,d);this._triangleHitCallback=f}intersectRange(e,g){h(this.ray0,this.rayDirection,e,g,this.indexData,this.vertexData,this.vertexStride,this.totalElevationOffset,this.planetCenterZ,this.normalRequired,this._triangleHitCallback, this._bvh.elementIndexMap,this.startTriangleNumber)}getTriangleElevationOffset(e){return this.totalElevationOffset}}a.ComponentObjectElevationAgnosticComponentGeometryBVH=c;a.intersectTriangleRangeForComponent=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH":function(){define(["exports","../../../../../core/mathUtils","../../../../../core/libs/gl-matrix-2/factories/vec3f64","../../lib/triangleIntersectionUtils"], function(a,b,q,l){function p(f,c,e,g){f*=4;const d=g[f+0+c];return g[f+2+c]e?1:0}class k{constructor(f,c){this.elementCount=f;this.model=c;this._elementIndexMap=null;this._bspNodes=[];this._generatedBVH=!1;this.localMode=c.localMode;this.planetCenterZ=c.planetCenterZ;this.geometryMinZ=c.geometryMinZ;this.planetCenter=q.fromValues(0,0,this.planetCenterZ);this.maxBspNodeDepth=c.maxBspNodeDepth??8;this.minElementCountForBVH=c.minElementCountForBVH??15;this.minBspNodeElementCount=c.minBspNodeElementCount?? 5}get elementIndexMap(){this._ensureBVH();return this._elementIndexMap}get _skipBVH(){return this.elementCountthis.elementCount||(this._skipBVH?this._intersectRayWithoutBVH(e):this._intersectRayWithBVH(f,c,e))}_intersectRayWithoutBVH(f){this._intersectRange(0,this.elementCount)}_intersectRange(f,c){this.model.intersectRange(f, c)}_intersectRayWithBVH(f,c,e){this._ensureBVH();e?this._intersectGeometryWithBVHVerticalRay(f):this._intersectGeometryWithBVHGeneralRay(f,c)}_intersectGeometryWithBVHVerticalRay(f){let c=f[0];var e=f[1];if(!this.localMode){const {geometryMinZ:d,planetCenterZ:t}=this;e=(d-t)/(f[2]-t);c=f[0]*e;e*=f[1]}({_bspNodes:f}=this);for(var g=0;0<=g;){g=f[g];const {d,dim:t,minIndexIndex:w,minMidIndexIndex:v,maxMidIndexIndex:m,maxIndexIndex:r,aabb2D:n}=g;if(cn[2]||en[3])break;if(-1===t||-1=== g.child0&&-1===g.child1){this._intersectRange(w,r);break}else{this._intersectRange(v,m);const u=(0===t?c:e)-d;if(0>u){if(-1===g.child0){this._intersectRange(w,v);break}g=g.child0}else if(0v)return;e=(1-t)*f[0]+t*c[0];g=(1-t)*f[1]+t*c[1];var m=(1-t)*f[2]+t*c[2];d=(1-v)*f[0]+v*c[0];t=(1-v)*f[1]+v*c[1];f=(1-v)*f[2]+v*c[2];({planetCenterZ:c}=this);w-=c;v=w/(m-c);e*=v;g*=v;w/=f-c;d*=w;t*=w}w=d-e;f=t-g;c=this._bspNodes;let r=1;({aabb2D:t}=c[0]);d=(z,A,B,C)=>{if(Math.abs(A)<1E-5*Math.max(C-B,1))return!1;const D=0B)?(r=Math.max((B-z)/A,r),!0):!1};Math.abs(w)>=Math.abs(f)?d(e,w,t[0],t[2])||d(g,f,t[1],t[3]):d(g,f,t[1],t[3])||d(e,w,t[0],t[2]);t=[0,0,r]; for(d=0;dm)continue;n=c[n];const {minIndexIndex:z,maxIndexIndex:A}=n,{child0:B,child1:C,minMidIndexIndex:D,maxMidIndexIndex:F,aabb2D:H,d:N,dim:E}=n;var u=e+v*w,x=e+m*w;n=Math.min(u,x);u=Math.max(u,x);var y=H[0];x=H[2];if(!(uf)){var c=l.createUintArray(f,f);this._elementIndexMap=c;for(var e=0;e{v.push(x);v.push(y);v.push(z);v.push(0>A?-1:(B?0:1)+2*A)},{maxBspNodeDepth:r,minBspNodeElementCount:n}=this,u=(x,y,z,A,B)=>{const C=d.length;if(!(0=r||y-x=E-H?(H=.5*(F+N),F=0):(H=.5*(H+E),F=1),F={d:H,dim:F}):(H=D[0],N=D[1],E=D[2],G=D[3],E-H>=G-N?(F=0,H=.5*(H+E)):(F=1,H=.5*(N+G)),F={dim:F,d:H});var {d:I,dim:O}=F;H=x;for(F=y;Hp(N,O,I,g)?++H:(--F,c[H]=c[F],c[F]=N);F=H;for(N=y;H=x+n;H=!H&&y>=P+n;if(F||H||0===C)D=new h(x,L,P,y,O,I,D),F&&m(x,L,z+1,C,!0),H&&m(P,y,z+1,C,!1),d.push(D),-1!==A&&(x=d[A],B?x.child0=C:x.child1=C)}};for(m(0,f,0,-1,!1);e>1;u(f,x,y,A,0===z-(A<<1))}this._generatedBVH=!0}}}class h{constructor(f,c,e,g,d,t,w){this.minIndexIndex=f;this.minMidIndexIndex=c;this.maxMidIndexIndex=e;this.maxIndexIndex=g;this.dim=d;this.d=t;this.aabb2D= w;this.child1=this.child0=-1}}a.ElevationAgnosticBVH=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/triangleIntersectionUtils":function(){define(["exports","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q){function l(w,v,m){w=b.dot(w,v)-m;return 1E-5>=Math.abs(w)}function p(w,v,m){const r=q.create(),n=q.create();b.sub(n,v,w);v=q.create();b.sub(v,m,w);b.cross(r,n,v);b.normalize(r,r);return r}function k(w, v,m,r){const n=[v,m,r];v=p(v,m,r);m=b.dot(n[0],v);if(!l(w,v,m))return!1;for(w=0;3>w;++w){v=n[w];var u=n[(w+1)%3];m=n[(w+2)%3];r=q.create();b.sub(r,u,v);b.normalize(r,r);u=q.create();b.sub(u,m,v);const x=b.dot(u,r);u=q.create();b.scaleAndAdd(u,v,r,x);r=q.create();b.sub(r,m,u);b.normalize(r,r);v=b.dot(v,r);if(!(-1E-4<=b.dot(r,u)-v))return!1}return!0}function h(w){const v=q.create();b.sub(v,w[1],w[0]);b.normalize(v,v);const m=q.create();b.sub(m,w[2],w[0]);b.normalize(m,m);w=q.create();b.cross(w,v,m); b.normalize(w,w);return w}function f(w,v,m){const r=q.create();b.sub(r,m,v);b.normalize(r,r);m=q.create();b.sub(m,w,v);w=b.dot(m,r);m=q.create();b.scaleAndAdd(m,v,r,w);return m}function c(w,v,m){const r=q.create();b.sub(r,m,v);const n=b.len(r);b.normalize(r,r);var u=q.create();b.sub(u,w,v);u=b.dot(u,r);if(0>u)return b.dist(v,w);if(u>n)return b.dist(m,w);m=q.create();b.scaleAndAdd(m,v,r,u);return b.dist(m,w)}function e(w,v,m){return b.dot(w,v)-m}function g(w,v,m){const r=q.create(),n=q.create();b.sub(n, v,w);v=q.create();b.sub(v,m,w);b.cross(r,n,v);b.normalize(r,r);w=b.dot(r,w);return{normal:r,d:w}}function d(w,v,m,r){const {normal:n,d:u}=g(v,m,r),x=e(w,n,u),y=q.create();b.scaleAndAdd(y,w,n,-x);return k(y,v,m,r)?x:Math.min(c(w,v,m),c(w,m,r),c(w,r,v))}function t(w){return 128>w?Uint8Array:32768>w?Uint16Array:-2147483648>w?Uint32Array:Array}a.binarySearchSortedArray=function(w,v){var m=w.length;if(0===m)return 0;if(v=w[m-1])return m;let r=0;for(--m;1=w[n]?r=n:m=n}return r};a.calculateNormalFromVertices=h;a.createUintArray=function(w,v){return new (t(w))(v)};a.distancePointLine=function(w,v,m){v=f(w,v,m);return b.dist(v,w)};a.distancePointPlane=e;a.distancePointSegment=c;a.distancePointTriangle=d;a.elevationAlignVertexGlobal=function(w,v,m,r){const [n,u,x]=r??w;m=x-m;v/=Math.sqrt(n*n+u*u+m*m);w[0]+=n*v;w[1]+=u*v;w[2]+=m*v};a.elevationAlignVertexLocal=function(w,v){w[2]+=v};a.generateTriangleAabbsGlobal=function(w,v,m,r,n,u,x){u-=x;v-= w;const y=new Float64Array(4*v);for(let H=0;H=p)return l;null==l&&(l=q());let f=l.data;const c=8*f.BYTES_PER_ELEMENT,e=k/c|0,g=k-c*e,d=f;h=h===l.isVisibleBit;kk.renderable.material.submit(l,p,k))}queryShadowCasterDepthRange(l){return this._objects.visibleObjects.length?b.computeDepthRange(l,this._objects.visibleObjects):null}}a.RenderSubmitSystem=q;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/DepthRange":function(){define("exports ../../../../../core/PooledArray ../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../core/libs/gl-matrix-2/math/quat ../../../../../core/libs/gl-matrix-2/factories/quatf64 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/plane ../../lib/depthRange".split(" "),function(a, b,q,l,p,k,h,f,c,e){function g(H,N,E){return h.set(H,N.data[E],N.data[E+1],N.data[E+2])}function d(H,N){H.push(N[0]);H.push(N[1]);H.push(N[2])}function t(H,N,E,G){p.conjugate(z,H.quaternion);h.sub(A,N,H.center);h.transformQuat(A,A,z);N=H.halfSize;const I=8*((A[0]<-N[0]?-1:A[0]>N[0]?1:0)+3*(A[1]<-N[1]?-1:A[1]>N[1]?1:0)+9*(A[2]<-N[2]?-1:A[2]>N[2]?1:0)+13);N=x[I];if(0===N)return N;q.fromQuat(y,H.quaternion);q.scale(y,y,H.halfSize);const O=(L,P)=>{P=x[I+P+1];h.set(L,((P&1)<<1)-1,(P&2)-1,((P&4)>>1)-1); h.transformMat3(L,L,y);return h.add(L,H.center,L)};E.length=0;d(E,O(B,0));d(E,O(C,1));d(E,O(A,2));d(E,O(D,3));G(E);if(1===N)return N;E.length=0;d(E,B);d(E,D);d(E,O(A,4));d(E,O(F,5));G(E);if(2===N)return N;E.length=0;d(E,B);d(E,F);d(E,O(A,6));d(E,C);G(E);return N}const w=new b({allocator:H=>H||{near:Infinity,far:-Infinity,mask:0,object:null},deallocator:H=>{H.object=null;return H}}),v=e.empty(),m=f.create(),r=f.create(),n=new b({deallocator:null}),u=new b({deallocator:null}),x=(()=>{const H=Array(216); let N=0;const E=G=>{for(let I=0;I{var P=null!=L.offsetObb?L.offsetObb:L.obb;const M=h.dot(h.sub(A,P.center,G),O),K=P.projectedRadius(O);if(!e.within(E,M-K)||!e.within(E,M+K)){a:{var J=0;for(let R=0;4>R;R++){const Q= P.intersectPlane(I[R]);if(0{var M=u;for(var K=0;4>K&&0=S&&(Q.push(m[0]),Q.push(m[1]),Q.push(m[2]));let V=0,T=S;for(V;VT*Y&&(h.lerp(m,r,m,Y/(Y-T)),d(Q,m));0>=Y&&d(Q,r);T=Y;h.copy(m,r)}0>T*S&&(g(r,R,W),h.lerp(m,r,m,S/(S-T)),d(Q,m));J=P;P=M;M=J}for(M=0;Mthis.objectOpacity?N.Transparent:this.componentParameters.opaqueOverride===a.ComponentParameterSummary.All?N.Opaque:1>this.baseColor[3]||this.alphaDiscardMode===C.AlphaDiscardMode.Blend||this.alphaDiscardMode===C.AlphaDiscardMode.MaskBlend?N.Transparent:this.componentParameters.transparent===a.ComponentParameterSummary.None? N.Opaque:this.componentParameters.transparent===a.ComponentParameterSummary.All?N.Transparent:N.OpaqueAndTransparent}}b.__decorate([m.parameter({vectorOps:f.vec4})],H.prototype,"baseColor",void 0);b.__decorate([m.parameter()],H.prototype,"usePBR",void 0);b.__decorate([m.parameter()],H.prototype,"hasParametersFromSource",void 0);b.__decorate([m.parameter({vectorOps:k.vec3})],H.prototype,"mrrFactors",void 0);b.__decorate([m.parameter({vectorOps:k.vec3})],H.prototype,"emissiveFactor",void 0);b.__decorate([m.parameter({dispose:!0})], H.prototype,"baseColorTexture",void 0);b.__decorate([m.parameter({dispose:!0})],H.prototype,"metallicRoughnessTexture",void 0);b.__decorate([m.parameter({dispose:!0})],H.prototype,"emissionTexture",void 0);b.__decorate([m.parameter({dispose:!0})],H.prototype,"occlusionTexture",void 0);b.__decorate([m.parameter({dispose:!0})],H.prototype,"normalTexture",void 0);b.__decorate([m.parameter()],H.prototype,"objectOpacity",void 0);b.__decorate([m.parameterBlock()],H.prototype,"commonMaterialParameters", void 0);b.__decorate([m.parameterBlock()],H.prototype,"componentParameters",void 0);b.__decorate([m.parameter()],H.prototype,"textureAlphaCutoff",void 0);b.__decorate([m.parameter()],H.prototype,"alphaDiscardMode",void 0);b.__decorate([m.parameter()],H.prototype,"isIntegratedMesh",void 0);b.__decorate([m.parameter()],H.prototype,"polygonOffsetEnabled",void 0);b.__decorate([m.parameter()],H.prototype,"ellipsoidMode",void 0);b.__decorate([m.parameter()],H.prototype,"hasOccludees",void 0);var N;(function(O){O[O.Opaque= 0]="Opaque";O[O.Transparent=1]="Transparent";O[O.OpaqueAndTransparent=2]="OpaqueAndTransparent";O[O.IntegratedMesh=3]="IntegratedMesh"})(N||={});class E extends m.MaterialParameterBlock{constructor(){super(...arguments);this.doubleSided=!1;this.cullFace=C.CullFaceOptions.Back;this.hasSlicePlane=!0}}b.__decorate([m.parameter()],E.prototype,"doubleSided",void 0);b.__decorate([m.parameter()],E.prototype,"cullFace",void 0);b.__decorate([m.parameter()],E.prototype,"hasSlicePlane",void 0);class G extends m.MaterialParameterBlock{constructor(){super(...arguments); this.externalColor=c.fromValues(1,1,1,1);this.externalColorMixMode=e.ColorMixModeEnum.Multiply;this.castShadows=a.ComponentParameterSummary.All}get transparent(){return 1>this.externalColor[3]?a.ComponentParameterSummary.All:a.ComponentParameterSummary.None}get opaqueOverride(){return this.externalColorMixMode===e.ColorMixModeEnum.Replace&&1===this.externalColor[3]?a.ComponentParameterSummary.All:a.ComponentParameterSummary.None}get visible(){return 0new Promise((u,x)=>a(["./shader/ComponentShader.glsl"],u,x)));const n=new Map([[w.VertexAttribute.POSITION,0],[w.VertexAttribute.NORMAL,1],[w.VertexAttribute.NORMALCOMPRESSED,1],[w.VertexAttribute.COLOR,2],[w.VertexAttribute.UV0, 3],[w.VertexAttribute.UVREGION,4],[w.VertexAttribute.COMPONENTINDEX,5]]);b.ComponentTechnique=r;b.attributeLocations=n;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration":function(){define("exports ../../../../../../chunks/tslib.es6 ./shader/ComponentData.glsl ./shader/VertexDiscardByOpacity.glsl ../../../core/shaderLibrary/ShaderOutput ../../../core/shaderLibrary/attributes/NormalAttribute.glsl ../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../../../core/shaderLibrary/shading/Normals.glsl ../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../../../core/shaderLibrary/util/EllipsoidMode ../../../core/shaderTechnique/BindType ../../../core/shaderTechnique/ShaderTechniqueConfiguration ../../../lib/basicInterfaces ../../../lib/TransparencyPassType".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.IntegratedMeshMode=void 0;(function(m){m[m.None=0]="None";m[m.NoOverlay=1]="NoOverlay";m[m.ColorOverlay=2]="ColorOverlay";m[m.ColorOverlayWithWater=3]="ColorOverlayWithWater";m[m.COUNT=4]="COUNT"})(a.IntegratedMeshMode||(a.IntegratedMeshMode={}));class v extends d.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.output=p.ShaderOutput.Color;this.textureCoordinateType=h.TextureCoordinateAttributeType.None;this.componentData=q.ComponentDataType.Uniform; this.cullFace=t.CullFaceOptions.Back;this.vertexDiscardMode=l.VertexDiscardMode.None;this.doubleSidedMode=f.NormalsDoubleSidedMode.WindingOrder;this.alphaDiscardMode=t.AlphaDiscardMode.Opaque;this.integratedMeshMode=a.IntegratedMeshMode.None;this.transparencyPassType=w.TransparencyPassType.NONE;this.ellipsoidMode=e.EllipsoidMode.Earth;this.pbrMode=c.PBRMode.Disabled;this.normalType=k.NormalType.Attribute;this.hasColorTexture=this.hasSlicePlane=this.hasNormals=this.hasVertexColors=this.doublePrecisionRequiresObfuscation= this.spherical=!1;this.blendingEnabled=this.receiveShadows=this.receiveAmbientOcclusion=!0;this.hasNormalTextureTransform=this.cullAboveGround=this.multipassEnabled=this.hasOccludees=this.hasNormalTexture=this.hasOcclusionTexture=this.hasEmissionTexture=this.hasMetallicRoughnessTexture=this.hasPolygonOffset=this.hasScreenSpaceReflections=!1;this.hasCloudsReflections=!0;this.objectAndLayerIdColor=this.snowCover=!1}}b.__decorate([d.parameter({count:p.ShaderOutput.COUNT})],v.prototype,"output",void 0); b.__decorate([d.parameter({count:h.TextureCoordinateAttributeType.COUNT})],v.prototype,"textureCoordinateType",void 0);b.__decorate([d.parameter({count:q.ComponentDataType.COUNT})],v.prototype,"componentData",void 0);b.__decorate([d.parameter({count:t.CullFaceOptions.COUNT})],v.prototype,"cullFace",void 0);b.__decorate([d.parameter({count:l.VertexDiscardMode.COUNT})],v.prototype,"vertexDiscardMode",void 0);b.__decorate([d.parameter({count:f.NormalsDoubleSidedMode.COUNT})],v.prototype,"doubleSidedMode", void 0);b.__decorate([d.parameter({count:t.AlphaDiscardMode.COUNT})],v.prototype,"alphaDiscardMode",void 0);b.__decorate([d.parameter({count:a.IntegratedMeshMode.COUNT})],v.prototype,"integratedMeshMode",void 0);b.__decorate([d.parameter({count:w.TransparencyPassType.COUNT})],v.prototype,"transparencyPassType",void 0);b.__decorate([d.parameter({count:e.EllipsoidMode.COUNT})],v.prototype,"ellipsoidMode",void 0);b.__decorate([d.parameter({count:c.PBRMode.COUNT})],v.prototype,"pbrMode",void 0);b.__decorate([d.parameter({count:k.NormalType.COUNT})], v.prototype,"normalType",void 0);b.__decorate([d.parameter()],v.prototype,"spherical",void 0);b.__decorate([d.parameter()],v.prototype,"doublePrecisionRequiresObfuscation",void 0);b.__decorate([d.parameter()],v.prototype,"hasVertexColors",void 0);b.__decorate([d.parameter()],v.prototype,"hasNormals",void 0);b.__decorate([d.parameter()],v.prototype,"hasSlicePlane",void 0);b.__decorate([d.parameter()],v.prototype,"hasColorTexture",void 0);b.__decorate([d.parameter()],v.prototype,"receiveAmbientOcclusion", void 0);b.__decorate([d.parameter()],v.prototype,"receiveShadows",void 0);b.__decorate([d.parameter()],v.prototype,"blendingEnabled",void 0);b.__decorate([d.parameter()],v.prototype,"hasScreenSpaceReflections",void 0);b.__decorate([d.parameter()],v.prototype,"hasPolygonOffset",void 0);b.__decorate([d.parameter()],v.prototype,"hasMetallicRoughnessTexture",void 0);b.__decorate([d.parameter()],v.prototype,"hasEmissionTexture",void 0);b.__decorate([d.parameter()],v.prototype,"hasOcclusionTexture",void 0); b.__decorate([d.parameter()],v.prototype,"hasNormalTexture",void 0);b.__decorate([d.parameter()],v.prototype,"hasOccludees",void 0);b.__decorate([d.parameter()],v.prototype,"multipassEnabled",void 0);b.__decorate([d.parameter()],v.prototype,"cullAboveGround",void 0);b.__decorate([d.parameter()],v.prototype,"hasNormalTextureTransform",void 0);b.__decorate([d.parameter()],v.prototype,"hasCloudsReflections",void 0);b.__decorate([d.parameter()],v.prototype,"snowCover",void 0);b.__decorate([d.parameter()], v.prototype,"objectAndLayerIdColor",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"occlusionPass",void 0);b.__decorate([d.parameter({constValue:g.BindType.Draw})],v.prototype,"pbrTextureBindType",void 0);b.__decorate([d.parameter({constValue:!0})],v.prototype,"hasSliceHighlight",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"hasSliceInVertexProgram",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"useCustomDTRExponentForWater",void 0);b.__decorate([d.parameter({constValue:!1})], v.prototype,"hasVertexTangents",void 0);b.__decorate([d.parameter({constValue:!0})],v.prototype,"supportsTextureAtlas",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"highStepCount",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"instancedDoublePrecision",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"hasModelTransformation",void 0);b.__decorate([d.parameter({constValue:!0})],v.prototype,"useFillLights",void 0);b.__decorate([d.parameter({constValue:!1})], v.prototype,"objectAndLayerIdColorInstanced",void 0);a.ComponentTechniqueConfiguration=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/shader/VertexDiscardByOpacity.glsl":function(){define(["exports","../../../../../../../core/compilerUtils","../../../../core/shaderModules/interfaces"],function(a,b,q){a.VertexDiscardMode=void 0;(function(l){l[l.None=0]="None";l[l.Transparent=1]="Transparent";l[l.Opaque=2]="Opaque";l[l.COUNT= 3]="COUNT"})(a.VertexDiscardMode||(a.VertexDiscardMode={}));a.VertexDiscardByOpacity=function(l,p){l=l.vertex;l.code.add(q.glsl`#define VERTEX_DISCARD_CUTOFF (1.0 - 1.0 / 255.0)`);switch(p.vertexDiscardMode){case a.VertexDiscardMode.None:l.code.add(q.glsl`#define vertexDiscardByOpacity(_opacity_) {}`);break;case a.VertexDiscardMode.Opaque:l.code.add(q.glsl`#define vertexDiscardByOpacity(_opacity_) { if (_opacity_ > VERTEX_DISCARD_CUTOFF) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`); break;case a.VertexDiscardMode.Transparent:l.code.add(q.glsl`#define vertexDiscardByOpacity(_opacity_) { if (_opacity_ <= VERTEX_DISCARD_CUTOFF) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`);break;case a.VertexDiscardMode.COUNT:break;default:b.neverReached(p.vertexDiscardMode)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode":function(){define(["exports","../../../../../../geometry/support/spatialReferenceUtils"], function(a,b){a.EllipsoidMode=void 0;(function(q){q[q.Earth=1]="Earth";q[q.Mars=2]="Mars";q[q.Moon=3]="Moon";q[q.COUNT=4]="COUNT"})(a.EllipsoidMode||(a.EllipsoidMode={}));a.getEllipsoidMode=function(q){return q&&b.isMars(q)?a.EllipsoidMode.Mars:q&&b.isMoon(q)?a.EllipsoidMode.Moon:a.EllipsoidMode.Earth};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ComponentShader.glsl":function(){define("exports ../geometry/support/Ellipsoid ../views/3d/terrain/OverlayContent ../views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration ../views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl ../views/3d/webgl-engine/collections/Component/Material/shader/VertexDiscardByOpacity.glsl ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){function P(K){const J=new I.ShaderBuilder;J.include(w.VertexPosition,K);J.include(t.VertexNormal,K);J.include(d.VertexColor,K);J.include(g.TextureCoordinateAttribute,K);J.include(h.ForwardLinearDepth,K);J.include(p.ComponentData,K);J.include(N.DiscardOrAdjustAlphaDraw,K);J.include(c.SlicePass,K);J.include(C.ReadBaseColorTexture,K);J.include(k.VertexDiscardByOpacity,K);const {vertex:R,fragment:Q}=J;if(K.pbrMode===B.PBRMode.Normal|| K.pbrMode===B.PBRMode.Schematic)J.include(B.PhysicallyBasedRenderingParameters,K),K.hasNormalTexture&&J.include(u.ComputeNormalTexture,K);const W=K.output===f.ShaderOutput.Shadow||K.output===f.ShaderOutput.ShadowHighlight||K.output===f.ShaderOutput.ShadowExcludeHighlight;W&&K.componentData===p.ComponentDataType.Varying?R.code.add(G.glsl`#define discardShadows(castShadows) { if(!castShadows) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`):R.code.add(G.glsl`#define discardShadows(castShadows) {}`); const S=K.integratedMeshMode===l.IntegratedMeshMode.ColorOverlay||K.integratedMeshMode===l.IntegratedMeshMode.ColorOverlayWithWater;var V=S&&K.output===f.ShaderOutput.Color&&K.pbrMode===B.PBRMode.WaterOnIntegratedMesh;S&&(J.include(y.EvaluateSceneLighting,K),J.include(F.OverlayIM,K),K.spherical?R.code.add(G.glsl` const float invEllipsoidRadius = ${G.glsl.float(1/(K.ellipsoidMode===E.EllipsoidMode.Earth?b.earth.radius:K.ellipsoidMode===E.EllipsoidMode.Mars?b.mars.radius:b.moon.radius))}; vec2 projectOverlay(vec3 pos) { return pos.xy / (1.0 + invEllipsoidRadius * pos.z); } `):R.code.add(G.glsl`vec2 projectOverlay(vec3 pos) { return pos.xy; }`));V&&(J.varyings.add("tbnTangent","vec3"),J.varyings.add("tbnBiTangent","vec3"),J.varyings.add("groundNormal","vec3"));R.code.add(G.glsl` void main() { bool castShadows; vec4 externalColor = forwardExternalColor(castShadows); discardShadows(castShadows); vertexDiscardByOpacity(externalColor.a); ${K.output===f.ShaderOutput.ObjectAndLayerIdColor?G.glsl`externalColor.a = 1.0;`:""} if (externalColor.a < ${G.glsl.float(H.symbolAlphaCutoff)}) { // Discard this vertex gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } forwardPosition(readElevationOffset()); forwardNormal(); forwardTextureCoordinates(); forwardVertexColor(); forwardLinearDepth(); ${K.output===f.ShaderOutput.ObjectAndLayerIdColor?G.glsl`forwardObjectAndLayerIdColor();`:""} ${V?K.spherical?G.glsl` groundNormal = normalize(positionWorld()); tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), groundNormal)); tbnBiTangent = normalize(cross(groundNormal, tbnTangent));`:G.glsl` groundNormal = vec3(0.0, 0.0, 1.0); tbnTangent = vec3(1.0, 0.0, 0.0); tbnBiTangent = vec3(0.0, 1.0, 0.0);`:""} ${S?G.glsl`setOverlayVTC(projectOverlay(position));`:""} } `);K.output===f.ShaderOutput.Color&&(Q.include(r.ReadLinearDepth),J.include(A.multipassTerrainTest,K),J.include(n.ComputeMaterialColor,K),J.include(x.ComputeShadingNormal,K),J.include(y.EvaluateSceneLighting,K),K.transparencyPassType===L.TransparencyPassType.ColorAlpha&&(J.outputs.add("fragColor","vec4",0),J.outputs.add("fragAlpha","float",1)),K.receiveShadows?(J.include(D.ReadShadowMapPass,K),Q.code.add(G.glsl`float evaluateShadow() { return readShadowMap(vPositionWorldCameraRelative, linearDepth); }`)):Q.code.add(G.glsl`float evaluateShadow() { return 0.0; }`),S&&Q.uniforms.add(new O.Texture2DPassUniform("ovColorTex",(T,Y)=>F.getIMColorTexture(T,Y))),Q.code.add(G.glsl` void main() { discardBySlice(vPositionWorldCameraRelative); ${K.multipassEnabled?G.glsl`terrainDepthTest(vPosition_view.z);`:""} vec4 textureColor = readBaseColorTexture(); discardOrAdjustAlpha(textureColor); vec4 externalColor; int externalColorMixMode; readExternalColor(externalColor, externalColorMixMode); vec4 materialColor = computeMaterialColor( textureColor, externalColor, externalColorMixMode ); ${S?G.glsl`vec4 overlayColor = getOverlayColor(ovColorTex, vtcOverlay);`:""} `),K.pbrMode===B.PBRMode.Normal||K.pbrMode===B.PBRMode.Schematic?(z.addMainLightIntensity(Q),Q.code.add(G.glsl` ${K.pbrMode===B.PBRMode.Normal?G.glsl` applyPBRFactors(); if (int(externalColorMixMode) == 3) { mrr = vec3(0.0, 0.6, 0.2); }`:""} vec3 normalVertex = shadingNormalWorld(); float additionalIrradiance = 0.02 * mainLightIntensity[2]; `),K.hasNormalTexture?Q.code.add(G.glsl`mat3 tangentSpace = computeTangentSpace(normalVertex, vPositionWorldCameraRelative, vuv0); vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`):Q.code.add(G.glsl`vec3 shadingNormal = normalVertex;`),Q.code.add(G.glsl`${K.spherical?G.glsl`vec3 normalGround = normalize(positionWorld());`:G.glsl`vec3 normalGround = vec3(0.0, 0.0, 1.0);`} `),Q.code.add(G.glsl` vec3 viewDir = normalize(vPositionWorldCameraRelative); float ssao = 1.0 - occlusion * evaluateAmbientOcclusionInverse(); ${K.snowCover?G.glsl` vec3 surfaceNormal = normalize(shadingNormalWorld()); float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld()))); materialColor.rgb = mix(materialColor.rgb, vec3(1.1), snow); ssao = mix(ssao, 0.5 * ssao, snow); shadingNormal = mix(shadingNormal, surfaceNormal, snow);`:""} ${S?G.glsl` materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""} vec3 additionalLight = evaluateAdditionalLighting(ssao, positionWorld()); vec4 shadedColor = vec4(evaluateSceneLightingPBR(shadingNormal, materialColor.rgb, evaluateShadow(), ssao, additionalLight, viewDir, normalGround, mrr, emission, additionalIrradiance), materialColor.a); `)):(K.receiveShadows?Q.code.add(G.glsl`float shadow = evaluateShadow();`):K.spherical?(y.addLightingGlobalFactor(Q),Q.code.add(G.glsl`float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld()); float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);`)):Q.code.add(G.glsl`float shadow = 0.0;`),V&&Q.uniforms.add(new O.Texture2DPassUniform("ovNormalTex",(T,Y)=>Y.overlay?.getTexture(q.OverlayContent.WaterNormal))),K.snowCover&&Q.code.add(G.glsl`vec3 surfaceNormal = normalize(cross(dFdx(vPositionWorldCameraRelative), dFdy(vPositionWorldCameraRelative))); float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld()))); materialColor.rgb = mix(materialColor.rgb, vec3(1), snow);`),Q.code.add(G.glsl` float ambientOcclusion = evaluateAmbientOcclusion(); vec3 additionalLight = evaluateAdditionalLighting(ambientOcclusion, positionWorld()); ${S?G.glsl` materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""} vec4 shadedColor = vec4(evaluateSceneLighting(shadingNormalWorld(), materialColor.rgb, shadow, ambientOcclusion, additionalLight), materialColor.a); ${V?G.glsl` vec4 overlayWaterMask = getOverlayColor(ovNormalTex, vtcOverlay); float waterNormalLength = length(overlayWaterMask); if (waterNormalLength > 0.95) { mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, groundNormal); vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, overlayColor, -normalize(vPositionWorldCameraRelative), shadow, groundNormal, tbnMatrix, vPosition_view, positionWorld()); vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0)); // un-gamma the ground color to mix in linear space shadedColor = mix(shadedColor, waterColorNonLinear, waterColorLinear.w); }`:""} `)),Q.code.add(G.glsl` fragColor = highlightSlice(shadedColor, vPositionWorldCameraRelative); ${K.transparencyPassType===L.TransparencyPassType.ColorAlpha?G.glsl` fragColor = premultiplyAlpha(fragColor); fragAlpha = fragColor.a;`:""} } `));if((V=K.output===f.ShaderOutput.Depth)||W||K.output===f.ShaderOutput.ViewshedShadow)V||J.include(v.OutputDepth,K),Q.code.add(G.glsl` void main() { discardBySlice(vPositionWorldCameraRelative); vec4 textureColor = readBaseColorTexture(); discardOrAdjustAlpha(textureColor); ${V?"":G.glsl`outputDepth(linearDepth);`} } `);K.output===f.ShaderOutput.Normal&&(J.include(x.ComputeShadingNormal,K),Q.code.add(G.glsl` void main() { discardBySlice(vPositionWorldCameraRelative); vec4 textureColor = readBaseColorTexture(); discardOrAdjustAlpha(textureColor); // note: the alpha component needs to be 1.0 in order for this material to influence ambient occlusion, // see the ssao fragment shader float alpha = ${K.normalType===e.NormalType.Ground?"0.0":"1.0"}; fragColor = vec4(vec3(.5) + .5 * shadingNormal_view(), alpha); } `));K.output===f.ShaderOutput.ObjectAndLayerIdColor&&J.fragment.code.add(G.glsl` void main() { discardBySlice(vPositionWorldCameraRelative); vec4 textureColor = readBaseColorTexture(); discardOrAdjustAlpha(textureColor); ${S?G.glsl`fragColor = getOverlayColorTexel(vtcOverlay);`:"outputObjectAndLayerIdColor();"} } `);K.output===f.ShaderOutput.Highlight&&(J.include(m.OutputHighlight),Q.code.add(G.glsl` void main() { discardBySlice(vPositionWorldCameraRelative); vec4 textureColor = readBaseColorTexture(); discardOrAdjustAlpha(textureColor); ${S?G.glsl` vec4 overlayColor = getCombinedOverlayColor(); if (overlayColor.a == 0.0) { fragColor = vec4(0.0); return; }`:""} outputHighlight(); } `));return J}const M=Object.freeze(Object.defineProperty({__proto__:null,build:P},Symbol.toStringTag,{value:"Module"}));a.ComponentShader=M;a.build=P})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl":function(){define("exports ../attributes/VertexColor.glsl ../util/MixExternalColor.glsl ../../shaderModules/Float4DrawUniform ../../shaderModules/FloatDrawUniform ../../shaderModules/interfaces".split(" "),function(a,b,q,l,p,k){a.ComputeMaterialColor=function(h, f){h.include(b.VertexColor,f);h.fragment.include(q.MixExternalColor);h=h.fragment;h.uniforms.add(new l.Float4DrawUniform("baseColor",c=>c.baseColor));h.uniforms.add(new p.FloatDrawUniform("objectOpacity",c=>c.objectOpacity));f.hasVertexColors?h.code.add(k.glsl`vec3 _baseColor() { return baseColor.rgb * vColor.rgb; } float _baseOpacity() { return baseColor.a * vColor.a; }`):h.code.add(k.glsl`vec3 _baseColor() { return baseColor.rgb; } float _baseOpacity() { return baseColor.a; }`);h.code.add(k.glsl`vec4 computeMaterialColor(vec4 textureColor, vec4 externalColor, int externalColorMixMode) { vec3 baseColor = _baseColor(); float baseOpacity = _baseOpacity(); vec3 color = mixExternalColor( baseColor, textureColor.rgb, externalColor.rgb, externalColorMixMode ); float opacity = objectOpacity * mixExternalOpacity( baseOpacity, textureColor.a, externalColor.a, externalColorMixMode ); return vec4(color, opacity); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl":function(){define("exports ../../../../../../core/compilerUtils ../attributes/NormalAttribute.glsl ../attributes/VertexNormal.glsl ../attributes/VertexPosition.glsl ./Normals.glsl ../../shaderModules/interfaces".split(" "),function(a,b,q,l,p,k,h){a.ComputeShadingNormal=function(f,c){const e=f.fragment;switch(c.doubleSidedMode){case k.NormalsDoubleSidedMode.None:e.code.add(h.glsl`vec3 _adjustDoublesided(vec3 normal) { return normal; }`);break;case k.NormalsDoubleSidedMode.View:f.include(p.VertexPosition,c);e.code.add(h.glsl`vec3 _adjustDoublesided(vec3 normal) { return dot(normal, vPositionWorldCameraRelative) > 0.0 ? -normal : normal; }`);break;case k.NormalsDoubleSidedMode.WindingOrder:e.code.add(h.glsl`vec3 _adjustDoublesided(vec3 normal) { return gl_FrontFacing ? normal : -normal; }`);break;default:b.neverReached(c.doubleSidedMode);case k.NormalsDoubleSidedMode.COUNT:}switch(c.normalType){case q.NormalType.Attribute:case q.NormalType.Compressed:f.include(l.VertexNormal,c);e.code.add(h.glsl`vec3 shadingNormalWorld() { return _adjustDoublesided(normalize(vNormalWorld)); } vec3 shadingNormal_view() { vec3 normal = normalize(vNormalView); return gl_FrontFacing ? normal : -normal; }`);break;case q.NormalType.ScreenDerivative:f.include(p.VertexPosition,c);e.code.add(h.glsl`vec3 shadingNormalWorld() { return normalize(cross( dFdx(vPositionWorldCameraRelative), dFdy(vPositionWorldCameraRelative) )); } vec3 shadingNormal_view() { return normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view))); }`);break;case q.NormalType.Ground:c.spherical?(f.include(p.VertexPosition,c),e.code.add(h.glsl`vec3 shadingNormalWorld() { return normalize(positionWorld()); }`)):e.code.add(h.glsl`vec3 shadingNormalWorld() { return vec3(0.0, 0.0, 1.0); }`);e.code.add(h.glsl`vec3 shadingNormal_view() { return normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view))).xyz; }`);break;default:b.neverReached(c.normalType);case q.NormalType.COUNT:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl":function(){define("exports ../ShaderOutput ../attributes/TextureCoordinateAttribute.glsl ../attributes/VertexTextureCoordinates.glsl ../util/TextureAtlasLookup.glsl ../../shaderModules/interfaces ../../shaderModules/Texture2DDrawUniform ../../../lib/basicInterfaces".split(" "),function(a, b,q,l,p,k,h,f){a.ReadBaseColorTexture=function(c,e){const g=c.fragment;!e.hasColorTexture||e.output!==b.ShaderOutput.Color&&e.alphaDiscardMode===f.AlphaDiscardMode.Opaque?g.code.add(k.glsl`vec4 readBaseColorTexture() { return vec4(1.0); }`):(c.include(l.VertexTextureCoordinates,e),e=e.textureCoordinateType===q.TextureCoordinateAttributeType.Atlas,g.uniforms.add(new h.Texture2DDrawUniform("baseColorTexture",d=>d.texture)),e?(c.include(p.TextureAtlasLookup),g.code.add(k.glsl`vec4 readBaseColorTexture() { return textureAtlasLookup(baseColorTexture, vuv0, vuvRegion); }`)):g.code.add(k.glsl`vec4 readBaseColorTexture() { return texture(baseColorTexture, vuv0); }`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/material/MaterialBase":function(){define(["exports","../shaderModules/interfaces"],function(a,b){class q extends b.NoParameters{constructor(){super(...arguments);this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){this._dirty=!1;if(null!=this._parameterBlocks)for(const p of this._parameterBlocks)this[p]._setClean()}get dirty(){return this._dirty||this._checkParameterBlocksDirty()}_checkParameterBlocksDirty(){if(null== this._parameterBlocks)return!1;for(const p of this._parameterBlocks)if(this[p].dirty)return!0;return!1}}class l{constructor(){this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){this._dirty=!1}get dirty(){return this._dirty}}a.MaterialBase=q;a.MaterialParameterBlock=l;a.parameter=function(p={}){return(k,h)=>{const f=k._parameterCount??0;k._parameterCount=f+1;if(p.vectorOps){const c=p.vectorOps;Object.defineProperty(k,h,{get(){return this[f]},set(e){const g=this[f];if(null==g)this[f]=e;else{if(c.equals(g, e))return;c.copy(g,e)}this._setDirty()}})}else Object.defineProperty(k,h,{get(){return this[f]},set(c){this[f]!==c&&(p.dispose&&this[f]&&this[f].dispose(),this[f]=c,this._setDirty())}})}};a.parameterBlock=function(){return(p,k)=>{const h=p._parameterCount??0;p._parameterCount=h+1;p._parameterBlocks=p._parameterBlocks||[];p._parameterBlocks.push(h);Object.defineProperty(p,k,{get(){return this[h]},set(f){this[h]!==f&&(this[h]=f,this._setDirty())}})}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/core/util/TwoVectorPosition":function(){define(["exports","../../../../../chunks/vec32","../../../../../core/libs/gl-matrix-2/factories/vec3f32","../../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q,l){class p{constructor(h){this._low=l.create();this._high=l.create();h&&this.set(h)}get low(){return this._low}get high(){return this._high}set(h){b.copy(this._low,b.copy(k,h));h=b.sub(k,h,this._low);b.copy(this._high,h)}get(h){return b.add(h,this._low,this._high)}getLowScaled(h){return b.scale(h, this._low,1)}}const k=q.create();a.TwoVectorPosition=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts":function(){define(["exports","../../../support/buffer/glUtil","../../../support/buffer/InterleavedLayout","../VertexAttribute"],function(a,b,q,l){const p=q.newLayout().vec3f(l.VertexAttribute.POSITION).u16(l.VertexAttribute.COMPONENTINDEX).freeze(),k=q.newLayout().vec2u8(l.VertexAttribute.SIDENESS).freeze();b=b.glLayout(k); const h=q.newLayout().vec3f(l.VertexAttribute.POSITION0).vec3f(l.VertexAttribute.POSITION1).vec2i16(l.VertexAttribute.NORMALCOMPRESSED).u16(l.VertexAttribute.COMPONENTINDEX).u8(l.VertexAttribute.VARIANTOFFSET,{glNormalized:!0}).u8(l.VertexAttribute.VARIANTSTROKE).u8(l.VertexAttribute.VARIANTEXTENSION,{glNormalized:!0}).freeze();q=q.newLayout().vec3f(l.VertexAttribute.POSITION0).vec3f(l.VertexAttribute.POSITION1).vec2i16(l.VertexAttribute.NORMALCOMPRESSED).vec2i16(l.VertexAttribute.NORMAL2COMPRESSED).u16(l.VertexAttribute.COMPONENTINDEX).u8(l.VertexAttribute.VARIANTOFFSET, {glNormalized:!0}).u8(l.VertexAttribute.VARIANTSTROKE).u8(l.VertexAttribute.VARIANTEXTENSION,{glNormalized:!0}).freeze();l=new Map([[l.VertexAttribute.POSITION0,0],[l.VertexAttribute.POSITION1,1],[l.VertexAttribute.COMPONENTINDEX,2],[l.VertexAttribute.VARIANTOFFSET,3],[l.VertexAttribute.VARIANTSTROKE,4],[l.VertexAttribute.VARIANTEXTENSION,5],[l.VertexAttribute.NORMALCOMPRESSED,6],[l.VertexAttribute.NORMAL2COMPRESSED,7],[l.VertexAttribute.SIDENESS,8]]);a.EdgeInputBufferLayout=p;a.EdgeShaderAttributeLocations= l;a.RegularEdgeInstancesLayout=h;a.SilhouetteEdgeInstancesLayout=q;a.VertexLayout=k;a.glVertexLayout=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing":function(){define("exports ../../../../../geometry/support/meshUtils/deduplicate ../../../support/meshProcessing ../../../support/buffer/InterleavedLayout ../VertexAttribute ./bufferLayouts ./edgeBufferWriters ./edgePreprocessing".split(" "),function(a,b,q,l,p,k,h,f){function c(t, w,v,m){if(w)return w=q.computeNeighbors(v,m,t.count),new e(v,m,w,t);t=b.deduplicate(t.buffer,t.stride/4,{originalIndices:v,originalIndicesLength:m});m=q.computeNeighbors(t.indices,m,t.uniqueCount);return{faces:t.indices,facesLength:t.indices.length,neighbors:m,vertices:k.EdgeInputBufferLayout.createView(t.buffer)}}class e{constructor(t,w,v,m){this.faces=t;this.facesLength=w;this.neighbors=v;this.vertices=m}}const g=new h.RegularEdgeBufferWriter,d=new h.SilhouetteEdgeBufferWriter;h=l.newLayout().vec3f(p.VertexAttribute.POSITION0).vec3f(p.VertexAttribute.POSITION1); l=l.newLayout().vec3f(p.VertexAttribute.POSITION0).vec3f(p.VertexAttribute.POSITION1).u16(p.VertexAttribute.COMPONENTINDEX);a.extract=function(t){const w=c(t.data,t.skipDeduplicate,t.indices,t.indicesLength);g.updateSettings(t.writerSettings);d.updateSettings(t.writerSettings);return f.extractEdges(w,g,d)};a.extractComponentsEdgeLocationsLayout=l;a.extractEdgeInformation=c;a.extractEdgeLocationsLayout=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/meshProcessing":function(){define(["exports"], function(a){a.computeNeighbors=function(b,q,l){q/=3;const p=new Uint32Array(l+1),k=new Uint32Array(l+1);var h=(m,r)=>{m{m{const n= 2*m;m=r-m;for(r=1;ru;y--)d[n+2*y+2]=d[n+2*y],d[n+2*y+3]=d[n+2*y+1];d[n+2*y+2]=u;d[n+2*y+3]=x}};for(f=0;fm===b[3*r]?0:m===b[3*r+1]?1:m===b[3*r+2]?2:-1;q=(m,r)=>{m=v(m,r);w[3*r+m]=-1};h=(m,r,n,u)=>{m=v(m,r);w[3*r+m]=u;n=v(n,u);w[3*u+n]=r};for(f=0;fy|| new f,deallocator:null}),e=new q({deallocator:null}),g=new q({deallocator:null}),d=new k.Edge,t=p.create(),w=p.create(),v=p.create(),m=p.create(),r=p.create(),n=b.deg2rad(4),u=Math.cos(n);q=b.deg2rad(35);const x=Math.cos(q);a.extractEdges=function(y,z,A){const B=y.vertices.position,C=y.vertices.componentIndex,D=d.position0,F=d.position1,H=d.faceNormal0,N=d.faceNormal1,{edges:E,normals:G}=h(y);y=E.length/4;const I=z.allocate(y);let O=0;const L=A?.allocate(y);let P=0,M=0,K=0;c.length=0;for(var J=0;J< y;++J){var R=4*J;B.getVec(E.data[R],D);B.getVec(E.data[R+1],F);R=c.pushNew();R.index=4*J;R.length=l.distance(D,F)}c.sort((S,V)=>V.length-S.length);const Q=[],W=[];c.forAll(({length:S,index:V})=>{var T=E.data[V],Y=E.data[V+1];const ha=E.data[V+2],ba=E.data[V+3];V=-1===ba;B.getVec(T,D);B.getVec(Y,F);if(V)Y=3*ha,l.set(H,G.data[Y],G.data[Y+1],G.data[Y+2]),l.copy(N,H),d.componentIndex=C.get(T),d.cosAngle=l.dot(H,N);else{Y=3*ha;l.set(H,G.data[Y],G.data[Y+1],G.data[Y+2]);Y=3*ba;l.set(N,G.data[Y],G.data[Y+ 1],G.data[Y+2]);d.componentIndex=C.get(T);d.cosAngle=l.dot(H,N);if(d.cosAngle>u)return;-.9999>d.cosAngle&&l.copy(N,H)}M+=S;K++;V||d.cosAnglen&&(L&&A&&A.write(L,P++,d),W.push(S)))});y=new Float32Array(Q.reverse());J=new Float32Array(W.reverse());J=L&&A?{instancesData:L.slice(0,P),lodInfo:{lengths:J}}:void 0;return{regular:{instancesData:I.slice(0, O),lodInfo:{lengths:y}},silhouette:J,averageEdgeLength:M/K}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/Edge":function(){define(["exports","../../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b){class q{constructor(){this.position0=b.create();this.position1=b.create();this.faceNormal0=b.create();this.faceNormal1=b.create();this.cosAngle=this.componentIndex=0}}a.Edge=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager":function(){define(["exports","./ManagedTextureBackedBuffer"],function(a,b){class q{constructor(l,p=1){this._rctx=l;this._fieldCount=p;this._buffers=[]}garbageCollect(){this._buffers=this._buffers.filter(l=>0===l.activeCount?(l.dispose(),!1):!0)}destroy(){this._buffers.forEach(l=>l.dispose());this._buffers=[]}getBuffer(l){for(const p of this._buffers)if(p.availableCount>=l)return p;if(l>b.maxIndexCount)return null;l=new b.ManagedTextureBackedBuffer(this._rctx, this._fieldCount);this._buffers.push(l);return l}updateTextures(){for(const l of this._buffers)l.textureBuffer.updateTexture()}}a.BufferManager=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer":function(){define(["exports","./SimpleIndexManager","./TextureBackedBuffer"],function(a,b,q){class l{constructor(p,k=1){this.textureBuffer=new q.TextureBackedBuffer(p,k);this._indexManager=new b.SimpleIndexManager(65536)}dispose(){this.textureBuffer.dispose(); this.textureBuffer=void 0}get availableCount(){return this._indexManager.availableCount}get activeCount(){return this._indexManager.activeCount}acquireIndex(){const p=this._indexManager.acquire();this.textureBuffer.resizeToFit(p);return p}releaseIndex(p){this._indexManager.release(p)}}a.ManagedTextureBackedBuffer=l;a.maxIndexCount=65536;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/SimpleIndexManager":function(){define(["exports"], function(a){class b{constructor(q){this._maxCount=q;this._nextIndex=0;this._recycledIndices=[]}get activeCount(){return this._nextIndex-this._recycledIndices.length}get availableCount(){return this._recycledIndices.length+this._maxCount-this._nextIndex}acquire(){if(0this._data.count&&(h=new b.BufferViewVec4u8(new ArrayBuffer(Math.ceil(h/this.textureWidth)*this.textureWidth*4)),h.typedBuffer.set(this._data.typedBuffer),this._data=h)}updateTexture(){if(this._dirty){var h=this._texture.descriptor.width;this._data.count>h*this._texture.descriptor.height&&this._texture.resize(h,this._data.count/h);this._texture.setData(this._data.typedBuffer);this._dirty=!1}}get texture(){return this._texture}}a.TextureBackedBuffer=k;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/Highlight":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/colorUtils ../../../../../core/has ../../../../../core/maybe ../../../../../core/reactiveUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/vec2 ../../../webgl/formats ../../../webgl/RenderNode ./HighlightApplyTechnique ./HighlightBlurTechnique ./HighlightDefaults ./HighlightDownsampleTechnique ./HighlightPassParameters ../../lib/basicInterfaces ../../lib/DefaultVertexAttributeLocations ../../lib/DefaultVertexBufferLayouts ../../lib/VertexArrayObject ../../../../../chunks/HighlightBlur.glsl ../../../../../chunks/HighlightDownsample.glsl ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F){a.Highlight=class extends t{constructor(H){super(H);this.produces="highlight-color";this.consumes={required:["highlight-color","highlights"]};this._passParameters=new n.HighlightPassParameters;this._downsampleDrawParameters=new B.HighlightDownsampleDrawParameters;this._blurDrawParameters=new A.HighlightBlurDrawParameters;this._blurColorFormat=l("mac")?d.ColorFormat.RGBA:d.ColorFormat.RGBA4;this._grid={coverage:null,vao:null,verticalCellCount:0, horizontalCellCount:0,viewportWidth:0,viewportHeight:0};this._blurTechnique=H.techniques.acquire(v.HighlightBlurTechnique);this._downsampleTechnique=H.techniques.acquire(r.HighlightDownsampleTechnique);this._applyTechnique=H.techniques.acquire(w.HighlightApplyTechnique)}initialize(){this.addHandles([k.watch(()=>this.view.highlightOptions.color,H=>{this._passParameters.color=q.unitRGBAFromColor(H??m.defaultColor);this.view.highlightOptions.haloColor||(this._passParameters.haloColor=this._passParameters.color); this.requestRender(u.RenderRequestType.UPDATE)},k.syncAndInitial),k.watch(()=>this.view.highlightOptions.haloColor,H=>{this._passParameters.haloColor=null!=H?q.unitRGBAFromColor(H):this._passParameters.color;this.requestRender(u.RenderRequestType.UPDATE)},k.syncAndInitial),k.watch(()=>this.view.highlightOptions.haloOpacity,H=>{this._passParameters.haloOpacity=H??m.defaultHaloOpacity;this._passParameters.haloOpacityOccluded=.25*this._passParameters.haloOpacity;this.requestRender(u.RenderRequestType.UPDATE)}, k.syncAndInitial),k.watch(()=>this.view.highlightOptions.fillOpacity,H=>{this._passParameters.fillOpacity=H??m.defaultFillOpacity;this._passParameters.fillOpacityOccluded=.25*this._passParameters.fillOpacity;this.requestRender(u.RenderRequestType.UPDATE)},k.syncAndInitial)])}destroy(){this._blurTechnique.release();this._downsampleTechnique.release();this._applyTechnique.release();this._grid.coverage=p.releaseMaybe(this._grid.coverage);this._grid.vao=p.disposeMaybe(this._grid.vao)}render(H){if(this.bindParameters.decorations=== u.Decorations.OFF)return H.find(({name:J})=>"highlight-color"===J);if(!(this._blurTechnique.compiled&&this._downsampleTechnique.compiled&&this._applyTechnique.compiled))return this.requestRender(u.RenderRequestType.UPDATE),H.find(({name:J})=>"highlight-color"===J);var N=H.find(({name:J})=>"highlights"===J).getTexture();const E=this.bindParameters.camera;var G=E.pixelRatio,I=Math.ceil(E.fullWidth/G);const O=Math.ceil(E.fullHeight/G);G=this.renderingContext;this._gridUpdateResources(N);this._gridComputeCoverage(N, this.bindParameters);this._passParameters.highlightTexture=N;this._passParameters.coverageTexture=this._grid.coverage?.getTexture();const {width:L,height:P}=N.descriptor;g.set(this._passParameters.coverageRounding,L/(Math.ceil(L/B.gridCellPixelSize)*B.gridCellPixelSize),P/(Math.ceil(P/B.gridCellPixelSize)*B.gridCellPixelSize));const M=this._grid.vao;G.bindVAO(M);const K=this.fboCache.acquire(I,O,"highlight blur",this._blurColorFormat);G.unbindTexture(K.fbo?.colorTexture);G.bindFramebuffer(K.fbo); G.setClearColor(0,0,0,0);G.clear(D.ClearBufferBit.COLOR_BUFFER_BIT);G.setViewport(0,0,I,O);this._blurDrawParameters.blurInputTexture=N;g.set(this._blurDrawParameters.blurSize,1/I,0);N=G.bindTechnique(this._blurTechnique,this.bindParameters,this._passParameters,this._blurDrawParameters);G.drawArrays(this._blurTechnique.primitiveType,0,F.vertexCount(M,"geometry"));I=this.fboCache.acquire(I,O,"highlight blur",this._blurColorFormat);G.unbindTexture(I.fbo?.colorTexture);G.bindFramebuffer(I.fbo);G.setClearColor(0, 0,0,0);G.clear(D.ClearBufferBit.COLOR_BUFFER_BIT);this._blurDrawParameters.blurInputTexture=K.getTexture();g.set(this._blurDrawParameters.blurSize,0,1/O);N.bindDraw(this._blurDrawParameters,this.bindParameters,this._passParameters);G.drawArrays(this._blurTechnique.primitiveType,0,F.vertexCount(M,"geometry"));H=H.find(({name:J})=>"highlight-color"===J);G.bindFramebuffer(H.fbo);G.setViewport4fv(E.fullViewport);this._passParameters.blurTexture=I.getTexture();G.bindTechnique(this._applyTechnique,this.bindParameters, this._passParameters);G.drawArrays(this._applyTechnique.primitiveType,0,F.vertexCount(M,"geometry"));K.release();I.release();return H}_gridUpdateResources(H){const N=this.renderingContext,E=this._grid;var G=Math.ceil(H.descriptor.height/B.gridCellPixelSize),I=Math.ceil(H.descriptor.width/B.gridCellPixelSize);if(!E.vao||E.verticalCellCount!==G||E.horizontalCellCount!==I){E.verticalCellCount=G;E.horizontalCellCount=I;H=G+1;var O=I+1;G=1/G;I=1/I;var L=new Float32Array(24*H*O),P=0;for(let M=0;Mnew Promise((g,d)=>a(["../../shaders/HighlightApply.glsl"],g, d)));b.HighlightApplyTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/HighlightApply.glsl":function(){define("exports ./vec42 ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute ./HighlightDownsample.glsl".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(){const t=new h.ShaderBuilder,{vertex:w,fragment:v}=t,m=w.code,r=v.code;t.attributes.add(c.VertexAttribute.POSITION,"vec2");t.varyings.add("uv","vec2");t.attributes.add(c.VertexAttribute.UV0,"vec2");w.uniforms.add(new f.Texture2DPassUniform("coverageTex",n=>n.coverageTexture),new l.Float2PassUniform("coverageRounding",n=>n.coverageRounding));m.add(k.glsl`void main() { vec4 cov = texture(coverageTex, uv0 * coverageRounding); if (cov.r == 0.0) { gl_Position = vec4(0.0); return; } gl_Position = vec4(position, 0.0, 1.0); uv = position.xy * 0.5 + vec2(0.5); }`);v.uniforms.add(new f.Texture2DPassUniform("tex",n=>n.blurTexture),new f.Texture2DPassUniform("highlightTexture",n=>n.highlightTexture),new p.Float4PassUniform("uColor",n=>n.color),new p.Float4PassUniform("haloColor",n=>n.haloColor),new p.Float4PassUniform("opacities",n=>b.set(d,n.haloOpacity,n.haloOpacityOccluded,n.fillOpacity,n.fillOpacityOccluded)));v.constants.add("inner","float",1-(e.outlineSize-e.blurSize)/e.outlineSize);r.add(k.glsl`void main() { vec4 blurredHighlightValue = texture(tex, uv); float highlightIntensity = blurredHighlightValue.a; if (highlightIntensity == 0.0) { discard; } vec4 origin_color = texture(highlightTexture, uv); float outlineIntensity; float fillIntensity; if (blurredHighlightValue.g > blurredHighlightValue.b) { outlineIntensity = haloColor.w * opacities[1]; fillIntensity = uColor.w * opacities[3]; } else { outlineIntensity = haloColor.w * opacities[0]; fillIntensity = uColor.w * opacities[2]; } float outlineFactor = smoothstep(0.0, inner, highlightIntensity); float fillFactor = any(notEqual(origin_color, vec4(0.0, 0.0, 0.0, 0.0))) ? 1.0 : 0.0; float intensity = outlineIntensity * outlineFactor * (1.0 - fillFactor) + fillIntensity * fillFactor; fragColor = vec4(mix(haloColor.rgb, uColor.rgb, fillFactor), intensity); }`);return t}const d=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:g},Symbol.toStringTag,{value:"Module"}));a.HighlightApply=q;a.build=g})},"esri/chunks/HighlightDownsample.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform"],function(a,b,q,l, p){function k(){const c=new l.ShaderBuilder,{outputs:e,fragment:g}=c;c.include(b.ScreenSpacePass);g.uniforms.add(new p.Texture2DDrawUniform("textureInput",d=>d.input));g.constants.add("sampleArea","int",5);e.add("fragGrid","vec2");g.code.add(q.glsl` void main() { float red = 0.0; float green = 1.0; int cellSize = ${q.glsl.int(32)}; vec2 texelSize = 1.0 / vec2(textureSize(textureInput, 0)); vec2 offset = floor(gl_FragCoord.xy) * vec2(float(cellSize)); for(int x = -sampleArea; x < cellSize + sampleArea; x += 2) { for(int y = -sampleArea; y < cellSize + sampleArea; y += 2) { vec2 coord = (offset + vec2(float(x), float(y))) * texelSize; vec4 value = texture(textureInput, coord); float mx = floor(max(value.g, value.b)); red = max(red, ceil(value.r)); green = min(green, mx); if(red == 1.0 && green == 0.0) { fragGrid = vec2(red, green); return; } } } fragGrid = vec2(red, green); }`);return c}class h extends q.NoParameters{}const f=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:h,blurSize:.4,build:k,gridCellPixelSize:32,outlineSize:9},Symbol.toStringTag,{value:"Module"}));a.HighlightDownsample=f;a.HighlightDownsampleDrawParameters=h;a.blurSize=.4;a.build=k;a.gridCellPixelSize=32;a.outlineSize=9})},"esri/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/HighlightBlur.glsl ../../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.HighlightBlur,()=>new Promise((e,g)=>a(["../../shaders/HighlightBlur.glsl"],e,g)));b.HighlightBlurTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/HighlightBlur.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec2f64 ../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c){function e(){const t=new k.ShaderBuilder,{attributes:w,varyings:v,vertex:m,fragment:r}=t;w.add(c.VertexAttribute.POSITION,"vec2");w.add(c.VertexAttribute.UV0,"vec2");v.add("blurCoordinate","vec3");m.uniforms.add(new f.Texture2DPassUniform("coverageTex",n=>n.coverageTexture),new l.Float2PassUniform("coverageRounding",n=>n.coverageRounding));m.code.add(p.glsl`void main() { gl_Position = vec4(position, 0.0, 1.0); vec4 cov = texture(coverageTex, uv0 * coverageRounding); if (cov.r == 0.0) { gl_Position = vec4(0.0); } blurCoordinate = vec3(gl_Position.xy * 0.5 + vec2(0.5), cov.g); }`);r.uniforms.add(new q.Float2DrawUniform("blurSize",n=>n.blurSize),new h.Texture2DDrawUniform("tex",n=>n.blurInputTexture));r.code.add(p.glsl`void main() { vec2 uv = blurCoordinate.xy; vec4 center = texture(tex, uv); if (blurCoordinate.z == 1.0) { fragColor = center; } else { vec4 sum = center * 0.204164; sum += texture(tex, uv + blurSize * 1.407333) * 0.304005; sum += texture(tex, uv - blurSize * 1.407333) * 0.304005; sum += texture(tex, uv + blurSize * 3.294215) * 0.093913; sum += texture(tex, uv - blurSize * 3.294215) * 0.093913; fragColor = sum; } }`);return t}class g extends p.NoParameters{constructor(){super(...arguments);this.blurSize=b.create()}}const d=Object.freeze(Object.defineProperty({__proto__:null,HighlightBlurDrawParameters:g,build:e},Symbol.toStringTag,{value:"Module"}));a.HighlightBlur=d;a.HighlightBlurDrawParameters=g;a.build=e})},"esri/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/HighlightDownsample.glsl ../../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.HighlightDownsample,()=>new Promise((e,g)=>a(["../../shaders/HighlightDownsample.glsl"],e,g)));b.HighlightDownsampleTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/HighlightPassParameters":function(){define(["exports", "../../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../../core/libs/gl-matrix-2/factories/vec4f64","../../core/shaderModules/interfaces"],function(a,b,q,l){class p extends l.NoParameters{constructor(){super(...arguments);this.color=q.fromValues(1,0,1,1);this.haloColor=q.fromValues(1,0,1,1);this.haloOpacity=1;this.haloOpacityOccluded=.25;this.fillOpacity=.2;this.fillOpacityOccluded=.05;this.coverageRounding=b.fromValues(1,1)}}a.HighlightPassParameters=p;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/ShadowHighlight":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/colorUtils ../../../../../core/mathUtils ../../../../../core/reactiveUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../ViewingMode ../../../webgl/RenderNode ./HighlightDefaults ./ShadowHighlightTechnique ../../lib/basicInterfaces".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){a.ShadowHighlight=class extends w{constructor(u){super(u);this.produces="composite-color";this.consumes={required:["composite-color","highlights"]};this._passParameters=new m.ShadowHighlightPassParameters;this._maxOpacity=1;this._shadowDifference=.2;this._technique=u.techniques.acquire(m.ShadowHighlightTechnique)}initialize(){this.addHandles([p.watch(()=>this.view.highlightOptions.shadowOpacity,u=>{this._passParameters.shadowOpacity=u??v.defaultShadowOpacity; this._updateOccludedShadowOpacity();this._updateMaxOpacity()},p.syncAndInitial),p.watch(()=>this.view.highlightOptions.shadowDifference,u=>{this._shadowDifference=u??v.defaultShadowDifference;this._updateOccludedShadowOpacity();this._updateMaxOpacity()},p.syncAndInitial),p.watch(()=>this.view.highlightOptions.shadowColor,u=>{this._passParameters.shadowColor=q.unitRGBAFromColor(u??v.defaultShadowColor);this._updateMaxOpacity()},p.syncAndInitial)])}destroy(){this._technique.release()}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity= this._passParameters.shadowOpacity*(1-this._shadowDifference)}_updateMaxOpacity(){this._maxOpacity=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity)*this._passParameters.shadowColor[3]}render(u){const x=u.find(({name:z})=>"composite-color"===z),y=this.bindParameters;if(!y.shadowHighlightsVisible||!y.depth||!this._ensureIfVisible(y.camera,y.lighting.mainLight.direction))return x;if(!this._technique.compiled)return this.requestRender(r.RenderRequestType.UPDATE), x;this._passParameters.highlight=u.find(({name:z})=>"highlights"===z)?.getTexture();this._passParameters.origin=y.camera.center;u=this.renderingContext;u.bindFramebuffer(x.fbo);u.bindTechnique(this._technique,y,this._passParameters);u.screen.draw();return x}_ensureIfVisible(u,x){this._passParameters.opacityElevation=1-l.smoothstep(4E4,5E4,u.relativeElevation);u=this.viewingMode===t.ViewingMode.Global?g.normalize(n,u.center):g.set(n,0,0,1);x=g.dot(u,x);this._passParameters.dayNightTerminator=l.smoothstep(0, 1,l.clamp(30*x,0,1));return.001953125<=this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator}};b.__decorate([k.property()],a.ShadowHighlight.prototype,"produces",void 0);b.__decorate([k.property()],a.ShadowHighlight.prototype,"consumes",void 0);b.__decorate([k.property({constructOnly:!0})],a.ShadowHighlight.prototype,"viewingMode",void 0);b.__decorate([k.property({constructOnly:!0})],a.ShadowHighlight.prototype,"techniques",void 0);a.ShadowHighlight=b.__decorate([e.subclass("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")], a.ShadowHighlight);const n=d.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique":function(){define("require exports ../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../core/shaderLibrary/shading/ReadShadowMap.glsl ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../shaders/ShadowConfiguration ../../../../../chunks/ShadowHighlight.glsl ../../../../webgl/enums ../../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends l.ReadShadowMapPassParameters{constructor(){super(...arguments);this.shadowColor=q.fromValues(1,0,1,1);this.shadowOpacity=.2;this.occludedShadowOpacity=.1;this.dayNightTerminator=this.opacityElevation=1}}class w extends k.ShaderTechnique{constructor(v){super(v,new c.ShadowConfiguration,()=>this.destroy())}initializeProgram(v){return new f.Program(v.rctx,w.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return d.makePipelineState({blending:d.separateBlendingParams(g.BlendFactor.SRC_ALPHA, g.BlendFactor.ONE,g.BlendFactor.ONE_MINUS_SRC_ALPHA,g.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:d.defaultColorWriteParams,depthTest:null,depthWrite:null})}get primitiveType(){return g.PrimitiveType.TRIANGLE_STRIP}}w.shader=new p.ReloadableShaderModule(e.ShadowHighlight,()=>new Promise((v,m)=>a(["../../shaders/ShadowHighlight.glsl"],v,m)));b.ShadowHighlightPassParameters=t;b.ShadowHighlightTechnique=w;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ShadowConfiguration":function(){define(["exports", "../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.receiveShadows=!0}}b.__decorate([q.parameter()],l.prototype,"receiveShadows",void 0);a.ShadowConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ShadowHighlight.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/ShadowMap".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(z){const A=new m.ShaderBuilder;A.include(c.ReadShadowMapPass,z);A.include(h.ScreenSpacePass);A.include(k.NormalFromDepth);z=A.fragment;z.include(e.RgbaFloatEncoding);z.uniforms.add(new r.Texture2DPassUniform("defaultDepthTex",(B,C)=>C.shadowMap.getSnapshot(n.SnapshotSlot.ExcludeHighlight)),new r.Texture2DPassUniform("highlightDepthTex",(B,C)=>C.shadowMap.getSnapshot(n.SnapshotSlot.Highlight)),new r.Texture2DPassUniform("depthMap",(B,C)=>C.depth?.attachment), new r.Texture2DPassUniform("highlightTexture",B=>B.highlight),new d.Float4PassUniform("uColor",B=>B.shadowColor),new t.FloatPassUniform("opacity",B=>B.shadowOpacity),new t.FloatPassUniform("occludedOpacity",B=>B.occludedShadowOpacity),new t.FloatPassUniform("terminationFactor",B=>B.opacityElevation*B.dayNightTerminator),new g.Float3PassUniform("lightingMainDirectionView",(B,C)=>l.normalize(y,l.transformMat4(y,C.lighting.mainLight.direction,C.camera.viewInverseTransposeMatrix))),new v.Matrix4PassUniform("inverseViewMatrix", (B,C)=>b.invert(x,b.translate(x,C.camera.viewMatrix,C.camera.center))));z.constants.add("unoccludedHighlightFlag","vec4",f.unoccludedHighlightFlag);z.code.add(w.glsl` void main(void) { vec4 highlightInfo = texture(highlightTexture, uv); float visiblyHighlighted = (1.0 - clamp(distance(unoccludedHighlightFlag, highlightInfo), 0.0, 1.0)) * highlightInfo.a; if (visiblyHighlighted > ${w.glsl.float(.99999)}) { discard; } float depth = depthFromTexture(depthMap, uv); // 1.0 is the clear value of depthMap, which means nothing has been drawn there and we should discard if (depth >= 1.0 || depth <= 0.0) { discard; } float currentPixelDepth = linearizeDepth(depth); vec4 currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0); vec4 worldSpacePos = inverseViewMatrix * currentPixelPos; mat4 shadowMatrix; float linearDepth = -currentPixelDepth; int i = chooseCascade(linearDepth, shadowMatrix); if (i >= numCascades) { discard; } vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix); // vertex completely outside? -> no shadow if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { discard; } ivec2 texSize = textureSize(highlightDepthTex, 0); ivec2 uvShadow = ivec2(cascadeCoordinates(i, texSize, lvpos) * vec2(texSize)); float depthHighlight = readShadowMapDepth(uvShadow, highlightDepthTex); bool shadowHighlight = depthHighlight < lvpos.z; if (!shadowHighlight) { discard; } float depthDefault = readShadowMapDepth(uvShadow, defaultDepthTex); bool shadowDefault = depthDefault < lvpos.z; vec3 normal = normalFromDepth(depthMap, currentPixelPos.xyz, gl_FragCoord.xy, uv); bool shaded = dot(normal, lightingMainDirectionView) < ${w.glsl.float(.025)}; float fragOpacity = (shadowDefault || shaded) ? occludedOpacity : opacity; fragColor = vec4(uColor.rgb, uColor.a * fragOpacity * terminationFactor); } `);return A}const x=q.create(),y=p.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:u},Symbol.toStringTag,{value:"Module"}));a.ShadowHighlight=q;a.build=u})},"esri/views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl":function(){define(["exports","./output/ReadDepth.glsl","./util/CameraSpace.glsl","../shaderModules/interfaces"],function(a,b,q,l){a.NormalFromDepth=function(p){const k=p.fragment;p.include(q.CameraSpace);k.include(b.ReadDepth);k.code.add(l.glsl`vec3 normalFromDepth(sampler2D depthMap, vec3 pixelPos, vec2 fragCoord, vec2 uv) { ivec2 iuv = ivec2(uv * vec2(textureSize(depthMap, 0))); float leftPixelDepth = linearizeDepth(texelFetch(depthMap, iuv + ivec2(-1, 0), 0).r); float rightPixelDepth = linearizeDepth(texelFetch(depthMap, iuv + ivec2(1, 0), 0).r); float bottomPixelDepth = linearizeDepth(texelFetch(depthMap, iuv + ivec2(0, -1), 0).r); float topPixelDepth = linearizeDepth(texelFetch(depthMap, iuv + ivec2(0, 1), 0).r); bool pickLeft = abs(pixelPos.z - leftPixelDepth) < abs(pixelPos.z - rightPixelDepth); bool pickBottom = abs(pixelPos.z - bottomPixelDepth) < abs(pixelPos.z - topPixelDepth); vec3 fragCoordHorizontal = pickLeft ? vec3(fragCoord + vec2(-1.0, 0.0), leftPixelDepth) : vec3(fragCoord + vec2(1.0, 0.0), rightPixelDepth); vec3 fragCoordVertical = pickBottom ? vec3(fragCoord + vec2(0.0, -1.0), bottomPixelDepth) : vec3(fragCoord + vec2(0.0, 1.0), topPixelDepth); vec3 verticalPixelPos = reconstructPosition(fragCoordHorizontal.xy, fragCoordHorizontal.z); vec3 horizontalPixelPos = reconstructPosition(fragCoordVertical.xy, fragCoordVertical.z); vec3 normal = normalize(cross(verticalPixelPos - pixelPos, horizontalPixelPos - pixelPos)); return pickLeft == pickBottom ? normal : -normal; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/magnifier/MagnifierRenderNode":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/asyncUtils ../../../../../core/mathUtils ../../../../../core/maybe ../../../../../core/reactiveUtils ../../../../../core/screenUtils ../../../../../core/urlUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../support/requestImageUtils ../../../webgl/RenderNode ./MagnifierTechnique ../../lib/basicInterfaces ../../lib/DefaultVertexAttributeLocations ../../lib/DefaultVertexBufferLayouts ../../lib/glUtil3D ../../../../../chunks/Magnifier.glsl ../../../../magnifier/resources ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){a.MagnifierRenderNode=class extends v{constructor(D){super(D);this.produces="magnifier-color";this.consumes={required:["magnifier-color"]};this._imageLoadTask=this._imageSources=null;this._passParameters=new y.MagnifierPassParameters;this._magnifier=this._technique=this._vao=null;this._tmpScreenPoint=h.createScreenPointArray();this._tmpRenderPoint=h.createRenderScreenPointArray()}initialize(){this.addHandles([k.watch(()=>this.view.magnifier, D=>this._update(D),k.syncAndInitial)])}_update(D){D!==this._magnifier&&(this.removeAllHandles(),this._magnifier=D,D=()=>{const F=this._validMagnifier;F?(this._loadResources(F),this.produces="magnifier-color"):this.produces="disabled";this.requestRender()},this._magnifier&&this.addHandles(k.watch(()=>this._magnifier?.version,D)),D())}get _validMagnifier(){return this._magnifier?.visible&&this._magnifier?.position&&0"magnifier-color"===P);if(null== F)return D;if(null==this._imageSources)return this.requestRender(r.RenderRequestType.UPDATE),D;const H=this.renderingContext;var N=Math.ceil(this.camera.pixelRatio*F.size);this._vao??(this._vao=x.createQuadVAO(H,u.Pos2,n.Default3D,0,1));this._technique??(this._technique=this.techniques.acquire(m.MagnifierTechnique));this._ensureTextureResources(H,N);if(!this._technique?.compiled||!this._passParameters.input)return this.requestRender(r.RenderRequestType.UPDATE),D;N=Math.ceil(1/this._factor*N);const E= this._passParameters.input;E.resize(N,N);h.screenPointObjectToArray(F.position,this._tmpScreenPoint);var G=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),I=this.camera.fullHeight;const O=.5*N,L=.5*N;G[0]=l.clamp(G[0],O,this.camera.fullWidth-O-1);G[1]=l.clamp(G[1],L,I-L-1);I=Math.floor(G[0]-O);G=Math.floor(G[1]-L);H.bindFramebuffer(D.fbo);this._technique.program.bindTexture("textureInput",E);H.gl.copyTexImage2D(E.descriptor.target,0,E.descriptor.pixelFormat,I,G,N,N,0);this._passParameters.magnifier= F;H.bindTechnique(this._technique,this.bindParameters,this._passParameters);H.bindVAO(this._vao);H.drawArrays(A.PrimitiveType.TRIANGLE_STRIP,0,4);return D}_loadResources(D){const {maskUrl:F,overlayUrl:H}=D;if(this._imageLoadTask?.maskUrl!==F||this._imageLoadTask?.overlayUrl!==H)this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null;this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:F,overlayUrl:H,task:q.createTask(async N=>{const E=null==F||null==H?z.loadMagnifierResources(N): null,G=null!=F?w.requestImage(F,{signal:N}):E.then(I=>I.mask);N=null!=H?w.requestImage(H,{signal:N}):E.then(I=>I.overlay);this._imageSources={mask:await G,overlay:await N}})})}_ensureTextureResources(D,F){null==this._imageSources||this._passParameters.size===F&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=F,this._imageSources.overlay.height=this._imageSources.mask.height= F,F=new C.TextureDescriptor,F.internalFormat=A.PixelFormat.RGBA,F.wrapMode=A.TextureWrapMode.CLAMP_TO_EDGE,F.flipped=!0,F.preMultiplyAlpha=!f.isSVG(this._imageSources.overlay.src)||!D.driverTest.svgPremultipliesAlpha.result,this._passParameters.overlay=new B.Texture(D,F,this._imageSources.overlay),F.pixelFormat=F.internalFormat=A.PixelFormat.ALPHA,F.preMultiplyAlpha=!1,this._passParameters.mask=new B.Texture(D,F,this._imageSources.mask),F.pixelFormat=F.internalFormat=A.PixelFormat.RGBA,F.flipped= !1,this._passParameters.input=new B.Texture(D,F))}};b.__decorate([c.property()],a.MagnifierRenderNode.prototype,"produces",void 0);b.__decorate([c.property()],a.MagnifierRenderNode.prototype,"consumes",void 0);b.__decorate([c.property()],a.MagnifierRenderNode.prototype,"_imageSources",void 0);b.__decorate([c.property()],a.MagnifierRenderNode.prototype,"_imageLoadTask",void 0);b.__decorate([c.property({constructOnly:!0})],a.MagnifierRenderNode.prototype,"techniques",void 0);a.MagnifierRenderNode=b.__decorate([t.subclass("esri.views.3d.webgl-engine.effects.magnifier.MagnifierRenderNode")], a.MagnifierRenderNode);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/Magnifier.glsl ../../../../webgl/enums ../../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx, e.shader.get().build(),p.Default3D)}initializePipeline(){return c.makePipelineState({blending:c.simpleBlendingParams(f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:null,depthWrite:null,colorWrite:c.defaultColorWriteParams})}}e.shader=new q.ReloadableShaderModule(h.Magnifier,()=>new Promise((g,d)=>a(["../../shaders/Magnifier.glsl"],g,d)));b.MagnifierTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Magnifier.glsl":function(){define("exports ../core/screenUtils ./vec42 ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderModules/BooleanPassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e){function g(){const m=new f.ShaderBuilder;m.attributes.add(e.VertexAttribute.POSITION,"vec2");m.vertex.uniforms.add(new k.Float4PassUniform("drawPosition",(r,n)=>{var u=n.camera.pixelRatio;const x=r.magnifier.offset.x*u,y=r.magnifier.offset.y*u;b.screenPointObjectToArray(r.magnifier.position,t);const z=n.camera.screenToRender(t,w);r=Math.ceil(u*r.magnifier.size);u=n.camera.fullWidth;n=n.camera.fullHeight;return q.set(v,-1+(z[0]+x)/u*2,-1+(z[1]-y)/n*2,r/u*2,r/n*2)}));m.varyings.add("vUV", "vec2");m.vertex.code.add(h.glsl`void main(void) { vUV = position; gl_Position = vec4(drawPosition.xy + vec2(position - 0.5) * drawPosition.zw, 0.0, 1.0); }`);m.fragment.uniforms.add(new c.Texture2DPassUniform("textureInput",r=>r.input));m.fragment.uniforms.add(new c.Texture2DPassUniform("textureMask",r=>r.mask));m.fragment.uniforms.add(new c.Texture2DPassUniform("textureOverlay",r=>r.overlay));m.fragment.uniforms.add(new p.BooleanPassUniform("maskEnabled",r=>r.magnifier.maskEnabled));m.fragment.uniforms.add(new p.BooleanPassUniform("overlayEnabled",r=>r.magnifier.overlayEnabled));m.fragment.code.add(h.glsl`const float barrelFactor = 1.1; vec2 barrel(vec2 uv) { vec2 uvn = uv * 2.0 - 1.0; if (uvn.x == 0.0 && uvn.y == 0.0) { return vec2(0.5, 0.5); } float theta = atan(uvn.y, uvn.x); float r = pow(length(uvn), barrelFactor); return r * vec2(cos(theta), sin(theta)) * 0.5 + 0.5; } void main() { float mask = maskEnabled ? texture(textureMask, vUV).a : 1.0; vec4 inputColor = texture(textureInput, barrel(vUV)) * mask; vec4 overlayColor = overlayEnabled ? texture(textureOverlay, vUV) : vec4(0); fragColor = overlayColor + (1.0 - overlayColor.a) * inputColor; }`);return m}class d extends h.NoParameters{constructor(){super(...arguments);this.input=this.overlay=this.mask=null;this.size=0}}const t=b.createScreenPointArray(),w=b.createRenderScreenPointArray(),v=l.create();l=Object.freeze(Object.defineProperty({__proto__:null,MagnifierPassParameters:d,build:g},Symbol.toStringTag,{value:"Module"}));a.Magnifier=l;a.MagnifierPassParameters=d;a.build=g})},"esri/views/magnifier/resources":function(){define(["require","exports","../../core/promiseUtils","../../support/requestImageUtils"], function(a,b,q,l){const p=k=>Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));b.loadMagnifierResources=async function(k){var h=new Promise((c,e)=>a(["./mask-svg"],g=>c(p(g)),e)),f=new Promise((c,e)=>a(["./overlay-svg"],g=>c(p(g)),e));h=l.requestImage((await h).default,{signal:k});f=l.requestImage((await f).default,{signal:k});f={mask:await h,overlay:await f};q.throwIfAborted(k);return f};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/effects/smaa/SMAA":function(){define("require exports ../../../../../chunks/tslib.es6 ../../../../../core/maybe ../../../../../core/promiseUtils ../../../../../core/reactiveUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../support/requestImageUtils ../../../webgl/formats ../../../webgl/RenderNode ./SMAABlendWeightsTechnique ./SMAABlurTechnique ./SMAAEdgeDetectTechnique ./SMAAPassParameters ../../lib/basicInterfaces ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(B,C,D,F){const H=new z.TextureDescriptor;H.pixelFormat=D;H.wrapMode=x.TextureWrapMode.CLAMP_TO_EDGE;H.width=F.width;H.height=F.height;H.samplingMode=C;return new y.Texture(B,H,F)}b.SMAA=class extends w{constructor(B){super(B);this.produces="disabled";this.consumes={required:["aa-color","composite-color"]};this._searchTexture=this._areaTexture=null;this._smaaParameters=new n.SMAAPassParameters;this._edgeTechnique=B.techniques.acquire(r.SMAAEdgeDetectTechnique); this._blendTechnique=B.techniques.acquire(v.SMAABlendWeightsTechnique);this._blurTechnique=B.techniques.acquire(m.SMAABlurTechnique)}initialize(){this.addHandles([k.watch(()=>this.isEnabled(),B=>B?this.enable():this.disable(),k.syncAndInitial)])}async enable(){this.produces="aa-color";if(!(this._abortController||this._areaTexture&&this._searchTexture)){this._abortController=new AbortController;var B=this._abortController.signal;try{const C=await new Promise((D,F)=>a(["./SMAAData"],D,F));await this._loadTextures(C, B);this.requestRender(u.RenderRequestType.UPDATE)}catch{}this._abortController=null}}async _loadTextures(B,C){p.throwIfAborted(C);const [D,F]=await Promise.allSettled([d.requestImage(B.areaTexture,{signal:C}),d.requestImage(B.searchTexure,{signal:C})]);p.throwIfAborted(C);"fulfilled"===D.status&&"fulfilled"===F.status&&(B=this.renderingContext,this._areaTexture=A(B,x.TextureSamplingMode.LINEAR,x.PixelFormat.RGB,D.value),this._searchTexture=A(B,x.TextureSamplingMode.NEAREST,x.PixelFormat.LUMINANCE, F.value))}disable(){this.produces="disabled"}destroy(){this._searchTexture=l.disposeMaybe(this._searchTexture);this._areaTexture=l.disposeMaybe(this._areaTexture);this._blurTechnique.release();this._blendTechnique.release();this._edgeTechnique.release()}render(B){const C=B.find(({name:E})=>"aa-color"===E);if(!(this._edgeTechnique.compiled&&this._blendTechnique.compiled&&this._blurTechnique.compiled&&this._areaTexture&&this._searchTexture))return this.requestRender(u.RenderRequestType.UPDATE),C;var D= B.find(({name:E})=>"composite-color"===E);const F=D.fbo.width,H=D.fbo.height;B=this.renderingContext;B.setViewport(0,0,F,H);const N=this.fboCache.acquire(F,H,"smaa edges",t.ColorFormat.RG);B.unbindTexture(N.fbo?.colorTexture);B.bindFramebuffer(N.fbo);B.setClearColor(0,0,0,1);B.clear(x.ClearBufferBit.COLOR_BUFFER_BIT);this._smaaParameters.color=D.getTexture();B.bindTechnique(this._edgeTechnique,null,this._smaaParameters);B.screen.draw();D=this.fboCache.acquire(F,H,"smaa blend");B.unbindTexture(D.fbo?.colorTexture); B.bindFramebuffer(D.fbo);B.setClearColor(0,0,1,1);B.clear(x.ClearBufferBit.COLOR_BUFFER_BIT);this._smaaParameters.inputTexture=N.getTexture();this._smaaParameters.areaTexture=this._areaTexture;this._smaaParameters.searchTexture=this._searchTexture;B.bindTechnique(this._blendTechnique,null,this._smaaParameters);B.screen.draw();N.release();B.bindFramebuffer(C.fbo);B.setClearColor(0,1,0,1);B.clear(x.ClearBufferBit.COLOR_BUFFER_BIT);this._smaaParameters.inputTexture=D.getTexture();B.bindTechnique(this._blurTechnique, null,this._smaaParameters);B.screen.draw();D.release();return C}};q.__decorate([h.property()],b.SMAA.prototype,"produces",void 0);q.__decorate([h.property()],b.SMAA.prototype,"consumes",void 0);q.__decorate([h.property({constructOnly:!0})],b.SMAA.prototype,"isEnabled",void 0);q.__decorate([h.property({constructOnly:!0})],b.SMAA.prototype,"techniques",void 0);q.__decorate([h.property()],b.SMAA.prototype,"_abortController",void 0);b.SMAA=q.__decorate([g.subclass("esri.views.3d.webgl-engine.effects.smaa.SMAA")], b.SMAA);Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/BlendWeights.glsl ../../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx, c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.BlendWeights,()=>new Promise((e,g)=>a(["../../shaders/BlendWeights.glsl"],e,g)));b.SMAABlendWeightsTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/BlendWeights.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces", "../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],function(a,b,q,l,p){function k(){const c=new l.ShaderBuilder;c.include(b.ScreenSpacePass);c.fragment.uniforms.add(new p.Texture2DPassUniform("edgesTexture",e=>e.inputTexture),new p.Texture2DPassUniform("areaTexture",e=>e.areaTexture),new p.Texture2DPassUniform("searchTexture",e=>e.searchTexture));c.fragment.code.add(q.glsl` #define SMAA_AREATEX_PIXEL_SIZE ( 1.0 / vec2( 160.0, 560.0 ) ) #define SMAA_AREATEX_SUBTEX_SIZE ( 1.0 / 7.0 ) vec4 sampleLevelZeroOffset(sampler2D tex, vec2 coord, vec2 offset, vec2 resolution) { return texture(tex, coord + offset.x * resolution, 0.0); } float searchLength(sampler2D searchTex, vec2 e, float bias, float scale) { e.r = bias + e.r * scale; return 255.0 * texture( searchTex, e, 0.0 ).r; } float searchLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) { vec2 e = vec2( 0.0, 1.0 ); for ( int i = 0; i < ${q.glsl.int(h.maxSearchSteps)}; i ++ ) { e = texture( edgesTex, texcoord, 0.0 ).rg; texcoord -= vec2( 2.0, 0.0 ) * resolution; if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break; } texcoord.x += 0.25 * resolution.x; texcoord.x += resolution.x; texcoord.x += 2.0 * resolution.x; texcoord.x -= resolution.x * searchLength(searchTex, e, 0.0, 0.5); return texcoord.x; } float searchRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) { vec2 e = vec2( 0.0, 1.0 ); for ( int i = 0; i < ${q.glsl.int(h.maxSearchSteps)}; i ++ ) { e = texture( edgesTex, texcoord, 0.0 ).rg; texcoord += vec2( 2.0, 0.0 ) * resolution; if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break; } texcoord.x -= 0.25 * resolution.x; texcoord.x -= resolution.x; texcoord.x -= 2.0 * resolution.x; texcoord.x += resolution.x * searchLength( searchTex, e, 0.5, 0.5 ); return texcoord.x; } float searchUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) { vec2 e = vec2( 1.0, 0.0 ); for ( int i = 0; i < ${q.glsl.int(h.maxSearchSteps)}; i ++ ) { e = texture( edgesTex, texcoord, 0.0 ).rg; texcoord += vec2( 0.0, 2.0 ) * resolution; if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break; } texcoord.y -= 0.25 * resolution.y; texcoord.y -= resolution.y; texcoord.y -= 2.0 * resolution.y; texcoord.y += resolution.y * searchLength( searchTex, e.gr, 0.0, 0.5 ); return texcoord.y; } float searchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) { vec2 e = vec2( 1.0, 0.0 ); for ( int i = 0; i < ${q.glsl.int(h.maxSearchSteps)}; i ++ ) { e = texture( edgesTex, texcoord, 0.0 ).rg; texcoord -= vec2( 0.0, 2.0 ) * resolution; if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break; } texcoord.y += 0.25 * resolution.y; texcoord.y += resolution.y; texcoord.y += 2.0 * resolution.y; texcoord.y -= resolution.y * searchLength( searchTex, e.gr, 0.5, 0.5 ); return texcoord.y; } vec2 getArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) { vec2 texcoord = float( ${q.glsl.int(h.maxDistanceAreaTex)} ) * round( 4.0 * vec2( e1, e2 ) ) + dist; texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE ); texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset; return texture( areaTex, texcoord, 0.0 ).rg; } void main() { vec2 size = vec2(textureSize(edgesTexture, 0)); vec2 resolution = 1.0 / size; vec2 pixelCoord = uv * size; vec4 offsets[2]; offsets[0] = uv.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 ); offsets[1] = uv.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 ); vec4 maxOffset = vec4( offsets[0].xz, offsets[1].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( ${q.glsl.int(h.maxSearchSteps)} ); ivec4 subsampleIndices = ivec4(0.0); vec4 weights = vec4(0.0); vec2 e = texture( edgesTexture, uv ).rg; if ( e.g > 0.0 ) { vec2 d; vec2 coords; coords.x = searchLeft( edgesTexture, searchTexture, offsets[0].xy, maxOffset.x, resolution ); coords.y = offsets[1].y; d.x = coords.x; float e1 = texture( edgesTexture, coords, 0.0 ).r; coords.x = searchRight( edgesTexture, searchTexture, offsets[0].zw, maxOffset.y, resolution ); d.y = coords.x; d = d * size.x - pixelCoord.x; vec2 sqrt_d = sqrt( abs(d) ); coords.y -= 1.0 * resolution.y; float e2 = sampleLevelZeroOffset( edgesTexture, coords, vec2( 1.0, 0.0 ), resolution).r; weights.rg = getArea( areaTexture, sqrt_d, e1, e2, float( subsampleIndices.y ) ); } if ( e.r > 0.0 ) { vec2 d; vec2 coords; coords.y = searchUp( edgesTexture, searchTexture, offsets[1].xy, maxOffset.z, resolution ); coords.x = offsets[0].x; d.x = coords.y; float e1 = texture( edgesTexture, coords, 0.0 ).g; coords.y = searchYDown( edgesTexture, searchTexture, offsets[1].zw, maxOffset.w, resolution ); d.y = coords.y; d = d * size.y - pixelCoord.y; vec2 sqrt_d = sqrt(abs(d)); coords.y -= 1.0 * resolution.y; float e2 = sampleLevelZeroOffset( edgesTexture, coords, vec2(0.0, 1.0), resolution).g; weights.ba = getArea( areaTexture, sqrt_d, e1, e2, float( subsampleIndices.x ) ); // for some reason the following lines are necessary to prevent // texture lookup precision issues on some Intel integrated graphics chips vec4 dbg = (offsets[0] + offsets[1] + maxOffset + coords.xyyx); weights.r += 0.00000001 * dot(vec4(0, 1, 0, 1), dbg); } fragColor = weights; }`);return c}const h={maxSearchSteps:8,maxDistanceAreaTex:16},f=Object.freeze(Object.defineProperty({__proto__:null,build:k},Symbol.toStringTag,{value:"Module"}));a.BlendWeights=f;a.build=k})},"esri/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/Blur.glsl ../../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.Blur,()=>new Promise((e,g)=>a(["../../shaders/Blur.glsl"],e,g)));b.SMAABlurTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Blur.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl", "../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],function(a,b,q,l,p){function k(){const f=new l.ShaderBuilder;f.include(b.ScreenSpacePass);f.fragment.uniforms.add(new p.Texture2DPassUniform("blendWeightsTexture",c=>c.inputTexture),new p.Texture2DPassUniform("colorTexture",c=>c.color));f.fragment.code.add(q.glsl`void main() { vec2 resolution = 1.0 / vec2(textureSize(colorTexture, 0)); vec4 offsets = vec4(uv.x + resolution.x, uv.y, uv.x, uv.y - resolution.y); vec4 a; a.rb = texture(blendWeightsTexture, uv).rb; a.g = texture(blendWeightsTexture, offsets.zw).g; a.a = texture(blendWeightsTexture, offsets.xy).a; if ( dot(a, vec4(1.0)) < 1e-5 ) { fragColor = texture( colorTexture, uv, 0.0 ); } else { vec2 offset; offset.x = a.a > a.b ? a.a : -a.b; offset.y = a.g > a.r ? -a.g : a.r; if ( abs( offset.x ) > abs( offset.y )) { offset.y = 0.0; } else { offset.x = 0.0; } vec4 C = texture( colorTexture, uv, 0.0 ); vec4 Cop = texture( colorTexture, uv + sign( offset ) * resolution.xy, 0.0 ); float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y ); fragColor = mix(C, Cop, s); } }`);return f}const h=Object.freeze(Object.defineProperty({__proto__:null,build:k},Symbol.toStringTag,{value:"Module"}));a.Blur=h;a.build=k})},"esri/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/EdgeDetect.glsl ../../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx, c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.EdgeDetect,()=>new Promise((e,g)=>a(["../../shaders/EdgeDetect.glsl"],e,g)));b.SMAAEdgeDetectTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/EdgeDetect.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces", "../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],function(a,b,q,l,p){function k(){const c=new l.ShaderBuilder;c.include(b.ScreenSpacePass);c.fragment.uniforms.add(new p.Texture2DPassUniform("colorTexture",e=>e.color));c.outputs.add("fragEdges","vec2");c.fragment.code.add(q.glsl` float absMax3(vec3 v) { vec3 t = abs(v); return max(max(t.r, t.g), t.b); } void main() { vec2 resolution = 1.0 / vec2(textureSize(colorTexture, 0)); vec4 offsets[3]; offsets[0] = vec4(uv.x - resolution.x, uv.y, uv.x, uv.y + resolution.y); offsets[1] = vec4(uv.x + resolution.x, uv.y, uv.x, uv.y - resolution.y); offsets[2] = vec4(uv.x - 2.0 * resolution.x, uv.y, uv.x, uv.y + 2.0 * resolution.y); // Calculate color deltas: vec4 delta; vec3 C = texture(colorTexture, uv).rgb; vec3 Cleft = texture(colorTexture, offsets[0].xy).rgb; delta.x = absMax3(C - Cleft); vec3 Ctop = texture(colorTexture, offsets[0].zw).rgb; delta.y = absMax3(C - Ctop); vec2 edges = step(vec2(${q.glsl.float(h.threshold)}), delta.xy); // discard if there is no edge: if (dot(edges, vec2(1.0)) == 0.0) { discard; } // Calculate right and bottom deltas: vec3 Cright = texture(colorTexture, offsets[1].xy).rgb; delta.z = absMax3(C - Cright); vec3 Cbottom = texture(colorTexture, offsets[1].zw).rgb; delta.w = absMax3(C - Cbottom); // Calculate the maximum delta in the direct neighborhood: float maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w); // Calculate left-left and top-top deltas: vec3 Cleftleft = texture(colorTexture, offsets[2].xy).rgb; delta.z = absMax3(C - Cleftleft); vec3 Ctoptop = texture(colorTexture, offsets[2].zw).rgb; delta.w = absMax3(C - Ctoptop); // Calculate the final maximum delta: maxDelta = max(max(maxDelta, delta.z), delta.w); // Local contrast adaptation in action: edges *= step(maxDelta, float(${q.glsl.float(h.localConstrastAdaption)}) * delta.xy); fragEdges = edges; } `);return c}const h={threshold:.05,localConstrastAdaption:2},f=Object.freeze(Object.defineProperty({__proto__:null,build:k},Symbol.toStringTag,{value:"Module"}));a.EdgeDetect=f;a.build=k})},"esri/views/3d/webgl-engine/effects/smaa/SMAAPassParameters":function(){define(["exports","../../core/shaderModules/interfaces"],function(a,b){class q extends b.NoParameters{}a.SMAAPassParameters=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/CompositingHelper":function(){define("../../../../chunks/Compositing.glsl ../shaders/CompositingTechnique ../shaders/CompositingTechniqueConfiguration ../../../../chunks/HUDCompositing.glsl ../shaders/HUDCompositingTechnique ../../../../chunks/OITCompositing.glsl ../shaders/OITCompositingTechnique".split(" "), function(a,b,q,l,p,k,h){class f{constructor(c,e){this._rctx=c;this._techniques=e;this._configuration=new q.CompositingTechniqueConfiguration;this._passParameters=new a.CompositingPassParameters;this._oitParameters=new k.OITCompositingPassParameters;this._hudParameters=new l.HUDCompositingPassParameters}compositeOIT(c,e,g,d){this._oitParameters.colorTexture=e;this._oitParameters.alphaTexture=g;this._oitParameters.frontFaceTexture=d;e=this._techniques.acquire(h.OITCompositingTechnique);this._rctx.bindTechnique(e, c,this._oitParameters);this._rctx.screen.draw();e.release()}compositeHUD(c,e){this._hudParameters.texture=e;e=this._techniques.acquire(p.HUDCompositingTechnique);this._rctx.bindTechnique(e,c,this._hudParameters);this._rctx.screen.draw();e.release()}composite(c,e,g=q.AlphaMode.None,d=1){this._configuration.alphaMode=g;this._configuration.hasOpacityFactor=1!==d;this._passParameters.texture=e;this._passParameters.opacity=d;e=this._techniques.acquire(b.CompositingTechnique,this._configuration);this._rctx.bindTechnique(e, c,this._passParameters);this._rctx.screen.draw();e.release()}blitDepthToLinearDepth(c,e){this._configuration.isDepthBlit=!0;this.composite(c,e);this._configuration.isDepthBlit=!1}}return f})},"esri/chunks/Compositing.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c){function e(t){const w=new f.ShaderBuilder;w.include(b.ScreenSpacePass);w.fragment.uniforms.add(new c.Texture2DPassUniform("tex",v=>v.texture));t.hasOpacityFactor&&w.fragment.uniforms.add(new k.FloatPassUniform("opacity",v=>v.opacity));t.isDepthBlit&&(w.fragment.uniforms.add(new p.Float2PassUniform("nearFar",(v,m)=>m.camera.nearFar)),w.fragment.include(q.ReadDepth),w.fragment.include(l.RgbaFloatEncoding));w.fragment.code.add(h.glsl` void main() { ${t.isDepthBlit?h.glsl` float normalizedLinearDepth = (-linearDepthFromTexture(tex, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]); fragColor = float2rgba(normalizedLinearDepth);`:h.glsl` fragColor = texture(tex, uv) ${t.hasOpacityFactor?"* opacity":""};`} }`);return w}class g extends h.NoParameters{constructor(){super(...arguments);this.opacity=1}}const d=Object.freeze(Object.defineProperty({__proto__:null,CompositingPassParameters:g,build:e},Symbol.toStringTag,{value:"Module"}));a.Compositing=d;a.CompositingPassParameters=g;a.build=e})},"esri/views/3d/webgl-engine/shaders/CompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/Compositing.glsl ./CompositingTechniqueConfiguration ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e){class g extends l.ShaderTechnique{initializeProgram(d){return new k.Program(d.rctx,g.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){switch(this.configuration.alphaMode){case f.AlphaMode.None:return e.makePipelineState({colorWrite:e.defaultColorWriteParams});case f.AlphaMode.Alpha:return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA), colorWrite:e.defaultColorWriteParams});case f.AlphaMode.PremultipliedAlpha:case f.AlphaMode.COUNT:return e.makePipelineState({blending:e.simpleBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:e.defaultColorWriteParams})}}}g.shader=new q.ReloadableShaderModule(h.Compositing,()=>new Promise((d,t)=>a(["./Compositing.glsl"],d,t)));b.CompositingTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration":function(){define(["exports", "../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){a.AlphaMode=void 0;(function(p){p[p.None=0]="None";p[p.Alpha=1]="Alpha";p[p.PremultipliedAlpha=2]="PremultipliedAlpha";p[p.COUNT=3]="COUNT"})(a.AlphaMode||(a.AlphaMode={}));class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.alphaMode=a.AlphaMode.None;this.isDepthBlit=this.hasOpacityFactor=!1}}b.__decorate([q.parameter({count:a.AlphaMode.COUNT})],l.prototype,"alphaMode", void 0);b.__decorate([q.parameter()],l.prototype,"hasOpacityFactor",void 0);b.__decorate([q.parameter()],l.prototype,"isDepthBlit",void 0);a.CompositingTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/HUDCompositing.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"], function(a,b,q,l,p){function k(){const c=new l.ShaderBuilder;c.include(b.ScreenSpacePass);c.fragment.uniforms.add(new p.Texture2DPassUniform("tex",e=>e.texture));c.fragment.code.add(q.glsl`void main() { fragColor = vec4(1.0 - texture(tex, uv).a); }`);return c}class h extends q.NoParameters{}const f=Object.freeze(Object.defineProperty({__proto__:null,HUDCompositingPassParameters:h,build:k},Symbol.toStringTag,{value:"Module"}));a.HUDCompositing=f;a.HUDCompositingPassParameters=h;a.build=k})},"esri/views/3d/webgl-engine/shaders/HUDCompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/HUDCompositing.glsl ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:{r:!1,g:!0,b:!1,a:!1}})}}c.shader=new q.ReloadableShaderModule(h.HUDCompositing,()=>new Promise((e,g)=>a(["./HUDCompositing.glsl"],e,g)));b.HUDCompositingTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/OITCompositing.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl", "../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],function(a,b,q,l,p){function k(){const c=new l.ShaderBuilder;c.include(b.ScreenSpacePass);c.fragment.uniforms.add(new p.Texture2DPassUniform("colorTexture",e=>e.colorTexture),new p.Texture2DPassUniform("alphaTexture",e=>e.alphaTexture),new p.Texture2DPassUniform("frontFaceTexture",e=>e.frontFaceTexture));c.fragment.code.add(q.glsl`void main() { float srcAlpha = texture(alphaTexture, uv).r; if(srcAlpha <= 1e-5){ discard; } vec4 srcColor = texture(colorTexture, uv); vec4 frontFace = texture(frontFaceTexture, uv); fragColor = vec4(mix(srcColor.rgb / srcAlpha, frontFace.rgb, frontFace.a), 1.0 - srcColor.a); }`);return c}class h extends q.NoParameters{}const f=Object.freeze(Object.defineProperty({__proto__:null,OITCompositingPassParameters:h,build:k},Symbol.toStringTag,{value:"Module"}));a.OITCompositing=f;a.OITCompositingPassParameters=h;a.build=k})},"esri/views/3d/webgl-engine/shaders/OITCompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/OITCompositing.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx,e.shader.get().build(),p.Default3D)}initializePipeline(){return c.makePipelineState({blending:c.separateBlendingParams(f.BlendFactor.SRC_ALPHA,f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA,f.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:c.defaultColorWriteParams})}}e.shader=new q.ReloadableShaderModule(h.OITCompositing,()=>new Promise((g,d)=>a(["./OITCompositing.glsl"],g,d)));b.OITCompositingTechnique= e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/depthRangeUtils":function(){define("exports ../../../../core/floatRGBA ../../../../core/PooledArray ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/frustum ../../../../chunks/sphere ../../support/mathUtils ./depthRange ./Octree ./Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(O,L){if(L.visible){var P=d.empty(),M=L.getSpatialQueryAccelerator();M?m(P,O,M):r(P,O,L.objects);return P}}function m(O,L,P){var M=L.eye;const K=L.viewForward,J=L.frustum,R=W=>W.visible;var Q=P.objectCount;500>Q?(d.set(N,L.near,Math.min(O.near,L.far)),P.forEachInDepthRange(M,K,t.DepthOrder.FRONT_TO_BACK,N,(W,S)=>{n(O,L,W);N.far=O.near;S.setRange(N)},J,R),d.set(N,Math.max(O.far,L.near),L.far),P.forEachInDepthRange(M,K,t.DepthOrder.BACK_TO_FRONT,N,(W, S)=>{n(O,L,W);N.near=O.far;S.setRange(N)},J,R)):(Q=Math.max(Math.min(Q,500),Math.ceil(.1*Q)),M=P.findClosest(K,t.DepthOrder.FRONT_TO_BACK,J,R,Q),P=P.findClosest(K,t.DepthOrder.BACK_TO_FRONT,J,R,Q),M&&P&&(x(O,L,M.boundingVolumeWorldSpace.bounds),x(O,L,P.boundingVolumeWorldSpace.bounds)))}function r(O,L,P){E.clear();P.forAll(M=>{M.visible&&0!==M.geometries.length&&E.add(M)});E.empty||(E.sort(L),d.set(N,L.near,Math.min(O.near,L.far)),E.forEachInDepthRange(N,t.DepthOrder.FRONT_TO_BACK,(M,K)=>{K{O.far=Math.max(O.far,J)}))}function n(O,L,P){if(P.visible&&c.intersectsSphere(L.frustum,P.boundingVolumeWorldSpace.bounds)){var M=P.transformation,K=H;P.geometries.forEach(J=>{l.multiply(K,M,J.transformation);const R=g.maxScale(K);u(O,L,J.boundingInfo,K,R)})}}function u(O,L,P,M,K){if(null!=P){k.transformMat4(e.getCenter(F),P.center,M);var {eye:J,viewForward:R}=L,Q=R[0]*(F[0]-J[0])+R[1]*(F[1]- J[1])+R[2]*(F[2]-J[2]);F[3]=P.radius*K;if(!(Q-F[3]>O.near&&Q+F[3]=-O[3];if(1===L)return O[1]>=-O[3];if(2===L)return O[0]<= O[3];if(3===L)return O[1]<=O[3];w.assert(!1)}function z(O,L,P){let M=0;0===P?M=(-O[3]-O[0])/(L[0]-O[0]+L[3]-O[3]):1===P?M=(-O[3]-O[1])/(L[1]-O[1]+L[3]-O[3]):2===P?M=(O[3]-O[0])/(L[0]-O[0]-L[3]+O[3]):3===P&&(M=(O[3]-O[1])/(L[1]-O[1]-L[3]+O[3]));return h.lerp(f.create(),O,L,M)}class A{constructor(){this._items=new q({allocator:O=>O||{object:null,distance:0,near:0,far:0},deallocator:O=>{O.object=null;O.distance=0;O.near=0;O.far=0;return O}})}get length(){return this._items.length}get empty(){return 0=== this._items.length}clear(){this._items.clear()}add(O){this._items.pushNew().object=O}sort(O){const L=O.eye,P=O.viewForward;this._items.forAll(M=>{const K=M.object.boundingVolumeWorldSpace.bounds,J=(K[0]-L[0])*P[0]+(K[1]-L[1])*P[1]+(K[2]-L[2])*P[2];M.distance=J;M.near=J-K[3];M.far=J+K[3]});this._items.sort((M,K)=>M.distance-K.distance)}forEachInDepthRange(O,L,P){if(L===t.DepthOrder.FRONT_TO_BACK)for(L=0;LO.far||P(M.object,M.near, M.far)}else for(L=this._items.length-1;0<=L;--L)M=this._items.data[L],M.farO.far||P(M.object,M.near,M.far)}}class B{constructor(){this._view=p.create();this._viewProj=p.create();this._frustum=c.create();this._geometries=[];this._near=[];this._far=[];this._nearCandidates=[];this._farCandidates=[];this._looseRange={near:0,far:0}}compute(O,L){this._reset();l.copy(this._view,O.viewMatrix);l.multiply(this._viewProj,O.projectionMatrix,this._view);c.copy(this._frustum,O.frustum);O=this._view; const P=O[2],M=O[6],K=O[10],J=O[14];L.forAll(W=>{W.materialReference&&W.forEachGeometry&&W.forEachGeometry(S=>{if(S.visible&&S.castShadow){var V=S.boundingSphere,T=P*V[0]+M*V[1]+K*V[2]+J,Y=T-V[3];V=T+V[3];this._geometries.push(S);this._near.push(-V);this._far.push(-Y)}})});L=new d.DepthRange;if(0===this._geometries.length)return L;for(O=0;OL.far&&(L.far=this._near[O]),2=O.near?L.near=this._near[W]:this._nearCandidates[R++]=W),this._far[W]>L.far&&(this._far[W]<=O.far?L.far=this._far[W]:this._farCandidates[Q++]=W);if(0===this._nearCandidates.length&&0===this._farCandidates.length)return L;this._nearCandidates.sort((W,S)=>this._near[W]this._near[S]?1:0);this._farCandidates.sort((W,S)=>this._far[W] this._far[S]?-1:0);for(O=0;OL.far&&(R=this._geometries[R],this._includeFarBoundingInfoRec(R.boundingInfo,R.shaderTransformation,L));this._reset();return L}_reset(){this._geometries.length=0;this._near.length=0;this._far.length=0;this._nearCandidates.length= 0;this._farCandidates.length=0}_includeNearBoundingInfoRec(O,L,P){if(null!=O){var M=O.center;k.transformMat4(e.getCenter(F),M,L);M=g.maxScale(L);var K=F[0],J=F[1],R=F[2];M*=O.radius;var Q=this._frustum;if(!(Q[0][0]*K+Q[0][1]*J+Q[0][2]*R+Q[0][3]>M||Q[1][0]*K+Q[1][1]*J+Q[1][2]*R+Q[1][3]>M||Q[2][0]*K+Q[2][1]*J+Q[2][2]*R+Q[2][3]>M||Q[3][0]*K+Q[3][1]*J+Q[3][2]*R+Q[3][3]>M||(K=this._view[2]*K+this._view[6]*J+this._view[10]*R+this._view[14],J=K+M,2>-(K-M)||-J>=P.near)))if(-J>this._looseRange.near)P.near= -J;else{if(100M||J[1][0]*K+J[1][1]*R+J[1][2]*Q+J[1][3]>M||J[2][0]*K+J[2][1]*R+J[2][2]*Q+J[2][3]>M||J[3][0]*K+J[3][1]*R+J[3][2]* Q+J[3][3]>M||(K=this._view[2]*K+this._view[6]*R+this._view[10]*Q+this._view[14]-M,-K<=P.far)))if(-KP;++P){var R=this._clipPosition[P],Q=0===P||3===P||4===P||7===P?M[0]:K[0],W=0===P||1===P||4===P||5===P?M[1]:K[1];const S=4>P?M[2]:K[2];R[0]=J[0]*Q+J[4]*W+J[8]*S+J[12];R[1]=J[1]*Q+J[5]*W+J[9]*S+J[13];R[2]=J[2]*Q+J[6]*W+J[10]*S+J[14];R[3]=J[3]*Q+J[7]*W+J[11]*S+J[15]}for(M=0;12>M;++M){K=[this._clipPosition[D[M][0]],this._clipPosition[D[M][1]],this._clipPosition[D[M][2]]];for(J=0;4>J;++J)for(P=K,K=[],R=0;R{if(!J.materialReference)return!1;M+=J.numGeometries;return 1E4<=M}))return G.compute(O,L);const K=d.empty();P.forAll(J=>d.union(K,v(O,J)));return K};a.textureToDepth=function(O,L,P){return b.unpackFloatRGBA(L,O)*(P[1]-P[0])+P[0]};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper":function(){define(["exports","../../../../core/NestedMap","../../../../core/libs/gl-matrix-2/factories/vec4f64","../../../../geometry/support/buffer/BufferView"], function(a,b,q,l){class p{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper";this.colorZero=new l.BufferViewVec4u8(new ArrayBuffer(4));this._layerToOidToColor=new b.NestedMap;this._colorToUID=new Map;this._layerUidToGraphicsUidToObjectId=new b.NestedMap;this._layerUidToId=new Map;this._layerUidToPopupEnabled=new Map}setUidToObjectAndLayerId(k,h,f,c,e,g=null,d=null,t=null){k&&h&&f&&c&&(this._layerUidToId.set(c,f),this._layerUidToPopupEnabled.set(c,e),e&& this._layerUidToGraphicsUidToObjectId.set(c,h,{objectId:k,attributeNodeId:g,attributeIndex:d,subLayerId:t}))}getObjectAndLayerIdColor(k){k=this.getObjectAndLayerIdColorArray(k);return q.fromValues(k.get(0,1),k.get(0,2),k.get(0,3),255)}getObjectAndLayerIdColorArray(k){if(!k.layerUid||!k.graphicUid)return this.colorZero;var h=this._layerUidToPopupEnabled.get(k.layerUid);if(void 0===h||!1===h)return this.colorZero;const f=this._layerUidToGraphicsUidToObjectId.get(k.layerUid,k.graphicUid)?.objectId;if(!f)return this.colorZero; h=this._layerToOidToColor.get(k.layerUid,f);if(!h){for(;!h;){const c=Math.floor(16777214*Math.random())+1;this._colorToUID.has(c)||(h=c)}if(16777215ua.immediate.schedule(Na)}class ya{constructor(ua,Na,Ua,wa,sa,Ha){this._stage=ua;this._techniques=Ua;this._rctx=wa;this._compositingHelper=sa;this._requestRender=Ha;this._pluginsHas={hudElements:!1,water:!1};this._hasOverlayWater=!1;this.renderOverlay=Ka=>{};this._inGlobeView=this._isRendering=!1;this._backgroundColor=z.fromValues(0, 0,0,1);this._sliceHelper=new ea;this._blit=null;this._state=d.signal(na.RenderState.IDLE);this._highQualityTransparencyEnabled=!0;this._terrainTransparency=D.TransparencyMode.Opaque;this._hasAnimations=this._ssrEnabled=!1;this._animationTimestep=new K.AnimationTimeStep;this._loadEdgeViewTask=null;this._edgeViewCallbacks=[];this._reprojectionMatrixVersion=d.signal(0);this._renderHiddenTransparentEdges=()=>{};this._pluginInput=new ba.RenderPluginInput;this._releaseNormals=Ka=>{Ka.some(({name:Aa})=> "normals"===Aa)&&this._pluginInput.release("normals")};this._debugNeedsDepth=!1;this.fboCache=new H.FBOCache(wa);this._renderStateFeatures=d.signal(ha.setupFeatureDefaults(!h("disable-feature:high-quality-idle"),ua.view.qualityProfile));this._offscreen=new V.OffscreenRendering(this.fboCache,this._compositingHelper);this.performanceInfo=new la.RendererPerformanceInfo(this._rctx);this._shadowMap=new ca.ShadowMap(this.fboCache,ua.viewingMode);this._viewshed=new ia.Viewshed({fboCache:this.fboCache,view:ua.view}, (Ka,Aa,Sa)=>{Aa.setGLViewport(this._rctx);const {camera:Ya,contentCamera:qa}=Ka;this._ensureBindParametersCamera(Aa,Aa);this._renderAllGeometry(Sa);this._ensureBindParametersCamera(Ya,qa);Ka.camera.setGLViewport(this._rctx)});this._shadowAccumulator=new Z.ShadowAccumulator(this.fboCache,Ua,ua,Ka=>{const Aa=this.shadowsEnabled;this._shadowMap.enabled=!0;this._ensureBindParametersCamera(Ka.camera,Ka.contentCamera);this._plugins.prepareRender();this._shadowMap.enabled=Aa},(Ka,Aa,Sa)=>{Ka.shadowMap.start(Ka.camera, Aa,Sa,!0,this._stage.view.qualitySettings.maximumPixelRatio);this._renderShadowCascades(E.ShaderOutput.Shadow,Ka.shadowMap);Ka.shadowMap.finish();Ka.camera.setGLViewport(this._rctx);this._ensureBindParametersCamera(Ka.camera,Ka.contentCamera)},Ha);this._renderContext=new T.RenderContext(this._rctx,this._offscreen,this._shadowMap,this._sliceHelper);this._nodes=new O.RenderNodes(this._renderContext);this._plugins=new P.RenderPluginManager({renderContext:this._renderContext,techniques:Ua,materials:Na, requestRender:Ha,controller:ua,fbos:this.fboCache,isFeatureEnabled:Ka=>this.isFeatureEnabled(Ka)});this.renderPassManager=new N.RenderPassManager;this._plugins.add(this.renderPassManager);this._plugins.add(this._viewshed);this._handles=[g.watch(()=>this._stage.view.state.camera,()=>Ha(),g.syncAndInitial),g.watch(()=>C.debugFlags.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,Ka=>{this._renderHiddenTransparentEdges=Ka?()=>this._renderEdges(ka.Transparency.TRANSPARENT):()=>{};Ha()},g.initial),g.watch(()=>this._stage.view.environment.background?.color, Ka=>{Ka=Ka?k.unitRGBAFromColor(Ka):z.ZEROS;y.set(this._backgroundColor,Ka[0]*Ka[3],Ka[1]*Ka[3],Ka[2]*Ka[3],Ka[3]);Ha()},g.syncAndInitial),g.watch(()=>this._stage.view.state.camera.relativeElevation,Ka=>{this._inGlobeView=(Ka??Infinity)>=I.distanceFadeEnd},g.syncAndInitial)]}destroy(){this._handles.forEach(ua=>ua.remove());this._gpuTimerHandle=f.removeMaybe(this._gpuTimerHandle);this._nodes.destroy();this._offscreen.dispose();this._shadowMap.dispose();this._shadowAccumulator.dispose();this._loadEdgeViewTask= f.abortMaybe(this._loadEdgeViewTask);this._edgeView=f.destroyMaybe(this._edgeView);this.renderPassManager.dispose();this._releaseFBOs();this._disposeOffscreenBuffers();this.fboCache.destroy();this._plugins.destroy();R.BoundingInfo.prune()}get _bindParameters(){return this._renderContext.bindParameters}updateRenderFeatures(ua=null,Na=!h("disable-feature:high-quality-idle")){this._renderStateFeatures.value=ha.setupFeatureDefaults(Na,ua);this._plugins.renderFeatureChanged();this._requestRender()}isFeatureEnabled(ua, Na=this._state.value){return this._renderStateFeatures.value.get(Na,ua)??!1}setFeatureEnabled(ua,Na,Ua){this._renderStateFeatures.mutate(wa=>wa.set(Na,ua,Ua));this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(ha.RenderFeature.HighQualityTransparency)}get hasReflections(){return(this._pluginsHas.water||this._hasOverlayWater)&&(this._ssrEnabled||this.isFeatureEnabled(ha.RenderFeature.WaterReflection))}get hasDecorations(){return this._plugins.hasDecorations|| this._nodes.produces("magnifier-color")}get hasHighlights(){return this._plugins.produces(E.ShaderOutput.Highlight,U.RenderSlot.OPAQUE_MATERIAL,U.RenderSlot.TRANSPARENT_MATERIAL,U.RenderSlot.DRAPED_MATERIAL)}get hasLaserlines(){return this._plugins.produces(this._renderContext.output,U.RenderSlot.LASERLINES,U.RenderSlot.LASERLINES_CONTRAST_CONTROL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(ha.RenderFeature.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled|| this.isFeatureEnabled(ha.RenderFeature.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(ha.RenderFeature.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=f.releaseMaybe(this._bindParameters.ssr.lastFrameColor);this._bindParameters.multipassTerrain.depth=f.releaseMaybe(this._bindParameters.multipassTerrain.depth);this._bindParameters.multipassGeometry.depth=f.releaseMaybe(this._bindParameters.multipassGeometry.depth)}_disposeOffscreenBuffers(){this._offscreen.dispose(); this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers();this._viewshed.viewshedShadowMap.disposeOffscreenBuffers();this._bindParameters.depth=f.releaseMaybe(this._bindParameters.depth);this._bindParameters.hudVisibility=f.releaseMaybe(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){if(this._loadEdgeViewTask)return this._loadEdgeViewTask.promise; this._loadEdgeViewTask=p.createTask(async ua=>{const {EdgeView:Na}=await new Promise((wa,sa)=>a(["./edgeRendering/EdgeView"],wa,sa));e.throwIfAborted(ua);const Ua=this._edgeView=new Na({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:za(this._stage.view.resourceController)});this._handles.push(g.watch(()=>Ua.updating,()=>this._requestRender(),g.sync));this._requestRender(); this._edgeViewCallbacks.forEach(wa=>wa(Ua));this._edgeViewCallbacks.length=0;return Ua});return this._loadEdgeViewTask.promise}withEdgeView(ua){this.loadEdgeView();null==this._edgeView?this._edgeViewCallbacks.push(ua):ua(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return 0<=this._reprojectionMatrixVersion.value&&u.equals(this._bindParameters.ssr.reprojectionMatrix,x.IDENTITY)}set _reprojectionMatrix(ua){l.update(this._bindParameters.ssr.reprojectionMatrix,ua)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(ua){const {_shadowMap:Na, _bindParameters:Ua}=this;void 0!==ua.qualitySettings?.reflections&&this._ssrEnabled!==ua.qualitySettings.reflections&&(this._ssrEnabled=ua.qualitySettings.reflections,this._requestRender());void 0!==ua.shadowMap&&this._shadowMap.enabled!==ua.shadowMap&&(this._shadowMap.enabled=ua.shadowMap,this._requestRender());void 0!==ua.shadowMapMaxCascades&&Na.maxCascades!==ua.shadowMapMaxCascades&&(Na.maxCascades=ua.shadowMapMaxCascades,this._requestRender());if(null!=ua.environment){null!=ua.environment.weather&& (this._bindParameters.weather=ua.environment.weather,this._bindParameters.weatherVisible=!!ua.weatherVisible);const wa="virtual"!==ua.environment.lighting.type;Ua.enableFillLights!==wa&&(Ua.enableFillLights=wa,this._requestRender())}void 0!==ua.highQualityTransparency&&this._highQualityTransparencyEnabled!==ua.highQualityTransparency&&(this._highQualityTransparencyEnabled=ua.highQualityTransparency,this._requestRender());void 0!==ua.hasOverlayWater&&this._hasOverlayWater!==ua.hasOverlayWater&&(this._hasOverlayWater= ua.hasOverlayWater,this._requestRender());void 0!==ua.slicePlane&&this._sliceHelper.plane!==ua.slicePlane&&(this._sliceHelper.plane=ua.slicePlane,this._requestRender());void 0!==ua.terrainTransparency&&this._terrainTransparency!==ua.terrainTransparency&&(this._terrainTransparency=ua.terrainTransparency,this._requestRender());void 0!==ua.shadowCast&&this._shadowAccumulator.setOptions(ua.shadowCast)}get hasSlicePlane(){return!!this._sliceHelper.plane}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&& this._hasOITSupport}modify(ua,Na){this._isRendering&&console.warn("Renderer.modify called while rendering");const {adds:Ua,removes:wa,updates:sa}=ua;if(0!==Ua.length||0!==wa.length||0!==sa.length){var Ha=!1;Y.splitRenderGeometryChangeSetByMaterial(ua).forEach((Ka,Aa)=>{if(!Na.done){var Sa=this._plugins.getMaterialRenderer(Aa);null==Sa&&0ua.removes.removeUnordered(Ya));Ka.adds.forEach(Ya=>ua.adds.removeUnordered(Ya));Ka.updates.forEach(Ya=>ua.updates.removeUnordered(Ya));Na.madeProgress()}});Ha&&this._plugins.removeEmptyMaterialRenderers();this._updateHasFlags();this._requestRender()}}_updateHasFlags(){const ua=this._pluginsHas;ua.hudElements=this._plugins.produces(E.ShaderOutput.Color,U.RenderSlot.LINE_CALLOUTS_HUD_DEPTH,U.RenderSlot.HUD_MATERIAL,U.RenderSlot.LABEL_MATERIAL);ua.water=this._plugins.produces(E.ShaderOutput.Normal, U.RenderSlot.DRAPED_WATER);this._bindParameters.hasOccludees=this._plugins.hasOccludees}updateAnimation(ua){const Na=this._hasAnimations;this._hasAnimations=this._plugins.updateAnimation(ua);this._hasAnimations=this._nodes.updateAnimation()||this._hasAnimations;this._hasAnimations!==Na&&(this._gpuTimerHandle=Na?f.removeMaybe(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo());return this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(ua, Na,Ua=Y.RendererTarget.Default,wa=J.Decorations.ON){this._isRendering=!0;this.performanceInfo.startFrame();this.fboCache.frameStart();this._disposeBindBuffers();const sa=this._offscreen,{camera:Ha,contentCamera:Ka,mode:Aa,alignPixelEnabled:Sa}=ua;this._state.value=Aa;this._bindParameters.overlay=this.renderOverlay(Na);this._bindParameters.overlay&&this.performanceInfo.advance(la.PerformanceCategory.OVERLAY);this._renderContext.time=Na;this._bindParameters.transparencyPassType=da.TransparencyPassType.NONE; this._bindParameters.alignPixelEnabled=Sa;this._bindParameters.decorations=wa;this._bindParameters.mainColor=this._bindParameters.mainDepth=null;this._bindParameters.viewshedEnabled=this._viewshed.enabled;ua=this._nodes.produces("magnifier-color");const Ya=this._nodes.produces("final-color"),qa=A.create(this._sliceHelper.plane);wa===J.Decorations.OFF&&(this._sliceHelper.plane=null);Ha.setGLViewport(this._rctx);var aa=sa.initializeFrame(Ha,this._backgroundColor,Ua);this.hasReflections?this._bindParameters.ssr.lastFrameColor= aa:aa?.release();this._ensureBindParametersCamera(Ha,Ka);this._plugins.prepareRender();this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&wa===J.Decorations.ON;var Ja=this._plugins.produces(E.ShaderOutput.Color,U.RenderSlot.OPAQUE_TERRAIN)&&(this._terrainTransparency===D.TransparencyMode.Semitransparent||this._terrainTransparency===D.TransparencyMode.TransparentWithDraped);aa=this._highQualityTransparency&&Ja;const Ta=this._plugins.produces(E.ShaderOutput.Color,...Ma);this._prepareShaders(aa, Ta);this.performanceInfo.advance(la.PerformanceCategory.PREPARE);var Ra=this._computeDepthRange(Ha);this._renderShadowMap(Ha,this._bindParameters.lighting.mainLight.direction,Ra);this._ensureBindParametersCamera(Ha,Ka);let $a=this._renderNormals();this._pluginInput.set("normals",$a);if($a){let pa=null;this._needsDepth&&(pa=$a.getAttachment(va.DepthStencilAttachment),pa?.retain());this._pluginInput.set("ssao",this._renderSSAO());this._renderNoSSAOGeometryDepth(pa);$a=null}else this._renderAllGeometryDepth(); this._renderShadowAccumulation(Ra,Ha,Ka);this._ensureBindParametersSSR(Na);this._renderContext.output=E.ShaderOutput.Color;sa.bindFbo();this._bindParameters.mainColor=sa.colorTexture;this._bindParameters.mainDepth=sa.depthTexture;const bb=this.plugins.produces(E.ShaderOutput.Color,...xa);bb&&this._renderOpaqueGeometry();this._offscreen.updateColor(pa=>this._renderNodes(B.RenderCategory.OPAQUE,pa,bb));this.fboCache.debugCallback?.("opaque-color",this._offscreen.color.fbo);this._renderPlugins(U.RenderSlot.OPAQUE_ENVIRONMENT, la.PerformanceCategory.OPAQUE_ENVIRONMENT);this._renderMultipassTerrainDepth(aa);this._setMultipassTerrain(aa);this._renderEdges(ka.Transparency.OPAQUE);sa.bindFbo();this._renderPlugins(U.RenderSlot.VOXEL,la.PerformanceCategory.VOXEL);this._renderHiddenTransparentEdges();Ta&&(this._oitEnabled?this._renderOITPass(Da.Geometry):this._renderTransparentMaterial());this._offscreen.updateColor(pa=>this._renderNodes(B.RenderCategory.TRANSPARENT,pa,Ta));this.fboCache.debugCallback?.("transparent-color",this._offscreen.color.fbo); this._renderMultipassGeometryDepth(aa);this._renderHUDVisibility();aa||this._plugins.render(this._pluginInput,U.RenderSlot.LINE_CALLOUTS);Na=Ua===Y.RendererTarget.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;this._renderEdges(ka.Transparency.TRANSPARENT);if(Ja=Ja?this._renderTransparentTerrain():null)this.performanceInfo.advance(la.PerformanceCategory.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(aa?this._renderLineCallouts(G.HUDRenderStyle.Occluded):sa.compositeToHUDVisibility(this._bindParameters, Ja.getTexture()),this._renderHUD(G.HUDRenderStyle.Occluded,sa.color));this._setTerrainCulling(!1);Ja&&(sa.compositeToFramebuffer(this._bindParameters,Ja.getTexture(),X.AlphaMode.PremultipliedAlpha,1),Ja.release(),aa&&(this._renderEdges(ka.Transparency.OPAQUE),Ta&&(this._oitEnabled?this._renderOITPass(Da.Geometry):this._renderTransparentMaterial(),this.performanceInfo.advance(la.PerformanceCategory.TRANSPARENT)),this._renderEdges(ka.Transparency.TRANSPARENT)));this._bindParameters.ssao=f.releaseMaybe(this._bindParameters.ssao); aa&&this._renderLineCallouts(G.HUDRenderStyle.NotOccluded);this._setMultipassEnabled(!1);this._renderTransparentEnvironment();this._renderViewshed();this._renderLaserlines();this._renderOccluded();this._pluginInput.set("highlights",this._renderHighlightPrepass());this._offscreen.updateColor(pa=>this._renderNodes(B.RenderCategory.COMPOSITE,pa));aa=this._nodes.produces("aa-color");Ra=Ua===Y.RendererTarget.Default&&!Ya&&!(ua&&wa===J.Decorations.ON&&Ua===Y.RendererTarget.Default);Ja=this._pluginInput.get("composite-color"); Ra=Ra?H.defaultWebGLFBO:this.fboCache.acquire(Ja.fbo.width,Ja.fbo.height,"aa-color");aa=aa?this._renderNodes(B.InternalRenderCategory.ANTIALIASING,Ra):this._blitToDefault(Ja,Ra,!1);this._pluginInput.set(B.InternalRenderCategory.ANTIALIASING,aa);this._renderHUD(G.HUDRenderStyle.NotOccluded,aa);aa=this._renderNodes(B.InternalRenderCategory.HIGHLIGHTS,aa);aa=this._renderNodes(B.InternalRenderCategory.MAGNIFIER,aa);ua&&wa===J.Decorations.ON&&Ua===Y.RendererTarget.Default&&!Ya&&(aa=this._blitToDefault(aa)); Ya?(aa.attachDepth(sa.depth),this._blitToDefault(this._renderNodes(B.RenderCategory.FINAL,aa)),aa.detachDepth()):this._pluginInput.set(B.RenderCategory.FINAL,aa);this._pluginInput.release("highlights");if(this.onPostRender)this.onPostRender();this._releaseFBOs();this._offscreen.releaseBuffers();this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera);this._sliceHelper.plane=qa;this._isRendering=!1;this.fboCache.frameEnd();this.performanceInfo.finishFrame();Ua!==Y.RendererTarget.Default&& (this._releaseFBOs(),this._disposeOffscreenBuffers());return{screen:this._pluginInput.get("final-color"),oid:Na}}_prepareShaders(ua,Na){this._renderContext.output=E.ShaderOutput.Color;this._prepareOpaqueGeometry();this._setMultipassTerrain(ua);this._plugins.prepare(U.RenderSlot.TRANSPARENT_TERRAIN);this._setMultipassTerrain(!1);ua||this._plugins.prepare(U.RenderSlot.LINE_CALLOUTS);Na&&this._prepareTransparencySlots();this._plugins.prepare(U.RenderSlot.VIEWSHED,U.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL, U.RenderSlot.TRANSPARENT_ENVIRONMENT,U.RenderSlot.LASERLINES);this._rctx.gl.flush()}_renderObjectAndLayerIdColor(){if(h("enable-feature:objectAndLayerId-rendering")){var ua=this._renderContext.output,Na=this.fboCache.acquire(this._offscreen.width,this._offscreen.height,"oid");Na.acquireDepth(F.DepthFormat.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(Na.fbo);this.fboCache.rctx.clearFramebuffer([0,0,0,0],!0,!0);this._renderAllGeometry(E.ShaderOutput.ObjectAndLayerIdColor);this._rctx.bindFramebuffer(Na.fbo); this.fboCache.rctx.clearFramebuffer(void 0,!0,!0);this._bindParameters.hudRenderStyle=G.HUDRenderStyle.NotOccluded;this._plugins.render(this._pluginInput,U.RenderSlot.HUD_MATERIAL);this._renderContext.output=ua;this.performanceInfo.advance(la.PerformanceCategory.OBJECT_AND_LAYER_ID_COLOR);return Na}}finish(ua){this._hasAnimations||this._animationTimestep.clear();var Na=this.performanceInfo.gpuSamplingEnabled;if((ua=ua===J.RenderRequestType.BACKGROUND)||Na){const Ua=ua?this.performanceInfo.elapsedTime: 0;Na=Na?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError();this._animationTimestep.frame(Math.max(Ua,Na),ua)}}readDepthPixels(ua,Na){if(this._bindParameters.mainDepth){var {width:Ua,height:wa}=this._offscreen,sa=this.fboCache.acquire(Ua,wa,"linear-depth");this._rctx.bindFramebuffer(sa.fbo);this._bindParameters.camera.setGLViewport(this._rctx);this._rctx.clearFramebuffer([0,0,0,0],!0,!0);this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,this._bindParameters.mainDepth); sa.fbo?.readPixels(ua[0],ua[1],ua[2],ua[3],va.PixelFormat.RGBA,va.PixelType.UNSIGNED_BYTE,Na);sa.release()}}readHUDVisibility(ua,Na,Ua,wa,sa){this._bindParameters.hudVisibility?.fbo?.readPixels(ua,Na,Ua,wa,va.PixelFormat.RGBA,va.PixelType.UNSIGNED_BYTE,sa)}readAccumulatedShadow(ua){return this._shadowAccumulator.readAccumulatedShadow(ua[0],ua[1])}_setMultipassTerrain(ua){this._setMultipassEnabled(ua);this._setTerrainCulling(ua)}_setMultipassEnabled(ua){this._bindParameters.multipassEnabled=ua}_setTerrainCulling(ua){this._bindParameters.multipassTerrain.cullAboveGround= ua}_renderEdges(ua){const Na=this._edgeView;if(Na?.shouldRender()){var {width:Ua,height:wa,depth:sa}=this._offscreen,Ha=this.fboCache.acquire(Ua,wa,"edges");this._offscreen.renderToTargets(()=>Na.render(this._bindParameters,ua),Ha,this._bindParameters.multipassGeometry.depth??sa,ra);this._offscreen.compositeToFramebuffer(this._bindParameters,Ha.getTexture(),X.AlphaMode.Alpha,1);Ha.release();this.performanceInfo.advance(ua===ka.Transparency.OPAQUE?la.PerformanceCategory.OPAQUE_EDGES:la.PerformanceCategory.TRANSPARENT_EDGES)}}_renderShadowMap(ua, Na,Ua){const wa=this._shadowMap;wa.enabled&&(wa.start(ua,Na,Ua,this.isFeatureEnabled(ha.RenderFeature.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(E.ShaderOutput.ShadowHighlight,this._shadowMap),wa.moveSnapshot(ca.SnapshotSlot.Highlight),this._renderShadowCascades(E.ShaderOutput.ShadowExcludeHighlight,this._shadowMap),wa.copySnapshot(ca.SnapshotSlot.ExcludeHighlight),this._renderShadowCascades(E.ShaderOutput.ShadowHighlight, this._shadowMap)):this._renderShadowCascades(E.ShaderOutput.Shadow),wa.finish(),ua.setGLViewport(this._rctx),this.performanceInfo.advance(la.PerformanceCategory.SHADOW_MAP))}_renderShadowCascades(ua,Na=this._shadowMap){for(const Ua of Na.cascades)Ua.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(Ua.camera,Ua.camera),this._renderAllGeometry(ua)}get _needsDepth(){return this._plugins.consumes(E.ShaderOutput.Depth)||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast|| this._debugNeedsDepth}_renderNoSSAOGeometryDepth(ua){if(this._needsDepth&&ua){var {width:Na,height:Ua}=this._offscreen,wa=this.fboCache.acquire(Na,Ua,"depth");wa.attachDepth(ua);ua.release();this._rctx.bindFramebuffer(wa.fbo);this._rctx.clearFramebuffer(void 0,!1,!0);this._renderGeometryExcludedFromSSAO(E.ShaderOutput.Depth);f.releaseMaybe(this._bindParameters.depth);this._bindParameters.depth=wa.obtainDepthTexture();wa.release();this.performanceInfo.advance(la.PerformanceCategory.DEPTH)}else this._bindParameters.depth= f.releaseMaybe(this._bindParameters.depth)}_renderAllGeometryDepth(){if(this._needsDepth){var {width:ua,height:Na}=this._offscreen,Ua=this.fboCache.acquire(ua,Na,"depth").acquireDepth(F.DepthFormat.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(Ua.fbo);this._rctx.clearFramebuffer(void 0,!0,!0);this._renderAllGeometry(E.ShaderOutput.Depth);f.releaseMaybe(this._bindParameters.depth);this._bindParameters.depth=Ua.obtainDepthTexture();Ua.release();this.performanceInfo.advance(la.PerformanceCategory.DEPTH)}else this._bindParameters.depth= f.releaseMaybe(this._bindParameters.depth)}_renderMultipassTerrainDepth(ua){if(ua){ua=this._renderContext.output;this._renderContext.output=E.ShaderOutput.Depth;var {width:Na,height:Ua}=this._offscreen,wa=this.fboCache.acquire(Na,Ua,"terrain depth").acquireDepth(F.DepthFormat.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(wa.fbo);this._rctx.clearFramebuffer(void 0,!0,!0);this._renderTransparentTerrain();f.releaseMaybe(this._bindParameters.multipassTerrain.depth);this._bindParameters.multipassTerrain.depth= wa.obtainDepthTexture();this._renderContext.output=ua;wa.release()}else this._bindParameters.multipassTerrain.depth=f.releaseMaybe(this._bindParameters.multipassTerrain.depth)}_renderMultipassGeometryDepth(ua){if(ua){ua=this._renderContext.output;var {width:Na,height:Ua}=this._offscreen,wa=this.fboCache.acquire(Na,Ua,"geometry depth").acquireDepth(F.DepthFormat.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(wa.fbo);this._rctx.clearFramebuffer(void 0,!0,!0);this._renderOpaqueGeometryAndTransparentMaterial(E.ShaderOutput.Depth); this._renderContext.output=ua;f.releaseMaybe(this._bindParameters.multipassGeometry.depth);this._bindParameters.multipassGeometry.depth=wa.obtainDepthTexture();wa.release()}else this._bindParameters.multipassGeometry.depth=f.releaseMaybe(this._bindParameters.multipassGeometry.depth)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(ua){if(!this._needsDepthRange)return Q.zero;const Na=W.depthRangeFromScene(ua,this._plugins.plugins,this._stage.layers);Q.union(Na, this._plugins.queryDepthRange(ua));Na.near=Math.max(ua.near,Na.near);Na.far=Math.min(ua.far,Na.far);return Na}_renderNormals(){var ua=this._nodes.require("normals","final-color","composite-color","opaque-color","transparent-color");ua=(this.hasSSAO?1:0)+(this.hasLaserlines?1:0)+ua;if(0!==ua){var Na=this._offscreen.renderToCachedFBO(null,"normals",()=>this._renderGeometryForSSAO(E.ShaderOutput.Normal),[0,0,0,0],F.ColorFormat.RGBA,F.DepthFormat.DEPTH_STENCIL_TEXTURE),Ua=this._nodes.optional("normals", "final-color","composite-color","opaque-color","transparent-color")+(this._viewshedEnabled?1:0);Na.retain(ua+Ua-1);this.performanceInfo.advance(la.PerformanceCategory.NORMALS);return Na}}_renderSSAO(){const ua=this._pluginInput.get("normals");if(this.hasSSAO&&ua){var Na=this._nodes.render("ssao",this._pluginInput);this._bindParameters.ssao=Na;ua.detachDepth();this._pluginInput.release("normals");this.performanceInfo.advance(la.PerformanceCategory.SSAO);return Na}ua?.detachDepth()}_renderAllGeometry(ua){this._renderContext.output= ua;this._plugins.prepare(U.RenderSlot.TRANSPARENT_TERRAIN);this._renderOpaqueGeometryAndTransparentMaterial(ua);this._renderTransparentTerrain()}_renderOpaqueGeometryAndTransparentMaterial(ua){this._renderContext.output=ua;this._plugins.prepare(U.RenderSlot.TRANSPARENT_MATERIAL,U.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH);this._renderOpaqueGeometry();this._renderTransparentMaterial()}_renderGeometryForSSAO(ua){this._renderContext.output=ua;this._plugins.render(this._pluginInput,U.RenderSlot.INTEGRATED_MESH, U.RenderSlot.OPAQUE_TERRAIN,U.RenderSlot.OPAQUE_MATERIAL,U.RenderSlot.TRANSPARENT_MATERIAL);this._renderTransparentTerrain()}_renderGeometryExcludedFromSSAO(ua){this._renderContext.output=ua;this._plugins.render(this._pluginInput,U.RenderSlot.OPAQUE_NO_SSAO_DEPTH,U.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH)}_prepareOpaqueGeometry(){this._plugins.prepare(...xa,U.RenderSlot.OPAQUE_ENVIRONMENT)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...xa)}_renderTransparentMaterial(){this._plugins.render(this._pluginInput, ...Ma)}_renderTransparentTerrain(){var ua=this._renderContext.output;if(this._plugins.produces(ua,U.RenderSlot.TRANSPARENT_TERRAIN)){var Na=()=>this._plugins.render(this._pluginInput,U.RenderSlot.TRANSPARENT_TERRAIN);if(ua!==E.ShaderOutput.Color)Na();else{var {width:Ua,height:wa,depth:sa}=this._offscreen;ua=this.fboCache.acquire(Ua,wa,"transparent terrain");this._offscreen.renderToTargets(Na,ua,sa,[0,0,0,0]);return ua}}}_renderHUDVisibility(){this._plugins.produces(this._renderContext.output,U.RenderSlot.OCCLUSION_PIXELS)? (this._bindParameters.hudVisibility=this._offscreen.renderHUDVisibility(this._bindParameters.hudVisibility,()=>this._plugins.render(this._pluginInput,U.RenderSlot.OCCLUSION_PIXELS),this._bindParameters.multipassGeometry.depth),this._offscreen.bindFbo(),this.performanceInfo.advance(la.PerformanceCategory.HUD_VISIBILITY)):this._bindParameters.hudVisibility=f.releaseMaybe(this._bindParameters.hudVisibility)}_renderLineCallouts(ua){this._bindParameters.hudRenderStyle=ua;if(ua===G.HUDRenderStyle.Occluded){const {width:Na, height:Ua,color:wa}=this._offscreen;ua=this.fboCache.acquireDepth(F.DepthFormat.DEPTH16_BUFFER,Na,Ua,"line callouts");this._offscreen.renderToTargets(()=>this._plugins.render(this._pluginInput,U.RenderSlot.LINE_CALLOUTS),wa,ua,void 0,!0,!0);ua.release()}else this._plugins.render(this._pluginInput,U.RenderSlot.LINE_CALLOUTS)}_renderLaserlines(){if(this.hasLaserlines){this._plugins.render(this._pluginInput,U.RenderSlot.LASERLINES);if(this._plugins.produces(this._renderContext.output,U.RenderSlot.LASERLINES_CONTRAST_CONTROL)){const ua= this._offscreen,{width:Na,height:Ua,depth:wa}=ua,sa=this.fboCache.acquire(Na,Ua,"laser lines");ua.renderToTargets(()=>this._plugins.render(this._pluginInput,U.RenderSlot.LASERLINES_CONTRAST_CONTROL),sa,wa,ra);ua.compositeToFramebuffer(this._bindParameters,sa.getTexture(),X.AlphaMode.PremultipliedAlpha,1);sa.release()}this._pluginInput.release("normals");this.performanceInfo.advance(la.PerformanceCategory.LASER_LINES)}}_renderHUD(ua,Na){if(this._pluginsHas.hudElements){if(this._oitEnabled){const Ua= this._renderOITPass(Da.HUD,ua);this._rctx.bindFramebuffer(Na.fbo);this._compositingHelper.composite(this._bindParameters,Ua.getTexture(),X.AlphaMode.PremultipliedAlpha);Ua.release()}else if(ua===G.HUDRenderStyle.Occluded){this._renderContext.output=E.ShaderOutput.Color;const {width:Ua,height:wa,color:sa}=this._offscreen;Na=this.fboCache.acquireDepth(F.DepthFormat.DEPTH16_BUFFER,Ua,wa,"hud");this._offscreen.renderToTargets(()=>this._renderHUDElements(ua),sa,Na,void 0,!0,!0);Na.release()}else this._renderContext.output= E.ShaderOutput.Color,Na.acquireDepth(F.DepthFormat.DEPTH16_BUFFER),this._rctx.bindFramebuffer(Na.fbo),this._renderHUDElements(ua),Na.detachDepth();this.performanceInfo.advance(ua===G.HUDRenderStyle.Occluded?la.PerformanceCategory.HUD_OCCLUDED:la.PerformanceCategory.HUD)}}_renderHUDElements(ua){this._bindParameters.hudRenderStyle=ua;this._plugins.prepare(U.RenderSlot.LINE_CALLOUTS_HUD_DEPTH,U.RenderSlot.HUD_MATERIAL,U.RenderSlot.LABEL_MATERIAL);this._plugins.render(this._pluginInput,U.RenderSlot.LINE_CALLOUTS_HUD_DEPTH, U.RenderSlot.HUD_MATERIAL,U.RenderSlot.LABEL_MATERIAL)}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._plugins.produces(E.ShaderOutput.ShadowHighlight,U.RenderSlot.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(this.hasHighlights){var ua=this._offscreen.renderToCachedFBO(null,"highlights",()=>{this._renderAllGeometry(E.ShaderOutput.Highlight);this._rctx.clear(va.ClearBufferBit.DEPTH_BUFFER_BIT);this._renderHUDElements(G.HUDRenderStyle.Both)},[0,0,0,0],F.ColorFormat.RGBA4,F.DepthFormat.DEPTH_STENCIL_TEXTURE); ua.detachDepth();return ua}}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(ua,Na,Ua){this._needsShadowCast&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,ua,Na,Ua)&&this.performanceInfo.advance(la.PerformanceCategory.ACCUMULATED_SHADOWS)}_prepareTransparencySlots(){this._renderContext.output=E.ShaderOutput.Color;this._bindParameters.transparencyPassType=da.TransparencyPassType.ColorAlpha;this._plugins.prepare(...Ma); this._bindParameters.transparencyPassType=da.TransparencyPassType.FrontFace;this._plugins.prepare(...Ma);this._bindParameters.transparencyPassType=da.TransparencyPassType.NONE;this._techniques.acquire(ja.OITCompositingTechnique).release()}_renderOITPass(ua,Na=G.HUDRenderStyle.Both){var Ua=ua===Da.HUD;ua=Ua?this.fboCache.acquire(this._offscreen.width,this._offscreen.height,"oit hud composite"):null;const wa=Ua?()=>this._renderHUDElements(Na):()=>this._renderTransparentMaterial(),sa=this._renderContext.output; this._renderContext.output=E.ShaderOutput.Color;this._bindParameters.transparencyPassType=da.TransparencyPassType.ColorAlpha;const Ha=this._offscreen.renderOITPass(wa,da.TransparencyPassType.ColorAlpha,Ua);this._bindParameters.transparencyPassType=da.TransparencyPassType.FrontFace;Ua=this._offscreen.renderOITPass(wa,da.TransparencyPassType.FrontFace,Ua);this._offscreen.compositeOIT(this._bindParameters,Ha,Ua,ua);ua?.detachDepth();Ua.release();Ha.release();this._bindParameters.transparencyPassType= da.TransparencyPassType.NONE;this._renderContext.output=sa;return ua}_renderOccluded(){let ua=0;Ga.clear();this._plugins.plugins.forAll(Aa=>{Aa.materialReference&&Aa.queryRenderOccludedState(S.RenderOccludedFlag.OccludeAndTransparentStencil)&&(ua|=S.RenderOccludedFlag.OccludeAndTransparentStencil,Ga.push(Aa))});const Na=this._offscreen,Ua=(Aa,Sa,Ya,qa,aa)=>{if(0!==(ua&Sa)){var {width:Ja,height:Ta,depth:Ra}=Na;Sa=this.fboCache.acquire(Ja,Ta,"tmp color");Na.renderToTargets(Ya,Sa,Ra,[0,0,0,0],qa,aa); Na.compositeToFramebuffer(this._bindParameters,Sa.getTexture(),X.AlphaMode.PremultipliedAlpha,Aa);Sa.release()}},wa=(Aa,Sa)=>{this._bindParameters.slot=Aa;Sa.forAll(Ya=>{if(L.isPrepareRenderPlugin(Ya)){const qa=Ya.prepareTechnique(this._renderContext);qa&&Ya.renderNode(this._renderContext,qa)}})};0!==Ga.length&&(wa(U.RenderSlot.OCCLUDER_MATERIAL,Ga),Ua(.5,S.RenderOccludedFlag.OccludeAndTransparentStencil,()=>wa(U.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL,Ga),!1,!1));const sa=0{if(Aa.materialReference){var Sa=Aa.queryRenderOccludedState(S.RenderOccludedFlag.OccludeAndTransparent),Ya=Aa.queryRenderOccludedState(S.RenderOccludedFlag.Transparent),qa=Aa.queryRenderOccludedState(S.RenderOccludedFlag.Opaque);if(Sa||Ya||qa)ua|=Sa?S.RenderOccludedFlag.OccludeAndTransparent:Ya?S.RenderOccludedFlag.Transparent:S.RenderOccludedFlag.Opaque,Ga.push(Aa)}});const Ha=this._plugins.renderOccludedFlags;if(ua|=Ha){var Ka=Aa=>{this._renderContext.renderOccludedMask= Aa;Ha>S.RenderOccludedFlag.Occlude&&this._plugins.render(this._pluginInput,U.RenderSlot.OCCLUDED_TERRAIN);wa(U.RenderSlot.OPAQUE_MATERIAL,Ga);wa(U.RenderSlot.TRANSPARENT_MATERIAL,Ga);wa(U.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,Ga);this._renderContext.renderOccludedMask=T.defaultRenderOccludedMask};this._renderContext.output=E.ShaderOutput.Color;Ua(.5,S.RenderOccludedFlag.OccludeAndTransparent,()=>Ka(S.RenderOccludedFlag.OccludeAndTransparent),!0,J.StencilBits.OutlineVisualElementMask); Ua(.5,S.RenderOccludedFlag.Transparent,()=>Ka(S.RenderOccludedFlag.Transparent),!0,J.StencilBits.OutlineVisualElementMask);Ua(1,S.RenderOccludedFlag.Opaque,()=>Ka(S.RenderOccludedFlag.Opaque),!0,J.StencilBits.OutlineVisualElementMask);(sa||0this._bindParameters.ssr.fadeFactor&&this._requestRender()}else this._reprojectionMatrix=x.IDENTITY,this._ssrEnableTime=null}addRenderNode(ua){this._nodes.add(ua);this._requestRender()}removeRenderNode(ua){this._nodes.remove(ua); this._requestRender()}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}get _viewshedEnabled(){return this._viewshed.enabled&&this._plugins.produces(this._renderContext.output,U.RenderSlot.VIEWSHED)}get test(){}}q.__decorate([t.property({readOnly:!0})],ya.prototype,"fullResolutionAtmosphere",null);q.__decorate([t.property()],ya.prototype,"_edgeView",void 0);q.__decorate([t.property()],ya.prototype,"updating",null);var Da;(function(ua){ua[ua.Geometry= 0]="Geometry";ua[ua.HUD=1]="HUD"})(Da||={});b.FramebufferId=void 0;(function(ua){ua[ua.Color=0]="Color";ua[ua.LinearDepth=1]="LinearDepth";ua[ua.ShadowMap=2]="ShadowMap";ua[ua.HudVisibility=3]="HudVisibility";ua[ua.ViewshedShadowMap=4]="ViewshedShadowMap"})(b.FramebufferId||(b.FramebufferId={}));const ra=[0,0,0,0],xa=[U.RenderSlot.INTEGRATED_MESH,U.RenderSlot.OPAQUE_TERRAIN,U.RenderSlot.OPAQUE_MATERIAL,U.RenderSlot.OPAQUE_NO_SSAO_DEPTH],Ma=[U.RenderSlot.TRANSPARENT_MATERIAL,U.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH], Ga=new c,Pa=x.create(),Qa=x.create(),Ea=x.create();b.Renderer=ya;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl":function(){define(["exports","../../core/libs/gl-matrix-2/factories/mat4f64","../../geometry/projection/computeTranslationToOriginAndRotation","../../geometry/projection/projectBuffer"],function(a,b,q,l){a.RenderCategory=void 0;(function(p){p.OPAQUE="opaque-color";p.TRANSPARENT="transparent-color";p.COMPOSITE="composite-color";p.FINAL="final-color"})(a.RenderCategory|| (a.RenderCategory={}));a.InternalRenderCategory=void 0;(function(p){p.ANTIALIASING="aa-color";p.HIGHLIGHTS="highlight-color";p.MAGNIFIER="magnifier-color"})(a.InternalRenderCategory||(a.InternalRenderCategory={}));a.fromRenderCoordinates=function(p,k,h,f,c,e,g){e=e||p.spatialReference;return l.projectBuffer(k,p.renderCoordsHelper.spatialReference,h,f,e,c,g)?f:null};a.renderCoordinateTransformAt=function(p,k,h,f){f||=b.create();h=h||p.spatialReference;return q.computeTranslationToOriginAndRotation(h, k,f,p.renderCoordsHelper.spatialReference)?f:null};a.toRenderCoordinates=function(p,k,h,f,c,e,g){f=f||p.spatialReference;return l.projectBuffer(k,f,h,c,p.renderCoordsHelper.spatialReference,e,g)?c:null};a.webgl=null;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/FBOCache":function(){define("exports ../../webgl/formats ../../webgl/ManagedColorAttachment ../../webgl/ManagedDepthAttachment ../../webgl/ManagedFBO ../../webgl/ManagedFBObject ./FBOPool ../../../webgl/enums ../../../webgl/FramebufferObject ../../../webgl/Renderbuffer ../../../webgl/RenderbufferDescriptor ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w{constructor(C){this.rctx=C;this._acquired=new Set;this._cache=new h.FBOPool(C.newCache,"FBOCache");this._depthCache=new h.FBOPool(C.newCache,"DepthAttachmentCache");this._colorCache=new h.FBOPool(C.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy();this._depthCache.destroy();this._colorCache.destroy()}clean(){this._cache.clean();this._colorCache.clean();this._depthCache.clean()}frameStart(){this._cache.frame();this._colorCache.frame();this._depthCache.frame(); this.debugCallback&&this.debugCallback()}frameEnd(){const C=this.debugCallback;C&&this._acquired.forEach(D=>D.type===k.AttachmentType.FBO&&C(D.name,D.fbo))}get usedMemory(){return Array.from(this._acquired.values()).reduce((C,D)=>C+("getTexture"in D?D.getTexture()?.usedMemory??0:D.usedMemory),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(C){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=C}acquire(C,D,F,H=b.ColorFormat.RGBA){const N= `${H}x${C}x${D}`;let E=this._cache.pop(N);E?(E.retain(),E.setName(F),F=this.rctx.getBoundFramebufferObject(),this.rctx.bindFramebuffer(E.fbo),this.rctx.setDrawBuffers([f.ColorAttachment.COLOR_ATTACHMENT0]),this.rctx.bindFramebuffer(F)):E=new p(N,F,new c.FramebufferObject(this.rctx,{...A[H],width:C,height:D}),G=>{G??=b.DepthFormat.DEPTH_STENCIL_TEXTURE;G=this._acquireDepth(G,E.fbo.width,E.fbo.height,`${E.name} depth`);E.attachDepth(G);G.release();return E},(G,I)=>{I??=b.ColorFormat.RGBA;I=this._acquireColor(I, C,D,`${E.name} color ${G}`);E.attachColor(I,G);I.release();return E},()=>{this.debugCallback&&this.debugCallback(E.name,E.fbo);this._acquired.delete(E);E.detachAll();this._cache.put(E)});return this._trackHandle(E)}acquireDepth(C,D,F,H){return this._acquireDepth(C,D,F,H)}_acquireDepth(C,D,F,H){const N=`${C}x${D}x${F}`,E=this._depthCache.pop(N);if(E)return E.retain(),E.name=H,this._trackHandle(E);const G=C===b.DepthFormat.DEPTH_STENCIL_TEXTURE?new l.ManagedDepthAttachment(N,new d.Texture(this.rctx, {...B[C],width:D,height:F}),()=>{this._acquired.delete(G);this._depthCache.put(G)}):new l.ManagedDepthAttachment(N,new e.Renderbuffer(this.rctx,{...B[C],width:D,height:F}),()=>{this._acquired.delete(G);this._depthCache.put(G)});G.name=H;return this._trackHandle(G)}_acquireColor(C,D,F,H){const N=`${C}x${D}x${F}`,E=this._colorCache.pop(N);if(E)return E.retain(),E.name=H,this._trackHandle(E);const G=new q.ManagedColorAttachment(N,new d.Texture(this.rctx,{...A[C],width:D,height:F}),()=>{this._acquired.delete(G); this._colorCache.put(G)});G.name=H;return this._trackHandle(G)}_trackHandle(C){this._acquired.add(C);return C}}const v=new p("default","default",null,()=>v,()=>v,()=>{}),m=new t.TextureDescriptor;m.pixelFormat=f.PixelFormat.RED;m.internalFormat=f.SizedPixelFormat.R8;m.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const r=new t.TextureDescriptor;r.pixelFormat=f.PixelFormat.RG;r.internalFormat=f.SizedPixelFormat.RG8;r.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const n=new t.TextureDescriptor;n.internalFormat= f.SizedPixelFormat.RGBA4;n.dataType=f.PixelType.UNSIGNED_SHORT_4_4_4_4;n.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const u=new t.TextureDescriptor;u.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const x=new t.TextureDescriptor;x.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;x.samplingMode=f.TextureSamplingMode.LINEAR_MIPMAP_LINEAR;x.hasMipmap=!0;x.maxAnisotropy=8;const y=new t.TextureDescriptor;y.pixelFormat=f.PixelFormat.RED;y.dataType=f.PixelType.HALF_FLOAT;y.internalFormat=f.SizedPixelFormat.R16F;y.samplingMode= f.TextureSamplingMode.NEAREST;const z=new t.TextureDescriptor;z.dataType=f.PixelType.HALF_FLOAT;z.internalFormat=f.SizedPixelFormat.RGBA16F;z.samplingMode=f.TextureSamplingMode.NEAREST;const A={[b.ColorFormat.RED]:m,[b.ColorFormat.RG]:r,[b.ColorFormat.RGBA4]:n,[b.ColorFormat.RGBA]:u,[b.ColorFormat.RGBA_MIPMAP]:x,[b.ColorFormat.R16F]:y,[b.ColorFormat.RGBA16F]:z};t=new t.TextureDescriptor;t.pixelFormat=f.PixelFormat.DEPTH_STENCIL;t.dataType=f.PixelType.UNSIGNED_INT_24_8;t.samplingMode=f.TextureSamplingMode.NEAREST; t.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const B={[b.DepthFormat.DEPTH_STENCIL_TEXTURE]:t,[b.DepthFormat.DEPTH16_BUFFER]:new g.RenderbufferDescriptor(f.RenderbufferFormat.DEPTH_COMPONENT16,4)};a.FBOCache=w;a.defaultWebGLFBO=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/ManagedColorAttachment":function(){define(["exports","./ManagedFBOAttachment","./ManagedFBObject"],function(a,b,q){class l extends b.ManagedFBOAttachment{constructor(p,k,h){super(p,k,h);this.attachment= k;this.type=q.AttachmentType.COLOR}}a.ManagedColorAttachment=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/ManagedFBOAttachment":function(){define(["exports","./ManagedFBObject"],function(a,b){class q extends b.ManagedFBObject{constructor(l,p,k){super(l,k);this.attachment=p;this.name=""}dispose(){this.attachment.dispose()}get usedMemory(){return this.attachment.usedMemory}}a.ManagedFBOAttachment=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl/ManagedFBObject":function(){define(["exports"],function(a){class b{constructor(q,l){this.key=q;this.free=l;this.incarnation=0;this._refCount=1}retain(q=1){this._refCount+=q}release(){if(0===this._refCount)return console.log(`Releasing already released FBO attachment in ${Error().stack}`),!0;--this._refCount;return 0===this._refCount?(this.free(),!0):!1}}a.AttachmentType=void 0;(function(q){q[q.FBO=0]="FBO";q[q.DEPTH=1]="DEPTH";q[q.COLOR=2]="COLOR"})(a.AttachmentType||(a.AttachmentType= {}));a.ManagedFBObject=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/ManagedDepthAttachment":function(){define(["exports","./ManagedFBOAttachment","./ManagedFBObject"],function(a,b,q){class l extends b.ManagedFBOAttachment{constructor(){super(...arguments);this.type=q.AttachmentType.DEPTH}}a.ManagedDepthAttachment=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/ManagedFBO":function(){define(["../../../core/maybe","./ManagedDepthTexture", "./ManagedFBObject","../../webgl/enums"],function(a,b,q,l){class p extends q.ManagedFBObject{constructor(k,h,f,c,e,g){super(k,g);this.type=q.AttachmentType.FBO;this._colors=new Map;this._name="composite-color";this.acquireColor=this.acquireDepth=null;this._name=h;this.fbo=f;this.acquireDepth=c;this.acquireColor=e}dispose(){this.fbo?.dispose()}get usedMemory(){return this.fbo?.usedMemory||0}get name(){return this._name}setName(k){this._name=k}getTexture(k=l.ColorAttachment.COLOR_ATTACHMENT0){return k=== l.DepthStencilAttachment?this.fbo?.depthStencilTexture:this.fbo?.getColorTexture(k)}getAttachment(k=l.ColorAttachment.COLOR_ATTACHMENT0){return k===l.DepthStencilAttachment?this._depth:this._colors.get(k)}attachDepth(k){k?.retain();this.detachDepth();k&&this.fbo?.attachDepthStencil(k.attachment);this._depth=k;return this}detachDepth(){this.fbo?.detachDepthStencilTexture();this.fbo?.detachDepthStencilBuffer();this._depth=a.releaseMaybe(this._depth)}obtainDepthTexture(){const k=this._depth;if(!b.isManagedDepthTexture(k))return null; this.fbo?.detachDepthStencilTexture();this._depth=null;return k}attachColor(k,h){k.retain();this.detachColor(h);this.fbo?.attachColorTexture(k.attachment,h);this._colors.set(h,k);return this}detachColor(k){this.fbo?.detachColorTexture(k);const h=this._colors.get(k);this._colors.delete(k);h?.release()}detachAll(){this._colors.forEach((k,h)=>this.detachColor(h));this.detachDepth()}}return p})},"esri/views/3d/webgl/ManagedDepthTexture":function(){define(["exports","../../webgl/GLObjectType"],function(a, b){a.isManagedDepthTexture=function(q){return q?.attachment.type===b.GLObjectType.Texture};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/FBOPool":function(){define(["exports","../../../../core/MemCachePool","../../../../core/PooledArray"],function(a,b,q){class l{constructor(p,k){this._last=new q;this._incarnation=0;this._cache=new b.MemCachePool(p,k)}destroy(){this._last?.forAll(p=>p.dispose());this._last=null;this._cache.destroy()}set interactive(p){p&& !this._last?this._last=new q:p||(this._last?.forAll(k=>k.dispose()),this._last=null)}clean(){this._last?.filterInPlace(p=>p.incarnationh.key===p);if(k)return this._last.removeUnordered(k),k}return this._cache.pop(p)}put(p){p.incarnation=this._incarnation;this._last?this._last.push(p):this._cache.put(p.key,p)}get usedMemory(){return this._last?.reduce((p,k)=>p+k.usedMemory, 0)??0}}a.FBOPool=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/renderPasses/RenderPassManager":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/Logger ../../../../../core/has ../../../../../core/RandomLCG ../../../../../core/Error ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./AllRenderPasses ./RenderPass ../shaderLibrary/ShaderOutput ../util/TwoVectorPosition ../../effects/RenderPlugin ../../lib/depthRange ../../lib/RenderSlot".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){a.RenderPassManager=class extends r.SyncPreparesRenderPlugin{constructor(){super({});this._passes=null;this.produces=new Map([[u.RenderSlot.OPAQUE_MATERIAL,A=>this._produces(A)],[u.RenderSlot.TRANSPARENT_MATERIAL,A=>this._passes&&0this._produces(A)]]);this._materialPassParameters=new t.MaterialPassParameters;this._shadowPassParameters=new t.ShadowMapPassParameters; this._highlightPassParameters=new t.HighlightPassParameters;this._viewshedPassParameters=new t.ViewshedShadowMapPassParameters;this._systems=new Set}initializeRenderContext(A){this._context=A;const B=A.renderContext.rctx;A=A.techniques;this._passes={materialOpaque:new w.RenderPass(B,A),materialTransparent:new w.RenderPass(B,A,w.RenderPassSorting.BackToFront),materialIntegratedMesh:new w.RenderPass(B,A),shadowMap:new w.RenderPass(B,A),highlight:new w.RenderPass(B,A),highlightIntegratedMesh:new w.RenderPass(B, A),highlightShadowMap:new w.RenderPass(B,A),viewshedShadowMap:new w.RenderPass(B,A),defaultShadowMap:new w.RenderPass(B,A)}}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null;this._systems.clear()}register(A){this._systems.add(A)}_produces(A){return 0===this._systems.size||null===this._passes?!1:A===v.ShaderOutput.Highlight?0B.submit(this._passes,A.bindParameters));for(const B of Object.values(this._passes))B.finishSubmit();this._context.techniques.frameUpdate()}}prepareTechniques(A){if(0===this._systems.size)return null;const B=A.bindParameters;this._updateParameters(B.camera,A.output===v.ShaderOutput.Shadow||A.output===v.ShaderOutput.ShadowHighlight||A.output===v.ShaderOutput.ShadowExcludeHighlight? this._shadowPassParameters:A.output===v.ShaderOutput.ViewshedShadow?this._viewshedPassParameters:A.output===v.ShaderOutput.Highlight?this._highlightPassParameters:this._materialPassParameters,B.slot===u.RenderSlot.TRANSPARENT_MATERIAL);this._materialPassParameters.output=A.output;return this._invoke(A,(C,D)=>C.prepare(D,A.bindParameters))}renderNode(A,B){this._invoke(A,(C,D)=>C.dispatch(D,A.bindParameters,B))}_invoke(A,B){if(null===this._passes)return null;switch(A.bindParameters.slot){case u.RenderSlot.OPAQUE_MATERIAL:switch(A.output){case v.ShaderOutput.Color:case v.ShaderOutput.Depth:case v.ShaderOutput.Normal:case v.ShaderOutput.ObjectAndLayerIdColor:return B(this._passes.materialOpaque, this._materialPassParameters);case v.ShaderOutput.Highlight:return B(this._passes.highlight,this._highlightPassParameters);case v.ShaderOutput.Shadow:return B(this._passes.shadowMap,this._shadowPassParameters);case v.ShaderOutput.ShadowHighlight:return B(this._passes.highlightShadowMap,this._shadowPassParameters);case v.ShaderOutput.ShadowExcludeHighlight:return B(this._passes.defaultShadowMap,this._shadowPassParameters);case v.ShaderOutput.ViewshedShadow:return B(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break; case u.RenderSlot.TRANSPARENT_MATERIAL:switch(A.output){case v.ShaderOutput.Color:case v.ShaderOutput.Depth:case v.ShaderOutput.Normal:case v.ShaderOutput.ObjectAndLayerIdColor:return B(this._passes.materialTransparent,this._materialPassParameters)}break;case u.RenderSlot.INTEGRATED_MESH:switch(A.output){case v.ShaderOutput.Color:case v.ShaderOutput.Depth:case v.ShaderOutput.Normal:case v.ShaderOutput.ObjectAndLayerIdColor:return B(this._passes.materialIntegratedMesh,this._materialPassParameters); case v.ShaderOutput.Highlight:return B(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(A){const B=new n.DepthRange;this._systems.forEach(C=>n.union(B,C.queryShadowCasterDepthRange(A)));return B}_updateParameters(A,B,C){const D=A.viewInverseTransposeMatrix;g.set(x,D[3],D[7],D[11]);z.set(x);g.copy(B.transformWorldFromViewTH,z.high);g.copy(B.transformWorldFromViewTL,z.low);g.copy(B.slicePlaneLocalOrigin,x);f.fromMat4(B.transformViewFromCameraRelativeRS, A.viewMatrix);e.copy(B.transformProjFromView,A.projectionMatrix);B.identifier===t.RenderPassIdentifier.Material&&(this._materialPassParameters.transparent=C,f.transpose(y,B.transformViewFromCameraRelativeRS),f.invert(B.transformNormalViewFromGlobal,y))}};a.RenderPassManager=b.__decorate([h.subclass("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],a.RenderPassManager);const x=d.create(),y=c.create(),z=new m.TwoVectorPosition;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/core/renderPasses/RenderPass":function(){define(["exports","../../../../../core/PooledArray","../../lib/TransparencyPassType","../../../../webgl/enums"],function(a,b,q,l){a.RenderPassSorting=void 0;(function(h){h[h.FrontToBack=0]="FrontToBack";h[h.BackToFront=1]="BackToFront"})(a.RenderPassSorting||(a.RenderPassSorting={}));class p{constructor(h,f,c=a.RenderPassSorting.FrontToBack){this._rctx=h;this._techniques=f;this._sorting=c;this._draws=new b({initialSize:32,allocator:e=> e||{material:null,geometry:null,geometryRanges:null,bindDrawParams:null,depthSquaredHint:0,indexType:0}});this._previouslyBoundDraw=new Map}submitDraw(h,f,c,e){const g=this._draws.pushNew();g.geometry=f;g.geometryRanges=c;g.material=h;g.depthSquaredHint=e;g.indexType=(f.indexed?f.vao.indexBuffer.indexType:null)??0}prepare(h,f){return this._draws.map(c=>c.material.prepareTechnique(this._techniques,h,f,c.geometry.parameters))}dispatch(h,f,c){const e=this._rctx;this._previouslyBoundDraw.clear();let g= null;const d=this._draws.length;for(let v=0;v{const e=h*(f.depthSquaredHint-c.depthSquaredHint);return 0!==e?e:f.geometry.vao.byteSize-c.geometry.vao.byteSize})}get count(){return this._draws.length}}const k=new Map;k.set(l.DataType.UNSIGNED_BYTE,1);k.set(l.DataType.UNSIGNED_SHORT,2);k.set(l.DataType.UNSIGNED_INT,4);a.RenderPass=p;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/RenderNodes":function(){define("exports ../../../../core/Logger ../../../../core/PooledArray ../../webgl/utils ../core/FBOCache ../../../webgl/checkWebGLError".split(" "),function(a,b,q,l,p,k){class h{constructor(f){this._context=f;this._nodes=new q}destroy(){this._nodes.forEach(f=>f.destroy());this._nodes.clear()}add(f){this._nodes.push(f);k.hasFeatureFlagWebGLDebug&&console.log(`Registered render nodes: ${this._nodes.map(({declaredClass:c})=> c).join(", ")}`)}remove(f){this._nodes.remove(f);k.hasFeatureFlagWebGLDebug&&console.log(`Registered render nodes: ${this._nodes.map(({declaredClass:c})=>c).join(", ")}`)}produces(f){return this._nodes.some(({produces:c})=>c===f)}require(f,...c){const e=this._nodes;return c.reduce((g,d)=>g+e.reduce((t,{consumes:w,produces:v})=>t+(w.required.includes(f)&&v===d?1:0),0),0)}optional(f,...c){const e=this._nodes;return c.reduce((g,d)=>g+e.reduce((t,{consumes:w,produces:v})=>t+(w.optional?.includes(f)&& v===d?1:0),0),0)}updateAnimation(){return this._nodes.reduce((f,c)=>c.updateAnimation()||f,!1)}render(f,c,e=()=>{}){const g=l.isManagedFBO(f)?f.name:f,d=this._nodes.filter(({produces:t})=>t===g);if(0===d.length)return l.isManagedFBO(f)?f:p.defaultWebGLFBO;d.forEach(t=>{const w=l.isManagedFBO(f)?[f]:[];for(var v of t.consumes.required){if(v===g)continue;const m=c.get(v);if(!m){e&&e(w);return}w.push(m)}if(t.consumes.optional)for(const m of t.consumes.optional)m!==g&&(v=c.get(m))&&w.push(v);try{const m= t.doRender(w,this._context);m&&m!==f&&(l.isManagedFBO(f)?(f.release(),f=m,c.set(g,f)):f=m)}catch(m){b.getLogger(t).errorOnce(m)}e&&e(w)});this._context.rctx.enforceState();return l.isManagedFBO(f)?f:p.defaultWebGLFBO}}a.RenderNodes=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/utils":function(){define(["exports"],function(a){a.isManagedFBO=function(b){return b.name};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/RenderPluginManager":function(){define("exports ../../../../core/has ../../../../core/PooledArray ../../../../core/promiseUtils ../../../../core/signal ../core/shaderLibrary/ShaderOutput ./RenderPlugin ../lib/basicInterfaces ../lib/depthRange ../lib/Material ../lib/RenderSlot".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){class d{constructor(t){this._context=t;this._renderPlugins=new q;this._materialRenderers=new Map;this._slots=[];this._renderVersion=p.signal(0);for(t=0;tt.destroy());this._renderPlugins.clear();this._materialRenderers.clear()}get plugins(){return this._renderPlugins}add(t,w){const v=()=>{if(w?.aborted)throw t.uninitializeRenderContext(),l.createAbortError();this._renderPlugins.push(t); t.materialReference&&this._materialRenderers.set(t.materialReference,t);t.produces.forEach((r,n)=>{this._slots[n].push(t)});this._context.requestRender();this._renderVersion.value++},m=t.initializeRenderContext(this._context,w);if(l.isPromiseLike(m))return m.then(v);v()}remove(t){null!=t.materialReference&&this._materialRenderers.delete(t.materialReference);if(null!=this._renderPlugins.removeUnordered(t)){for(let w=0;wv!==t);t.uninitializeRenderContext(); this._context.requestRender();this._renderVersion.value++}}prepareRender(){this._renderPlugins.forAll(t=>{t.prepareRender&&t.prepareRender(this._context.renderContext)})}updateAnimation(t){let w=!1;this._renderPlugins.forAll(v=>{v.updateAnimation&&(w=v.updateAnimation(t)||w)});return w}renderFeatureChanged(){this._renderPlugins.forAll(t=>{t.renderFeatureChanged&&t.renderFeatureChanged()})}prepare(...t){for(const w of t)this._context.renderContext.bindParameters.slot=w,this._slots[w].forEach(v=>{v.produces.get(w)?.(k.ShaderOutput.Color)&& (h.isPrepareRenderPlugin(v)&&v.prepareTechnique(this._context.renderContext),h.isPreparesRenderPlugin(v)&&v.prepareTechniques(this._context.renderContext))})}_getRenderables(){const t=this._context.renderContext.bindParameters.slot,w=this._context.renderContext.output??k.ShaderOutput.Color,v=new Map;this._slots[t].forEach(m=>{if(m.produces.get(t)?.(w)&&(!m.isDecoration||this._context.renderContext.bindParameters.decorations!==f.Decorations.OFF))if(h.isPrepareRenderPlugin(m)){var r=m.prepareTechnique(this._context.renderContext); null!=r&&v.set(m,r)}else h.isPreparesRenderPlugin(m)?(r=m.prepareTechniques(this._context.renderContext),null!=r&&v.set(m,r)):v.set(m,null)});return v}render(t,...w){for(const v of w)this._context.renderContext.bindParameters.slot=v,this._getRenderables().forEach((m,r)=>r.renderNode(this._context.renderContext,m,t))}queryDepthRange(t){const w=new c.DepthRange;this._renderPlugins.forAll(v=>{v=v.queryDepthRange?.(t);c.union(w,v)});return w}get updating(){return 0<=this._renderVersion.value&&this._renderPlugins.some(t=> t.running)}produces(t,...w){for(const v of w)if(this._slots[v].some(m=>(m=m.produces.get(v))?m(t):!1))return!0;return!1}consumes(t){return this._renderPlugins.some(w=>w.consumes().required.includes(t))}getMaterialRenderer(t){return this._materialRenderers.get(t)}removeEmptyMaterialRenderers(){this._renderPlugins.filterInPlace(t=>t.materialReference&&0===t.numGeometries?(this._materialRenderers.delete(t.materialReference),t.destroy(),!1):!0)}get hasDecorations(){return this._renderPlugins.some(t=> t.isDecoration)}get hasOccludees(){return this._renderPlugins.some(t=>t.hasOccludees)}get renderOccludedFlags(){return this._renderPlugins.reduce((t,w)=>t|w.renderOccludedFlags,e.RenderOccludedFlag.None)}get usedMemory(){return this._renderPlugins.reduce((t,w)=>null!==w.materialReference?t:t+(w.usedMemory??0),0)}get test(){}}a.RenderPluginManager=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/blit/Blit":function(){define("exports ../../lib/basicInterfaces ../../../../../chunks/Compositing.glsl ../../shaders/CompositingTechnique ../../shaders/CompositingTechniqueConfiguration ../../../../webgl/enums".split(" "), function(a,b,q,l,p,k){class h{constructor(f){this.techniques=f;this._blitConfiguration=new p.CompositingTechniqueConfiguration;this._blitParameters=new q.CompositingPassParameters}render(f,c,e,g,d){f.bindFramebuffer(e.fbo);const t=this.techniques.acquire(l.CompositingTechnique,this._blitConfiguration);f.setClearColor(0,0,0,1);f.clear(k.ClearBufferBit.COLOR_BUFFER_BIT);if(!t?.compiled)return d(b.RenderRequestType.UPDATE),e;this._blitParameters.texture=c.getTexture();f.bindTechnique(t,g,this._blitParameters); f.screen.draw();t.release();return e}}a.Blit=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/AnimationTimeStep":function(){define(["exports","../../../../core/has","../../../../core/mathUtils","../../../../core/time"],function(a,b,q,l){class p{constructor(){this._step=f;this._dilation=1;this._firstIdleTime=l.Milliseconds(0)}frame(e,g){g?0===this._firstIdleTime&&(this._firstIdleTime=l.Milliseconds(performance.now())):this._firstIdleTime=l.Milliseconds(0); if(b("disable-feature:high-quality-idle"))this._dilation=1;else{g=g?performance.now()-this._firstIdleTime:0;if(g>=k+h){this._step=l.Milliseconds(Infinity);this._dilation=1;return}this._dilation=g>=k?10:1}e=q.clamp(e/.5,f,c);this._step=Infinity===this._step?l.Milliseconds(e):l.Milliseconds(.9*this._step+e*(1-.9))}get value(){return this._step}get timeDilation(){return this._dilation}clear(){this._step=this._firstIdleTime=l.Milliseconds(0)}}const k=l.Milliseconds(12E4),h=l.Milliseconds(1E4),f=l.Milliseconds(1E3), c=l.Milliseconds(1E3/30);a.AnimationTimeStep=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/OffscreenRendering":function(){define("exports ../../../../core/has ../../../../core/maybe ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../webgl/formats ./rendererUtils ./TransparencyPassType ../../../webgl/enums ../../../webgl/FramebufferObject".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g{constructor(t,w){this._fbos= t;this.compositingHelper=w;this._height=this._width=4;this._clearColor=p.create()}dispose(){this._color=q.releaseMaybe(this._color);this.releaseBuffers()}get framebuffer(){this.color.attachDepth(this.depth);return this.color.fbo}get colorTexture(){return this.color.getTexture()}get depthTexture(){return this.depth.attachment}initializeFrame(t,w,v){this._fbos.interactive=v===h.RendererTarget.Default;v=this._fbos.rctx;this._width=t.fullWidth;this._height=t.fullHeight;e.ensureAttachmentMaxSize(this, v.parameters.maxTextureSize);t=this._color;this._color=null;this.releaseBuffers();l.copy(this._clearColor,w);return t}releaseBuffers(){this._color?.detachDepth();this._depth=q.releaseMaybe(this._depth)}renderHUDVisibility(t,w,v){if(t?.fbo?.width!==this._width||t?.fbo?.height!==this._height)t?.release(),t=this._fbos.acquire(this._width,this._height,"hud visibility",k.ColorFormat.RGBA4);t.attachDepth(v||this.depth);this._fbos.rctx.bindFramebuffer(t.fbo);this._fbos.rctx.clearFramebuffer(d);w();t.detachDepth(); return t}compositeToHUDVisibility(t,w){this._fbos.rctx.bindFramebuffer(t.hudVisibility?.fbo);this.compositingHelper.compositeHUD(t,w)}renderOITPass(t,w,v){let m,r;const {_width:n,_height:u}=this;switch(w){case f.TransparencyPassType.ColorAlpha:m=this._fbos.acquire(n,u,v?"oit hud color alpha":"oit color alpha",k.ColorFormat.RGBA16F);m.acquireColor(c.ColorAttachment.COLOR_ATTACHMENT1,k.ColorFormat.R16F);r=[0,0,0,1];break;case f.TransparencyPassType.FrontFace:m=this._fbos.acquire(n,u,v?"oit hud front": "oit front"),r=[0,0,0,0]}v?m.acquireDepth(k.DepthFormat.DEPTH16_BUFFER):m.attachDepth(this.depth);this._fbos.rctx.bindFramebuffer(m.fbo);this._fbos.rctx.clearFramebuffer(r,v,v);t();m.detachDepth();return m}compositeToFramebuffer(t,w,v,m){this.bindFbo();this.compositingHelper.composite(t,w,v,m)}compositeOIT(t,w,v,m){m?(this._fbos.rctx.bindFramebuffer(m.fbo),this._fbos.rctx.setClearColor(0,0,0,1E-13),this._fbos.rctx.clear(c.ClearBufferBit.COLOR_BUFFER_BIT)):this.bindFbo();this.compositingHelper.compositeOIT(t, w.getTexture(),w.getTexture(c.ColorAttachment.COLOR_ATTACHMENT1),v.getTexture())}renderDepthDetached(t){this._bindTarget(this.color);t();this._bindTarget(this.color,this.depth)}renderToCachedFBO(t,w,v,m,r=k.ColorFormat.RGBA,n=k.DepthFormat.DEPTH16_BUFFER,u=this._width,x=this._height,y=null){if(t?.fbo?.width!==u||t?.fbo?.height!==x)t=q.releaseMaybe(t);t=t??this._fbos.acquire(u,x,w,r);y?.forEach(z=>t.acquireColor(z.attachment,z.format));null!=n&&t.acquireDepth(n);this._fbos.rctx.bindFramebuffer(t.fbo); this._fbos.rctx.clearFramebuffer(m,!0,!0);v();return t}renderToTargets(t,w,v,m,r=!1,n=!1){this._bindTarget(w,v);this._fbos.rctx.clearFramebuffer(m,r,n);t();w.detachDepth()}bindFbo(){var t=null==this._color;this._bindTarget(this.color,this.depth);t&&(t=this._fbos.rctx,t.setClearStencil(0),t.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),t.clear(c.ClearBufferBit.COLOR_BUFFER_BIT|c.ClearBufferBit.DEPTH_BUFFER_BIT|c.ClearBufferBit.STENCIL_BUFFER_BIT))}_bindTarget(t, w){t.attachDepth(w);this._fbos.rctx.bindFramebuffer(t.fbo)}get width(){return this._width}get height(){return this._height}get color(){return this._ensureColor()}_ensureColor(){this._color||(this._color=this._fbos.acquire(this._width,this._height,"composite-color"));return this._color}updateColor(t){const w=this._ensureColor();w.attachDepth(this.depth);this._color=t(w)}get depth(){this._depth||(this._depth=this._fbos.acquireDepth(k.DepthFormat.DEPTH_STENCIL_TEXTURE,this._width,this._height,"depth")); return this._depth}}const d=[0,1,0,1];a.OffscreenRendering=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderPluginInput":function(){define(["exports"],function(a){class b{constructor(){this._inputs=new Map}set(q,l){this._inputs.set(q,l)}get(q){return this._inputs.get(q)}has(q){return this._inputs.has(q)}release(q){this._inputs.get(q)?.release()&&this._inputs.delete(q)}}a.RenderPluginInput=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/lib/ShadowAccumulator":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/has ../../../../core/mathUtils ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../core/shaderLibrary/shading/ReadShadowMap.glsl ./BindParameters ./depthRange ./glUtil3D ./ShadowCastRenderer ./ShadowMap ../../../../chunks/ShadowCastAccumulate.glsl ../shaders/ShadowCastAccumulateTechnique ../../../support/Scheduler ../../../webgl/enums ../../../webgl/FramebufferObject ../../../webgl/TextureDescriptor ../../../webgl/Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D){a.ShadowAccumulator=class extends q{constructor(H,N,E,G,I,O){super({});this.fbos=H;this._stage=E;this._prepareForShadowMapPass=G;this._renderToShadowMap=I;this._requestRender=O;this._sampleCount=this._progress=0;this._passParameters=new w.ReadShadowMapPassParameters;this._cachedLightDirections=[];this._depthRange=m.zero;this._cameraForcedForScreenshot=this._previewing=!1;this._shadowAccumulatorKey="shadowAccumulator";this._rctx=H.rctx; this._bindParameters=new v.BindParameters(new u.ShadowMap(H,E.viewingMode),null);this._bindParameters.shadowMap.enabled=!0;this._vao=r.createQuadVAO(this._rctx);this._accumulationRenderer=new n.ShadowCastRenderer(N,this._rctx,this,O);this.addHandles([this._stage.view.resourceController.scheduler.registerTask(z.TaskPriority.SHADOW_ACCUMULATOR,this),f.watch(()=>E.renderView,L=>{this.removeHandles("renderView");null!=L&&this.addHandles(L.events.on("force-camera-for-screenshot",()=>this._cameraForcedForScreenshot= !0),"renderView")},f.syncAndInitial),f.watch(()=>this._previewing,()=>this._requestRenderIfEnabled(),f.sync)],this._shadowAccumulatorKey)}normalizeCtorArgs(){return{}}dispose(){this._disable();this.removeHandles(this._shadowAccumulatorKey);this._accumulationRenderer=h.disposeMaybe(this._accumulationRenderer);this._bindParameters.shadowMap.dispose();this._fbo=h.disposeMaybe(this._fbo);this._vao=h.disposeMaybe(this._vao);this._accumulationTechniqueCached=h.releaseMaybe(this._accumulationTechniqueCached); this._sampleCount=this._cachedLightDirections.length=0}get computedSamples(){return this._progress}get shadowCastTexture(){return this._fbo?.colorTexture}get isAccumulating(){return this._isPreviewing||this._isRefining}get _accumulationTechnique(){null==this._accumulationTechniqueCached&&(this._accumulationTechniqueCached=new y.ShadowCastAccumulateTechnique({rctx:this._rctx,viewingMode:this._stage.viewingMode}));return this._accumulationTechniqueCached}get _isRefining(){return this._isActive&&!this._isDoneAccumulating&& !this._previewing}get _isPreviewing(){return this._isActive&&this._previewing}get _isActive(){return null!=this._fbo&&0n.shadowCastDisabledElevationThreshold}get _isDoneAccumulating(){return this._progress>=this._sampleCount}get _lightDirections(){return this._cachedLightDirections}set _lightDirections(H){const N=this._cachedLightDirections;if(!l.equals(N,H,d.equals)){var E= Math.min(x.ShadowCastMaxSamples,H.length);this._sampleCount=N.length=E;for(let G=0;Gthis._progress|| 0>H||H>=this._fbo.width||0>N||N>=this._fbo.height)return 0;this._fbo.readPixels(H,N,1,1,A.PixelFormat.RGBA,A.PixelType.UNSIGNED_BYTE,F);return F[0]/this._progress}_enable(){this._progress=0;const H=new C.TextureDescriptor;H.pixelFormat=A.PixelFormat.RED;H.internalFormat=A.SizedPixelFormat.R8;H.wrapMode=A.TextureWrapMode.CLAMP_TO_EDGE;this._fbo=new B.FramebufferObject(this._rctx,H);this._requestRender()}_disable(){this._fbo=h.disposeMaybe(this._fbo);this._requestRender()}_invalidate(){this._progress= 0;this._requestRenderIfEnabled()}_clear(){this._rctx.bindFramebuffer(this._fbo);this._rctx.setClearColor(0,0,0,0);this._rctx.clear(A.ClearBufferBit.COLOR_BUFFER_BIT);this._progress=0}_accumulateShadow(){this._renderToShadowMap(this._bindParameters,this._lightDirections[this._progress++],this._depthRange);const H=this._accumulationTechnique;this._rctx.bindFramebuffer(this._fbo);this._rctx.bindTechnique(H,this._bindParameters,this._passParameters);this._rctx.bindVAO(this._vao);this._rctx.drawArrays(H.primitiveType, 0,D.vertexCount(this._vao,"geometry"))}_updateCamera(H){const N=this._fbo;if(null!=N){var E=this._bindParameters.camera;H.equals(E)||E.copyFrom(H);N.resize(H.fullWidth,H.fullHeight);this._opacityFromElevation=1-k.smoothstep(n.shadowCastDisableElevationMin,n.shadowCastDisableElevationMax,H.relativeElevation)}}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_progress",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype, "_sampleCount",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_fbo",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_depthRange",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_previewing",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_accumulationRenderer",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_isRefining",null);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_isActive",null);b.__decorate([c.property()], a.ShadowAccumulator.prototype,"canAccumulate",null);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_isDoneAccumulating",null);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_opacityFromElevation",null);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"running",null);a.ShadowAccumulator=b.__decorate([g.subclass("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],a.ShadowAccumulator);const F=new Uint8Array(4);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/lib/ShadowCastRenderer":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/maybe ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec42 ./glUtil3D ../../../../chunks/ShadowCastVisualize.glsl ../shaders/ShadowCastVisualizeTechnique ../shaders/ShadowCastVisualizeTechniqueConfiguration ../../../webgl/Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){const m=1/512;a.ShadowCastRenderer=class extends q{constructor(r,n,u,x){super({});this._techniques=r;this._rctx=n;this._data=u;this._requestRender=x;this._passParameters=new d.ShadowCastVisualizePassParameters(this._data);this._techniqueConfig=new w.ShadowCastVisualizeTechniqueConfiguration;this._enabled=!1;this._vao=g.createQuadVAO(n)}normalizeCtorArgs(){return{}}dispose(){this._stop();this._vao=l.disposeMaybe(this._vao);this._techniques.release(this._technique); this._technique=null}get _visualizeShadowCastTechnique(){return this._technique=this._techniques.releaseAndAcquire(t.ShadowCastVisualizeTechnique,this._techniqueConfig,this._technique)}render(r){if(this._showVisualization){this._passParameters.sampleScale=1/this._data.computedSamples;var n=this._visualizeShadowCastTechnique;this._rctx.bindVAO(this._vao);this._rctx.bindTechnique(n,r,this._passParameters);this._rctx.drawArrays(n.primitiveType,0,v.vertexCount(this._vao,"geometry"))}}setOptions(r){void 0!== r.enabled&&this._setEnabled(r.enabled);void 0!==r.color&&this._setColor(r.color);void 0!==r.threshold&&(this._threshold=r.threshold);void 0!==r.visualization&&(this._visualization=r.visualization);void 0!==r.bandSize&&(this._bandSize=r.bandSize);void 0!==r.bandsEnabled&&(this._bandsEnabled=r.bandsEnabled)}get opacityFromElevation(){return this._passParameters.opacityFromElevation}set opacityFromElevation(r){this._passParameters.opacityFromElevation!==r&&(this._passParameters.opacityFromElevation= r,this.notifyChange("opacityFromElevation"))}get _showVisualization(){return this._enabled&&0m}get _threshold(){return this._passParameters.threshold}set _threshold(r){this._threshold!==r&&(this._passParameters.threshold=r,this._requestRenderIfRunning())}get _visualization(){return this._techniqueConfig.visualization}set _visualization(r){r!==this._visualization&&(this._techniqueConfig.visualization=r,this._techniques.release(this._technique), this._technique=null,this._requestRenderIfRunning())}get _bandSize(){return this._passParameters.bandSize}set _bandSize(r){r!==this._bandSize&&(this._passParameters.bandSize=r,this._requestRenderIfRunning())}get _bandsEnabled(){return this._techniqueConfig.bandsEnabled}set _bandsEnabled(r){r!==this._bandsEnabled&&(this._techniqueConfig.bandsEnabled=r,this._techniques.release(this._technique),this._technique=null,this._requestRenderIfRunning())}_setColor(r){e.exactEquals(r,this._passParameters.color)|| (e.copy(this._passParameters.color,r),this._requestRenderIfRunning())}_setEnabled(r){r!==this._enabled&&(r?this._start():this._stop())}_requestRenderIfRunning(){this._enabled&&this._requestRender()}_start(){this._enabled=!0;this._requestRender()}_stop(){this._enabled=!1;this._requestRender()}};b.__decorate([p.property()],a.ShadowCastRenderer.prototype,"opacityFromElevation",null);a.ShadowCastRenderer=b.__decorate([c.subclass("esri.views.3d.webgl-engine.lib.ShadowCastRenderer")],a.ShadowCastRenderer); a.shadowCastDisableElevationMax=5E4;a.shadowCastDisableElevationMin=4E4;a.shadowCastDisabledElevationThreshold=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ShadowCastVisualize.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ./ShadowCastAccumulate.glsl ../views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(n){const u=new e.ShaderBuilder,x=u.fragment;x.include(k.RgbaFloatEncoding);x.include(l.ReadLinearDepth);u.include(p.CameraSpace);u.include(q.ScreenSpacePass);const {visualization:y,bandsEnabled:z}=n;x.constants.add("inverseSampleValue","float",d.ShadowCastMaxSamples);x.uniforms.add(new g.Texture2DPassUniform("shadowCastMap",B=>B.shadowCastMap),new f.FloatPassUniform("sampleScale",B=>B.sampleScale),new f.FloatPassUniform("opacityFromElevation",B=>B.opacityFromElevation), new h.Float4PassUniform("uColor",B=>B.color));n=y===t.ShadowCastVisualization.Gradient;const A=y===t.ShadowCastVisualization.Threshold;n&&z?x.uniforms.add(new f.FloatPassUniform("bandSize",B=>B.bandSize)):A&&x.uniforms.add(new f.FloatPassUniform("threshold",B=>B.threshold));x.code.add(c.glsl` void main(void) { float record = texture(shadowCastMap, uv).r; float pixelSamples = record * inverseSampleValue; if (pixelSamples < 1.0) { discard; } float strength = pixelSamples * sampleScale; ${A?c.glsl` if (strength <= threshold) { discard; }`:""} ${n&&z?c.glsl`strength = ceil(strength / bandSize) * bandSize;`:""} fragColor = vec4(uColor.xyz, uColor.a * opacityFromElevation ${n?c.glsl`* strength`:""}); } `);return u}class v extends c.NoParameters{constructor(n){super();this._data=n;this.sampleScale=0;this.opacityFromElevation=1;this.color=b.clone(m);this.bandSize=.1;this.threshold=.5}get shadowCastMap(){return this._data.shadowCastTexture}}const m=b.fromValues(.01,0,.25,1),r=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:v,build:w},Symbol.toStringTag,{value:"Module"}));a.ShadowCastVisualize=r;a.ShadowCastVisualizePassParameters=v;a.build=w})},"esri/chunks/ShadowCastAccumulate.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){function t(m){const r=new g.ShaderBuilder,n=r.fragment;n.include(f.RgbaFloatEncoding);n.include(p.ReadDepth);r.include(h.CameraSpace);r.include(l.ScreenSpacePass);r.include(k.ReadShadowMapPass,m);n.uniforms.add(new d.Texture2DPassUniform("shadowMap",(u,x)=>x.shadowMap.depthTexture),new d.Texture2DPassUniform("depthMap",(u,x)=>x.depth?.attachment),new e.Matrix4PassUniform("inverseViewMatrix",(u,x)=>b.invert(v,b.translate(v,x.camera.viewMatrix,x.camera.center))));n.constants.add("sampleValue", "float",w);r.outputs.add("sampleCount","float");n.code.add(c.glsl`void main(void) { float depth = depthFromTexture(depthMap, uv); if (depth >= 1.0 || depth <= 0.0) { discard; } float currentPixelDepth = linearizeDepth(depth); vec4 currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0); vec4 worldSpacePos = inverseViewMatrix * currentPixelPos; mat4 shadowMatrix; float linearDepth = -currentPixelDepth; int i = chooseCascade(linearDepth, shadowMatrix); if (i >= numCascades) { discard; } vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix); if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { discard; } ivec2 texSize = textureSize(shadowMap, 0); ivec2 uvShadow = ivec2(cascadeCoordinates(i, texSize, lvpos) * vec2(texSize)); float depthShadow = readShadowMapDepth(uvShadow, shadowMap); bool shadow = depthShadow < lvpos.z; if (!shadow) { discard; } sampleCount = sampleValue; }`);return r}const w=1/255,v=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastMaxSamples:255,build:t},Symbol.toStringTag,{value:"Module"}));a.ShadowCastAccumulate=q;a.ShadowCastMaxSamples=255;a.build=t})},"esri/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){a.ShadowCastVisualization=void 0;(function(p){p[p.Gradient= 0]="Gradient";p[p.Threshold=1]="Threshold";p[p.COUNT=2]="COUNT"})(a.ShadowCastVisualization||(a.ShadowCastVisualization={}));class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.visualization=a.ShadowCastVisualization.Gradient;this.bandsEnabled=!1}}b.__decorate([q.parameter({count:a.ShadowCastVisualization.COUNT})],l.prototype,"visualization",void 0);b.__decorate([q.parameter()],l.prototype,"bandsEnabled",void 0);a.ShadowCastVisualizeTechniqueConfiguration=l;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../../../../chunks/ShadowCastVisualize.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends l.ShaderTechnique{constructor(d,t){super(d, t,()=>this.destroy())}initializeProgram(d){return new h.Program(d.rctx,g.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){return e.makePipelineState({blending:k.blendingDefault,colorWrite:e.defaultColorWriteParams,depthTest:null,depthWrite:null})}get primitiveType(){return c.PrimitiveType.TRIANGLE_STRIP}}g.shader=new q.ReloadableShaderModule(f.ShadowCastVisualize,()=>new Promise((d,t)=>a(["./ShadowCastVisualize.glsl"],d,t)));b.ShadowCastVisualizeTechnique=g;Object.defineProperty(b, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/ShadowCastAccumulate.glsl ./ShadowConfiguration ../../../webgl/enums ../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends l.ShaderTechnique{constructor(d){super(d,new f.ShadowConfiguration, ()=>this.destroy())}initializeProgram(d){return new k.Program(d.rctx,g.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ONE,c.BlendFactor.ONE,c.BlendFactor.ONE),colorWrite:e.defaultColorWriteParams,depthTest:null,depthWrite:null})}get primitiveType(){return c.PrimitiveType.TRIANGLE_STRIP}}g.shader=new q.ReloadableShaderModule(h.ShadowCastAccumulate,()=>new Promise((d,t)=>a(["./ShadowCastAccumulate.glsl"], d,t)));b.ShadowCastAccumulateTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/SliceHelper":function(){define(["../../../../chunks/boundedPlane"],function(a){const b=a.create();class q{constructor(){this._plane=a.create()}get isEnabled(){return!a.equals(this.plane,b)}get plane(){return this._plane}set plane(l){a.copy(l||b,this._plane)}}return q})},"esri/views/3d/webgl-engine/lib/Viewshed":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Collection ../../../../core/mathUtils ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../core/shaderLibrary/ShaderOutput ../effects/RenderPlugin ./RenderSlot ./ViewshedShadowMap ../../../../chunks/Viewshed.glsl ../shaders/ViewshedTechnique ../shaders/ViewshedTechniqueConfiguration".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){a.Viewshed=class extends r.SyncRenderPlugin{get viewshedShadowMap(){return this._viewshedShadowMap}get enabled(){return 0!0]]);this._renderShadowMap=D}initialize(){this.addHandles(k.watch(()=> this.view.qualitySettings.maximumPixelRatio,C=>this._maximumPixelRatio=C,k.syncAndInitial))}destroy(){this.uninitializeRenderContext()}consumes(){return this.enabled?r.ConsumesDepth:r.ConsumesNone}initializeRenderContext(C){this._pluginContext=C;this._viewshedShadowMap=new u.ViewshedShadowMap(this.fboCache);this._viewshedShadowMap.enabled=!0}renderNode(C,D,F){const {bindParameters:H,rctx:N}=C;if(this.enabled&&H.depth&&null!=F){D=this._setupNormals(F);if(null==this._technique||this._configuration.useNormalMap!== D)this._configuration.useNormalMap=D,this._technique=this._pluginContext?.techniques.acquire(y.ViewshedTechnique,this._configuration);if(this._technique?.compiled)for(const E of this._viewsheds){D=C.rctx.getBoundFramebufferObject();F=this._renderViewshedShadowCubeMap(H,E);const G=this._viewshedShadowMap;F&&null!=G.depthTexture&&!G.isTextureZero&&(this._setPassParameters(E),C.rctx.bindFramebuffer(D),N.bindTechnique(this._technique,H,this._parameters),N.screen.draw())}else this._pluginContext?.requestRender()}}uninitializeRenderContext(){this._pluginContext= null;this._viewshedShadowMap.dispose();this._technique=p.destroyMaybe(this._technique)}updateViewsheds(C){const D=C.removes;null!=D&&(q.isCollection(D)?this._viewsheds.removeMany(D):this._viewsheds.remove(D));C=C.adds;null!=C&&(q.isCollection(C)?(C=C.filter(F=>!this._viewsheds.includes(F)),this._viewsheds.addMany(C)):this._viewsheds.includes(C)||this._viewsheds.add(C))}_renderViewshedShadowCubeMap(C,D){const F=this._viewshedShadowMap;if(!F.enabled)return!1;if(D=F.start(C.camera,D,this.renderHighQuality, this._maximumPixelRatio))for(const H of F.faces)this._renderShadowMap(C,H,m.ShaderOutput.ViewshedShadow);F.finish();return D}_setPassParameters(C){const D=this._parameters,F=this._viewshedShadowMap,H=C.observerRenderSpace;D.localOrigin=H;D.fovs=[l.deg2rad(C.horizontalFieldOfView),l.deg2rad(C.verticalFieldOfView)];D.headingAndTilt=[l.deg2rad(C.heading),l.deg2rad(C.tiltParallelToSurface)];D.upVector=C.tiltedUpVector;C=C.targetRenderSpace;var N=v.create();C=w.sub(N,C,H);D.targetVector=C;D.shadowMap= F;C=[];N=[];for(let O=0;O{m[n]&&(r+=1)});return r}get faces(){const m=this._faces,r=[];for(const n of w){const u=m[n];u&&r.push(u)}return r}get atlasRegions(){return this.faces.map(m=>[m.x/this._textureWidth,(m.x+m.width)/this._textureWidth,m.y/this._textureHeight,(m.y+m.height)/this._textureHeight])}get viewshedProjectionMatrices(){return this.faces.map(m=>m.projectionMatrix)}get viewshedViewMatrices(){return this.faces.map(m=>m.viewMatrix)}_setupFaceCamera(m,r,n,u){const {observerRenderSpace:x, tiltedUpVector:y,targetRenderSpace:z,farDistanceRenderSpace:A,horizontalFieldOfView:B,verticalFieldOfView:C}=r,D=f.create();h.sub(D,z,x);const F=f.create(),H=f.create(),N=(K,J)=>{const R=f.create(),Q=k.create();p.fromRotation(Q,K,J);h.transformMat4(R,D,Q);h.add(R,x,R);return R};let E=y;const G=Math.min(90,B),I=Math.min(90,Math.max(0,(B-90)/2));r=-45;let O=45,L=-45,P=45;["top","bottom"].includes(m)||(L=q.clamp(-C/2,-45,45)-this.settings.toleranceBottomTop,P=q.clamp(+C/2,-45,45)+this.settings.toleranceBottomTop); switch(m){case "front":var M=z;r=-G/2;O=G/2;break;case "left":M=N(Math.PI/2,y);r=45-I;break;case "right":M=N(-Math.PI/2,y);O=-45+I;break;case "top":M=h.add(F,x,y);E=h.negate(H,D);break;case "bottom":M=h.sub(F,x,y);E=D;break;case "back":M=N(Math.PI,y)}M=new g.ViewshedFaceCamera({center:M,eye:x,up:E,far:A});M.sectionAnglesDeg=[r-this.settings.toleranceSides,O+this.settings.toleranceSides,L,P];M.fovY=Math.PI/2;n=M.setViewport(n,u);this._faces[m]=M;return n}_bindFBO(){const m=this._fbos.rctx;m.unbindTexture(this.depthTexture); m.bindFramebuffer(this._handle?.fbo)}_computeActiveFaces(m){const r=new Set,{horizontalFieldOfView:n,verticalFieldOfView:u}=m;m=-u/2;const x=u/2;if(0===n||0===u)return r;45>=m&&-45<=x&&r.add("front");9045-this.settings.toleranceBottomTop&&r.add("top");m<-45+this.settings.toleranceBottomTop&&r.add("bottom");return r}_computeBaseTextureSize(m,r,n,u){r=Math.min(window.devicePixelRatio,r)/m.pixelRatio;n=this.settings.textureSizeModifier(n);m=e.applyTextureResizeModulo(Math.floor(Math.max(m.fullWidth, m.fullHeight)*r*n));return e.applyTextureResizeFloorModulo(Math.min(Math.floor(this._maxTextureWidth/u),m))}_ensureFBO(){const m=this._textureWidth,r=this._textureHeight;if(this._handle?.fbo?.width!==m||this._handle?.fbo?.height!==r)this._handle?.release(),this._handle=this._fbos.acquire(m,r,"viewshed shadow map",c.ColorFormat.RGBA4);this._handle.acquireDepth(c.DepthFormat.DEPTH16_BUFFER)}clearFBO(){const m=this._fbos.rctx;this._ensureFBO();this._bindFBO();m.setClearColor(1,1,1,1);m.clear(d.ClearBufferBit.COLOR_BUFFER_BIT| d.ClearBufferBit.DEPTH_BUFFER_BIT)}dispose(){this.enabled=!1;this.disposeOffscreenBuffers()}disposeOffscreenBuffers(){this._handle=l.releaseMaybe(this._handle)}start(m,r,n,u){this._faces={};if(!this.enabled)return!1;const x=this._computeActiveFaces(r),y=x.size;if(0===y)return!1;const z=this._computeBaseTextureSize(m,u,n,y);if(0===z)return!1;let A=0,B=0,C=0;w.filter(D=>x.has(D)).forEach(D=>{if(4>y)var F=0;else F="front"===D||"left"===D,F=4===y?F?0:1:F||"right"===D?0:1;F>B&&(C=Math.max(C,A),A=0);B= F;A+=this._setupFaceCamera(D,r,[A,F*z],z)});C=Math.max(C,A);this._textureWidth=this.settings.textureResizeModulo(C);this._textureHeight=(4>y?1:2)*z;this.clearFBO();return!0}finish(){this._handle?.detachDepth()}get test(){return{faces:this._faces,faceTypes:w}}}a.ViewshedShadowMap=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ViewshedFaceCamera":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../webgl/RenderCamera ./Util".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.ViewshedFaceCamera=class extends d{constructor(){super(...arguments);this.sectionAngles=g.create()}get sectionAnglesDeg(){return g.fromArray(this.sectionAngles.map(w=>q.rad2deg(w)))}set sectionAnglesDeg(w){this.sectionAngles=g.fromArray(w.map(v=>q.deg2rad(v)))}get projectionMatrix(){const w=e.create();return c.mul(w,this.sectionMatrix,this._projectionMatrixInternal)}get sectionMatrix(){var w=this.sectionAngles[0],v=this.sectionAngles[1],m=this.sectionAngles[2], r=this.sectionAngles[3];t.assert(w<=v);t.assert(m<=r);var n=2*Math.tan(this.fovX/2),u=2*Math.tan(this.fovY/2);w=Math.tan(w);m=Math.tan(m);const x=Math.tan(v)-w,y=Math.tan(r)-m;r=n/x;v=u/y;n=-(w+x/2)/n*2;w=-(m+y/2)/u*2;u=e.create();c.fromTranslation(u,[n,w,0]);n=e.create();c.fromScaling(n,[r,v,1]);r=e.create();return c.mul(r,n,u)}get _sectionRatioX(){return Math.min(1,(Math.tan(this.sectionAngles[1])-Math.tan(this.sectionAngles[0]))/(2*Math.tan(this.fovX/2)))}setViewport(w,v){const m=v*this._sectionRatioX; this.viewport=[w[0],w[1],m,v];return m}};b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"sectionAngles",void 0);b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"sectionAnglesDeg",null);b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"projectionMatrix",null);b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"sectionMatrix",null);b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"_sectionRatioX",null);a.ViewshedFaceCamera=b.__decorate([f.subclass("esri.views.3d.webgl-engine.lib.ViewshedFaceCamera")], a.ViewshedFaceCamera);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Viewshed.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloat16Encoding.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform ../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(A){const B=new r.ShaderBuilder,C=B.fragment;B.include(p.ScreenSpacePass);B.include(h.LocalFromScreenSpace);B.include(c.TextureAtlasLookup);C.include(k.ReadDepth);C.include(f.Rgba4FloatEncoding);C.uniforms.add(new n.Texture2DPassUniform("depthTexture",(D,F)=>F.depth?.attachment));C.uniforms.add(new v.Matrix4PassUniform("inverseProjectionMatrix",(D,F)=>F.camera.inverseProjectionMatrix),new v.Matrix4PassUniform("inverseViewNormalMatrix",(D,F)=> b.invertOrIdentity(y,F.camera.viewInverseTransposeMatrix)));C.uniforms.add(new g.Float3PassUniform("viewshedTargetVector",(D,F)=>D.targetVector),new g.Float3PassUniform("viewshedUpVector",(D,F)=>D.upVector),new e.Float2PassUniform("viewshedFOVs",(D,F)=>D.fovs),new e.Float2PassUniform("viewshedHeadingAndTilt",(D,F)=>D.headingAndTilt),new e.Float2PassUniform("viewshedNearFar",(D,F)=>D.shadowMap.nearFar??[1,100]));C.uniforms.add(new n.Texture2DPassUniform("viewshedShadowMap",D=>D.shadowMap.depthTexture), new m.Matrix4sPassUniform("viewshedProjectionMatrices",(D,F)=>D.projectionMatrices,6),new m.Matrix4sPassUniform("viewshedViewMatrices",(D,F)=>D.viewMatrices,6),new t.IntegerPassUniform("viewshedNumFaces",(D,F)=>D.shadowMap.numActiveFaces),new d.FloatsPassUniform("viewshedAtlasRegions",(D,F)=>D.shadowMap.atlasRegions.flat(),24));C.constants.add("visibleColor","vec4",[0,1,0,.5]);C.constants.add("occludedColor","vec4",[1,0,0,.5]);(A=A.useNormalMap)?(C.uniforms.add(new n.Texture2DPassUniform("normalMap", (D,F)=>D.normalTexture)),C.code.add(w.glsl`vec3 normalFromTexture() { vec4 norm4 = texture(normalMap, uv); vec3 nNormal = vec3(-1.0) + 2.0 * norm4.xyz; return normalize((inverseViewNormalMatrix * vec4(nNormal, 1.0)).xyz); }`)):B.include(l.NormalFromDepth);C.code.add(w.glsl` // UV coordinates of point projected onto viewshed shadow map vec2 getViewshedUv(vec4 worldPosition, int face) { mat4 viewshedMatrix = viewshedProjectionMatrices[face]; vec4 viewshedUv4 = viewshedMatrix * worldPosition; vec3 viewshedUv = viewshedUv4.xyz / viewshedUv4.w; return viewshedUv.xy; } float viewshedDepthToFloat(float depth) { return (depth - viewshedNearFar[0]) / (viewshedNearFar[1] - viewshedNearFar[0]); } // Orthographic depth to viewshed of given point and given cube map face in range [0, 1]. float getOrthographicDepthToViewshed(vec4 worldPosition, int face) { mat4 viewshedViewMatrix = viewshedViewMatrices[face]; vec4 viewshedUv4 = viewshedViewMatrix * worldPosition; vec3 viewshedUv = viewshedUv4.xyz / viewshedUv4.w; float depth = -viewshedUv.z; return viewshedDepthToFloat(depth); } // Read depth from shadow map given uv and cube map face float getDepthFromShadowMap(vec2 uv, int face) { int index = 4 * face; float umin = viewshedAtlasRegions[index]; float umax = viewshedAtlasRegions[index + 1]; float vmin = viewshedAtlasRegions[index + 2]; float vmax = viewshedAtlasRegions[index + 3]; vec4 atlasRegion = vec4(umin, vmin, umax, vmax); return rgba4ToFloat(textureAtlasLookup(viewshedShadowMap, uv, atlasRegion)); } struct ViewshedPoint { int face; vec2 uv; bool isWithin; float orthographicDepth; }; // Find cube map face the given position lies in and return relevant information about it bool getViewshedPoint(vec4 worldPosition, out ViewshedPoint point) { vec3 nUp = normalize(viewshedUpVector); // Try with all active cube map faces for(int i=0; i < viewshedNumFaces; i++) { // Check if when projected, point lies within shadow map texture vec2 viewshedUv = getViewshedUv(worldPosition, i); if (viewshedUv.x > 0.0 && viewshedUv.x < 1.0 && viewshedUv.y > 0.0 && viewshedUv.y < 1.0) { float orthoDepth = getOrthographicDepthToViewshed(worldPosition, i); if (orthoDepth >= 0.0) { // found a cube map face // Check whether point is really inside viewshed geometry, not just within the camera frustum // outside farDistance vec3 position = worldPosition.xyz; bool isWithin = length(position) <= viewshedNearFar[1]; // horizontally outside fov float t = dot(nUp, position); bool isBottomHalf = t > 0.0; vec3 nProjVector = normalize(position - t * nUp); if (isWithin) { float angle = acos(dot(normalize(viewshedTargetVector), nProjVector)); if (angle > viewshedFOVs[0] / 2.0) { isWithin = false; } } // vertically outside fov if (isWithin) { float angle = acos(dot(nProjVector, normalize(position))); if (!isBottomHalf) { angle = -angle; } float tilt = viewshedHeadingAndTilt[1]; float limit = viewshedFOVs[1] / 2.0; if (angle > limit || angle < -limit) { isWithin = false; } } point = ViewshedPoint(i, viewshedUv, isWithin, orthoDepth); return true; } } } // no cube face matches return false; } float normalCosAngle(float linearDepth, vec3 localPosition) { ${A?w.glsl`vec3 normal = normalFromTexture();`:w.glsl` vec3 cameraSpacePosition = reconstructPosition(gl_FragCoord.xy, linearDepth); vec3 normal = normalFromDepth(depthTexture, cameraSpacePosition, gl_FragCoord.xy, uv); normal = (inverseViewNormalMatrix * vec4(normal, 1.0)).xyz; `}; vec3 viewingDir = normalize(localPosition); return dot(normal, viewingDir); } void main() { float depth = depthFromTexture(depthTexture, uv); // Outside camera planes if (depth >= 1.0 || depth <= 0.0) { return; } float linearDepth = linearizeDepth(depth); // Relative to viewshed position vec4 localPosition = reconstructLocalPosition(gl_FragCoord.xy, linearDepth); ViewshedPoint point; bool foundFace = getViewshedPoint(localPosition, point); // Outside every viewshed if (!foundFace || !point.isWithin) { return; } float viewshedDepth = getDepthFromShadowMap(point.uv, point.face); float distance = point.orthographicDepth; bool visible = distance < viewshedDepth; fragColor = visible ? visibleColor : occludedColor; float cosAngle = normalCosAngle(linearDepth, localPosition.xyz); // Everything facing away, and close to parallel is considered occluded. // Theshold corresponds to around 0.6 degrees, tuned empirically. if (cosAngle > -0.01) { fragColor = occludedColor; } }`);return B}class x extends h.LocalFromScreenSpacePassParameters{constructor(){super(...arguments);this.targetVector=[1,0,0];this.upVector=[0,0,1];this.fovs=[45,45];this.headingAndTilt=[0,0];this.shadowMap={depthTexture:null,nearFar:[1,100],numActiveFaces:1,atlasRegions:[[0,0,1,1]]};this.projectionMatrices=q.IDENTITY.flat();this.viewMatrices=q.IDENTITY.flat()}}const y=q.create(),z=Object.freeze(Object.defineProperty({__proto__:null,ViewshedPassParameters:x,build:u},Symbol.toStringTag,{value:"Module"})); a.Viewshed=z;a.ViewshedPassParameters=x;a.build=u})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./CameraSpace.glsl ../../shaderModules/interfaces ../../shaderModules/Matrix4PassUniform".split(" "),function(a,b,q,l,p,k,h){class f extends k.NoParameters{constructor(){super(...arguments); this.localOrigin=l.zeros()}}a.LocalFromScreenSpace=function(c){c.include(p.CameraSpace);c.fragment.uniforms.add(new h.Matrix4PassUniform("inverseViewMatrix",(e,g)=>{const d=q.create();b.translate(d,g.camera.viewMatrix,e.localOrigin);return b.invertOrIdentity(d,d)}));c.fragment.code.add(k.glsl`vec4 reconstructLocalPosition(vec2 coord, float linearDepth) { vec4 cameraSpace = vec4(reconstructPosition(coord, linearDepth), 1.0); return inverseViewMatrix * cameraSpace; }`)};a.LocalFromScreenSpacePassParameters=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ViewshedTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../../../../chunks/Viewshed.glsl ../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new h.Program(g.rctx, e.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){return c.makePipelineState({colorWrite:c.defaultColorWriteParams,blending:k.blendingDefault})}}e.shader=new q.ReloadableShaderModule(f.Viewshed,()=>new Promise((g,d)=>a(["./Viewshed.glsl"],g,d)));b.ViewshedTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ViewshedTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"], function(a,b,q){class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.useNormalMap=!0}}b.__decorate([q.parameter()],l.prototype,"useNormalMap",void 0);a.ViewshedTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/statistics/RendererPerformanceInfo":function(){define("exports ../../../../core/maybe ../../../../core/PerformanceSampler ../../../../core/time ../../webgl ../../../webgl/TimerPool".split(" "), function(a,b,q,l,p,k){a.PerformanceCategory=void 0;(function(c){c.OVERLAY="overlay";c.PREPARE="prepare";c.SHADOW_MAP="shadow map";c.DEPTH="depth";c.ACCUMULATED_SHADOWS="accumulated shadows";c.OBJECT_AND_LAYER_ID_COLOR="object/layer id color";c.NORMALS="normals";c.SSAO="SSAO";c.OPAQUE_EDGES="opaque edges";c.VOXEL="voxel";c.TRANSPARENT="transparent";c.TRANSPARENT_EDGES="transparent edges";c.HUD_VISIBILITY="HUD visibility";c.TRANSPARENT_TERRAIN="transparent terrain";c.OPAQUE_ENVIRONMENT="opaque environment"; c.TRANSPARENT_ENVIRONMENT="transparent environment";c.LASER_LINES="laser lines";c.VIEWSHED="viewshed";c.OCCLUDED="occluded";c.HUD="HUD";c.HUD_OCCLUDED="HUD occluded";c.FINISH="finish"})(a.PerformanceCategory||(a.PerformanceCategory={}));const h=Object.values(p.RenderCategory).concat(Object.values(p.InternalRenderCategory)).concat(Object.values(a.PerformanceCategory));class f{constructor(c){this._rctx=c;this._startTimeStampCPU=l.Milliseconds(0);this._lastTimeStampCPU=l.Milliseconds(0);this._totalCPUTime= new q("Total");this._cpuTimeSamplers=new Map(h.map(e=>[e,new q(e)]));this._enableGPUTimer=0;this._totalGPUTime=new q("GPU");this._gpuTimeSamplers=new Map(h.map(e=>[e,new q(e)]));this._totalTime=l.Milliseconds(0);this._totalFrameCount=0}get totalCPUTimeSampler(){return this._totalCPUTime}get cpuTimeSamplers(){return Array.from(this._cpuTimeSamplers.values())}get totalGPUTimeSampler(){return this._totalGPUTime}get gpuTimeSamplers(){return Array.from(this._gpuTimeSamplers.values())}get gpuSamplingEnabled(){return null!= this._gpuTimerPool}get totalTime(){return this._totalTime}get totalFrameCount(){return this._totalFrameCount}get elapsedTime(){return l.Milliseconds(performance.now()-this._startTimeStampCPU)}enableGPUPerformanceInfo(){if(null==this._gpuTimerPool){const e=[...h,"Total"];this._gpuTimerPool=k.createElapsedTimerPool(this._rctx,e)}if(null==this._gpuTimerPool)return{hasGPUTimerSupport:!1,remove:()=>{}};++this._enableGPUTimer;let c=!1;return{hasGPUTimerSupport:!0,remove:()=>{c||(c=!0,--this._enableGPUTimer, 0===this._enableGPUTimer&&(this._gpuTimerPool=b.disposeMaybe(this._gpuTimerPool)))}}}startFrame(){this._startTimeStampCPU=this._lastTimeStampCPU=l.Milliseconds(performance.now());this._gpuTimerPool&&this._gpuTimerPool.start()}advance(c){var e=l.Milliseconds(performance.now());this._cpuTimeSamplers.get(c).record(e-this._lastTimeStampCPU);this._lastTimeStampCPU=e;this._gpuTimerPool&&(e=this._gpuTimerPool.stop(c),this._gpuTimeSamplers.get(c).record(e),this._gpuTimerPool.start())}finishFrame(){if(this._gpuTimerPool){var c= this._gpuTimerPool.stop(a.PerformanceCategory.FINISH);this._gpuTimeSamplers.get(a.PerformanceCategory.FINISH).record(c);this._rctx.gl.flush()}c=l.Milliseconds(performance.now()-this._startTimeStampCPU);this._totalTime=l.Milliseconds(this._totalTime+c);this._totalCPUTime.record(c);this._gpuTimerPool&&this._totalGPUTime.record(this.gpuTimeSamplers.reduce((e,g)=>e+(g.last||0),0));++this._totalFrameCount}}a.PerformanceCategories=h;a.RendererPerformanceInfo=f;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/webgl/TimerPool":function(){define(["exports","./capabilities/DisjointTimerQuery"],function(a,b){class q{constructor(l,p){this._timer=l;this._queryPool=[];this._queryResults=new Map;this._currentQuery=null;p.forEach(k=>{const h=this._timer.createQuery(),f=this._timer.createQuery();this._queryPool.push(h,f);this._queryResults.set(k,null)})}start(){b.hasRunningElapsedTimer||(this._currentQuery=this._queryPool.pop(),null!=this._currentQuery&&(this._timer.disjoint(),this._timer.beginTimeElapsed(this._currentQuery)))}stop(l){if(this._timer.disjoint()|| null==this._currentQuery||!this._queryResults.has(l))return this.abort(),null;this._timer.endTimeElapsed();const p=this._queryResults.get(l);if(null==p)return this._queryResults.set(l,this._currentQuery),this._currentQuery=null;if(!this._timer.resultAvailable(p))return this._queryPool.unshift(this._currentQuery),this._currentQuery=null;const k=this._timer.getResult(p)/1E6;this._queryPool.unshift(p);this._queryResults.set(l,this._currentQuery);this._currentQuery=null;return k}abort(){null!=this._currentQuery&& (this._timer.deleteQuery(this._currentQuery),this._queryPool.unshift(this._timer.createQuery()),this._currentQuery=null)}dispose(){null!=this._currentQuery&&this._timer.deleteQuery(this._currentQuery);this._queryPool.forEach(l=>{this._timer.deleteQuery(l)});this._queryResults.forEach(l=>{null!=l&&this._timer.deleteQuery(l)})}}a.createElapsedTimerPool=function(l,p){l=l.capabilities.disjointTimerQuery;return null==l?null:new q(l,p)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/capabilities/DisjointTimerQuery":function(){define(["exports"], function(a){class b{constructor(q,l,p,k,h,f,c,e,g){this.createQuery=q;this.deleteQuery=l;this.resultAvailable=p;this.getResult=k;this.disjoint=h;this.beginTimeElapsed=f;this.endTimeElapsed=c;this.createTimestamp=e;this.timestampBits=g}}a.hasRunningElapsedTimer=!1;a.DisjointTimerQuery=b;a.createDisjointTimerQuery=function(q,l){if(l.disjointTimerQuery)return null;let p=q.getExtension("EXT_disjoint_timer_query_webgl2");return p?new b(()=>q.createQuery(),k=>{q.deleteQuery(k);a.hasRunningElapsedTimer= !1},k=>q.getQueryParameter(k,q.QUERY_RESULT_AVAILABLE),k=>q.getQueryParameter(k,q.QUERY_RESULT),()=>q.getParameter(p.GPU_DISJOINT_EXT),k=>{a.hasRunningElapsedTimer||(a.hasRunningElapsedTimer=!0,q.beginQuery(p.TIME_ELAPSED_EXT,k))},()=>{q.endQuery(p.TIME_ELAPSED_EXT);a.hasRunningElapsedTimer=!1},k=>p.queryCounterEXT(k,p.TIMESTAMP_EXT),()=>q.getQuery(p.TIMESTAMP_EXT,p.QUERY_COUNTER_BITS_EXT)):(p=q.getExtension("EXT_disjoint_timer_query"))?new b(()=>p.createQueryEXT(),k=>{p.deleteQueryEXT(k);a.hasRunningElapsedTimer= !1},k=>p.getQueryObjectEXT(k,p.QUERY_RESULT_AVAILABLE_EXT),k=>p.getQueryObjectEXT(k,p.QUERY_RESULT_EXT),()=>q.getParameter(p.GPU_DISJOINT_EXT),k=>{a.hasRunningElapsedTimer||(a.hasRunningElapsedTimer=!0,p.beginQueryEXT(p.TIME_ELAPSED_EXT,k))},()=>{p.endQueryEXT(p.TIME_ELAPSED_EXT);a.hasRunningElapsedTimer=!1},k=>p.queryCounterEXT(k,p.TIMESTAMP_EXT),()=>p.getQueryEXT(p.TIMESTAMP_EXT,p.QUERY_COUNTER_BITS_EXT)):null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderingContext":function(){define(["exports", "../../../../core/has","../effects/ScreenSpaceGeometry","../../../webgl/AppleAmdDriverHelper","../../../webgl/RenderingContext"],function(a,b,q,l,p){class k extends p.RenderingContext{constructor(h,f,c){super(h,f);this.gl=h;this.newCache=c;this._appleAmdDriverHelper=null;this._refCount=1;this.screen=new q.ScreenSpaceGeometry(this)}destroy(){0<--this._refCount||this.dispose()}ref(){++this._refCount}dispose(){super.dispose();this._appleAmdDriverHelper?.dispose();this.screen.destroy()}bindTechnique(h, f,c,e,g){this.useProgram(h.program);this.setPipelineState(h.getPipeline(!!g));h.program.bindPass(c,f);e&&h.program.bindDraw(e,f,c);return h.program}runAppleAmdDriverHelper(){this.driverTest.drawArraysRequiresIndicesTypeReset.result&&(this._appleAmdDriverHelper??(this._appleAmdDriverHelper=new l.AppleAmdDriverHelper(this)),this._appleAmdDriverHelper.run())}get test(){}}a.RenderingContext=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ScreenSpaceGeometry":function(){define("exports ../../../../core/has ../../../../core/maybe ../lib/DefaultVertexAttributeLocations ../lib/DefaultVertexBufferLayouts ../lib/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f){function c(g,d=p.Pos2,t=l.Default3D){const w=new Float32Array([-1,-1,3,-1,-1,3]);return new k.VertexArrayObject(g,t,{geometry:d},{geometry:h.BufferObject.createVertex(g,f.Usage.STATIC_DRAW,w)})}class e{constructor(g){this._rctx=g;this._vao=c(g)}destroy(){this._vao=q.disposeMaybe(this._vao)}draw(){null!=this._vao&&(this._rctx.bindVAO(this._vao),this._rctx.drawArrays(f.PrimitiveType.TRIANGLES,0,3))}get test(){}}a.ScreenSpaceGeometry=e;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/webgl/AppleAmdDriverHelper":function(){define(["exports","../../core/has","./BufferObject","./enums"],function(a,b,q,l){class p{constructor(k){this._rctx=k;this._indexBuffer=this._createIndexbuffer();this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:"#version 300 es\n precision highp float;\n\n void main(void) {\n gl_Position \x3d vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0);\n }",fragment:"#version 300 es\n precision highp float;\n\n out vec4 fragColor;\n\n void main(void) {\n fragColor \x3d vec4(0.0, 0.0, 0.0, 1.0);\n }"}}_createHelperProgram(){const k= p.getShaderSources();return this._rctx.programCache.acquire(k.vertex,k.fragment,new Map([]))}_createIndexbuffer(){return q.BufferObject.createIndex(this._rctx,l.Usage.STATIC_DRAW,new Uint32Array([0]))}run(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,l.BufferType.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(l.PrimitiveType.POINTS,1,l.DataType.UNSIGNED_INT,0))}dispose(){this._program.dispose();this._indexBuffer.dispose()}get test(){}} a.AppleAmdDriverHelper=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/RenderingContext":function(){define("exports ../../core/maybe ../../core/promiseUtils ../../core/time ./checkWebGLError ./ContextState ./enums ./InstanceCounter ./Parameters ./ProgramCache ./renderState ./Texture ./Util ./WebGLDriverTest ./capabilities/Capabilities".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(n,u,x,y){u?y!==u&&n.bindBuffer(x,u.glName):n.bindBuffer(x,null);return u} function r(n,u){switch(n){case h.PrimitiveType.POINTS:return 2*u;case h.PrimitiveType.TRIANGLES:return u/3;case h.PrimitiveType.TRIANGLE_STRIP:return u-2;case h.PrimitiveType.TRIANGLE_FAN:return u-2;default:return 0}}a.RenderingContext=class{constructor(n,u){this.gl=n;this.instanceCounter=new f.InstanceCounter;this.programCache=new e.ProgramCache(this);this._transformFeedbackRequestInfo=null;this._state=new k.ContextState;this._numOfTriangles=this._numOfDrawCalls=0;this._loadExtensions();this.configure(u)}configure(n){this._capabilities= new v.Capabilities(this.gl,n);this._parameters=new c.Parameters(this.gl,this._capabilities,n);d.Texture.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;n=this.gl.getParameter(this.gl.VIEWPORT);this._state=new k.ContextState;this._state.viewport={x:n[0],y:n[1],width:n[2],height:n[3]};this._stateTracker=new g.StateTracker({setBlending:u=>{u?(this.setBlendingEnabled(!0),this.setBlendEquationSeparate(u.opRgb,u.opAlpha),this.setBlendFunctionSeparate(u.srcRgb,u.dstRgb,u.srcAlpha,u.dstAlpha), u=u.color,this.setBlendColor(u.r,u.g,u.b,u.a)):this.setBlendingEnabled(!1)},setCulling:u=>{u?(this.setFaceCullingEnabled(!0),this.setCullFace(u.face),this.setFrontFace(u.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:u=>{u?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(u.factor,u.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:u=>{u?(this.setDepthTestEnabled(!0),this.setDepthFunction(u.func)):this.setDepthTestEnabled(!1)},setStencilTest:u=>{if(u){this.setStencilTestEnabled(!0); const x=u.function;this.setStencilFunction(x.func,x.ref,x.mask);u=u.operation;this.setStencilOp(u.fail,u.zFail,u.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:u=>{u?(this.setDepthWriteEnabled(!0),this.setDepthRange(u.zNear,u.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:u=>{u?this.setColorMask(u.r,u.g,u.b,u.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:u=>{u?this.setStencilWriteMask(u.mask):this.setStencilWriteMask(0)},setDrawBuffers:u=>{u?this.setDrawBuffers(u.buffers):({drawFramebuffer:u}= this._state,null===u?this.setDrawBuffers([h.SpecialDrawBuffers.BACK]):0===u.colorAttachments.length?this.setDrawBuffers([h.SpecialDrawBuffers.NONE]):this.setDrawBuffers([h.ColorAttachment.COLOR_ATTACHMENT0]))}});this.enforceState();b.disposeMaybe(this._driverTest);this._driverTest=new w.WebGLDriverTest(this)}dispose(){b.disposeMaybe(this._driverTest);this.programCache.dispose();this.bindVAO(null);this.unbindBuffer(h.BufferType.ARRAY_BUFFER);this.unbindBuffer(h.BufferType.ELEMENT_ARRAY_BUFFER);this.unbindBuffer(h.BufferType.UNIFORM_BUFFER); this._state.uniformBufferBindingPoints.length=0;this.unbindBuffer(h.BufferType.PIXEL_PACK_BUFFER);this.unbindBuffer(h.BufferType.PIXEL_UNPACK_BUFFER);this.unbindBuffer(h.BufferType.COPY_READ_BUFFER);this.unbindBuffer(h.BufferType.COPY_WRITE_BUFFER);this._state.textureUnitMap.length=0;p.webglDebugEnabled()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(n){this._stateTracker.setPipeline(n)}setBlendingEnabled(n){this._state.blend!== n&&(!0===n?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=n,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop();this._state.program=null}externalTextureUnitUpdate(n,u){for(let x=0;xz===n[A]))if(n.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(x){if(1=this.parameters.maxTextureImageUnits|| 0>u)&&console.error("Input texture unit is out of range of available units!");const y=this._state.textureUnitMap[u];if(null==n?.glName)return null!=y&&(this.setActiveTexture(u,x),this.gl.bindTexture(y.descriptor.target,null)),this._state.textureUnitMap[u]=null,y;if(!x&&y===n)return n.isDirty&&(this.setActiveTexture(u,x),n.applyChanges()),y;this.setActiveTexture(u,x);this.gl.bindTexture(n.descriptor.target,n.glName);n.applyChanges();this._state.textureUnitMap[u]=n;return y}unbindTexture(n){if(null!= n)for(let u=0;u=this.parameters.maxUniformBufferBindings||0>u)return console.error("Uniform buffer binding point is out of range!"),null;n=n===h.BufferType.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints; let x=n[u];null==x&&(x={buffer:null,offset:0,size:0},n[u]=x);return x}bindBufferBase(n,u,x){const y=this._getBufferBinding(n,u);null==y||y.buffer===x&&0===y.offset&&0===y.size||(this.gl.bindBufferBase(n,u,x?x.glName:null),y.buffer=x,y.offset=0,y.size=0)}bindBufferRange(n,u,x,y,z){const A=this._getBufferBinding(n,u);null==A||A.buffer===x&&A.offset===y&&A.size===z||(0!==y%this._parameters.uniformBufferOffsetAlignment?console.error("Uniform buffer binding offset is not a multiple of the context offset alignment"): (this.gl.bindBufferRange(n,u,x.glName,y,z),A.buffer=x,A.offset=y,A.size=z))}bindUBO(n,u,x,y){null==u?this.bindBufferBase(h.BufferType.UNIFORM_BUFFER,n,null):(p.webglDebugEnabled()&&(y??u.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),u.initialize(),void 0!==x&&void 0!==y?this.bindBufferRange(h.BufferType.UNIFORM_BUFFER,n,u.buffer,x,y):this.bindBufferBase(h.BufferType.UNIFORM_BUFFER,n,u.buffer))}unbindUBO(n){for(let u= 0,x=this._state.uniformBufferBindingPoints.length;uk+(f{q.has(k)||q.set(k,new Map);k=q.get(k);k.set(h??0,k.get(h??0)??1)});this._active.clear();let l=0;const p=[];q.forEach((k,h)=>{let f=0;k.forEach((c,e)=>f+=c*e);k.set(-1,f);l+=f;p.push([h,k])});q.clear();p.sort((k,h)=>h[1].get(-1)-k[1].get(-1));return p.reduce((k,[h,f])=>{const c=Math.round(f.get(-1)/1024);f.delete(-1);f=Array.from(f.values()).reduce((e, g)=>e+g,0);return k+=` ${c}KB from ${f} allocations at ${h}\n`},`Total unestimated ${this._objectType} memory: ${Math.round(l/1024)}KB\n`)}}a.AllocationTracer=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Parameters":function(){define(["exports"],function(a){class b{constructor(q,l,p){l=l.textureFilterAnisotropic;p=p.maxAnisotropy??Infinity;this.versionString=q.getParameter(q.VERSION);this.maxVertexTextureImageUnits=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS); this.maxVertexAttributes=q.getParameter(q.MAX_VERTEX_ATTRIBS);this.maxMaxAnisotropy=l?Math.min(q.getParameter(l.MAX_TEXTURE_MAX_ANISOTROPY),p):1;this.maxTextureImageUnits=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS);this.maxTextureSize=q.getParameter(q.MAX_TEXTURE_SIZE);this.maxRenderbufferSize=q.getParameter(q.MAX_RENDERBUFFER_SIZE);this.maxViewportDims=q.getParameter(q.MAX_VIEWPORT_DIMS);this.maxUniformBufferBindings=q.getParameter(q.MAX_UNIFORM_BUFFER_BINDINGS);this.maxVertexUniformBlocks=q.getParameter(q.MAX_VERTEX_UNIFORM_BLOCKS); this.maxFragmentUniformBlocks=q.getParameter(q.MAX_FRAGMENT_UNIFORM_BLOCKS);this.maxUniformBlockSize=q.getParameter(q.MAX_UNIFORM_BLOCK_SIZE);this.uniformBufferOffsetAlignment=q.getParameter(q.UNIFORM_BUFFER_OFFSET_ALIGNMENT);this.maxArrayTextureLayers=q.getParameter(q.MAX_ARRAY_TEXTURE_LAYERS);this.maxSamples=q.getParameter(q.MAX_SAMPLES);this.maxDrawBuffers=q.getParameter(q.MAX_DRAW_BUFFERS)}}a.Parameters=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ProgramCache":function(){define(["exports", "../../core/has","../../core/NestedMap","./Program"],function(a,b,q,l){class p{constructor(k){this._rctx=k;this._store=new q.NestedMap}dispose(){this._store.forEach(k=>k.forEach(h=>h.dispose()));this._store.clear()}acquire(k,h,f,c){const e=this._store.get(k,h);if(null!=e)return e.ref(),e;f=new l.Program(this._rctx,k,h,f,c);f.ref();this._store.set(k,h,f);return f}get test(){}}a.ProgramCache=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Program":function(){define(["exports", "../../core/has","./checkWebGLError","./enums","./ShaderTranspiler"],function(a,b,q,l,p){function k(g,d,t){g=g.gl;const w=g.createShader(d);g.shaderSource(w,t);g.compileShader(w);q.webglValidateShadersEnabled()&&!g.getShaderParameter(w,g.COMPILE_STATUS)&&(console.error("Compile error in ".concat(d===l.ShaderType.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(g.getShaderInfoLog(w)),console.error(h(t)));return w}function h(g){let d=2;return g.replaceAll("\n",()=>{var t=d++;t=1E3<=t?t.toString(): (" "+t).slice(-3);return"\n"+t+":"})}function f(g,d,t){const w=g.get(d);if(!w)return g.set(d,Array.from(t)),!0;const v=t.length;if(w.length!==v)return g.set(d,Array.from(t)),!0;for(g=0;gr.bindAttribLocation(n,u,x));this._transformFeedbackVaryings?.length&&r.transformFeedbackVaryings(n,this._transformFeedbackVaryings,r.SEPARATE_ATTRIBS);r.linkProgram(n);q.webglValidateShadersEnabled()&&!r.getProgramParameter(n,r.LINK_STATUS)&&console.error("Could not link shader\n"+`validated: ${r.getProgramParameter(n,r.VALIDATE_STATUS)}`+`, gl error ${r.getError()}`+`, vertex: ${r.getShaderParameter(this._vShader, r.COMPILE_STATUS)}`+`, fragment: ${r.getShaderParameter(this._fShader,r.COMPILE_STATUS)}`+`, info log: ${r.getProgramInfoLog(n)}`+`, vertex source: ${this.vertexShader}`+`, fragment source: ${this.fragmentShader}`);for(const [u,x]of this._uniformBlockBindings)g=r.getUniformBlockIndex(n,u),4294967295>g&&r.uniformBlockBinding(n,g,x);this._glName=n;this._context.instanceCounter.increment(l.ResourceType.Program,this)}get glName(){return this._glName}get hasGLName(){return null!=this._glName}get hasTransformFeedbackVaryings(){return!!this._transformFeedbackVaryings?.length}get compiled(){if(this._compiled)return!0; const g=this._context.gl.getExtension("KHR_parallel_shader_compile");return null==g||null==this.glName?this._compiled=!0:this._compiled=!!this._context.gl.getProgramParameter(this.glName,g.COMPLETION_STATUS_KHR)}dispose(){if(!(0<--this._refCount)){var g=this._context.gl,d=this._context.instanceCounter;this._nameToUniformLocation.forEach(t=>t&&d.decrement(l.ResourceType.Uniform,t));this._nameToUniformLocation.clear();this._vShader&&(0"eof"!==n.type?n.data:"").join("")}function c(r, n="100",u="300 es"){const x=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const y of r)if("preprocessor"===y.type){const z=x.exec(y.data);if(z){r=z[1].replaceAll(/\s{2,}/g," ");if(r===u)return r;if(r===n)return y.data="#version "+u,n;throw Error("unknown glsl version: "+r);}}r.splice(0,0,{type:"preprocessor",data:"#version "+u},{type:"whitespace",data:"\n"});return null}function e(r,n,u,x){x=x||u;for(const y of r)if("ident"===y.type&&y.data===u)return x in n?n[x]++:n[x]=0,e(r,n,x+"_"+n[x],x);return u} function g(r,n,u="afterVersion"){const x={data:"\n",type:"whitespace"},y=A=>Al.loseContext()}:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureRepository":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./basicInterfaces ./ContentObjectType ./ITexture ./TextureTechnique ./TextureTechniqueConfiguration ./Util ../../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){a.TextureRepository=class extends q{constructor(u,x,y){super({});this._stage=u;this._techniques=x;this._rctx=y;this._textures=new Map;this._loadingCount=0;this._frameUpdates=new Map;this.events=new l;this._frameTask=u.view.resourceController.scheduler.registerTask(r.TaskPriority.TEXTURE_UNLOAD)}normalizeCtorArgs(){return{}}destroy(){this._frameTask.remove();this._stage.forEachOfType(d.ContentObjectType.Texture,u=>u.unload())}get updating(){return 0{const y=x.texture.frameUpdate(x.previousToken);0<=y&&y!==x.previousToken&&(x.previousToken=y,u=!0)});u&&this.events.emit("changed",g.RenderRequestType.BACKGROUND)}_createNewRef(u){const x= this._stage.getObject(u);if(null==x)return m.assert(void 0!==x),null;const y=x.events.on("unloaded",()=>{y.remove();this._onTextureUnloaded(u)}),z=new n(u,()=>{this._frameTask.schedule(()=>{z.isUnreferenced&&x.unload()})});this._textures.set(u,z);z.ref();if(x.glTexture)return this._updateGLTexture(z,x.glTexture),t.isFrameUpdateTexture(x)&&this._frameUpdates.set(u,{texture:x,previousToken:-1}),z;this._loadingCount++;z.loadingPromise=this._stage.schedule(()=>{const A=x.load(this._rctx),B=D=>{this._loadingCount--; z.loadingPromise=null;this._updateGLTexture(z,D);t.isFrameUpdateTexture(x)&&this._frameUpdates.set(u,{texture:x,previousToken:-1});return z},C=D=>{this._loadingCount--;z.loadingPromise=null;k.isAbortError(D)||p.getLogger(this).error(D);return null};return k.isPromiseLike(A)?A.then(B,C):B(A)});return z.loadingPromise}_updateGLTexture(u,x){u.glTexture=x;this.events.emit("changed",g.RenderRequestType.UPDATE)}_onTextureUnloaded(u){this._textures.delete(u);this._frameUpdates.delete(u)}};b.__decorate([h.property()], a.TextureRepository.prototype,"_loadingCount",void 0);b.__decorate([h.property()],a.TextureRepository.prototype,"_frameTask",void 0);b.__decorate([h.property()],a.TextureRepository.prototype,"updating",null);a.TextureRepository=b.__decorate([e.subclass("esri.views.3d.webgl-engine.lib.TextureRepository")],a.TextureRepository);class n{constructor(u,x){this.id=u;this._release=x;this._refCount=0}get isUnreferenced(){return 0===this._refCount}ref(){++this._refCount}release(){--this._refCount;0b.createMarkerTexture(k,l),k=>k,p)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/internal/WaterTextureRepository":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../assets ../../../../../core/Accessor ../../../../../core/asyncUtils ../../../../../core/Logger ../../../../../core/maybe ../../../../../core/promiseUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../support/requestImageUtils ../../core/shaderModules/interfaces ../../lib/basicInterfaces ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){a.WaterTextureRepository=class extends l{constructor(){super(...arguments);this._passParameters=new u;this._resourcesTask=null}get passParameters(){return this._passParameters}destroy(){this._resourcesTask=h.abortMaybe(this._resourcesTask);this._passParameters.waveNormal=h.disposeMaybe(this._passParameters.waveNormal);this._passParameters.wavePerturbation=h.disposeMaybe(this._passParameters.wavePerturbation)}get updating(){return!!this._resourcesTask&& !this._resourcesTask.finished}ensureResources(x){this._resourcesTask||(this._resourcesTask=p.createTask(async y=>{await Promise.allSettled([this._loadImageResource(x,q.getAssetUrl("esri/images/materials/water/normals.jpg"),z=>this._passParameters.waveNormal=z,y),this._loadImageResource(x,q.getAssetUrl("esri/images/materials/water/perturbation.jpg"),z=>this._passParameters.wavePerturbation=z,y)])}));return this._resourcesTask.finished?v.ResourceState.LOADED:v.ResourceState.LOADING}async _loadImageResource(x, y,z,A){try{const B=await t.requestImage(y,{signal:A});f.throwIfAborted(A);const C=new n.TextureDescriptor(B.width,B.height);C.pixelFormat=m.PixelFormat.RGB;C.samplingMode=m.TextureSamplingMode.LINEAR_MIPMAP_LINEAR;C.hasMipmap=!0;C.maxAnisotropy=8;z(new r.Texture(x,C,B))}catch(B){k.getLogger(this).error("Failed to load water material normal texture.",B)}}};b.__decorate([c.property()],a.WaterTextureRepository.prototype,"_resourcesTask",void 0);b.__decorate([c.property({type:Boolean,readOnly:!0})],a.WaterTextureRepository.prototype, "updating",null);a.WaterTextureRepository=b.__decorate([d.subclass("esri.views.3d.webgl-engine.materials.internal.WaterTextureRepository")],a.WaterTextureRepository);class u extends w.NoParameters{}a.WaterTexturePassParameters=u;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/parts/contextCache":function(){define(["exports"],function(a){const b=new Map;a.getContextCache=function(){return b};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/webgl-engine/parts/ScreenshotManager":function(){define("exports ../../../../core/promiseUtils ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../lib/basicInterfaces ../lib/rendererUtils ../../../support/RenderState ../../../support/screenshotUtils ../../../webgl/enums ../../../webgl/FramebufferObject ../../../../core/imageUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g{constructor(t,w,v){this.parameters=t;this.frameHasDecorations=w;this.fbos=v}}class d{constructor(t,w, v){this._rctx=t;this._renderFunctions=w;this._forceCameraHook=v;this.supersample=!0;this._screenshotQueue=[]}destroy(){this._rctx=null}async takeScreenshot(t){await this._renderFunctions.prepareOverlay();this._renderFunctions.requestRenderScene(l.RenderRequestType.BACKGROUND);const w=b.createResolver();this._screenshotQueue.push({settings:t,resolver:w});return w.promise}update(t,w){for(const v of this._screenshotQueue){if(null==this._rctx){v.resolver.reject();continue}const m=this._renderScreenshot(t, {...v.settings,pixelRatio:v.settings.pixelRatio*t.parameters.camera.pixelRatio},w);v.resolver(m)}this._screenshotQueue.length=0}_renderScreenshotOverlay(t,w,v){t.width=w.width;t.height=w.height;const m=t.getContext("2d"),r=v.pixelRatio;m.save();m.translate(0,w.height);m.scale(1,-1);v.region&&m.translate(-v.region.x,-v.region.y);m.scale(r,r);w=this._renderFunctions.renderOverlay(t,v.disableDecorations?l.Decorations.OFF:l.Decorations.ON,w);m.restore();return w}_readbackScreenshot(t,w){return t.resample? this._readbackScreenshotResampled({...t,resample:t.resample},w):this._readbackScreenshotImmediate(t,w)}_readbackScreenshotResampled(t,w){const {framebufferWidth:v,framebufferHeight:m,region:r,resample:n}=t,u=this._ensureScreenshotEncodeCanvas();let x=e.createEmptyImageData(v,m,u);this._rctx.gl.readPixels(0,0,v,m,f.PixelFormat.RGBA,f.DataType.UNSIGNED_BYTE,new Uint8Array(x.data.buffer));w();x=this._renderScreenshotOverlay(u,x,{...t,region:void 0});t=e.createEmptyImageData(r.width,r.height,u);return h.resampleHermite(x, t,!0,n.region.x,m-(n.region.y+n.region.height),n.region.width,n.region.height)}_readbackScreenshotImmediate(t,w){const {framebufferHeight:v,region:m}=t,r=this._ensureScreenshotEncodeCanvas(),n=e.createEmptyImageData(m.width,m.height,r);this._rctx.gl.readPixels(m.x,v-(m.y+m.height),m.width,m.height,f.PixelFormat.RGBA,f.DataType.UNSIGNED_BYTE,new Uint8Array(n.data.buffer));w();return this._renderScreenshotOverlay(r,n,t)}_renderScreenshot(t,w,v){var m=t.parameters.camera,r={width:w.framebufferWidth, height:w.framebufferHeight};c.ensureAttachmentMaxSize(r,Math.min(this._rctx.parameters.maxTextureSize,this._rctx.parameters.maxRenderbufferSize));var n=!1,u=w.disableDecorations&&t.frameHasDecorations,x=w.ignorePadding&&m.pixelRatio!==w.pixelRatio;u=r.width!==m.fullWidth||r.height!==m.fullHeight||u||x||w.objectAndLayerIdColor;let y=null,z=null;if(u){n=m.clone();if(w.ignorePadding){x=q.clone(n.padding);for(let A=0;4>A;A++)x[A]=Math.round(x[A]/n.pixelRatio*w.pixelRatio);n.padding=x}n.fullWidth=r.width; n.fullHeight=r.height;n.pixelRatio=w.pixelRatio;r=m.fovX-n.fovX;x=m.fovY-n.fovY;0>r&&rx&&x{this._rctx.bindFramebuffer(null);z?.release()});m=null;w.objectAndLayerIdColor&&(this._rctx.bindFramebuffer(y?.fbo),m=this._readbackScreenshot(w,()=>{this._rctx.bindFramebuffer(null);y?.release()}),this._rctx.bindFramebuffer(null));if(u&&!this._rctx.contextAttributes.alpha)for(w=3;wr?(r=Math.floor(A.width/z),A={x:A.x,y:Math.floor(A.y+(A.height-r)/2),width:A.width,height:r}):(r=Math.floor(A.height*z),A={x:Math.floor(A.x+(A.width-r)/2),y:A.y,width:r,height:A.height}));const {width:D,height:F}=f(m,A);r=g(n);z=w[r];z=q.clamp(null!=u?u:z,0,100);return{format:r,quality:z,area:A, width:D,height:F,rotation:x,disableDecorations:!!y,ignoreBackground:!!m?.ignoreBackground,ignorePadding:!!m?.ignorePadding}}function k(m,r){null==d&&(d=document.createElement("canvas"));var n=d;if(r.premultipliedAlpha){var u=m.data;const y=u.length;for(let z=0;zB[Y+3]&&(G=G*B[Y+3]/255);K+=G*B[Y];J+=G*B[Y+1];R+=G*B[Y+2];P+=G}}F[L]=K/P;F[L+1]=J/P;F[L+2]=R/P;F[L+3]=Q/M}return r};a.screenshotSuperSampleSettings=function(m,r,n){if(!r)return m;const {framebufferWidth:u,framebufferHeight:x,pixelRatio:y,region:z}=m;r=e(m,n);n=r.left+r.right;const A=r.top+r.bottom,B=u-n,C=x-A,D=Math.min(8,Math.min((2048-n)/B,(2048-A)/C));return 1.5>D?m:{...m,framebufferWidth:Math.round(B*D)+n,framebufferHeight:Math.round(C* D)+A,pixelRatio:y*D,resample:{region:{x:Math.round((z.x-r.left)*D)+r.left,y:Math.round((z.y-r.top)*D)+r.top,width:Math.round(z.width*D),height:Math.round(z.height*D)},width:u,height:x}}};a.toDataUrl=h;a.toRenderSettings=function(m,r){const n=p(m,r),u=n.area,x=n.width/u.width,y=e(n,r.padding),z=y.left+y.right,A=y.top+y.bottom;return{framebufferWidth:Math.floor((r.width-z)*x+z),framebufferHeight:Math.floor((r.height-A)*x+A),region:{x:Math.floor(u.x*x)+y.left,y:Math.floor(u.y*x)+y.top,width:n.width, height:n.height},format:n.format,quality:n.quality,rotation:n.rotation,pixelRatio:x,layers:m?.layers??[],disableDecorations:n.disableDecorations,ignoreBackground:n.ignoreBackground,ignorePadding:n.ignorePadding,objectAndLayerIdColor:!1}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/parts/testUtils":function(){define(["exports","./contextCache"],function(a,b){a.contextCache={enabled:!1,disposeContextCache:()=>{const q=b.getContextCache();q.forEach(l=> l.dispose());q.clear()}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/contextUtils":function(){define(["exports"],function(a){a.createContext=function(b,q={}){return(b=b.getContext("webgl2",q))?b:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/WebGLRequirements":function(){define(["exports","../../core/Error","../webgl/capabilities"],function(a,b,q){a.check=function(l){const p=q.getWebGLCapabilities();return p.available? "3d"===l&&p.majorPerformanceCaveat?new b("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):p.supportsHighPrecisionFragment?p.supportsVertexShaderSamplers?null:new b("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new b("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."): new b("webgl:required","WebGL2 is required but not supported.",Error().stack)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/capabilities":function(){define(["exports","./contextUtils"],function(a,b){function q(k){if("undefined"===typeof WebGL2RenderingContext)return null;var h=document.createElement("canvas");if(!h)return null;let f=b.createContext(h,{failIfMajorPerformanceCaveat:!0});null==f&&(f=b.createContext(h),null!=f&&(k.majorPerformanceCaveat=!0));if(null== f)return f;k.available=!0;k.maxTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE);k.supportsVertexShaderSamplers=0{this.components.forEach(m=>{m=this._find(m)?.widget;void 0!==m?.view&&(m.view=v)})};this._componentsWatcher=(v,m)=>{this._removeComponents(m);this._addComponents(v);this._adjustPadding(v)}}initialize(){this.addHandles([l.watch(()=>this.components,this._componentsWatcher, l.initial),l.watch(()=>this.view,this._updateViewAwareWidgets,l.initial)])}_add(w,v,m,r,n){let u=w;if("string"===typeof w&&this._defaultPositionLookup[w]){if(this._find(w))return;u=this._createComponent(w)}super._add(u,v,m,r,n)}_removeComponents(w){w.forEach(v=>{if(v=this._find(v))this.remove(v),v.destroy()})}_adjustPadding(w){w.includes("attribution")||this._isOverridden("padding")||({top:w}=this.padding,this.padding=w)}_addComponents(w){this.constructed&&w.forEach(v=>this.add(this._createComponent(v), this._defaultPositionLookup[v]))}_createComponent(w){const v=this._createWidget(w);return new f({id:w,node:v})}_createWidget(w){const v=this.view;switch(w){case "attribution":return new e({view:v});case "compass":return new g({view:v});case "navigation-toggle":return new d({view:v});case "zoom":return new t({view:v})}}};a.__decorate([p.property()],b.prototype,"components",void 0);return b=a.__decorate([h.subclass("esri.views.ui.DefaultUI")],b)})},"esri/views/ui/Component":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/domUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f){b=class extends b{constructor(){super(...arguments);this.widget=null}destroy(){this.node=null;this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(c){this._set("id",c)}set node(c){const e=this._get("node");c!==e&&(c&&c.classList.add("esri-component"),e&&e.classList.remove("esri-component"),this._set("node",c))}castNode(c){this.widget?.destroy();if(!c)return this._set("widget",null),null;if("string"===typeof c||c&&"nodeType"in c)return this._set("widget", null),q.byId(c);c&&"function"===typeof c.render&&!c.domNode&&(c.domNode=document.createElement("div"));this._set("widget",c);return c.domNode}};a.__decorate([l.property()],b.prototype,"id",null);a.__decorate([l.property()],b.prototype,"node",null);a.__decorate([p.cast("node")],b.prototype,"castNode",null);a.__decorate([l.property({readOnly:!0})],b.prototype,"widget",void 0);return b=a.__decorate([f.subclass("esri.views.ui.Component")],b)})},"esri/views/ui/UI":function(){define("../../chunks/tslib.es6 ../../intl ../../core/Accessor ../../core/arrayUtils ../../core/domUtils ../../core/Evented ../../core/handleUtils ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/has ../../core/accessorSupport/decorators/subclass ../../support/themeUtils ./Component ../../widgets/support/widgetUtils ../../intl/locale".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(z){return 0===z?"0":`${z}px`}function n(z){const A="object"===typeof z&&null!==z&&Object.getPrototypeOf(z);return null!==A&&A!==Object.prototype||!("component"in z||"index"in z||"position"in z)?null:z}function u(z,{top:A,bottom:B,left:C,right:D}){z.style.top=A;z.style.bottom=B;z.style.left=C;z.style.right=D}const x={left:0,top:0,bottom:0,right:0},y={bottom:30,top:15,right:15,left:15};b=class extends k.EventedAccessor{constructor(z){super(z);this._cornerNameToContainerLookup= {};this._positionNameToContainerLookup={};this._components=[];this._componentMap=new Map;this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol");this._locale=m.getLocale();this.view=null;this._applyViewPadding=()=>{const A=this.container;A&&u(A,this._toPixelPosition(this._getViewPadding()))};this._applyUIPadding=()=>{const A=this._innerContainer;A&&u(A,this._toPixelPosition(this.padding))};this._initContainers()}initialize(){this.addHandles([f.watch(()=>[this.view?.padding,this.container],this._applyViewPadding, f.initial),f.watch(()=>this.padding,this._applyUIPadding,f.initial),f.watch(()=>[this.container,this._locale],([z,A])=>{z&&z.setAttribute("lang",A)},f.initial),m.onLocaleChange(z=>{this._locale=z})])}destroy(){this.container=null;for(const z of this._components)z.destroy();this._components.length=0;this._componentMap.clear()}set container(z){const A=this._get("container");z!==A&&(z&&(z.classList.add("esri-ui"),t.setCalciteThemeClass(z),this._attachContainers(z)),A&&(A.classList.remove("esri-ui"), u(A,{top:"",bottom:"",left:"",right:""}),p.empty(A)),this._set("container",z))}get height(){const z=this.view?.height??0;if(0===z)return z;const A=this._getViewPadding(),{top:B,bottom:C}=A;return Math.max(z-B-C,0)}get padding(){return this._get("padding")}set padding(z){this._overrideIfSome("padding",z)}castPadding(z){return"number"===typeof z?{bottom:z,top:z,right:z,left:z}:{...y,...z}}get width(){const z=this.view?.width??0;if(0===z)return z;const A=this._getViewPadding(),{left:B,right:C}=A;return Math.max(z- B-C,0)}add(z,A){let B,C,D;if(Array.isArray(z))z.forEach(H=>this.add(H,A));else{var F=n(z);F&&({index:B,position:A,component:z,key:C}=F);A&&"object"===typeof A&&({index:B,key:C,position:A,internal:D}=A);!z||A&&!this._isValidPosition(A)||this._add(z,A,B,C,D)}}remove(z,A){if(z){if(Array.isArray(z))return z.map(C=>this.remove(C,A));if((z=this._find(z))&&(!this._componentMap.has(z)||this._componentMap.get(z)?.key===A)){var B=this._components.indexOf(z);z.node.parentNode?.removeChild(z.node);this._componentMap.delete(z); z.widget?.removeHandlesReference(this._removeWidgetHandleKey);return this._components.splice(B,1)[0]}}}empty(z,A={removeInternal:!1}){if(Array.isArray(z))for(const B of z)this.empty(B,A);else{z=Array.prototype.slice.call(this._positionNameToContainerLookup[z??"manual"].children).map(B=>this._findByNode(B)).filter(B=>null==B?!1:!(this._componentMap.get(B)?.internal??!1)||A.removeInternal);for(const B of z)this.remove(B)}}move(z,A){Array.isArray(z)&&z.forEach(D=>this.move(D,A));if(z){var B=n(z)||n(A); if(B){var C=B.index;A=B.position;z=B.component||z}(!A||this._isValidPosition(A))&&(z=this.remove(z))&&this.add(z,{position:A,index:C})}}find(z){return z?(z=this._findById(z))&&(z.widget||z.node):null}getComponents(z,A={includeInternal:!1}){return z?Array.isArray(z)?z.flatMap(B=>this._getComponentsAtPosition(B,A)):this._getComponentsAtPosition(z,A):this._components.filter(B=>A.includeInternal||!(this._componentMap.get(B)?.internal??!1)).map(({widget:B,node:C})=>B??C)}getPosition(z){for(const A in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[A].contains(z))return A; return null}_add(z,A,B,C,D){z instanceof w||(z=new w({node:z}));const {widget:F}=z;null!=F&&F instanceof q&&F.addHandles(h.makeHandle(()=>{queueMicrotask(()=>this.remove(z))}),this._removeWidgetHandleKey);this._place({component:z,position:A,index:B});this._components.push(z);this._componentMap.set(z,{key:C,internal:D})}_find(z){return z?z instanceof w?this._findByComponent(z):"string"===typeof z?this._findById(z):this._findByNode(z.domNode||z):null}_getViewPadding(){return this.view?.padding??x}_attachContainers(z){z.appendChild(this._innerContainer); z.appendChild(this._manualContainer)}_initContainers(){var z=document.createElement("div");z.classList.add("esri-ui-inner-container","esri-ui-corner-container");const A=document.createElement("div");A.classList.add("esri-ui-inner-container","esri-ui-manual-container");const B=document.createElement("div");B.classList.add("esri-ui-top-left","esri-ui-corner");z.appendChild(B);const C=document.createElement("div");C.classList.add("esri-ui-top-right","esri-ui-corner");z.appendChild(C);const D=document.createElement("div"); D.classList.add("esri-ui-bottom-left","esri-ui-corner");z.appendChild(D);const F=document.createElement("div");F.classList.add("esri-ui-bottom-right","esri-ui-corner");z.appendChild(F);this._innerContainer=z;this._manualContainer=A;z=v.isRTL();this._cornerNameToContainerLookup={"top-left":B,"top-right":C,"bottom-left":D,"bottom-right":F,"top-leading":z?C:B,"top-trailing":z?B:C,"bottom-leading":z?F:D,"bottom-trailing":z?D:F};this._positionNameToContainerLookup={manual:A,...this._cornerNameToContainerLookup}}_isValidPosition(z){return!!this._positionNameToContainerLookup[z]}_place(z){var A= z.position??"manual";const {component:B,index:C}=z;z=this._positionNameToContainerLookup[A];A=null!=C&&-1=A.length?z.appendChild(B.node):p.insertBefore(B.node,A[C])):z.appendChild(B.node)}_toPixelPosition(z){return{top:r(z.top), left:r(z.left),right:r(z.right),bottom:r(z.bottom)}}_findByComponent(z){return this._components.find(A=>A===z)??null}_findById(z){return this._components.find(({id:A})=>A===z)??null}_findByNode(z){return this._components.find(({node:A})=>A===z)??null}_getComponentsAtPosition(z,A){return Array.prototype.slice.call(this._positionNameToContainerLookup[z].children).map(B=>this._findByNode(B)).filter(l.isSome).filter(B=>A.includeInternal||!(this._componentMap.get(B)?.internal??!1)).map(({widget:B,node:C})=> B??C)}};a.__decorate([c.property()],b.prototype,"_locale",void 0);a.__decorate([c.property()],b.prototype,"container",null);a.__decorate([c.property()],b.prototype,"height",null);a.__decorate([c.property({value:y})],b.prototype,"padding",null);a.__decorate([e.cast("padding")],b.prototype,"castPadding",null);a.__decorate([c.property()],b.prototype,"view",void 0);a.__decorate([c.property()],b.prototype,"width",null);return b=a.__decorate([d.subclass("esri.views.ui.UI")],b)})},"esri/widgets/Attribution":function(){define("../chunks/tslib.es6 ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ./Attribution/AttributionViewModel ./support/globalCss ./support/decorators/accessibleHandler ./support/decorators/messageBundle ./support/jsxFactory ./support/widgetUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){l=class extends f{constructor(v,m){super(v,m);this._attributionTextOverflowed=this._isOpen=!1;this._prevSourceNodeHeight=0;this._resizeObserver=new ResizeObserver(r=>r.forEach(({target:n})=>this._checkSourceTextOverflow(n)));this.itemDelimiter=" | ";this.messages=null;this.viewModel=new c}initialize(){this.addHandles(b.on(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen|| this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((v,m)=>{v.includes(m.text)||v.push(m.text);return v},[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(v){this._overrideIfSome("icon",v)}get label(){return this.messages?.widgetLabel??""}set label(v){this._overrideIfSome("label",v)}get view(){return this.viewModel.view}set view(v){this.viewModel.view=v}render(){return t.tsx("div",{bind:this,class:this.classes("esri-attribution",e.globalCss.widget, {["esri-attribution--open"]:this._isOpen}),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return t.tsx("div",{class:"esri-attribution__powered-by"},"Powered by"," ",t.tsx("a",{class:"esri-attribution__link",href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const v=this._isOpen,m=this._isInteractive,r=m?0:void 0,{attributionText:n}=this;return t.tsx("div",{afterCreate:this._afterSourcesNodeCreate, bind:this,class:this.classes("esri-attribution__sources",{["esri-attribution__sources--open"]:v,[e.globalCss.interactive]:m}),innerHTML:n,tabIndex:r})}_afterSourcesNodeCreate(v){this._prevSourceNodeHeight=v.clientWidth;this._resizeObserver.observe(v)}_checkSourceTextOverflow(v){let m=!1;const {clientHeight:r,clientWidth:n,scrollWidth:u}=v;v=u>n;const x=this._attributionTextOverflowed!==v;this._attributionTextOverflowed=v;x&&(m=!0);this._isOpen&&(v=rz.text!==y[A].text)}function n(x,y,z){z&&y&&(x.find(A=>A.layerView===y&&A.text===z)||x.push({text:z,layerView:y}))}const u=[];b=class extends b{constructor(x){super(x);this._clear=()=>{this._fetchedAttributionData.clear();this._pendingAttributions.clear();this.removeHandles("suspension"); this.notifyChange("state")};this._pendingAttributions=new Set;this._fetchedAttributionData=new Map;this.items=new l;this.view=null;this._allLayerViewsChange=y=>{this.removeHandles("suspension");this.removeHandles("visible-geometry-changed");const z=this.view?.allLayerViews;z&&(this.addHandles(z.map(A=>p.watch(()=>[A.suspended,A.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),z.forEach(A=>{"esri.views.3d.layers.Tiles3DLayerView3D"===A.declaredClass&&this.addHandles(A.on("visible-geometry-changed", ()=>this._updateAttributionItems()),"visible-geometry-changed")}));y?.removed&&y.removed.forEach(A=>{this._pendingAttributions.delete(A);this._fetchedAttributionData.delete(A)});this._updateAttributionItems()};this.addHandles([p.on(()=>this.view?.allLayerViews,"change",y=>this._allLayerViewsChange(y),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),p.when(()=>!0===this.view?.stationary,()=>this._updateAttributionItems())])}destroy(){this.view=null;this._fetchedAttributionData.clear(); this._pendingAttributions.clear();this.items.removeAll()}get state(){return this.view?.ready?0{if(!A.suspended&&A.layer?.attributionVisible){var B=A.layer;if(m(B,"user"))n(u,A,B.copyright);else if(B.hasAttributionData)if(this._fetchedAttributionData.has(A)){var C=this._fetchedAttributionData.get(A);C?n(u,A,this._getDynamicAttribution(C,x, B)):m(B)&&n(u,A,B.copyright)}else this._fetchAttributionData(A);else(C="portalItem"in B?B.portalItem?.accessInformation:void 0)?n(u,A,C):n(u,A,B.copyright)}});y=y.find(A=>"integrated-mesh-3dtiles"===A.layer?.type);if(this.view&&y){var z=v.getLyr3DWasm(this.view);if(z){z=z.getAttributionText();for(let A=0;A=z)return"";x=x[z];const C=w.project(A.center.clone().normalize(), y.spatialReference),D=new Set;return x?x.filter(F=>{const H=F.id;(F=!D.has(H)&&C&&F.extent&&t.extentContainsPoint(F.extent,C))&&D.add(H);return F}).sort((F,H)=>H.score-F.score||F.objectId-H.objectId).map(F=>F.attribution).join(", "):""}};a.__decorate([k.property({readOnly:!0,type:l})],b.prototype,"items",void 0);a.__decorate([k.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([k.property()],b.prototype,"view",void 0);return b=a.__decorate([e.subclass("esri.widgets.Attribution.AttributionViewModel")], b)})},"esri/views/3d/layers/Lyr3DWasm":function(){define(["require","exports"],function(a,b){let q,l=null;const p=new Map;b.addLayerViewToWasm=async function(k){null==l&&(null==q&&(q=new Promise((c,e)=>a(["../../../layers/Lyr3DWasmPerSceneView"],g=>c(Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"}))),e))),l=await q);const h=k.view;let f=p.get(h);f||(f=new l.default({view:h}),p.set(h,f));await f.initializeWasm();return f.add3DTilesLayerView(k)};b.getLyr3DWasm= function(k){return p.get(k)};b.removeLayerViewFromWasm=function(k){const h=k.view,f=p.get(h);f&&1>f.remove3DTilesLayerView(k)&&(p.delete(h),0===p.size&&(l=q=null))};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/globalCss":function(){define(["exports"],function(a){a.globalCss={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary", buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item", menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active", widgetDisabled:"esri-widget--disabled"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Compass":function(){define("require ../chunks/tslib.es6 ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ./Compass/CompassViewModel ./Compass/css ../chunks/componentsUtils ./support/globalCss ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory".split(" "),function(a, b,q,l,p,k,h,f,c,e,g,d,t,w,v){l=class extends f{constructor(m,r){super(m,r);this.messages=null;this.viewModel=new c;this._reset=()=>{this.viewModel.reset()};this._toRotationTransform=n=>({transform:`rotateZ(${n.z}deg)`})}loadDependencies(){return g.loadCalciteComponents({button:()=>new Promise((m,r)=>a(["../chunks/calcite-button"],m,r)),icon:()=>new Promise((m,r)=>a(["../chunks/calcite-icon"],m,r))})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(m){this.viewModel.goToOverride= m}get icon(){return"rotation"===this.viewModel.state?"arrow-up":"compass-needle"}set icon(m){this._overrideIfSome("icon",m)}get label(){return this.messages?.widgetLabel??""}set label(m){this._overrideIfSome("label",m)}get view(){return this.viewModel.view}set view(m){this.viewModel.view=m}reset(){return this.viewModel.reset()}render(){const {orientation:m,state:r}=this.viewModel,{messages:n}=this;return v.tsx("div",{class:this.classes(e.css.base,d.globalCss.widget)},v.tsx("calcite-button",{class:d.globalCss.widgetButton, disabled:"disabled"===r,kind:"neutral",label:n.reset,onclick:this._reset,round:!0,scale:"s",title:n.reset},v.tsx("div",{"aria-hidden":"true",class:e.css.iconContainer,title:n.reset},v.tsx("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(m)}))))}};b.__decorate([q.property()],l.prototype,"goToOverride",null);b.__decorate([q.property()],l.prototype,"icon",null);b.__decorate([q.property()],l.prototype,"label",null);b.__decorate([q.property(),w.messageBundle("esri/widgets/Compass/t9n/Compass")], l.prototype,"messages",void 0);b.__decorate([q.property()],l.prototype,"view",null);b.__decorate([q.property({type:c})],l.prototype,"viewModel",void 0);return l=b.__decorate([h.subclass("esri.widgets.Compass")],l)})},"esri/widgets/Compass/CompassViewModel":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/has ../../core/reactiveUtils ../../core/time ../../core/accessorSupport/decorators/property ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./utils ../support/GoTo".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){b=class extends g.GoToMixin(b){constructor(d){super(d);this.orientation={x:0,y:0,z:0};this.view=null;this._updateForCamera=this._updateForCamera.bind(this);this._updateForRotation=this._updateForRotation.bind(this);this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(l.watch(()=>this.view,this._updateRotationWatcher,l.initial))}destroy(){this.view=null}get canShowNorth(){return e.canShowNorth(this.view)}get state(){return!this.view?.ready|| "2d"===this.view.type&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){this.view?.ready&&("2d"===this.view?.type?this.callGoTo({target:{rotation:0},options:{animationMode:"always",duration:p.Milliseconds(q("mapview-essential-goto-duration"))}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(d){void 0!==d&&null!==d&&this._set("orientation",{z:d})}_updateForCamera(d){d&&this._set("orientation",{x:0,y:0,z:-d.heading})}_updateRotationWatcher(d){this.removeAllHandles(); d&&this.addHandles("2d"===d.type?l.watch(()=>d?.rotation,this._updateForRotation,l.initial):l.watch(()=>d?.camera,this._updateForCamera,l.initial))}};a.__decorate([k.property({readOnly:!0})],b.prototype,"canShowNorth",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"orientation",void 0);a.__decorate([k.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([k.property()],b.prototype,"view",void 0);return b=a.__decorate([c.subclass("esri.widgets.Compass.CompassViewModel")],b)})}, "esri/widgets/Compass/utils":function(){define(["exports"],function(a){a.canShowNorth=function(b){return b?.spatialReference?.isWebMercator||b?.spatialReference?.isGeographic||!1};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/GoTo":function(){define("exports ../../chunks/tslib.es6 ../../core/maybe ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a, b,q,l,p,k,h,f){a.GoToMixin=c=>{c=class extends c{constructor(...e){super(...e);this.view=this.goToOverride=null}callGoTo(e){const {view:g}=this;q.assertIsSome(g);return this.goToOverride?this.goToOverride(g,e):g.goTo(e.target,e.options)}};b.__decorate([l.property()],c.prototype,"goToOverride",void 0);b.__decorate([l.property()],c.prototype,"view",void 0);return c=b.__decorate([f.subclass("esri.widgets.support.GoTo")],c)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Compass/css":function(){define(["exports"], function(a){a.css={base:"esri-compass",iconContainer:"esri-compass__icon-container"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/NavigationToggle":function(){define("require ../chunks/tslib.es6 ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ./NavigationToggle/css ./NavigationToggle/NavigationToggleViewModel ../chunks/componentsUtils ./support/globalCss ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){l=class extends f{constructor(m,r){super(m,r);this.messages=null;this.viewModel=new e;this.toggle=()=>this.viewModel.toggle();this._rotateButton=this._panButton=null;this._toggle=()=>{("pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton)?.setFocus();this.toggle()}}loadDependencies(){return g.loadCalciteComponents({button:()=>new Promise((m,r)=>a(["../chunks/calcite-button"],m,r))})}get icon(){return"move"}set icon(m){this._overrideIfSome("icon", m)}get label(){return this.messages?.widgetLabel??""}set label(m){this._overrideIfSome("label",m)}set layout(m){"horizontal"!==m&&(m="vertical");this._set("layout",m)}get view(){return this.viewModel.view}set view(m){this.viewModel.view=m}render(){const m="disabled"===this.viewModel?.state,r="pan"===this.viewModel?.navigationMode,n=this.messages.toggle;return v.tsx("div",{class:this.classes(c.css.base,d.globalCss.widget,{[c.css.isLayoutHorizontal]:"horizontal"===this.layout})},v.tsx("calcite-button", {afterCreate:u=>{this._panButton=u},appearance:r?"outline-fill":"solid",class:d.globalCss.widgetButton,disabled:m,iconStart:"move",kind:"neutral",label:n,onclick:this._toggle,tabIndex:r?void 0:-1,title:n}),v.tsx("calcite-button",{afterCreate:u=>{this._rotateButton=u},appearance:r?"solid":"outline-fill",class:d.globalCss.widgetButton,disabled:m,iconStart:"rotate",kind:"neutral",label:n,onclick:this._toggle,tabIndex:r?-1:void 0,title:n}))}};b.__decorate([q.property()],l.prototype,"icon",null);b.__decorate([q.property()], l.prototype,"label",null);b.__decorate([q.property({value:"vertical"})],l.prototype,"layout",null);b.__decorate([q.property(),w.messageBundle("esri/widgets/NavigationToggle/t9n/NavigationToggle")],l.prototype,"messages",void 0);b.__decorate([q.property()],l.prototype,"view",null);b.__decorate([q.property({type:e})],l.prototype,"viewModel",void 0);return l=b.__decorate([h.subclass("esri.widgets.NavigationToggle")],l)})},"esri/widgets/NavigationToggle/css":function(){define(["exports"],function(a){a.css= {base:"esri-navigation-toggle",isLayoutHorizontal:"esri-navigation-toggle--horizontal"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/NavigationToggle/NavigationToggleViewModel":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){b=class extends b{constructor(c){super(c); this._navigationMode="pan";this.view=null}initialize(){this.addHandles(q.when(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&"3d"===this.view?.type?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(c){this._navigationMode=c;this._setNavigationMode()}toggle(){"disabled"!==this.state&&(this.navigationMode="pan"!==this.navigationMode?"pan":"rotate")}_setNavigationMode(){const c=this.view?.inputManager; c&&(c.primaryDragAction="pan"===this._navigationMode?"pan":"rotate")}};a.__decorate([l.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([l.property()],b.prototype,"_navigationMode",void 0);a.__decorate([l.property()],b.prototype,"view",void 0);return b=a.__decorate([f.subclass("esri.widgets.NavigationToggle.NavigationToggleViewModel")],b)})},"esri/widgets/Zoom":function(){define("require ../chunks/tslib.es6 ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ../chunks/componentsUtils ./support/globalCss ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory ./Zoom/ZoomViewModel".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){l=class extends f{constructor(v,m){super(v,m);this.messages=null;this.viewModel=new w;this.zoomIn=()=>this.viewModel.zoomIn();this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return c.loadCalciteComponents({button:()=>new Promise((v,m)=>a(["../chunks/calcite-button"],v,m))})}get icon(){return"magnifying-glass-plus"}set icon(v){this._overrideIfSome("icon",v)}get label(){return this.messages?.widgetLabel??""}set label(v){this._overrideIfSome("label", v)}set layout(v){"horizontal"!==v&&(v="vertical");this._set("layout",v)}set view(v){this.viewModel.view=v}get view(){return this.viewModel.view}render(){const v={["esri-zoom--horizontal"]:"horizontal"===this.layout},{canZoomIn:m,canZoomOut:r}=this.viewModel,{zoomIn:n,zoomOut:u}=this.messages;return t.tsx("div",{class:this.classes("esri-zoom",e.globalCss.widget,v)},t.tsx("calcite-button",{class:e.globalCss.widgetButton,disabled:!m,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}), t.tsx("calcite-button",{class:e.globalCss.widgetButton,disabled:!r,iconStart:"minus",kind:"neutral",label:u,onclick:this.zoomOut,title:u}))}};b.__decorate([q.property()],l.prototype,"icon",null);b.__decorate([q.property()],l.prototype,"label",null);b.__decorate([q.property({value:"vertical"})],l.prototype,"layout",null);b.__decorate([q.property(),d.messageBundle("esri/widgets/Zoom/t9n/Zoom")],l.prototype,"messages",void 0);b.__decorate([q.property()],l.prototype,"view",null);b.__decorate([q.property({type:w})], l.prototype,"viewModel",void 0);return l=b.__decorate([h.subclass("esri.widgets.Zoom")],l)})},"esri/widgets/Zoom/ZoomViewModel":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/promiseUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./ZoomConditions2D ./ZoomConditions3D".split(" "),function(a,b,q,l,p,k,h,f,c,e){b=class extends b{constructor(g){super(g)}destroy(){this.view= null}get canZoomIn(){return null!=this._zoomConditions&&this._zoomConditions.canZoomIn}get canZoomOut(){return null!=this._zoomConditions&&this._zoomConditions?.canZoomOut}get state(){return this.view?.ready?"ready":"disabled"}set view(g){g?"2d"===g.type?this._zoomConditions=new c({view:g}):"3d"===g.type&&(this._zoomConditions=new e({view:g})):this._zoomConditions=null;this._set("view",g)}zoomIn(){if(this.canZoomIn){var g=this.view;"2d"===g.type?g.mapViewNavigation.zoomIn():q.ignoreAbortErrors(g.goTo({zoomFactor:2}))}}zoomOut(){if(this.canZoomOut){var g= this.view;"2d"===g.type?g.mapViewNavigation.zoomOut():q.ignoreAbortErrors(g.goTo({zoomFactor:.5}))}}};a.__decorate([l.property()],b.prototype,"_zoomConditions",void 0);a.__decorate([l.property()],b.prototype,"canZoomIn",null);a.__decorate([l.property()],b.prototype,"canZoomOut",null);a.__decorate([l.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([l.property()],b.prototype,"view",null);return b=a.__decorate([f.subclass("esri.widgets.Zoom.ZoomViewModel")],b)})},"esri/widgets/Zoom/ZoomConditions2D":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h){b=class extends b{get canZoomIn(){if(!this.view?.ready)return!1;const f=this.view?.constraints?.effectiveMaxScale;return 0===f||this._scale>f}get canZoomOut(){var {view:f}=this;if(!f?.ready)return!1;f=f.constraints?.effectiveMinScale;return 0===f||this._scale{"esriFieldTypeOID"===Ka.type&&(sa=Ka.name);return!!sa});return sa||void 0}readGlobalIdField(sa,Ha){!sa&&Ha.fields&&Ha.fields.some(Ka=>{"esriFieldTypeGlobalID"===Ka.type&&(sa=Ka.name);return!!sa});return sa||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(sa,Ha){sa=Ha.store.profile;if(null!=sa&&Ua[sa])return Ua[sa];n.getLogger(this).error("Unknown or missing profile", {profile:sa,layer:this});return"mesh-pyramids"}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(sa){this._override("useViewTime",sa)}load(sa){this.addResolvingPromise(this._load(sa));return Promise.resolve(this)}async _load(sa){const Ha=null!=sa?sa.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},sa).catch(x.throwIfAbortError);await this._fetchService(Ha);await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,Ha),this._setAssociatedFeatureLayer(Ha), this._loadFilterGeometries()]);this._validateElevationInfo();this._applyAssociatedLayerOverrides();this._populateFieldUsageInfo();await this.loadTimeInfoFromService(sa);await Da.loadStyleRenderer(this,{origin:"service"},Ha);da.fixRendererFields(this.renderer,this.fieldsIndex);await this.finishLoadEditablePortalLayer(sa)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(sa){n.getLogger(this).error("#_loadFilterGeometries()", this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:sa}),this.filter=null}}createQuery(){const sa=new ra;"mesh"===this.geometryType?this.associatedLayer?.infoFor3D&&(sa.returnGeometry=!0):(sa.returnGeometry=!0,sa.returnZ=!0);sa.where=this.definitionExpression||"1\x3d1";sa.sqlFormat="standard";sa.outFields=["*"];return sa}queryExtent(sa,Ha){return this._getAssociatedLayerForQuery().then(Ka=>Ka.queryExtent(sa||this.createQuery(),Ha))}queryFeatureCount(sa, Ha){return this._getAssociatedLayerForQuery().then(Ka=>Ka.queryFeatureCount(sa||this.createQuery(),Ha))}queryFeatures(sa,Ha){return this._getAssociatedLayerForQuery().then(Ka=>Ka.queryFeatures(sa||this.createQuery(),Ha)).then(Ka=>{if(Ka?.features)for(const Aa of Ka.features)Aa.layer=this,Aa.sourceLayer=this;return Ka})}async queryRelatedFeatures(sa,Ha){await this.load();if(!this.associatedLayer)throw new r("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer", {layer:this});return this.associatedLayer.queryRelatedFeatures(sa,Ha)}async queryRelatedFeaturesCount(sa,Ha){await this.load();if(!this.associatedLayer)throw new r("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(sa,Ha)}async queryCachedAttributes(sa,Ha){const Ka=da.unpackFieldNames(this.fieldsIndex,await Ea.getRequiredFields(this,Ea.getFetchPopupTemplate(this)));return Qa.queryAttributesFromCachedAttributesId(this.parsedUrl?.path?? "",this.attributeStorageInfo??[],sa,Ha,Ka,this.apiKey,this.customParameters)}async queryCachedFeature(sa,Ha){sa=await this.queryCachedAttributes(sa,[Ha]);if(!sa||0===sa.length)throw new r("scenelayer:feature-not-in-cached-data","Feature not found in cached data");Ha=new q;Ha.attributes=sa[0];Ha.layer=this;Ha.sourceLayer=this;return Ha}queryObjectIds(sa,Ha){return this._getAssociatedLayerForQuery().then(Ka=>Ka.queryObjectIds(sa||this.createQuery(),Ha))}queryAttachments(sa,Ha){return this._getAssociatedLayerForQuery().then(Ka=> Ka.queryAttachments(sa,Ha))}getFieldUsageInfo(sa){const Ha={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[sa]||Ha:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),Ha)}createPopupTemplate(sa){return Ga.createPopupTemplate(this,sa)}_getAssociatedLayerForQuery(){const sa=this.associatedLayer;return sa?.loaded?Promise.resolve(sa):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){await this.load(); if(!this.associatedLayer)throw new r("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(sa){throw new r("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:sa});}return this.associatedLayer}hasCachedStatistics(sa){return null!=this.statisticsInfo&&this.statisticsInfo.some(Ha=>Ha.name===sa)}async queryCachedStatistics(sa,Ha){await this.load(Ha); return await this.fetchStatistics(sa,Ha)}async saveAs(sa,Ha){return this._debouncedSaveOperations(Q.SaveOperationType.SAVE_AS,{...Ha,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},sa)}async save(){return this._debouncedSaveOperations(Q.SaveOperationType.SAVE,{getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"})}async applyEdits(sa,Ha){const {applyEdits:Ka}=await new Promise((aa,Ja)=>a(["./graphics/editingSupport"],aa,Ja));await this.load();const Aa=this.associatedLayer; if(!Aa)throw new r(`${this.type}-layer:not-editable`,"Service is not editable");await Aa.load();const {globalIdField:Sa}=Aa,Ya=!!Aa.infoFor3D,qa=Ha?.globalIdUsed??!0;if(Ya&&null==Sa)throw new r(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(Ya&&!qa)throw new r(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");V.isHostedAgolService(Aa.url)&&Ya&&null!=sa.deleteFeatures&&null!=Sa&&(Ha= {...Ha,globalIdToObjectId:await ba.getGlobalIdToObjectIdMap(Aa,sa.deleteFeatures,Sa)});return Ka(this,Aa.source,sa,Ha)}async uploadAssets(sa,Ha){await this.load();if(null==this.associatedLayer)throw new r(`${this.type}-layer:not-editable`,"Service is not editable");await this.associatedLayer.load();return this.associatedLayer.uploadAssets(sa,Ha)}on(sa,Ha){return super.on(sa,Ha)}async convertMesh(sa,Ha){var Ka=Sa=>{n.getLogger(this).error(".convertMesh()",Sa.message);throw Sa;};await this.load();this.infoFor3D|| Ka(new r("invalid:layer","SceneLayer has no capability for mesh conversion"));sa=await this.extractAndFilterFiles(sa);const Aa=sa.reduce((Sa,Ya)=>ka.isFileEditFormat(this.infoFor3D,Ya)?Sa+1:Sa,0);0===Aa&&Ka(new I.NoModelError);1ka.isFileSupported(Ha,Ka)):sa}validateLayer(sa){if(sa.layerType&&!Na.has(sa.layerType))throw new r("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:sa.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new r("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"}); if(2Aa.name===sa.name),Ka=!!this.associatedLayer?.fields?.some(Aa=>Aa&&sa.name===Aa.name);this._fieldUsageInfo[sa.name]={supportsLabelingInfo:Ha,supportsRenderer:Ha,supportsPopupTemplate:Ha||Ka,supportsLayerQuery:Ka}}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides();this._applyAssociatedLayerPopupOverrides();this._applyAssociatedLayerExtentOverride();this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(this.associatedLayer?.fields){var sa= null;for(const Ha of this.associatedLayer.fields){const Ka=this.getField(Ha.name);Ka?(!Ka.domain&&Ha.domain&&(Ka.domain=Ha.domain.clone()),Ka.editable=Ha.editable,Ka.nullable=Ha.nullable,Ka.length=Ha.length):(sa||=this.fields?this.fields.slice():[],sa.push(Ha.clone()))}sa&&this._set("fields",sa)}}_applyAssociatedLayerPopupOverrides(){if(this.associatedLayer){var sa=["popupTemplate","popupEnabled"],Ha=C.getProperties(this);for(let Ka=0;Kathis.popupEnabled&&null!=this.popupTemplate);const sa=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${sa}`): n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${sa}`)}_validateElevationInfo(){const sa=this.elevationInfo;"mesh-pyramids"===this.profile&&xa.logInvalidElevationInfoWarning(n.getLogger(this),xa.elevationModeUnsupportedMessage("Mesh scene layers","relative-to-scene",sa));xa.logInvalidElevationInfoWarning(n.getLogger(this),xa.featureExpressionUnsupportedMessage("Scene layers",sa))}async fetchStatistics(sa,Ha){return await ya.fetchStatistics({fieldName:sa, statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:Ha?.signal})}};b.__decorate([z.property({types:{key:"type",base:U.FeatureReduction,typeMap:{selection:Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],v.prototype,"featureReduction",void 0);b.__decorate([z.property({type:[na.RangeInfo], json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],v.prototype,"rangeInfos",void 0);b.__decorate([z.property({json:{read:!1}})],v.prototype,"associatedLayer",void 0);b.__decorate([z.property({type:["show","hide"]})],v.prototype,"listMode",void 0);b.__decorate([z.property({type:["ArcGISSceneServiceLayer"]})],v.prototype,"operationalLayerType",void 0);b.__decorate([z.property({json:{read:!1},readOnly:!0})], v.prototype,"type",void 0);b.__decorate([z.property({...p.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],v.prototype,"fields",void 0);b.__decorate([z.property()],v.prototype,"types",null);b.__decorate([z.property()],v.prototype,"typeIdField",null);b.__decorate([z.property()],v.prototype,"templates",null);b.__decorate([z.property()],v.prototype,"formTemplate",null);b.__decorate([z.property({readOnly:!0,clonable:!1})],v.prototype,"fieldsIndex",null);b.__decorate([z.property({type:ja, json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],v.prototype,"floorInfo",void 0);b.__decorate([z.property(p.outFields)],v.prototype,"outFields",void 0);b.__decorate([z.property({type:ia.I3SNodePageDefinition,readOnly:!0,json:{read:!1}})],v.prototype,"nodePages",void 0);b.__decorate([D.reader("service","nodePages",["nodePages","pointNodePages"])],v.prototype,"readNodePages",null);b.__decorate([z.property({type:[ia.I3SMaterialDefinition],readOnly:!0})], v.prototype,"materialDefinitions",void 0);b.__decorate([z.property({type:[ia.I3STextureSetDefinition],readOnly:!0})],v.prototype,"textureSetDefinitions",void 0);b.__decorate([z.property({type:[ia.I3SGeometryDefinition],readOnly:!0})],v.prototype,"geometryDefinitions",void 0);b.__decorate([z.property({readOnly:!0})],v.prototype,"serviceUpdateTimeStamp",void 0);b.__decorate([z.property({readOnly:!0})],v.prototype,"attributeStorageInfo",void 0);b.__decorate([z.property({readOnly:!0})],v.prototype,"statisticsInfo", void 0);b.__decorate([z.property({type:m.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],v.prototype,"excludeObjectIds",void 0);b.__decorate([z.property({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],v.prototype,"definitionExpression",void 0);b.__decorate([z.property({type:va,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0, allowNull:!0},origins:{service:{read:!1,write:!1}}}})],v.prototype,"filter",void 0);b.__decorate([z.property({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],v.prototype,"path",void 0);b.__decorate([z.property(ha.elevationInfo)],v.prototype,"elevationInfo",null);b.__decorate([z.property({readOnly:!0,json:{read:!1}})],v.prototype,"effectiveCapabilities",null);b.__decorate([z.property({readOnly:!0})],v.prototype,"effectiveEditingEnabled",null);b.__decorate([z.property({type:String})], v.prototype,"geometryType",null);b.__decorate([z.property(ha.labelsVisible)],v.prototype,"labelsVisible",void 0);b.__decorate([z.property({type:[fa],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:X.reader},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:X.reader},write:!0}})],v.prototype,"labelingInfo",void 0);b.__decorate([z.property(ha.legendEnabled)],v.prototype,"legendEnabled",void 0);b.__decorate([z.property({type:Number,json:{origins:{"web-document":{default:1, write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(sa,Ha){if("number"===typeof sa&&0<=sa&&1>=sa)return sa;sa=Ha.layerDefinition?.drawingInfo?.transparency;return void 0!==sa?ua.transparencyToOpacity(sa):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],v.prototype,"opacity",void 0);b.__decorate([z.property({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})], v.prototype,"priority",void 0);b.__decorate([z.property({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],v.prototype,"semantic",void 0);b.__decorate([z.property({types:w.webSceneRendererTypes,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],v.prototype,"renderer",null);b.__decorate([z.property({json:{read:!1}})],v.prototype,"cachedDrawingInfo",void 0);b.__decorate([D.reader("service","cachedDrawingInfo")], v.prototype,"readCachedDrawingInfo",null);b.__decorate([z.property({readOnly:!0,json:{read:!1}})],v.prototype,"capabilities",null);b.__decorate([z.property({type:Boolean,json:{read:!1}})],v.prototype,"editingEnabled",null);b.__decorate([z.property({readOnly:!0,json:{write:!1,read:!1}})],v.prototype,"infoFor3D",null);b.__decorate([z.property({readOnly:!0,json:{write:!1,read:!1}})],v.prototype,"relationships",null);b.__decorate([z.property(ha.popupEnabled)],v.prototype,"popupEnabled",void 0);b.__decorate([z.property({type:l, json:{name:"popupInfo",write:!0}})],v.prototype,"popupTemplate",void 0);b.__decorate([z.property({readOnly:!0,json:{read:!1}})],v.prototype,"defaultPopupTemplate",null);b.__decorate([z.property({type:String,json:{read:!1}})],v.prototype,"objectIdField",void 0);b.__decorate([D.reader("service","objectIdField",["objectIdField","fields"])],v.prototype,"readObjectIdField",null);b.__decorate([z.property({type:String,json:{read:!1}})],v.prototype,"globalIdField",void 0);b.__decorate([D.reader("service", "globalIdField",["globalIdField","fields"])],v.prototype,"readGlobalIdField",null);b.__decorate([z.property({readOnly:!0,type:String,json:{read:!1}})],v.prototype,"displayField",null);b.__decorate([z.property({type:String,json:{read:!1}})],v.prototype,"profile",void 0);b.__decorate([D.reader("service","profile",["store.profile"])],v.prototype,"readProfile",null);b.__decorate([z.property({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],v.prototype, "normalReferenceFrame",void 0);b.__decorate([z.property(ha.screenSizePerspectiveEnabled)],v.prototype,"screenSizePerspectiveEnabled",void 0);b.__decorate([z.property({json:{read:!1,origins:{service:{read:!0}}}})],v.prototype,"serviceItemId",void 0);b.__decorate([z.property(W.useViewTimeProperty)],v.prototype,"useViewTime",null);v=b.__decorate([F.subclass("esri.layers.SceneLayer")],v);const Ua={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points", "features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},wa={"mesh-pyramids":"mesh",points:"point"};return v})},"esri/geometry/Mesh":function(){define("require ../chunks/tslib.es6 ../core/deprecate ../core/Error ../core/Loadable ../core/Logger ../core/Promise ../core/promiseUtils ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../core/libs/gl-matrix-2/factories/vec3f64 ./Extent ./Geometry ./Point ./Polygon ./support/axisAngleDegrees ./support/MeshComponent ./support/meshErrors ./support/MeshGeoreferencedVertexSpace ./support/MeshLocalVertexSpace ./support/MeshTransform ./support/MeshVertexAttributes ./support/meshVertexSpaceUtils ./support/triangulationUtils ./support/meshUtils/bounds ./support/meshUtils/centerAt ./support/meshUtils/loadExternal ./support/meshUtils/Metadata ./support/meshUtils/primitives ./support/meshUtils/rotate ./support/meshUtils/scale".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){function P(){return k.getLogger("esri.geometry.Mesh")}var M;g={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:z,local:A}};p=M=class extends p.LoadableMixin(h.EsriPromiseMixin(m)){constructor(J){super(J);this.components=null;this.vertexSpace=new z;this.transform=null;this.metadata=new G.Metadata;this.hasZ=!0;this.hasM=!1;this.vertexAttributes=new C.MeshVertexAttributes;this.type="mesh"}initialize(){if(0=== this.metadata.externalSources.length||this.vertexAttributes.position.length)this.loadStatus="loaded";this.when(()=>{this.addHandles(c.watch(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(J=>J.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?0V.cloneWithDeduplication(W,S))}J={components:Q,spatialReference:this.spatialReference,vertexAttributes:J,vertexSpace:R,transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new M(J)}cloneShallow(){return new M({components:this.components,spatialReference:this.spatialReference, vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(J){const [{toBinaryGLTF:R}]=await Promise.all([new Promise((Q,W)=>a(["./support/meshUtils/exporters/gltf/gltfexport"],Q,W)),this.load(J)]);f.throwIfAborted(J);return await R(this,J)}get memoryUsage(){let J;J=0+this.vertexAttributes.memoryUsage;if(null!=this.components)for(const R of this.components)J+= R.memoryUsage;return J}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(J){return this.loaded?!0:(P().error(J,y.meshNotLoadedMessage),!1)}static createBox(J,R){if(!(J instanceof r))return P().error(".createBox()",y.invalidLocationMessage),null;J=new M(I.convertUnitGeometry(I.createUnitSizeBox(),J,R));return R?.imageFace&&"all"!==R.imageFace?I.extractSingleFaceOfBox(J,R.imageFace):J}static createSphere(J,R){return J instanceof r?new M(I.convertUnitGeometry(I.createUnitSizeSphere(R?.densificationFactor|| 0),J,R)):(P().error(".createSphere()",y.invalidLocationMessage),null)}static createCylinder(J,R){return J instanceof r?new M(I.convertUnitGeometry(I.createUnitSizeCylinder(R?.densificationFactor||0),J,R)):(P().error(".createCylinder()",y.invalidLocationMessage),null)}static createPlane(J,R){if(!(J instanceof r))return P().error(".createPlane()",y.invalidLocationMessage),null;const Q=R?.facing??"up",W=I.convertPlaneSizeParameter(Q,R?.size);return new M(I.convertUnitGeometry(I.createUnitSizePlane(Q), J,{...R,size:W}))}static createFromPolygon(J,R){if(!(J instanceof n))return P().error(".createFromPolygon()",y.invalidPolygonMessage),null;const Q=F.triangulate(J);return new M({vertexAttributes:new C.MeshVertexAttributes({position:Q.position}),components:[new x({faces:Q.faces,shading:"flat",material:R?.material??null})],spatialReference:J.spatialReference,vertexSpace:new z})}static async createFromGLTF(J,R,Q){if(!(J instanceof r))throw J=new y.InvalidLocationError,P().error(".createfromGLTF()",J.message), J;const {loadGLTFMesh:W}=await f.whenOrAbort(new Promise((S,V)=>a(["./support/meshUtils/loadGLTFMesh"],S,V)),Q);return new M(await W(J,R,Q))}static async createFromFiles(J,R,Q){q.deprecatedFunction(P(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});if(!(J instanceof r))throw J=R=new y.InvalidLocationError,P().error(".createFromFiles()",J.message),R;if(!Q?.layer)throw new l("invalid:no-layer","SceneLayer required for file to mesh conversion."); return Q.layer.convertMesh(R,{location:J,...Q})}static createWithExternalSource(J,R,Q){var W=Q?.extent??null;const {spatialReference:S}=J,V=Q?.transform?.clone()??new B;J=D.selectVertexSpace(J,Q);R={source:R,extent:W};W=new G.Metadata;W.externalSources.push(R);return new M({metadata:W,transform:V,vertexSpace:J,spatialReference:S})}static createIncomplete(J,R){var {spatialReference:Q}=J;const W=R?.transform?.clone()??new B;J=D.selectVertexSpace(J,R);Q=new M({transform:W,vertexSpace:J,spatialReference:Q}); Q.addResolvingPromise(Promise.reject(new l("mesh-incomplete","Mesh resources are not complete")));return Q}};b.__decorate([e.property({type:[x],json:{write:!0}})],p.prototype,"components",void 0);b.__decorate([e.property({nonNullable:!0,types:g,constructOnly:!0,json:{write:!0}})],p.prototype,"vertexSpace",void 0);b.__decorate([e.property({type:B,json:{write:!0}})],p.prototype,"transform",void 0);b.__decorate([e.property({constructOnly:!0})],p.prototype,"metadata",void 0);b.__decorate([e.property()], p.prototype,"hasExtent",null);b.__decorate([e.property()],p.prototype,"_transformedExtent",null);b.__decorate([e.property()],p.prototype,"_untransformedBounds",null);b.__decorate([e.property()],p.prototype,"anchor",null);b.__decorate([e.property()],p.prototype,"origin",null);b.__decorate([e.property({readOnly:!0,json:{read:!1}})],p.prototype,"extent",null);b.__decorate([e.property({readOnly:!0,json:{read:!1,write:!0,default:!0}})],p.prototype,"hasZ",void 0);b.__decorate([e.property({readOnly:!0,json:{read:!1, write:!0,default:!1}})],p.prototype,"hasM",void 0);b.__decorate([e.property({type:C.MeshVertexAttributes,nonNullable:!0,json:{write:!0}})],p.prototype,"vertexAttributes",void 0);p=M=b.__decorate([t.subclass("esri.geometry.Mesh")],p);const K=u.create();return p})},"esri/geometry/support/meshErrors":function(){define(["exports","../../core/Error"],function(a,b){class q extends b{constructor(){super("invalid-input:location","Expected location to be a Point instance")}}a.InvalidLocationError=q;a.componentNotFoundMessage= "Provided component is not part of the list of components";a.invalidLocationMessage="Expected location to be a Point instance";a.invalidPolygonMessage="Expected polygon to be a Polygon instance";a.meshNotLoadedMessage="Mesh must be loaded before applying operations";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/bounds":function(){define(["exports","../../Extent","../aaBoundingBox","./projection"],function(a,b,q,l){function p(f){if(0===f.length)return q.zero; const c=q.create([Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,-Number.POSITIVE_INFINITY,-Number.POSITIVE_INFINITY,-Number.POSITIVE_INFINITY]);q.expandWithBuffer(c,f);return c}function k(f,c){const [e,g,d,t,w,v]=p(f);return new b({xmin:e,ymin:g,zmin:d,xmax:t,ymax:w,zmax:v,spatialReference:c})}let h=null;a.getBoundsFromPositions=p;a.getExtentFromBounds=function([f,c,e,g,d,t],w,v,m){h??=new Float64Array(24);const r=h;r[0]=f;r[1]=c;r[2]=e;r[3]=f;r[4]=d;r[5]=e;r[6]=g;r[7]= d;r[8]=e;r[9]=g;r[10]=c;r[11]=e;r[12]=f;r[13]=c;r[14]=t;r[15]=f;r[16]=d;r[17]=t;r[18]=g;r[19]=d;r[20]=t;r[21]=g;r[22]=c;r[23]=t;l.project({positions:r,transform:w,vertexSpace:v,inSpatialReference:m,outSpatialReference:m,outPositions:r});return k(r,m)};a.getExtentFromPositions=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/centerAt":function(){define("exports ../../../core/Logger ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../projection/projectPointToVector ../MeshGeoreferencedVertexSpace ../MeshLocalVertexSpace ../meshVertexSpaceUtils ./geographicUtils ./projection ./vertexSpaceConversion".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){const d=()=>b.getLogger("esri.geometry.support.meshUtils.centerAt"),t=l.create(),w=l.create(),v=l.create();a.centerAt=function(m,r,n){if(m.vertexAttributes?.position){var {vertexSpace:u}=m,x=n?.origin??m.anchor;n=c.performGlobalOperation(d,u,x.spatialReference,n?.geographic);if(f.isRelativeVertexSpace(u))({vertexSpace:u}=m),f.isRelativeVertexSpace(u)&&(p.projectPointToVector(r,t,m.spatialReference)?p.projectPointToVector(x,w,m.spatialReference)?(m=q.subtract(v,t,w), u.origin=q.add(l.create(),u.origin,m)):(r=m.origin,w[0]=r.x,w[1]=r.y,w[2]=r.z,e.logProjectionError(d(),x.spatialReference,m.spatialReference,e.loadProjectErrorMessage)):e.logProjectionError(d(),r.spatialReference,m.spatialReference,e.loadProjectErrorMessage));else if(n){if(x=l.fromValues(x.x,x.y,x.z??0),x=g.convertVertexSpace(m,new h({origin:x})))if(r=l.fromValues(r.x,r.y,r.z??0),r=g.convertVertexSpace({vertexAttributes:x,spatialReference:m.spatialReference,vertexSpace:new h({origin:r})},new k)){var {position:y, normal:z,tangent:A}=r;m.vertexAttributes.position=y;m.vertexAttributes.normal=z;m.vertexAttributes.tangent=A;m.vertexAttributesChanged()}}else if(p.projectPointToVector(r,t,m.spatialReference))if(p.projectPointToVector(x,w,m.spatialReference)){if(r=m.vertexAttributes.position)for(x=0;xu;u++)r[x+u]+=t[u]-w[u];m.vertexAttributesChanged()}else r=m.origin,w[0]=r.x,w[1]=r.y,w[2]=r.z,e.logProjectionError(d(),x.spatialReference,m.spatialReference,e.loadProjectErrorMessage);else e.logProjectionError(d(), r.spatialReference,m.spatialReference,e.loadProjectErrorMessage)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/geographicUtils":function(){define(["exports","../../../core/deprecate","../meshVertexSpaceUtils"],function(a,b,q){a.isGlobal=function(l,p){return l.isGeographic||l.isWebMercator&&(p??!0)};a.performGlobalOperation=function(l,p,k,h){if(void 0!==h){b.deprecated(l(),"option: geographic",{replacement:"Use mesh `vertexSpace` and spatial reference to control how operations are performed instead.", version:"4.30",warnOnce:!0});const f="local"===p.type;if(q.isRelativeVertexSpace(p)&&h!==f)l().warnOnce(`Specifying the 'geographic' parameter (${h}) for a Mesh vertex space of type "${p.type}" is not supported. This parameter will be ignored.`);else return k.isGeographic||k.isWebMercator&&h}switch(p.type){case "georeferenced":return k.isGeographic;case "local":return k.isGeographic||k.isWebMercator}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/vertexSpaceConversion":function(){define("exports ../../../core/Logger ../../../core/mathUtils ../../../core/unitUtils ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../spatialReferenceEllipsoidUtils ../../projection/computeTranslationToOriginAndRotation ../../projection/projectPointToVector ../meshVertexSpaceUtils ../../../chunks/vec3 ./projection".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r({vertexAttributes:G,transform:I,spatialReference:O},{origin:L},P,M){const {position:K,normal:J,tangent:R}=I?y(G,I.localMatrix):G,Q=new Float64Array(K.length);I=K;L&&(I=v.translate(Q,I,L));P&&(L=c.negate(H,P),I=v.translate(Q,I,L));z(O,M,E.NONE);O=M?.allowBufferReuse;return{position:I!==G.position||O?I:I.slice(),normal:J!==G.normal||O?J:J?.slice(),tangent:R!==G.tangent||O?R:R?.slice()}}function n({spatialReference:G,vertexAttributes:I,transform:O}, {origin:L},P,M){var K=g.getSphericalPCPF(G);if(!d.computeTranslationToOriginAndRotation(G,L,C,K))return m.logProjectionError(B(),G,K),null;O&&h.multiply(C,C,O.localMatrix);O=C;M=z(G,M,E.SOURCE);1!==M&&h.scale(O,O,[M,M,M]);M=new Float64Array(I.position.length);O=I.position;v.transformMat4(M,O,C);O=new Float64Array(O.length);m.projectFromPCPF(M,O,G)||(m.logProjectionError(B(),g.getSphericalPCPF(G),G),O=null);if(!O)return null;L=I.normal;K=C;if(null==L)L=null;else{var J=new Float32Array(L.length);m.transformNormal(L, J,K);m.projectNormalFromPCPF(J,O,M,G,J)?L=J:(m.logProjectionError(B(),g.getSphericalPCPF(G),G),L=null)}if(I.normal&&!L)return null;K=I.tangent;J=C;if(null==K)G=null;else{var R=new Float32Array(K.length);m.transformTangent(K,R,J);m.projectTangentFromPCPF(R,O,M,G,R)?G=R:(m.logProjectionError(B(),g.getSphericalPCPF(G),G),G=null)}if(I.tangent&&!G)return null;P&&(I=c.negate(H,P),v.translate(O,O,I));return{position:O,normal:L,tangent:G}}function u({vertexAttributes:G,spatialReference:I,transform:O},{origin:L}, P,M){const K=g.getSphericalPCPF(I);if(!d.computeTranslationToOriginAndRotation(I,P,C,K))return m.logProjectionError(B(),I,K),null;P=1/z(I,M,E.TARGET);h.scale(C,C,[P,P,P]);P=h.invert(D,C);if(L)if(O)O=y(G,O.localMatrix),v.translate(O.position,O.position,L),L=O;else{const {position:W,normal:S,tangent:V}=G;L={position:v.translate(new Float64Array(W.length),W,L),tangent:V,normal:S}}else L=G;const {position:J,normal:R,tangent:Q}=L;L=new Float64Array(J.length);(M=m.projectToPCPF(J,I,L))?(O=new Float64Array(M.length), v.transformMat4(O,M,P)):(m.logProjectionError(B(),I,g.getSphericalPCPF(I)),O=null);if(!O)return null;P=p.normalFromMat4(F,P);null==R?M=null:(M=(R!==G.normal?R:void 0)??new Float32Array(R.length),m.projectNormalToPCPF(R,J,L,I,M)?v.transformMat3(M,M,P):(m.logProjectionError(B(),I,g.getSphericalPCPF(I)),M=null));if(!M&&R)return null;null==Q?I=null:(G=(Q!==G.tangent?Q:void 0)??new Float32Array(Q.length),m.projectTangentToPCPF(Q,J,L,I,G)?(v.transformMat3(G,G,P,4),I=G):(m.logProjectionError(B(),I,g.getSphericalPCPF(I)), I=null));return!I&&Q?null:{position:O,normal:M,tangent:I}}function x({vertexAttributes:G,spatialReference:I,transform:O},{origin:L},P,M){const K=g.getSphericalPCPF(I);if(!d.computeTranslationToOriginAndRotation(I,L,C,K))return m.logProjectionError(B(),I,K),null;O&&h.multiply(C,C,O.localMatrix);if(!d.computeTranslationToOriginAndRotation(I,P,D,K))return m.logProjectionError(B(),K,I),null;h.invert(D,D);O=h.multiply(C,D,C);I=z(I,M,E.SOURCE|E.TARGET);1!==I&&h.scale(O,O,[I,I,I]);return y(G,O)}function y(G, I){const O=new Float64Array(G.position.length);v.transformMat4(O,G.position,I);const L=G.normal?new Float32Array(G.normal.length):null,P=G.tangent?new Float32Array(G.tangent.length):null;L&&G.normal&&m.transformNormal(G.normal,L,I);P&&G.tangent&&m.transformTangent(G.tangent,P,I);return{position:O,normal:L,tangent:P}}function z(G,I,O){const L=!!(O&E.SOURCE);O=!!(O&E.TARGET);const P=I?.sourceUnit;I=I?.targetUnit;if(!P&&!I)return 1;let M=A(P,G);!L&&P&&1!==M&&(B().warn("source unit conversion not supported"), M=1);G=1/A(I,G);!O&&I&&1!==G&&(B().warn("target unit conversion not supported"),G=1);return M*G}function A(G,I){if(null==G)return 1;I=l.getMetersPerCartesianUnitForSR(I);return 1/l.convertUnit(I,"meters",G)}const B=()=>b.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion"),C=f.create(),D=f.create(),F=k.create(),H=e.create(),N=f.create();var E;(function(G){G[G.NONE=0]="NONE";G[G.SOURCE=1]="SOURCE";G[G.TARGET=2]="TARGET"})(E||={});a.convertVertexSpace=function(G,I,O){const {vertexSpace:L, transform:P,vertexAttributes:M}=G,K=z(G.spatialReference,O,E.SOURCE|E.TARGET);if(w.vertexSpaceEquals(L,I)&&(!P||h.exactEquals(P.localMatrix,f.IDENTITY))&&q.floatEqualUlp(K,1)){const {position:J,normal:R,tangent:Q}=M;G=O?.allowBufferReuse;return{position:G?J:J.slice(),normal:G?R:R?.slice(),tangent:G?Q:Q?.slice()}}switch(G.vertexSpace.type){case "local":return"local"===I.type?x(G,G.vertexSpace,I.origin,O):n(G,G.vertexSpace,I.origin,O);case "georeferenced":return"local"===I.type?u(G,G.vertexSpace,I.origin, O):r(G,G.vertexSpace,I.origin,O)}};a.getUnitToSpatialReferenceScaleConversion=A;a.projectPointToVertexSpace=function(G,I,{vertexSpace:O,spatialReference:L}){if("georeferenced"===O.type){if(!t.projectPointToVector(I,G,L))return!1;({origin:L}=O);c.subtract(G,G,L);return!0}const P=g.getSphericalPCPF(L);if(!t.projectPointToVector(I,G,P))return!1;({origin:I}=O);if(!d.computeTranslationToOriginAndRotation(L,I,N,P))return!1;L=h.invert(N,N);if(null==L)return!1;c.transformMat4(G,G,L);return!0};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/loadExternal":function(){define("require exports ../../../core/Error ../../../core/promiseUtils ../../../core/urlUtils ../../Point".split(" "),function(a,b,q,l,p,k){function h(u){const x=p.removeFile(u.url);return y=>{var z=p.makeRelative(y,x,x);return((z=z?z.replace(/^ *\.\//,""):null)?u.files.get(z):null)??y}}async function f(u,x){if(Array.isArray(u)){if(!u.length)throw new q("mesh-load-external:missing-assets","There must be at least one file to load"); return u[0]instanceof File?e(u):g(u,x)}return n.fromBlob(u,t(u.name,u.type))}async function c(u,x){const {parts:y,assetMimeType:z,assetName:A}=u;if(1===y.length)return new n(y[0].partUrl);u=await u.toBlob(x);l.throwIfAborted(x);return n.fromBlob(u,t(A,z))}function e(u){u=u.map(x=>({name:x.name,mimeType:x.type,source:n.fromBlob(x,t(x.name,x.type))}));return d(u)}async function g(u,x){u=await l.allSettledValues(u.map(async y=>{const z=await c(y);l.throwIfAborted(x);return{name:y.assetName,mimeType:y.assetMimeType, source:z}}));if(l.isAborted(x))throw u.forEach(y=>y.source.dispose()),l.createAbortError();return d(u)}function d(u){const x=new Map;let y=null,z=void 0;for(const {name:A,mimeType:B,source:C}of u){if(null===y)if(w.test(B)||m.test(A))y=C.url,z="gltf";else if(v.test(B)||r.test(A))y=C.url,z="glb";x.set(A,C.url);C.files.forEach((D,F)=>x.set(F,D))}if(null==y)throw new q("mesh-load-external:missing-files","Missing files to load external mesh source");return new n(y,()=>u.forEach(({source:A})=>A.dispose()), x,z)}function t(u,x){return w.test(x)||m.test(u)?"gltf":v.test(x)||m.test(u)?"glb":void 0}const w=/^model\/gltf\+json$/,v=/^model\/gltf-binary$/,m=/\.gltf$/i,r=/\.glb$/i;class n{constructor(u,x=()=>{},y=new Map,z){this.url=u;this.dispose=x;this.files=y;this.type=z}static fromBlob(u,x){const y=URL.createObjectURL(u);return new n(y,()=>URL.revokeObjectURL(y),void 0,x)}}b.loadExternal=async function(u,x,y){({source:x}=x);const {loadGLTFMesh:z}=await l.whenOrAbort(new Promise((D,F)=>a(["./loadGLTFMesh"], D,F)),y),A=await f(x,y);l.throwIfAborted(y);y=z(new k({x:0,y:0,z:0,spatialReference:u.spatialReference}),A.url,{resolveFile:h(A),signal:y?.signal,expectedType:A.type});y.then(()=>A.dispose(),()=>A.dispose());const {vertexAttributes:B,components:C}=await y;u.vertexAttributes=B;u.components=C};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/Metadata":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/Collection ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./External".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){a.Metadata=class extends q.Clonable{constructor(d){super(d);this.externalSources=new l;this._explicitDisplaySource=null;this.addHandles(p.on(()=>this.externalSources,"after-remove",({item:t})=>{t===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(d){if(null!=d&&!g.isDisplayExternal(d))throw Error("Cannot use this source for display: it is not in a supported format."); (this._explicitDisplaySource=d)&&this.externalSources.every(t=>!g.externalSourcesAreEqual(t,d))&&this.externalSources.add(d)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(d){return this.externalSources.items.filter(t=>g.externalIsOnService(t,d))}get _implicitDisplaySource(){return this.externalSources.find(g.isDisplayExternal)}};b.__decorate([k.property()],a.Metadata.prototype,"externalSources",void 0);b.__decorate([k.property()],a.Metadata.prototype,"displaySource", null);b.__decorate([k.property()],a.Metadata.prototype,"_implicitDisplaySource",null);b.__decorate([k.property()],a.Metadata.prototype,"_explicitDisplaySource",void 0);a.Metadata=b.__decorate([e.subclass("esri.geometry.support.meshUtils.Metadata")],a.Metadata);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/primitives":function(){define("exports ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../MeshComponent ../MeshVertexAttributes ../meshVertexSpaceUtils ./vertexSpaceConversion".split(" "), function(a,b,q,l,p,k,h,f){var c=[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],e=[0,0,1,0,0,1,0,0,1,0,0,1],g=[0,1,1,1,1,0,0,0],d=[0,1,2,0,2,3],t={east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]};const w={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625], corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},v={south:0,east:1,north:2,west:3,up:4,down:5},m=l.create(),r=b.create();a.boxFaceOrder=v;a.convertPlaneSizeParameter=function(n,u){const x="number"===typeof u?u:null!=u?u.width:1;u="number"===typeof u?u:null!=u?u.height:1;switch(n){case "up":case "down":return{width:x, depth:u};case "north":case "south":return{width:x,height:u};case "east":case "west":return{depth:x,height:u}}};a.convertUnitGeometry=function(n,u,x){if(!n.isPlane)for(var y=0;yA;A++)m[A]=n.position[z+A];q.transformMat3(m,m,r);for(A=0;3>A;A++)n.position[z+A]=m[A]}if(y[0]!==y[1]||y[1]!==y[2])for(r[0]=1/y[0],r[4]=1/y[1],r[8]=1/y[2],y=0;yz;z++)m[z]=n.normal[y+z];q.transformMat3(m,m,r);q.normalize(m,m);for(z=0;3>z;z++)n.normal[y+z]=m[z]}}y=h.selectVertexSpace(u,x);z=u.spatialReference.isGeographic?h.selectVertexSpace(u):y;z=f.convertVertexSpace({vertexAttributes:n,vertexSpace:z,spatialReference:u.spatialReference}, y,{allowBufferReuse:!0});return{vertexAttributes:new k.MeshVertexAttributes({...z,uv:n.uv}),vertexSpace:y,components:[new p({faces:n.faces,material:x?.material||null})],spatialReference:u.spatialReference}};a.createUnitSizeBox=function(){const {faceDescriptions:n,faceVertexOffsets:u,uvScales:x}=w;var y=4*n.length;const z=new Float64Array(3*y),A=new Float32Array(3*y);y=new Float32Array(2*y);const B=new Uint32Array(6*n.length);let C=0,D=0,F=0,H=0;for(let E=0;EI;I++){const O=N[I];let L=0;y[F++]=.25*x[I][0]+G.uvOrigin[0];y[F++]=G.uvOrigin[1]-.25*x[I][1];for(let P=0;3>P;P++)0!==G.axis[P]?(z[C++]=.5*G.axis[P],A[D++]=G.axis[P]):(z[C++]=.5*O[L++],A[D++]=0)}}return{position:z,normal:A,uv:y,faces:B}};a.createUnitSizeCylinder=function(n=0){n=Math.round(16*2**n);var u=4*(n+1)+2*n;const x=new Float64Array(3*u),y=new Float32Array(3*u);u=new Float32Array(2*u);const z=new Uint32Array(12*n);let A=0,B=0,C=0,D=0,F=0;for(let N=0;5>=N;N++){const E= 0===N||5===N,G=1>=N||4<=N,I=2===N||4===N,O=E?n-1:n;for(let L=0;L<=O;L++){var H=L/O*2*Math.PI;const P=E?0:.5;m[0]=P*Math.sin(H);m[1]=P*-Math.cos(H);m[2]=2>=N?.5:-.5;for(H=0;3>H;H++)x[A++]=m[H],G?y[B++]=2===H?1>=N?1:-1:0:y[B++]=2===H?0:m[H]/P;u[C++]=(L+(E?.5:0))/n;1>=N?u[C++]=1*N/3:3>=N?u[C++]=(N-2)/3+1/3:u[C++]=(N-4)/3+2/3;I||0===N||L===n||(5!==N&&(z[D++]=F,z[D++]=F+1,z[D++]=F-n),1!==N&&(z[D++]=F,z[D++]=F-n,z[D++]=F-n-1));F++}}return{position:x,normal:y,uv:u,faces:z}};a.createUnitSizePlane=function(n){n= t[n];const u=new Float64Array(c.length),x=new Float32Array(e.length);let y=0;for(let A=0;4>A;A++){const B=y;for(let C=0;3>C;C++){var z=n[C];const D=Math.abs(z)-1;z=0<=z?1:-1;u[y]=c[B+D]*z;x[y]=e[B+D]*z;y++}}return{position:u,normal:x,uv:new Float32Array(g),faces:new Uint32Array(d),isPlane:!0}};a.createUnitSizeSphere=function(n=0){n=Math.round(8*2**n);const u=2*n;var x=(n-1)*(u+1)+2*u;const y=new Float64Array(3*x),z=new Float32Array(3*x);x=new Float32Array(2*x);const A=new Uint32Array((n-1)*u*6);let B= 0,C=0,D=0,F=0;for(let E=0;E<=n;E++){var H=E/n*Math.PI+.5*Math.PI;const G=Math.cos(H);m[2]=Math.sin(H);const I=(H=0===E||E===n)?u-1:u;for(let O=0;O<=I;O++){var N=O/I*2*Math.PI;m[0]=-Math.sin(N)*G;m[1]=Math.cos(N)*G;for(N=0;3>N;N++)y[B]=.5*m[N],z[B]=m[N],++B;x[C++]=(O+(H?.5:0))/u;x[C++]=E/n;0!==E&&O!==u&&(E!==n&&(A[D++]=F,A[D++]=F+1,A[D++]=F-u),1!==E&&(A[D++]=F,A[D++]=F-u,A[D++]=F-u-1));F++}}return{position:y,normal:z,uv:x,faces:A}};a.extractSingleFaceOfBox=function(n,u){const x=n.components[0];var y= x.faces,z=v[u],A=6*z;u=Array(6);const B=Array(y.length-6);var C=0;let D=0;for(let F=0;F=A&&FL;L++)A[L]=E[G+L]-O[L];c.transformMat4(A,A,D);for(L=0;3>L;L++)E[G+L]=A[L]+O[L]}}const z=()=>b.getLogger("esri.geometry.support.meshUtils.rotate"),A=e.create(),B=k.create(),C=v.create(),D=k.create(),F=l.create(),H=e.create(),N=f.create();a.rotate=function(E,G,I){if(E.vertexAttributes?.position&&0!==G[3]){var {spatialReference:O,vertexSpace:L}= E,P=I?.origin??E.anchor;I=n.performGlobalOperation(z,L,O,I?.geographic);if(r.isMeshWithRelativeVertexSpace(E))a:{E.transform??(E.transform=new m);const {vertexSpace:K,transform:J,spatialReference:R}=E,[Q,W,S]=K.origin;I=new g({x:Q,y:W,z:S,spatialReference:R});var M=A;if(I.equals(P))c.set(M,0,0,0);else if(!x.projectPointToVertexSpace(M,P,E)){u.logProjectionError(z(),P.spatialReference,R,u.loadProjectErrorMessage);break a}h.setAxisAngle(N,v.axis(G),v.angleRad(G));E=p.fromRotationTranslationScaleOrigin(B, N,e.ZEROS,e.ONES,M);({localMatrix:G}=J);E=p.multiply(B,E,G);J.scale=p.getScaling(e.create(),E);p.scale(E,E,c.inverse(A,J.scale));G=J.rotationAxis;J.rotation=v.fromMatrix(E);0===J.rotationAngle&&(J.rotationAxis=G);J.translation=p.getTranslation(e.create(),E)}else if(I)a:{I=E.spatialReference;M=d.getSphericalPCPF(I);if(!w.projectPointToVector(P,H,M)&&(u.logProjectionError(z(),P.spatialReference,M,"Falling back to mesh origin"),!w.projectPointToVector(E.origin,H,M))){u.logProjectionError(z(),E.origin.spatialReference, M);break a}P=E.vertexAttributes.position;const K=E.vertexAttributes.normal,J=E.vertexAttributes.tangent,R=new Float64Array(P.length),Q=null!=K?new Float32Array(K.length):null,W=null!=J?new Float32Array(J.length):null;t.computeTranslationToOriginAndRotation(M,H,D,M);q.fromMat4(F,D);c.transformMat3(v.axis(C),v.axis(G),F);C[3]=G[3];if(u.projectToPCPF(P,I,R))if(null==K||null==Q||u.projectNormalToPCPF(K,P,R,I,Q))if(null==J||null==W||u.projectTangentToPCPF(J,P,R,I,W))if(y(R,C,3,H),u.projectFromPCPF(R,P, I)){if(null!=K&&null!=Q&&(y(Q,C,3),!u.projectNormalFromPCPF(Q,P,R,I,K))){u.logProjectionError(z(),M,I);break a}if(null!=J&&null!=W&&(y(W,C,4),!u.projectTangentFromPCPF(W,P,R,I,J))){u.logProjectionError(z(),M,I);break a}E.vertexAttributesChanged()}else u.logProjectionError(z(),M,I);else u.logProjectionError(z(),I,M);else u.logProjectionError(z(),I,M);else u.logProjectionError(z(),I,M)}else w.projectPointToVector(P,H,E.spatialReference)?(y(E.vertexAttributes.position,G,3,H),y(E.vertexAttributes.normal, G,3),y(E.vertexAttributes.tangent,G,4),E.vertexAttributesChanged()):(G=E.origin,H[0]=G.x,H[1]=G.y,H[2]=G.z,u.logProjectionError(z(),P.spatialReference,E.spatialReference,u.loadProjectErrorMessage))}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/scale":function(){define("exports ../../../core/Logger ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/factories/quatf64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../Point ../../spatialReferenceEllipsoidUtils ../../projection/projectPointToVector ../axisAngleDegrees ../MeshTransform ../meshVertexSpaceUtils ./geographicUtils ./projection ./vertexSpaceConversion".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(A,B,C=h.ZEROS){if(A)for(let F=0;FD;D++)u[D]=A[F+D]-C[D];k.scale(u,u,B);for(D=0;3>D;D++)A[F+D]=u[D]+C[D]}}const n=()=>b.getLogger("esri.geometry.support.meshUtils.scale"),u=h.create(),x=h.create(),y=l.create(),z=h.create();a.scale=function(A,B,C){if(A.vertexAttributes?.position){var {vertexSpace:D,spatialReference:F}=A,H=C?.origin??A.anchor;C=w.performGlobalOperation(n,D,F,C?.geographic);if(t.isMeshWithRelativeVertexSpace(A))a:{A.transform?? (A.transform=new d);const {vertexSpace:E,transform:G,spatialReference:I}=A,[O,L,P]=E.origin;var N=new f({x:O,y:L,z:P,spatialReference:I});C=u;if(N.equals(H))k.set(C,0,0,0);else if(!m.projectPointToVertexSpace(C,H,A)){v.logProjectionError(n(),H.spatialReference,I,v.loadProjectErrorMessage);break a}A=k.set(x,B,B,B);A=q.fromRotationTranslationScaleOrigin(y,p.IDENTITY,h.ZEROS,A,C);({localMatrix:B}=G);A=q.multiply(y,A,B);G.scale=q.getScaling(h.create(),A);q.scale(A,A,k.inverse(u,G.scale));B=G.rotationAxis; G.rotation=g.fromMatrix(A);0===G.rotationAngle&&(G.rotationAxis=B);G.translation=q.getTranslation(h.create(),A)}else if(C)a:{C=A.spatialReference;N=c.getSphericalPCPF(C);if(!e.projectPointToVector(H,z,N)&&(v.logProjectionError(n(),H.spatialReference,N,"Falling back to mesh origin"),!e.projectPointToVector(A.origin,z,N))){v.logProjectionError(n(),A.origin.spatialReference,N);break a}H=A.vertexAttributes.position;const E=A.vertexAttributes.normal,G=A.vertexAttributes.tangent,I=new Float64Array(H.length), O=null!=E?new Float32Array(E.length):null,L=null!=G?new Float32Array(G.length):null;v.projectToPCPF(H,C,I)?null==E||null==O||v.projectNormalToPCPF(E,H,I,C,O)?null==G||null==L||v.projectTangentToPCPF(G,H,I,C,L)?(r(I,B,z),v.projectFromPCPF(I,H,C)?null==E||null==O||v.projectNormalFromPCPF(O,H,I,C,E)?null==G||null==L||v.projectTangentFromPCPF(L,H,I,C,G)?A.vertexAttributesChanged():v.logProjectionError(n(),N,C):v.logProjectionError(n(),N,C):v.logProjectionError(n(),N,C)):v.logProjectionError(n(),C,N): v.logProjectionError(n(),C,N):v.logProjectionError(n(),C,N)}else e.projectPointToVector(H,z,A.spatialReference)?(r(A.vertexAttributes.position,B,z),A.vertexAttributesChanged()):(B=A.origin,z[0]=B.x,z[1]=B.y,z[2]=B.z,v.logProjectionError(n(),H.spatialReference,A.spatialReference,v.loadProjectErrorMessage))}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/sources/support/uploadAssetErrors":function(){define(["exports","../../../../core/Error"],function(a,b){class q extends b{constructor(){super("upload-assets:unsupported", "Layer does not support asset uploads.",Error())}}class l extends b{constructor(){super("upload-assets:no-glb-support","Layer does not support glb.",Error())}}class p extends b{constructor(){super("upload-assets:no-supported-source","No supported external source found",Error())}}class k extends b{constructor(){super("upload-assets:not-base-64","Expected gltf data in base64 format after conversion.",Error())}}class h extends b{constructor(){super("upload-assets:unable-to-prepare-options","Unable to prepare uploadAsset request options.", Error())}}class f extends b{constructor(w,v){super("upload-assets:bad-response",`Bad response. Uploaded ${w} items and received ${v} results.`,Error())}}class c extends b{constructor(w,v){super("upload-assets-layer:upload-failed",`Failed to upload mesh file ${w}. Error code: ${v?.code??"-1"}. Error message: ${v?.messages??"unknown"}`,Error())}}class e extends b{constructor(w){super("upload-assets-layer:unsupported-format",`The service allowed us to upload an asset of FormatID ${w}, but it does not list it in its supported formats.`, Error())}}class g extends b{constructor(){super("upload-assets:convert3D-failed","convert3D failed.")}}class d extends b{constructor(){super("invalid-input:no-model","No supported model found")}}class t extends b{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}a.BadResponseError=f;a.Convert3DFailedError=g;a.MultipleModelsError=t;a.NoGlbSupportError=l;a.NoModelError=d;a.NoSupportedSourceError=p;a.NotBase64Error=k;a.UnableToPrepareOptionsError=h;a.UnsupportedError= q;a.UnsupportedFormatUploadedError=e;a.UploadFailedError=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/mixins/SceneService":function(){define("exports ../../chunks/tslib.es6 ../../request ../../core/Error ../../core/Logger ../../core/promiseUtils ../../core/urlUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/RandomLCG ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../core/accessorSupport/originUtils ../../geometry/Extent ../../geometry/HeightModelInfo ../../geometry/SpatialReference ../support/arcgisLayerUrl ../support/commonProperties ../support/I3SIndexInfo ../support/schemaValidatorLoader ../../portal/Portal ../../portal/PortalItem ../../portal/support/jsonContext ../../webdoc/support/resourceUtils ../../webdoc/support/saveAPIKeyUtils ../../webdoc/support/saveUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F){function H(I){if(null!=I.spatialReference)return r.fromJSON(I.spatialReference);I=I.store;I=(I=I.indexCRS||I.geographicCRS)&&parseInt(I.substring(I.lastIndexOf("/")+1,I.length),10);return null!=I?new r(I):null}function N(I,O,L){I.typeKeywords||(I.typeKeywords=[]);O=O.getTypeKeywords();for(const P of O)I.typeKeywords.push(P);I.typeKeywords&&(I.typeKeywords=I.typeKeywords.filter((P,M,K)=>K.indexOf(P)===M),L===E.newItem&&(I.typeKeywords= I.typeKeywords.filter(P=>"Hosted Service"!==P)))}var E;(function(I){I[I.existingItem=0]="existingItem";I[I.newItem=1]="newItem"})(E||={});const G={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};a.SaveOperationType=void 0;(function(I){I[I.SAVE=0]="SAVE";I[I.SAVE_AS=1]="SAVE_AS"})(a.SaveOperationType||(a.SaveOperationType={}));a.SceneService=I=>{I=class extends I{constructor(){super(...arguments);this.heightModelInfo=this.fullExtent= this.spatialReference=null;this.maxScale=this.minScale=0;this.version={major:Number.NaN,minor:Number.NaN,versionString:""};this.copyright=null;this.sublayerTitleMode="item-title";this.indexInfo=this.layerId=this.title=null;this._debouncedSaveOperations=k.debounce(async(O,L,P)=>{switch(O){case a.SaveOperationType.SAVE:return this._save(L);case a.SaveOperationType.SAVE_AS:return this._saveAs(P,L)}})}readSpatialReference(O,L){return H(L)}readFullExtent(O,L,P){if(null!=O&&"object"===typeof O)return L= null==O.spatialReference?{...O,spatialReference:H(L)}:O,v.fromJSON(L,P);P=L.store;L=H(L);return null==L||null==P?.extent||!Array.isArray(P.extent)||P.extent.some(M=>-1E38>M)?null:new v({xmin:P.extent[0],ymin:P.extent[1],xmax:P.extent[2],ymax:P.extent[3],spatialReference:L})}parseVersionString(O){const L={major:Number.NaN,minor:Number.NaN,versionString:O};O=O.split(".");2<=O.length&&(L.major=parseInt(O[0],10),L.minor=parseInt(O[1],10));return L}readVersion(O,L){O=L.store;return this.parseVersionString(null!= O.version?O.version.toString():"")}readTitlePortalItem(O){return"item-title"!==this.sublayerTitleMode?void 0:O}readTitleService(O,L){O=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?n.titleFromUrlAndName(this.url,L.name):L.name;L=L.name;if(!L&&this.url){const P=n.parse(this.url);null!=P&&(L=P.title)}"item-title-and-service-name"===this.sublayerTitleMode&&O&&(L=O+" - "+L);return n.cleanTitle(L)}set url(O){null==O?this._set("url",O):(O=n.sanitizeUrlWithLayerId({layer:this, url:O,nonStandardUrlAllowed:!1,logger:p.getLogger(this)}),this._set("url",O.url),null!=O.layerId&&this._set("layerId",O.layerId))}writeUrl(O,L,P,M){n.writeUrlWithLayerId(this,O,"layers",L,M)}get parsedUrl(){var O=this._get("url");(O=h.urlToObject(O))&&null!=this.layerId&&(O.path=`${O.path}/layers/${this.layerId}`);return O}async _fetchIndexAndUpdateExtent(O,L){this.indexInfo=x.fetchIndexInfo(this.parsedUrl?.path??"",this.rootNode,O,this.customParameters,this.apiKey,p.getLogger(this),L);null==this.fullExtent|| this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(O){if("page"===O?.type){var L=O.rootIndex%O.pageSize;L=O.rootPage?.nodes?.[L];if(null==L?.obb?.center||null==L.obb.halfSize)throw new l("sceneservice:invalid-node-page","Invalid node page.");-1E38>L.obb.center[0]||null==this.fullExtent||this.fullExtent.hasZ||(O=L.obb.halfSize,L=L.obb.center[2],O=Math.sqrt(O[0]*O[0]+O[1]*O[1]+O[2]*O[2]),this.fullExtent.zmin=L-O,this.fullExtent.zmax=L+O)}else if("node"===O?.type&&(L=O.rootNode?.mbs, Array.isArray(L)&&4===L.length&&!(-1E38>L[0]))){O=L[2];L=L[3];var {fullExtent:P}=this;P&&(P.zmin=O-L,P.zmax=O+L)}}async _fetchService(O){if(null==this.url)throw new l("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const L=await this._fetchFirstLayerId(O);null!=L&&(this.layerId=L)}return this._fetchServiceLayer(O)}async _fetchFirstLayerId(O){O=await q(this.url??"",{query:{f:"json",...this.customParameters, token:this.apiKey},responseType:"json",signal:O});if(O.data&&Array.isArray(O.data.layers)&&0new l("sceneservice:schema-validation",J)),new l("sceneservice-validate:error", "Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:M});}};b.__decorate([f.property(u.id)],I.prototype,"id",void 0);b.__decorate([f.property({type:r})],I.prototype,"spatialReference",void 0);b.__decorate([g.reader("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],I.prototype,"readSpatialReference",null);b.__decorate([f.property({type:v})],I.prototype,"fullExtent",void 0);b.__decorate([g.reader("fullExtent",["fullExtent","store.extent", "spatialReference","store.indexCRS","store.geographicCRS"])],I.prototype,"readFullExtent",null);b.__decorate([f.property({readOnly:!0,type:m})],I.prototype,"heightModelInfo",void 0);b.__decorate([f.property({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],I.prototype,"minScale",void 0);b.__decorate([f.property({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],I.prototype, "maxScale",void 0);b.__decorate([f.property({readOnly:!0})],I.prototype,"version",void 0);b.__decorate([g.reader("version",["store.version"])],I.prototype,"readVersion",null);b.__decorate([f.property({type:String,json:{read:{source:"copyrightText"}}})],I.prototype,"copyright",void 0);b.__decorate([f.property({type:String,json:{read:!1}})],I.prototype,"sublayerTitleMode",void 0);b.__decorate([f.property({type:String})],I.prototype,"title",void 0);b.__decorate([g.reader("portal-item","title")],I.prototype, "readTitlePortalItem",null);b.__decorate([g.reader("service","title",["name"])],I.prototype,"readTitleService",null);b.__decorate([f.property({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],I.prototype,"layerId",void 0);b.__decorate([f.property(u.url)],I.prototype,"url",null);b.__decorate([t.writer("url")],I.prototype,"writeUrl",null);b.__decorate([f.property()],I.prototype,"parsedUrl",null);b.__decorate([f.property({readOnly:!0})], I.prototype,"store",void 0);b.__decorate([f.property({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],I.prototype,"rootNode",void 0);return I=b.__decorate([d.subclass("esri.layers.mixins.SceneService")],I)};a.sceneServiceItemType="Scene Service";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/accessorSupport/originUtils":function(){define(["exports","../multiOriginJSONSupportUtils"],function(a,b){a.updateOrigins=function(q){q?.writtenProperties&&q.writtenProperties.forEach(({target:l, propName:p,newOrigin:k})=>{b.isMultiOriginJSONMixin(l)&&k&&l.originOf(p)!==k&&l.updateOrigin(p,k)})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/multiOriginJSONSupportUtils":function(){define(["exports"],function(a){a.isMultiOriginJSONMixin=function(b){return b&&"getAtOrigin"in b&&"originOf"in b};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/I3SIndexInfo":function(){define(["exports","../../request","../../core/Error"],function(a, b,q){a.fetchIndexInfo=async function(l,p,k,h,f,c,e){var g=null;if(null!=k){g=`${l}/nodepages/`;const d=g+Math.floor(k.rootIndex/k.nodesPerPage);try{return{type:"page",rootPage:(await b(d,{query:{f:"json",...h,token:f},responseType:"json",signal:e})).data,rootIndex:k.rootIndex,pageSize:k.nodesPerPage,lodMetric:k.lodSelectionMetricType,urlPrefix:g}}catch(t){null!=c&&c.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",d,t),g=t}}if(!p)return null;p=p?.split("/").pop(); l=`${l}/nodes/`;p=l+p;try{return{type:"node",rootNode:(await b(p,{query:{f:"json",...h,token:f},responseType:"json",signal:e})).data,urlPrefix:l}}catch(d){throw new q("sceneservice:root-node-missing","Root node missing.",{pageError:g,nodeError:d,url:p});}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/schemaValidatorLoader":function(){define(["exports"],function(a){let b=null;a.getLoader=function(){return b};a.registerLoader=function(q){b=q};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/portal/support/jsonContext":function(){define(["exports","../../core/urlUtils","../Portal"],function(a,b,q){function l(p,k){return{origin:k,url:b.urlToObject(p.itemUrl),portal:p.portal||q.getDefault(),portalItem:p}}a.createForItemRead=function(p,k){return{...l(p,k),readResourcePaths:[]}};a.createForItemWrite=function(p,k,h){const f=b.urlToObject(p.itemUrl);return{...l(p,k),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:f? {rootPath:f.path,writtenUrls:[]}:null,resources:h?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webdoc/support/resourceUtils":function(){define("require exports ../../core/Error ../../core/promiseUtils ../../core/uuid ../../portal/support/resourceUtils".split(" "),function(a,b,q,l,p,k){async function h(c,e,g){if(e?.resources){var d=e.portalItem===c.portalItem?new Set(c.paths):new Set;c.paths.length=0;c.portalItem= e.portalItem;var t=new Set(e.resources.toKeep.map(u=>u.resource.path)),w=new Set,v=[];t.forEach(u=>{d.delete(u);c.paths.push(u)});var m=[],r=[],n=[];for(const u of e.resources.toUpdate)if(d.delete(u.resource.path),t.has(u.resource.path)||w.has(u.resource.path)){const {resource:x,content:y,finish:z}=u,A=k.getSiblingOfSameTypeI(x,p.generateUUID());c.paths.push(A.path);m.push({resource:A,content:await k.contentToBlob(y),compress:u.compress});z&&n.push(()=>z(A))}else{c.paths.push(u.resource.path);r.push({resource:u.resource, content:await k.contentToBlob(u.content),compress:u.compress});const x=u.finish;x&&n.push(()=>x(u.resource));w.add(u.resource.path)}for(const u of e.resources.toAdd)if(c.paths.push(u.resource.path),d.has(u.resource.path))d.delete(u.resource.path);else{m.push({resource:u.resource,content:await k.contentToBlob(u.content),compress:u.compress});const x=u.finish;x&&n.push(()=>x(u.resource))}if(m.length||r.length)({addOrUpdateResources:t}=await new Promise((u,x)=>a(["../../portal/support/resourceUtils"], u,x))),await t(e.portalItem,m,"add",g),await t(e.portalItem,r,"update",g);n.forEach(u=>u());if(0===v.length)return d;e=await l.allSettledErrors(v);l.throwIfAborted(g);if(0({created:new Date(v),size:m,resource:h.resourceFromPath(r)}))}};a.getSiblingOfSameType= function(h,f){if(!h.hasPath())return null;const [c,,e]=k(h.path);return h.portalItem.resourceFromPath(l.join(c,f+e))};a.getSiblingOfSameTypeI=function(h,f){if(!h.hasPath())return null;const [c,,e]=k(h.path);return h.portalItem.resourceFromPath(l.join(c,f+e))};a.removeAllResources=async function(h,f){await h.load(f);const c=l.join(h.userItemUrl,"removeResources");return h.portal.request(c,{method:"post",query:{deleteAll:!0},signal:f?.signal})};a.removeResource=async function(h,f,c){if(!f.hasPath())throw new q("portal-item-resources-remove:invalid-path", "Resource does not have a valid path");await h.load(c);const e=l.join(h.userItemUrl,"removeResources");await h.portal.request(e,{method:"post",query:{resource:f.path},signal:c?.signal});f.portalItem=null};a.splitPrefixFileNameAndExtension=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webdoc/support/saveAPIKeyUtils":function(){define(["exports","../../config","../../core/Error","../../support/apiKeyUtils"],function(a,b,q,l){a.validateSaveAPIKey=function(p){if(b.apiKey&&l.supportsApiKey(p.portal.url))throw new q("save-api-key-utils:api-key-not-supported", `Saving is not supported on ${p.portal.url} when using an api key`);};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webdoc/support/saveUtils":function(){define(["exports","../../core/Error"],function(a,b){const q=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);a.beforeSave=async function(l){const p=[];for(const k of l.allLayers)"beforeSave"in k&&"function"===typeof k.beforeSave&&(l=k.beforeSave())&&p.push(l); await Promise.allSettled(p)};a.evaluateWriteErrors=function(l,p,k){let h=(l.messages??[]).filter(({type:f})=>"error"===f).map(({name:f,message:c,details:e})=>new b(f,c,e));l.blockedRelativeUrls&&(h=h.concat(l.blockedRelativeUrls.map(f=>new b("url:unsupported",`Relative url '${f}' is not supported`))));if(k){const {ignoreUnsupported:f,supplementalUnsupportedErrors:c=[],requiredPropertyChecksDisabled:e}=k;f&&(h=h.filter(({name:g})=>!(q.has(g)||c.includes(g))));e&&(h=h.filter(g=>"web-document-write:property-required"!== g.name))}if(0{v=class extends v{constructor(){super(...arguments);this.serviceTimeInfo=null}get timeInfo(){var m= this.associatedLayer?.timeInfo;if(null==m)return null;m=m.clone();g.fixTimeInfoFields(m,this.fieldsIndex);return m}set timeInfo(m){g.fixTimeInfoFields(m,this.fieldsIndex);this._override("timeInfo",m)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(m){this._override("timeExtent",m)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(m){this._override("timeOffset",m)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(m){this._override("datesInUnknownTimezone", m)}async loadTimeInfoFromService(m){var {serviceTimeInfo:r}=this;if(null!=r){var {startTimeField:n,endTimeField:u}=r;if((null!=n||null!=u)&&!d.cacheIsOutOfSync({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp})){r=async z=>{let A=null;try{A=(await this.fetchStatistics?.(z,m))?.stats}catch{}if(null==A)return null;const {minTimeStr:B,min:C,maxTimeStr:D,max:F}=A;z=z===n?B??C:D??F;return null!=z?new Date(z):null};var [x,y]=await Promise.all([r(n),r(u)]);null!=n&& null==x||null!=u&&null==y||(r=new q({start:x,end:y}),this.setAtOrigin("timeInfo",new t({endField:u,startField:n,fullTimeExtent:r}),"service"))}}}};b.__decorate([k.property({type:t,json:{read:!1,write:!1}})],v.prototype,"timeInfo",null);b.__decorate([k.property({type:q,json:{read:!1,write:!1}})],v.prototype,"timeExtent",null);b.__decorate([k.property({type:l,json:{read:!1,write:!1}})],v.prototype,"timeOffset",null);b.__decorate([k.property({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],v.prototype, "datesInUnknownTimezone",null);b.__decorate([k.property({type:w,readOnly:!0,json:{read:{source:"timeInfo"}}})],v.prototype,"serviceTimeInfo",void 0);return v=b.__decorate([e.subclass("esri.layers.mixins.TemporalSceneLayer")],v)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/sceneLayerCacheUtils":function(){define(["exports"],function(a){a.cacheIsOutOfSync=function({associatedLayer:b,serviceUpdateTimeStamp:q}){const l=b?.editingInfo?.lastEditDate;b=b?.serverGens; const p=null!=l,k=null!=q;q=p&&k&&q.lastUpdate!==l.getTime();return p&&(q||!k&&b?.minServerGen!==b?.serverGen)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/capabilities":function(){define(["exports"],function(a){a.zeroCapabilities={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1, supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1, supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1, supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1, supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/I3SLayerDefinitions":function(){define("exports ../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/enumeration ../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,q,l,p,k,h,f,c){a.I3SNodePageDefinition=class extends q.JSONSupport{constructor(){super(...arguments);this.nodesPerPage=null;this.rootIndex=0;this.lodSelectionMetricType=null}};b.__decorate([l.property({type:Number})],a.I3SNodePageDefinition.prototype,"nodesPerPage",void 0);b.__decorate([l.property({type:Number})],a.I3SNodePageDefinition.prototype,"rootIndex",void 0);b.__decorate([l.property({type:String})],a.I3SNodePageDefinition.prototype,"lodSelectionMetricType",void 0);a.I3SNodePageDefinition= b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],a.I3SNodePageDefinition);a.I3SMaterialTexture=class extends q.JSONSupport{constructor(){super(...arguments);this.factor=1}};b.__decorate([l.property({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],a.I3SMaterialTexture.prototype,"id",void 0);b.__decorate([l.property({type:Number})],a.I3SMaterialTexture.prototype,"factor",void 0);a.I3SMaterialTexture=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")], a.I3SMaterialTexture);a.I3SMaterialPBRMetallicRoughness=class extends q.JSONSupport{constructor(){super(...arguments);this.baseColorFactor=[1,1,1,1];this.metallicRoughnessTexture=this.baseColorTexture=null;this.roughnessFactor=this.metallicFactor=1}};b.__decorate([l.property({type:[Number]})],a.I3SMaterialPBRMetallicRoughness.prototype,"baseColorFactor",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],a.I3SMaterialPBRMetallicRoughness.prototype,"baseColorTexture",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})], a.I3SMaterialPBRMetallicRoughness.prototype,"metallicRoughnessTexture",void 0);b.__decorate([l.property({type:Number})],a.I3SMaterialPBRMetallicRoughness.prototype,"metallicFactor",void 0);b.__decorate([l.property({type:Number})],a.I3SMaterialPBRMetallicRoughness.prototype,"roughnessFactor",void 0);a.I3SMaterialPBRMetallicRoughness=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],a.I3SMaterialPBRMetallicRoughness);a.I3SMaterialDefinition=class extends q.JSONSupport{constructor(){super(...arguments); this.alphaMode="opaque";this.alphaCutoff=.25;this.doubleSided=!1;this.cullFace="none";this.pbrMetallicRoughness=this.emissiveFactor=this.emissiveTexture=this.occlusionTexture=this.normalTexture=null}};b.__decorate([f.enumeration({opaque:"opaque",mask:"mask",blend:"blend"})],a.I3SMaterialDefinition.prototype,"alphaMode",void 0);b.__decorate([l.property({type:Number})],a.I3SMaterialDefinition.prototype,"alphaCutoff",void 0);b.__decorate([l.property({type:Boolean})],a.I3SMaterialDefinition.prototype, "doubleSided",void 0);b.__decorate([f.enumeration({none:"none",back:"back",front:"front"})],a.I3SMaterialDefinition.prototype,"cullFace",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],a.I3SMaterialDefinition.prototype,"normalTexture",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],a.I3SMaterialDefinition.prototype,"occlusionTexture",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],a.I3SMaterialDefinition.prototype,"emissiveTexture",void 0);b.__decorate([l.property({type:[Number]})], a.I3SMaterialDefinition.prototype,"emissiveFactor",void 0);b.__decorate([l.property({type:a.I3SMaterialPBRMetallicRoughness})],a.I3SMaterialDefinition.prototype,"pbrMetallicRoughness",void 0);a.I3SMaterialDefinition=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],a.I3SMaterialDefinition);a.I3STextureFormat=class extends q.JSONSupport{};b.__decorate([l.property({type:String,json:{read:{source:["name","index"],reader:(e,g)=>null!=e?e:`${g.index}`}}})],a.I3STextureFormat.prototype, "name",void 0);b.__decorate([f.enumeration({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],a.I3STextureFormat.prototype,"format",void 0);a.I3STextureFormat=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],a.I3STextureFormat);a.I3STextureSetDefinition=class extends q.JSONSupport{constructor(){super(...arguments);this.atlas=!1}};b.__decorate([l.property({type:[a.I3STextureFormat]})],a.I3STextureSetDefinition.prototype,"formats", void 0);b.__decorate([l.property({type:Boolean})],a.I3STextureSetDefinition.prototype,"atlas",void 0);a.I3STextureSetDefinition=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],a.I3STextureSetDefinition);a.I3SGeometryAttribute=class extends q.JSONSupport{};b.__decorate([f.enumeration({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],a.I3SGeometryAttribute.prototype,"type",void 0);b.__decorate([l.property({type:Number})], a.I3SGeometryAttribute.prototype,"component",void 0);a.I3SGeometryAttribute=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],a.I3SGeometryAttribute);a.I3SGeometryCompressedAttributes=class extends q.JSONSupport{};b.__decorate([f.enumeration({draco:"draco"})],a.I3SGeometryCompressedAttributes.prototype,"encoding",void 0);b.__decorate([l.property({type:[String]})],a.I3SGeometryCompressedAttributes.prototype,"attributes",void 0);a.I3SGeometryCompressedAttributes= b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],a.I3SGeometryCompressedAttributes);a.I3SGeometryBuffer=class extends q.JSONSupport{constructor(){super(...arguments);this.offset=0}};b.__decorate([l.property({type:Number})],a.I3SGeometryBuffer.prototype,"offset",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"position",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype, "normal",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"uv0",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"color",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"uvRegion",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"featureId",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype, "faceRange",void 0);b.__decorate([l.property({type:a.I3SGeometryCompressedAttributes})],a.I3SGeometryBuffer.prototype,"compressedAttributes",void 0);a.I3SGeometryBuffer=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],a.I3SGeometryBuffer);a.I3SGeometryDefinition=class extends q.JSONSupport{};b.__decorate([f.enumeration({triangle:"triangle"})],a.I3SGeometryDefinition.prototype,"topology",void 0);b.__decorate([l.property()],a.I3SGeometryDefinition.prototype,"geometryBuffers", void 0);a.I3SGeometryDefinition=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],a.I3SGeometryDefinition);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/RangeInfo":function(){define("exports ../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){a.RangeInfo= class extends q.JSONSupport{constructor(){super(...arguments);this.fullRangeExtent=this.currentRangeExtent=this.field=this.name=null;this.type="rangeInfo"}};b.__decorate([l.property({type:String,json:{read:!0,write:!0}})],a.RangeInfo.prototype,"name",void 0);b.__decorate([l.property({type:String,json:{read:!0,write:!0}})],a.RangeInfo.prototype,"field",void 0);b.__decorate([l.property({type:[Number],json:{read:!0,write:!0}})],a.RangeInfo.prototype,"currentRangeExtent",void 0);b.__decorate([l.property({type:[Number], json:{read:!0,write:!0}})],a.RangeInfo.prototype,"fullRangeExtent",void 0);b.__decorate([l.property({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],a.RangeInfo.prototype,"type",void 0);a.RangeInfo=b.__decorate([f.subclass("esri.layers.support.RangeInfo")],a.RangeInfo);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/SceneFilter":function(){define("../../chunks/tslib.es6 ../../request ../../core/JSONSupport ../../core/lang ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/persistable ./PolygonCollection ../../chunks/persistableUrlUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){var w;q=w=class extends q.JSONSupport{constructor(v){super(v);this.spatialRelationship="disjoint";this.geometries=new d;this._geometriesSource=null}initialize(){this.addHandles(p.on(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,p.sync))}readGeometries(v,m,r){Array.isArray(v)?this.geometries=d.fromJSON(v,r):this._geometriesSource={url:t.fromJSON(v,r),context:r}}async loadGeometries(v,m){if(null!=this._geometriesSource){var {url:r,context:n}= this._geometriesSource;m=await b(r,{responseType:"json",signal:m?.signal});var u=v.toJSON();v=m.data.map(x=>({...x,spatialReference:u}));this.geometries=d.fromJSON(v,n);this._geometriesSource=null}}clone(){const v=new w({geometries:l.clone(this.geometries),spatialRelationship:this.spatialRelationship});v._geometriesSource=this._geometriesSource;return v}};a.__decorate([k.property({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],q.prototype,"spatialRelationship",void 0);a.__decorate([k.property({type:d, nonNullable:!0,json:{write:!0}}),g.persistable({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],q.prototype,"geometries",void 0);a.__decorate([c.reader(["web-scene","portal-item"],"geometries")],q.prototype,"readGeometries",null);return q=w=a.__decorate([e.subclass("esri.layers.support.SceneFilter")],q)})},"esri/core/accessorSupport/decorators/persistable":function(){define("exports ../../Error ../../MD5 ../../multiOriginJSONSupportUtils ../../urlUtils ../../uuid ../metadata ../PropertyOrigin ./property ../../../portal/support/resourceExtension ../../../chunks/persistableUrlUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(r,n,u){const x=h.getPropertyMetadata(n,u);return{type:String,read:(y,z,A)=>{y=g.read(y,z,A);if(x.type===String)return y;if("function"===typeof x.type)return new x.type({url:y})},write:{writer(y,z,A,B){if(B?.resources){var C=null==y?null:"string"===typeof y?y:y.url;C=g.toJSON(C,{...B,verifyItemRelativeUrls:B?.verifyItemRelativeUrls?{writtenUrls:B.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},g.MarkKeep.NO);var D=x.type!==String&&(!l.isMultiOriginJSONMixin(this)|| B?.origin&&this.originIdOf(u)>f.nameToId(B.origin));y={object:this,propertyName:u,value:y,targetUrl:C,dest:z,targetPropertyName:A,context:B,params:r};if(B?.portalItem&&C&&!p.isAbsolute(C))if(D&&r?.contentAddressed)t(y);else if(D){{const {context:F,targetUrl:H,params:N,value:E,dest:G,targetPropertyName:I}=y;F.portalItem&&(z=F.portalItem.resourceFromPath(H),A=m(E,H,F),B=e.getResourceContentExtension(A),C=p.getPathExtension(z.path),D=N?.compress??!1,B!==C?t(y):(F.resources&&v({...y,resource:z,content:A, compress:D,updates:F.resources.toUpdate}),G[I]=H))}}else w(y);else B?.portalItem&&(null==C||null!=g.itemIdFromResourceUrl(C)||p.isBlobProtocol(C)||D)?t(y):z[A]=C}else z[A]="string"===typeof y?g.toJSON(y,B):y.write({},B)}}}}function t(r){const {targetUrl:n,params:u,value:x,context:y,dest:z,targetPropertyName:A}=r;if(y.portalItem){var B=g.prefixAndFilenameFromResourceUrl(n),C=m(x,n,y);if(u?.contentAddressed&&"json"!==C.type)y.messages?.push(new b("persistable:contentAddressingUnsupported",`Property "${A}" is trying to serializing a resource with content of type ${C.type} with content addressing. Content addressing is only supported for json resources.`, {content:C}));else{var D=u?.contentAddressed&&"json"===C.type?q.createMD5Hash(C.jsonString):B?.filename??k.generateUUID(),F=p.join(u?.prefix??B?.prefix,D),H=`${F}.${e.getResourceContentExtension(C)}`;if(u?.contentAddressed&&y.resources&&"json"===C.type&&(B=y.resources.toKeep.find(({resource:E})=>E.path===H)??y.resources.toAdd.find(({resource:E})=>E.path===H))){z[A]=B.resource.itemRelativeUrl;return}var N=y.portalItem.resourceFromPath(H);p.isBlobProtocol(n)&&y.resources&&y.resources.pendingOperations.push(p.blobUrlToBlob(n).then(E=> {N.path=`${F}.${e.getResourceContentExtension({type:"blob",blob:E})}`;z[A]=N.itemRelativeUrl}).catch(()=>{}));y.resources&&v({...r,resource:N,content:C,compress:u?.compress??!1,updates:y.resources.toAdd});z[A]=N.itemRelativeUrl}}}function w({context:r,targetUrl:n,dest:u,targetPropertyName:x}){r.portalItem&&r.resources&&(r.resources.toKeep.push({resource:r.portalItem.resourceFromPath(n),compress:!1}),u[x]=n)}function v({object:r,propertyName:n,updates:u,resource:x,content:y,compress:z}){u.push({resource:x, content:y,compress:z,finish:A=>{"string"===typeof r[n]?r[n]=A.url:r[n].url=A.url}})}function m(r,n,u){return"string"===typeof r?{type:"url",url:n}:{type:"json",jsonString:JSON.stringify(r.toJSON(u))}}a.persistable=function(r){const n=r?.origins??[void 0];return(u,x)=>{a:if("resource"===r?.type)var y=d(r,u,x);else{switch(r?.type??"other"){case "other":y={read:!0,write:!0};break a;case "url":const {read:z,write:A}=g.persistableUrlUtils;y={read:z,write:A};break a}y=void 0}for(const z of n){const A=c.propertyJSONMeta(u, z,x);for(const B in y)A[B]=y[B]}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/portal/support/resourceExtension":function(){define(["exports","../../core/urlUtils"],function(a,b){const q={},l=q["text/plain"],p={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"}; for(const k in p)q[p[k]]=k;a.getResourceContentExtension=function(k){"json"===k.type?k="application/json":"blob"===k.type?k=k.blob.type:(k=b.getPathExtension(k.url),k=p[k]||"text/plain");return q[k]||l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/PolygonCollection":function(){define("../../chunks/tslib.es6 ../../core/Collection ../../core/JSONSupport ../../core/Warning ../../core/Logger ../../core/has ../../core/RandomLCG ../../core/Error ../../core/accessorSupport/decorators/subclass ../../geometry/Polygon ../../geometry/projection".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){var d;b=d=class extends q.JSONSupportMixin(b.ofType(e)){constructor(t){super(t)}clone(){return new d(this.items.map(t=>t.clone()))}write(t,w){return this.toJSON(w)}toJSON(t){const w=t?.layer?.spatialReference;return w?this.toArray().map(v=>{if(!w.equals(v.spatialReference)){if(!g.canProjectWithoutEngine(v.spatialReference,w))return t?.messages&&t.messages.push(new l("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this, spatialReference:t.layer.spatialReference,context:t})),null;const m=new e;g.projectPolygon(v,m,w);v=m}v=v.toJSON(t);delete v.spatialReference;return v}).filter(v=>null!=v):(t?.messages&&t.messages.push(new l("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:t.layer.spatialReference,context:t})),this.toArray().map(v=>v.toJSON(t)))}static fromJSON(t,w){const v=new d;t.forEach(m=>v.add(e.fromJSON(m,w)));return v}};return b=d= a.__decorate([c.subclass("esri.layers.support.PolygonCollection")],b)})},"esri/layers/support/sceneLayerStatistics":function(){define(["exports","../../request","../../core/Error","../../core/urlUtils"],function(a,b,q,l){a.fetchStatistics=async function({fieldName:p,statisticsInfo:k,errorContext:h,fieldsIndex:f,path:c,customParameters:e,apiKey:g,signal:d}){if(null==k)throw new q(`${h}:no-cached-statistics`,"Cached statistics are not available for this layer");const t=f.get(p);if(null==t)throw new q(`${h}:field-unexisting`, `Field '${p}' does not exist on the layer`);p=k.find(w=>w.name===t.name);if(null==p)throw new q(`${h}:no-cached-statistics`,"Cached statistics for this attribute are not available");h=l.join(c,p.href);({data:e}=await b(h,{query:{f:"json",...e,token:g},responseType:"json",signal:d}));return e};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/zipUtils":function(){define(["require","exports"],function(a,b){async function q(l){const {BlobReader:p,ZipReader:k,BlobWriter:h}= await new Promise((c,e)=>a(["./zipjs-wrapper"],c,e)),f=[];l=new p(l);(await (new k(l)).getEntries()).forEach(c=>{if(!c.directory&&!/^__MACOS/i.test(c.filename)){var e=new h;(e=c.getData?.(e).then(g=>new File([g],c.filename)))&&f.push(e)}});return Promise.all(f)}b.extractZipFile=q;b.extractZipFiles=async function(l){const p=[];for(const k of l)k.name.toLowerCase().endsWith(".zip")?p.push(q(k)):p.push(Promise.resolve(k));return(await Promise.all(p)).flat()};Object.defineProperty(b,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/layers/i3s/I3SUtil":function(){define("exports ../../../../geometry ../../../../request ../../../../core/arrayUtils ../../../../core/Error ../../../../core/has ../../../../core/typedArrayUtil ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection ../../../../geometry/spatialReferenceEllipsoidUtils ../../../../geometry/projection/projectVectorToVector ../../../../geometry/support/aaBoundingRect ../../../../chunks/sphere ../../../../rest/support/Query ./I3SBinaryReader ./I3SProjectionUtil ../support/edgeUtils ../support/symbolColorUtils ../../support/orientedBoundingBox ../../../../geometry/SpatialReference".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(ba){return ba?parseInt(ba.substring(ba.lastIndexOf("/")+1,ba.length),10):void 0}function C(ba,U){var Z=U[0],ca=U[1];U=U[3];const ea=ba[0]-Z;Z-=ba[2];const da=ba[1]-ca;ba=ca-ba[3];ca=Math.max(ea,Z,0);const ia=Math.max(da,ba,0);ca=ca*ca+ia*ia;return ca>U*U?a.MbsIntersectResult.OUTSIDE:0U?a.MbsIntersectResult.INSIDE:a.MbsIntersectResult.INTERSECTS_CENTER_INSIDE} function D(ba,U,Z){const ca=[],ea=Z?.missingFields;Z=Z?.originalFields;for(const da of ba){ba=da.toLowerCase();let ia=!1;for(const ka of U)if(ba===ka.name.toLowerCase()){ca.push(ka.name);ia=!0;Z&&Z.push(da);break}!ia&&ea&&ea.push(da)}return ca}function F(ba,U,Z){const ca=new Map,ea=[];Z=Z();for(const ka of ba){var da=ka.attributes[U];for(var ia=0;iaka.attributes[Z]-fa.attributes[Z]);var da=U.map(ka=>ka.attributes[Z]);const ia=[];ca=D(ca,ba.fields,{originalFields:ia});ba=await N(ba,da,ca,ea);for(ea=0;eaea)return ea=l.splitIntoChunks(U,ea),Promise.all(ea.map(da=>N(ba,da,Z,ca))).then(da=>da.flat());ea=new r({objectIds:U,outFields:Z,orderByFields:[ba.objectIdField]});return ba.queryFeatures(ea,ca).then(da=>{if(da&&da.features&&da.features.length===U.length)return da.features.map(ia=>ia.attributes);throw new p("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer");})}async function E(ba, U,Z,ca,ea,da,ia,ka){const fa=[];for(const X of U)X&&ea.includes(X.name)&&fa.push({url:`${ba}/nodes/${Z}/attributes/${X.key}/0`,storageInfo:X});ba=await Promise.allSettled(fa.map(X=>q(X.url,{responseType:"array-buffer",query:{...ia,token:da},signal:ka?.signal}).then(ja=>n.readBinaryAttribute(X.storageInfo,ja.data))));U=[];for(const X of ca){ca={};for(Z=0;Z{if(!fa)if(fa=Q,v.empty(S),null!=ba.serviceObbInIndexSR){ba.serviceObbInIndexSR.transform(V,Z,U,ea,ia);V.getCorners(fa);for(var va of fa)e.transformMat4(va, va,ha),v.expandPointInPlace(S,va)}else{var za=ba.serviceMbsInIndexSR;if(za)for(va=za[3],w.projectVectorToVector(m.getCenter(za),Z,T,U),e.transformMat4(T,T,ha),T[2]+=ea,za=0;8>za;++za){const ya=fa[za];e.copy(ya,[T[0]+(za&1?va:-va),T[1]+(za&2?va:-va),T[2]+(za&4?va:-va)]);v.expandPointInPlace(S,ya)}}};let ja=Infinity,la=-Infinity;const na=va=>{if("replace"===va.type&&(va=va.geometry,va?.hasZ)){v.empty(W);var za=va.spatialReference||ca;va=va.rings.reduce((ya,Da)=>Da.reduce((ra,xa)=>{e.set(T,xa[0],xa[1], xa[2]);w.projectVectorToVector(T,za,T,U);e.transformMat4(T,T,ha);v.expandPointInPlace(W,T);return Math.min(T[2],ra)},ya),Infinity);X();v.intersects(S,W)&&(ja=Math.min(ja,va),la=Math.max(la,va))}};da.forEach(va=>na(va));if(Infinity===ja)return null;da=(va,za,ya)=>{e.transformMat4(T,ya,ka);va[za]=T[0];va[za+1]=T[1];va[za+2]=T[2];za+=24;ya[2]=ja;e.transformMat4(T,ya,ka);va[za]=T[0];va[za+1]=T[1];va[za+2]=T[2];za+=24;ya[2]=la;e.transformMat4(T,ya,ka);va[za]=T[0];va[za+1]=T[1];va[za+2]=T[2]};for(let va= 0;8>va;++va)da(Y.data,3*va,fa[va]);return z.compute(Y)};a.containsDraco=function(ba){if(k("disable-feature:i3s-draco")||!ba)return!1;for(const U of ba)for(const Z of U.geometryBuffers)if("draco"===Z.compressedAttributes?.encoding)return!0;return!1};a.extractWkid=B;a.filterInPlace=function(ba,U,Z){let ca=0,ea=0;for(let da=0;da{const da=ea.serviceMbsInIndexSR;if((null!=da&&C(ba,da))===a.MbsIntersectResult.OUTSIDE)return!1;ca(ea);return!0})};a.getCacheKeySuffix=function(ba,U){return null==U?"@null":U===t.getSphericalPCPF(U)?"@ECEF":ba.equals(U)?"":null!=U.wkid?"@"+U.wkid:null};a.getCachedAttributeValue=G;a.getClipRect=function(ba,U){if(0===U.rotationScale[1]&&0===U.rotationScale[2]&&0===U.rotationScale[3]&&0===U.rotationScale[5]&&0===U.rotationScale[6]&&0===U.rotationScale[7])return K[0]=(ba[0]-U.position[0])/U.rotationScale[0], K[1]=(ba[1]-U.position[1])/U.rotationScale[4],K[2]=(ba[2]-U.position[0])/U.rotationScale[0],K[3]=(ba[3]-U.position[1])/U.rotationScale[4],K};a.getIndexCrs=I;a.getSymbolInfo=function(ba){const U=new R;var Z=!1;let ca=!1;for(const da of ba.symbolLayers.items)if("fill"===da.type&&da.enabled){var ea=da.material;ba=da.edges;null==ea||Z||(Z=ea.color,ea=y.parseColorMixMode(ea.colorMixMode),U.material=null!=Z?{color:[Z.r/255,Z.g/255,Z.b/255],alpha:Z.a,colorMixMode:ea}:{color:[1,1,1],alpha:1,colorMixMode:y.ColorMixModeEnum.Multiply}, U.castShadows=da.castShadows,Z=!0);null==ba||ca||(U.edgeMaterial=x.createMaterialFromEdges(ba,{}),ca=!0)}U.material||(U.material={color:[1,1,1],alpha:1,colorMixMode:y.ColorMixModeEnum.Multiply});return U};a.getVertexCrs=O;a.intersectBoundingRectWithMbs=C;a.invalidateMbs=function(ba){null!=ba&&(ba[3]=-1)};a.isSupportedLocalModeProjection=P;a.isValidMbs=function(ba){return 0<=ba[3]};a.objectIdFilter=function(ba,U,Z){let ca=0,ea=0;for(;caE(ka,ia,fa.node.resources.attributes,fa.indices, ca,ba.apiKey,ba.customParameters,da).then(X=>{for(let ja=0;ja{D=D?Date.parse(D):null;return null==D||Number.isNaN(D)?null:D})}function c(A,B,C){const D=[];let F,H=0,N;for(N=0;NP)M+=String.fromCharCode(P),K++;else if(192<=P&&224>P){if(K+1>=L)throw new b("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");M+=String.fromCharCode((P&31)<<6|I[O+K+1]&63);K+=2}else if(224<=P&&240>P){if(K+2>=L)throw new b("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");M+=String.fromCharCode((P&15)<<12|(I[O+K+1]&63)<<6|I[O+K+2]&63);K+=3}else if(240<=P&&248>P){if(K+3>=L)throw new b("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated."); P=(P&7)<<18|(I[O+K+1]&63)<<12|(I[O+K+2]&63)<<6|I[O+K+3]&63;M=65536<=P?M+String.fromCharCode((P-65536>>10)+55296,(P&1023)+56320):M+String.fromCharCode(P);K+=4}else throw new b("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");}G.call(E,M);if(0!==C[H+F-1])throw new b("string-array-error","Invalid string array: missing null termination.");}else D.push(null);H+=F}return D}function e(A,B){return new y[B.valueType](A,B.byteOffset,B.count*B.valuesPerElement)}function g(A,B){return new Uint8Array(A, B.byteOffset,B.byteCount)}function d(A,B,C){A=null!=B.header?h(A,B.header):{byteOffset:0,byteCount:0,fields:{count:C}};C={header:A,byteOffset:A.byteCount,byteCount:0,entries:Object.create(null)};let D=A.byteCount;for(let F=0;Fl.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader"),x={position:k.VertexAttribute.POSITION,normal:k.VertexAttribute.NORMAL,color:k.VertexAttribute.COLOR,uv0:k.VertexAttribute.UV0,region:k.VertexAttribute.UVREGION},y={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},z={Float32:(A,B)=>(new DataView(A,0)).getFloat32(B,!0),Float64:(A,B)=>(new DataView(A,0)).getFloat64(B,!0),UInt8:(A,B)=> (new DataView(A,0)).getUint8(B),Int8:(A,B)=>(new DataView(A,0)).getInt8(B),UInt16:(A,B)=>(new DataView(A,0)).getUint16(B,!0),Int16:(A,B)=>(new DataView(A,0)).getInt16(B,!0),UInt32:(A,B)=>(new DataView(A,0)).getUint32(B,!0),Int32:(A,B)=>(new DataView(A,0)).getInt32(B,!0)};a.createAttributeDataIndex=d;a.createGeometryDescriptor=function(A,B){return A&&A.compressedAttributes&&"draco"===A.compressedAttributes.encoding?m(A.compressedAttributes.attributes):A?w(A):v(B)};a.createGeometryDescriptorForDraco= m;a.createGeometryDescriptorFromDefinition=w;a.createGeometryDescriptorFromSchema=v;a.createGeometryIndexFromSchema=function(A,B){var C=h(A,B&&B.header);let D=C.byteCount;const F={isDraco:!1,header:C,byteOffset:C.byteCount,byteCount:0,vertexAttributes:{}};C=C.fields;var H=null!=C.vertexCount?C.vertexCount:C.count;for(var N of B.ordering){if(!B.vertexAttributes[N])continue;const G={...B.vertexAttributes[N],byteOffset:D,count:H};F.vertexAttributes[x[N]||"_"+N]=G;D+=n(G.valueType)*G.valuesPerElement* H}N=C.faceCount;if(B.faces&&N){F.faces={};for(var E of B.ordering)B.faces[E]&&(H={...B.faces[E],byteOffset:D,count:N},F.faces[E]=H,D+=n(H.valueType)*H.valuesPerElement*N)}E=C.featureCount;if(B.featureAttributes&&B.featureAttributeOrder&&E){F.featureAttributes={};for(const G of B.featureAttributeOrder)B.featureAttributes[G]&&(C={...B.featureAttributes[G],byteOffset:D,count:E},F.featureAttributes[G]=C,N="UInt64"===C.valueType?8:n(C.valueType),D+=N*C.valuesPerElement*E)}t(D,A.byteLength,"geometry"); F.byteCount=D-F.byteOffset;return F};a.createRawView=g;a.createTypedView=e;a.getBytesPerValue=n;a.isValueType=r;a.readBinaryAttribute=function(A,B,C){if("lepcc-rgb"===A.encoding)return p.decodeRGB(B);if("lepcc-intensity"===A.encoding)return p.decodeIntensity(B);if(null!=A.encoding&&""!==A.encoding)throw new b("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");A["attributeByteCounts "]&&!A.attributeByteCounts&&(u().warn("Warning: Trailing space in 'attributeByteCounts '."), A.attributeByteCounts=A["attributeByteCounts "]);"ObjectIds"===A.ordering[0]&&A.hasOwnProperty("objectIds")&&(u().warn("Warning: Case error in objectIds"),A.ordering[0]="objectIds");C=d(B,A,C);t(C.byteOffset+C.byteCount,B.byteLength,"attribute");if(A=C.entries.attributeValues||C.entries.objectIds){if("String"===A.valueType){C=C.entries.attributeByteCounts;const D=e(B,C);B=g(B,A);return A.timeEncoding?f(C.count,D,B):c(C.count,D,B)}return e(B,A)}throw new b("bad-attribute-storage-info","Bad attributeStorageInfo specification."); };a.readDateStringArray=f;a.readHeader=h;a.readStringArray=c;a.valueType2ArrayBufferReader=z;a.valueType2TypedArrayClassMap=y;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/LEPCC":function(){define(["exports","../../../../core/Error"],function(a,b){function q(h,f,c){return{identifier:String.fromCharCode.apply(null,new Uint8Array(h,c+k.identifierOffset,k.identifierLength)),version:f.getUint16(c+k.versionOffset,!0),checksum:f.getUint32(c+k.checksumOffset,!0)}} function l(h,f,c){const e=[];f=p(h,f,e);const g=[];for(let d=0;d>6;g=0;if(0===w)g=e.getUint32(1,!0),f+=5;else if(1===w)g=e.getUint16(1,!0),f+=3;else if(2===w)g=e.getUint8(1),f+=2;else throw new b("lepcc-decode-error","Bad count type");if(t)throw new b("lepcc-decode-error","LUT not implemented");h=new Uint8Array(h, f,Math.ceil(g*d/8));w=t=e=0;const v=-1>>>32-d;for(let m=0;m>>=d;t-=d;32>8-t)}return f+w}const k={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};a.decodeIntensity=function(h){const f=new DataView(h,0);var c=0;const {identifier:e,version:g}=q(h,f,c);c+=k.byteCount;if("Intensity "!==e)throw new b("lepcc-decode-error","Bad identifier");if(1= r&&1===d){if(c+3!==h.byteLength||1!==m)throw new b("lepcc-decode-error","Bad count");h=f.getUint8(c);m=f.getUint8(c+1);c=f.getUint8(c+2);f=new Uint8Array(3*v);for(t=0;t{({keyField:d}=d);g&&d&&l.fieldsIndex?.has(d)&&!g.includes(d)&&g.push(d)});return g};a.hasPopupTemplate=function(l,p){return null!=q(l,{defaultPopupTemplateEnabled:p})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/ElevationLayerView3D":function(){define("../../../chunks/tslib.es6 ../../../core/Error ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/support/ElevationTileData ../../../layers/support/LercDecoder ./LayerView3D ./TiledLayerView3D ../terrain/TerrainConst ../terrain/terrainUtils ../../layers/LayerView".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){h=class extends t.TiledLayerView3D(d.LayerView3D(m)){constructor(){super(...arguments);this.type="elevation-3d"}get tileInfo(){return this.layer.tileInfo}initialize(){const r=this.view;var n=r.map?.allLayers;n=n&&n.includes(this.layer);var u=r.map?.ground?.layers;u=u&&u.includes(this.layer);n&&!u&&(n=new b("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`),this.addResolvingPromise(Promise.reject(n))); this._lercDecoder=g.acquireDecoder(r.resourceController);this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=l.releaseMaybe(this._lercDecoder)}async fetchTile(r,n){const u=this.layer;if(v.useFetchTileForLayer(u)){r=await u.fetchTile(r[0],r[1],r[2],{noDataValue:w.elevationNoDataValue,signal:n.signal});if(p.isAborted(n)){q.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true.");return}return r}r= this.getTileUrl(r);r=await n.requester.request(r,"binary",n);if(n=await this._lercDecoder.decode(r,{noDataValue:w.elevationNoDataValue},n.signal))return new e.ElevationTileData(n);throw Error("LERC decoding failed");}};a.__decorate([k.property()],h.prototype,"layer",void 0);a.__decorate([k.property()],h.prototype,"tileInfo",null);return h=a.__decorate([c.subclass("esri.views.3d.layers.ElevationLayerView3D")],h)})},"esri/layers/support/ElevationTileData":function(){define(["exports"],function(a){class b{constructor(q, l,p,k){this._maxValue=this._minValue=this._hasNoDataValues=null;"pixelData"in q?(this.values=q.pixelData,this.width=q.width,this.height=q.height,this.noDataValue=q.noDataValue):(this.values=q,this.width=l,this.height=p,this.noDataValue=k)}get hasNoDataValues(){null==this._hasNoDataValues&&(this._hasNoDataValues=this.values.includes(this.noDataValue));return this._hasNoDataValues}get minValue(){this._ensureBounds();return this._minValue}get maxValue(){this._ensureBounds();return this._maxValue}_ensureBounds(){if(null== this._minValue){var {noDataValue:q,values:l}=this,p=Infinity,k=-Infinity,h=!0;for(const f of l)f===q?this._hasNoDataValues=!0:(p=fk?f:k,h=!1);h?this._maxValue=this._minValue=0:(this._minValue=p,this._maxValue=-3E38[k.buffer]},p,{strategy:"dedicated"});this.schedule=p;this.ref=0}decode(p,k,h){return p&&0!==p.byteLength?this.invoke({buffer:p,options:k},h):Promise.resolve(null)}release(){0>=--this.ref&&(l.forEach((p,k)=>{p===this&&l.delete(k)}),this.destroy())}}const l=new Map;a.acquireDecoder=function(p=null){let k=l.get(p);k||(null!=p?(k=new q(h=>p.immediate.schedule(h)),l.set(p,k)):(k=new q,l.set(null,k)));++k.ref;return k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/core/workers/WorkerHandle":function(){define("exports ../arrayUtils ../handleUtils ../Logger ../promiseUtils ./workers".split(" "),function(a,b,q,l,p,k){class h{constructor(f,c,e,g,d={}){this._mainMethod=c;this._transferLists=e;this._listeners=[];this._promise=k.open(f,{...d,schedule:g}).then(t=>{if(void 0===this._thread){this._thread=t;this._promise=null;d.hasInitialize&&this.broadcast({},"initialize");for(const w of this._listeners)this._connectListener(w)}else t.close()});this._promise.catch(t=> l.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${f} worker: ${t}`))}on(f,c){const e={removed:!1,eventName:f,callback:c,threadHandle:null};this._listeners.push(e);this._connectListener(e);return q.makeHandle(()=>{e.removed=!0;b.remove(this._listeners,e);this._thread&&null!=e.threadHandle&&e.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null);this._promise=null;this._listeners.length=0;this._transferLists={}}invoke(f,c){return this.invokeMethod(this._mainMethod, f,c)}invokeMethod(f,c,e){if(this._thread){var g=this._transferLists[f];g=g?g(c):[];return this._thread.invoke(f,c,{transferList:g,signal:e})}return this._promise?this._promise.then(()=>{p.throwIfAborted(e);return this.invokeMethod(f,c,e)}):Promise.reject(null)}broadcast(f,c){return this._thread?Promise.all(this._thread.broadcast(c,f)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(f,c)):Promise.reject()}get promise(){return this._promise}_connectListener(f){this._thread&&this._thread.on(f.eventName, f.callback).then(c=>{f.removed||(f.threadHandle=c)})}}a.WorkerHandle=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/LayerView3D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/handleUtils ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/heightModelInfoUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){a.LayerView3D=d=>{d=class extends d{constructor(){super(...arguments);this.supportsHeightUnitConversion=this.slicePlaneEnabled=!1}postscript(){super.postscript();g.supportsHeightModelInfo(this.layer)&&this.addResolvingPromise(this._validateHeightModelInfo())}async _validateHeightModelInfo(){const t=new AbortController;var w=t.signal;this.addHandles(q.makeHandle(()=>t.abort()));await p.whenOnce(()=>this.view.defaultsFromMap?.heightModelInfoReady,w);l.throwIfAborted(w); if(w=g.rejectLayerError(this.layer,this.view.heightModelInfo,this.supportsHeightUnitConversion))throw w;}};b.__decorate([k.property()],d.prototype,"view",void 0);b.__decorate([k.property()],d.prototype,"slicePlaneEnabled",void 0);return d=b.__decorate([e.subclass("esri.views.3d.layers.LayerView3D")],d)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/TiledLayerView3D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Error ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./support/LayerViewPerformanceInfo ../support/updatingProperties ../terrain/terrainUtils ../../support/layerViewUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.TiledLayerView3D=w=>{w=class extends w{constructor(){super(...arguments);this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return 1<=this.fullOpacity&&this.imageFormatIsOpaque}get visibleAtCurrentScale(){if(!t.isScaleRangeActive(this.layer.minScale,this.layer.maxScale)||!this.view.terrainScale)return!0;const v=Math.round(this.view.basemapTerrain.tilingScheme.levelAtScale(this.view.terrainScale)); return v>=this.displayLevelRange.minLevel&&v<=this.displayLevelRange.maxLevel}get dataScaleRange(){var v=this.tileInfo.lods;let m=v[0].scale;v=v[v.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const {effectiveMinLOD:r,effectiveMaxLOD:n}=this.layer.tilemapCache;m=this.tileInfo.lodAt(r).scale;v=this.tileInfo.lodAt(n).scale}return{minScale:m,maxScale:v}}canResume(){const v=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&& this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&t.validateScaleRange(v)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){const {minScale:v,maxScale:m}=this.dataScaleRange;return this.levelRangeFromScaleRange(v,m)}get displayLevelRange(){const v=this.levelRangeFromScaleRange(this.layer.minScale||this.dataScaleRange.minScale,this.layer.maxScale||this.dataScaleRange.maxScale);this.layer.maxScale&&v.maxLevel++;return v}get performanceInfo(){return new e.LayerViewPerformanceInfo(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(v){return this.layer.getTileUrl(v[0], v[1],v[2])}_addTilingSchemeMatchPromise(){if(null==this.fullExtent)return this.addResolvingPromise(Promise.reject(new q("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const v=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(v)return this.addResolvingPromise(Promise.reject(v));this.addResolvingPromise(l.whenOnce(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const m=this._getTileInfoCompatibilityError(this.tileInfo,this.view.basemapTerrain.tilingScheme, "tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(m)throw m;}))}_getTileInfoSupportError(v,m){if(v=d.checkIfTileInfoSupportedForView(v,m,this.view.spatialReference,this.view.state.viewingMode,"tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0))switch(m={layer:this.layer,error:v},v.name){case "tilingscheme:spatial-reference-mismatch":case "tilingscheme:global-unsupported-spatial-reference":case "tilingscheme:local-unsupported-spatial-reference":return new q("layerview:spatial-reference-incompatible", "The spatial reference of this layer does not meet the requirements of the view",m);default:return new q("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",m)}}_getTileInfoCompatibilityError(v,m,r){return null!=v&&m.compatibleWith(v,r)?null:new q("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(v,m){const r={minLevel:0,maxLevel:Infinity};var n= this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!n)return r;const u=n.levels[0];n=x=>{x=Math.log(u.scale/x)/Math.LN2;return 1E-9>.5-Math.abs(.5-x%1)?Math.round(x):Math.ceil(x)};null!=v&&0{const v=await q.whenOnce(()=>this.graphicsPipeline);this.destroyed||v.destroyed||(v.suspendResumeExtentMode="computed")})()):this.addResolvingPromise(Promise.reject(new b("featurelayerview3d:unsupported-geometry-type",`Unsupported geometry type ${t.geometryType}`))));"mesh"!==t.geometryType||c.canProjectWithoutEngine(t.spatialReference,w.spatialReference)||this.addResolvingPromise(Promise.reject(new b("layerview:spatial-reference-incompatible","The spatial references of the feature layer is incompatible with the spatial reference of the view")))}get featureSpatialReference(){return this.view.featureTiles?.tilingScheme?.spatialReference}}; a.__decorate([l.property({constructOnly:!0})],p.prototype,"direct3DObjectFeatureLayerDisplayEnabled",void 0);a.__decorate([l.property()],p.prototype,"layer",void 0);return p=a.__decorate([f.subclass("esri.views.3d.layers.FeatureLayerView3D")],p)})},"esri/views/3d/layers/FeatureLayerViewBase3D":function(){define("../../../chunks/tslib.es6 ../../../core/Error ../../../core/has ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/graphics/dehydratedFeatures ./FeatureLikeLayerView3D ./LayerView3D ./graphics/FeatureGraphics3DGraphicsPipeline ../support/updatingProperties ../webgl-engine/lib/UpdatePolicy ../../layers/FeatureLayerView ../../layers/LayerView ../../layers/RefreshableLayerView".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){q=class extends n(g.FeatureLikeLayerView3D(m(d.LayerView3D(r)))){constructor(u){super(u)}initialize(){this.addHandles(p.watch(()=>this._updatingRequiredFieldsPromise,u=>this._updatingHandles.addPromise(u),p.syncAndInitial))}destroy(){this._updatingHandles.removeAll();this._fetcherContext=l.destroyMaybe(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(u){this.graphicsPipeline.maximumNumberOfFeatures= u}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??v.UpdatePolicy.ASYNC}get hasZ(){const u=this.layer,x=u.capabilities&&u.capabilities.data;return x&&x.supportsZ?"returnZ"in u&&null!=u.returnZ?u.returnZ:x.supportsZ:!1}get hasM(){const u=this.layer,x=u.capabilities&& u.capabilities.data;return x&&x.supportsM?"returnM"in u&&null!=u.returnM?u.returnM:!1:!1}setVisibility(u,x){this.graphicsPipeline?.setVisibility(u,x)}createQuery(){return super.createQuery()}queryFeatures(u,x){const y=()=>super.queryFeatures(u,x);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(u),y):y()}createGraphicsPipeline(){return new t.FeatureGraphics3DGraphicsPipeline({layerView:this})}async doRefresh(u){return await this.graphicsPipeline.doRefresh(u)}_popupFeatureHasRequiredFields(u, x){if(!super._popupFeatureHasRequiredFields(u,x))return!1;u=e.getObjectId(u,this.layer.objectIdField);if(null==u)return!0;u=this.graphicsPipeline.getMissingAttributesForFeature(u);if(null==u)return!0;for(const y of x)if(u.has(y))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(u,x){await this._validateQueryFeaturesMesh(u); x=await x();const y=this.graphicsPipeline;if(u?.outStatistics||null==y)return x;u=this.layer.objectIdField;const z=[];for(const A of x.features)if(A.geometry){const B=y.getHydratedGeometry(A.attributes[u]);B&&(A.geometry=B,z.push(A))}else z.push(A);x.features=z;return x}async _validateQueryFeaturesMesh(u){if(u){var x=z=>{throw new b("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${z}'`);},y=["quantizationParameters","geometryPrecision","maxAllowableOffset"]; for(const z of y)null!=u[z]&&x(z);"returnM"in u&&u.returnM&&x("returnM");"returnCentroid"in u&&u.returnCentroid&&x("returnCentroid");null==u.outSpatialReference||u.outSpatialReference.equals(this.view.spatialReference)||x("outSpatialReference")}}get test(){}};a.__decorate([k.property()],q.prototype,"layer",void 0);a.__decorate([k.property()],q.prototype,"graphicsPipeline",void 0);a.__decorate([k.property()],q.prototype,"maximumNumberOfFeatures",null);a.__decorate([k.property()],q.prototype,"maximumNumberOfFeaturesExceeded", null);a.__decorate([k.property(w.updatingProgress)],q.prototype,"updatingProgress",void 0);a.__decorate([k.property({readOnly:!0})],q.prototype,"updatingProgressValue",null);a.__decorate([k.property({readOnly:!0})],q.prototype,"updatePolicy",null);a.__decorate([k.property({readOnly:!0})],q.prototype,"hasZ",null);a.__decorate([k.property({readOnly:!0})],q.prototype,"hasM",null);return q=a.__decorate([c.subclass("esri.views.3d.layers.FeatureLayerViewBase3D")],q)})},"esri/views/3d/layers/FeatureLikeLayerView3D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Error ../../../core/maybe ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/graphics/hydratedFeatures ../../../layers/support/timeSupport ../../../rest/support/Query ./support/projectExtentUtils ../webgl-engine/lib/UpdatePolicy".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.FeatureLikeLayerView3D=v=>{v=class extends v{constructor(){super(...arguments);this.updatePolicy=w.UpdatePolicy.SYNC;this.slicePlaneEnabled=!1;this.fullExtentInLocalViewSpatialReference=null;this.supportsHeightUnitConversion=!0}initialize(){const m=this.layer;"isTable"in m&&m.isTable?this.addResolvingPromise(Promise.reject(new q("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:m}))):(this.addResolvingPromise(this._validateGeometryType()), this.addResolvingPromise((async()=>{this.fullExtentInLocalViewSpatialReference=await t.toViewIfLocal(this);const r=this.createGraphicsPipeline();this.graphicsPipeline=r;await r.when()})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=l.destroyMaybe(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return!(this.graphicsPipeline?.scaleVisibilitySuspended?? !1)}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return g.combineTimeExtent(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get queryEngine(){return this.graphicsPipeline.queryEngine}getHit(m){var r=this.graphicsPipeline.findGraphic(n=> n.uid===m);if(null==r)return null;r=e.hydrateGraphic(r,this.layer);return{type:"graphic",graphic:r,layer:r.layer}}whenGraphicBounds(m,r){return this.graphicsPipeline?.whenGraphicBounds(m,r)}computeAttachmentOrigin(m,r){return this.graphicsPipeline?.computeAttachmentOrigin(m,r)}async elevationAlignPointsInFeatures(m,r){return this.graphicsPipeline.elevationAlignPointsInFeatures(m,r)}async queryForSymbologySnapping(m,r){return this.graphicsPipeline.queryForSymbologySnapping(m,r)}queryFeatures(m,r){return this.queryEngine.executeQuery(this._ensureQuery(m), r?.signal)}queryObjectIds(m,r){return this.queryEngine.executeQueryForIds(this._ensureQuery(m),r?.signal)}queryFeatureCount(m,r){return this.queryEngine.executeQueryForCount(this._ensureQuery(m),r?.signal)}queryExtent(m,r){return this.queryEngine.executeQueryForExtent(this._ensureQuery(m),r?.signal)}_ensureQuery(m){return null==m?this.createQuery():d.from(m)}highlight(m){return this.graphicsPipeline.highlight(m)}maskOccludee(m){return this.graphicsPipeline.maskOccludee(m)}getSuspendInfo(){return{...super.getSuspendInfo(), ...this.graphicsPipeline.suspendInfo}}isUpdating(){return!this.graphicsPipeline||this.graphicsPipeline.destroyed?!1:!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case "multipatch":case "multipoint":throw new q("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType});}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};b.__decorate([p.property()], v.prototype,"graphicsPipeline",void 0);b.__decorate([p.property({readOnly:!0})],v.prototype,"dataUpdating",null);b.__decorate([p.property()],v.prototype,"suspended",void 0);b.__decorate([p.property({readOnly:!0})],v.prototype,"legendEnabled",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"visibleAtCurrentScale",null);b.__decorate([p.property()],v.prototype,"updating",void 0);b.__decorate([p.property({readOnly:!0})],v.prototype,"updatePolicy",void 0);b.__decorate([p.property({type:Boolean})], v.prototype,"slicePlaneEnabled",void 0);b.__decorate([p.property({readOnly:!0})],v.prototype,"suspendInfo",void 0);b.__decorate([p.property()],v.prototype,"symbologySnappingSupported",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"hasAllFeatures",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"hasAllFeaturesInView",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"hasFullGeometries",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"timeExtent",null);return v= b.__decorate([c.subclass("esri.views.3d.layers.FeatureLikeLayerView3D")],v)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/timeSupport":function(){define(["exports","../../support/timeUtils"],function(a,b){a.combineTimeExtent=function(q,l,p){if(null==q?.timeInfo)return null;const {datesInUnknownTimezone:k=!1,timeOffset:h,useViewTime:f}=q;q=q.timeExtent;k&&(q=b.toLocalTimeExtent(q));l=f?l&&q?l.intersection(q):l||q:q;if(!l||l.isEmpty||l.isAllTime)return l;h&&(l= l.offset(-h.value,h.unit));k&&(l=b.toUTCTimeExtent(l));return l.equals(p)?p:l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/timeUtils":function(){define("exports ../TimeExtent ../core/arrayUtils ../core/deprecate ../core/lang ../core/Logger ../core/timeUtils ../webmap/utils ../webscene/utils".split(" "),function(a,b,q,l,p,k,h,f,c){function e(v){return void 0!==v.timeInfo}async function g(v,m){return v.widgets?.timeSlider?.fullTimeExtent??d(v.allLayers,m)}async function d(v, m){if(0===v.length)return b.allTime;await Promise.all(v.map(x=>x.load({signal:m})));var r=v.filter(e),n=v.filter(x=>!e(x)&&null!=x.visibilityTimeExtent);if(0===r.length&&0===n.length)return b.allTime;v=[];const u=[];for(const x of r)"feature"!==x?.type&&"map-image"!==x?.type||!x.timeInfo?.hasLiveData?u.push(x):v.push(x);r=x=>null==x||x.isAllTime;n=[...u.map(x=>{const y=x.timeInfo?.fullTimeExtent;({visibilityTimeExtent:x}=x);return y?.intersection(x)??x}),...n.map(x=>x.visibilityTimeExtent)];if(n.some(r))return b.allTime; v=v.map(async x=>{const y=(await x.fetchRecomputedExtents({signal:m}))?.timeExtent??x.timeInfo?.fullTimeExtent;({visibilityTimeExtent:x}=x);return y?.intersection(x)??x});v=(await Promise.allSettled(v)).map(x=>"fulfilled"===x.status?x.value:null);if(v.some(r))return b.allTime;v=[...v,...n].filter(q.isSome);return 0===v.length?b.allTime:v.reduce((x,y)=>x.union(y))}function t(v,m){v=v.currentTimeExtent;if(!v)return null;const {start:r,end:n}=v;v=r??n??null;switch(m){case "time-window":return new b({start:r, end:n});case "cumulative-from-start":return new b({start:null,end:v});case "cumulative-from-end":return new b({start:v,end:null});case "instant":return new b({start:v,end:v})}}async function w(v,m){if(!f.isWebMap(v)&&!c.isWebScene(v))return null;await v.load({signal:m});var r=v?.widgets?.timeSlider;if(!r)return null;v=await g(v,m);m=r.loop;var n=r.numThumbs??2;var u=r.currentTimeExtent;if(u){const {start:y,end:z}=u;n=null!=y&&null!=z&&y.getTime()===z.getTime()?"instant":2===n?"time-window":null== y||0===y.getTime()?"cumulative-from-start":"cumulative-from-end"}else n=2===n?"time-window":"cumulative-from-start";u=r.stopDelay??2E3;{const {numStops:y,stopInterval:z,stops:A}=r;var x=A?{dates:p.clone(A)}:z?{interval:z.clone()}:{count:y??5}}r=t(r,n);return{fullTimeExtent:v,loop:m,mode:n,playRate:u,stops:x,timeExtent:r}}a.getTimeExtentFromLayers=d;a.getTimeSliderSettingsFromWebDocument=w;a.getTimeSliderSettingsFromWebMap=async function(v,m){l.deprecatedFunction(k.getLogger("esri.support.timeUtils.getTimeSliderSettingsFromWebMap"), "`timeUtils.getTimeSliderSettingsFromWebMap` is deprecated in favor of 'timeUtils.getTimeSliderSettingsFromWebDocument'",{replacement:"timeUtils.getTimeSliderSettingsFromWebDocument",version:"4.30",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-support-timeUtils.html#getTimeSliderSettingsFromWebDocument",warnOnce:!0});return null!=v&&f.isWebMap(v)?await w(v,m):null};a.toLocalTimeExtent=function(v){if(!v)return v;const {start:m,end:r}=v;return new b({start:null!=m?h.offsetDate(m, m.getTimezoneOffset(),"minutes"):m,end:null!=r?h.offsetDate(r,r.getTimezoneOffset(),"minutes"):r})};a.toUTCTimeExtent=function(v){if(!v)return v;const {start:m,end:r}=v;return new b({start:null!=m?h.offsetDate(m,-m.getTimezoneOffset(),"minutes"):m,end:null!=r?h.offsetDate(r,-r.getTimezoneOffset(),"minutes"):r})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webmap/utils":function(){define(["exports"],function(a){a.isWebMap=function(b){return null!=b&&"object"===typeof b&&"declaredClass"in b&&"esri.WebMap"===b.declaredClass};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webscene/utils":function(){define(["exports","../support/tagSymbols"],function(a,b){a.isWebScene=function(q){return null!=q&&"object"===typeof q&&b.WebSceneTag in q};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/tagSymbols":function(){define(["exports"],function(a){const b=Symbol("WebScene");a.WebSceneTag=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/layers/support/projectExtentUtils":function(){define(["exports","../../../../geometry/support/webMercatorUtils","../../../../portal/support/geometryServiceUtils"],function(a,b,q){a.toViewIfLocal=function(l){const p=l.view.spatialReference,k=l.layer.fullExtent;var h=null!=k&&k.spatialReference;if(null==k||!h)return Promise.resolve(null);if(h.equals(p))return Promise.resolve(k.clone());h=b.project(k,p);return null!=h?Promise.resolve(h):l.view.state.isLocal?q.projectGeometry(k,p,l.layer.portalItem).then(f=> !l.destroyed&&f?f:null).catch(()=>null):Promise.resolve(null)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/graphics/hydratedFeatures ../../../../layers/graphics/controllers/FeatureTileController3D ../FeatureLayerViewPerformanceInfo ./Graphics3DGraphicsPipeline ../support/FeatureTileFetcher3DLayerViewContext ../../support/EventedSet ../../webgl-engine/lib/UpdatePolicy".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){a.FeatureGraphics3DGraphicsPipeline=class extends t.Graphics3DGraphicsPipeline{constructor(n){super(n);this._processorTotal=this._controllerTotal=0;this._needsRefresh=!1;this.suspendResumeExtentMode="data"}initialize(){this.addHandles(l.watch(()=>({controller:this.controller,suspended:this.suspended}),({controller:n,suspended:u})=>{n&&!u&&this._needsRefresh&&(n.refetch(),this._needsRefresh=!1)}))}destroy(){this._fetcherContext=q.destroyMaybe(this._fetcherContext)}get maximumNumberOfFeatures(){return this.controller?.maximumNumberOfFeatures?? this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(n){this._set("maximumNumberOfFeatures",n);this.controller&&(this.controller.maximumNumberOfFeatures=n)}get maximumNumberOfFeaturesExceeded(){return this.controller?!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded):!1}get updatingProgressValue(){let n=0;if(this.controller?.updating){var u=this.controller.updatingRemaining,x=Math.max(this.controller.updatingTotal,this._controllerTotal);0n?m.UpdatePolicy.ASYNC:m.UpdatePolicy.SYNC;case "tiles":return m.UpdatePolicy.ASYNC}}get usedMemory(){return(this.processor?.usedMemory?? 0)+(this.controller?.memoryForUnusedFeatures??0)}get unloadedMemory(){const n=this.controller?.expectedFeatureDiff??0,u=this.processor?.loadedFeatures??0;return(this.processor?.unprocessedMemoryEstimate??0)+n*(this.processor?.usedMemoryPerFeature??0)*(0n.serviceDataExtent, u=>{this.processor&&(this.processor.dataExtent=u)},l.initial);this.addHandles(l.watch(()=>this.suspended&&this.layerView.updateSuspended,u=>{u?n.suspend():n.resume()},l.syncAndInitial));this.updatingHandles.add(()=>this.processor?.displayFeatureLimit,u=>n.displayFeatureLimit=u,l.initial);this.addHandles(l.when(()=>!this.updating,()=>{this._processorTotal=this._controllerTotal=0}));return n}beforeSetController(n){n.maximumNumberOfFeatures=this.maximumNumberOfFeatures}get test(){return{controller:this.controller, graphics3DProcessor:this.graphics3DProcessor,heatmapProcessor:this.heatmapProcessor,loadedGraphics:this.loadedGraphics}}};b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"layerView",void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"controller",void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"_controllerTotal",void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"_processorTotal", void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"_needsRefresh",void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"maximumNumberOfFeatures",null);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"maximumNumberOfFeaturesExceeded",null);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"updatingProgressValue",null);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype, "updatePolicy",null);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"suspendResumeExtentMode",void 0);a.FeatureGraphics3DGraphicsPipeline=b.__decorate([c.subclass("esri.views.3d.layers.graphics.FeatureGraphics3DGraphicsPipeline")],a.FeatureGraphics3DGraphicsPipeline);const r=new Map([["point",5E3],["polygon",500],["polyline",1E3]]);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/controllers/FeatureTileController3D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/asyncUtils ../../../core/Collection ../../../core/has ../../../core/Error ../../../core/lang ../../../core/Logger ../../../core/maybe ../../../core/Promise ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../core/support/UpdatingHandles ../../support/arcgisLayerUrl ../../support/layerUtils ../../../portal/support/geometryServiceUtils ../../../rest/support/StatisticDefinition ../../../views/3d/layers/support/FeatureTileFetcher3D ../../../views/3d/layers/support/FeatureTileFetcher3DDebugger ../../../views/3d/support/debugFlags".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(C,D){if(!D)return!1;for(const F of D)if(!C.has(F))return!0;return!1}a.FeatureTileController3D=class extends g.EsriPromiseMixin(q){get dataUpdating(){return this._tileFetcher?.dataUpdating??!1}set extent(C){if(null==C||C.spatialReference.equals(this.layerView.view.spatialReference)){var D=this._get("extent");D===C||null!=D&&C&&D.equals(C)||(C=null!=C?C.clone():null,this._set("extent",C))}else c.getLogger(this).error("#extent\x3d","extent needs to be in the same spatial reference as the view")}get updating(){return!!(null!= this._tileFetcher&&this._tileFetcher.updating||null!=this._fetchDataInfoPromise||"tiles"===this.mode&&this.layerView.view.featureTiles&&this.layerView.view.featureTiles.updating||this._updatingHandles&&this._updatingHandles.updating)}get updatingTotal(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&null!=this._tileFetcher? this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return null!=this._tileFetcher?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(null==this._tileFetcher||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return this.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(C){C!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",C)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get hasAllFeatures(){return this.serviceDataCount=== a.FeatureTileController3DConstants.noServiceDataCount&&"snapshot"===this.mode&&this.hasAllFeaturesInView||this.serviceDataCount===this.graphics.length}get hasAllFeaturesInView(){return this._tileFetcher?.hasAllFeatures??!1}get hasFullGeometries(){return this._tileFetcher?.hasFullGeometries??!1}get mode(){var C=this.layerView.layer;if("feature"===C.type&&null!=C.infoFor3D)return"snapshot";if("catalog-footprint"===C.type||this._forceTilesMode)return"tiles";var D=this.layerView.view;if(!1===D.qualitySettings?.graphics3D?.snapshotAvailable|| this.serviceDataCount===a.FeatureTileController3DConstants.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||1>D.quality)return"tiles";D=(D=D&&D.featureTiles)&&D.tilingScheme;return C&&C.minScale&&this.serviceDataExtent&&D&&(C=this._approximateExtentSizeAtScale(C.minScale,D),(this.serviceDataExtent.width/C+this.serviceDataExtent.height/C)/2>a.FeatureTileController3DConstants.maxSnapshotMinScaleFactor)?"tiles":!this.maximumNumberOfFeatures||this.serviceDataCount<= this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const C=this._get("maxTotalSnapshotVertices")||0;return Math.max(C,"snapshot"===this.mode&&this._tileFetcher?.totalVertices||0)}_approximateExtentSizeAtScale(C,D){const F=this.layerView.view,H=D.levels[0];return(H.tileSize[0]/(H.scale/C)+H.tileSize[1]/(H.scale/C))/2*Math.ceil((F.width/D.pixelSize+F.height/D.pixelSize)/2)}get tileDescriptors(){const C=this.layerView.view.featureTiles;return"snapshot"===this.mode?new p([{id:"dummy-tile-full-extent", lij:[0,0,0]}]):C?C.tiles:new p}get test(){}constructor(C){super(C);this.type="feature-tile-3d";this._updatingHandles=new m.UpdatingHandles;this.serviceDataExtent=null;this.serviceDataCount=a.FeatureTileController3DConstants.noServiceDataCount;this._snapshotLimitExceeded=!1;this.displayFeatureLimit=null;this._suspended=this._forceTilesMode=!1;this._fetchDataInfoAbortController=this._fetchDataInfoPromise=this._tileFetcher=null;this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add(()=> this.displayFeatureLimit,C=>this._updatingHandles.addPromise(this._updateSnapshotLimit(C,null,this._lifeCycleAbortController.signal)));this._updatingHandles.add(()=>this.mode,()=>this._modeChanged(),t.initial);this._updatingHandles.add(()=>this.mode,(C,D)=>{"tiles"===C&&"snapshot"===D&&(this._forceTilesMode=!0)},t.initial);this.addResolvingPromise(Promise.resolve().then(()=>this._verifyCapabilities()).then(()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo())).then(()=>this._initializeTileFetcher()))}_verifyCapabilities(){const C= this.layerView.layer;if("ogc-feature"!==C.type&&!n.getEffectiveLayerCapabilities(C)?.operations.supportsQuery)throw new h("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:C});}destroy(){this._cancelFetchServiceDataInfo();this._tileFetcher=e.destroyMaybe(this._tileFetcher);this._tilesHandle=e.removeMaybe(this._tilesHandle);this._lifeCycleAbortController=e.abortMaybe(this._lifeCycleAbortController);this._updatingHandles.destroy(); this._set("_updatingHandles",null)}suspend(){this._suspended||(this._suspended=!0,null!=this._tileFetcher&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,null!=this._tileFetcher&&this._tileFetcher.resume())}restart(){const C=()=>{null!=this._tileFetcher&&this._tileFetcher.restart()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(C,C))}refetch(){this._refetch({resetForceTilesMode:!1})}getMissingAttributesForFeature(C){return this._tileFetcher?.getMissingAttributesForFeature(C)}_refetch(C){const D= ()=>{null!=this._tileFetcher&&(C.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(D,D))}_initializeTileFetcher(){const C=this.layerView.view;if(C){var D=t.whenOnce(()=>C.featureTiles?.tilingScheme,this._lifeCycleAbortController.signal);this._updatingHandles.addPromise(D);D.then(()=>{const {layerView:F,tileDescriptors:H}=this,N=F.layer,E=new y.FeatureTileFetcher3D({context:this.context,filterExtent:this.extent, tileDescriptors:H,features:this.graphics});this._tileFetcher=E;this._suspended?E.suspend():E.resume();const G=this.layerView.view;G&&this.addHandles(t.watch(()=>G.quality,O=>E.memoryFactor=O,t.syncAndInitial));const I="polygon"===this.context.geometryType?"polygonLodFactor":"polyline"===this.context.geometryType?"polylineLodFactor":null;I&&this.addHandles(t.watch(()=>this.layerView.view?.qualitySettings?.graphics3D?.[I],O=>E.lodFactor=O||1,t.initial));"ogc-feature"!==N.type&&this._updatingHandles.add(()=> N.createQueryVersion,()=>this._dataFilterChanged());this._updatingHandles.add(()=>F.availableFields,(O,L)=>this._availableFieldsChanged(L,O));this._updatingHandles.add(()=>F.requiredFields,(O,L)=>this._requiredFieldsChanged(L,O));"customParameters"in N&&this._updatingHandles.add(()=>N.customParameters,()=>this.restart());this.addHandles([N.on("apply-edits",O=>this._applyEdits(O)),t.watch(()=>this.extent,O=>E.filterExtent=O,t.sync),t.watch(()=>this.tileDescriptors,O=>E.tileDescriptors=O,t.sync),t.watch(()=> this.maximumNumberOfFeatures,O=>{E.maximumNumberOfFeatures=O;E.useTileCount=this.serviceDataCount>O},t.syncAndInitial),t.watch(()=>this.serviceDataCount,O=>{E.useTileCount=O>this.maximumNumberOfFeatures},t.syncAndInitial),t.watch(()=>A.debugFlags.FEATURE_TILE_FETCH_SHOW_TILES,O=>{O&&E&&!E.debugger?(E.debugger=new z.FeatureTileFetcher3DDebugger(E,G.featureTiles.tilingScheme.toTileInfo(),G),E.debugger.update()):!O&&this._tileFetcher&&E.debugger&&(E.debugger.destroy(),E.debugger=null)},t.syncAndInitial)]); this._supportsExceedsLimitQuery||this._updatingHandles.add(()=>this.maxTotalSnapshotVertices,()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal)))}).catch(()=>{})}}_modeChanged(){switch(this.mode){case "tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.featureTiles.addClient());break;default:c.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case "snapshot":null!=this._tilesHandle&&(this._tilesHandle.remove(), this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0);this.notifyChange("maxTotalSnapshotVertices");this._refetch({resetForceTilesMode:!0})}_applyEdits(C){const D=this.layerView.layer;null!=this._tileFetcher&&this._tileFetcher.applyEdits(C).then(F=>{if(F){if(!this._lifeCycleAbortController)throw d.createAbortError();F.exceededTransferLimit&&"refresh"in D?D.refresh():(F.deletedFeatures.length||F.updatedFeatures.length||F.addedFeatures.length)&&this._updatingHandles.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}}).catch(F=> {if(!d.isAbortError(F))throw F;})}_availableFieldsChanged(C,D){null!=this._tileFetcher&&B(this._tileFetcher.availableFields,D)&&this._refetch({resetForceTilesMode:!1})}_requiredFieldsChanged(C,D){null!=this._tileFetcher&&B(this._tileFetcher.availableFields,D)&&this.restart()}_createVertexLimitExceededQuery(C){const D=this.layerView.layer,F=D.createQuery();F.returnGeometry=!1;F.outStatistics=[new x({statisticType:"exceedslimit",maxVertexCount:C,outStatisticFieldName:"exceedslimit",maxPointCount:1E8, maxRecordCount:1E8})];D.capabilities?.query.supportsCacheHint&&(F.cacheHint=!0);return F}_createDataInfoQuery(){const C=this.layerView.layer,D=C.createQuery();D.returnGeometry=!1;D.outSpatialReference=this.layerView.view.spatialReference;C.capabilities?.query.supportsCacheHint&&(D.cacheHint=!0);return D}_fullExtentIsAccurate(){const C=this.layerView.layer;if("definitionExpression"in C&&C.definitionExpression)return!1;switch(C.type){case "feature":case "catalog-footprint":case "oriented-imagery":return r.isHostedAgolService(C.url); case "csv":case "geojson":case "ogc-feature":case "wfs":return!0}}async _updateServiceDataExtent(C){try{await this._tryUpdateServiceDataExtent(C)}catch(D){d.isAbortError(D)||this._set("serviceDataExtent",f.clone(this.layerView.fullExtentInLocalViewSpatialReference))}}async _tryUpdateServiceDataExtent(C){var D=this.layerView;const F=D.layer,H=F.capabilities?.query.supportsExtent??!1,N=f.clone(D.fullExtentInLocalViewSpatialReference),E=F.fullExtent,G=this._fullExtentIsAccurate(),I=this.serviceDataCount; H&&I<=a.FeatureTileController3DConstants.maxFeatureCountForExtent&&(!N||!G)&&"queryExtent"in F?(D=this._createDataInfoQuery(),C=await F.queryExtent(D,{timeout:a.FeatureTileController3DConstants.queryExtentTimeout,signal:C}),this._set("serviceDataExtent",C.extent)):N?this._set("serviceDataExtent",N):null!=E?(C=await u.projectGeometry(E,D.view.spatialReference,"portalItem"in F?F.portalItem:null,C),this._set("serviceDataExtent",C)):this._set("serviceDataExtent",null)}async _updateServiceDataCount(C){const D= this.layerView.layer;if("queryFeatureCount"in D&&k("featurelayer-snapshot-enabled"))if(C=await l.result(D.queryFeatureCount(this._createDataInfoQuery(),{timeout:a.FeatureTileController3DConstants.queryStatisticsTimeout,signal:C})),!0===C.ok)this._set("serviceDataCount",C.value);else{if(d.isAbortError(C.error))throw C.error;this._set("serviceDataCount",a.FeatureTileController3DConstants.noServiceDataCount)}else this._set("serviceDataCount",a.FeatureTileController3DConstants.noServiceDataCount)}get _supportsExceedsLimitQuery(){const C= this.layerView.layer;return null!=C.capabilities&&C.capabilities.operations&&C.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case "point":return 1;case "multipoint":return 1;case "polygon":return 4;case "polyline":return 2;case "multipatch":case "mesh":return 3;case null:return 0;default:return 0}}async _updateSnapshotLimit(C,D,F){if(null==C?.averageSymbolComplexity)this._snapshotLimitExceeded=!1;else{var {maximumTotalNumberOfVertices:H, averageSymbolComplexity:N}=C,{verticesPerFeature:E,verticesPerCoordinate:G}=N;C=1=E||C){0!==E&&null!=D&&await D;var I=Math.min(H,1E6);D=this.serviceDataCount;var O=D!==a.FeatureTileController3DConstants.noServiceDataCount;I=O?Math.ceil((I-D*E)/(G||1)):Math.ceil(I/(G||1));C&&(I=Math.min(I,5E6));if(O&&this._minimumNumberOfVerticesForGeometry*D>I)this._snapshotLimitExceeded=!0;else if(this._supportsExceedsLimitQuery&&k("featurelayer-snapshot-enabled"))if(F= await l.result(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(I),{timeout:a.FeatureTileController3DConstants.queryStatisticsTimeout,signal:F})),!1===F.ok){if(d.isAbortError(F.error))throw F.error;this._snapshotLimitExceeded=!1}else F=F.value.features[0],this._snapshotLimitExceeded=F?.attributes?!!F.attributes.exceedslimit:!1;else this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>I}else this._snapshotLimitExceeded=!1}}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo(); let C=new AbortController;const D=C.signal;var F=this._updateServiceDataCount(D);F=Promise.allSettled([F,this._updateSnapshotLimit(this.displayFeatureLimit,F,D)]);const H=F.then(()=>this._updateServiceDataExtent(D)).catch(N=>{d.isAbortError(N)||c.getLogger(this).error("#fetchServiceDataInfo()",N)}).then(()=>{H===this._fetchDataInfoPromise&&(this._fetchDataInfoAbortController=this._fetchDataInfoPromise=null);C=null});C&&(this._fetchDataInfoPromise=H);this._fetchDataInfoAbortController=C;return F.then(()=> {},()=>{})}_cancelFetchServiceDataInfo(){const C=this._fetchDataInfoAbortController;C&&(this._fetchDataInfoPromise=this._fetchDataInfoAbortController=null,C.abort())}get performanceInfo(){return{storedFeatures:this._tileFetcher?.storedFeatures??0,totalFeatures:this._tileFetcher?.totalFeatures??0,totalVertices:this._tileFetcher?.totalVertices??0,missingTiles:this._tileFetcher?.missingTiles??0}}};b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"type",void 0);b.__decorate([w.property({constructOnly:!0})], a.FeatureTileController3D.prototype,"graphics",void 0);b.__decorate([w.property({constructOnly:!0})],a.FeatureTileController3D.prototype,"layerView",void 0);b.__decorate([w.property({constructOnly:!0})],a.FeatureTileController3D.prototype,"context",void 0);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"dataUpdating",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"extent",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"updating", null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"_updatingHandles",void 0);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"updatingTotal",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"updatingRemaining",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"expectedFeatureDiff",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"memoryForUnusedFeatures",null);b.__decorate([w.property()], a.FeatureTileController3D.prototype,"maximumNumberOfFeaturesExceeded",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"serviceDataExtent",void 0);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"serviceDataCount",void 0);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"_snapshotLimitExceeded",void 0);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"displayFeatureLimit",void 0);b.__decorate([w.property({type:Number})], a.FeatureTileController3D.prototype,"maximumNumberOfFeatures",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"hasAllFeatures",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"hasAllFeaturesInView",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"hasFullGeometries",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"_forceTilesMode",void 0);b.__decorate([w.property({readOnly:!0})], a.FeatureTileController3D.prototype,"mode",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"maxTotalSnapshotVertices",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"tileDescriptors",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"_tileFetcher",void 0);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"_fetchDataInfoPromise",void 0);a.FeatureTileController3D=b.__decorate([v.subclass("esri.layers.graphics.controllers.FeatureTileController3D")], a.FeatureTileController3D);a.FeatureTileController3DConstants=void 0;(function(C){C.noServiceDataCount=Infinity;C.maxSnapshotMinScaleFactor=5;C.reset=function(){C.maxFeatureCountForExtent=1E4;C.queryStatisticsTimeout=12E3;C.queryExtentTimeout=1E4}})(a.FeatureTileController3DConstants||(a.FeatureTileController3DConstants={}));a.FeatureTileController3DConstants.reset();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileFetcher3D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/Logger ../../../../core/MapUtils ../../../../core/promiseUtils ../../../../core/ReactiveMap ../../../../core/reactiveUtils ../../../../core/scheduling ../../../../core/accessorSupport/decorators/property ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/aaBoundingRect ../../../../layers/graphics/dehydratedFeatures ../../../../rest/support/QuantizationParameters ../../../../rest/support/Query ../../../ViewingMode ./featureReference ./FeatureTile ../../terrain/tileUtils ../../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(G){return"dummy-tile-full-extent"===G.id}function B(G){let I=0;for(const O of G)O.features&&0I.name))}function F(G,I){if(null==G||null==I)return D(I);const O=new Set;for(const {name:L}of I)G.has(L)&&O.add(L);return O} function H(G,I){if(!I?.length)return G;G??=new Map;const O=()=>new Set;for(const {objectId:L,attribute:P}of I)k.getOrCreateMapValue(G,L,O).add(P);return G}a.FeatureTileFetcher3D=class extends q{set maximumNumberOfFeatures(G){G=G||Infinity;const I=this._get("maximumNumberOfFeatures");G===I||1>G||(this._set("maximumNumberOfFeatures",G),this._maximumFeaturesUpdated(I,G))}set memoryFactor(G){this.memoryFactor!==G&&(this._set("memoryFactor",G),this._setDirty())}set lodFactor(G){this.lodFactor!==G&&(this._set("lodFactor", G),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(G){this._useTileCount=G;this.notifyChange("useTileCount")}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get memoryForUnusedFeatures(){let G=0;this._featureTiles.forEach(I=>G+=I.estimatedUnusedSize);return G}get totalVertices(){let G=0;this._featureTiles.forEach(I=>G+=I.numVertices);return G}get totalFeatures(){let G= 0;this._featureTiles.forEach(I=>G+=I.numFeatures);return G}get hasAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(const [,G]of this._featureTiles)if(!this.hasFullGeometries&&0!==G.emptyFeatureRatio||!G.hasAllFeatures)return!1;return!0}get hasFullGeometries(){return this._supportsResolution?!this.tileDescriptors.find(G=>null!=G.resolution)||!this.context.capabilities.supportsQuantization&&"polyline"!==this.context.geometryType:!0}set filterExtent(G){if(null!=G&&this.context.tilingScheme&& !G.spatialReference.equals(this.context.tilingScheme.spatialReference))p.getLogger(this).error("#filterExtent\x3d","extent needs to be in the same spatial reference as the tiling scheme");else{var I=this._get("filterExtent");I===G||null!=I&&G&&I.equals(G)||(G=null!=G?G.clone():null,this._set("filterExtent",G),this._reclip(G,I))}}constructor(G){super(G);this.running=this.dataUpdating=this._useTileCount=!1;this.expectedFeatureDiff=this.updatingRemaining=this.updatingTotal=0;this.maximumNumberOfFeaturesExceeded= !1;this._farRatio=this._fullRatio=1;this._changes={updates:{adds:[],removes:[]},adds:[],removes:[]};this._frameTask=z.ImmediateTask;this._dirty=!1;this._featureTiles=new f;this._displayingFeatureReferences=new Map;this._numDisplayingFeatureReferences=0;this._suspended=!0;this._pendingEdits=null;this._isFetching=this._applyEditsTilesUpdated=!1}initialize(){this.addHandles(c.on(()=>this.tileDescriptors,"change",()=>this._setDirty(),{sync:!0,onListenerAdd:()=>this._setDirty()}));this._objectIdField= this.context.objectIdField;this.FeatureReferenceClass=this.context.capabilities.supportsMultipleResolutions?u.MultiFeatureReference:u.SingleFeatureReference;const G=this.context.scheduler;null!=G&&(this._frameTask=G.registerTask(z.TaskPriority.FEATURE_TILE_FETCHER,this));this._setDirty()}destroy(){this._frameTask.remove();this._featureTiles.forEach(G=>{this._cancelFetchTile(G);this._removeTile(G)});this._featureTiles.clear();this._displayingFeatureReferences.clear();this._pendingEdits?.controller.abort(); this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(G=>{this._cancelFetchTile(G);this._clearTile(G);this._resetFetchTile(G)});null!=this.context.memoryCache&&this.context.memoryCache.clear();this._setDirty()}refetch(){this._featureTiles.forEach(G=>{this._cancelFetchTile(G);this._resetFetchTile(G)});null!=this.context.memoryCache&&this.context.memoryCache.clear();this._setDirty()}suspend(){this._suspended||(this._suspended=!0,this._pause(), this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(G){for(const [,I]of this._featureTiles){const O=I.missingAttributes?.get(G);if(null!=O)return O}}_pause(){this._paused&&(this._featureTiles.forEach(G=>this._cancelFetchTile(G)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let G=null;this._featureTiles.forEach(I=>{null!=I.displayingFeatures&&0!==I.displayingFeatures.length&&(null==G?G=new Set(I.availableFields): G.forEach(O=>{I.availableFields.has(O)||G.delete(O)}))});return null!=G?G:new Set}applyEdits(G){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const I=this._pendingEdits;I.count++;const O=I.edits.then(()=>G.result.catch(L=>{if(h.isAbortError(L))throw L;return null}).then(L=>{if(!L)return L;this._applyEditsDeleteFeatures(L.deletedFeatures);return this._applyEditsAddUpdateFeatures(L.addedFeatures,L.updatedFeatures,I.controller.signal).then(()=> L)}).then(L=>{0===--I.count&&(this._pendingEdits===I&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause());return L}));I.edits=O;this._updated();return O}_applyEditsDeleteFeatures(G){if(0!==G.length){var I=this.context.globalIdField,O=I&&this.availableFields.has(I),L=new Set,P=this._objectIdField;G.forEach(({objectId:M,globalId:K})=>{(!M||0>M)&&I&&K&&(O||p.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${I} to be included the layer's outFields for updates to be reflected in the view`), M=this._objectIdFromGlobalId(K,P,I));null!=M&&0<=M&&L.add(M)});this._featureTiles.forEach(M=>{if(M.features){var K=M.features.filter(J=>!L.has(v.getObjectId(J,this._objectIdField)));K.length!==M.features.length&&(this._applyEditsTileUpdated(),M.setFeatures(K,0,M.availableFields,M.missingAttributes),this._invalidateCounts())}})}}_objectIdFromGlobalId(G,I,O){if(null==G)return null;const L=this.features.find(P=>P.attributes?.[O]===G);return L?v.getObjectId(L,I):null}async _applyEditsAddUpdateFeatures(G, I,O){const {objectIdField:L,globalIdField:P}=this.context,M=P&&this.availableFields.has(P),K=new Set,J=new Set;for(const Q of G)G=Q.objectId,null!=G&&K.add(G);for(const {objectId:Q,globalId:W}of I)I=Q,(null==I||0>I)&&P&&(M||p.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${P} to be included the layer's outFields for updates to be reflected in the view`),I=this._objectIdFromGlobalId(W,L,P)),null!=I&&0<=I&&(K.add(I),J.add(I));if(0!==K.size){var R= [];this._featureTiles.forEach(Q=>{(Q=this._applyEditsAddUpdateTile(Q,K,J,O))&&R.push(Q)});this._updated();await Promise.allSettled(R)}}async _applyEditsAddUpdateTile(G,I,O,L){if(G.features){var P=this._createQuery(G);P.resultType=void 0;P.cacheHint=!1;P.objectIds=Array.from(I);I=await this._queryFeatures(P,L);L=null;0!O.has(v.getObjectId(M,this._objectIdField))),P.length!==G.features.length&&(L=P));if(0this._addTiles(O,G))&&G.run(()=>this._filterExtentTiles(O,G))&&G.run(()=>this._removeTiles(O,G))&&!G.done){var L=this._sortTiles(O);G.run(()=>this._showTiles(L,G))&&G.run(()=>this._fetchTiles(L,G))&&G.run(()=>this._updateMemoryEstimates(L,G))||this._setDirty();this._updated();this.updating||this._updateMaximumNumberOfFeaturesExceeded()}else this._setDirty()}_markTilesNotAlive(G){for(const I of G)I.alive= !1}_addTiles(G,I){if(this._suspended||!this.tileDescriptors)return!1;this.tileDescriptors.forEach(O=>{const L=this._featureTiles.get(O.id);L?L.alive=!0:I.done||(G.push(this._addTile(O)),I.madeProgress())});return I.hasProgressed}_filterExtentTiles(G,I){for(const O of G){if(I.done)break;O.alive&&(O.filtered=!O.intersects(this.filterExtent),O.filtered&&(this._clearTile(O),I.madeProgress()))}return I.hasProgressed}_removeTiles(G,I){for(let O=G.length-1;0<=O&&!I.done;O--){const L=G[O];L.alive||(this._removeTile(L), O!==G.length-1&&(G[O]=G[G.length-1]),G.pop(),I.madeProgress())}return I.hasProgressed}_sortTiles(G){G.sort((I,O)=>(I.descriptor.loadPriority??0)-(O.descriptor.loadPriority??0));return G}_showTiles(G,I){const O=this._updateRatio(G),L=P=>{const M=1>this._fullRatio?O(P)*this._farRatio:1;P.reduceFeatures(M,this.memoryFactor,this._objectIdField)&&this._setDirty();return this._showTile(P)};for(const P of G)if(!I.run(()=>L(P))){this._setDirty();break}return I.hasProgressed}_fetchTiles(G,I){if(this._paused)return!1; var O=!1;for(const P of G)if(P.needsFetching){var L=null!=this.context.memoryCache?this.context.memoryCache.pop(P.id):null;if(null!=L)P.cache=L,P.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),I.madeProgress();else if(this._needsNumFeatures(P)&&(O=new AbortController,L=this._fetchTileCount(P,O.signal),this._handleRequest(P,L,O,()=>P.numFeatures=x.failedFeatureCount),O=!0,I.madeProgress()),I.done)return!0}if(O)return I.hasProgressed;for(const P of G)if(P.needsFetching&& (G=new AbortController,O=this._fetchTile(P,G.signal),this._handleRequest(P,O,G,M=>{P.setFeatures([],0,null,void 0);this._invalidateCounts();P.featuresMissing=!1;P.fetchFailed=!0;this.context.logFetchError(p.getLogger(this),M)}),I.madeProgress()))return!0;return I.hasProgressed}_updateMemoryEstimates(G,I){G.some(O=>I.run(()=>O.updateMemoryEstimates())?!1:(this._setDirty(),!0));return I.hasProgressed}_reclip(G,I){if(this.initialized){var O=[];this._featureTiles.forEach(L=>{null!=L.displayingFeatures&& 0!==L.displayingFeatures.length&&(L.intersectionIncludingBorrowed(I,N),L.intersectionIncludingBorrowed(G,E),w.equals(N,E)||O.push(L))});this._refreshDisplayingFeatures(O);this._updated()}}_refreshDisplayingFeatures(G){const I=new Set,O=this._changes.updates;for(const L of G)if(null!=L.displayingFeatures)for(const P of L.displayingFeatures)G=v.getObjectId(P,this._objectIdField),I.has(G)||(I.add(G),G=this._displayingFeatureReferences.get(G).feature,O.removes.push(G),O.adds.push(G));this._applyChanges()}_updated(){let G= 0;this._paused||this._featureTiles.forEach(I=>I.isFetching?++G:0);this._isFetching=0{++O;if(Q.isFetching&&Q.hasPreciseFeatureCount){const W=this._maximumFeaturesForTile(Q)*(1-Q.emptyFeatureRatio);M+=W-(null!= Q.displayingFeatures?Q.displayingFeatures.length*K:0)}Q.needsFetching?++P:0I.perTileMaximumNumberOfFeaturesExceeded);this._set("maximumNumberOfFeaturesExceeded",G)}_updateRatio(G){const I=B(G),O=M=>1/(1<G&&this._featureTiles.forEach(O=>{if(O.featuresMissing){var L=this._maximumFeaturesForTile(O); O.features&&(O.features.length>=L||O.fetchStatus===x.FetchStatus.FULL)||(this._cancelFetchTile(O),this._resetFetchTile(O))}}),this._setDirty())}_addTile(G){G=new x.FeatureTile(G);this._featureTiles.set(G.id,G);this._resetFetchTile(G);this._referenceDisplayingFeaturesFromRelatedTiles(G);return G}_referenceDisplayingFeaturesFromRelatedTiles(G){const I=G.descriptor.resolution;this._featureTiles.forEach(O=>{if(!(null==O.displayingFeatures||G===O||G.descriptor.lij&&O.descriptor.lij&&!y.tilesAreRelated(G.descriptor.lij, O.descriptor.lij))){null==G.displayingFeatures&&(G.displayingFeatures=[]);G.descriptor.extent&&O.descriptor.extent&&(null==G.extentIncludingBorrowedFeatures&&(G.extentIncludingBorrowedFeatures=w.clone(G.descriptor.extent)),w.expand(G.extentIncludingBorrowedFeatures,O.descriptor.extent,G.extentIncludingBorrowedFeatures));for(const L of O.displayingFeatures)G.displayingFeatures.push(L),O=this._displayingFeatureReferences.get(v.getObjectId(L,this._objectIdField)),O.ref(O.feature,I),this._numDisplayingFeatureReferences++}}); G.featureLimit=null!=G.displayingFeatures?G.displayingFeatures.length:0}_removeTile(G){this._clearTile(G);this._featureTiles.delete(G.id)}_resetFetchTile(G){G.filtered=!G.intersects(this.filterExtent);G.filtered?G.needsFetching&&(G.fetchStatus=x.FetchStatus.DONE):G.fetchStatus=x.FetchStatus.FETCH_NEEDED}_cancelFetchTile(G){const I=G.requestController;null!=I&&(G.requestController=null,G.resetFetching(),I.abort())}async _fetchTileCount(G,I){G.numFeatures=await this._fetchCount(G,I);this._updateRatio(this._getListOfTiles()); return G.fetchStatus===x.FetchStatus.REFETCHING?x.FetchStatus.REFETCH_NEEDED:x.FetchStatus.FETCH_NEEDED}async _fetchTile(G,I){G.fetchFailed=!1;var O=this._maximumFeaturesForTile(G);if(0>=O)return G.hasPreciseFeatureCount&&0===G.numFeatures||(G.fetchFailed=!0),C(G);const L=this._getMaxRecordCount(G);var P=Math.ceil(O/L);if(A(G)||!this.context.capabilities.supportsMaxRecordCountFactor||G.numFeatures<=O&&P>r.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(G,I);P=this._createQuery(G);P.maxRecordCountFactor= Math.ceil(O/L);G.isRefetching&&G.features&&0=r.MAX_MAX_RECORD_COUNT_FACTOR?x.FetchStatus.FULL:x.FetchStatus.DONE:x.FetchStatus.FULL;await this._frameTask.schedule(()=>{G.featuresMissing=G.hasPreciseFeatureCount&&M.length{S&&(O+=W.num);M+=V.length;L+=this._removeEmptyFeatures(V);G.featuresMissing=S&&G.hasPreciseFeatureCount&&O=K)return T?x.FetchStatus.DONE:x.FetchStatus.FULL}}_createFeatureCountQuery(G){G=this._createQuery(G);this.context.capabilities.supportsCacheHint&& (G.resultType=void 0,G.cacheHint=!0);return G}_createQuery(G){const I=this.context.createQuery(),O=G.descriptor.extent;O&&(I.geometry=w.toExtent(O,this.context.tilingScheme.spatialReference));this._setResolutionParams(I,G);this._useTileQuery(G)?I.resultType="tile":this.context.capabilities.supportsCacheHint&&(I.cacheHint=!0);return I}_setPagingParameters(G,I,O,L){if(!this.context.capabilities.supportsPagination)return!1;G.start=I;0{G.requestController=null;G.fetchStatus=M}).catch(M=>{G.requestController===O&&(G.requestController= null,G.fetchStatus=x.FetchStatus.DONE);h.isAbortError(M)?P=!0:L(M)}).then(()=>{P||this._setDirty();this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(e.schedule(()=>{this.removeHandles("scheduleUpdated");this._updated()}),"scheduleUpdated")}_showTile(G){if(null!=G.displayingFeatures&&!G.needsDisplayUpdate)return!1;var I=G.features;if(0===G.featureLimit||!I)return I=null!=G.displayingFeatures&&0O&&(this._notifyDataUpdating(),this.features.addMany(0===L?G:G.slice(L)));I.length>O&&(this._notifyDataUpdating(),this.features.removeMany(0===L?I:I.slice(L)));G.length=0;I.length=0}_clearTile(G){this._hideTile(G);G.features&&null!=this.context.memoryCache&& this.context.memoryCache.put(G.id,G.cache,16+G.estimatedSize);G.setFeatures(null,0,null,void 0);this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices");this.notifyChange("totalFeatures");this.notifyChange("memoryForUnusedFeatures")}_getListOfTiles(){return Array.from(this._featureTiles.values())}get storedFeatures(){return this._getListOfTiles().reduce((G,I)=>G+(I.features?I.features.length:0),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce((G,I)=> G+(I.needsFetching||I.isFetching?1:0),0)}_maximumFeaturesForTile(G){const I=G.hasPreciseFeatureCount?G.numFeatures:Infinity;return Math.min(Math.ceil((G.hasPreciseFeatureCount?I:this.maximumNumberOfFeatures)*(1>this._fullRatio?this._farRatio:1)/(1-G.emptyFeatureRatio)),I)}get test(){}};b.__decorate([g.property({constructOnly:!0})],a.FeatureTileFetcher3D.prototype,"features",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"tileDescriptors",void 0);b.__decorate([g.property({value:Infinity})], a.FeatureTileFetcher3D.prototype,"maximumNumberOfFeatures",null);b.__decorate([g.property({value:1})],a.FeatureTileFetcher3D.prototype,"memoryFactor",null);b.__decorate([g.property({value:1})],a.FeatureTileFetcher3D.prototype,"lodFactor",null);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"useTileCount",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"updating",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"dataUpdating", void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"running",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"updatingTotal",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"updatingRemaining",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"expectedFeatureDiff",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"memoryForUnusedFeatures", null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"maximumNumberOfFeaturesExceeded",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"totalVertices",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"totalFeatures",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"hasAllFeatures",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"hasFullGeometries", null);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"filterExtent",null);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileFetcher3D.prototype,"context",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_dirty",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_suspended",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_pendingEdits",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_applyEditsTilesUpdated", void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_paused",null);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_isFetching",void 0);a.FeatureTileFetcher3D=b.__decorate([t.subclass("esri.views.3d.layers.support.FeatureTileFetcher3D")],a.FeatureTileFetcher3D);const N=w.create(),E=w.create();a.contextCapabilitiesFromLayer=function(G){const I=G.capabilities.query;a:switch(G.geometryType){case "polyline":G=!0;break a;case "polygon":G=G.capabilities&&G.capabilities.query&& G.capabilities.query.supportsQuantization;break a;default:G=!1}return{supportsMultipleResolutions:G,supportsPagination:!(!I||!I.supportsPagination),supportsResultType:!(!I||!I.supportsResultType),supportsCacheHint:!(!I||!I.supportsCacheHint),supportsQuantization:!(!I||!I.supportsQuantization),supportsQuantizationEditMode:!(!I||!I.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!I||!I.supportsMaxRecordCountFactor),supportsFormatPBF:!(!I||!I.supportsFormatPBF)}};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/featureReference":function(){define("exports ../../../../core/has ../../../../geometry/SpatialReference ../../../../geometry/support/aaBoundingBox ../../../../core/mathUtils ../../../../geometry/Extent ../../../../geometry/Geometry ../../../../geometry/Multipoint ../../../../geometry/Point ../../../../geometry/Polygon ../../../../geometry/Polyline ../../../../geometry/support/typeUtils ../../../../layers/support/Field ../../../../layers/graphics/dehydratedFeatureComparison".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){class v{get isReferenced(){return 0!==this.versions.length}get isSingle(){return 1===this.versions.length&&1===this.versions[0].refCount}constructor(n,u){this._highestResolutionVersion=null;this.versions=[];this.ref(n,u)}ref(n,u){const x=this.feature;r.oldVersion=x;this.feature&&Object.defineProperty(n,"uid",{value:this.feature.uid,configurable:!0});for(var y of this.versions)if(y.resolution===u){y.refCount++;if((u=this._highestResolutionVersion===y&&!w.equals(n, y.feature))||this._highestResolutionVersion!==y)y.feature=n;r.newVersion=u?n:x;return r}y={feature:n,resolution:u,refCount:1};this.versions.push(y);!this._highestResolutionVersion||ut+p.numVertices(w.geometry),0)):this._numVertices=this._emptyFeatureRatio.value=0}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures:this._features?this._features.length:0}set numFeatures(c){this._numFeatures=c}get hasPreciseFeatureCount(){return-1this._estimatedSize){this._estimatedUnusedSize=this._estimatedSize=0;if(this._features)for(var c=0;c=this.featureLimit&&(this._estimatedUnusedSize+=e)}return!0}if(this._estimatedUnusedSizeDirty){this._estimatedUnusedSize=0;this._estimatedUnusedSizeDirty=!1;if(this._features)for(c=this.featureLimit;c< this._features.length;++c)this._estimatedUnusedSize+=p.estimateSize(this._features[c]);return!0}return!1}get isFetching(){return this.fetchStatus===a.FetchStatus.FETCHING||this.fetchStatus===a.FetchStatus.REFETCHING}get isRefetching(){return this.fetchStatus===a.FetchStatus.REFETCHING}get needsFetching(){return this.fetchStatus===a.FetchStatus.FETCH_NEEDED||this.fetchStatus===a.FetchStatus.REFETCH_NEEDED}get needsRefetching(){return this.fetchStatus===a.FetchStatus.REFETCH_NEEDED}get isFetched(){return this.fetchStatus=== a.FetchStatus.DONE||this.fetchStatus===a.FetchStatus.FULL}resetFetching(){this.fetchStatus=this.fetchStatus===a.FetchStatus.REFETCHING?a.FetchStatus.REFETCH_NEEDED:a.FetchStatus.FETCH_NEEDED}get needsDisplayUpdate(){var c;if(c=!!this._features){a:{c=this._features;var e=this.displayingFeatures,g=this.featureLimit;if(null==e||null==c||g!==e.length||g>c.length)c=!1;else{for(let d=0;dp.getObjectId(e,c)-p.getObjectId(g,c)),b.shuffle(this._features,16438),this._estimatedUnusedSizeDirty=this._shuffled=!0)}reduceFeatures(c, e,g){if(0>=c)return!1;if(!this._features)return this.featureLimit=0,!1;let d=!1;this.featureLimit=Math.ceil(this.numFeatures*c);this.featureLimit>this._features.length&&(this.featureLimit=this._features.length,this.fetchStatus===a.FetchStatus.DONE&&0c&&this._shuffle(g);c=Math.max(this.featureLimit,Math.ceil(e*this.numFeatures));this._features.length>c&&(this._features.length=c,this._featuresLength.value= c,this.featuresMissing=!0,this.fetchStatus===a.FetchStatus.FULL&&(this.fetchStatus=a.FetchStatus.DONE));return d}get cache(){return{availableFields:this._availableFields,features:this._features,numFeatures:this._numFeatures,emptyFeatureRatio:this._emptyFeatureRatio.value,fetchStatus:this.fetchStatus,featuresMissing:this.featuresMissing}}set cache(c){this.requestController=null;this._availableFields=c.availableFields;this._features=c.features;this._featuresLength.value=c.features?.length??0;this._numFeatures= c.numFeatures;this._emptyFeatureRatio.value=c.emptyFeatureRatio;this.fetchStatus=c.fetchStatus;this.featuresMissing=c.featuresMissing;this._estimatedSize=-1;this._estimatedUnusedSizeDirty=!0}}a.FetchStatus=void 0;(function(c){c[c.FETCH_NEEDED=0]="FETCH_NEEDED";c[c.REFETCH_NEEDED=1]="REFETCH_NEEDED";c[c.FETCHING=2]="FETCHING";c[c.REFETCHING=3]="REFETCHING";c[c.DONE=4]="DONE";c[c.FULL=5]="FULL"})(a.FetchStatus||(a.FetchStatus={}));const f=l.create();a.FeatureTile=h;a.failedFeatureCount=-2;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileFetcher3DDebugger":function(){define("exports ../../../../Color ../../../../Graphic ../../../../symbols ../../../../core/Collection ../../../../geometry/Polygon ../../../../symbols/FillSymbol3DLayer ../../../../symbols/PointSymbol3D ../../../../symbols/PolygonSymbol3D ../../../../symbols/TextSymbol3DLayer ../../../../symbols/support/Symbol3DVerticalOffset ../../terrain/TilingScheme ../../../../symbols/callouts/LineCallout3D ../../../../symbols/callouts/LineCallout3DBorder".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){const v=[[0,179,255],[117,62,128],[0,104,255],[215,189,166],[32,0,193],[98,162,206],[102,112,129],[52,125,0],[142,118,246],[138,83,0],[92,122,255],[122,55,83],[0,142,255],[81,40,179],[0,200,244],[13,24,127],[0,170,147],[19,58,241],[22,44,35]];class m{constructor(r,n,u){this._loadingGraphics=new Map;this._loadedGraphics=new Map;this._pendingGraphics=new Map;this._dataExtentGraphic=null;this._enabled=!0;this._tileFetcher=r;this._view=u;this._tilingScheme=new d.TilingScheme(n); this._loadedSymbols=v.map(x=>new c({symbolLayers:new p([new h({material:{color:[x[0],x[1],x[2],.6]},outline:{color:"black",size:1}})])}));this._loadingSymbols=[new c({symbolLayers:new p([new h({material:{color:[200,200,200,.4]},outline:{color:[30,30,30],size:1}})])})];this._pendingSymbols=[new c({symbolLayers:new p([new h({material:{color:[100,100,100,.4]},outline:{color:[30,30,30],size:1}})])})];this._dataExtentSymbol=new c({symbolLayers:new p([new h({material:{color:[0,0,0,0]},outline:{color:"green", size:4}})])})}destroy(){this.enabled=!1}get enabled(){return this._enabled}set enabled(r){this._enabled=r;this.update()}update(){this._enabled?(this._synchronizeMaps(this._loadingGraphics,{filter:r=>r.isFetching,symbols:this._loadingSymbols}),this._synchronizeMaps(this._loadedGraphics,{filter:r=>!r.isFetching,symbols:this._loadedSymbols}),this._synchronizeMaps(this._pendingGraphics,{filter:r=>!r.isFetching,symbols:this._pendingSymbols}),this.showDataExtent(this._tileFetcher.filterExtent)):(this._loadingGraphics.forEach(r=> {this._view.graphics.removeMany(r)}),this._loadingGraphics.clear(),this._loadedGraphics.forEach(r=>{this._view.graphics.removeMany(r)}),this._loadedGraphics.clear(),this._pendingGraphics.forEach(r=>{this._view.graphics.removeMany(r)}),this._pendingGraphics.clear(),this._dataExtentGraphic&&(this._view.graphics.remove(this._dataExtentGraphic),this._dataExtentGraphic=null))}showDataExtent(r){this._dataExtentGraphic&&(this._view.graphics.remove(this._dataExtentGraphic),this._dataExtentGraphic=null);null!= r&&(r=k.fromExtent(r),this._dataExtentGraphic=new q({geometry:r,symbol:this._dataExtentSymbol}),this._view.graphics.add(this._dataExtentGraphic))}_synchronizeMaps(r,n){const u=[];r.forEach((x,y)=>{const z=this._tileFetcher.test.getFeatureTileById(y);z&&n.filter(z)||(this._view.graphics.removeMany(x),u.push(y))});u.forEach(x=>r.delete(x));this._tileFetcher.test.forEachFeatureTile(x=>{if(n.filter(x)&&!r.has(x.id)){const [A,B,C]=x.descriptor.lij;this._tilingScheme.ensureMaxLod(A);var y=this._tilingScheme.getExtentGeometry(A, B,C),z=new q({geometry:y,symbol:n.symbols[A%n.symbols.length]});y=new q({geometry:y.center,symbol:new f({verticalOffset:new g({screenLength:40/.75}),callout:new t({color:new b("white"),border:new w({color:new b("black")})}),symbolLayers:new p([new e({text:`${A}/${B}/${C}`,halo:{color:"white",size:1/.75},material:{color:"black"},size:16})])})});z=[z,y];r.set(x.id,z);this._view.graphics.addMany(z)}})}}a.FeatureTileFetcher3DDebugger=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/FeatureLayerViewPerformanceInfo":function(){define(["exports", "./support/LayerViewPerformanceInfo"],function(a,b){class q extends b.LayerViewPerformanceInfo{constructor(l,p,k,h,f,c){super(l.usedMemory,l.displayedFeatures,l.totalFeatures,l.maximumFeatures,l.nodes,l.core);this.storedFeatures=p;this.totalVertices=k;this.partial=h;this.mode=f;this.symbolComplexity=c}}a.FeatureLayerViewPerformanceInfo=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DGraphicsPipeline":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Error ../../../../core/maybe ../../../../core/Promise ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/support/UpdatingHandles ../../../../layers/graphics/controllers/FeatureTileController3D ../../../../symbols/support/utils ./elevationAlignPointsInFeatures ./Graphics3DFeatureProcessor ./QueryEngine ./queryForSymbologySnapping ../support/HeatmapFeatureProcessor ../support/LayerViewPerformanceInfo ../../webgl-engine/lib/UpdatePolicy ../../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){a.Graphics3DGraphicsPipeline=class extends p.EsriPromise{constructor(B){super(B);this._dataUpdatingState=A.NONE;this.controller=null;this.updatingHandles=new d.UpdatingHandles;this._controllerCreated=!1;this._pendingController=null}initialize(){this.addResolvingPromise(this._initializeController());this.updatingHandles.add(()=>this.layer.renderer,C=>this._recreateProcessor(C),k.initial);this.updatingHandles.add(()=>this.updatePolicy,C=>this.processor.preferredUpdatePolicy= C);const B=()=>this.processor.featureStore;this.queryEngine=new r.QueryEngine({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return B()},hasZ:this.hasZ,hasM:this.hasM},priority:z.TaskPriority.FEATURE_QUERY_ENGINE})}destroy(){this.removeAllHandles();this.updatingHandles.destroy();this._destroyPendingController();this.controller=l.destroyMaybe(this.controller);this.processor=l.destroyMaybe(this.processor);this.queryEngine= l.destroyMaybe(this.queryEngine);this.loadedGraphics=null}_destroyPendingController(){this._pendingController=l.destroyMaybe(this._pendingController)}get updating(){return this.updatingHandles.updating||!this._controllerCreated||this.controller?.updating||this.processor?.updating}get legendEnabled(){return this.processor.legendEnabled}get layer(){return this.layerView.layer}get view(){return this.layerView.view}get hasZ(){return this.layerView.hasZ}get hasM(){return this.layerView.hasM}get fullOpacity(){return this.layerView.fullOpacity}get suspended(){return this.layerView.suspended}get filter(){return"filter"in this.layerView?this.layerView.filter:null}get slicePlaneEnabled(){return this.layerView.slicePlaneEnabled}get featureSpatialReference(){return"featureSpatialReference"in this.layerView?this.layerView.featureSpatialReference:null}get graphics3DProcessor(){return"graphics-3d"===this.processor?.type?this.processor:null}get heatmapProcessor(){return"heatmap"===this.processor?.type?this.processor:null}get hasAllFeatures(){return this.controller&&"hasAllFeatures"in this.controller?this.controller.hasAllFeatures: !1}get hasAllFeaturesInView(){return this.controller&&"hasAllFeaturesInView"in this.controller?this.controller.hasAllFeaturesInView:!1}get hasFullGeometries(){return this.controller&&"hasFullGeometries"in this.controller?this.controller.hasFullGeometries:!1}get symbologySnappingSupported(){return this.layer?.renderer?.getSymbols()?.some(w.symbolHasExtrudeSymbolLayer)??!1}get updatePolicy(){return y.UpdatePolicy.SYNC}get scaleVisibilitySuspended(){return this.processor?.scaleVisibilitySuspended}get timeExtent(){return"timeExtent"in this.layerView?this.layerView.timeExtent:null}get dataUpdating(){return this._dataUpdatingState!==A.NONE}get suspendInfo(){return this.processor?.suspendInfo??{}}forEachGraphic(B){this.loadedGraphics.forEach(B)}findGraphic(B){return this.loadedGraphics.find(B)}queryObjectIds(B,C){return this.layerView.queryObjectIds(B,C)}whenGraphicBounds(B,C){return this.processor?.whenGraphicBounds(B,C)}computeAttachmentOrigin(B,C){return this.processor?.computeAttachmentOrigin(B,C)}async elevationAlignPointsInFeatures(B, C){const D=this.graphics3DProcessor;if(null==D)throw new q("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return v.elevationAlignPointsInFeatures(this.view,this.layer,F=>D.getGraphics3DGraphicByObjectId(F),B,C)}async queryForSymbologySnapping(B,C){return this.symbologySnappingSupported?n.queryForSymbologySnapping(this.graphics3DProcessor,B,C):{candidates:[],sourceCandidateIndices:[]}}highlight(B){return this.processor.highlight(B,this.layer.objectIdField)}maskOccludee(B){return this.processor.maskOccludee(B)}async _initializeController(){const B= this.createController();this._pendingController=B;this._setupDataUpdating(B);await B.when();this._setControllerWhenInitialized(B)}_setupDataUpdating(B){"dataUpdating"in B&&this.addHandles([k.watch(()=>B.dataUpdating,C=>{C&&this._dataUpdatingState===A.NONE?this._dataUpdatingState=A.CONTROLLER:C||this._dataUpdatingState!==A.CONTROLLER||(this._dataUpdatingState=A.NONE)},k.sync),k.watch(()=>!!this.graphics3DProcessor?.dataUpdating,C=>{C&&this._dataUpdatingState===A.CONTROLLER?this._dataUpdatingState= A.CORE:C||this._dataUpdatingState!==A.CORE||(this._dataUpdatingState=B.dataUpdating?A.CONTROLLER:A.NONE)},k.sync)])}async _setControllerWhenInitialized(B){try{await this.when()}catch(C){}this._controllerCreated=!0;!this.isResolved()||this.destroyed?this._destroyPendingController():(await k.whenOnce(()=>this.view?.basemapTerrain?.ready),this.beforeSetController(B),this._pendingController=null,this.controller=B,this.loadedGraphics=B.graphics)}_recreateProcessor(B){var C="heatmap"===B?.type;const D= "heatmap"===this.processor?.type;B=this.processor;B&&C===D||(this.processor=C=C?new u.HeatmapFeatureProcessor({owner:this}):new m.Graphics3DFeatureProcessor({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:F=>this._updateClippingExtent(F)}),B?.destroy(),this.queryEngine?.clear(),this.addResolvingPromise(C.initializePromise))}_updateClippingExtent(B){this.clippingExtent= B;if(!this.controller)return!1;switch(this.controller.type){case "stream":return!1;case "feature-tile-3d":return this.controller.extent=B,!0}}get performanceInfo(){const B=this.controller instanceof t.FeatureTileController3D?this.controller:null;return new x.LayerViewPerformanceInfo(this.processor.usedMemory,this.loadedGraphics?.length,B?.serviceDataCount??-1,B?.maximumNumberOfFeatures??-1,0,this.processor.performanceInfo)}};b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"updating", null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"legendEnabled",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"layerView",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"layer",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"view",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasZ",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasM",null); b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"fullOpacity",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"suspended",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"filter",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"slicePlaneEnabled",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"featureSpatialReference",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype, "loadedGraphics",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"graphics3DProcessor",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"heatmapProcessor",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasAllFeatures",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasAllFeaturesInView",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasFullGeometries",null);b.__decorate([h.property()], a.Graphics3DGraphicsPipeline.prototype,"symbologySnappingSupported",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"updatePolicy",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"queryEngine",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"scaleVisibilitySuspended",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"timeExtent",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype, "_dataUpdatingState",void 0);b.__decorate([h.property({readOnly:!0})],a.Graphics3DGraphicsPipeline.prototype,"dataUpdating",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"controller",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"processor",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"updatingHandles",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"_controllerCreated",void 0);a.Graphics3DGraphicsPipeline= b.__decorate([g.subclass("esri.views.3d.layers.graphics.Graphics3DGraphicsPipeline")],a.Graphics3DGraphicsPipeline);var A;(function(B){B[B.NONE=0]="NONE";B[B.CONTROLLER=1]="CONTROLLER";B[B.CORE=2]="CORE"})(A||={});Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/elevationAlignPointsInFeatures":function(){define("exports ../../../../geometry ../../../../core/promiseUtils ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectPointToVector ../../../../layers/graphics/dehydratedPoint ../../../../support/elevationInfoUtils ./elevationAlignmentUtils ./ElevationContext ./featureExpressionInfoUtils ../../../../geometry/SpatialReference".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){a.elevationAlignPointsInFeatures=async function(d,t,w,v,m){const {elevationProvider:r,renderCoordsHelper:n}=d,{elevationInfo:u}=t,{pointsInFeatures:x,spatialReference:y}=v;var z=g.fromJSON(y);v=e.extractExpressionInfo(u,!0);v=await e.createContext(v,z,m);q.throwIfAborted(m);const A=[],B=new Set,C=new Set,D=new c.ElevationContext,F=k.makeDehydratedPoint(0,0,0,g.WGS84),H=new f.SampleElevationInfo,N=l.create();F.spatialReference=z;d=d.elevationProvider.spatialReference?? d.spatialReference;for(const {objectId:E,points:G}of x)if(z=w(E),null==z){for(const I of G)A.push(I.z??0);B.add(E)}else{z.isDraped&&C.add(E);D.setFromElevationInfo(h.getGeometryEffectiveElevationInfo(z.graphic.geometry,u));D.updateFeatureExpressionInfoContext(v,z.graphic,t);for(const {x:I,y:O,z:L}of G)F.x=I,F.y=O,F.z=L??0,await p.projectPointToVectorAsync(F,N,d,0,{signal:m}),f.evaluateElevationInfoAtPoint(N,r,D,n,H),A.push(H.z)}return{elevations:A,drapedObjectIds:C,failedObjectIds:B}};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DFeatureProcessor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../Graphic ../../../../arcade/functions/hash ../../../../core/Accessor ../../../../core/compilerUtils ../../../../core/handleUtils ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/accessorSupport/diffUtils ../../../../core/support/UpdatingHandles ../../../../geometry/support/webMercatorUtils ../../../../renderers/support/randomRotationExpression ../../../../renderers/support/renderingInfoUtils ../../../../rest/support/Query ../interfaces ./constants ./DisplayFeatureLimit ./Graphics3DCore ./Graphics3DElevationAlignment ./Graphics3DFrustumVisibility ./Graphics3DObjectStates ./Graphics3DScaleVisibility ./graphicUtils ../support/attributeUtils ../support/FeatureVisibilityFilter ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/UpdatePolicy".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O){a.Graphics3DFeatureProcessor=class extends p{constructor(L){super(L);this.type="graphics-3d";this._randomRotationRenderers=null;this._updatingHandles=new m.UpdatingHandles;this.timeExtentEnabled=this.elevationAlignmentEnabled=this.frustumVisibilityEnabled=this.filterVisibilityEnabled=this.scaleVisibilityEnabled=this.elevationFeatureExpressionEnabled=!1;this.setUidToIdOnAdd=!0;this.dataExtent=null;this.drapeSourceType=y.DrapeSourceType.Features; this.preferredUpdatePolicy=O.UpdatePolicy.ASYNC;this._suspendResumeExtent=null}initialize(){const L=this.owner,P=new B.Graphics3DCore({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:L.hasZ,hasM:L.hasM,setUidToIdOnAdd:this.setUidToIdOnAdd,componentFactories:{deconflictor:M=>L.view.deconflictor.addGraphicsOwner(M),labeler:(M,K)=>L.view.labeler.addGraphicsOwner(M,K),elevationAlignment:this.elevationAlignmentEnabled? (M,K)=>new C.Graphics3DElevationAlignment({graphicsCoreOwner:this,graphicsCore:M,queryGraphicUIDsInExtent:K,elevationProvider:L.view.elevationProvider}):null,scaleVisibility:this.scaleVisibilityEnabled?(M,K)=>new H.Graphics3DScaleVisibility({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:K,graphicsCore:M,basemapTerrain:L.view.basemapTerrain}):null,filterVisibility:(this.filterVisibilityEnabled||this.timeExtentEnabled)&&"multipatch"!==L.layer.geometryType?M=>new G.FeatureVisibilityFilter({context:{...M, configuration:L}}):null,objectStates:M=>new F.Graphics3DObjectStates(M)}});this._set("graphicsCore",P);this.frustumVisibilityEnabled&&this._set("frustumVisibility",new D.Graphics3DFrustumVisibility({graphicsCoreOwner:this}));this.elevationAlignment&&this._updatingHandles.add(()=>this.layer.elevationInfo,(M,K)=>{v.diff(M,K)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())});this._updatingHandles.add(()=>this.layer.labelsVisible,()=>this.graphicsCore.updateVisibilityInfo()); this._updatingHandles.add(()=>this.layer.labelingInfo,(M,K)=>{v.diff(M,K)&&this.graphicsCore.updateLabelingInfo()});this._updatingHandles.add(()=>this.preferredUpdatePolicy,M=>this.graphicsCore.preferredUpdatePolicy=M);this._set("initializePromise",this._initializeAsync());this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){await c.logOnError(this.graphicsCore.initializePromise);const L=this.owner;this._updatingHandles.add(()=>this.renderer,P=>this._updatingHandles.addPromise(this.graphicsCore.rendererChange(P))); this._updatingHandles.add(()=>L.fullOpacity,()=>this.graphicsCore.opacityChange());this._setupSuspendResumeExtent();this.updateClippingExtent&&(this._updatingHandles.add(()=>L.view.clippingArea,()=>this._updateClippingExtent()),this._updateClippingExtent());this.graphicsCore.startCreateGraphics();this.graphicsCore.labelsEnabled&&await c.logOnError(this.graphicsCore.updateLabelingInfo())}destroy(){this._updatingHandles.destroy();this._set("frustumVisibility",f.destroyMaybe(this.frustumVisibility)); this._set("graphicsCore",f.destroyMaybe(this.graphicsCore));this._set("owner",null)}get layer(){return this.owner.layer}get dataUpdating(){return this.graphicsCore?.dataUpdating??!1}get renderer(){const {renderer:L,objectIdField:P}=this.layer;if(!L||!P||"heatmap"===L.type||!L.visualVariables)return L;const M=L.visualVariables.findIndex(J=>"rotation"===J.type&&null!=J.valueExpression&&n.matchRandomRotationExpression(J.valueExpression)===P&&(null==J.axis||"heading"===J.axis)&&"geographic"===J.rotationType); if(0>M)return L;const K=L.clone();K.visualVariables.splice(M,1);this._randomRotationRenderers||(this._randomRotationRenderers=new WeakMap);this._randomRotationRenderers.set(K,P);return K}get scaleVisibility(){return this.graphicsCore?.scaleVisibility}get filterVisibility(){return this.graphicsCore?.filterVisibility}get elevationAlignment(){return this.graphicsCore?.elevationAlignment}get suspendResumeExtentMode(){return this.owner.suspendResumeExtentMode??"computed"}get scaleVisibilitySuspended(){return null!= this.scaleVisibility&&this.scaleVisibility.suspended}get suspended(){return this.owner.suspended}get legendEnabled(){return null==this.frustumVisibility||!this.frustumVisibility.suspended}get suspendInfo(){const L={};this.scaleVisibilitySuspended&&(L.outsideScaleRange=!0);null!=this.frustumVisibility&&this.frustumVisibility.suspended&&(L.outsideOfView=!0);return L}get updating(){return!!(this.graphicsCore?.updating||this.frustumVisibility?.updating||this._updatingHandles.updating)}get updatingRemaining(){return this.graphicsCore?.updatingRemaining?? 0}get featureStore(){return this.graphicsCore?.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner?.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}get featureSpatialReference(){return"featureSpatialReference"in this.owner?this.owner.featureSpatialReference:this.owner.view.spatialReference}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.graphicsCore?.symbolUpdateType}get displayFeatureLimit(){const L= this.view.quality,P=this.graphicsCore?.displayFeatureLimit;return 1===L?P:new A.DisplayFeatureLimit(P.maximumTotalNumberOfVertices,Math.ceil(P.maximumNumberOfFeatures*L),P.averageSymbolComplexity)}get usedMemory(){return this.graphicsCore?.usedMemory??0}get loadedFeatures(){return this.graphicsCore?.numberOfGraphics??0}get usedMemoryPerFeature(){return this.graphicsCore?.usedMemoryPerGraphic??0}get unprocessedMemoryEstimate(){return this.graphicsCore?.unprocessedMemoryEstimate??0}get performanceInfo(){return this.graphicsCore.performanceInfo}maskOccludee(L){const P= this.graphicsCore?.objectStates;if(!P)return h.makeHandle();const {set:M,handle:K}=P.acquireSet(I.Object3DState.MaskOccludee,null);P.setUid(M,L.uid);return K}highlight(L,P){const M=this.graphicsCore?.objectStates;if(!M)return h.makeHandle();if(L instanceof x){const {set:K,handle:J}=M.acquireSet(I.Object3DState.Highlight,P);this.owner.queryObjectIds(L).then(R=>M.setObjectIds(K,R));return J}if("number"===typeof L||"string"===typeof L||L instanceof q)return this.highlight([L],P);"toArray"in L&&(L=L.toArray()); if(Array.isArray(L)&&0E.attributeLookup(this.layer.fieldsIndex,K.attributes,P));else{L=L.map(R=>R.uid);const {set:K,handle:J}=M.acquireSet(I.Object3DState.Highlight,null);M.setUids(K,L);return J}if(Array.isArray(L)&&("number"===typeof L[0]||"string"===typeof L[0])){const {set:K,handle:J}=M.acquireSet(I.Object3DState.Highlight,P);M.setObjectIds(K,L);return J}}return h.makeHandle()}resetObjectStates(){this.graphicsCore?.objectStates?.reset()}whenGraphicBounds(L, P){return this.graphicsCore?.whenGraphicBounds(L,P)}computeAttachmentOrigin(L,P){return this.graphicsCore?.computeAttachmentOrigin(L,P)}notifyGraphicGeometryChanged(L){this.graphicsCore.notifyGraphicGeometryChanged(L)}notifyGraphicVisibilityChanged(L){this.graphicsCore.notifyGraphicVisibilityChanged(L)}getRenderingInfo(L,P,M){M=u.getRenderingInfo(L,{renderer:P,arcade:M});if(M?.color){const K=M.color;K[0]/=255;K[1]/=255;K[2]/=255}null!=M&&null!=P&&this._randomRotationRenderers?.has(P)&&(P=this._randomRotationRenderers.get(P), L=L.attributes[P],P=new l.XXH(0),P.updateFloatArray([L]),P.updateUint8Array([173]),M.heading=8.381E-8*P.digest());return M}getRenderingInfoAsync(L,P,M,K){return u.getRenderingInfoAsync(L,{renderer:P,arcade:M,...K})}getSymbolLayerSize(L,P){return this.graphicsCore?.getSymbolLayerSize(L,P)}setObjectIdVisibility(L,P){this.graphicsCore?.setObjectIdVisibility(L,P)}refreshFilter(){null!=this.filterVisibility&&this.filterVisibility.reapply()}getGraphics3DGraphicByObjectId(L){return this.graphicsCore?.getGraphics3DGraphicByObjectId(L)}_updateClippingExtent(){const L= this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(L,this.owner.view.spatialReference)&&(this.updateClippingExtent(L)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.addHandles(e.watch(()=>this.suspendResumeExtentMode,()=>{this.removeHandles("suspendResumeExtentMode");switch(this.suspendResumeExtentMode){case "computed":this.addHandles([e.watch(()=>this.graphicsCore.computedExtent,L=>this._updateSuspendResumeExtent(L), e.initial),e.watch(()=>this.graphicsCore.extentPadding,()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent))],"suspendResumeExtentMode");break;case "data":this.addHandles([e.when(()=>this.dataExtent,L=>this._updateSuspendResumeExtent(L),e.initial),e.watch(()=>this.graphicsCore.extentPadding,()=>this._updateSuspendResumeExtent(this.dataExtent))],"suspendResumeExtentMode");break;default:k.neverReached(this.suspendResumeExtentMode)}},e.initial))}_updateSuspendResumeExtent(L){L?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(L, this._suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(L,P){const M=this.owner.view.spatialReference;if(!L.spatialReference.equals(M)){if(!r.canProject(L,M))return;L=r.project(L,M)}return N.enlargeExtent(L,P,z.suspendResumeExtentOptimism,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(L){null!=this.frustumVisibility&&this.frustumVisibility.setExtent(L);null!=this.scaleVisibility&&this.scaleVisibility.setExtent(L)}};b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype, "type",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"owner",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"layer",null);b.__decorate([g.property({readOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"dataUpdating",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"renderer",null);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"updateClippingExtent",void 0);b.__decorate([g.property({constructOnly:!0})], a.Graphics3DFeatureProcessor.prototype,"elevationFeatureExpressionEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"graphicsCore",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"scaleVisibilityEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"filterVisibilityEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype, "frustumVisibilityEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"elevationAlignmentEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"timeExtentEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"setUidToIdOnAdd",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"scaleVisibility",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype, "filterVisibility",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"elevationAlignment",null);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"frustumVisibility",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"initializePromise",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"suspendResumeExtentMode",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"dataExtent", void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"scaleVisibilitySuspended",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"suspended",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"legendEnabled",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"suspendInfo",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"updating",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype, "updatingRemaining",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"featureStore",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"view",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"loadedGraphics",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"fullOpacity",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"filter",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype, "slicePlaneEnabled",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"drapeSourceType",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"updatePolicy",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"preferredUpdatePolicy",void 0);b.__decorate([g.property({readOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"displayFeatureLimit",null);a.Graphics3DFeatureProcessor=b.__decorate([w.subclass("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")], a.Graphics3DFeatureProcessor);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/hash":function(){define(["exports"],function(a){function b(l){const p=[];for(let k=0,h=l.length;kf?p.push(f):2048>f?p.push(192|f>>6,128|f&63):55296>f||57344<=f?p.push(224|f>>12,128|f>>6&63,128|f&63):(k++,f=65536+((f&1023)<<10|l.charCodeAt(k)&1023),p.push(240|f>>18,128|f>>12&63,128|f>>6&63,128|f&63))}return new Uint8Array(p)}class q{constructor(l){this._seed= l;this._totallen=0;this._bufs=[];this.init()}init(){this._bufs=[];this._totallen=0;return this}updateFloatArray(l){const p=[];for(const k of l)isNaN(k)?p.push("NaN"):Infinity===k?p.push("Infinity"):-Infinity===k?p.push("-Infinity"):0===k?p.push("0"):p.push(k.toString(16));this.update(b(p.join("")))}updateIntArray(l){l=Int32Array.from(l);this.update(new Uint8Array(l.buffer))}updateUint8Array(l){this.update(Uint8Array.from(l))}updateWithString(l){return this.update(b(l))}update(l){this._bufs.push(l); this._totallen+=l.length;return this}digest(){const l=new Uint8Array(this._totallen);let p=0;for(const k of this._bufs)l.set(k,p),p+=k.length;this.init();return this._xxHash32(l,this._seed)}_xxHash32(l,p=0){var k=p+374761393&4294967295;let h=0;if(16<=l.length){k=[p+2654435761+2246822519&4294967295,p+2246822519&4294967295,p+0&4294967295,p-2654435761&4294967295];p=l.length-16;var f=0;for(h=0;(h&4294967280)<=p;h+=4){var c=h;c=k[f]+(2246822519*(l[c]+(l[c+1]<<8))+(2246822519*(l[c+2]+(l[c+3]<<8))<<16))& 4294967295;c=c<<13|c>>>19;k[f]=2654435761*(c&65535)+(2654435761*(c>>>16)<<16)&4294967295;f=f+1&3}k=(k[0]<<1|k[0]>>>31)+(k[1]<<7|k[1]>>>25)+(k[2]<<12|k[2]>>>20)+(k[3]<<18|k[3]>>>14)&4294967295}k=k+l.length&4294967295;for(p=l.length-4;h<=p;h+=4)f=h,k=k+(3266489917*(l[f]+(l[f+1]<<8))+(3266489917*(l[f+2]+(l[f+3]<<8))<<16))&4294967295,k=k<<17|k>>>15,k=668265263*(k&65535)+(668265263*(k>>>16)<<16)&4294967295;for(;h>>21,k=2654435761*(k&65535)+(2654435761*(k>>>16)<< 16)&4294967295;k^=k>>>15;k=(2246822519*(k&65535)&4294967295)+(2246822519*(k>>>16)<<16);k^=k>>>13;k=(3266489917*(k&65535)&4294967295)+(3266489917*(k>>>16)<<16);k^=k>>>16;return 0>k?k+4294967296:k}}a.XXH=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/DisplayFeatureLimit":function(){define(["exports"],function(a){class b{constructor(q,l,p){this.maximumTotalNumberOfVertices=q;this.maximumNumberOfFeatures=l;this.averageSymbolComplexity=p}}a.DisplayFeatureLimit= b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DCore":function(){define("exports ../../../../chunks/tslib.es6 ../../../../geometry ../../../../renderers/ClassBreaksRenderer ../../../../renderers/DictionaryRenderer ../../../../renderers/DotDensityRenderer ../../../../renderers/HeatmapRenderer ../../../../renderers/PieChartRenderer ../../../../renderers/Renderer ../../../../renderers/SimpleRenderer ../../../../renderers/UniqueValueRenderer ../../../../renderers/support/jsonUtils ../../../../core/Logger ../../../../symbols ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/has ../../../../core/Error ../../../../core/handleUtils ../../../../core/MapUtils ../../../../core/maybe ../../../../core/MemCache ../../../../core/PooledArray ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/scheduling ../../../../core/accessorSupport/decorators/property ../../../../core/accessorSupport/decorators/subclass ../../../../core/accessorSupport/diffUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection ../../../../geometry/projection/projectBuffer ../../../../geometry/projection/projectVectorToVector ../../../../geometry/projection/projectXYZToVector ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../../../layers/Layer ../../../../layers/graphics/dehydratedFeatures ../../../../layers/graphics/hydratedFeatures ../../../../layers/support/PromiseQueue ../../../../renderers/support/rendererConversion ../../../../support/arcadeOnDemand ../../../../support/basemapUtils ../../../../symbols/support/defaults3D ../../../../symbols/support/symbolConversion ./defaultSymbolComplexity ./DisplayFeatureLimit ./ElevationQuery ./enums ./featureExpressionInfoUtils ./Graphics3DFeatureStore ./Graphics3DGraphicCreationContext ./Graphics3DSymbolCreationContext ./Graphics3DSymbolFactory ./Graphics3DWebStyleSymbol ./GraphicsCorePerformanceInfo ./GraphicStateTracking ./graphicUtils ./interfaces ./Loadable ./SpatialIndex2D ./symbolMemory ../support/StageLayerElevationProvider ../../support/extentUtils ../../support/PropertiesPool ../../webgl-engine/lib/GridLocalOriginFactory ../../webgl-engine/lib/UpdatePolicy ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/lib/WebGLLayer ../../../layers/support/popupUtils ../../../support/Scheduler ../../../support/Yield ../../../../geometry/Extent ../../../../geometry/Point ../../../../symbols/LabelSymbol3D ../../../../symbols/TextSymbol ../../../../symbols/WebStyleSymbol".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va,za,ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua,Na,Ua,wa,sa,Ha,Ka,Aa,Sa){var Ya;const qa=G.create(),aa=M.create();a.Graphics3DCore=Ya=class extends v{get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){this._spatialIndex||(this._spatialIndex=new Da.SpatialIndex2D({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference, hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values())));this._spatialIndex.update();return this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return null!=this.currentRenderer&&"dictionary"===this.currentRenderer.type?Qa.UpdatePolicy.ASYNC:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating|| this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this.running)}get dataUpdating(){return!!(0=pa.verticesPerFeature||Ba.verticesPerCoordinate>=pa.verticesPerCoordinate||Ba.drawCallsPerFeature>=pa.drawCallsPerFeature)||Ba.verticesPerFeature===pa.verticesPerFeature&&Ba.verticesPerCoordinate===pa.verticesPerCoordinate&&Ba.drawCallsPerFeature===pa.drawCallsPerFeature)?Ba:pa}get usedMemory(){const pa=null!=this.averageSymbolComplexity&& this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this._numberOfGraphics:0,Ba=this._getSymbolComplexitiesUsed().reduce((ib,La)=>ib+La.memory.resourceBytes,0);if(null==this._symbolMaterials){this._symbolMaterials=[];for(var Ia of this._symbols.values())if(null!=Ia)for(const ib of Ia.symbolLayers)if(ib)for(const La of ib.materials)La&&this._symbolMaterials.push(La)}const Wa=this.owner.view._stage.renderer.plugins,gb=this.owner.view.basemapTerrain.overlayManager.renderer;Ia= this._symbolMaterials.reduce((ib,La)=>ib+((Wa.getMaterialRenderer(La)||gb.getMaterialRenderer(La))?.usedMemory??0),0);return this._usedMemory+pa+Ba+Ia}get usedMemoryPerGraphic(){return this._usedMemory&&this._numberOfGraphics?this._usedMemory/this._numberOfGraphics*(this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves))):null!=this.averageSymbolComplexity?this.averageSymbolComplexity.memory.bytesPerFeature+(this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel: 0):0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(pa){if("web-style"===pa.type)return pa.clone();var Ba=this._symbolConversionCache.get(pa.id);if(null!=Ba)return Ba;Ba=ba.to3D(pa,{geometryType:this.layer?.geometryType??void 0,retainId:!0, hasLabelingContext:this._hasLabelingContext(pa),cimFallbackEnabled:!0});const Ia=Ba.symbol||null;null==Ia&&Ba.error&&t.getLogger(this).error(Ba.error.message);this._symbolConversionCache.set(pa.id,Ia);return Ia}_getSymbolComplexitiesUsedOrRenderer(pa){if(null==pa)return[];var Ba=pa.getSymbols(),Ia="backgroundFillSymbol"in pa?pa.backgroundFillSymbol:null;if(!Ia&&!Ba?.length)return[];pa=[];Ia=this._getSymbolComplexityUsedOrRenderer(Ia);null!=Ia&&pa.push(Ia);for(const Wa of Ba)Ba=this._getSymbolComplexityUsedOrRenderer(Wa), null!=Ba&&pa.push(Ba);return pa}_getSymbolComplexityUsedOrRenderer(pa){if(null==pa)return null;const Ba=this._symbols.get(pa.id);if(null!=Ba)return Ba.complexity;pa=this._getConvertedSymbol(pa);return null!=pa?U.defaultSymbolComplexity(pa):null}_getSymbolComplexitiesUsed(){const pa=[];this._symbols.forEach(Ba=>{null!=Ba&&pa.push(Ba.complexity)});return pa}get _objectIdField(){return this.layer.objectIdField}constructor(pa){super(pa);this._propertiesPool=new Ga.PropertiesPool({computedExtent:sa},this); this.currentRenderer=this.computedExtent=null;this.rendererHasGeometryOperations=!1;this._graphicStateTracking=null;this.graphics3DGraphics=new Map;this.stage=this.stageLayer=null;this._graphicsDrapedUids=new Set;this._graphicsBySymbol=new Map;this._symbolConversionCache=new Map;this._symbols=new Map;this._graphicsWithoutSymbol=new Map;this._graphicsWaitingForSymbol=new Map;this._graphicsUpdateId=0;this._frameTaskHandle=Ua.ImmediateTask;this._dataUpdateQueue=new S.PromiseQueue;this._updateQueue=new S.PromiseQueue; this._suspendSymbolCleanup=!1;this._spatialIndex=this._filterVisibility=this._scaleVisibility=this._elevationAlignment=this._initializeAbortController=this._elevationInfoChangeAbortController=this._rendererChangeAbortController=this._arcadeOnDemand=null;this.extentPadding=0;this._sharedSymbolResourcesOwnerHandle=this._stageLayerElevationProvider=this._viewElevationProvider=this._objectStates=this._labeler=this._deconflictor=this._featureStore=this._updatingPendingLoadedGraphicsChange=null;this._whenGraphics3DGraphicRequests= {};this._pendingUpdates=new Map;this._pendingRemoves=this._pendingAdds=this._numberOfGraphicsProvidingElevation=this._numberOfGraphics=0;this._applyPendingRemovesFirst=!1;this._loadingSymbols=0;this._pendingUpdatesPool=new A({allocator:Ba=>Ba||new Ta,deallocator:Ba=>{Ba.clear();return Ba}});this._geometryWarningLogged=this._symbolWarningLogged=!1;this._objectIdInvisibleSet=new Set;this._whenSymbolRemoved=new A;this.preferredUpdatePolicy=Qa.UpdatePolicy.SYNC;this._forcedUpdatePolicy=null;this.elevationFeatureExpressionEnabled= !0;this.layer=this.owner=null;this.graphicSymbolSupported=!0;this.getRenderingInfoWithoutRenderer=!1;this.setUidToIdOnAdd=!0;this.hasM=this.hasZ=null;this._usedMemory=0;this._startCreateGraphics=this._visible=!1;this._unusedSymbolsCache=pa.owner.view.resourceController.memoryController.newCache("graphics-3d-unused-symbols",Ba=>Ba.destroy());this.symbolCreationContext=new fa.Graphics3DSymbolCreationContext(pa.owner.view.resourceController.scheduler,(Ba,Ia)=>this._updateQueue.push(Ba,Ia))}initialize(){this._featureStore= new ia.Graphics3DFeatureStore({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:Ia=>this.graphics3DGraphics.forEach(Ia)});const pa=(Ia,Wa,gb)=>this.spatialIndex.queryGraphicUIDsInExtent(Ia,Wa,gb),{componentFactories:Ba}=this;this._elevationAlignment=Ba.elevationAlignment?.(this,pa);this._scaleVisibility=Ba.scaleVisibility?.(this, pa);this._filterVisibility=Ba.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:Ia=>this.modifyGraphics3DGraphicVisibilities(Wa=>Wa.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.FILTER,Ia(Q.getObjectId(Wa.graphic,this._objectIdField)))),setAllFeaturesVisibility:Ia=>this.modifyGraphics3DGraphicVisibilities(Wa=>Wa.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.FILTER,Ia)),clearFeaturesVisibility:()=> this.modifyGraphics3DGraphicVisibilities(Ia=>Ia.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.FILTER,!0))});this._deconflictor=Ba.deconflictor?.(this);this._labeler=Ba.labeler?.(this,this._scaleVisibility);this._objectStates=Ba.objectStates?.(this);this._initializeAbortController=new AbortController;this._initializePromise=this._initializeAsync()}async _initializeAsync(){const pa=this._initializeAbortController?.signal,Ba=this.owner.view;this._viewElevationProvider=new ca.ViewElevationProvider(this._viewSpatialReference, Ba);this._initializeStage(Ba,this.layer.uid);var Ia=Ba.sharedSymbolResources;this.symbolCreationContext.sharedResources=Ia;this._sharedSymbolResourcesOwnerHandle=Ia.addGraphicsOwner(this.owner);null!=this.currentRenderer&&(this.symbolCreationContext.renderer=this.currentRenderer);this.symbolCreationContext.stage=this.stage;this.symbolCreationContext.streamDataRequester=Ia.streamDataRequester;this.symbolCreationContext.renderCoordsHelper=Ba.renderCoordsHelper;this.symbolCreationContext.layer=this.layer; this.symbolCreationContext.graphicsCoreOwner=this.owner;this.symbolCreationContext.localOriginFactory=new Pa.GridLocalOriginFactory(Ba.renderSpatialReference);this.symbolCreationContext.elevationProvider=Ba.elevationProvider;this.symbolCreationContext.notifyGraphicGeometryChanged=Wa=>this.notifyGraphicGeometryChanged(Wa);this.symbolCreationContext.notifyGraphicVisibilityChanged=Wa=>this.notifyGraphicVisibilityChanged(Wa);Ia=da.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled); this.symbolCreationContext.featureExpressionInfoContext=await da.createContext(Ia,this._viewSpatialReference,pa,t.getLogger(this));B.throwIfAborted(pa);this.symbolCreationContext.screenSizePerspectiveEnabled=Ba.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled;this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled;this.symbolCreationContext.skipHighSymbolLods= !!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods;if("drapeSourceType"in this.owner){const {owner:Wa}=this;this.symbolCreationContext.drapeSourceRenderer=Ba.basemapTerrain.overlayManager.registerGeometryDrapeSource(Wa);this.addHandles(u.makeHandle(()=>Ba.basemapTerrain.overlayManager.unregisterDrapeSource(Wa)))}this.addHandles([C.watch(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(B.ignoreAbortErrors)),C.watch(()=>[this.layer?.screenSizePerspectiveEnabled, this.owner.view?.screenSizePerspectiveEnabled],()=>{const Wa=Ba.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;Wa!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=Wa,this._labeler?.reset(),this.recreateAllGraphicsAndSymbols())}),C.watch(()=>this.owner.slicePlaneEnabled,Wa=>this._slicePlaneEnabledChange(!!Wa)),C.watch(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),C.watch(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled, Wa=>this._physicalBasedRenderingChange(Wa)),C.watch(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,Wa=>this._skipHighSymbolLoDsChange(Wa)),C.when(()=>Ba.basemapTerrain?.tilingScheme,Wa=>{Wa.spatialReference.equals(this.symbolCreationContext.overlaySR)||null==Ba.basemapTerrain.spatialReference||(this.symbolCreationContext.overlaySR=Ba.basemapTerrain.spatialReference);this.hasHandles("loaded-graphics")?this.recreateAllGraphics():this.addHandles([C.on(()=>this.owner?.loadedGraphics, "change",gb=>{this._graphicsCollectionChanged(gb);this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics();this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")},{initial:!0}),C.watch(()=>this.effectiveUpdatePolicy,Wa=>{null!=this.stageLayer&&(this.stageLayer.updatePolicy=Wa);this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===Qa.UpdatePolicy.ASYNC;Wa===Qa.UpdatePolicy.SYNC&&this.runTask(Ua.noBudget)},C.syncAndInitial)]); this._frameTaskHandle=Ba.resourceController.scheduler.registerTask(Ua.TaskPriority.GRAPHICS_CORE,this);this.layer&&"featureReduction"in this.layer&&this.addHandles(C.watch(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange()));this.notifyChange("averageSymbolComplexity");this.rendererChange(this.owner.renderer).catch(()=>{});this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController&&(this._initializeAbortController.abort(),this._initializeAbortController= null)}destroy(){this._unusedSymbolsCache.destroy();this._abortInitialize();this._abortRendererChange();this._abortElevationInfoChange();this._frameTaskHandle.remove();this._frameTaskHandle=Ua.ImmediateTask;this._dataUpdateQueue.cancelAll();this._updateQueue.cancelAll();this._deconflictor=y.removeMaybe(this._deconflictor);this._labeler=y.removeMaybe(this._labeler);this._elevationAlignment=y.destroyMaybe(this._elevationAlignment);this._scaleVisibility=y.destroyMaybe(this._scaleVisibility);this._filterVisibility= y.destroyMaybe(this._filterVisibility);this._objectStates=y.destroyMaybe(this._objectStates);this.clear();this._featureStore=y.destroyMaybe(this._featureStore);this._updatingPendingLoadedGraphicsChange=y.removeMaybe(this._updatingPendingLoadedGraphicsChange);this._graphicStateTracking=y.destroyMaybe(this._graphicStateTracking);this.stage&&(this.stageLayer=y.destroyMaybe(this.stageLayer),this.stage=null);this._set("owner",null);for(const pa in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[pa].reject(new n("graphic:layer-destroyed", "Layer has been destroyed"));this._whenGraphics3DGraphicRequests=null;this._sharedSymbolResourcesOwnerHandle=y.removeMaybe(this._sharedSymbolResourcesOwnerHandle);this._propertiesPool=y.destroyMaybe(this._propertiesPool);this._pendingUpdatesPool=null;this._symbolConversionCache.clear();this._objectIdInvisibleSet.clear();this._spatialIndex=y.destroyMaybe(this._spatialIndex)}clear(){this._objectStates?.allGraphicsDeleted();null!=this._graphicStateTracking&&this._graphicStateTracking.allGraphicsDeleted(); this.graphics3DGraphics.forEach(pa=>pa.destroy());this._spatialIndex?.clear();this.graphics3DGraphics.clear();this._usedMemory=this._numberOfGraphics=0;this._updateLayerVisibility();this._symbols.forEach(y.destroyMaybe);this._symbols.clear();this._symbolMaterials=null;this._graphicsBySymbol.clear();this._graphicsWithoutSymbol.clear();this._graphicsWaitingForSymbol.clear();this._pendingUpdates.clear();this._pendingUpdatesPool.clear();this._pendingRemoves=this._pendingAdds=0;this._applyPendingRemovesFirst= !1;this.notifyChange("dataUpdating");this.notifyChange("running");this.notifyChange("updatingRemaining");this._featureStore.events.emit("changed")}_initializeStage(pa,Ba){this.stage=pa._stage;this.stageLayer=new ua.WebGLLayer(this.stage,{pickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},Ba);pa=this.stageLayer.events;pa.on("transformationChanged",Ia=>this.notifyGraphicGeometryChanged(Ia.graphicUid));pa.on("shaderTransformationChanged",Ia=>this.notifyGraphicGeometryChanged(Ia.graphicUid)); pa.on("visibilityChanged",Ia=>this.notifyGraphicVisibilityChanged(Ia.graphicUid));pa.on("geometryAdded",Ia=>this.notifyGraphicGeometryChanged(Ia.object.graphicUid));pa.on("geometryRemoved",Ia=>this.notifyGraphicGeometryChanged(Ia.object.graphicUid));pa.on("attributesChanged",Ia=>Ea.affectsGeometry(Ia.attribute)&&this.notifyGraphicGeometryChanged(Ia.object.graphicUid))}notifyGraphicGeometryChanged(pa){null!=this._graphicStateTracking&&null!=pa&&(pa=this.graphics3DGraphics.get(pa))&&this._graphicStateTracking.updateGraphicGeometry(pa)}notifyGraphicVisibilityChanged(pa){null!= this._graphicStateTracking&&null!=pa&&(pa=this.graphics3DGraphics.get(pa))&&this._graphicStateTracking.updateGraphicVisibility(pa)}_updateLayerVisibility(){var pa=this._numberOfGraphics>10*this.displayFeatureLimit.maximumNumberOfFeatures;pa=!this.suspendedOrOutsideOfView&&!pa;pa!==this._visible&&((this._visible=pa)?(this.stageLayer.pickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.pickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.visible= this._visible&&(null==this.layer.opacity||0{if(Ia){var Wa= this._getGraphicObjectID(Ia.graphic,pa);null!=Wa&&Ba.set(Wa,Ia)}});return Ba}}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(pa){const Ba=this._deconflictor?.labelingInfoChange(pa);pa=this._labeler?.labelingInfoChange(pa);await Promise.allSettled([Ba,pa])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange();this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(0{if(null!=Ia){Ia=Ia.getFastUpdateStatus();if(0this._getGraphicObjectID(Ba.graphic)===pa)}_updateUserVisibility(pa){if(null==pa)return!1;var Ba=pa.graphic;const Ia=this._getGraphicObjectID(Ba);Ba=Ba.visible&&!this.owner.suspended&&(null==Ia||!this._objectIdInvisibleSet.has(Ia));return pa.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.USER, Ba)}_whenGraphics3DGraphic(pa){var Ba=this.graphics3DGraphics.get(pa.uid);if(Ba)return Promise.resolve(Ba);if(Ba=this._whenGraphics3DGraphicRequests[pa.uid])return Ba.promise;Ba=B.createResolver();this._whenGraphics3DGraphicRequests[pa.uid]=Ba;return Ba.promise}async _boundsForGraphics3DGraphic(pa,Ba){const Ia=this._viewSpatialReference,Wa=this.owner.view.renderSpatialReference,gb=this.owner.view.basemapTerrain.spatialReference;pa=await pa.getProjectedBoundingBox((La,Xa,eb)=>O.projectBuffer(La,Wa, Xa,La,Ia,Xa,eb),(La,Xa,eb)=>O.projectBuffer(La,gb,Xa,La,Ia,Xa,eb),this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:null!=Ba?!!Ba.useViewElevation:!1,minDemResolution:null!=Ba?Ba.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,Ba?.signal);if(!pa)return null;Ba=pa.boundingBox;if(pa.requiresDrapedElevation){var ib=this.symbolCreationContext.elevationProvider;ib&&(M.center(Ba,qa),ib=ib.getElevation(qa[0],qa[1],0,Ia,"ground")??0,Ba[2]=Math.min(Ba[2], ib),Ba[5]=Math.max(Ba[5],ib))}return{boundingBox:Ba,screenSpaceObjects:pa.screenSpaceObjects}}async whenGraphicBounds(pa,Ba){await C.whenOnce(()=>this.owner?.loadedGraphics);const Ia=this.owner.layer?.objectIdField;var Wa=this.owner.loadedGraphics.find(gb=>gb===pa?!0:null!=Ia&&null!=gb.attributes&&pa.attributes&&gb.attributes[Ia]===pa.attributes[Ia]);if(!Wa)throw new n("internal:graphic-not-part-of-view","Graphic is not part of this view");Wa=await this._whenGraphics3DGraphic(Wa);return this._boundsForGraphics3DGraphic(Wa, Ba)}computeAttachmentOrigin(pa,Ba){pa=this.graphics3DGraphics.get(pa.uid);if(!pa)return null;var Ia=pa.computeAttachmentOrigin();if(0===Ia.render.num&&0===Ia.draped.num)return null;E.set(Ra,0,0,0);pa=0;if(0null!=Ba.newValue&&null!=pa&&pa.graphics3DSymbol.updateGeometry(pa,Ba.newValue)&&(this._labeler?.updateGraphicGeometry(pa)??!0)?(this._labeler?.setDirty(),!0):!1);const Ia=Ba.graphic.geometry;null!=Ia&&this._expandComputedExtent(Ia)}_graphicUpdateTransformHandler(pa,Ba){const Ia=Ba.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(pa, Ba,()=>null!=Ba.newValue&&null!=pa&&null!=Ia&&pa.graphics3DSymbol.updateTransform(pa,Ia.spatialReference,Ba.newValue,Ba.action))}_graphicUpdateGeometryOrTransformHandler(pa,Ba,Ia){if(null==Ba.graphic.geometry)this._recreateGraphic(Ba.graphic);else if(null==pa){if(pa=Ba.graphic.symbol?.id)if(pa=this._symbols.get(pa),null!=pa&&pa.loadStatus===ya.LoadStatus.LOADING)return;this._recreateGraphic(Ba.graphic)}else Ia()||this._recreateGraphic(pa.graphic)}_graphicUpdateSymbolHandler(pa,Ba){var Ia=Ba.graphic; const Wa=null!=pa?pa.graphics3DSymbol:null!=Ba.oldValue?this._symbols.get(Ba.oldValue.id):null;if(null==Wa||null==Ba.newValue)this._recreateGraphic(Ia);else{var gb=Wa.symbol;Ba=this._getConvertedSymbol(Ba.newValue);if(null!=Ba&&(Ba.type!==gb.type||"web-style"===Ba.type)||"web-style"===gb.type)this._recreateGraphic(Ia);else{var ib=this._graphicsBySymbol.get(gb.id);if(ib&&1!==ib.size)this._recreateGraphic(Ia);else if(ib=N.diff(gb,Ba),null==ib)this._updateSymbolMapping(gb.id,Ba);else if(ib={diff:ib, graphics3DGraphicPatches:[],symbolStatePatches:[]},Wa.prepareSymbolPatch(ib),N.isEmpty(ib.diff)){var La=this._getRenderingInfo(Ia);if(null==La)this._recreateGraphic(Ia);else{Ia=Wa.extentPadding;for(const Xa of ib.symbolStatePatches)Xa();Ia!==Wa.extentPadding&&this._recomputeExtentPadding();if(null!=pa)for(const Xa of ib.graphics3DGraphicPatches)Xa(pa,La);this._updateSymbolMapping(gb.id,Ba)}}else this._recreateGraphic(Ia)}}}_graphicUpdateVisibleHandler(pa){this._updateUserVisibility(pa)&&(this._labeler?.setDirty(), this._deconflictor?.setDirty())}recreateGraphics(pa){this._suspendSymbolCleanup=!0;this.remove(pa);this.add(pa);this._suspendSymbolCleanup=!1;this.effectiveUpdatePolicy===Qa.UpdatePolicy.SYNC&&this._cleanupSymbols()}_recreateGraphic(pa){this.recreateGraphics([pa])}_beginGraphicUpdate(pa){const Ba=this._graphicsUpdateId;this._graphicsUpdateId++;this._graphicsWaitingForSymbol.set(pa.uid,Ba);1===this._graphicsWaitingForSymbol.size&&this.notifyChange("dataUpdating");return Ba}_endGraphicUpdate(pa){pa&& (this._graphicsWaitingForSymbol.delete(pa.uid),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating")))}_recomputeExtentPadding(){let pa=0;this._symbols.forEach(Ba=>{null!=Ba&&(pa=Math.max(pa,Ba.extentPadding))});this._set("extentPadding",pa)}_expandComputedExtent(pa){var Ba=pa.spatialReference;Q.computeAABB(pa,aa);pa=this._viewSpatialReference;var Ia=Ya.tmpVec;!J.equals(Ba,pa)&&P.projectXYZToVector(aa[0],aa[1],0,Ba,Ia,pa)&&(aa[0]=Ia[0],aa[1]=Ia[1],P.projectXYZToVector(aa[3], aa[4],0,Ba,Ia,pa),aa[3]=Ia[0],aa[4]=Ia[1]);if(isFinite(aa[0])&&isFinite(aa[3])&&isFinite(aa[1])&&isFinite(aa[4])){Ba=this.computedExtent;Ia=null;var Wa=isFinite(aa[2])&&isFinite(aa[5]),gb=Wa&&(null==Ba?.zmin||aa[2]Ba.zmax);if(Ba){if(aa[0]Ba.xmax||aa[4]>Ba.ymax||gb||Wa)Ia=this._propertiesPool.get("computedExtent"),Ia.xmin=Math.min(aa[0],Ba.xmin),Ia.ymin=Math.min(aa[1],Ba.ymin),Ia.xmax=Math.max(aa[3],Ba.xmax),Ia.ymax=Math.max(aa[4], Ba.ymax),Ia.spatialReference=pa}else Ia=this._propertiesPool.get("computedExtent"),Ia.xmin=aa[0],Ia.ymin=aa[1],Ia.xmax=aa[3],Ia.ymax=aa[4],Ia.spatialReference=pa;Ia&&(gb&&(Ia.zmin=aa[2]),Wa&&(Ia.zmax=aa[5]),this._set("computedExtent",Ia))}}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&(this._elevationInfoChangeAbortController.abort(),this._elevationInfoChangeAbortController=null)}async elevationInfoChange(){this._abortElevationInfoChange();const pa=new AbortController;this._elevationInfoChangeAbortController= pa;const Ba=da.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await da.createContext(Ba,this._viewSpatialReference,pa.signal,t.getLogger(this));B.throwIfAborted(pa.signal);this._elevationInfoChangeAbortController=null;this._labeler?.elevationInfoChange();this.forEachGraphics3DSymbol((Ia,Wa,gb)=>{Ia.globalPropertyChanged("elevationInfo",Wa)?Wa.forEach(ib=>{const La=ib.graphic;ib=ib.labelLayers;for(const Xa of ib)Xa.graphics3DSymbolLayer.updateGraphicElevationContext(La, Xa)}):this._recreateSymbol(gb)});this.updateStageLayerElevationProvider();this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){if(this._stageLayerElevationProvider){if(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this._numberOfGraphicsProvidingElevation)this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=y.disposeMaybe(this._stageLayerElevationProvider)}else(!this.layer.elevationInfo|| this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&0{const ib=Wa.usedMemory;this._conditionalRemove(Wa,gb);this._spatialIndex?.remove(Wa);Ia.push(Wa.graphic);Wa.destroy();this._removeGraphics3DGraphic(gb,ib);this._updateLayerVisibility();this._featureStore.events.emit("changed")}),this._graphicsBySymbol.set(pa,new Map));Ba=this._symbols.get(pa);y.destroyMaybe(Ba);this._symbols.delete(pa);this._symbolMaterials=null;this.add(Ia)}_recreateGraphicsForSymbol(pa){if(pa=this._graphicsBySymbol.get(pa)){const Ba= [];pa.forEach(Ia=>Ba.push(Ia.graphic));this.recreateGraphics(Ba)}}_conditionalRemove(pa,Ba){this._graphicsDrapedUids.delete(Ba);this._objectStates?.removeGraphic(pa);this._labeler?.removeGraphic(pa);this._deconflictor?.removeGraphic(pa);null!=this._graphicStateTracking&&this._graphicStateTracking.removeGraphic(pa)}add(pa){pa&&0!==pa.length&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(pa)===Qa.UpdatePolicy.ASYNC?this._addDelayed(pa):this._addImmediate(pa),this.notifyChange("dataUpdating")): t.getLogger(this).error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(pa){if(this.effectiveUpdatePolicy===Qa.UpdatePolicy.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const Ba of pa)if(null!=Ba.geometry&&"mesh"===Ba.geometry.type&&!Ba.geometry.loaded)return Qa.UpdatePolicy.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(pa){this._symbolWarningLogged=this._geometryWarningLogged=!1;for(const Ba of pa)this._addGraphic(Ba, this._getRenderingInfo(Ba,t.getLogger(this)),Qa.UpdatePolicy.SYNC);this._cleanupSymbols();this._labeler?.setDirty();this._deconflictor?.setDirty()}_addDelayed(pa){for(const Ba of pa){pa=Ba.uid;let Ia=this._pendingUpdates.get(pa);Ia?Ia.add?Ia.state!==Ja.NEW&&Ia.abortController?.abort():this._pendingAdds++:(Ia=this._pendingUpdatesPool.pushNew(),this._pendingAdds++,this._pendingUpdates.set(pa,Ia));Ia.add=Ba}this.notifyChange("running");this.notifyChange("updatingRemaining");this.notifyChange("dataUpdating")}remove(pa){this.effectiveUpdatePolicy=== Qa.UpdatePolicy.ASYNC?this._removeDelayed(pa):this._removeImmediate(pa);this.notifyChange("dataUpdating")}_removeImmediate(pa){for(const Ba of pa)this._removeGraphic(Ba);this._cleanupSymbols();this._labeler?.setDirty();this._deconflictor?.setDirty()}_removeDelayed(pa){for(const Ia of pa){pa=Ia.uid;var Ba=this._pendingUpdates.get(pa);Ba?Ba.add&&(Ba.remove?Ba.add=null:this._pendingUpdates.delete(pa),Ba.state===Ja.LOADING&&Ba.abortController?.abort(),this._pendingAdds--):(Ba=this._pendingUpdatesPool.pushNew(), Ba.remove=Ia,this._pendingUpdates.set(pa,Ba),this._pendingRemoves++,this._applyPendingRemovesFirst=!0)}0===this._pendingUpdates.size&&this._finishPendingUpdates();this.notifyChange("running");this.notifyChange("updatingRemaining");this.notifyChange("dataUpdating")}_finishPendingUpdates(){this._pendingUpdatesPool.clear();this._cleanupSymbols();(this._pendingAdds||this._pendingRemoves)&&t.getLogger(this).warn("pendingAdds/Removes in inconsistent state!");this._pendingRemoves=this._pendingAdds=0;this._applyPendingRemovesFirst= !1}_applyPendingUpdates(pa){this._symbolWarningLogged=this._geometryWarningLogged=!1;if(0===this._pendingUpdates.size&&this._spatialIndex?.updating)this._spatialIndex.update(),pa.madeProgress();else{if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const [Ba,Ia]of this._pendingUpdates){if(pa.done){this._applyPendingRemovesFirst=!0;break}if(Ia.remove&&!Ia.add&&(this._pendingRemoves--,pa.madeProgress(),this._removeGraphic(Ia.remove),Ia.remove=null,this._pendingUpdates.delete(Ba), 0===this._pendingRemoves))break}}for(const [Ba,Ia]of this._pendingUpdates){if(pa.done)break;Ia.add&&Ia.state===Ja.NEW&&this._processPendingUpdateNew(Ia);let Wa=this.effectiveUpdatePolicy;!Ia.remove||Ia.add&&Ia.state!==Ja.READY||(this._pendingRemoves--,pa.madeProgress(),this._removeGraphic(Ia.remove),Ia.remove=null,Wa=Qa.UpdatePolicy.SYNC);if(Ia.add)switch(Ia.state){case Ja.READY:this._addGraphic(Ia.add,Ia.renderingInfo,Wa);Ia.add=null;this._pendingAdds--;pa.madeProgress();break;case Ja.REJECTED:Ia.add= null,this._pendingAdds--}null==Ia.remove&&null==Ia.add&&this._pendingUpdates.delete(Ba)}0===this._pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("dataUpdating"))}}_processPendingUpdateNew(pa){if(pa.add){var Ba=pa.add.geometry;null==Ba||"mesh"!==Ba.type||Ba.loaded?this._processPendingUpdateNewRenderingInfo(pa):this._processPendingUpdateNewMesh(pa,Ba)}else pa.state=Ja.READY}async _processPendingUpdateNewMesh(pa,Ba){pa.state=Ja.LOADING;pa.abortController= new AbortController;const Ia=pa.abortController.signal;try{await Ba.load({signal:Ia})}catch(Wa){return this._processPendingUpdateNewError(pa,Wa)}pa.abortController=null;this._processPendingUpdateNewRenderingInfo(pa)}_processPendingUpdateNewError(pa,Ba){pa.abortController=null;B.isAbortError(Ba)?pa.state=Ja.NEW:pa.state=Ja.REJECTED}async _processPendingUpdateNewRenderingInfo(pa){if(null==this.layer.renderer||"dictionary"!==this.layer.renderer.type)pa.renderingInfo=this._getRenderingInfo(pa.add,t.getLogger(this)); else{pa.state=Ja.LOADING;pa.abortController=new AbortController;var Ba=null;try{Ba=await this._getRenderingInfoAsync(pa.add,{signal:pa.abortController.signal})}catch(Ia){pa.abortController=null;B.isAbortError(Ia)?pa.state=Ja.NEW:pa.state=Ja.REJECTED;return}null==Ba?.symbol?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,t.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),pa.renderingInfo=null):pa.renderingInfo=Ba}pa.state=Ja.READY}_addGraphic(pa, Ba,Ia){this._graphicsWithoutSymbol.set(pa.uid,pa);if(null!=Ba?.symbol&&Q.hasGeometry(pa)){if(null!=this.stage.renderView.objectAndLayerIdRenderHelper&&this.setUidToIdOnAdd){const jb=Y.isBasemapLayer(this.owner.view.map,this.layer.uid);this.stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(pa.objectId,pa.uid,this.layer.id,this.layer.uid,!!this.layer.popupEnabled&&!jb&&Na.hasPopupTemplate(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}var Wa=this.getOrCreateGraphics3DSymbol(Ba.symbol, Ba.renderer);if(null!=Wa){this._expandComputedExtent(pa.geometry);var gb=this._beginGraphicUpdate(pa),ib=new ka.Graphics3DGraphicCreationContext(pa,Ba,this.layer),La=!1,Xa=jb=>{jb===Wa.symbol.id&&(La=!0)};this._whenSymbolRemoved.push(Xa);var eb=()=>{--this._loadingSymbols;if(!this.destroyed){this._whenSymbolRemoved.removeUnordered(Xa);if(this._graphicsWaitingForSymbol.get(pa.uid)!==gb||La||Wa.destroyed||this.graphicSymbolSupported&&pa.symbol&&pa.symbol.id!==Wa.symbol.id)--Wa.referenced,this._cleanupSymbols(); else{const jb=this._createGraphics3DGraphic(Wa,ib);this._spatialIndex&&null!=jb&&this._spatialIndex.add(jb);--Wa.referenced;this._endGraphicUpdate(pa)}this._featureStore.events.emit("changed");this._labeler?.setDirty()}},db=jb=>{--this._loadingSymbols;this.destroyed||(this._whenSymbolRemoved.removeUnordered(Xa),La||(B.isAbortError(jb)?this.add([pa]):Wa.destroyed||this._endGraphicUpdate(pa)))};++this._loadingSymbols;Ia===Qa.UpdatePolicy.ASYNC?Wa.load(()=>this._dataUpdateQueue.push(eb,null).catch(B.ignoreAbortErrors), jb=>this._dataUpdateQueue.push(()=>db(jb),null).catch(B.ignoreAbortErrors)):Wa.load(eb,db)}}}_removeGraphic(pa){pa=pa.uid;const Ba=this.graphics3DGraphics.get(pa);if(Ba){Ba.graphics3DSymbol.onRemoveGraphic(Ba);const Ia=Ba.usedMemory,Wa=Ba.isElevationSource;this._conditionalRemove(Ba,pa);this._spatialIndex?.remove(Ba);this._graphicsBySymbol.get(Ba.graphics3DSymbol.symbol.id)?.delete(pa);this._graphicsWithoutSymbol.delete(pa);this._removeGraphics3DGraphic(pa,Ia,Wa);Ba.destroy();this._featureStore.events.emit("changed")}else this._graphicsWithoutSymbol.delete(pa), this._graphicsWaitingForSymbol.delete(pa),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating"))}_hasLabelingContext(pa){if(pa instanceof Ka||pa instanceof Aa){const Ba=this.symbolCreationContext.layer;return Ba.labelingInfo?Ba.labelingInfo.some(Ia=>Ia.symbol===pa):!1}return!1}_hasValidSymbolCreationContext(pa){return pa instanceof Ka&&!this._hasLabelingContext(pa)?(t.getLogger(this).error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."), !1):!0}_getRenderingInfo(pa,Ba){const Ia=pa.geometry;if(null==Ia)return Ba&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,Ba.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!I.canProjectWithoutEngine(Ia.spatialReference,this._viewSpatialReference))return Ba&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,Ba.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&& null!=pa.symbol)return Ba&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,Ba.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;pa=this.rendererHasGeometryOperations?W.hydrateGraphic(pa,this.layer):pa;pa=this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||null!=this.currentRenderer)?this.owner.getRenderingInfo(pa,this.currentRenderer,this._arcadeOnDemand):{symbol:pa.symbol||ha.getDefaultSymbol3D(pa.geometry)};return null== pa?.symbol?(Ba&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,Ba.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):pa}_getRenderingInfoAsync(pa,Ba){if(null==pa.geometry)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,t.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&null!=pa.symbol)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,t.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)), null;pa=this.rendererHasGeometryOperations?W.hydrateGraphic(pa,this.layer):pa;return this.owner.getRenderingInfoAsync(pa,this.currentRenderer,this._arcadeOnDemand,Ba)}_createGraphics3DSymbol(pa,Ba){if(!this._hasValidSymbolCreationContext(pa))return null;pa=this._getConvertedSymbol(pa);if(!pa)return null;let Ia;null!=Ba&&"backgroundFillSymbol"in Ba&&Ba.backgroundFillSymbol&&(Ba=ba.to3D(Ba.backgroundFillSymbol,{ignoreDrivers:!0}),null!=Ba.symbol&&(Ia=Ba.symbol.symbolLayers));const Wa=X.make(pa,this.symbolCreationContext, Ia);Wa.load(()=>{const gb=Wa.extentPadding;gb>this.extentPadding&&this._set("extentPadding",gb);this.notifyChange("averageSymbolComplexity")},()=>{});return Wa}getOrCreateGraphics3DSymbol(pa,Ba){var Ia=this._symbols.get(pa.id);void 0===Ia&&(Ia=this._unusedSymbolsCache.pop(pa.id),Ia=null!=Ia?Ia:pa instanceof Sa?new ja.Graphics3DWebStyleSymbol(pa,Wa=>this._dataUpdateQueue.push(Wa,null),Wa=>this._createGraphics3DSymbol(Wa,Ba)):this._createGraphics3DSymbol(pa,Ba),this._symbols.set(pa.id,Ia),this._symbolMaterials= null);null!=Ia&&++Ia.referenced;return Ia}trackGraphicState(pa){null==this._graphicStateTracking&&(this._graphicStateTracking=new na.GraphicStateTracking(this));return this._graphicStateTracking.add(pa)}_addGraphics3DGraphic(pa){this._usedMemory+=pa.usedMemory;this.graphics3DGraphics.set(pa.graphic.uid,pa);this._numberOfGraphics++;pa.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider());this._updateLayerVisibility()}_removeGraphics3DGraphic(pa,Ba, Ia=!1){this._usedMemory-=Ba;this.graphics3DGraphics.delete(pa);this._numberOfGraphics--;Ia&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider());this._updateLayerVisibility()}_createGraphics3DGraphic(pa,Ba){const Ia=Ba.graphic;this._graphicsWithoutSymbol.delete(Ia.uid);if(!this._symbols.has(pa.symbol.id))return this.add([Ia]),null;if(this.graphics3DGraphics.has(Ia.uid))return null;Ba=pa.createGraphics3DGraphic(Ba);if(null==Ba)return null;this._addGraphics3DGraphic(Ba); pa=pa.symbol.id;this._graphicsBySymbol.has(pa)||this._graphicsBySymbol.set(pa,new Map);this._graphicsBySymbol.get(pa).set(Ia.uid,Ba);Ba.isDraped&&this._graphicsDrapedUids.add(Ia.uid);Ba.centroid=null;null!=Ia.geometry&&"point"!==Ia.geometry.type&&(Ba.centroid=va.computeCentroid(Ia.geometry,this._viewSpatialReference));this._updateUserVisibility(Ba);null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(Ba);null!=this._filterVisibility&&({defaultVisibility:pa}=this._filterVisibility,Ba.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC, ea.VisibilityFlag.FILTER,pa),pa||this._filterVisibility.reapply());this._deconflictor?.addGraphic(Ba);this._labeler?.addGraphic(Ba);this._objectStates?.addGraphic(Ba);Ba.initialize(this.stageLayer,this.owner);null!=this._graphicStateTracking&&this._graphicStateTracking.addGraphic(Ba);if(pa=this._whenGraphics3DGraphicRequests[Ia.uid])delete this._whenGraphics3DGraphicRequests[Ia.uid],pa.resolve(Ba);this._symbolMaterials=null;return Ba}_abortRendererChange(){this._rendererChangeAbortController&&(this._rendererChangeAbortController.abort(), this._rendererChangeAbortController=null)}async rendererChange(pa){this._abortRendererChange();if(pa!==this.currentRenderer)if(this._validateRenderer(pa),null==pa&&this._currentRendererChange(null,!1),V.isSupportedRenderer3D(pa))if(pa?.arcadeRequired){var Ba=new AbortController;this._rendererChangeAbortController=Ba;const {arcadeUtils:Ia}=await this._ensureArcade();B.throwIfAborted(Ba);const Wa=Ia.hasGeometryOperations(pa);Wa&&(await Ia.enableGeometryOperations(),B.throwIfAborted(Ba));this.effectiveUpdatePolicy=== Qa.UpdatePolicy.ASYNC?await this._updateQueue.push(()=>this._currentRendererChange(pa,Wa),Ba.signal):this._currentRendererChange(pa,Wa);this._rendererChangeAbortController=null}else this.effectiveUpdatePolicy===Qa.UpdatePolicy.ASYNC?(this._rendererChangeAbortController=Ba=new AbortController,await this._updateQueue.push(()=>this._currentRendererChange(pa,!1),Ba.signal),this._rendererChangeAbortController=null):this._currentRendererChange(pa,!1);else this._currentRendererChange(pa,!1)}async _ensureArcade(){null== this._arcadeOnDemand&&(this._arcadeOnDemand=await T.loadArcade());return this._arcadeOnDemand}_currentRendererChange(pa,Ba){this.currentRenderer=pa;this.rendererHasGeometryOperations=Ba;this.symbolCreationContext.arcade=this._arcadeOnDemand;Ba=this.symbolCreationContext.renderer;if(pa!==Ba)if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),null==pa)this.symbolCreationContext.renderer=null,this.recreateAllGraphicsAndSymbols();else{var Ia=N.diff(Ba,pa);this._updateUnchangedSymbolMappings(Ia, pa,Ba);this.symbolCreationContext.renderer=pa;null!=Ia&&("complete"===Ia.type?this.recreateAllGraphicsAndSymbols():"partial"===Ia.type&&(this._applyRendererDiff(Ia,pa,Ba)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}}_diffHasSymbolChange(pa){for(const Ba in pa.diff)switch(Ba){case "visualVariables":case "defaultSymbol":case "uniqueValueInfos":break;case "uniqueValueGroups":case "authoringInfo":case "fieldDelimiter":delete pa.diff[Ba];break; default:return!0}return!1}_applySymbolSetDiff(pa,Ba,Ia){pa=pa||[];Ba=Ba||[];const Wa=[];for(const gb of Ba){const ib=this._graphicsBySymbol.get(gb.id);ib&&ib.forEach((La,Xa)=>{var eb=La.graphic,db=this.layer instanceof R?this.layer:null;const jb=this._arcadeOnDemand;if(gb!==Ia.defaultSymbol||Ia.getSymbol(W.hydrateGraphic(eb,db),{arcade:jb})!==Ia.defaultSymbol)db=La.usedMemory,pa.length||Ia.defaultSymbol?Wa.push(eb):this._graphicsWithoutSymbol.set(Xa,eb),eb=this.graphics3DGraphics.get(Xa),this._conditionalRemove(eb, Xa),La.destroy(),ib.delete(Xa),this._removeGraphics3DGraphic(Xa,db),this._updateLayerVisibility()});this._whenSymbolRemoved.forAll(La=>La(gb.id))}if(pa.length||Wa.length)this._graphicsWithoutSymbol.forEach(gb=>Wa.push(gb)),this._graphicsWithoutSymbol.clear(),this.add(Wa);this._cleanupSymbols();this._labeler?.setDirty();this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(pa,Ba,Ia){const Wa=pa.diff.defaultSymbol,gb=pa.diff.uniqueValueInfos;if(Wa||gb){const ib=gb?gb.added.map(Xa=>Xa.symbol).filter(m.isSome): [],La=gb?gb.removed.map(Xa=>Xa.symbol).filter(m.isSome):[];if(gb)for(let Xa=0;Xanull!=ib?ib.id:null;var gb=pa&&pa.diff;pa=gb?.defaultSymbol;if(gb=gb&&gb.uniqueValueInfos)gb=gb.unchanged.map(ib=>({oldId:Wa(ib.oldValue.symbol),newId:Wa(ib.newValue.symbol)}));else{gb=[];for(const ib of Ia.uniqueValueInfos??[]){const La=Wa(ib.symbol),Xa=Ba.uniqueValueInfos?.find(eb=>eb.value===ib.value);Xa&&La!==Wa(Xa.symbol)&&gb.push({oldId:La,newId:Wa(Xa.symbol)})}}!pa&&Ia.defaultSymbol&&gb.push({oldId:Wa(Ia.defaultSymbol), newId:Wa(Ba.defaultSymbol)});return gb}_updateSymbolMapping(pa,Ba){const Ia=null!=Ba&&Ba?"string"===typeof Ba?Ba:Ba.id:null;if(null!=pa&&pa!==Ia){var Wa=this._graphicsBySymbol.get(pa);this._graphicsBySymbol.delete(pa);void 0!==Wa&&this._graphicsBySymbol.set(Ia,Wa);Wa=this._symbols.get(pa);void 0!==Wa&&(this._symbols.delete(pa),this._symbols.set(Ia,Wa),this._symbolMaterials=null,null!=Wa&&(pa="string"===typeof Ba?null:Ba,null!=pa?Wa.symbol=pa:Wa.symbol.id=Ia))}}_updateUnchangedSymbolMappings(pa,Ba, Ia){pa=this._calculateUnchangedSymbolMapping(pa,Ba,Ia);for(const {oldId:Wa,newId:gb}of pa)this._updateSymbolMapping(Wa,gb)}_applyRendererDiff(pa,Ba,Ia){if(this._diffHasSymbolChange(pa))return!1;if(Ba instanceof g&&Ia instanceof g&&this._applyUniqueValueRendererDiff(pa,Ba,Ia)&&0===Object.keys(pa.diff).length)return!0;for(const [Wa]of this._graphicsBySymbol)if(Ia=this._symbols.get(Wa),null!=Ia)switch(Ia.applyRendererDiff(pa,Ba)){case za.ApplyRendererDiffResult.RecreateSymbol:this._recreateSymbol(Wa); break;case za.ApplyRendererDiffResult.RecreateGraphics:this._recreateGraphicsForSymbol(Wa)}return!0}opacityChange(){this.forEachGraphics3DSymbol((pa,Ba)=>pa.globalPropertyChanged("opacity",Ba));this._updateStageLayerVisibility()}_slicePlaneEnabledChange(pa){pa!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=pa,this.stageLayer.sliceable=pa,this.forEachGraphics3DSymbol((Ba,Ia)=>Ba.globalPropertyChanged("slicePlaneEnabled",Ia)),this._deconflictor?.slicePlaneEnabledChange(), this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(pa){this.symbolCreationContext.physicalBasedRenderingEnabled=pa;this.forEachGraphics3DSymbol((Ba,Ia,Wa)=>{Ba.globalPropertyChanged("physicalBasedRenderingEnabled",Ia)||this._recreateSymbol(Wa)})}_skipHighSymbolLoDsChange(pa){this.symbolCreationContext.skipHighSymbolLods=pa;this.forEachGraphics3DSymbol((Ba,Ia,Wa)=>{Ba.globalPropertyChanged("skipHighSymbolLods",Ia)||this._recreateSymbol(Wa)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((pa, Ba,Ia)=>{pa.globalPropertyChanged("pixelRatio",Ba)||this._recreateSymbol(Ia)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove();this._updatingPendingLoadedGraphicsChange=D.schedule(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(pa,Ba){const Ia=this.symbolCreationContext.clippingExtent,Wa=K.create();Ma.toBoundingRect(pa,Wa,Ba)?this.symbolCreationContext.clippingExtent=M.fromRect(M.create(), Wa):this.symbolCreationContext.clippingExtent=null;return!M.equals(this.symbolCreationContext.clippingExtent,Ia)}modifyGraphics3DGraphicVisibilities(pa){if(!this.destroyed){var Ba=!1;this.graphics3DGraphics.forEach(Ia=>{pa(Ia)&&(Ba=!0)});Ba&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}}forEachGraphics3DSymbol(pa){for(const [Ba,Ia]of this._symbols){if(null==Ia)break;const Wa=this._graphicsBySymbol.get(Ba);pa(Ia,Wa||bb,Ba)}}updateAllGraphicsVisibility(){null!=this._filterVisibility&& this._filterVisibility.reapply();this.modifyGraphics3DGraphicVisibilities(pa=>{const Ba=this._updateUserVisibility(pa);pa=null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(pa);return Ba||pa})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(pa=>pa.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.USER,!1))}_validateRenderer(pa){const Ba=()=>`'${this.layer.title?`${this.layer.title}, `:""}id:${this.layer.id}'`;if(pa=V.validateTo3D(pa,{geometryType:this.layer?.geometryType, logWarning:Ia=>t.getLogger(this).warn(`Symbology conversion for layer ${Ba()}: ${Ia}`)})){const Ia=`Renderer for layer ${Ba} is not supported in a SceneView`;t.getLogger(this).warn(Ia,pa.message)}}_cleanupSymbols(){if(!(0{if(!(null==Ba||0w.details.symbol.type||w.details.symbol.declaredClass).filter(w=>!!w);d.sort();const t=[];d.forEach((w,v)=>{0!==v&&w===d[v-1]||t.push(w)});return new l("renderer-conversion-3d:unsupported-symbols", `Renderer contains symbols (${t.join(", ")}) which are not supported in 3D`,{renderer:e,symbolErrors:g})}return null}function f(e,g){const d={...p.defaultTo3DOptions,...g,cimFallbackEnabled:!0};g=e.uniqueValueInfos?.map(w=>p.to3D(w.symbol,d).error).filter(b.isSome);const t=p.to3D(e.defaultSymbol,d);t.error&&g?.unshift(t.error);return h(e,g)}function c(e,g){const d={...p.defaultTo3DOptions,...g,cimFallbackEnabled:!0};g=e.classBreakInfos.map(w=>p.to3D(w.symbol,d).error).filter(b.isSome);const t=p.to3D(e.defaultSymbol, d);t.error&&g.unshift(t.error);return h(e,g)}a.isSupportedRenderer3D=k;a.validateTo3D=function(e,g){if(null==e)return null;if(!k(e))return new l("renderer-conversion-3d:unsupported-renderer",`Unsupported renderer of type '${e.type||e.declaredClass}'`,{renderer:e});switch(e.type){case "simple":return h(e,p.to3D(e.symbol,{...p.defaultTo3DOptions,...g,cimFallbackEnabled:!0}).error);case "unique-value":return f(e,g);case "class-breaks":return c(e,g)}return null};Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DFeatureStore":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/projection ../../../../geometry/support/aaBoundingBox ../../../../layers/graphics/dehydratedFeatures ../../../../layers/graphics/OptimizedFeature ../../../../layers/graphics/OptimizedGeometry ../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){const m=g.create();a.Graphics3DFeatureStore=class extends q{constructor(n){super(n);this.events=new l;this.objectIdField=this.hasM=this.hasZ=null;this.featureAdapter={getAttribute(u,x){return"graphic"in u?u.graphic.attributes[x]:v.optimizedFeatureQueryEngineAdapter.getAttribute(u,x)},getAttributes(u){return"graphic"in u?u.graphic.attributes:v.optimizedFeatureQueryEngineAdapter.getAttributes(u)},getObjectId:u=>"graphic"in u?d.getObjectId(u.graphic,this.objectIdField)?? void 0:v.optimizedFeatureQueryEngineAdapter.getObjectId(u),getGeometry:u=>"graphic"in u?u.getAsOptimizedGeometry(this.hasZ,this.hasM):v.optimizedFeatureQueryEngineAdapter.getGeometry(u),getCentroid:(u,x)=>{if("graphic"in u){let y=null;null!=u.centroid?y=u.centroid:"point"===u.graphic.geometry.type&&e.projectPoint(u.graphic.geometry,r,this.viewSpatialReference)&&(y=r);u=Array(2+(x.hasZ?1:0)+(x.hasM?1:0));null==y?(u[0]=0,u[1]=0,u[2]=0,u[3]=0):(u[0]=y.x,u[1]=y.y,x.hasZ&&(u[2]=y.hasZ?y.z:0),x.hasM&&(u[x.hasZ? 3:2]=y.hasM?y.m:0));return new w([],u)}return v.optimizedFeatureQueryEngineAdapter.getCentroid(u,x)},cloneWithGeometry:(u,x)=>"graphic"in u?new t.OptimizedFeature(x,this.featureAdapter.getAttributes(u),null,this.featureAdapter.getObjectId(u)):v.optimizedFeatureQueryEngineAdapter.cloneWithGeometry(u,x)}}forEachInBounds(n,u){this.getSpatialIndex().forEachInBounds(n,u)}forEachBounds(n,u){const x=this.getSpatialIndex();for(const y of n)n=this.featureAdapter.getObjectId(y),null!=x.getBounds(n,m)&&u(m)}}; b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"getSpatialIndex",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"forEach",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"hasZ",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"hasM",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"objectIdField",void 0); b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"viewSpatialReference",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"featureSpatialReference",void 0);a.Graphics3DFeatureStore=b.__decorate([c.subclass("esri.views.3d.layers.graphics.Graphics3DFeatureStore")],a.Graphics3DFeatureStore);const r={type:"point",x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/optimizedFeatureQueryEngineAdapter":function(){define(["exports", "../centroid","../OptimizedFeature","../OptimizedGeometry"],function(a,b,q,l){a.optimizedFeatureQueryEngineAdapter={getObjectId(p){return p.objectId},getAttributes(p){return p.attributes},getAttribute(p,k){return p.attributes[k]},cloneWithGeometry(p,k){return new q.OptimizedFeature(k,p.attributes,null,p.objectId)},getGeometry(p){return p.geometry},getCentroid(p,k){null==p.centroid&&(p.centroid=b.getCentroidOptimizedGeometry(new l,p.geometry,k.hasZ,k.hasM));return p.centroid}};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/centroid":function(){define(["exports"],function(a){function b(l,p,k,h,f,c){c=f?c?4:3:c?3:2;let e=k,g=k+c,d=0,t=0,w=k=0,v=0;for(let m=0,r=h-1;ml[1]&&(l[1]=h);nl[3]&&(l[3]=n);f&&(ul[5]&&(l[5]=u))}0{let r=v[2]-m[2];0===r&&k&&(r=v[4]-m[4]);return r});c.length&&(t=6*c[0][2],f[0]=c[0][0]/t,f[1]=c[0][1]/t,k&&(t=6*c[0][4],f[2]=0!==t?c[0][3]/t:0),f[0]e[1]||f[1]e[3]||k&&(f[2]e[5]))&&(f.length=0);if(!f.length)if(p=p.lengths[0]?q(d,0,g[0],k,h):null)f[0]=p[0],f[1]=p[1],k&&2g.calloutLayer):!0:!1}updateGeometry(c,e){const g=super.updateGeometry(c,e);return g&&this._calloutSymbolLayer&&(c=c.calloutLayer)?this._calloutSymbolLayer.updateGeometry(c,e):g}_createCalloutGraphic(c){const e= c.renderingInfo;c.renderingInfo=new k.LineCalloutSymbolLayerRenderingInfo(e.renderer,e.symbol);return this._calloutSymbolLayer.createGraphics3DGraphic(c)}}a.Graphics3DPointSymbol=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/GraphicsCorePerformanceInfo":function(){define(["exports"],function(a){class b{constructor(q,l,p){this.visible=q;this.missing=l;this.pending=p}}a.GraphicsCorePerformanceInfo=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/layers/graphics/GraphicStateTracking":function(){define(["exports","../../../../core/arrayUtils","../../../../core/handleUtils","../../../../layers/graphics/dehydratedFeatures"],function(a,b,q,l){class p{constructor(k){this._graphicsCore=k;this._idToState=new Map;this._states=new Set;const h=k.owner.layer?.objectIdField;h?(this._getGraphicId=f=>l.getObjectId(f,h),this._getGraphics3DGraphicById=f=>this._graphicsCore.getGraphics3DGraphicByObjectId(f)):(this._getGraphicId=f=>f.uid,this._getGraphics3DGraphicById= f=>this._graphicsCore.getGraphics3DGraphicById(f))}destroy(){this._idToState.clear();this._states.forEach((k,h)=>this.remove(h))}add(k){const h=q.makeHandle(()=>this.remove(k));if(this._states.has(k))return h;const f=this._getGraphicId(k.graphic),c=this._getGraphics3DGraphicById(f);this._states.has(k)||this._states.add(k);this._ensureStateList(f).push(k);k.displaying=null!=c?c.isVisible():!1;k.isDraped=null!=c?c.isDraped:!1;k.tracking=!0;null!=c&&k.emit("changed");return h}remove(k){if(this._states.has(k)){if(this._idToState.size){const h= this._getGraphicId(k.graphic),f=this._idToState.get(h);f&&(b.remove(f,k),0===f.length&&this._idToState.delete(h))}this._states.delete(k);k.tracking=!1;k.displaying=!1}}addGraphic(k){this._forEachState(k,h=>{h.displaying=k.isVisible();h.isDraped=k.isDraped;h.emit("changed")})}removeGraphic(k){this._forEachState(k,h=>{h.displaying=!1;h.isDraped=!1})}updateGraphicGeometry(k){this._forEachState(k,h=>h.emit("changed"))}updateGraphicVisibility(k){this._forEachState(k,h=>h.displaying=k.isVisible())}allGraphicsDeleted(){this._states.forEach(k=> k.displaying=!1)}_ensureStateList(k){var h=this._idToState.get(k);if(h)return h;h=[];this._idToState.set(k,h);return h}_forEachState(k,h){0!==this._states.size&&0!==this._idToState.size&&(k=this._getGraphicId(k.graphic),k=this._idToState.get(k),null!=k&&k.forEach(h))}}a.GraphicStateTracking=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/SpatialIndex2D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/maybe ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/rbush/PooledRBush ../../../../geometry/support/aaBoundingBox ../../../../layers/graphics/dehydratedFeatures".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){a.SpatialIndex2D=class extends q{constructor(w){super(w);this._index=new e.PooledRBush(9,l("esri-csp-restrictions")?v=>({minX:v.extent[0],minY:v.extent[1],maxX:v.extent[2],maxY:v.extent[3]}):[".extent[0]",".extent[1]",".extent[2]",".extent[3]"]);this._missing=new Set;this._boundsByFeature=new Map;this.objectIdField=this.hasM=this.hasZ=this.spatialReference=null;this.updating=!1}setup(w){this._addMany(w)}destroy(){this._missing.clear();this._index=p.destroyMaybe(this._index); this._boundsByFeature.clear();this._boundsByFeature=null}update(){0m(r.graphic.uid)))}add(w){this._missing.add(w);this.updating=!0}remove(w){this._missing.delete(w)?this.updating= 0{v(m)})}getBounds(w,v){this.update();return(w=this._boundsByFeature.get(w))?g.fromRect(v,w):null}};b.__decorate([k.property({constructOnly:!0})],a.SpatialIndex2D.prototype,"spatialReference",void 0);b.__decorate([k.property({constructOnly:!0})],a.SpatialIndex2D.prototype,"hasZ",void 0);b.__decorate([k.property({constructOnly:!0})],a.SpatialIndex2D.prototype,"hasM",void 0);b.__decorate([k.property({constructOnly:!0})],a.SpatialIndex2D.prototype, "objectIdField",void 0);b.__decorate([k.property()],a.SpatialIndex2D.prototype,"updating",void 0);b.__decorate([k.property({readOnly:!0})],a.SpatialIndex2D.prototype,"updatingRemaining",null);a.SpatialIndex2D=b.__decorate([c.subclass("esri.views.3d.layers.graphics.SpatialIndex2D")],a.SpatialIndex2D);const t={minX:0,minY:0,maxX:0,maxY:0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/rbush/PooledRBush":function(){define(["exports","../../arrayUtils","../../has","../../PooledArray", "../../../chunks/quickselect"],function(a,b,q,l,p){function k(D,F){for(u.clear();D;){if(!0===D.leaf)for(const H of D.children)F(H);else u.pushArray(D.children);D=u.pop()??null}}function h(D,F){f(D,0,D.children.length,F,D)}function f(D,F,H,N,E){E||=new B([]);E.minX=Infinity;E.minY=Infinity;E.maxX=-Infinity;E.maxY=-Infinity;for(let G=F,I;G=D.minX&&F.maxY>=D.minY}function m(D,F,H,N,E){for(F=[F,H];F.length;){H=F.pop();const G=F.pop();if(H-G<=N)continue;const I=G+Math.ceil((H-G)/N/2)*N;p.quickselect(D, I,G,H,E);F.push(G,I,I,H)}}class r{constructor(D=9,F){this._compareMinX=e;this._compareMinY=g;this._toBBox=H=>H;this._maxEntries=Math.max(4,D||9);this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries));F&&("function"===typeof F?this._toBBox=F:this._initFormat(F));this.clear()}destroy(){this.clear();n.prune();u.prune();x.prune();y.prune()}all(D){k(this._data,D)}search(D,F){let H=this._data;const N=this._toBBox;if(v(D,H))for(n.clear();H;){for(let E=0,G=H.children.length;Ethis._maxEntries)this._split(x,F),F--;else break;for(D=x;0<=F;F--)c(D.data[F],H)}_split(D,F){const H=D.data[F];var N=H.children.length;const E=this._minEntries;this._chooseSplitAxis(H,E,N);if(N=this._chooseSplitIndex(H,E,N))N=H.children.splice(N,H.children.length-N),N=H.leaf?new B(N):new C(N),N.height=H.height,h(H,this._toBBox),h(N,this._toBBox), F?D.data[F-1].children.push(N):this._splitRoot(H,N)}_splitRoot(D,F){this._data=new C([D,F]);this._data.height=D.height+1;h(this._data,this._toBBox)}_chooseSplitIndex(D,F,H){let N,E,G=void 0;N=E=Infinity;for(let O=F;O<=H-F;O++){var I=f(D,0,O,this._toBBox);const L=f(D,O,H,this._toBBox),P=Math.max(0,Math.min(I.maxX,L.maxX)-Math.max(I.minX,L.minX))*Math.max(0,Math.min(I.maxY,L.maxY)-Math.max(I.minY,L.minY));I=d(I)+d(L);P=F;H--)E=D.children[H],c(G,D.leaf?N(E):E),I+=t(G);return I}_condense(D){for(let F=D.length-1;0<=F;F--){const H=D.data[F];if(0===H.children.length)if(0e;){if(600w-t/2?-1:1);p(f,c,Math.max(e,Math.floor(c-w*m/t+v)),Math.min(g,Math.floor(c+(t-w)*m/t+v)),d)}t=f[c];w=e;m=g;k(f,e,c);for(0d(f[w],t);)w++;for(;0 c?1:0}return function(f,c,e,g,d){p(f,c,e||0,g||f.length-1,d||h)}})})(q);b=b.getDefaultExportFromCjs(q.exports);a.quickselect=b})},"esri/views/3d/layers/graphics/symbolMemory":function(){define(["exports"],function(a){a.getSymbolMemorySize=function(b){return 2216+4096*b.symbolLayers.length+b.complexity.memory.resourceBytes};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/StageLayerElevationProvider":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/Logger ../../../../core/unitUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../symbols/support/unitConversionUtils ../../support/ElevationUpdateEvent ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces ../../webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){const u=Symbol("layerHandles");a.StageLayerElevationProvider=class extends l.EventedMixin(q){get spatialReference(){return this.view?.spatialReference}constructor(C){super(C);this._elevationOffset=0}initialize(){this._renderCoordsHelper=this.view.renderCoordsHelper;this._intersectLayers=[this.stageLayer];this._intersector=m.newIntersector(this.view.state.viewingMode);this._intersector.options.store=r.StoreResults.MIN;var C=this._computeLayerExtent(this.spatialReference, this.stageLayer);this._zmin=C[2];this._zmax=C[5];C=this.stageLayer.events;this.addHandles([C.on(["layerObjectAdded","layerObjectRemoved","geometryAdded","geometryRemoved"],({object:D})=>this._objectChanged(D)),C.on("attributesChanged",({attribute:D,object:F})=>n.affectsGeometry(D)&&this._objectChanged(F)),C.on(["transformationChanged","shaderTransformationChanged"],D=>this._objectChanged(D))],u)}dispose(){this.removeHandles(u)}elevationInfoChanged(){const C=null!=this.layer?this.layer.elevationInfo: null;if(null!=C&&"on-the-ground"!==C.mode){const D=k.getMetersPerVerticalUnitForSR(this.layer.spatialReference),F=w.getMetersPerUnit(C.unit??"meters");this._elevationOffset=(C.offset??0)*F/D}else this._elevationOffset=0}getElevation(C,D,F,H){z[0]=C;z[1]=D;z[2]=F;if(!this._renderCoordsHelper.toRenderCoords(z,H,z))return p.getLogger(this).error("could not project point for elevation alignment"),null;C=this._elevationOffset;D=this._zmin+C;this._renderCoordsHelper.setAltitude(A,this._zmax+C,z);this._renderCoordsHelper.setAltitude(B, D,z);this._intersector.reset(A,B,null);this._intersector.intersect(this._intersectLayers,null,1,null,N=>!!N.lastValidElevationBB);return this._intersector.results.min.getIntersectionPoint(z)?this._renderCoordsHelper.getAltitude(z):null}_objectChanged(C){const D=this.spatialReference;if(C.lastValidElevationBB&&D){t.empty(x);var F=C.lastValidElevationBB;F.isEmpty()||this._expandExtent(D,F.min,F.max,x);var {min:H,max:N}=C.boundingVolumeWorldSpace;this._expandExtent(D,H,N,x);t.toRect(x,y.extent);this._zmin= Math.min(this._zmin,x[2]);this._zmax=Math.max(this._zmax,x[5]);y.spatialReference=D;this.emit("elevation-change",y);g.copy(F.min,H);g.copy(F.max,N)}}_computeLayerExtent(C,D){t.empty(x);null!=C&&D.objects.forAll(F=>this._expandExtent(C,F.boundingVolumeWorldSpace.min,F.boundingVolumeWorldSpace.max,x));return x}_expandExtent(C,D,F,H){for(let N=0;8>N;++N)z[0]=N&1?D[0]:F[0],z[1]=N&2?D[1]:F[1],z[2]=N&4?D[2]:F[2],this._renderCoordsHelper.fromRenderCoords(z,z,C),t.expandWithVec3(H,z);return H}};b.__decorate([h.property({constructOnly:!0})], a.StageLayerElevationProvider.prototype,"layer",void 0);b.__decorate([h.property({constructOnly:!0})],a.StageLayerElevationProvider.prototype,"stageLayer",void 0);b.__decorate([h.property({constructOnly:!0})],a.StageLayerElevationProvider.prototype,"view",void 0);b.__decorate([h.property()],a.StageLayerElevationProvider.prototype,"spatialReference",null);a.StageLayerElevationProvider=b.__decorate([e.subclass("esri.views.3d.layers.support.StageLayerElevationProvider")],a.StageLayerElevationProvider); const x=t.empty(),y=new v.ElevationUpdateEvent,z=d.create(),A=d.create(),B=d.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DElevationAlignment":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./ExtentSet ../../webgl-engine/lib/UpdatePolicy ../../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(v){return null==v?t.TaskPriority.ELEVATION_ALIGNMENT:"relative-to-scene"===v?t.TaskPriority.ELEVATION_ALIGNMENT_SCENE:t.TaskPriority.ELEVATION_ALIGNMENT}a.Graphics3DElevationAlignment=class extends q{constructor(v){super(v);this._dirtyExtents=new g.ExtentSet;this._globalDirty=!1;this._averageExtentUpdateSize=0;this._dirtyGraphicsSet=new Set;this._updateElevation=!1;this.graphicsCore=this.graphicsCoreOwner=null;this.events=new l}initialize(){const v=this.elevationProvider; this._task=this.graphicsCoreOwner.view.resourceController.scheduler.registerTask(w(this.graphicsCore.layer.elevationInfo?.mode),this);this.addHandles([v.on("elevation-change",m=>this._elevationChanged(m)),p.watch(()=>this.graphicsCoreOwner.suspended,()=>this._suspendedChange()),this._task,p.watch(()=>w(this.graphicsCore.layer.elevationInfo?.mode),m=>this._task.priority=m)])}destroy(){this._dirtyGraphicsSet.clear();this.elevationProvider=this.queryGraphicUIDsInExtent=this.graphicsCore=this.graphicsCoreOwner= null}clear(){this._dirtyGraphicsSet.clear();this.notifyChange("updating")}_suspendedChange(){!0===this.graphicsCoreOwner.suspended?this._updateElevation=!1:!1===this.graphicsCoreOwner.suspended&&this._updateElevation&&(this._globalDirty=!0,this.notifyChange("updating"))}elevationInfoChange(){this._globalDirty=!0;this.notifyChange("updating")}get updating(){return this.running}get running(){return 0this._dirtyExtents.merge(v));this.running&&!v.done;)this._updateDirtyGraphics(v),this._updateDirtyExtents(v);this.notifyChange("updating")}_updateDirtyGraphics(v){const m=this.graphicsCoreOwner.view.renderCoordsHelper,r=this.graphicsCore.effectiveUpdatePolicy===d.UpdatePolicy.ASYNC;for(const n of this._dirtyGraphicsSet.keys()){const u= this.graphicsCore.getGraphics3DGraphicById(n);this._dirtyGraphicsSet.delete(n);null!=u&&(u.alignWithElevation(this.elevationProvider,m,r),this.graphicsCore.deconflictor?.setDirty(),v.madeProgress());if(v.done)break}}_updateDirtyExtents(v){for(;!this._dirtyExtents.empty&&!v.done;){const m=this._dirtyExtents.pop(),r=this.elevationProvider.spatialReference;this.events.emit("invalidate-elevation",{extent:m,spatialReference:r});const n=this._dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(m,r,u=>{const x= this.graphicsCore.getGraphics3DGraphicById(u);null!=x&&x.needsElevationUpdates()&&this._dirtyGraphicsSet.add(u)});this._averageExtentUpdateSize=.1*(this._dirtyGraphicsSet.size-n)+.9*this._averageExtentUpdateSize;v.madeProgress()}}_markAllGraphicsElevationDirty(){this._dirtyExtents.clear();this._dirtyGraphicsSet.clear();this.graphicsCore.graphics3DGraphics.forEach((v,m)=>this._dirtyGraphicsSet.add(m))}_elevationChanged(v){if("scene"!==v.context||this.graphicsCore.layer.elevationInfo&&"relative-to-scene"=== this.graphicsCore.layer.elevationInfo.mode){var m=v.extent;if(this.graphicsCoreOwner.suspended){if(!this._updateElevation){const r=this.graphicsCore.computedExtent;r&&m[2]>r.xmin&&m[0]r.ymin&&m[1]h||l.create()});this._tmpExtent=l.create(); this._dirty=!1}get empty(){return 0===this._extents.length}get size(){return this._extents.length}clear(){this._extents.clear()}add(h){this._contains(h)||(this._removeContained(h),l.copy(this._extents.pushNew(),h),this._dirty=!0)}pop(){this._dirty&&this._mergeTight();return this._extents.pop()}merge(h){this._mergeTight(h);return h.hasProgressed}_mergeTight(h=p.noBudget){const f=this._extents,c=new Set;let e=0;for(;e!==f.length;){f.sort((g,d)=>g[0]-d[0]);e=f.length;c.clear();for(let g=0;g=d[2])break;c.add(w)}c.forEach(t=>{if(d!==t)if(t[2]<=d[0])c.delete(t);else{var w=l.area(d),v=l.area(t),m=this._tmpExtent;l.expand(d,t,m);w+=v;.05>(l.area(m)-w)/w&&(l.copy(d,m),c.delete(t),f.remove(t),h.madeProgress())}});c.add(d)}}}this._dirty=!1}_contains(h){return this._extents.some(f=>l.contains(f,h))}_removeContained(h){this._extents.filterInPlace(f=>!l.contains(h,f))}get test(){}}a.ExtentSet=k;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DFrustumVisibility":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/ellipsoidUtils ../../support/FrustumExtentIntersection ../../../support/Scheduler ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.Graphics3DFrustumVisibility=class extends q{constructor(w){super(w);this.suspended=!1;this._extent=null;this._extentIntersectionDirty=!0;this._isVisibleBelowSurfaceInternal=!1;this.graphicsCoreOwner=null;this.updating=!0}initialize(){var {graphicsCoreOwner:w}=this;this._extentIntersection=new g.FrustumExtentIntersection({renderCoordsHelper:w.view.renderCoordsHelper});const v=w.view,m=v.basemapTerrain;w=v.resourceController.scheduler;this.addHandles([v.on("resize", ()=>this._viewChange()),l.watch(()=>v.state.camera,()=>this._viewChange(),l.sync),w.registerTask(d.TaskPriority.FRUSTUM_VISIBILITY,this),l.watch(()=>m.visibleElevationBounds,()=>this._elevationBoundsChange())]);"local"===v.viewingMode?this._isVisibleBelowSurface=!0:this.addHandles([l.watch(()=>[m.baseOpacity,m.wireframe,v.map?.ground?.navigationConstraint?.type],()=>this._updateIsVisibleBelowSurface(),l.initial)])}destroy(){this._set("graphicsCoreOwner",null);this._extentIntersection=this._extent= null}_setDirty(){this.updating||this._set("updating",!0)}setExtent(w){this._extent=w;this._extentIntersectionDirty=!0;this._setDirty()}_viewChange(){this._setDirty()}_elevationBoundsChange(){this._setDirty();this._extentIntersectionDirty=!0}set _isVisibleBelowSurface(w){this._isVisibleBelowSurfaceInternal=w;this._setDirty();this._extentIntersectionDirty=!0}_updateIsVisibleBelowSurface(){const w=this.graphicsCoreOwner.view,v=w.basemapTerrain,m="none"===w.map.ground?.navigationConstraint?.type;this._isVisibleBelowSurface= "local"===w.viewingMode||!v.opaque||m}_updateExtentIntersection(){if(this._extentIntersectionDirty){this._extentIntersectionDirty=!1;var w=this.graphicsCoreOwner.view;if(this._isVisibleBelowSurfaceInternal)var v=-.3*e.getReferenceEllipsoid(w.spatialReference).radius;else{const {min:m,max:r}=w.basemapTerrain.visibleElevationBounds;v=m-Math.max(1,(r-m)*(1.2-1))}this._extentIntersection.update(this._extent,w.spatialReference,v)}}get running(){return this.updating}runTask(w){this._set("updating",!1); if(!this._extent)return this._set("suspended",!1),t.Yield;this._updateExtentIntersection();const v=this.graphicsCoreOwner.view.frustum,m=e.getReferenceEllipsoid(this.graphicsCoreOwner.view.spatialReference).radius;this._set("suspended",!this._extentIntersection.isVisibleInFrustum(v,m));w.madeProgress()}};b.__decorate([p.property({readOnly:!0})],a.Graphics3DFrustumVisibility.prototype,"suspended",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFrustumVisibility.prototype,"graphicsCoreOwner", void 0);b.__decorate([p.property({readOnly:!0})],a.Graphics3DFrustumVisibility.prototype,"updating",void 0);a.Graphics3DFrustumVisibility=b.__decorate([c.subclass("esri.views.3d.layers.graphics.Graphics3DFrustumVisibility")],a.Graphics3DFrustumVisibility);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObjectStates":function(){define(["exports","../../../../core/handleUtils","../../../../core/has","./Graphics3DObjectStateSet"],function(a,b, q,l){class p{constructor(k){this._graphicsCore=k;this._stateSets=[]}destroy(){this.reset();this._stateSets=null}reset(){this._stateSets&&(this._stateSets.forEach(k=>k.objectStateSet.removeAll()),this._stateSets.length=0)}acquireSet(k,h){const f=new l.Graphics3DObjectStateSet(k,h);this._stateSets.push(f);k=b.makeHandle(()=>this.releaseSet(f));return{set:f,handle:k}}releaseSet(k){k.objectStateSet.removeAll();k=this._stateSets?this._stateSets.indexOf(k):-1;-1!==k&&this._stateSets.splice(k,1)}setUid(k, h){k.ids.add(h);(h=this._graphicsCore.graphics3DGraphics.get(h))&&h.addObjectStateSet(k.stateType,k.objectStateSet)}setUids(k,h){h.forEach(f=>this.setUid(k,f))}setObjectIds(k,h){h.forEach(f=>k.ids.add(f));this._initializeSet(k)}addGraphic(k){this._stateSets.forEach(h=>{!h.paused&&h.hasGraphic(k)&&k.addObjectStateSet(h.stateType,h.objectStateSet)})}removeGraphic(k){this._stateSets.forEach(h=>{h.hasGraphic(k)&&k.removeObjectState(h.objectStateSet)})}allGraphicsDeleted(){this._stateSets&&this._stateSets.forEach(k=> k.objectStateSet.removeAll())}_initializeSet(k){const h=this._graphicsCore.graphics3DGraphics;k.objectIdField?h.forEach(f=>{f&&k.hasGraphic(f)&&f.addObjectStateSet(k.stateType,k.objectStateSet)}):k.ids.forEach(f=>{(f=h.get(f))&&f.addObjectStateSet(k.stateType,k.objectStateSet)})}get test(){}}a.Graphics3DObjectStates=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObjectStateSet":function(){define(["exports","../../webgl-engine/lib/Object3DStateSet"], function(a,b){class q{constructor(l,p){this.stateType=l;this.objectIdField=p;this.objectStateSet=new b.Object3DStateSet;this.ids=new Set;this.paused=!1}hasGraphic(l){return this.objectIdField?this.ids.has(l.graphic.attributes[this.objectIdField]):this.ids.has(l.graphic.uid)}}a.Graphics3DObjectStateSet=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Object3DStateSet":function(){define(["exports","./basicInterfaces"],function(a,b){function q(k){switch(k.type){case l.Object:k.objectStateId.channel=== b.Object3DState.Highlight?k.object.removeHighlight(k.objectStateId):k.objectStateId.channel===b.Object3DState.MaskOccludee&&k.object.removeOcclude(k.objectStateId);break;case l.RenderGeometry:k.owner.removeRenderGeometryObjectState(k.renderGeometry,k.objectStateId);break;case l.External:k.remove(k.objectStateId)}}var l;(function(k){k[k.Object=0]="Object";k[k.RenderGeometry=1]="RenderGeometry";k[k.External=2]="External";k[k.COUNT=3]="COUNT"})(l||={});class p{constructor(){this._items=[]}addObject(k, h){this._items.push({type:l.Object,objectStateId:h,object:k})}addRenderGeometry(k,h,f){this._items.push({type:l.RenderGeometry,objectStateId:h,renderGeometry:k,owner:f})}addExternal(k,h){this._items.push({type:l.External,objectStateId:h,remove:k})}remove(k){for(let h=this._items.length-1;0<=h;--h){const f=this._items[h];f.objectStateId===k&&(q(f),this._items.splice(h,1))}}removeObject(k){for(let h=this._items.length-1;0<=h;--h){const f=this._items[h];f.type===l.Object&&f.object===k&&(q(f),this._items.splice(h, 1))}}removeRenderGeometry(k){for(let h=this._items.length-1;0<=h;--h){const f=this._items[h];f.type===l.RenderGeometry&&f.renderGeometry===k&&(q(f),this._items.splice(h,1))}}removeAll(){this._items.forEach(k=>{q(k)});this._items=[]}}a.Object3DStateSet=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DScaleVisibility":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Logger ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/support/UpdatingHandles ../../../../geometry/projection/projectBoundingRect ../../../../geometry/support/aaBoundingRect ./enums ../../../support/layerViewUtils ../../../support/Scheduler ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){a.Graphics3DScaleVisibility=class extends q{constructor(r){super(r);this._layerScaleRangeVisibilityQuery=this._scaleRangeActive=!1;this._extent=null;this._updatingHandles=new c.UpdatingHandles;this.basemapTerrain=this.graphicsCore=this.queryGraphicUIDsInExtent=this.layer=this.graphicsCoreOwner=null;this.layerScaleEnabled=!0;this.suspended=!1;this._dirty=!0}initialize(){this.updateScaleRangeActive();this.addHandles(this.graphicsCoreOwner.view.resourceController.scheduler.registerTask(w.TaskPriority.SCALE_VISIBILITY, this));this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this.layerMinMaxScaleChangeHandler())}destroy(){this._updatingHandles.destroy();this.removeHandles();this._dirty=!1;this.basemapTerrain=this.graphicsCore=this.queryGraphicUIDsInExtent=this.layer=this.graphicsCoreOwner=this._extent=null}get updating(){return this._dirty||this._updatingHandles.updating}_setDirty(){this._dirty=!0}setExtent(r){const n=this.graphicsCoreOwner.view.spatialReference,u=this.graphicsCoreOwner.view.basemapTerrain.spatialReference; if(n===u)this._extent=r??null;else{const x=g.create();e.projectBoundingRect(r,n,x,u)?this._extent=x:this._extent=null}this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){var r=this.layer,n=r.effectiveScaleRange;n=this.layerScaleEnabled&&null!=n&&(0u&&(0<(u.minScale??0)||0<(u.maxScale??0))));r=this._scaleRangeActive!==n;(this._scaleRangeActive=n)&&!this.hasHandles("terrain-events")&&this.basemapTerrain? (this.addHandles(this.basemapTerrain.on("scale-change",u=>this._scaleUpdateHandler(u)),"terrain-events"),this.layerScaleEnabled&&this.addHandles(this.basemapTerrain.on("tiles-visibility-changed",()=>this._setDirty()),"terrain-events")):!n&&this.hasHandles("terrain-events")&&this.removeHandles("terrain-events");return r}get running(){return!(!this.graphicsCoreOwner.view.basemapTerrain||!this.updating)}runTask(r){const n=this.graphicsCoreOwner.view.basemapTerrain;if(this._extent&&n&&n.ready&&this._scaleRangeActive&& this.layerScaleEnabled){if(this._layerScaleRangeVisibilityQuery)return v.Yield;this._layerScaleRangeVisibilityQuery=!0;const {minScale:u,maxScale:x}=this.layer.effectiveScaleRange;n.queryVisibleScaleRange(this._extent,u,x,y=>this._finishUpdate(y))}else this._finishUpdate(!0);r.madeProgress()}_finishUpdate(r){this._layerScaleRangeVisibilityQuery=!1;this._set("suspended",!r);this._dirty=!1}_visibleAtLayerScale(r){const n=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||t.scaleBoundsPredicate(r, n.minScale||0,n.maxScale||0)}_visibleAtLabelScale(r,n){return t.scaleBoundsPredicate(r,n.minScale||0,n.maxScale||0)}_graphicScale(r){let n;null!=r.centroid?n=r.centroid:null!=r.graphic.geometry&&"point"===r.graphic.geometry.type&&(n=r.graphic.geometry);return n?this.graphicsCoreOwner.view.basemapTerrain?this.graphicsCoreOwner.view.basemapTerrain.getScale(n):1:null}_graphicVisible(r){if(!this.layerScaleEnabled)return!0;r=this._graphicScale(r);return this._visibleAtLayerScale(r)}updateVisibility(r){if(this._scaleRangeActive){const n= this._graphicVisible(r);return r.setVisibilityFlag(d.VisibilityGroup.GRAPHIC,d.VisibilityFlag.SCALE_RANGE,n)}return!1}updateGraphicLabelScaleVisibility(r){if(!this._scaleRangeActive||!r.labelLayers||0===r.labelLayers.length)return!1;const n=this._graphicScale(r);if(r=this._updateLabelScaleVisibility(r,n))this.graphicsCore.deconflictor?.setDirty(),this.graphicsCore.labeler?.setDirty();return r}_updateLabelScaleVisibility(r,n){if(!r.labelLayers||0===r.labelLayers.length)return!1;const u=r.labelLayers[0]._labelClass; return null!=u?.minScale&&null!=u.maxScale&&(n=this._visibleAtLabelScale(n,u),r.setVisibilityFlag(d.VisibilityGroup.LABEL,d.VisibilityFlag.SCALE_RANGE,n))?!0:!1}_scaleUpdateHandler(r){this._setDirty();if(this.graphicsCore.visible){var n=r.extent,u=r.scale,x=this._visibleAtLayerScale(u),y=!1,z=this.graphicsCoreOwner.view.spatialReference;r=r.spatialReference;if(null==r)l.getLogger(this).error("scaleUpdate: Internal error, no SpatialReference given for tiles");else{var A=!r.equals(z);A&&!e.projectBoundingRect(n, r,m,z)?l.getLogger(this).error("scaleUpdate: Internal error, cannot project AABR from "+r+" to wkid "+z):(this.queryGraphicUIDsInExtent(A?m:n,z,B=>{B=this.graphicsCore.getGraphics3DGraphicById(B);if(null!=B){var C=B.centroid;null!=C&&(n[0]>C.x||n[1]>C.y||n[2]r.setVisibilityFlag(d.VisibilityGroup.GRAPHIC,d.VisibilityFlag.SCALE_RANGE,!0)):this._scaleRangeActive&&this.graphicsCore.updateAllGraphicsVisibility();this._setDirty()}};b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"graphicsCoreOwner",void 0);b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"layer",void 0);b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"queryGraphicUIDsInExtent", void 0);b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"graphicsCore",void 0);b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"basemapTerrain",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DScaleVisibility.prototype,"layerScaleEnabled",void 0);b.__decorate([p.property({readOnly:!0})],a.Graphics3DScaleVisibility.prototype,"suspended",void 0);b.__decorate([p.property({readOnly:!0})],a.Graphics3DScaleVisibility.prototype,"updating",null);b.__decorate([p.property()], a.Graphics3DScaleVisibility.prototype,"_dirty",void 0);a.Graphics3DScaleVisibility=b.__decorate([f.subclass("esri.views.3d.layers.graphics.Graphics3DScaleVisibility")],a.Graphics3DScaleVisibility);const m=g.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/attributeUtils":function(){define(["exports"],function(a){a.attributeLookup=function(b,q,l){if(!l||null==q)return null;if(!b){a:{b=l.toLowerCase();for(var p in q)if(p.toLowerCase()===b){q=q[p]; break a}q=null}return q}return(p=b.get(l))?q[p.name]:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureVisibilityFilter":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/asyncUtils ../../../../core/Logger ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/support/UpdatingHandles ../../../../layers/support/FeatureFilter ../../../../layers/support/floorFilterUtils ../graphics/QueryEngine ../../../support/Scheduler ../../../support/Yield".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){a.FeatureVisibilityFilter=class extends q{constructor(u){super(u);this._queryEngine=this._frameTask=this._updateTask=null;this._updateRequested=!0;this._updatingHandles=new t.UpdatingHandles;this._updateVisibility=async x=>{if(null==this._compositedFeatureFilter&&null==this._sceneFilter||0===this.context.getFeatureCount())return await this._frameTask.schedule(()=>this.clear(),x);try{const y=await this._queryEngine.executeQueryForIdSet(this._compositedFeatureFilter, this._sceneFilter,x);h.throwIfAborted(x);return await this._frameTask.schedule(()=>{this.context.updateFeatureVisibilities(z=>y.has(z))},x)}catch(y){return h.throwIfAbortError(y),p.getLogger(this).warn(`FeatureFilter query failed: ${y}`,{error:y}),await this._frameTask.schedule(()=>{this.context.setAllFeaturesVisibility(!0)},x)}}}initialize(){const u=r.TaskPriority.FILTER_VISIBILITY,{layer:x,view:y}=this._configuration,{featureStore:z}=this.context;this._queryEngine=new m.QueryEngine({context:{spatialReference:y.spatialReference, layer:x,scheduler:y.resourceController.scheduler,featureStore:z,hasM:this._configuration.hasM??!1,hasZ:this._configuration.hasZ??!1},priority:u});this._frameTask=y.resourceController.scheduler.registerTask(u,this);this._updatingHandles.add(()=>[this._compositedFeatureFilter,this._sceneFilter],()=>this.reapply(),f.initial)}destroy(){this._updateRequested=!1;this._updatingHandles.destroy();this.clear();this._updateTask=k.abortMaybe(this._updateTask);this._frameTask=k.removeMaybe(this._frameTask);this._queryEngine= k.destroyMaybe(this._queryEngine);this._set("context",null)}get updating(){return this.running||this._updatingHandles.updating||null!=this._updateTask&&!this._updateTask.finished}get running(){return this._updateRequested||this._frameTask.updating}get defaultVisibility(){return null==this._compositedFeatureFilter&&null==this._sceneFilter}get _featureFilter(){return"filter"in this._configuration?this._configuration.filter:null}get _sceneFilter(){return"layerFilter"in this._configuration?this._configuration.layerFilter: null}get _floorFilter(){return v.getFloorFilterClause(this._configuration)}get _timeExtent(){return"timeExtent"in this._configuration?this._configuration.timeExtent:null}get _compositedFeatureFilter(){const {_featureFilter:u,_timeExtent:x,_floorFilter:y}=this;if(null==x&&null==y)return u;const z=null!=u?u.clone():new w;null!=x&&(z.timeExtent=null!=z.timeExtent?z.timeExtent.intersection(x):x);null!=y&&(z.where=null==z.where||""===z.where?y:`(${z.where}) AND (${y})`);return z}get _configuration(){return this.context.configuration}reapply(){this._updateRequested= !0}clear(){this._queryEngine.clear();this.context.clearFeaturesVisibility()}runTask(u){this._updateRequested&&(this._updateTask=k.abortMaybe(this._updateTask),this._updateTask=l.createTask(this._updateVisibility),this._updateRequested=!1,u.madeProgress());this._frameTask.processQueue(u);if(!u.hasProgressed)return n.Yield}};b.__decorate([c.property({constructOnly:!0})],a.FeatureVisibilityFilter.prototype,"context",void 0);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"updating",null); b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"running",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"defaultVisibility",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_featureFilter",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_sceneFilter",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_floorFilter",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_timeExtent", null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_compositedFeatureFilter",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_configuration",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_updateTask",void 0);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_updateRequested",void 0);a.FeatureVisibilityFilter=b.__decorate([d.subclass("esri.views.3d.layers.support.FeatureVisibilityFilter")],a.FeatureVisibilityFilter); Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/floorFilterUtils":function(){define(["exports"],function(a){function b(q,l){if(!q?.length)return null;q=q.filter(p=>""!==p).map(p=>`'${p}'`);q.push("''");return`${l} IN (${q.join(",")}) OR ${l} IS NULL`}a.getFloorFilterClause=function(q){const l=q.layer;return"floorInfo"in l&&l.floorInfo?.floorField&&"floors"in q.view?b(q.view.floors,l.floorInfo.floorField):null};a.getLayerFloorFilterClause=function(q,l){return"floorInfo"in l&&l.floorInfo?.floorField?b(q,l.floorInfo.floorField):null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/QueryEngine":function(){define("exports ../../../../chunks/tslib.es6 ../../../../geometry ../../../../core/Accessor ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Extent ../../../../layers/graphics/data/QueryEngine ../../../../layers/support/FieldsIndex ../../../../rest/support/FeatureSet ../../../../rest/support/Query ../../../../geometry/support/typeUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){const m=g.QueryEngine;a.QueryEngine=class extends l{get layer(){return this.context.layer}get spatialReference(){return this.context.spatialReference}get _queryGeometryType(){switch(this.layer.geometryType){case "multipoint":case "point":case "polygon":case "polyline":return this.layer.geometryType;case "mesh":return"polygon"}}get defaultQueryJSON(){return(new w({outSpatialReference:this.spatialReference})).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}constructor(r){super(r); this._dataQueryEngineInstance=null}destroy(){this.clear()}clear(){return this._dataQueryEngineInstance?(this._dataQueryEngineInstance.destroy(),this._dataQueryEngineInstance=null,!0):!1}async executeQueryForIdSet(r,n,u){return this._dataQueryEngine.executeQueryForIdSet(this._ensureQueryJSON(r,n),u)}async executeQueryForCount(r,n){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(r),n)}async executeQueryForExtent(r,n){const {count:u,extent:x}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(r), n);r=e.fromJSON(x);return{count:u,extent:r}}async executeQueryForIds(r,n){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(r),n)}async executeQueryForLatestObservations(r,n){r=await this._dataQueryEngine.executeQueryForLatestObservations(this._ensureQueryJSON(r),n);r=t.fromJSON(r);r.features.forEach(u=>{u.layer=this.layer;u.sourceLayer=this.layer});return r}async executeQuery(r,n){r=await this._dataQueryEngine.executeQuery(this._ensureQueryJSON(r),n);r=t.fromJSON(r);r.features.forEach(u=> {u.layer=this.layer;u.sourceLayer=this.layer});return r}_ensureQueryJSON(r,n){let u=this.defaultQueryJSON;null!=r&&("outSpatialReference"in r&&!r.outSpatialReference&&(r.outSpatialReference=this.spatialReference),u=r.toJSON());null!=n&&(r=n.geometries.map(x=>x.toJSON()).reduce((x,y)=>{x.rings=x.rings.concat(y.rings);return x}),u={...u,sceneFilter:{...n,geometry:r}});return u}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const r="timeInfo"in this.layer&& this.layer.timeInfo?.toJSON()||null,n=this.layer.objectIdField,u=v.featureGeometryTypeKebabDictionary.toJSON(this._queryGeometryType),x=this.layer.fieldsIndex?.toJSON()||new d([]),y=this.priority,z=this.spatialReference.toJSON(),{hasZ:A,hasM:B,featureStore:C,scheduler:D}=this.context;return this._dataQueryEngineInstance=new m({hasZ:A,hasM:B,geometryType:u,fieldsIndex:x,timeInfo:r,spatialReference:z,objectIdField:n,featureStore:C,scheduler:D,priority:y})}};b.__decorate([p.property({constructOnly:!0})], a.QueryEngine.prototype,"context",void 0);b.__decorate([p.property({constructOnly:!0})],a.QueryEngine.prototype,"priority",void 0);b.__decorate([p.property()],a.QueryEngine.prototype,"layer",null);b.__decorate([p.property()],a.QueryEngine.prototype,"spatialReference",null);b.__decorate([p.property()],a.QueryEngine.prototype,"_queryGeometryType",null);b.__decorate([p.property()],a.QueryEngine.prototype,"defaultQueryJSON",null);a.QueryEngine=b.__decorate([c.subclass("esri.views.3d.layers.graphics.QueryEngine")], a.QueryEngine);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/QueryEngine":function(){define("exports ../../../core/arrayUtils ../../../core/Error ../../../core/JSONSupport ../../../core/lang ../../../core/maybe ../../../core/MemCache ../../../core/promiseUtils ../../../core/unitUtils ../../../geometry/projection ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/boundsUtils ../../../geometry/support/jsonUtils ../../../geometry/support/normalizeUtils ../../../geometry/support/spatialReferenceUtils ../featureConversionUtils ./attributeSupport ./geometryUtils ./projectionSupport ./QueryEngineCapabilities ./QueryEngineResult ./queryUtils ./queryValidationUtils ./spatialQuerySupport ./timeSupport ../../support/FieldsIndex ../../../views/support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H){function N(L){if(C.canQueryWithRBush(L)){if(w.isExtent(L))return[d.fromValues(Math.min(L.xmin,L.xmax),Math.min(L.ymin,L.ymax),Math.max(L.xmin,L.xmax),Math.max(L.ymin,L.ymax))];if(w.isPolygon(L))return L.rings.map(P=>d.fromValues(Math.min(P[0][0],P[2][0]),Math.min(P[0][1],P[2][1]),Math.max(P[0][0],P[2][0]),Math.max(P[0][1],P[2][1])))}return[t.getBoundsXY(d.create(),L)]}class E{constructor(L,P=null,M,K,J){this.attributes=L;this.geometry= M;this.centroid=K;this.filterFlags=J;this.groupId=-1;this.displayId=P}}const G=new h.MemCacheStorage(2E6);let I=0;class O{constructor(L){this._changeHandle=this._geometryQueryCache=null;this.capabilities={query:y.queryCapabilities};this.geometryType=L.geometryType;this.hasM=!!L.hasM;this.hasZ=!!L.hasZ;this.objectIdField=L.objectIdField;this.spatialReference=L.spatialReference;this.definitionExpression=L.definitionExpression;this.featureStore=L.featureStore;this.aggregateAdapter=L.aggregateAdapter; this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache());this.timeInfo=L.timeInfo;L.cacheSpatialQueries&&(this._geometryQueryCache=new h.MemCache(I++ +"$$",G));this.fieldsIndex=l.isSerializable(L.fieldsIndex)?L.fieldsIndex:F.fromJSON(L.fieldsIndex);this.availableFields=!L.availableFields||1===L.availableFields.length&&"*"===L.availableFields[0]?new Set(this.fieldsIndex.fields.map(P=>P.name)):new Set(L.availableFields.map(P=>this.fieldsIndex.get(P)?.name).filter(P=>null!=P)); L.scheduler&&L.priority&&(this._frameTask=L.scheduler.registerTask(L.priority))}destroy(){this._frameTask=k.removeMaybe(this._frameTask);this.clearCache();k.destroyMaybe(this._geometryQueryCache);this._changeHandle=k.removeMaybe(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear();this._fullExtentPromise=this._timeExtentPromise=this._allFeaturesPromise=null}async executeQuery(L,P){P=f.signalFromSignalOrOptions(P);try{return(await this._executeQuery(L, {},P)).createQueryResponse()}catch(M){if(M!==A.queryEngineEmptyResult)throw M;return(new z.QueryEngineResult([],L,this)).createQueryResponse()}}async executeQueryForCount(L={},P){P=f.signalFromSignalOrOptions(P);try{return(await this._executeQuery(L,{returnGeometry:!1,returnCentroid:!1,outSR:null},P)).createQueryResponseForCount()}catch(M){if(M!==A.queryEngineEmptyResult)throw M;return 0}}async executeQueryForExtent(L,P){P=f.signalFromSignalOrOptions(P);const M=L.outSR;try{const K=await this._executeQuery(L, {returnGeometry:!0,returnCentroid:!1,outSR:null},P),J=K.size;if(!J)return{count:0,extent:null};const R=await this._getBounds(K.items,K.spatialReference,M||this.spatialReference);return{count:J,extent:R}}catch(K){if(K===A.queryEngineEmptyResult)return{count:0,extent:null};throw K;}}async executeQueryForIds(L,P){return this.executeQueryForIdSet(L,P).then(M=>Array.from(M))}async executeQueryForIdSet(L,P){P=f.signalFromSignalOrOptions(P);try{const M=await this._executeQuery(L,{returnGeometry:!0,returnCentroid:!1, outSR:null},P),K=M.items,J=new Set;await this._reschedule(()=>{for(const R of K)J.add(M.featureAdapter.getObjectId(R))},P);return J}catch(M){if(M===A.queryEngineEmptyResult)return new Set;throw M;}}async executeQueryForSnapping(L,P){const M=f.signalFromSignalOrOptions(P),{point:K,distance:J,returnEdge:R,vertexMode:Q}=L;if(!R&&"none"===Q)return{candidates:[]};let W=p.clone(L.query);W=await this._schedule(()=>A.normalizeQueryLike(W,this.definitionExpression,this.spatialReference),M);W=await this._reschedule(()=> B.validateQuery(W,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),M);(P=!m.equals(K.spatialReference,this.spatialReference))&&await x.checkProjectionSupport(K.spatialReference,this.spatialReference);var S="number"===typeof J?J:J.x,V="number"===typeof J?J:J.y;S={xmin:K.x-S,xmax:K.x+S,ymin:K.y-V,ymax:K.y+V,spatialReference:K.spatialReference};S=P?x.project(S,this.spatialReference):S;if(!S)return{candidates:[]}; V=(await v.normalizeCentralMeridian(w.fromJSON(K),null,{signal:M}))[0];const T=(await v.normalizeCentralMeridian(w.fromJSON(S),null,{signal:M}))[0];if(null==V||null==T)return{candidates:[]};const Y=new z.QueryEngineResult(await this._reschedule(()=>this._searchFeatures(N(T.toJSON())),M),W,this);await this._reschedule(()=>this._executeObjectIdsQuery(Y),M);await this._reschedule(()=>this._executeTimeQuery(Y),M);await this._reschedule(()=>this._executeAttributesQuery(Y),M);await this._reschedule(()=> this._executeGeometryQueryForSnapping(Y,M),M);V=V.toJSON();V=P?x.project(V,this.spatialReference):V;return Y.createSnappingResponse({...L,point:V,distance:P?Math.max(S.xmax-S.xmin,S.ymax-S.ymin)/2:J},K.spatialReference)}async executeQueryForLatestObservations(L,P){P=f.signalFromSignalOrOptions(P);if(!this.timeInfo?.trackIdField)throw new q("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:L,timeInfo:this.timeInfo});try{const M=await this._executeQuery(L,{},P);await this._reschedule(()=> this._filterLatest(M),P);return M.createQueryResponse()}catch(M){if(M!==A.queryEngineEmptyResult)throw M;return(new z.QueryEngineResult([],L,this)).createQueryResponse()}}async executeQueryForSummaryStatistics(L={},P,M){M=f.signalFromSignalOrOptions(M);const {field:K,normalizationField:J,valueExpression:R}=P;return(await this._executeQueryForStatistics(L,{field:K,normalizationField:J,valueExpression:R},M)).createSummaryStatisticsResponse(P)}async executeQueryForUniqueValues(L={},P,M){M=f.signalFromSignalOrOptions(M); const {field:K,field2:J,field3:R,valueExpression:Q}=P;return(await this._executeQueryForStatistics(L,{field:K,field2:J,field3:R,valueExpression:Q},M)).createUniqueValuesResponse(P)}async executeQueryForClassBreaks(L={},P,M){M=f.signalFromSignalOrOptions(M);const {field:K,normalizationField:J,valueExpression:R}=P;return(await this._executeQueryForStatistics(L,{field:K,normalizationField:J,valueExpression:R},M)).createClassBreaksResponse(P)}async executeQueryForHistogram(L={},P,M){M=f.signalFromSignalOrOptions(M); const {field:K,normalizationField:J,valueExpression:R}=P;return(await this._executeQueryForStatistics(L,{field:K,normalizationField:J,valueExpression:R},M)).createHistogramResponse(P)}async fetchRecomputedExtents(L){L=f.signalFromSignalOrOptions(L);this._timeExtentPromise||(this._timeExtentPromise=D.getTimeExtent(this.timeInfo,this.featureStore));const [P,M]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);f.throwIfAborted(L);return{fullExtent:P,timeExtent:M}}async _getBounds(L, P,M){const K=g.set(g.create(),g.negativeInfinity);await this.featureStore.forEachBounds(L,J=>g.expandWithAABB(K,J));L={xmin:K[0],ymin:K[1],xmax:K[3],ymax:K[4],spatialReference:u.cleanFromGeometryEngine(this.spatialReference)};this.hasZ&&isFinite(K[2])&&isFinite(K[5])&&(L.zmin=K[2],L.zmax=K[5],L.hasZ=!0);P=x.project(L,P,M);P.spatialReference=u.cleanFromGeometryEngine(M);0===P.xmax-P.xmin&&(M=c.getMetersPerUnitForSR(P.spatialReference),P.xmin-=M,P.xmax+=M);0===P.ymax-P.ymin&&(M=c.getMetersPerUnitForSR(P.spatialReference), P.ymin-=M,P.ymax+=M);this.hasZ&&null!=P.zmin&&null!=P.zmax&&0===P.zmax-P.zmin&&(M=c.getMetersPerUnitForSR(P.spatialReference),P.zmin-=M,P.zmax+=M);return P}_getFullExtent(){this._fullExtentPromise||(this._fullExtentPromise="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(L=>this._getBounds(L,this.spatialReference,this.spatialReference)));return this._fullExtentPromise}async _schedule(L, P){return null!=this._frameTask?this._frameTask.schedule(L,P):L(H.noBudget)}async _reschedule(L,P){return null!=this._frameTask?this._frameTask.reschedule(L,P):L(H.noBudget)}async _getAllFeaturesQueryEngineResult(L){return new z.QueryEngineResult(await this._getAllFeatures(),L,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const M=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(K=>M.push(K))})().then(()=>M)}const L=this._allFeaturesPromise,P=await L;return L=== this._allFeaturesPromise?P.slice():this._getAllFeatures()}async _executeQuery(L,P,M){L=p.clone(L);L=await this._schedule(()=>A.normalizeQuery(L,this.definitionExpression,this.spatialReference),M);L=await this._reschedule(()=>B.validateQuery(L,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),M);L={...L,...P};const K=await this._reschedule(()=>this._executeSceneFilterQuery(L,M),M),J=await this._reschedule(()=> this._executeGeometryQuery(L,K,M),M);await this._reschedule(()=>this._executeAggregateIdsQuery(J),M);await this._reschedule(()=>this._executeObjectIdsQuery(J),M);await this._reschedule(()=>this._executeTimeQuery(J),M);await this._reschedule(()=>this._executeAttributesQuery(J),M);return J}async _executeSceneFilterQuery(L,P){if(null==L.sceneFilter)return null;const {outSR:M,returnGeometry:K,returnCentroid:J}=L;var R=this.featureStore.featureSpatialReference,Q=L.sceneFilter.geometry;const W=null==R|| m.equals(R,Q.spatialReference)?Q:x.project(Q,R);if(!W)return null;R=K||J;R=m.isValid(M)&&!m.equals(this.spatialReference,M)&&R?async Y=>this._project(Y,M):Y=>Y;const S=this.featureAdapter;Q=await this._reschedule(()=>this._searchFeatures(N(W)),P);if("disjoint"===L.sceneFilter.spatialRelationship){if(!Q.length)return null;const Y=new Set;for(var V of Q)Y.add(S.getObjectId(V));const ha=await this._reschedule(()=>this._getAllFeatures(),P);V=await this._reschedule(async()=>{const ba=await C.getSpatialQueryOperator("esriSpatialRelDisjoint", W,this.geometryType,this.hasZ,this.hasM),U=await this._runSpatialFilter(ha,Z=>!Y.has(S.getObjectId(Z))||ba(S.getGeometry(Z)),P);return new z.QueryEngineResult(U,L,this)},P);return R(V)}if(!Q.length)return new z.QueryEngineResult([],L,this);if(this._canExecuteSinglePass(W,L))return R(new z.QueryEngineResult(Q,L,this));const T=await C.getSpatialQueryOperator("esriSpatialRelContains",W,this.geometryType,this.hasZ,this.hasM);V=await this._runSpatialFilter(Q,Y=>T(S.getGeometry(Y)),P);return R(new z.QueryEngineResult(V, L,this))}async _executeGeometryQuery(L,P,M){if(null!=P&&0===P.items.length)return P;L=null!=P?P.query:L;const {geometry:K,outSR:J,spatialRel:R,returnGeometry:Q,returnCentroid:W}=L;var S=this.featureStore.featureSpatialReference;const V=!K||null==S||m.equals(S,K.spatialReference)?K:x.project(K,S),T=Q||W,Y=m.isValid(J)&&!m.equals(this.spatialReference,J),ha=this._geometryQueryCache&&null==P?Y&&T?JSON.stringify({originalFilterGeometry:K,spatialRelationship:R,outSpatialReference:J}):JSON.stringify({originalFilterGeometry:K, spatialRelationship:R}):null;S=ha?this._geometryQueryCache.get(ha):null;if(null!=S)return new z.QueryEngineResult(S,L,this);S=async ea=>{Y&&T&&await this._project(ea,J);ha&&this._geometryQueryCache.put(ha,ea.items,ea.items.length+1);return ea};if(!V)return S(null!=P?P:await this._getAllFeaturesQueryEngineResult(L));const ba=this.featureAdapter;let U=await this._reschedule(()=>this._searchFeatures(N(K)),M);if("esriSpatialRelDisjoint"===R){if(!U.length)return S(null!=P?P:await this._getAllFeaturesQueryEngineResult(L)); const ea=new Set;for(var Z of U)ea.add(ba.getObjectId(Z));const da=null!=P?P.items:await this._reschedule(()=>this._getAllFeatures(),M);Z=await this._reschedule(async()=>{const ia=await C.getSpatialQueryOperator(R,V,this.geometryType,this.hasZ,this.hasM),ka=await this._runSpatialFilter(da,fa=>!ea.has(ba.getObjectId(fa))||ia(ba.getGeometry(fa)),M);return new z.QueryEngineResult(ka,L,this)},M);return S(Z)}if(null!=P){const ea=new b.PositionHint;U=U.filter(da=>0<=b.indexOf(P.items,da,P.items.length, ea))}if(!U.length)return S=new z.QueryEngineResult([],L,this),ha&&this._geometryQueryCache.put(ha,S.items,1),S;if(this._canExecuteSinglePass(V,L))return S(new z.QueryEngineResult(U,L,this));const ca=await C.getSpatialQueryOperator(R,V,this.geometryType,this.hasZ,this.hasM);Z=await this._runSpatialFilter(U,ea=>ca(ba.getGeometry(ea)),M);return S(new z.QueryEngineResult(Z,L,this))}async _executeGeometryQueryForSnapping(L,P){const {query:M}=L,{spatialRel:K}=M;if(L?.items?.length&&M.geometry&&K){var J= await C.getSpatialQueryOperator(K,M.geometry,this.geometryType,this.hasZ,this.hasM);P=await this._runSpatialFilter(L.items,R=>J(R.geometry),P);L.items=P}}_executeAggregateIdsQuery(L){if(0!==L.items.length&&L.query.aggregateIds?.length&&null!=this.aggregateAdapter){var P=new Set;for(const K of L.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(K).forEach(J=>P.add(J));var M=this.featureAdapter.getObjectId;L.items=L.items.filter(K=>P.has(M(K)))}}_executeObjectIdsQuery(L){if(0!==L.items.length&& L.query.objectIds?.length){var P=new Set(L.query.objectIds),M=this.featureAdapter.getObjectId;L.items=L.items.filter(K=>P.has(M(K)))}}_executeTimeQuery(L){if(0!==L.items.length){var P=D.getTimeOperator(this.timeInfo,L.query.timeExtent,this.featureAdapter);null!=P&&(L.items=L.items.filter(P))}}_executeAttributesQuery(L){if(0!==L.items.length){var P=n.getWhereClause(L.query.where,this.fieldsIndex);if(P){if(!P.isStandardized)throw new TypeError("Where clause is not standardized");L.items=L.items.filter(M=> P.testFeature(M,this.featureAdapter))}}}async _runSpatialFilter(L,P,M){if(!P)return L;if(null==this._frameTask)return L.filter(Q=>P(Q));let K=0;const J=[],R=async Q=>{for(;KR(S),M)}};return this._reschedule(Q=>R(Q),M).then(()=>J)}_filterLatest(L){const {trackIdField:P,startTimeField:M,endTimeField:K}=this.timeInfo,J=K||M,R=new Map,Q=this.featureAdapter.getAttribute;for(const W of L.items){const S=Q(W,P), V=Q(W,J),T=R.get(S);(!T||V>Q(T,J))&&R.set(S,W)}L.items=Array.from(R.values())}_canExecuteSinglePass(L,P){({spatialRel:P}=P);return C.canQueryWithRBush(L)&&("esriSpatialRelEnvelopeIntersects"===P||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===P||"esriSpatialRelContains"===P))}async _project(L,P){if(!P||m.equals(this.spatialReference,P))return L;const M=this.featureAdapter;let K=void 0;try{const J=await this._getFullExtent();K=e.getTransformation(this.spatialReference,P,J)}catch{}P= await x.projectMany(L.items.map(J=>u.getGeometry(this.geometryType,this.hasZ,this.hasM,M.getGeometry(J))),this.spatialReference,P,K);L.items=P.map((J,R)=>M.cloneWithGeometry(L.items[R],r.convertFromGeometry(J,this.hasZ,this.hasM)));return L}async _searchFeatures(L){const P=new Set;await Promise.all(L.map(M=>this.featureStore.forEachInBounds(M,K=>P.add(K))));L=Array.from(P.values());P.clear();return L}async _executeQueryForStatistics(L,P,M){L=p.clone(L);try{L=await this._schedule(()=>A.normalizeQuery(L, this.definitionExpression,this.spatialReference),M);L=await this._reschedule(()=>B.validateStatisticsQuery(L,P,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),M);const K=await this._reschedule(()=>this._executeSceneFilterQuery(L,M),M),J=await this._reschedule(()=>this._executeGeometryQuery(L,K,M),M);await this._reschedule(()=>this._executeAggregateIdsQuery(J),M);await this._reschedule(()=>this._executeObjectIdsQuery(J), M);await this._reschedule(()=>this._executeTimeQuery(J),M);await this._reschedule(()=>this._executeAttributesQuery(J),M);return J}catch(K){if(K!==A.queryEngineEmptyResult)throw K;return new z.QueryEngineResult([],L,this)}}}a.Feature=E;a.QueryEngine=O;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/attributeSupport":function(){define(["exports","../../../core/Error","../../../core/sql/WhereClauseCache","../../support/fieldType"],function(a,b,q,l){function p(w, v,m={}){const r=k(v,w);if(!r)throw m=g.getError(v,w),new b("unsupported-query","invalid SQL expression",{expression:v,error:m});w=m.expressionName||"expression";if(m.validateStandardized&&!r.isStandardized)throw new b("unsupported-query",`${w} is not standard`,{expression:v});if(m.validateAggregate&&!r.isAggregate)throw new b("unsupported-query",`${w} does not contain a valid aggregate function`,{expression:v});return r.fieldNames}function k(w,v){return w?g.get(w,v):null}function h(w){return/\((.*?)\)/.test(w)? w:w.split(" as ")[0]}function f(w,v,m,r={}){const n=new Map;c(n,w,v,r.allowedFieldTypes??t,m);if(n.size)throw new b("unsupported-query",`${r.expressionName??"expression"} contains invalid or missing fields`,{errors:Array.from(n.values()),query:r.query});}function c(w,v,m,r,n){n=n.includes("*")?[...m,...n.filter(u=>"*"!==u)]:n;for(const u of n)if(v.get(u))e(w,v,m,r,u);else try{const x=h(u),y=p(v,x,{validateStandardized:!0});for(const z of y)e(w,v,m,r,z)}catch(x){w.set(u,{type:"expression-error",expression:u, error:x})}}function e(w,v,m,r,n){(v=v.get(n))?m.has(v.name)?"all"!==r&&!1===r?.has(v.type)&&w.set(n,{type:"invalid-type",fieldName:v.name,fieldType:l.kebabDict.fromJSON(v.type),allowedFieldTypes:Array.from(r,u=>l.kebabDict.fromJSON(u))}):w.set(n,{type:"missing-field",fieldName:v.name}):w.set(n,{type:"invalid-field",fieldName:n})}const g=new q.WhereClauseCache(50,500);q=new Set("esriFieldTypeOID esriFieldTypeSmallInteger esriFieldTypeBigInteger esriFieldTypeInteger esriFieldTypeSingle esriFieldTypeDouble esriFieldTypeLong".split(" ")); const d=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),t=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...q,...d]);a.allDateAndTimeFieldTypes=d;a.getAliasFromFieldName=function(w){return w.split(" as ")[1]};a.getExpressionFromFieldName=h;a.getWhereClause=k;a.numericFieldTypes=q;a.validateFields=f;a.validateHaving=function(w,v,m,r,n){if(!m)return!0;const u=p(w,m,{validateAggregate:!0,expressionName:"having clause"}); f(w,v,u,{expressionName:"having clause",query:n});if(!k(m,w)?.getExpressions().every(x=>{const {aggregateType:y,field:z}=x,A=w.get(z)?.name;return r.some(B=>{const {onStatisticField:C,statisticType:D}=B;return w.get(C)?.name===A&&D.toLowerCase().trim()===y})}))throw new b("unsupported-query","expressions in having clause should also exist in outStatistics",{having:m});return!0};a.validateWhere=function(w,v,m,r){if(!m)return!0;m=p(w,m,{validateStandardized:!0,expressionName:"where clause"});f(w,v, m,{expressionName:"where clause",query:r});return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/WhereClauseCache":function(){define(["exports","../LRUCache","./WhereClause"],function(a,b,q){class l{constructor(p,k){this._cache=new b.LRUCache(p);this._invalidCache=new b.LRUCache(k)}get(p,k){const h=`${k.uid}:${p}`,f=this._cache.get(h);if(f)return f;if(null!=this._invalidCache.get(h))return null;try{const c=q.WhereClause.create(p,k);this._cache.put(h,c);return c}catch(c){return this._invalidCache.put(h, c),null}}getError(p,k){return this._invalidCache.get(`${k.uid}:${p}`)??null}}a.WhereClauseCache=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/WhereClause":function(){define("exports ../../arcade/ArcadeDate ../../arcade/featureset/support/errorsupport ../has ./AggregateFunctions ./DateOnly ./sqlArithmeticUtils ./sqlCompareUtils ./sqlDateParsingUtils ./SqlInterval ./SqlTimestampOffset ./StandardizedFunctions ./TimeOnly ./WhereGrammar ../../chunks/datetime".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(H){return Array.isArray(H)?H:[H]}function r(H){return null!==H?!0!==H:null}function n(H,N){return null!=H&&null!=N?!0===H&&!0===N:!1===H||!1===N?!1:null}function u(H,N){return null!=H&&null!=N?!0===H||!0===N:!0===H||!0===N?!0:null}function x(H,N,E){if(null==H)return null;E=!1;for(const G of N)if(null==G)E=null;else if(H===G){E=!0;break}else if(f.isDateOrTimeValue(H)&&f.isDateOrTimeValue(G)&&(E=f.sqlCompare(H,G,"\x3d")))break;return E}function y(H, N,E){if(null==H)return null;let G="",I=D.Normal;for(let O=0;O{"current-time"===H.type?this._hasDateFunctions=!0:"function"===H.type&&(this._hasDateFunctions=this._hasDateFunctions||A.has(H.name.toLowerCase()))});return this._hasDateFunctions}getFunctions(){const H=new Set;this._visitAll(this.parseTree,N=>{"function"===N.type&&H.add(N.name.toLowerCase())});return Array.from(H)}getExpressions(){const H= new Map;this._visitAll(this.parseTree,N=>{if("function"===N.type){const E=N.name.toLowerCase();N=N.args.value[0];if("column-reference"===N.type){N=N.column;const G=`${E}-${N}`;H.has(G)||H.set(G,{aggregateType:E,field:N})}}});return[...H.values()]}getVariables(){const H=new Set;this._visitAll(this.parseTree,N=>{"parameter"===N.type&&H.add(N.value.toLowerCase())});return Array.from(H)}_compileMe(){const H="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion= (new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone",H)).bind(B)}_extractExpressionInfo(H){const N=[],E=new Set;let G=!0,I=!1;this._visitAll(this.parseTree,O=>{switch(O.type){case "column-reference":var L=H?.get(O.column);let P;L?L=P=L.name??"":(P=O.column,L=P.toLowerCase());E.has(L)||(E.add(L),N.push(P));O.column=P;break;case "function":const {name:M,args:K}=O;O=K.value.length;G&&=d.isStandardized(M,O);!1===I&&(I=p.isAggregate(M,O))}});return{referencedFieldNames:Array.from(N), isStandardized:G,isAggregate:I}}_visitAll(H,N){if(null!=H)switch(N(H),H.type){case "when-clause":this._visitAll(H.operand,N);this._visitAll(H.value,N);break;case "case-expression":for(const E of H.clauses)this._visitAll(E,N);"simple"===H.format&&this._visitAll(H.operand,N);null!==H.else&&this._visitAll(H.else,N);break;case "expression-list":for(const E of H.value)this._visitAll(E,N);break;case "unary-expression":this._visitAll(H.expr,N);break;case "binary-expression":this._visitAll(H.left,N);this._visitAll(H.right, N);break;case "function":this._visitAll(H.args,N)}}evaluateNodeToJavaScript(H){switch(H.type){case "interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(H.value)+", "+JSON.stringify(H.qualifier)+","+JSON.stringify(H.op)+")";case "case-expression":var N="";if("simple"===H.format){var E=this.evaluateNodeToJavaScript(H.operand);N="( ";for(let G=0;Gd?e-d:0}function k(e,g=!0){if(e instanceof l.Zone)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return q.UnknownTimeZone.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const d=l.FixedOffsetZone.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(d)return d}e=l.IANAZone.create(e);if(!e.isValid){if(g)throw new f(a.ArcadeDateErrorCodes.TimeZoneNotRecognized); return null}return e}a.ArcadeDateErrorCodes=void 0;(a.ArcadeDateErrorCodes||(a.ArcadeDateErrorCodes={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const h={[a.ArcadeDateErrorCodes.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class f extends Error{constructor(e,g){super(b.replace(h[e],g));this.declaredRootClass="esri.arcade.arcadedate.dateerror";Error.captureStackTrace&&Error.captureStackTrace(this,f)}}class c{constructor(e){this._date=e;this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e= 0,g=1,d=1,t=0,w=0,v=0,m=0,r){if(isNaN(e)||isNaN(g)||isNaN(d)||isNaN(t)||isNaN(w)||isNaN(v)||isNaN(m))return null;const n=l.DateTime.local(e,g).daysInMonth;e=l.DateTime.fromObject({day:1>d?1:d>n?n:d,year:e,month:1>g?1:12t?0:23w?0:59v?0:59m?0:999=g&&(t=v,w=g);return t}function c(g){if(null===g)return null;g=g.filter(w=>null!==w);if(0===g.length)return null;const d=h(g);if(null===d)return null;let t=0;for(const w of g){if("number"!== typeof w)throw new b.SqlError(b.SqlErrorCodes.InvalidValueForAggregateFunction);t+=(d-w)**2}return t/(g.length-1)}const e={min:{minParams:1,maxParams:1,evaluate:g=>f(g[0],"min")},max:{minParams:1,maxParams:1,evaluate:g=>f(g[0],"max")},avg:{minParams:1,maxParams:1,evaluate:g=>h(g[0])},sum:{minParams:1,maxParams:1,evaluate:g=>{g=g[0];if(null===g)g=null;else{var d=0;for(let t=0;t{g=g[0];null===g?g=null:(g=c(g),g=null===g?null:Math.sqrt(g));return g}},count:{minParams:1,maxParams:1,evaluate:g=>null==g[0]?null:g[0].length},var:{minParams:1,maxParams:1,evaluate:g=>c(g[0])}};a.aggregateFunction=function(g,d){const t=e[g.toLowerCase()];if(null==t)throw new b.SqlError(b.SqlErrorCodes.FunctionNotRecognized);if(d.lengtht.maxParams)throw new b.SqlError(b.SqlErrorCodes.InvalidParameterCount,{name:g.toUpperCase()}); return t.evaluate(d)};a.isAggregate=function(g,d){g=e[g.toLowerCase()];return null!=g&&d>=g.minParams&&d<=g.maxParams};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/DateOnly":function(){define(["exports","../../arcade/ArcadeDate","../../intl/locale","../../chunks/datetime"],function(a,b,q,l){function p(h){h=h.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$\x26]");let f="";const c=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; for(const e of h.match(c)||[])switch(e){case "D":f+="d";break;case "DD":f+="dd";break;case "DDD":f+="o";break;case "d":f+="c";break;case "ddd":f+="ccc";break;case "dddd":f+="cccc";break;case "M":f+="L";break;case "MM":f+="LL";break;case "MMM":f+="LLL";break;case "MMMM":f+="LLLL";break;case "YY":f+="yy";break;case "Y":case "YYYY":f+="yyyy";break;case "Q":f+="q";break;case "X":case "x":f+=e;break;default:f=2<=e.length&&"["===e.slice(0,1)&&"]"===e.slice(-1)?f+`'${e.slice(1,-1)}'`:f+`'${e}'`}return f} class k{constructor(h,f,c){this._year=h;this._month=f;this._day=c;this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(h){return h instanceof k&&h.day===this.day&&h.month===this.month&&h.year===this.year}clone(){return new k(this._year,this._month,this._day)}toDateTime(h){return l.DateTime.fromObject({day:this.day,month:this.month, year:this.year},{zone:b.createDateTimeZone(h)})}toDateTimeLuxon(h){return l.DateTime.fromObject({day:this.day,month:this.month,year:this.year},{zone:b.createDateTimeZone(h)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(h=null,f=!0){if(null===h||""===h)return this.toString();f&&(h=p(h));if(!h)return"";f=this.toDateTime("unknown");return b.ArcadeDate.dateTimeToArcadeDate(f).toFormat(h,{locale:q.getLocale(), numberingSystem:"latn"})}toArcadeDate(){const h=this.toDateTime("unknown");return b.ArcadeDate.dateTimeToArcadeDate(h)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(h,f){return k.fromDateTime(this.toUTCDateTime().plus({[h]:f}))}toUTCDateTime(){return l.DateTime.utc(this.year, this.month,this.day,0,0,0,0)}difference(h,f){switch(f.toLowerCase()){case "days":case "day":case "d":return this.toUTCDateTime().diff(h.toUTCDateTime(),"days").days;case "months":case "month":return this.toUTCDateTime().diff(h.toUTCDateTime(),"months").months;case "minutes":case "minute":case "m":return"M"===f?this.toUTCDateTime().diff(h.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(h.toUTCDateTime(),"minutes").minutes;case "seconds":case "second":case "s":return this.toUTCDateTime().diff(h.toUTCDateTime(), "seconds").seconds;case "milliseconds":case "millisecond":case "ms":return this.toUTCDateTime().diff(h.toUTCDateTime(),"milliseconds").milliseconds;case "hours":case "hour":case "h":return this.toUTCDateTime().diff(h.toUTCDateTime(),"hours").hours;case "years":case "year":case "y":return this.toUTCDateTime().diff(h.toUTCDateTime(),"years").years;default:return this.toUTCDateTime().diff(h.toUTCDateTime(),"milliseconds").milliseconds}}static fromMilliseconds(h){h=l.DateTime.fromMillis(h,{zone:l.FixedOffsetZone.utcInstance}); return h.isValid?k.fromParts(h.year,h.month,h.day):null}static fromSeconds(h){h=l.DateTime.fromSeconds(h,{zone:l.FixedOffsetZone.utcInstance});return h.isValid?k.fromParts(h.year,h.month,h.day):null}static fromReader(h){if(!h)return null;h=h.split("-");return 3!==h.length?null:new k(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10))}static fromParts(h,f,c){h=new k(h,f,c);return!1===h.isValid?null:h}static fromDateJS(h){return k.fromParts(h.getFullYear(),h.getMonth()+1,h.getDay())}static fromDateTime(h){return k.fromParts(h.year, h.month,h.day)}static fromSqlTimeStampOffset(h){return this.fromDateTime(h.toDateTime())}static fromString(h,f=null){if(""===h||null===h)return null;var c=[];if(f)(f=p(f))&&c.push(f);else if(null===f||""===f)return h=l.DateTime.fromISO(h,{setZone:!0}),h.isValid?k.fromParts(h.year,h.month,h.day):null;for(const e of c)if(c=l.DateTime.fromFormat(h,f??e),c.isValid)return new k(c.year,c.month,c.day);return null}static fromNow(h="system"){h=l.DateTime.fromJSDate(new Date).setZone(b.createDateTimeZone(h)); return new k(h.year,h.month,h.day)}}a.DateOnly=k;a.standardizeDateOnlyFormat=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/SqlTimestampOffset":function(){define(["exports","../../chunks/datetime"],function(a,b){function q(p){return Number.isNaN(p)||0===p?p:Math.trunc(p)}class l{constructor(p){this._timeStampOffset=p;this._date=null}toDateTime(){this._date??(this._date=b.DateTime.fromISO(this._timeStampOffset,{setZone:!0}));return this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return q(this.toDateTime().offset/ 60)}get timezoneOffsetMinutes(){return q(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return l.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(p){return new l(b.DateTime.fromJSDate(p).toISO({includeOffset:!0}))}static fromDateTime(p){return new l(p.toISO({includeOffset:!0}))}static fromParts(p, k,h=0,f=0,c=0,e=0,g=0,d=!1,t=0,w=0){p=`${p.toString().padStart(4,"0")}-${k.toString().padStart(2,"0")}-${h.toString().padStart(2,"0")}`;k="";10>e&&(k="0");f=`${f.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${k+e.toString()}`;0!==g&&(f+="."+g.toString().padStart(3,"0"));g=`${d?"-":"+"}${t.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}`;return new l(p+"T"+f+g)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let p=this.toDateTime().toSQL({includeOffset:!0, includeOffsetSpace:!0});p&&=p.replace(".000","");return p}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(p){p=this.toDateTime().plus(p);return l.fromDateTime(p)}}a.SqlTimeStampOffset=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/TimeOnly":function(){define(["exports","../../arcade/kernel","../../intl/locale","../../chunks/datetime"],function(a,b,q,l){function p(h){if(!h)return"";const f=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let c="";for(const e of h.match(f)|| [])switch(e){case "SSS":c+=e;break;case "A":case "a":c+="a";break;case "m":case "mm":case "h":case "hh":case "H":case "HH":case "s":case "ss":c+=e;break;default:c+=`'${e}'`}return c}class k{constructor(h,f,c,e){this._hour=h;this._minute=f;this._second=c;this._millisecond=e;this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(h){return h instanceof k&&h.hour=== this.hour&&h.minute===this.minute&&h.second===this.second&&h.millisecond===this.millisecond}clone(){return new k(this.hour,this.minute,this.second,this.millisecond)}isValid(){return b.isInteger(this.hour)&&b.isInteger(this.minute)&&b.isInteger(this.second)&&b.isInteger(this.millisecond)&&0<=this.hour&&24>this.hour&&0<=this.minute&&60>this.minute&&0<=this.second&&60>this.second&&0<=this.millisecond&&1E3>this.millisecond}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2, "0")}:${this.second.toString().padStart(2,"0")}`+(0h?null:new k(Math.floor(h/36E5%24),Math.floor(h/6E4%60),Math.floor(h/1E3%60),Math.floor(h%1E3))}static fromDateJS(h){return new k(h.getHours(),h.getMinutes(),h.getSeconds(),h.getMilliseconds())}static fromDateTime(h){return new k(h.hour,h.minute,h.second,h.millisecond)}static fromSqlTimeStampOffset(h){return this.fromDateTime(h.toDateTime())}static fromString(h,f=null){if(""===h||null===h)return null;const c=[];if(f)(f=p(f))&&c.push(f);else if(null=== f||""===f)c.push("HH:mm:ss"),c.push("HH:mm:ss.SSS"),c.push("hh:mm:ss a"),c.push("hh:mm:ss.SSS a"),c.push("HH:mm"),c.push("hh:mm a"),c.push("H:mm"),c.push("h:mm a"),c.push("H:mm:ss"),c.push("h:mm:ss a"),c.push("H:mm:ss.SSS"),c.push("h:mm:ss.SSS a");for(const e of c)if(f=l.DateTime.fromFormat(h,e),f.isValid)return new k(f.hour,f.minute,f.second,f.millisecond);return null}plus(h,f){switch(h){case "days":case "years":case "months":return this.clone();case "hours":case "minutes":case "seconds":case "milliseconds":return k.fromDateTime(this.toUTCDateTime().plus({[h]:f}))}return null}toUTCDateTime(){return l.DateTime.utc(1970, 1,1,this.hour,this.minute,this.second,this.millisecond)}difference(h,f){switch(f.toLowerCase()){case "days":case "day":case "d":return this.toUTCDateTime().diff(h.toUTCDateTime(),"days").days;case "months":case "month":return this.toUTCDateTime().diff(h.toUTCDateTime(),"months").months;case "minutes":case "minute":case "m":return"M"===f?this.toUTCDateTime().diff(h.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(h.toUTCDateTime(),"minutes").minutes;case "seconds":case "second":case "s":return this.toUTCDateTime().diff(h.toUTCDateTime(), "seconds").seconds;case "milliseconds":case "millisecond":case "ms":return this.toUTCDateTime().diff(h.toUTCDateTime(),"milliseconds").milliseconds;case "hours":case "hour":case "h":return this.toUTCDateTime().diff(h.toUTCDateTime(),"hours").hours;case "years":case "year":case "y":return this.toUTCDateTime().diff(h.toUTCDateTime(),"years").years;default:return this.toUTCDateTime().diff(h.toUTCDateTime(),"milliseconds").milliseconds}}}a.TimeOnly=k;a.standardizeTimeFormat=p;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/arcade/kernel":function(){define(["exports","../geometry/Extent"],function(a,b){a.cloneGeometry=function(q){if(null==q)return null;const l=q.clone();void 0!==q.cache._geVersion&&(l.cache._geVersion=q.cache._geVersion);return l};a.convertLinearUnitsToCode=function(q){if(null==q)return null;if("number"===typeof q)return q;q=q.toLowerCase();q=q.replaceAll(/\s/g,"");q=q.replaceAll("-","");switch(q){case "meters":case "meter":case "m":case "squaremeters":case "squaremeter":return 9001; case "miles":case "mile":case "squaremile":case "squaremiles":return 9093;case "kilometers":case "kilometer":case "squarekilometers":case "squarekilometer":case "km":return 9036;case "yard":case "yd":case "yards":case "squareyards":case "squareyard":return 9096;case "feet":case "ft":case "foot":case "squarefeet":case "squarefoot":return 9002;case "nmi":case "nauticalmile":case "nauticalmiles":case "squarenauticalmile":case "squarenauticalmiles":return 9030}return null};a.convertSquareUnitsToCode= function(q){if(null==q)return null;if("number"===typeof q)return q;q=q.toLowerCase();q=q.replaceAll(/\s/g,"");q=q.replaceAll("-","");switch(q){case "meters":case "meter":case "m":case "squaremeters":case "squaremeter":return 109404;case "miles":case "mile":case "squaremile":case "squaremiles":return 109439;case "kilometers":case "kilometer":case "squarekilometers":case "squarekilometer":case "km":return 109414;case "acres":case "acre":case "ac":return 109402;case "hectares":case "hectare":case "ha":return 109401; case "yard":case "yd":case "yards":case "squareyards":case "squareyard":return 109442;case "feet":case "ft":case "foot":case "squarefeet":case "squarefoot":return 109405;case "nmi":case "nauticalmile":case "nauticalmiles":case "squarenauticalmile":case "squarenauticalmiles":return 109409}return null};a.isInteger=function(q){return"number"===typeof q&&isFinite(q)&&Math.floor(q)===q};a.sameGeomType=function(q,l){return q===l||"point"===q&&"esriGeometryPoint"===l||"polyline"===q&&"esriGeometryPolyline"=== l||"polygon"===q&&"esriGeometryPolygon"===l||"extent"===q&&"esriGeometryEnvelope"===l||"multipoint"===q&&"esriGeometryMultipoint"===l||"point"===l&&"esriGeometryPoint"===q||"polyline"===l&&"esriGeometryPolyline"===q||"polygon"===l&&"esriGeometryPolygon"===q||"extent"===l&&"esriGeometryEnvelope"===q||"multipoint"===l&&"esriGeometryMultipoint"===q?!0:!1};a.shapeExtent=function(q){if(null==q)return null;switch(q.type){case "polygon":case "multipoint":case "polyline":return q.extent;case "point":return new b({xmin:q.x, ymin:q.y,xmax:q.x,ymax:q.y,spatialReference:q.spatialReference});case "extent":return q}return null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/sqlArithmeticUtils":function(){define(["exports","../../arcade/featureset/support/errorsupport","./sqlDateParsingUtils","./SqlInterval","./StandardizedFunctions"],function(a,b,q,l,p){function k(fa,X,ja){switch(ja){case "+":return fa+X;case "-":return fa-X;case "*":return fa*X;case "/":return fa/X}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }function h(fa,X,ja){switch(ja){case "+":return X.plus({milliseconds:fa.valueInMilliseconds()});case "-":return fa.valueInMilliseconds()-X.toMillis()}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function f(fa,X,ja){switch(ja){case "+":return X.plus("milliseconds",fa.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function c(fa,X,ja){switch(ja){case "+":return X.plus("milliseconds",fa.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }function e(fa,X,ja){switch(ja){case "+":return fa.plus("milliseconds",X.valueInMilliseconds());case "-":return fa.plus("milliseconds",-1*X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function g(fa,X,ja){switch(ja){case "+":return X.addMilliseconds(fa.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function d(fa,X,ja){switch(ja){case "+":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()+X.valueInMilliseconds());case "-":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()- X.valueInMilliseconds());case "*":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()*X.valueInMilliseconds());case "/":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()/X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function t(fa,X,ja){switch(ja){case "+":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()+X);case "-":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()-X);case "*":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()* X);case "/":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()/X)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function w(fa,X,ja){switch(ja){case "+":return l.SqlInterval.createFromMilliseconds(fa+X.valueInMilliseconds());case "-":return l.SqlInterval.createFromMilliseconds(fa-X.valueInMilliseconds());case "*":return l.SqlInterval.createFromMilliseconds(fa*X.valueInMilliseconds());case "/":return l.SqlInterval.createFromMilliseconds(fa/X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }function v(fa,X,ja){switch(ja){case "+":return fa.plus("milliseconds",X.valueInMilliseconds());case "-":return fa.plus("milliseconds",-1*X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function m(fa,X,ja){switch(ja){case "+":return fa.plus({milliseconds:X.valueInMilliseconds()});case "-":return fa.minus({milliseconds:X.valueInMilliseconds()})}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function r(fa,X,ja){switch(ja){case "+":return fa.addMilliseconds(X.valueInMilliseconds()); case "-":return fa.addMilliseconds(-1*X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function n(fa,X,ja){X*=864E5;switch(ja){case "+":return fa.plus({milliseconds:X});case "-":return fa.minus({milliseconds:X})}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function u(fa,X,ja){X*=864E5;switch(ja){case "+":return fa.plus("milliseconds",X);case "-":return fa.plus("milliseconds",-1*X)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function x(fa,X,ja){X*= 864E5;switch(ja){case "+":return fa.plus("milliseconds",X);case "-":return fa.plus("milliseconds",-1*X)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function y(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function z(fa,X,ja){X*=864E5;switch(ja){case "+":return fa.addMilliseconds(X);case "-":return fa.addMilliseconds(-1*X)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function A(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function B(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }function C(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function D(fa,X,ja){X=parseFloat(X);if(isNaN(X))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);return k(fa,X,ja)}function F(fa,X,ja){fa=parseFloat(fa);if(isNaN(fa))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);return k(fa,X,ja)}function H(fa,X,ja){switch(ja){case "+":return fa+X}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function N(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);} function E(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function G(fa,X,ja){switch(ja){case "-":return fa.toDateTimeLuxon(X.zone).diff(X).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function I(fa,X,ja){switch(ja){case "-":return fa.toDateTimeLuxon(X.toDateTime().zone).diff(X.toDateTime()).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function O(fa,X,ja){switch(ja){case "-":return fa.toDateTimeLuxon("UTC").diff(X.toDateTimeLuxon("UTC")).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }function L(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function P(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function M(fa,X,ja){switch(ja){case "-":return fa.toDateTime().diff(X.toDateTimeLuxon(fa.toDateTime().zone)).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function K(fa,X,ja){switch(ja){case "-":return fa.toDateTime().diff(X).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function J(fa,X,ja){switch(ja){case "-":return fa.toDateTime().diff(X.toDateTime()).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }function R(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function Q(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function W(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function S(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function V(fa,X,ja){switch(ja){case "-":return fa.diff(X).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function T(fa,X,ja){switch(ja){case "-":return fa.diff(X.toDateTimeLuxon(fa.zone)).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }function Y(fa,X,ja){switch(ja){case "-":return fa.diff(X.toDateTime()).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ha(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ba(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function U(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function Z(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ca(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }function ea(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function da(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ia(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ka(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}a.calculateDateOnlyAndDateOnly=O;a.calculateDateOnlyAndDateTime=G;a.calculateDateOnlyAndNumber=u;a.calculateDateOnlyAndSqlInterval=v;a.calculateDateOnlyAndString=ba;a.calculateDateOnlyAndTimeOnly= L;a.calculateDateOnlyAndTimestamp=I;a.calculateDateTimeAndDateOnly=T;a.calculateDateTimeAndDateTime=V;a.calculateDateTimeAndNumber=n;a.calculateDateTimeAndSqlInterval=m;a.calculateDateTimeAndString=Z;a.calculateDateTimeAndTimeOnly=ha;a.calculateDateTimeAndTimestamp=Y;a.calculateNumberAndDateOnly=C;a.calculateNumberAndDateTime=y;a.calculateNumberAndNumber=k;a.calculateNumberAndSqlInterval=w;a.calculateNumberAndString=D;a.calculateNumberAndTimeOnly=B;a.calculateNumberAndTimestamp=A;a.calculateSqlIntervalAndDateOnly= c;a.calculateSqlIntervalAndDateTime=h;a.calculateSqlIntervalAndNumber=t;a.calculateSqlIntervalAndSqlInterval=d;a.calculateSqlIntervalAndString=N;a.calculateSqlIntervalAndTimeOnly=f;a.calculateSqlIntervalAndTimestamp=g;a.calculateStringAndDateOnly=da;a.calculateStringAndDateTime=ia;a.calculateStringAndNumber=F;a.calculateStringAndSqlInterval=E;a.calculateStringAndString=H;a.calculateStringAndTimeOnly=ea;a.calculateStringAndTimestamp=ka;a.calculateTimeOnlyAndDateOnly=Q;a.calculateTimeOnlyAndDateTime= R;a.calculateTimeOnlyAndNumber=x;a.calculateTimeOnlyAndSqlInterval=e;a.calculateTimeOnlyAndString=U;a.calculateTimeOnlyAndTimeOnly=S;a.calculateTimeOnlyAndTimestamp=W;a.calculateTimestampAndDateOnly=M;a.calculateTimestampAndDateTime=K;a.calculateTimestampAndNumber=z;a.calculateTimestampAndSqlInterval=r;a.calculateTimestampAndString=ca;a.calculateTimestampAndTimeOnly=P;a.calculateTimestampAndTimestamp=J;a.sqlCalculateFunction=function(fa,X,ja,la){if("||"===fa)return p.evaluateFunction("concat",[X, ja],la);if(null===X||null===ja)return null;if(q.isNumber(X)){if(q.isNumber(ja))return k(X,ja,fa);if(q.isSqlInterval(ja))return w(X,ja,fa);if(q.isTimeOnly(ja))return B();if(q.isDateOnly(ja))return C();if(q.isTimestampOffset(ja))return A();if(q.isDateTime(ja))return y();if(q.isString(ja))return D(X,ja,fa)}else if(q.isDateOnly(X)){if(q.isNumber(ja))return u(X,ja,fa);if(q.isSqlInterval(ja))return v(X,ja,fa);if(q.isTimeOnly(ja))return L();if(q.isDateOnly(ja))return O(X,ja,fa);if(q.isTimestampOffset(ja))return I(X, ja,fa);if(q.isDateTime(ja))return G(X,ja,fa);if(q.isString(ja))return ba()}else if(q.isTimeOnly(X)){if(q.isNumber(ja))return x(X,ja,fa);if(q.isSqlInterval(ja))return e(X,ja,fa);if(q.isTimeOnly(ja))return S();if(q.isDateOnly(ja))return Q();if(q.isTimestampOffset(ja))return W();if(q.isDateTime(ja))return R();if(q.isString(ja))return U()}else if(q.isSqlInterval(X)){if(q.isNumber(ja))return t(X,ja,fa);if(q.isSqlInterval(ja))return d(X,ja,fa);if(q.isTimeOnly(ja))return f(X,ja,fa);if(q.isDateOnly(ja))return c(X, ja,fa);if(q.isTimestampOffset(ja))return g(X,ja,fa);if(q.isDateTime(ja))return h(X,ja,fa);if(q.isString(ja))return N()}else if(q.isDateTime(X)){if(q.isNumber(ja))return n(X,ja,fa);if(q.isSqlInterval(ja))return m(X,ja,fa);if(q.isTimeOnly(ja))return ha();if(q.isDateOnly(ja))return T(X,ja,fa);if(q.isTimestampOffset(ja))return Y(X,ja,fa);if(q.isDateTime(ja))return V(X,ja,fa);if(q.isString(ja))return Z()}else if(q.isTimestampOffset(X)){if(q.isNumber(ja))return z(X,ja,fa);if(q.isSqlInterval(ja))return r(X, ja,fa);if(q.isTimeOnly(ja))return P();if(q.isDateOnly(ja))return M(X,ja,fa);if(q.isTimestampOffset(ja))return J(X,ja,fa);if(q.isDateTime(ja))return K(X,ja,fa);if(q.isString(ja))return ca()}else if(q.isString(X)){if(q.isNumber(ja))return F(X,ja,fa);if(q.isSqlInterval(ja))return E();if(q.isTimeOnly(ja))return ea();if(q.isDateOnly(ja))return da();if(q.isTimestampOffset(ja))return ka();if(q.isDateTime(ja))return ia();if(q.isString(ja))return H(X,ja,fa)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); };Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/sqlDateParsingUtils":function(){define("exports ../../arcade/featureset/support/errorsupport ./DateOnly ./SqlInterval ./SqlTimestampOffset ./TimeOnly ./UnknownTimeZone ../../chunks/datetime".split(" "),function(a,b,q,l,p,k,h,f){function c(n,u,x){x=w.exec(n);if(null!==x){const [,y,z,A,B,C,D,F]=x;n=f.DateTime.fromObject({year:parseInt(y,10),month:parseInt(z,10),day:parseInt(A,10),hour:parseInt(B,10),minute:parseInt(C,10), second:parseInt(D,10),millisecond:F?parseInt(F.replace(".",""),10):0},{zone:h.substituteUnknownTimezone(u)});if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);return n}x=v.exec(n);if(null!==x){const [,y,z,A,B,C,D,F,H,N,E]=x;n=p.SqlTimeStampOffset.fromParts(parseInt(y,10),parseInt(z,10),parseInt(A,10),parseInt(B,10),parseInt(C,10),parseInt(D,10),F?parseInt(F.replace(".",""),10):0,"-"===H,parseInt(N,10),parseInt(E,10));if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp); return n}x=m.exec(n);if(null!==x){const [,y,z,A,B,C,D,F,H]=x;n=p.SqlTimeStampOffset.fromParts(parseInt(y,10),parseInt(z,10),parseInt(A,10),parseInt(B,10),parseInt(C,10),0,0,"-"===D,parseInt(F,10),parseInt(H,10));if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);return n}x=r.exec(n);if(null!==x){const [,y,z,A,B,C]=x;n=f.DateTime.fromObject({year:parseInt(y,10),month:parseInt(z,10),day:parseInt(A,10),hour:parseInt(B,10),minute:parseInt(C,10),second:0},{zone:h.substituteUnknownTimezone(u)}); if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);return n}x=t.exec(n);if(null!==x){const [,y,z,A]=x;n=f.DateTime.fromObject({year:parseInt(y,10),month:parseInt(z,10),day:parseInt(A,10),hour:0,minute:0,second:0},{zone:h.substituteUnknownTimezone(u)});if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);return n}throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);}const e=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,g=/^(\d{1,2}):(\d{1,2})$/,d=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/, t=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,w=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,v=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,m=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;a.convertToExecutingTimeZone=function(n,u){if(u instanceof f.Zone)return u===h.UnknownTimeZone.instance?f.DateTime.fromMillis(n.getTime(),{zone:h.UnknownTimeZone.instance}): f.DateTime.fromJSDate(n,{zone:u});switch(u){case "system":case "local":case null:return f.DateTime.fromJSDate(n);default:return"unknown"===u?.toLowerCase()?f.DateTime.fromMillis(n.getTime(),{zone:h.UnknownTimeZone.instance}):f.DateTime.fromJSDate(n,{zone:u})}};a.isDate=function(n){return n instanceof Date};a.isDateOnly=function(n){return n instanceof q.DateOnly};a.isDateTime=function(n){return n instanceof f.DateTime};a.isNumber=function(n){return"number"===typeof n};a.isSqlInterval=function(n){return n instanceof l.SqlInterval};a.isString=function(n){return"string"===typeof n||n instanceof String};a.isTimeOnly=function(n){return n instanceof k.TimeOnly};a.isTimestampOffset=function(n){return n instanceof p.SqlTimeStampOffset};a.parseDate=function(n,u){const x=t.exec(n);if(null===x)try{return c(n,u)}catch{throw new b.SqlError(b.SqlErrorCodes.InvalidDate);}const [,y,z,A]=x;n=q.DateOnly.fromParts(parseInt(y,10),parseInt(z,10),parseInt(A,10));if(null===n)throw new b.SqlError(b.SqlErrorCodes.InvalidDate);return n}; a.parseTime=function(n){let u=e.exec(n);if(null!==u){const [,x,y,z]=u;n=k.TimeOnly.fromParts(parseInt(x,10),parseInt(y,10),parseInt(z,10),0);if(null!==n)return n;throw new b.SqlError(b.SqlErrorCodes.InvalidTime);}u=g.exec(n);if(null!==u){const [,x,y]=u;n=k.TimeOnly.fromParts(parseInt(x,10),parseInt(y,10),0,0);if(null!==n)return n;throw new b.SqlError(b.SqlErrorCodes.InvalidTime);}u=d.exec(n);if(null!==u){const [,x,y,z,A]=u;n=k.TimeOnly.fromParts(parseInt(x,10),parseInt(y,10),parseInt(z,10),parseInt(A, 10));if(null!==n)return n}throw new b.SqlError(b.SqlErrorCodes.InvalidTime);};a.parseTimestamp=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/SqlInterval":function(){define(["exports","../../arcade/featureset/support/errorsupport"],function(a,b){class q{constructor(){this.op="+";this.millis=this.minute=this.year=this.month=this.hour=this.second=this.day=0}static _fixDefaults(l){if(null!==l.precision||null!==l.secondary)throw new b.SqlError(b.SqlErrorCodes.PrimarySecondaryQualifiers); }static _parseSecondsComponent(l,p){p.includes(".")?(p=p.split("."),l.second=parseFloat(p[0]),l.millis=parseInt(p[1],10)):l.second=parseFloat(p)}static createFromMilliseconds(l){const p=new q;p.second=l/1E3;return p}static createFromValueAndQualifier(l,p,k){let h=null;const f=new q;f.op="-"===k?"-":"+";if("interval-period"===p.type){q._fixDefaults(p);k=RegExp("^[0-9]{1,}$");if("year"===p.period||"month"===p.period)throw new b.SqlError(b.SqlErrorCodes.YearMonthIntervals);if("second"===p.period)if(/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(l))q._parseSecondsComponent(f, l);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);else if(k.test(l))f[p.period]=parseFloat(l);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}else{q._fixDefaults(p.start);q._fixDefaults(p.end);if("year"===p.start.period||"month"===p.start.period||"year"===p.end.period||"month"===p.end.period)throw new b.SqlError(b.SqlErrorCodes.YearMonthIntervals);switch(p.start.period){case "day":switch(p.end.period){case "hour":h=RegExp("^[0-9]{1,} [0-9]{1,}$");if(h.test(l))f[p.start.period]= parseFloat(l.split(" ")[0]),f[p.end.period]=parseFloat(l.split(" ")[1]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;case "minute":h=RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$");if(h.test(l))f[p.start.period]=parseFloat(l.split(" ")[0]),l=l.split(" ")[1].split(":"),f.hour=parseFloat(l[0]),f.minute=parseFloat(l[1]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;case "second":h=RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$");if(h.test(l))f[p.start.period]= parseFloat(l.split(" ")[0]),l=l.split(" ")[1].split(":"),f.hour=parseFloat(l[0]),f.minute=parseFloat(l[1]),q._parseSecondsComponent(f,l[2]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;default:throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}break;case "hour":switch(p.end.period){case "minute":h=RegExp("^[0-9]{1,}:[0-9]{1,}$");if(h.test(l))f.hour=parseFloat(l.split(":")[0]),f.minute=parseFloat(l.split(":")[1]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break; case "second":h=RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$");if(h.test(l))l=l.split(":"),f.hour=parseFloat(l[0]),f.minute=parseFloat(l[1]),q._parseSecondsComponent(f,l[2]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;default:throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}break;case "minute":switch(p.end.period){case "second":h=RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$");if(h.test(l))l=l.split(":"),f.minute=parseFloat(l[0]),q._parseSecondsComponent(f, l[1]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;default:throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}break;default:throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}}return f}valueInMilliseconds(){return("-"===this.op?-1:1)*(this.millis+1E3*this.second+6E4*this.minute+36E5*this.hour+864E5*this.day+365/12*this.month*864E5+31536E6*this.year)}}a.SqlInterval=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/StandardizedFunctions":function(){define("exports ../../arcade/featureset/support/errorsupport ../string ./DateOnly ./sqlCompareUtils ./sqlDateParsingUtils ./TimeOnly ../../chunks/datetime".split(" "), function(a,b,q,l,p,k,h,f){function c(m){return"string"===typeof m||m instanceof String}function e(m){return k.isDate(m)||k.isDateOnly(m)||k.isDateTime(m)||k.isTimeOnly(m)||k.isTimestampOffset(m)?!1:!0}function g(m){return k.isDateOnly(m)||k.isTimeOnly(m)?m.toString():k.isTimestampOffset(m)?m.toSQLValue():k.isDateTime(m)?0===m.millisecond?m.toFormat("yyyy-LL-dd HH:mm:ss"):m.toSQL({includeOffset:!1}):k.isDate(m)?g(f.DateTime.fromJSDate(m)):m.toString()}function d(m){if(k.isDate(m))return l.DateOnly.fromDateJS(m); if(k.isDateTime(m))return l.DateOnly.fromParts(m.year,m.month,m.day);if(k.isDateOnly(m))return m;if(k.isTimeOnly(m))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(k.isTimestampOffset(m)&&null===l.DateOnly.fromParts(m.year,m.month,m.day))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(c(m)&&(m=l.DateOnly.fromReader(m),null!==m&&m.isValid))return m;throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);}function t(m,r,n){if(k.isDate(m))return k.convertToExecutingTimeZone(m,r);if(k.isDateTime(m))return m; if(k.isDateOnly(m))return m.toDateTimeLuxon("unknown");if(k.isTimeOnly(m))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(k.isTimestampOffset(m))return m;if(c(m))return k.parseTimestamp(m,"unknown",n);throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);}function w(m){if(k.isDate(m))return h.TimeOnly.fromDateJS(m);if(k.isDateTime(m))return h.TimeOnly.fromDateTime(m);if(k.isDateOnly(m))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(k.isTimeOnly(m))return m;if(k.isTimestampOffset(m))return h.TimeOnly.fromSqlTimeStampOffset(m); if(c(m))return k.parseTime(m);throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);}const v={extract:{minParams:2,maxParams:2,evaluate:([m,r])=>{if(null==r)return null;if(k.isDate(r))switch(m.toUpperCase()){case "SECOND":return r.getSeconds();case "MINUTE":return r.getMinutes();case "HOUR":return r.getHours();case "DAY":return r.getDate();case "MONTH":return r.getMonth()+1;case "YEAR":return r.getFullYear();case "TIMEZONE_HOUR":return 0;case "TIMEZONE_MINUTE":return 0}else if(k.isDateTime(r))switch(m.toUpperCase()){case "SECOND":return r.second; case "MINUTE":return r.minute;case "HOUR":return r.hour;case "DAY":return r.day;case "MONTH":return r.month;case "YEAR":return r.year}else if(k.isDateOnly(r))switch(m.toUpperCase()){case "DAY":return r.day;case "MONTH":return r.month;case "YEAR":return r.year}else if(k.isTimeOnly(r))switch(m.toUpperCase()){case "SECOND":return r.second;case "MINUTE":return r.minute;case "HOUR":return r.hour}else if(k.isTimestampOffset(r))switch(m.toUpperCase()){case "SECOND":return r.second;case "MINUTE":return r.minute; case "HOUR":return r.hour;case "DAY":return r.day;case "MONTH":return r.month;case "YEAR":return r.year;case "TIMEZONE_HOUR":return r.timezoneOffsetHour;case "TIMEZONE_MINUTE":return r.timezoneOffsetMinutes}throw new b.SqlError(b.SqlErrorCodes.InvalidFunctionParameters,{function:"EXTRACT"});}},substring:{minParams:2,maxParams:3,evaluate:m=>{if(2===m.length){const [r,n]=m;return null==r||null==n?null:r.toString().substring(n-1)}if(3===m.length){const [r,n,u]=m;return null==r||null==n||null==u?null: 0>=u?"":r.toString().substring(n-1,n+u-1)}}},position:{minParams:2,maxParams:2,evaluate:([m,r])=>null==m||null==r?null:r.indexOf(m)+1},trim:{minParams:2,maxParams:3,evaluate:m=>{var r=3===m.length,n=r?m[1]:" ";r=r?m[2]:m[1];if(null==n||null==r)return null;n=`(${q.escapeRegExpString(n)})`;switch(m[0]){case "BOTH":return r.replaceAll(new RegExp(`^${n}*|${n}*$`,"g"),"");case "LEADING":return r.replaceAll(new RegExp(`^${n}*`,"g"),"");case "TRAILING":return r.replaceAll(new RegExp(`${n}*$`,"g"),"")}throw new b.SqlError(b.SqlErrorCodes.InvalidFunctionParameters, {function:"TRIM"});}},abs:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.abs(m[0])},ceiling:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.ceil(m[0])},floor:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.floor(m[0])},log:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.log(m[0])},log10:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.log(m[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.sin(m[0])},cos:{minParams:1,maxParams:1, evaluate:m=>null==m[0]?null:Math.cos(m[0])},tan:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.tan(m[0])},asin:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.asin(m[0])},acos:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.acos(m[0])},atan:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.atan(m[0])},sign:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:0m[1]?-1:0},power:{minParams:2,maxParams:2,evaluate:m=>null==m[0]||null==m[1]?null:m[0]**m[1]}, mod:{minParams:2,maxParams:2,evaluate:m=>null==m[0]||null==m[1]?null:m[0]%m[1]},round:{minParams:1,maxParams:2,evaluate:m=>{const r=m[0];m=2===m.length?10**m[1]:1;return null==r?null:Math.round(r*m)/m}},truncate:{minParams:1,maxParams:2,evaluate:m=>null==m[0]?null:1===m.length?parseInt(m[0].toFixed(0),10):parseFloat(m[0].toFixed(m[1]))},char_length:{minParams:1,maxParams:1,evaluate:m=>c(m[0])?m[0].length:0},concat:{minParams:1,maxParams:Infinity,evaluate:m=>{let r="";for(let n=0;nnull==m[0]?null:m[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:m[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:Infinity,evaluate:m=>{for(const r of m)if(null!==r)return r;return null}},cosh:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.cosh(m[0])},sinh:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.sinh(m[0])},tanh:{minParams:1, maxParams:1,evaluate:m=>null==m[0]?null:Math.tanh(m[0])},nullif:{minParams:2,maxParams:2,evaluate:(m,r)=>p.sqlCompare(m[0],m[1],"\x3d")?null:m[0]},cast:{minParams:2,maxParams:2,evaluate:(m,r)=>{const n=m[0];m=m[1];if(null===n)return null;switch(m.type){case "integer":if(!e(n))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);r=parseInt(n,10);if(isNaN(r))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);return r;case "smallint":if(!e(n))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue); r=parseInt(n,10);if(isNaN(r))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(32767r)throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);return r;case "float":case "real":if(!e(n))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);r=parseFloat(n);if(isNaN(r))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);return r;case "time":return w(n);case "date":return d(n);case "timestamp":return t(n,r,!0===m.withtimezone);case "varchar":r=g(n);if(r.length>m.size)throw new b.SqlError(b.SqlErrorCodes.CannotCastValue); return r;default:throw new b.SqlError(b.SqlErrorCodes.InvalidDataType);}}}};a.evaluateFunction=function(m,r,n){const u=v[m.toLowerCase()];if(null==u)throw new b.SqlError(b.SqlErrorCodes.FunctionNotRecognized);if(r.lengthu.maxParams)throw new b.SqlError(b.SqlErrorCodes.InvalidParameterCount,{name:m.toUpperCase()});return u.evaluate(r,n)};a.isStandardized=function(m,r){m=v[m.toLowerCase()];return null!=m&&r>=m.minParams&&r<=m.maxParams};Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/core/sql/sqlCompareUtils":function(){define("exports ../../arcade/featureset/support/errorsupport ./sqlDateParsingUtils ./SqlTimestampOffset ./UnknownTimeZone ../../chunks/datetime".split(" "),function(a,b,q,l,p,k){function h(m){return q.isDateTime(m)||q.isTimestampOffset(m)?!0:!1}function f(m){return q.isDateTime(m)||q.isDateOnly(m)||q.isTimestampOffset(m)||q.isTimeOnly(m)?!0:!1}function c(m){if(q.isDateTime(m))return m.toMillis();if(q.isDateOnly(m))return m.toNumber(); if(q.isTimestampOffset(m))return m.toMilliseconds();throw new b.SqlError(b.SqlErrorCodes.InvalidDataType);}function e(m,r,n){switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m=r;case "\x3c\x3d":return m<=r}}function g(m,r,n){const u=parseFloat(r);if(!isNaN(u))return e(m,u,n);m=m.toString();switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m= r;case "\x3c\x3d":return m<=r}}function d(m,r,n){const u=parseFloat(m);if(!isNaN(u))return e(u,r,n);r=r.toString();switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m=r;case "\x3c\x3d":return m<=r}}function t(m,r,n){switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m=r;case "\x3c\x3d":return m<=r}}function w(m,r,n){m instanceof l.SqlTimeStampOffset&& (m=m.toDateTime());r instanceof l.SqlTimeStampOffset&&(r=r.toDateTime());m=v(m);r=v(r);switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m=r;case "\x3c\x3d":return m<=r}}function v(m){return 321408E5*m.year+26784E5*m.month+864E5*m.day+36E5*m.hour+6E4*m.minute+1E3*m.second+m.millisecond}a.dateValueInMilliseconds=c;a.isDateOrTimeValue=f;a.isDateTimeComparableValue=h;a.sqlCompare=function(m,r,n,u){if(null==m||null==r)return null; if(q.isNumber(m)){if(q.isNumber(r))return e(m,r,n);if(q.isString(r))return g(m,r,n);if(f(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isString(m)){if(q.isNumber(r))return d(m,r,n);if(q.isString(r))return t(m,r,n);if(q.isDateTime(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isTimeOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); if(q.isTimestampOffset(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isDateTime(m)){if(h(r)){if(m instanceof k.DateTime&&p.isUnknownTimeZone(m.zone)){if(r instanceof k.DateTime&&!1===p.isUnknownTimeZone(r.zone)||r instanceof l.SqlTimeStampOffset)return w(m,r,n)}else if(r instanceof k.DateTime&&p.isUnknownTimeZone(r.zone)&&(m instanceof k.DateTime&&!1===p.isUnknownTimeZone(m.zone)||m instanceof l.SqlTimeStampOffset))return w(m,r,n);return e(c(m),c(r),n)}if(q.isString(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); if(q.isDateOnly(r))return r=r.toDateTimeLuxon(m.zone),m=m.startOf("day"),e(m.toMillis(),r.toMillis(),n);if(q.isTimeOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isNumber(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isDateOnly(m)){if(q.isTimestampOffset(r))return m=m.toDateTimeLuxon(r.toDateTime().zone),r=r.startOfDay(),e(m.toMillis(),r.toMilliseconds(),n);if(q.isDateTime(r))return m=m.toDateTimeLuxon(r.zone),r=r.startOf("day"),e(m.toMillis(),r.toMillis(), n);if(q.isString(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))return e(m.toNumber(),r.toNumber(),n);if(q.isTimeOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isNumber(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isTimeOnly(m)){if(q.isTimeOnly(r))return e(m.toNumber(),r.toNumber(),n);if(q.isString(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isNumber(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); if(h(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isTimestampOffset(m)){if(h(r))return r instanceof k.DateTime&&p.isUnknownTimeZone(r.zone)?w(m,r,n):e(c(m),c(r),n);if(q.isString(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))return r=r.toDateTimeLuxon(m.toDateTime().zone),m=m.startOfDay(),e(m.toMilliseconds(),r.toMillis(),n);if(q.isTimeOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isNumber(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator); }switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m=r;case "\x3c\x3d":return m<=r}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/WhereGrammar":function(){define(["exports","../../chunks/_commonjsHelpers"],function(a,b){var q={exports:{}};(function(k){(function(h,f){k.exports&&(k.exports=f())})(b.commonjsGlobal,function(){function h(c,e,g,d){c=Error.call(this,c);Object.setPrototypeOf&& Object.setPrototypeOf(c,h.prototype);c.expected=e;c.found=g;c.location=d;c.name="SyntaxError";return c}function f(c,e,g){g=g||" ";if(c.length>e)return c;e-=c.length;g+=g.repeat(e);return c+g.slice(0,e)}(function(c,e){function g(){this.constructor=c}g.prototype=e.prototype;c.prototype=new g})(h,Error);h.prototype.format=function(c){var e="Error: "+this.message;if(this.location){var g=null,d;for(d=0;dod&&(od=ma,rf=[]),rf.push(ta))}function r(){var ta=ma;Aa();var Ca=u();Ca!==aa?(Aa(),hb=ta,ta=Ca):(ma=ta,ta=aa);return ta}function n(){var ta= ma;var Ca=u();if(Ca!==aa){var Oa=[];var ab=ma;var ob=Aa();var wb=sa();if(wb!==aa){var Ob=Aa();var Rb=u();Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)}else ma=ab,ab=aa;for(;ab!==aa;)Oa.push(ab),ab=ma,ob=Aa(),wb=sa(),wb!==aa?(Ob=Aa(),Rb=u(),Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)):(ma=ab,ab=aa);hb=ta;ta={type:"expression-list"};Ca=[Ca];for(ab=0;ab"_geVersion"!==c?e:void 0;a.cleanFromGeometryEngine=function(c){return c&&"_geVersion"in c?JSON.parse(JSON.stringify(c,f)):c};a.getGeometry=function(c,e,g,d,t,w,v=e,m=g){const r=e&&v,n=g&&m;d=null!=d?"coords"in d?d:d.geometry:null;if(null==d)return null;if(t)return e=b.generalizeOptimizedGeometry(p, d,e,g,c,t,v,m),w&&(e=b.quantizeOptimizedGeometry(k,e,r,n,c,w)),h[c]?.(e,r,n)??null;if(w)return w=b.quantizeOptimizedGeometry(k,d,e,g,c,w,v,m),h[c]?.(w,r,n)??null;b.removeZMValues(l,d,e,g,v,m);return h[c]?.(l,r,n)??null};a.transformCentroid=function(c,e,g,d=c.hasZ,t=c.hasM){if(null==e)return null;const w=c.hasZ&&d,v=c.hasM&&t;return g?(c=b.quantizeOptimizedGeometry(k,e,c.hasZ,c.hasM,"esriGeometryPoint",g,d,t),b.convertToPoint(c,w,v)):b.convertToPoint(e,w,v)};Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/layers/graphics/data/projectionSupport":function(){define("exports ../../../core/arrayUtils ../../../core/promiseUtils ../../../geometry/projection ../../../geometry/geometryAdapters/json ../../../geometry/support/spatialReferenceUtils ../../../geometry/support/webMercatorUtils".split(" "),function(a,b,q,l,p,k,h){function f(m,r){if(!r)return null;if("x"in r){var n={x:0,y:0};[n.x,n.y]=m(r.x,r.y,g);null!=r.z&&(n.z=r.z);null!=r.m&&(n.m=r.m);return n}return"xmin"in r?(n={xmin:0, ymin:0,xmax:0,ymax:0},[n.xmin,n.ymin]=m(r.xmin,r.ymin,g),[n.xmax,n.ymax]=m(r.xmax,r.ymax,g),r.hasZ&&(n.zmin=r.zmin,n.zmax=r.zmax,n.hasZ=!0),r.hasM&&(n.mmin=r.mmin,n.mmax=r.mmax,n.hasM=!0),n):"rings"in r?{rings:c(r.rings,m),hasM:r.hasM,hasZ:r.hasZ}:"paths"in r?{paths:c(r.paths,m),hasM:r.hasM,hasZ:r.hasZ}:"points"in r?{points:e(r.points,m),hasM:r.hasM,hasZ:r.hasZ}:null}function c(m,r){const n=[];for(const u of m)n.push(e(u,r));return n}function e(m,r){const n=[];for(const u of m)m=r(u[0],u[1],[0,0]), n.push(m),2null!=n.geometry?n.geometry.spatialReference:null).filter(b.isSome):[m],await l.initializeProjection(m.map(n=> ({source:n,dest:r}))))};a.project=function(m,r,n,u){if(!m)return m;n||(n=r,r=m.spatialReference);return k.isValid(r)&&k.isValid(n)&&!k.equals(r,n)?h.canProject(r,n)?(m=k.isWebMercator(n)?d(m):t(m),m.spatialReference=n,m):l.projectMany(p.jsonAdapter,[m],r,n,null,u)[0]:m};a.projectMany=function(m,r,n,u){return v.push(m,r,n,u)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/geometryAdapters/json":function(){define(["exports"],function(a){class b{constructor(h,f,c){this.x= h;this.y=f;this.spatialReference=c;this.m=this.z=void 0}}class q{constructor(h,f,c,e){this.rings=h;this.spatialReference=f;this.hasM=this.hasZ=void 0;c&&(this.hasZ=c);e&&(this.hasM=e)}}class l{constructor(h,f,c,e){this.paths=h;this.spatialReference=f;this.hasM=this.hasZ=void 0;c&&(this.hasZ=c);e&&(this.hasM=e)}}class p{constructor(h,f,c,e){this.points=h;this.spatialReference=f;this.hasM=this.hasZ=void 0;c&&(this.hasZ=c);e&&(this.hasM=e)}}class k{constructor(h,f,c,e,g){this.xmin=h;this.ymin=f;this.xmax= c;this.ymax=e;this.spatialReference=g;this.mmax=this.mmin=this.zmax=this.zmin=void 0}}a.jsonAdapter={convertToGEGeometry:function(h,f){return null==f?null:h.convertJSONToGeometry(f)},exportPoint:function(h,f,c){c=new b(h.getPointX(f),h.getPointY(f),c);const e=h.hasZ(f),g=h.hasM(f);e&&(c.z=h.getPointZ(f));g&&(c.m=h.getPointM(f));return c},exportPolygon:function(h,f,c){return new q(h.exportPaths(f),c,h.hasZ(f),h.hasM(f))},exportPolyline:function(h,f,c){return new l(h.exportPaths(f),c,h.hasZ(f),h.hasM(f))}, exportMultipoint:function(h,f,c){return new p(h.exportPoints(f),c,h.hasZ(f),h.hasM(f))},exportExtent:function(h,f,c){var e=h.hasZ(f);const g=h.hasM(f);c=new k(h.getXMin(f),h.getYMin(f),h.getXMax(f),h.getYMax(f),c);e&&(e=h.getZExtent(f),c.zmin=e.vmin,c.zmax=e.vmax);g&&(h=h.getMExtent(f),c.mmin=h.vmin,c.mmax=h.vmax);return c}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/QueryEngineResult":function(){define("require exports ../../../core/lang ../../../geometry/support/centroid ../../../geometry/support/extentUtils ../../../geometry/support/quantizationUtils ../../../geometry/support/spatialReferenceUtils ./AttributesBuilder ./geometryUtils ./projectionSupport ./SnappingCandidate ../../support/fieldUtils ../../../statistics/utils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(n,u,x,y){const z=y.x-x.x;y=y.y-x.y;u=Math.min(1,Math.max(0,((u.x-x.x)*z+(u.y-x.y)*y)/(z*z+y*y)));n.x=x.x+z*u;n.y=x.y+y*u}function v(n,u){return n?u?4:3:u?3:2}class m{constructor(n,u,x){this.items=n;this.query=u;this.geometryType=x.geometryType;this.hasM=x.hasM;this.hasZ=x.hasZ;this.fieldsIndex=x.fieldsIndex;this.objectIdField=x.objectIdField;this.spatialReference=x.spatialReference;this.featureAdapter=x.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const n= new f(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return n.countDistinctValues(this.items);const {groupByFieldsForStatistics:u,having:x,outStatistics:y}=this.query;if(!u?.length)return 1;const z=new Map,A=new Map,B=new Set;for(const F of y){var {statisticType:C}=F;C="exceedslimit"!==C?F.onStatisticField:void 0;if(!A.has(C)){var D=[];for(const H of u){const N=this._getAttributeValues(n,H,z);D.push(N)}A.set(C,this._calculateUniqueValues(D,n.returnDistinctValues))}C= A.get(C);for(const H in C){const {data:N,items:E}=C[H];D=N.join(",");x&&!n.validateItems(E,x)||B.add(D)}}return B.size}async createQueryResponse(){let n;n=this.query.outStatistics?this.query.outStatistics.some(u=>"exceedslimit"===u.statisticType)?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const u=this.query.geometry;h.isValid(this.query.outSR)&&!h.equals(u.spatialReference, this.query.outSR)?n.queryGeometry=c.cleanFromGeometryEngine({spatialReference:this.query.outSR,...e.project(u,u.spatialReference,this.query.outSR)}):n.queryGeometry=c.cleanFromGeometryEngine({spatialReference:this.query.outSR,...u})}return n}createSnappingResponse(n,u){const x=this.featureAdapter,y=v(this.hasZ,this.hasM),{point:z,mode:A}=n,B="number"===typeof n.distance?n.distance:n.distance.x,C="number"===typeof n.distance?n.distance:n.distance.y,D={candidates:[]},F="esriGeometryPolygon"===this.geometryType; u=this._getPointCreator(A,this.spatialReference,u);const H=new r(null,0),N=new r(null,0),E={x:0,y:0,z:0};for(const K of this.items){var G=x.getGeometry(K);if(null==G)continue;const {coords:J,lengths:R}=G;H.coords=J;N.coords=J;if(n.returnEdge){G=0;for(var I=0;I=M&&D.candidates.push(g.makeEdgeCandidate(x.getObjectId(K), u(W),Math.sqrt(M),u(P),u(Q)))}}}}if("none"!==n.vertexMode)if(G=F?J.length-y:J.length,"all"===n.vertexMode)for(I=0;I=L&&D.candidates.push(g.makeVertexCandidate(x.getObjectId(K),u(O),Math.sqrt(L)));else if("ends"===n.vertexMode){G=[0];F||G.push(J.length-y);for(const Q of G)G=H,G.coordsIndex=Q,I=(z.x-G.x)/B,O=(z.y-G.y)/C,I=I*I+O*O,1>=I&&D.candidates.push(g.makeVertexCandidate(x.getObjectId(K),u(G),Math.sqrt(I)))}}D.candidates.sort((K, J)=>K.distance-J.distance);return D}_getPointCreator(n,u,x){const y=null==x||h.equals(u,x)?A=>A:A=>e.project(A,u,x),{hasZ:z}=this;return"3d"===n?z?({x:A,y:B,z:C})=>y({x:A,y:B,z:C}):({x:A,y:B})=>y({x:A,y:B,z:0}):({x:A,y:B})=>y({x:A,y:B})}async createSummaryStatisticsResponse(n){const {field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,minValue:B,maxValue:C,scale:D,timeZone:F}=n;var H=this.fieldsIndex.get(u);n=d.isDateField(H)||d.isDateOnlyField(H)||d.isTimestampOffsetField(H); const N=await this._getDataValues({field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,scale:D,timeZone:F}),E=t.isNullCountSupported({normalizationType:z,normalizationField:y,minValue:B,maxValue:C}),G={value:.5,fieldType:H?.type};H=d.isStringField(H)?t.calculateStringStatistics({values:N,supportsNullCount:E,percentileParams:G}):t.calculateStatistics({values:N,minValue:B,maxValue:C,useSampleStdDev:!z,supportsNullCount:E,percentileParams:G});return t.processSummaryStatisticsResult(H, n)}async createUniqueValuesResponse(n){const {field:u,valueExpression:x,domains:y,returnAllCodedValues:z,scale:A,timeZone:B}=n;var C=await this._getDataValues({field:u,field2:n.field2,field3:n.field3,fieldDelimiter:n.fieldDelimiter,valueExpression:x,scale:A,timeZone:B},!1);C=t.calculateUniqueValuesCount(C);return t.createUVResult(C,y,z,n.fieldDelimiter)}async createClassBreaksResponse(n){const {field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,classificationMethod:B, standardDeviationInterval:C,minValue:D,maxValue:F,numClasses:H,scale:N,timeZone:E}=n;n=await this._getDataValues({field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,scale:N,timeZone:E});n=t.calculateClassBreaks(n,{field:u,normalizationField:y,normalizationType:z,normalizationTotal:A,classificationMethod:B,standardDeviationInterval:C,minValue:D,maxValue:F,numClasses:H});return t.resolveCBResult(n,B)}async createHistogramResponse(n){const {field:u,valueExpression:x, normalizationField:y,normalizationType:z,normalizationTotal:A,classificationMethod:B,standardDeviationInterval:C,minValue:D,maxValue:F,numBins:H,scale:N,timeZone:E}=n;n=await this._getDataValues({field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,scale:N,timeZone:E});return t.calculateHistogram(n,{field:u,normalizationField:y,normalizationType:z,normalizationTotal:A,classificationMethod:B,standardDeviationInterval:C,minValue:D,maxValue:F,numBins:H})}_sortFeatures(n, u,x){if(1{C=x(C,z,A);D=x(D,z,A);return B(C,D)})}}_createFeatureQueryResponse(n){const u=this.items,{geometryType:x,hasM:y,hasZ:z,objectIdField:A,spatialReference:B}=this,{outFields:C,outSR:D,quantizationParameters:F,resultRecordCount:H,resultOffset:N,returnZ:E,returnM:G}=n,I=null!=H?u.length>(N||0)+H: !1,O=C&&(C.includes("*")?[...this.fieldsIndex.fields]:C.map(L=>this.fieldsIndex.get(L)));return{exceededTransferLimit:I,features:this._createFeatures(n,u),fields:O,geometryType:x,hasM:y&&G,hasZ:z&&E,objectIdFieldName:A,spatialReference:c.cleanFromGeometryEngine(D||B),transform:F&&k.toQuantizationTransform(F)||null}}_createFeatures(n,u){const x=new f(n,this.featureAdapter,this.fieldsIndex),{hasM:y,hasZ:z}=this,{orderByFields:A,quantizationParameters:B,returnGeometry:C,returnCentroid:D,maxAllowableOffset:F, resultOffset:H,resultRecordCount:N,returnZ:E=!1,returnM:G=!1}=n,I=z&&E,O=y&&G;n=[];var L=0;const P=[...u];this._sortFeatures(P,A,(Q,W,S)=>x.getFieldValue(Q,W,S));if(this.geometryType&&(C||D)){var M=k.toQuantizationTransform(B)??void 0;u="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(C&&!D)for(var K of P){var J=this.featureAdapter.getGeometry(K),R={attributes:x.getAttributes(K),geometry:c.getGeometry(this.geometryType,this.hasZ,this.hasM,J,F,M,I,O)};u&&J&& !R.geometry&&(R.centroid=c.transformCentroid(this,this.featureAdapter.getCentroid(K,this),M));n[L++]=R}else if(!C&&D)for(J of P)n[L++]={attributes:x.getAttributes(J),centroid:c.transformCentroid(this,this.featureAdapter.getCentroid(J,this),M)};else for(R of P)n[L++]={attributes:x.getAttributes(R),centroid:c.transformCentroid(this,this.featureAdapter.getCentroid(R,this),M),geometry:c.getGeometry(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(R),F,M,I,O)}}else for(M of P)(K=x.getAttributes(M))&& (n[L++]={attributes:K});L=H||0;null!=N&&(n=n.slice(L,Math.min(n.length,L+N)));return n}_createExceedsLimitQueryResponse(n){var u=!1;let x=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY;u=Number.POSITIVE_INFINITY;for(const z of n.outStatistics??[])if("exceedslimit"===z.statisticType){x=null!=z.maxPointCount?z.maxPointCount:Number.POSITIVE_INFINITY;y=null!=z.maxRecordCount?z.maxRecordCount:Number.POSITIVE_INFINITY;u=null!=z.maxVertexCount?z.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"=== this.geometryType)u=this.items.length>x;else if(this.items.length>y)u=!0;else{n=v(this.hasZ,this.hasM);const z=this.featureAdapter;u=this.items.reduce((A,B)=>{B=z.getGeometry(B);return A+(null!=B&&B.coords.length||0)},0)/n>u}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(u)}}]}}async _createStatisticsQueryResponse(n){var u={attributes:{}};const x=[],y=new Map,z= new Map,A=new Map,B=new Map,C=new f(n,this.featureAdapter,this.fieldsIndex);var D=n.outStatistics;const {groupByFieldsForStatistics:F,having:H,orderByFields:N,resultRecordCount:E}=n;n=F?.length;const G=!!n,I=G?F[0]:null,O=G&&!this.fieldsIndex.get(I);for(const J of D??[]){const {outStatisticFieldName:R,statisticType:Q}=J;D=J;const W="exceedslimit"!==Q?J.onStatisticField:void 0,S="percentile_disc"===Q||"percentile_cont"===Q;var L="EnvelopeAggregate"===Q||"CentroidAggregate"===Q||"ConvexHullAggregate"=== Q;const V=G&&1===n&&(W===I||O)&&"count"===Q;if(G){if(!A.has(W)){var P=[];for(const T of F){var M=this._getAttributeValues(C,T,y);P.push(M)}A.set(W,this._calculateUniqueValues(P,L?!1:C.returnDistinctValues))}P=A.get(W);if(!P)continue;M=Object.keys(P);for(const T of M){const {count:Y,data:ha,items:ba,itemPositions:U}=P[T];M=ha.join(",");if(!H||C.validateItems(ba,H)){const Z=B.get(M)||{attributes:{}};if(L){Z.aggregateGeometries||(Z.aggregateGeometries={});const {aggregateGeometries:ea,outStatisticFieldName:da}= await this._getAggregateGeometry(D,ba);Z.aggregateGeometries[da]=ea}else{var K=null;if(V)K=Y;else{const ea=this._getAttributeValues(C,W,y);K=U.map(da=>ea[da]);K=S&&"statisticParameters"in D?this._getPercentileValue(D,K):this._getStatisticValue(D,K,null,C.returnDistinctValues)}Z.attributes[R]=K}let ca=0;F.forEach((ea,da)=>Z.attributes[this.fieldsIndex.get(ea)?ea:`EXPR_${++ca}`]=ha[da]);B.set(M,Z)}}}else if(L){u.aggregateGeometries||(u.aggregateGeometries={});const {aggregateGeometries:T,outStatisticFieldName:Y}= await this._getAggregateGeometry(D,this.items);u.aggregateGeometries[Y]=T}else L=this._getAttributeValues(C,W,y),u.attributes[R]=S&&"statisticParameters"in D?this._getPercentileValue(D,L):this._getStatisticValue(D,L,z,C.returnDistinctValues);D="min"!==Q&&"max"!==Q||!d.isStringField(this.fieldsIndex.get(W))&&!this._isAnyDateField(W)?null:this.fieldsIndex.get(W)?.type;x.push({name:R,alias:R,type:D||"esriFieldTypeDouble"})}u=G?Array.from(B.values()):[u];this._sortFeatures(u,N,(J,R)=>J.attributes[R]); E&&(u.length=Math.min(E,u.length));return{fields:x,features:u}}_isAnyDateField(n){n=this.fieldsIndex.get(n);return d.isDateField(n)||d.isDateOnlyField(n)||d.isTimestampOffsetField(n)||d.isTimeOnlyField(n)}async _getAggregateGeometry(n,u){const {convexHull:x,union:y}=await new Promise((E,G)=>a(["../../../geometry/geometryEngineJSON"],E,G)),{statisticType:z,outStatisticFieldName:A}=n,{featureAdapter:B,spatialReference:C,geometryType:D,hasZ:F,hasM:H}=this;u=u.map(E=>c.getGeometry(D,F,H,B.getGeometry(E))); const N=x(C,u,!0)[0];n={aggregateGeometries:null,outStatisticFieldName:null};"EnvelopeAggregate"===z?(u=N?p.getPolygonExtent(N):p.getGeometryExtent(y(C,u)),n.aggregateGeometries={...u,spatialReference:C},n.outStatisticFieldName=A||"extent"):"CentroidAggregate"===z?(u=N?l.polygonCentroid(N):l.extentCentroid(p.getGeometryExtent(y(C,u))),n.aggregateGeometries={x:u[0],y:u[1],spatialReference:C},n.outStatisticFieldName=A||"centroid"):"ConvexHullAggregate"===z&&(n.aggregateGeometries=N,n.outStatisticFieldName= A||"convexHull");return n}_getStatisticValue(n,u,x,y){const {onStatisticField:z,statisticType:A}=n;n=null;n=x?.has(z)?x.get(z):d.isStringField(this.fieldsIndex.get(z))||this._isAnyDateField(z)?t.calculateStringStatistics({values:u,returnDistinct:y}):t.calculateStatistics({values:y?[...(new Set(u))]:u,minValue:null,maxValue:null,useSampleStdDev:!0});x&&x.set(z,n);return n["var"===A?"variance":A]}_getPercentileValue(n,u){const {onStatisticField:x,statisticParameters:y,statisticType:z}=n,{value:A,orderBy:B}= y;n=this.fieldsIndex.get(x);return t.calculatePercentile(u,{value:A,orderBy:B,fieldType:n?.type,isDiscrete:"percentile_disc"===z})}_getAttributeValues(n,u,x){if(x.has(u))return x.get(u);const y=this.fieldsIndex.get(u),z=this.items.map(A=>n.getFieldValue(A,u,y));x.set(u,z);return z}_calculateUniqueValues(n,u){const x={},y=this.items,z=y.length;for(let A=0;Athis.getAttributes(c));return this._returnDistinctMap.size}getAttributes(f){f= this._processAttributesForOutFields(f);return this._processAttributesForDistinctValues(f)}getFieldValue(f,c,e){const g=e?e.name:c;let d=null;this._fieldDataCache.has(g)?d=this._fieldDataCache.get(g)?.clause:e||(d=a.getWhereClause(c,this.fieldsIndex),this._fieldDataCache.set(g,{alias:g,clause:d}));return e?this.featureAdapter.getAttribute(f,g):d?.calculateValue(f,this.featureAdapter)}getDataValues(f,c,e=!0){const g=c.normalizationType,d=c.normalizationTotal,t=this.fieldsIndex.get(c.field),w=q.isDateOnlyField(t)|| q.isTimestampOffsetField(t),v=q.isTimeOnlyField(t);return f.map(m=>{let r=c.field&&this.getFieldValue(m,c.field,this.fieldsIndex.get(c.field));c.field2?(r=`${p.processNullValue(r)}${c.fieldDelimiter}${p.processNullValue(this.getFieldValue(m,c.field2,this.fieldsIndex.get(c.field2)))}`,c.field3&&(r=`${r}${c.fieldDelimiter}${p.processNullValue(this.getFieldValue(m,c.field3,this.fieldsIndex.get(c.field3)))}`)):"string"===typeof r&&e&&(w?r=r?(new Date(r)).getTime():null:v&&(r=r?l.timeOnlyToMilliseconds(r): null));g&&Number.isFinite(r)&&(m="field"===g&&c.normalizationField?this.getFieldValue(m,c.normalizationField,this.fieldsIndex.get(c.normalizationField)):null,r=p.getNormalizedValue(r,g,m,d));return r})}async getExpressionValues(f,c,e,g,d){const {arcadeUtils:t}=await k.loadArcade(),w=t.hasGeometryOperations(c);w&&await t.enableGeometryOperations();const v=t.createFunction(c),m=t.getViewInfo(e),r={fields:this.fieldsIndex.fields};return f.map(n=>{n={attributes:this.featureAdapter.getAttributes(n),layer:r, geometry:w?{...b.getGeometry(g.geometryType,g.hasZ,g.hasM,this.featureAdapter.getGeometry(n)),spatialReference:e?.spatialReference}:null};n=t.createExecContext(n,m,d);return t.executeFunction(v,n)})}validateItem(f,c){this._fieldDataCache.has(c)||this._fieldDataCache.set(c,{alias:c,clause:a.getWhereClause(c,this.fieldsIndex)});return this._fieldDataCache.get(c)?.clause?.testFeature(f,this.featureAdapter)??!1}validateItems(f,c){this._fieldDataCache.has(c)||this._fieldDataCache.set(c,{alias:c,clause:a.getWhereClause(c, this.fieldsIndex)});return this._fieldDataCache.get(c)?.clause?.testSet(f,this.featureAdapter)??!1}_processAttributesForOutFields(f){const c=this.outFields;if(!c?.length)return this.featureAdapter.getAttributes(f);const e={};for(const g of c){const {alias:d,clause:t}=this._fieldDataCache.get(g);e[d]=t?t.calculateValue(f,this.featureAdapter):this.featureAdapter.getAttribute(f,d)}return e}_processAttributesForDistinctValues(f){if(null==f||!this.returnDistinctValues)return f;var c=this.outFields,e=[]; if(c)for(const d of c){var {alias:g}=this._fieldDataCache.get(d);e.push(f[g])}else for(g in f)e.push(f[g]);c=`${(c||["*"]).join(",")}=${e.join(",")}`;e=this._returnDistinctMap.get(c)||0;this._returnDistinctMap.set(c,++e);return 1!z.getField(A))}function n(y){const z=y.layer;return y.fields.filter(A=>{A=z.getFieldUsageInfo(A); return!A||!A.supportsStatistics})}let u=null;const x=/^(?([0-1][0-9])|([2][0-3])):(?[0-5][0-9])(:(?[0-5][0-9]))?([.](?\d+))?$/;a.calculateHeatmapStats=function(y,z=18,A,B,C){const D=new Float64Array(B*C);z=Math.round(l.pt2px(z));let F=Number.POSITIVE_INFINITY,H=Number.NEGATIVE_INFINITY;A=e.createValueFunction(A);for(const {geometry:G,attributes:I}of y){const {x:O,y:L}=G;y=Math.max(0,O-z);var N=Math.max(0,L-z);const P=Math.min(C,L+z),M=Math.min(B,O+z),K=+A(I);for(;NW.name.toLowerCase()===B.toLowerCase());const G=E?c.isTimeOnlyField(E):!1,I=E?g.isAnyDateField(E):!1,O=y.valueExpression,L=y.normalizationType,P=y.normalizationField,M=y.normalizationTotal,K=[];E=y.viewInfoParams;let J= null,R=null;if(O){if(!u){const {arcadeUtils:W}=await t.loadArcade();u=W}u.hasGeometryOperations(O)&&await u.enableGeometryOperations();J=u.createFunction(O);R=E?u.getViewInfo({viewingMode:E.viewingMode,scale:E.scale,spatialReference:new k(E.spatialReference)}):null}y=y.fieldInfos;const Q=z[0]&&"declaredClass"in z[0]&&"esri.Graphic"===z[0].declaredClass||!y?null:{fields:y};z.forEach(W=>{var S=W.attributes;if(O){var V=u.createExecContext(Q?{...W,layer:Q}:W,R,N);V=u.executeFunction(J,V)}else S&&(V=S[B], C?(V=`${d.processNullValue(V)}${F}${d.processNullValue(S[C])}`,D&&(V=`${V}${F}${d.processNullValue(S[D])}`)):"string"===typeof V&&A&&(I?V=V?(new Date(V)).getTime():null:G&&(V=V?v(V):null)));L&&"number"===typeof V&&isFinite(V)&&(S=S&&parseFloat(S[P]),V=d.getNormalizedValue(V,L,S,M));K.push(V)});return K};a.getRangeExpr=function(y,z,A){z=null!=z?y+" \x3e\x3d "+z:"";y=null!=A?y+" \x3c\x3d "+A:"";A="";return(A=z&&y?m(z,y):z||y)?"("+A+")":""};a.getSQLFilterForNormalization=function(y){const z=y.field, A=y.normalizationType;y=y.normalizationField;let B;if("field"===A)B="(NOT "+y+" \x3d 0)";else if("log"===A||"natural-log"===A||"square-root"===A)B=`(${z} > 0)`;return B};a.getSumOfAttributesExpr=function(y,z,A){const B=[],C=[],D=[],F=[],H=[];y.forEach((G,I)=>{const O=G.field?"field":"expression",L=G.field||G.valueExpression;G.field?(H.push(L),C.push(`var ${O}${I} = Number($feature["${L}"]);`)):(B.push(`function getValueForExpr${I}() {\n ${L} \n}`),C.push(`var ${O}${I} = Number(getValueForExpr${I}());`)); A||D.push(`${O}${I} = IIf(${O}${I} < 0, 0, ${O}${I});`);F.push(`${O}${I}`)});y="return sum;";const N=B.length?null:H.reduce((G,I)=>`${G} + ${I}`);let E=null;z||A?z?A||(y="return IIf(sum \x3e\x3d 0, sum, null);",N&&(E=`(( ${N} ) >= 0)`)):(y="return IIf(sum !\x3d 0, sum, null);",N&&(E=`(( ${N} ) <> 0)`)):(y="return IIf(sum \x3e 0, sum, null);",N&&(E=`(( ${N} ) > 0)`));return{valueExpression:[B.length?B.join("\n"):"",C.join("\n"),D.join("\n"),`var sum = ${F.join(" + ")};`,y].filter(Boolean).join("\n\n"), sqlExpression:N,sqlWhere:E}};a.mergeWhereClauses=m;a.quantizeFeatures=function(y,z,A,B){const C=f.isWrappable(A)?f.getInfo(A):null,D=C?Math.round((C.valid[1]-C.valid[0])/z.scale[0]):null;return y.map(F=>{const H=new w(F.geometry);h.quantizePoint(z,H,H);if(C){var N=D??0,E=B[0];0>H.x?H.x+=N:H.x>E&&(H.x-=N)}F.geometry=H;return F})};a.timeOnlyToMilliseconds=v;a.verifyBasicFieldValidity=function(y,z,A){const B=r({layer:y,fields:z});if(B.length)return new q(A,"Unknown fields: "+B.join(", ")+". You can only use fields defined in the layer schema"); y=n({layer:y,fields:z});if(y.length)return new q(A,"Unsupported fields: "+y.join(", ")+". You can only use fields that can be fetched i.e. AdapterFieldUsageInfo.supportsStatistics must be true")};a.verifyFieldType=function(y,z,A,B){let C;z?z.name!==y.objectIdField&&B.includes(z.type)||(C=new q(A,"'field' should be one of these types: "+B.join(","))):C=new q(A,"'field' is not defined in the layer schema");return C};a.verifyFilterValidty=function(y,z){if(y&&"intersects"!==y.spatialRelationship)return new q(z, "Only 'intersects' spatialRelationship is supported for featureFilter")};a.verifyNumericField=function(y,z,A){let B;z?z.name!==y.objectIdField&&c.isNumericField(z)||(B=new q(A,"'field' should be one of these numeric types: "+c.numericTypes.join(","))):B=new q(A,"'field' is not defined in the layer schema");return B};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/smartMapping/support/utils":function(){define("exports ../../intl/date ../../layers/support/fieldUtils ../../support/arcadeOnDemand ../../support/basemapUtils ../../time/timeZoneUtils".split(" "), function(a,b,q,l,p,k){function h(w){return String(w).padStart(2,"0")}function f(w,v,m){if("date"===v||"number"===v){"number"===v&&(w=new Date(w));v=m?w.getFullYear():w.getUTCFullYear();const r=h((m?w.getMonth():w.getUTCMonth())+1),n=h(m?w.getDate():w.getUTCDate()),u=h(m?w.getHours():w.getUTCHours()),x=h(m?w.getMinutes():w.getUTCMinutes());w=h(m?w.getSeconds():w.getUTCSeconds());w=`TIMESTAMP'${v}-${r}-${n} ${u}:${x}:${w}'`}return w}function c(w,v){if(v instanceof Date)return"date";if("number"===typeof v)return"number"; if("string"===typeof v&&(w=w.getField(v),"\x3cnow\x3e"!==v.toLowerCase()&&q.isDateField(w)))return"field"}const e={light:"streets gray topo terrain oceans osm gray-vector streets-vector topo-vector streets-relief-vector streets-navigation-vector topo-3d navigation-3d streets-3d osm-3d gray-3d arcgis-light-gray arcgis-navigation arcgis-streets arcgis-streets-relief arcgis-topographic arcgis-oceans osm-standard osm-standard-relief osm-streets osm-streets-relief osm-light-gray arcgis-terrain arcgis-charted-territory arcgis-community arcgis-colored-pencil arcgis-modern-antique arcgis-midcentury arcgis-newspaper arcgis-hillshade-light".split(" "), dark:"satellite hybrid dark-gray dark-gray-vector streets-night-vector navigation-dark-3d streets-dark-3d dark-gray-3d arcgis-imagery arcgis-imagery-standard arcgis-dark-gray arcgis-navigation-night arcgis-streets-night osm-dark-gray arcgis-nova arcgis-hillshade-dark".split(" ")},g={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864E5},d=new Set(["integer","small-integer"]);let t=null;a.castIntegerFieldToFloat=function(w){return`cast(${w} as float)`};a.dateTypes= ["date","date-only","timestamp-offset"];a.defaultBasemapGroups=e;a.fieldDelimiter=",";a.formatAnyDate=function(w,v){const {format:m,timeZoneOptions:r,fieldType:n}=v??{};let u;r&&({timeZone:x,timeZoneName:u}=k.getTimeZoneFormattingOptions(r.layerTimeZone,r.datesInUnknownTimezone,r.viewTimeZone,b.convertDateFormatToIntlOptions(m||"short-date-short-time"),n));if("string"===typeof w&&isNaN(Date.parse("time-only"===n?`1970-01-01T${w}Z`:w)))return w;switch(n){case "date-only":var x=b.convertDateFormatToIntlOptions(m|| "short-date");return"string"===typeof w?b.formatDateOnly(w,{...x}):b.formatDate(w,{...x,timeZone:k.utc});case "time-only":return x=b.convertDateFormatToIntlOptions(m||"short-time"),"string"===typeof w?b.formatTimeOnly(w,x):b.formatDate(w,{...x,timeZone:k.utc});case "timestamp-offset":if(!x&&"string"===typeof w&&(new Date(w)).toISOString()!==w)return w;x=(v=m||r?b.convertDateFormatToIntlOptions(m||"short-date-short-time"):void 0)?{...v,timeZone:x,timeZoneName:u}:void 0;return"string"===typeof w?b.formatTimestamp(w, x):b.formatDate(w,x);default:return v=m||r?b.convertDateFormatToIntlOptions(m||"short-date-short-time"):void 0,b.formatDate("string"===typeof w?new Date(w):w,v?{...v,timeZone:x,timeZoneName:u}:void 0)}};a.getBasemapGroup=function(w,v=e){for(const m in v)if(v[m].includes(w))return m};a.getBasemapId=function(w,v,m=!0){let r=null;w&&("string"===typeof w?v.includes(w)&&(r=w):r=p.getWellKnownBasemapId(w));return m?r||"gray":r};a.getDateDiffSQL=function(w,v,m,r){const {hasQueryEngine:n}=w;m=f(m,c(w,m), n);w=f(v,c(w,v),n);w=`(${m} - ${w})`;r=g[r];v="/";1>r&&(r=1/r,v="*");return{sqlExpression:1===r?w:`(${w} ${v} ${r})`,sqlWhere:null}};a.getDateType=c;a.getFieldsList=async function(w){const {field:v,field2:m,field3:r,normalizationField:n,valueExpression:u}=w;w=[];u&&(t||({arcadeUtils:w}=await l.loadArcade(),t=w),w=t.extractFieldNames(u));v&&w.push(v);m&&w.push(m);r&&w.push(r);n&&w.push(n);return w};a.getNormalizationType=function(w){let v=w.normalizationType;v||(w.normalizationField?v="field":null!= w.normalizationTotal&&(v="percent-of-total"));return v??void 0};a.isAnyDateField=function(w){return q.isDateField(w)||q.isDateOnlyField(w)||q.isTimestampOffsetField(w)};a.isIntegerField=function(w,v){w=v&&w.getField(v);return!!w&&d.has(w.type)};a.unitValueInDays=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/statistics/utils":function(){define(["exports","../rest/support/ClassBreaksDefinition","../rest/support/generateRendererUtils"],function(a,b,q){function l(E){return null== E||"string"===typeof E&&!E?"\x3cNull\x3e":E}function p(E){const G=null!=E.minValue||null!=E.maxValue,I=!!E.sqlExpression&&E.supportsSQLExpression;return!(null!=E.normalizationField||null!=E.normalizationType)&&!G&&!I}function k(E){const {values:G,useSampleStdDev:I,supportsNullCount:O}=E;var L=Number.POSITIVE_INFINITY;let P=Number.NEGATIVE_INFINITY,M=null,K=null;var J=null;let R=null,Q=0;const W=null==E.minValue?-Infinity:E.minValue,S=null==E.maxValue?Infinity:E.maxValue;for(const V of G)Number.isFinite(V)? V>=W&&V<=S&&(M=null===M?V:M+V,L=Math.min(L,V),P=Math.max(P,V),Q++):"string"===typeof V&&Q++;if(Q&&null!=M){K=M/Q;J=0;for(const V of G)Number.isFinite(V)&&V>=W&&V<=S&&(J+=(V-K)**2);R=I?1null!=Q).sort((Q, W)=>M(Q,W));if(0===E.length)return null;if(0>=O)return E[0];if(1<=O)return E[E.length-1];var K=(E.length-1)*O,J=Math.floor(K);G=J+1;K%=1;J=E[J];const R=E[G];return G>=E.length||P||"string"===typeof J||"string"===typeof R?J:J*(1-K)+R*K}function f(E,G){if(E){if(u.has(E))return G?H:N;if(x.has(E))return c(G,!1);if("esriFieldTypeTimestampOffset"===E)return G?C:B;const P=c(G,!0);if("esriFieldTypeString"===E)return P;if("esriFieldTypeGUID"===E||"esriFieldTypeGlobalID"===E)return(M,K)=>P(e(M),e(K))}const I= G?1:-1,O=G?H:N,L=c(G,!0);return(P,M)=>"number"===typeof P&&"number"===typeof M?O(P,M):"string"===typeof P&&"string"===typeof M?L(P,M):I}function c(E,G){if(!G)return E?F:D;const I=E?z:A;return E?(O,L)=>{const P=I(O,L);if(null!=P)return P;O=O.toUpperCase();L=L.toUpperCase();return O>L?-1:O{const P=I(O,L);if(null!=P)return P;O=O.toUpperCase();L=L.toUpperCase();return OL?1:0}}function e(E){return E.substr(24,12)+E.substr(19,4)+E.substr(16,2)+E.substr(14,2)+E.substr(11,2)+E.substr(9, 2)+E.substr(6,2)+E.substr(4,2)+E.substr(2,2)+E.substr(0,2)}function g(E){return"coded-value"!==E?.type?[]:E.codedValues.map(G=>G.code)}function d(E,G){const I=w({field:G.field,normalizationType:G.normalizationType,normalizationField:G.normalizationField,classificationMethod:G.classificationMethod,standardDeviationInterval:G.standardDeviationInterval,breakCount:G.numClasses||5});E=t(E,G.minValue,G.maxValue);return q.createGenerateRendererClassBreaks({definition:I,values:E,normalizationTotal:G.normalizationTotal})} function t(E,G,I){const O=null==G?-Infinity:G,L=null==I?Infinity:I;return E.filter(P=>Number.isFinite(P)&&P>=O&&P<=L)}function w(E){const {breakCount:G,field:I,normalizationField:O,normalizationType:L}=E,P=E.classificationMethod||"equal-interval";return new b({breakCount:G,classificationField:I,classificationMethod:P,normalizationField:"field"===L?O:void 0,normalizationType:L,standardDeviationInterval:"standard-deviation"===P?E.standardDeviationInterval||1:void 0})}function v(E,G){const {field:I, classificationMethod:O,standardDeviationInterval:L,normalizationType:P,normalizationField:M,normalizationTotal:K,minValue:J,maxValue:R}=G,Q=G.numBins||10;let W=G=null,S=null;O&&"equal-interval"!==O||P?({classBreaks:E}=d(E,{field:I,normalizationType:P,normalizationField:M,normalizationTotal:K,classificationMethod:O,standardDeviationInterval:L,minValue:J,maxValue:R,numClasses:Q}),G=E[0].minValue,W=E[E.length-1].maxValue,S=E.map(V=>[V.minValue,V.maxValue])):(null!=J&&null!=R?(G=J,W=R):(E=k({values:E, minValue:J,maxValue:R,useSampleStdDev:!P,supportsNullCount:p({normalizationType:P,normalizationField:M,minValue:J,maxValue:R})}),G=E.min??null,W=E.max??null),S=r(G??0,W??0,Q));return{min:G,max:W,intervals:S}}function m(E,G){let I=-1;for(let O=E.length-1;0<=O;O--)if(G>=E[O][0]){I=O;break}return I}function r(E,G,I){const O=(G-E)/I,L=[];let P;for(let M=1;M<=I;M++)P=E+O,P=Number(P.toFixed(16)),L.push([E,M===I?G:P]),E=P;return L}const n=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,u=new Set("esriFieldTypeDate esriFieldTypeInteger esriFieldTypeSmallInteger esriFieldTypeSingle esriFieldTypeDouble esriFieldTypeLong esriFieldTypeOID esriFieldTypeBigInteger".split(" ")), x=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),y="min max avg stddev count sum variance nullcount median".split(" "),z=(E,G)=>null==E?null==G?0:1:null==G?-1:null,A=(E,G)=>null==E?null==G?0:-1:null==G?1:null,B=(E,G)=>A(E,G)??(E===G?0:(new Date(E)).getTime()-(new Date(G)).getTime()),C=(E,G)=>z(E,G)??(E===G?0:(new Date(G)).getTime()-(new Date(E)).getTime()),D=(E,G)=>A(E,G)??(E===G?0:Ez(E,G)??(E===G?0:Ez(E,G)??G-E,N=(E,G)=>A(E,G)??E-G;a.calculateClassBreaks= d;a.calculateHistogram=function(E,G){var I=v(E,G);if(null==I.min&&null==I.max)return{bins:[],minValue:I.min,maxValue:I.max,normalizationTotal:G.normalizationTotal};const O=I.intervals,L=I.min??0;I=I.max??0;const P=O.map((M,K)=>({minValue:O[K][0],maxValue:O[K][1],count:0}));for(const M of E)null!=M&&M>=L&&M<=I&&(E=m(O,M),-1null!=L).sort();const O=I.length;I={count:O,min:I[0],max:I[O-1]};E.supportsNullCount&&(I.nullcount=G.length-O);E.percentileParams&&(I.median=h(G,E.percentileParams));return I};a.calculateUniqueValuesCount=function(E){const G={};for(let I of E){if(null==I||"string"===typeof I&&""===I.trim())I=null;null==G[I]?G[I]={count:1,data:I}:G[I].count++}return{count:G}};a.createClassBreaksDefinition=w;a.createUVResult=function(E,G,I,O){E=E.count; const L=[];if(I&&G){I=[];var P=g(G[0]);for(const M of P)if(G[1]){P=g(G[1]);for(const K of P)if(G[2]){P=g(G[2]);for(const J of P)I.push(`${l(M)}${O}${l(K)}${O}${l(J)}`)}else I.push(`${l(M)}${O}${l(K)}`)}else I.push(M);for(const M of I)E.hasOwnProperty(M)||(E[M]={data:M,count:0})}for(const M in E)G=E[M],L.push({value:G.data,count:G.count,label:G.label});return{uniqueValueInfos:L}};a.getAttributeComparator=f;a.getEqualIntervalBins=r;a.getNormalizedValue=function(E,G,I,O){let L=null;switch(G){case "log":0!== E&&(L=Math.log(E)*Math.LOG10E);break;case "percent-of-total":Number.isFinite(O)&&0!==O&&(L=E/O*100);break;case "field":Number.isFinite(I)&&0!==I&&(L=E/I);break;case "natural-log":0{null!=E[O]&&(E[O]=Math.ceil(E[O]?? 0))});return E};a.resolveCBResult=function(E,G){let I=E.classBreaks;const O=I[0]?.minValue,L=I[I.length-1]?.maxValue,P="standard-deviation"===G;I=I.map(M=>{const K=M.label;M={minValue:M.minValue,maxValue:M.maxValue,label:K};if(P&&K){const J=K.match(n)?.map(R=>+R.trim())??[];2===J.length?(M.minStdDev=J[0],M.maxStdDev=J[1],0>J[0]&&0B-C);var u=n[0],x=n[n.length-1];if("equal-interval"===w)if(n.length>= t){n=(x-u)/t;d=u;for(var y=1;y{r.push({minValue:B,maxValue:B,label:l(B,B,v)})});else if("natural-breaks"===w){n=p(n);d=k(n.uniqueValues,d.valueFrequency||n.valueFrequency,t);for(y=1;yy&&(z=Number(n.uniqueValues[d[y]].toFixed(6)),r.push({minValue:u,maxValue:z,label:l(u,z,v)}),u=z);r.push({minValue:u,maxValue:x,label:l(u, x,v)})}else if("quantile"===w)if(n.length>=t&&u!==x){d=Math.ceil(n.length/t);y=0;for(z=1;zn.length&&(A=n.length-1);0>A&&(A=0);r.push({minValue:u,maxValue:n[A],label:l(u,n[A],v)});u=n[A];y+=d;d=Math.ceil((n.length-y)/(t-z))}r.push({minValue:u,maxValue:x,label:l(u,x,v)})}else for(t=-1,x=0;xv&&(w=v);for(var r=0;r< w;r++)m.push(Math.round(r*v/w-1));m.push(v-1);r=h(m,d,t,w);v=r.mean;r=r.sdcm;var n=w,u=0,x=0;let y=0,z=0,A=!0;for(let C=0;2>C&&A;C++){0===C&&(A=!1);for(var B=0;BMath.abs(r-x[n-1]))d[n]=A;else if(nMath.abs(r-x[n+1])){d[n+1]=A-1;break}A=u;u=0;r=[];n=[];for(let B=0;B< v;B++){r.push(x[B]);n.push(y[B]);const C=g(B,d,t,w);x[B]=C.sbMean;y[B]=C.sbSdcm;u+=y[B]}}if(u>A){for(t=0;t=r&&b.getLogger("esri.rest.support.generateRendererUtils").warn("Exception in Natural Breaks calculation");m/=r;r=0;for(n=t[d]+1;n<=t[d+1];n++)r+=v[n]*(w[n]-m)**2;return{sbMean:m,sbSdcm:r}}a.createGenerateRendererClassBreaks=function(d){const {normalizationTotal:t}=d;return{classBreaks:q(d),normalizationTotal:t}};a.createGenerateRendererUniqueValues=function(d){d=p(d);const t=[],w=d.uniqueValues.length;for(let v=0;ve.project(x,c.wgs84));return(await w())(y.spatialReference,y,n,r)}async function w(){return(await new Promise((r,n)=>a(["../../../geometry/geometryEngineJSON"],r,n))).geodesicBuffer}const v=new q.JSONMap({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers", esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),m=Object.freeze({});b.normalizeQuery=async function(r,n,u){const {outFields:x,orderByFields:y,groupByFieldsForStatistics:z,outStatistics:A}=r;if(x)for(var B=0;Bx.outStatisticFieldName&&x.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(m&&0{const z=y.toLowerCase();return z.includes(" asc")?z.split(" asc")[0]:z.includes(" desc")?z.split(" desc")[0]:y}).filter(y=>!u.includes(y));q.validateFields(d,t,x,{expressionName:"orderByFields",query:w})}if(v&&0x.onStatisticField).filter(Boolean);q.validateFields(d,t,u,{expressionName:"onStatisticFields",query:w});n&&q.validateFields(d,t,m,{expressionName:"groupByFieldsForStatistics", query:w});for(const x of v){const {onStatisticField:y,statisticType:z}=x;if(("percentile_disc"===z||"percentile_cont"===z)&&"statisticParameters"in x){if({statisticParameters:n}=x,!n)throw new b("unsupported-query","statisticParameters should be set for percentile type",{definition:x,query:w});}else d.get(y)&&"count"!==z&&"min"!==z&&"max"!==z&&q.validateFields(d,t,[y],{expressionName:`outStatistics with '${z}' statistic type`,allowedFieldTypes:g,query:w})}}}async function c(d,t,w,v){var m=[];w.valueExpression&& ({arcadeUtils:m}=await k.loadArcade(),m=m.extractFieldNames(w.valueExpression));w.field&&m.push(w.field);w.field2&&m.push(w.field2);w.field3&&m.push(w.field3);w.normalizationField&&m.push(w.normalizationField);if(!m.length&&!w.valueExpression)throw new b("unsupported-query","field or valueExpression is required",{params:w});q.validateFields(d,t,m,{expressionName:"statistics",query:v})}function e(d){return null!=d&&d.every(t=>"exceedslimit"!==t.statisticType)}const g=new Set([...q.numericFieldTypes, ...q.allDateAndTimeFieldTypes]);a.validateQuery=async function(d,{fieldsIndex:t,geometryType:w,spatialReference:v,availableFields:m}){if(0>(d.distance??0)||null!=d.geometryPrecision||d.multipatchOption&&"xyFootprint"!==d.multipatchOption||d.pixelSize||d.relationParam||d.text)throw new b("unsupported-query","Unsupported query options",{query:d});h(t,m,d);f(t,m,d);return Promise.all([p.checkSpatialQuerySupport(d,w,v),l.checkProjectionSupport(v,d.outSR)]).then(()=>d)};a.validateStatisticsQuery=async function(d, t,{fieldsIndex:w,geometryType:v,spatialReference:m,availableFields:r}){if(0>(d.distance??0)||null!=d.geometryPrecision||d.multipatchOption||d.pixelSize||d.relationParam||d.text||d.outStatistics||d.groupByFieldsForStatistics||d.having||d.orderByFields)throw new b("unsupported-query","Unsupported query options",{query:d});h(w,r,d);return Promise.all([c(w,r,t,d),p.checkSpatialQuerySupport(d,v,m),l.checkProjectionSupport(m,d.outSR)]).then(()=>d)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/layers/graphics/data/spatialQuerySupport":function(){define("require exports ../../../core/Error ../../../geometry/support/contains ../../../geometry/support/intersects ../../../geometry/support/jsonUtils ../../../geometry/support/spatialReferenceUtils ../contains ../featureConversionUtils ../OptimizedGeometry ./geometryUtils ./projectionSupport".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d){function t(){return new Promise((n,u)=>a(["../../../geometry/geometryEngineJSON"],n,u))}const w={esriSpatialRelIntersects:"intersects", esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null};var v={esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0, esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},m={esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},r={esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1};b.canQueryWithRBush=function(n){if(k.isExtent(n))return!0;if(k.isPolygon(n)){for(const u of n.rings)if(5!==u.length||u[0][0]!==u[1][0]||u[0][0]!==u[4][0]||u[2][0]!==u[3][0]||u[0][1]!==u[3][1]||u[0][1]!== u[4][1]||u[1][1]!==u[2][1])return!1;return!0}return!1};b.checkSpatialQuerySupport=async function(n,u,x){const {spatialRel:y,geometry:z}=n;if(z){if(null==y||!0!==v[y])throw new q("unsupported-query","Unsupported query spatial relationship",{query:n});if(h.isValid(z.spatialReference)&&h.isValid(x)){if(null==z||!0!==m[k.getJsonType(z)])throw new q("unsupported-query","Unsupported query geometry type",{query:n});if(null==u||!0!==r[u])throw new q("unsupported-query","Unsupported layer geometry type",{query:n}); if(n.outSR)return d.checkProjectionSupport(n.geometry?.spatialReference,n.outSR)}}};b.getSpatialQueryOperator=function(n,u,x,y,z){if(k.isPolygon(u)&&"esriGeometryPoint"===x&&("esriSpatialRelIntersects"===n||"esriSpatialRelContains"===n)){const A=c.convertFromPolygon(new e,u,!1,!1);return Promise.resolve(B=>f.polygonContainsPoint(A,!1,!1,B))}if(k.isPolygon(u)&&"esriGeometryMultipoint"===x){const A=c.convertFromPolygon(new e,u,!1,!1);if("esriSpatialRelContains"===n)return Promise.resolve(B=>f.polygonContainsMultipoint(A, !1,!1,B,y,z))}if(k.isExtent(u)&&"esriGeometryPoint"===x&&("esriSpatialRelIntersects"===n||"esriSpatialRelContains"===n))return Promise.resolve(A=>l.extentContainsPoint(u,g.getGeometry(x,y,z,A)));if(k.isExtent(u)&&"esriGeometryMultipoint"===x&&"esriSpatialRelContains"===n)return Promise.resolve(A=>l.extentContainsMultipoint(u,g.getGeometry(x,y,z,A)));if(k.isExtent(u)&&"esriSpatialRelIntersects"===n){const A=p.getExtentIntersector(x);return Promise.resolve(B=>A(u,g.getGeometry(x,y,z,B)))}return t().then(A=> {const B=A[w[n]].bind(null,u.spatialReference,u);return C=>B(g.getGeometry(x,y,z,C))})};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/intersects":function(){define(["exports","./intersectsBase"],function(a,b){a.extentIntersectsExtent=b.extentIntersectsExtent;a.extentIntersectsMultipoint=b.extentIntersectsMultipoint;a.extentIntersectsPoint=b.extentIntersectsPoint;a.extentIntersectsPolygon=b.extentIntersectsPolygon;a.extentIntersectsPolyline=b.extentIntersectsPolyline; a.getFeatureExtentIntersector=b.getFeatureExtentIntersector;a.isSelfIntersecting=b.isSelfIntersecting;a.segmentIntersects=b.segmentIntersects;a.getExtentIntersector=function(q){return"mesh"===q?b.extentIntersectsExtent:b.getFeatureExtentIntersector(q)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/contains":function(){define(["exports"],function(a){function b(q,l,p,k,h){if(!q)return!1;l=l?p?4:3:p?3:2;const {coords:f,lengths:c}=q;p=!1;q=0;for(const g of c){var e= q;for(let d=q,t=q+g*l;d=h||e=h)&&w+(h-v)/(e-v)*(m-w){const g=p(e,k);e=p(e,h);return(null==g||g<=c)&&(null==e||e>=f)};if(null!=f)return e=>{e=p(e,h);return null==e||e>=f};if(null!=c)return e=>{e=p(e,k);return null==e||e<=c}}function q(p,k,h,f){if(null!=h&&null!=f&&h===f)return c=>p(c,k)===h;if(null!=h&&null!=f)return c=>{c=p(c,k);return null!=c&&c>=h&&c<=f};if(null!=h)return c=>{c=p(c,k);return null!=c&&c>=h};if(null!= f)return c=>{c=p(c,k);return null!=c&&c<=f}}function l(){return()=>!1}a.getTimeExtent=async function(p,k){if(!p)return null;const h=k.featureAdapter,{startTimeField:f,endTimeField:c}=p;let e=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(f&&c)await k.forEach(d=>{const t=h.getAttribute(d,f);d=h.getAttribute(d,c);null==t||isNaN(t)||(e=Math.min(e,t));null==d||isNaN(d)||(g=Math.max(g,d))});else{const d=f||c;await k.forEach(t=>{t=h.getAttribute(t,d);null==t||isNaN(t)||(e=Math.min(e,t),g=Math.max(g, t))})}return{start:e,end:g}};a.getTimeOperator=function(p,k,h){if(!k||!p)return null;const {startTimeField:f,endTimeField:c}=p;if(!f&&!c)return null;const {start:e,end:g}=k;if(null===e&&null===g)return null;if(void 0===e&&void 0===g)return l();p=h.getAttributeAsTimestamp?.bind(h)??h.getAttribute.bind(h);return f&&c?b(p,f,c,e,g):q(p,f||c,e,g)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/queryForSymbologySnapping":function(){define(["exports","../../../../core/promiseUtils", "../../../../support/arcadeOnDemand"],function(a,b,q){const l={candidates:[],sourceCandidateIndices:[]};a.queryForSymbologySnapping=async function(p,k,h){if(null==p||0===k.candidates.length)return l;var f=p.graphics3DGraphicsByObjectID??p.graphics3DGraphics,c=[];const e=[],{renderer:g}=p,d=null!=g&&"arcadeRequired"in g&&g.arcadeRequired?q.loadArcade():null;var t=async(n,{graphic:u,graphics3DSymbol:x})=>{const y=await d;u=await p.getRenderingInfoAsync(u,g,y,{signal:h});return null==u?[]:x.queryForSnapping(n, v,u,h)};const {candidates:w,spatialReference:v}=k;for(k=0;kthis._loadedPointGraphics.length,setAllFeaturesVisibility:ba=>this._setAllFeaturesVisibility(ba),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:ba=> this._updateFeatureVisibilities(ba)}});this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,ba=>this._onLoadedFeaturesChange(ba),c.initial);this._updatingHandles.addWhen(()=>this._materialParameters,ba=>this._forEachMaterial(U=>U.setParameters(ba)),c.initial);this._updatingHandles.add(()=>this._rendererParameters,ba=>this._drapeSourceRenderer.set(ba));this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},c.sync);this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName, numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:ba,numeric:U})=>{if(null!=ba&&U){let Z=0;this._featureStore.forEach(ca=>Z+=ca.attributes[ba]??0);this._fieldTotal=Z}else this._fieldTotal=this._featureStore.numFeatures},c.initial);this.addHandles([c.watch(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:ba,field:U})=>{ba&&!U&&f.getLogger(this).warn(`Heatmap renderer field '${ba}' for layer '${this.layer.title??this.layer.id}' not found`)}),c.watch(()=> ({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:ba,numeric:U})=>{null==ba||U||f.getLogger(this).warn(`Heatmap renderer field '${ba.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),k.makeHandle(()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear();this._materialWithField=this._material=null;this._featureStore.clear(); this._featureStore=null;this._updatingHandles.destroy()}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){var S=this.owner?.view?.quality??1;const V=this.owner?.view?.qualitySettings;S=V?Math.ceil(V.heatmap.maxTotalNumberOfFeatures* S):0;return new D.DisplayFeatureLimit(6*S,S)}get hasZ(){return"hasZ"in this.layer&&this.layer.hasZ}get hasM(){return"hasM"in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;const {minScale:S,maxScale:V}=this.layer.effectiveScaleRange,{scale:T}=this.view;return!R.scaleBoundsPredicate(T,S??0,V??0)}get usedMemory(){const S= Math.ceil((this._overlayRenderer?.overlays[0]?.resolution??0)*this._densityMapPixelRatio)??0;return S*S*(this._pixelFormat===Q.PixelFormat.RED?1:4)*(this._dataType===Q.PixelType.FLOAT?4:2)+this.usedMemoryPerFeature*this._featureStore.numFeatures}get usedMemoryPerFeature(){var S=this._loadedPointGraphics.find(()=>!0);if(null==S)return 0;S=p.estimateAttributesObjectSize(S);const V=p.estimateNumberByteSize(),T=6*p.estimateFixedArraySize([0,0,0],V),Y=6*p.estimateFixedArraySize([0,0],V);return T+Y+(this._heatmapRendererFieldIsNumeric? 6*V:0)+S}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return new F.GraphicsCorePerformanceInfo(this._visibleFeatures,0,0)}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.basemapTerrain.overlayManager.renderer}get _overlaySpatialReference(){return this._overlayRenderer.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter, ...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){const S=this._heatmapRenderer;if(null==S)return null;const {minDensity:V,maxDensity:T}=S;return{minDensity:V,maxDensity:T,fieldTotal:this._fieldTotal}}get _radiusParameter(){const S=this._heatmapRenderer;return S?{searchRadius:e.pt2px(this._clampSearchRadius(S.radius))}:null}get _resolutionForScaleParameter(){var S=this._heatmapRenderer;if(!S)return null; ({referenceScale:S}=S);return{resolutionForScale:0===S?0:r.getResolutionForScale(S,this.view.spatialReference)}}get _colorRampParameter(){const S=this._heatmapRenderer;return S?{colorRampData:B.generateGradient(S.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){return this.owner?.view?.qualitySettings.heatmap.pixelRatio??1}get _renderView(){return this.view._stage.renderView}get _featuresArePoints(){return"point"===this.layer.geometryType}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){const S= this.layer.renderer;return"heatmap"===S?.type?S:null}get _heatmapRendererFieldName(){return this._heatmapRenderer?.field}get _heatmapRendererField(){const S=this._heatmapRendererFieldName;return null!=S?this.layer.fieldsIndex.get(S):null}get _heatmapRendererFieldIsNumeric(){const S=this._heatmapRendererField;return null==S?!1:A.isNumericField(S)}get _isScaleRangeActive(){const {layer:S}=this;if(!("effectiveScaleRange"in S))return!1;const {minScale:V,maxScale:T}=S.effectiveScaleRange;return R.isScaleRangeActive(V, T)}get _visibleFeatures(){let S=0;this._renderGeometries.forEach(V=>{V.visible&&++S});return S}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlight(){return k.makeHandle()}maskOccludee(){return k.makeHandle()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(S){if(this._featuresArePoints){var {objectIdField:V}=this.layer;this._featureStore.removeManyById(S.removed.map(Y=>n.getObjectId(Y,V)));this._featureStore.addMany(S.added.map(Y=> {const {attributes:ha,centroid:ba,geometry:U}=Y,Z=new x.OptimizedFeature(u.convertFromPoint(new y,U),ha,ba?u.convertFromPoint(new y,ba):null,n.getObjectId(Y,V));Z.displayId=Y.uid;return Z}));var T=S.added;S=S.removed;this._fieldTotal+=this._computeFieldTotalChange(T,S);S=S.map(({uid:Y})=>{const ha=this._renderGeometries.get(Y);this._renderGeometries.delete(Y);return ha}).filter(l.isSome);T=T.map(Y=>{const ha=this._pointGraphicToRenderGeometry(Y);this._renderGeometries.set(Y.uid,ha);return ha});0< S.length&&this._drapeSourceRenderer.removeGeometries(S,L.DirtyOperation.REMOVE);0ha+(ba.attributes[T]??0);return S.reduce(Y,0)-V.reduce(Y,0)}_clampSearchRadius(S){112{T=S(T);(Y=this._renderGeometries.get(Y))&&Y.visible!==T&&(V.push(Y),Y.visible=T)});this._drapeSourceRenderer.modifyGeometries(V,L.DirtyState.VISIBILITY)}_setAllFeaturesVisibility(S){const V=[];for(const T of this._renderGeometries.values())T.visible!==S&&(V.push(T),T.visible=S);this._drapeSourceRenderer.modifyGeometries(V,L.DirtyState.VISIBILITY)}get test(){}};b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"type",void 0); b.__decorate([g.property({constructOnly:!0})],a.HeatmapFeatureProcessor.prototype,"owner",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"layer",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"featureStore",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"updating",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"updatingRemaining",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"suspendInfo", null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"legendEnabled",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"filterVisibility",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"displayFeatureLimit",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"preferredUpdatePolicy",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"hasZ",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype, "hasM",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"dataExtent",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"view",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"fullOpacity",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"updatePolicy",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"drapeSourceType",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"scaleVisibilitySuspended", null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"renderer",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_featureStore",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_filterVisibility",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_overlayRenderer",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_overlaySpatialReference",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype, "_rendererParameters",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_materialParameters",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_densityParameters",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_radiusParameter",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_resolutionForScaleParameter",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_colorRampParameter",null);b.__decorate([g.property()], a.HeatmapFeatureProcessor.prototype,"_pixelRatioParameter",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_densityMapPixelRatio",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_renderGeometries",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_material",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_materialWithField",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_renderView", null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_featuresArePoints",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_loadedPointGraphics",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_heatmapRenderer",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_heatmapRendererFieldName",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_heatmapRendererField",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype, "_heatmapRendererFieldIsNumeric",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_fieldTotal",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_drapeSourceRenderer",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_isScaleRangeActive",null);a.HeatmapFeatureProcessor=b.__decorate([d.subclass("esri.views.3d.layers.support.HeatmapFeatureProcessor")],a.HeatmapFeatureProcessor);a.maxRadiusPt=112;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/layers/graphics/data/FeatureStore":function(){define("../../../core/arrayUtils ../../../core/Error ../../../core/Evented ../../../core/Logger ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../featureConversionUtils ./BoundsStore ./geometryUtils ./optimizedFeatureQueryEngineAdapter".split(" "),function(a,b,q,l,p,k,h,f,c,e){const g=p.create();class d{constructor(t){this.geometryInfo=t;this._boundsStore=new f.BoundsStore;this._featuresById= new Map;this._markedIds=new Set;this.events=new q;this.featureAdapter=e.optimizedFeatureQueryEngineAdapter}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let t=0;this._featuresById.forEach(w=>{null!=w.geometry&&w.geometry.coords&&(t+=w.geometry.coords.length)});return{featureCount:this._featuresById.size, vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(null==this.fullBounds)return null;const [w,v,m,r]=this.fullBounds;return{xmin:w,ymin:v,xmax:m,ymax:r,spatialReference:c.cleanFromGeometryEngine(t)}}add(t){this._add(t);this._emitChanged()}addMany(t){for(const w of t)this._add(w);this._emitChanged()}upsertMany(t){t=t.map(w=>this._upsert(w));this._emitChanged();return t.filter(a.isSome)}clear(){this._featuresById.clear();this._boundsStore.clear();this._emitChanged()}removeById(t){t= this._featuresById.get(t);if(!t)return null;this._remove(t);this._emitChanged();return t}removeManyById(t){this._boundsStore.invalidateIndex();for(const w of t)(t=this._featuresById.get(w))&&this._remove(t);this._emitChanged()}forEachBounds(t,w){for(const v of t)(t=this._boundsStore.get(v.objectId))&&w(p.fromRect(g,t))}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach(w=>t(w))}forEachInBounds(t,w){this._boundsStore.forEachInBounds(t, v=>{w(this._featuresById.get(v))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex();this._markedIds.clear()}sweep(){let t=!1;this._featuresById.forEach((w,v)=>{this._markedIds.has(v)||(t=!0,this._remove(w))});this._markedIds.clear();t&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(t){var w=t.objectId;if(null==w)l.getLogger("esri.layers.graphics.data.FeatureStore").error(new b("featurestore:invalid-feature","feature id is missing",{feature:t}));else{var v= this._featuresById.get(w);this._markedIds.add(w);if(v){t.displayId=v.displayId;var m=this._boundsStore.get(w);this._boundsStore.delete(w)}else if(null!=this.onFeatureAdd)this.onFeatureAdd(t);t.geometry?.coords?.length?(m=h.getBoundsOptimizedGeometry(null!=m?m:k.create(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=m&&this._boundsStore.set(w,m)):this._boundsStore.set(w,null);this._featuresById.set(w,t)}}}_upsert(t){const w=t?.objectId;if(null==w)return l.getLogger("esri.layers.graphics.data.FeatureStore").error(new b("featurestore:invalid-feature", "feature id is missing",{feature:t})),null;const v=this._featuresById.get(w);if(!v)return this._add(t),t;this._markedIds.add(w);const {geometry:m,attributes:r}=t;for(const n in r)v.attributes[n]=r[n];m&&(v.geometry=m,this._boundsStore.set(w,h.getBoundsOptimizedGeometry(k.create(),m,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null));return v}_remove(t){if(null!=this.onFeatureRemove)this.onFeatureRemove(t);const w=t.objectId;this._markedIds.delete(w);this._boundsStore.delete(w);this._featuresById.delete(w); return t}}return d})},"esri/layers/graphics/data/BoundsStore":function(){define(["exports","../../../core/has","../../../core/libs/rbush/PooledRBush","../../../geometry/support/aaBoundingRect"],function(a,b,q,l){function p(f,c,e){k.minX=c[0];k.minY=c[1];k.maxX=c[2];k.maxY=c[3];f.search(k,e)}const k={minX:0,minY:0,maxX:0,maxY:0};class h{constructor(){this._indexInvalid=!1;this._boundsToLoad=[];this._boundsById=new Map;this._idByBounds=new Map;this._index=new q.PooledRBush(9,b("esri-csp-restrictions")? f=>({minX:f[0],minY:f[1],maxX:f[2],maxY:f[3]}):["[0]","[1]","[2]","[3]"]);this._loadIndex=()=>{if(this._indexInvalid){const f=Array(this._idByBounds.size);let c=0;this._idByBounds.forEach((e,g)=>{f[c++]=g});this._indexInvalid=!1;this._index.clear();this._index.load(f)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(f=>this._idByBounds.has(f))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const f=l.empty();for(const c of this._boundsById.values())c&& (f[0]=Math.min(c[0],f[0]),f[1]=Math.min(c[1],f[1]),f[2]=Math.max(c[2],f[2]),f[3]=Math.max(c[3],f[3]));return f}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1;this._boundsToLoad.length=0;this._boundsById.clear();this._idByBounds.clear();this._index.clear()}delete(f){const c=this._boundsById.get(f);this._boundsById.delete(f);c&&(this._idByBounds.delete(c),this._indexInvalid||this._index.remove(c))}forEachInBounds(f,c){this._loadIndex();p(this._index,f,e=>c(this._idByBounds.get(e)))}get(f){return this._boundsById.get(f)}has(f){return this._boundsById.has(f)}invalidateIndex(){this._indexInvalid|| (this._indexInvalid=!0,this._boundsToLoad.length=0)}set(f,c){if(!this._indexInvalid){const e=this._boundsById.get(f);e&&(this._index.remove(e),this._idByBounds.delete(e))}this._boundsById.set(f,c);c&&(this._idByBounds.set(c,f),this._indexInvalid||(this._boundsToLoad.push(c),5E4[this.colorRampData, this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._technique=q.releaseMaybe(this._technique);this._densityMap=q.disposeMaybe(this._densityMap);this._quad=q.disposeMaybe(this._quad);this._colorRamp=q.disposeMaybe(this._colorRamp)}get searchRadius(){return this._heatmapParameters.searchRadius}set searchRadius(u){u!==this._heatmapParameters.searchRadius&&(this._heatmapParameters.searchRadius=u,this.notifyChange("searchRadius"))}get minDensity(){return this._heatmapParameters.minDensity}set minDensity(u){u!== this._heatmapParameters.minDensity&&(this._heatmapParameters.minDensity=u,this.notifyChange("minDensity"))}get maxDensity(){return this._heatmapParameters.maxDensity}set maxDensity(u){u!==this._heatmapParameters.maxDensity&&(this._heatmapParameters.maxDensity=u,this.notifyChange("maxDensity"))}get fieldTotal(){return this._heatmapParameters.fieldTotal}set fieldTotal(u){this._heatmapParameters.fieldTotal=u;this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(u){const {colorRamp:x}= this._heatmapParameters;if(null!=x&&u!==this._colorRampData){const y=u.length/4;y!==x.descriptor.width&&x.resize(y,1);x.setData(u)}this._colorRampData=u}get _colorRamp(){return this._heatmapParameters.colorRamp}set _colorRamp(u){this._heatmapParameters.colorRamp=u}get hasHighlights(){return!1}get hasWater(){return!1}get rendersOccludedDraped(){return!1}render(u){const x=this._sortedMaterialRenderers;if(0!==x.length){var y=this.rctx.getBoundFramebufferObject(),z=this.rctx.getViewport(),{pixelRatio:A}= this,B=Math.ceil(z.width*A);A=Math.ceil(z.height*A);this._densityMap.resize(B,A);this.rctx.bindFramebuffer(this._densityMap);this.rctx.setViewport(0,0,B,A);this.rctx.clear(w.ClearBufferBit.COLOR_BUFFER_BIT);var C=!1;x.forAll(D=>{const F=D.prepareTechnique(u);null!=F&&(D.renderNode(u,F),C=!0)});this.rctx.bindFramebuffer(y);this.rctx.setViewport(z.x,z.y,z.width,z.height);C&&(this.rctx.bindVAO(this._quad),this.rctx.bindTechnique(this._technique,u.bindParameters,this._heatmapParameters),this.rctx.drawArrays(this._technique.primitiveType, 0,n.vertexCount(this._quad,"geometry")))}}};b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"searchRadius",null);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"minDensity",null);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"maxDensity",null);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"fieldTotal",null);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"pixelRatio",void 0);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype, "colorRampData",null);b.__decorate([p.property({constructOnly:!0})],a.DrapedHeatmapRenderer.prototype,"dataType",void 0);b.__decorate([p.property({constructOnly:!0})],a.DrapedHeatmapRenderer.prototype,"samplingMode",void 0);b.__decorate([p.property({constructOnly:!0})],a.DrapedHeatmapRenderer.prototype,"pixelFormat",void 0);b.__decorate([p.property({constructOnly:!0})],a.DrapedHeatmapRenderer.prototype,"internalFormat",void 0);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"_colorRampData", void 0);a.DrapedHeatmapRenderer=b.__decorate([c.subclass("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],a.DrapedHeatmapRenderer);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/HeatmapTechnique":function(){define("require exports ../../../../chunks/tslib.es6 ../core/shaderModules/interfaces ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../materials/DefaultTechniqueConfiguration ../../../../chunks/Heatmap.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){class v extends l.NoParameters{constructor(){super(...arguments);this.densityMap=this.colorRamp=null;this.searchRadius=1;this.minDensity=this.fieldTotal=0;this.maxDensity=100}}class m extends k.ShaderTechnique{constructor(n,u){super(n,u,()=>this.destroy())}initializeProgram(n){return new e.Program(n.rctx,m.shader.get().build(this.configuration),f.Default3D)}initializePipeline(){return w.makePipelineState({blending:c.blendingDefault,colorWrite:w.defaultColorWriteParams, depthTest:null,depthWrite:null})}get primitiveType(){return t.PrimitiveType.TRIANGLE_STRIP}}m.shader=new p.ReloadableShaderModule(d.HeatmapShader,()=>new Promise((n,u)=>a(["./Heatmap.glsl"],n,u)));class r extends g.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.usesHalfFloat=!1}}q.__decorate([h.parameter()],r.prototype,"usesHalfFloat",void 0);b.HeatmapPassParameters=v;b.HeatmapTechnique=m;b.HeatmapTechniqueConfiguration=r;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})}, "esri/chunks/Heatmap.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),function(a,b,q,l,p,k,h){function f(e){const g=new k.ShaderBuilder; g.include(b.ScreenSpacePass);g.include(q.DiscardOrAdjustAlphaBlend);({usesHalfFloat:e}=e);g.fragment.uniforms.add(new h.Texture2DPassUniform("densityMap",d=>d.densityMap),new h.Texture2DPassUniform("tex",d=>d.colorRamp),new l.FloatPassUniform("densityNormalizer",d=>1/(d.maxDensity-d.minDensity)),new l.FloatPassUniform("minDensity",d=>d.minDensity),new l.FloatPassUniform("densityMultiplier",d=>3/(d.searchRadius*d.searchRadius*Math.PI)));e&&g.constants.add("compressionFactor","float",4);g.fragment.code.add(p.glsl` void main() { float density = texture(densityMap, uv).r * densityMultiplier${e?p.glsl` * compressionFactor`:""}; float densityRatio = (density - minDensity) * densityNormalizer; vec4 color = texture(tex, vec2(clamp(densityRatio, 0.0, 1.0), 0.5)); discardOrAdjustAlpha(color); fragColor = color; } `);return g}const c=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}));a.HeatmapShader=c;a.build=f})},"esri/views/3d/webgl-engine/materials/HeatmapDensityMaterial":function(){define("exports ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/VertexAttribute ./internal/bufferWriterUtils ../shaders/HeatmapDensityTechnique".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){class d extends g.HeatmapDensityPassParameters{constructor(){super(...arguments);this.usesHalfFloats=this.isAttributeDriven=!1}}class t extends h.Material{constructor(u){super(u,new d);this.produces=new Map([[f.RenderSlot.DRAPED_MATERIAL,x=>x===p.ShaderOutput.Color]]);this._configuration=new g.HeatmapDensityTechniqueConfiguration}getConfiguration(){this._configuration.isAttributeDriven=this.parameters.isAttributeDriven;this._configuration.usesHalfFloat=this.parameters.usesHalfFloats; return this._configuration}createGLMaterial(u){return new w(u)}intersect(){}intersectDraped(u,x,y,z,A,B){x=u.attributes.get(c.VertexAttribute.POSITION);({parameters:y}=this);({searchRadius:y}=y);({screenToWorldRatio:u}=u);u=y*u+2*u;u*=u;y=x.data.length/x.size;for(let D=0;Dnew Promise((r,n)=>a(["./HeatmapDensity.glsl"],r,n)));class m extends e.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.usesHalfFloat=this.isAttributeDriven=!1}}q.__decorate([k.parameter()],m.prototype,"isAttributeDriven",void 0);q.__decorate([k.parameter()],m.prototype,"usesHalfFloat",void 0);b.HeatmapDensityPassParameters=w;b.HeatmapDensityTechnique=v;b.HeatmapDensityTechniqueConfiguration=m;Object.defineProperty(b, Symbol.toStringTag,{value:"Module"})})},"esri/chunks/HeatmapDensity.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),function(a,b,q,l,p,k){function h(c){const e=new p.ShaderBuilder,{vertex:g,fragment:d,attributes:t,varyings:w}= e;b.addProjViewLocalOrigin(g,c);const {isAttributeDriven:v,usesHalfFloat:m}=c;t.add(k.VertexAttribute.POSITION,"vec3");t.add(k.VertexAttribute.UV0,"vec2");v&&(t.add(k.VertexAttribute.FEATUREATTRIBUTE,"float"),w.add("attributeValue","float"));m&&e.constants.add("compressionFactor","float",.25);w.add("unitCirclePos","vec2");g.uniforms.add(new q.FloatPassUniform("radius",({resolutionForScale:r,searchRadius:n},{camera:u,screenToWorldRatio:x,overlayStretch:y})=>2*n*(0===r?1:r/x)*u.pixelRatio/u.fullViewport[2]/ y));g.code.add(l.glsl` void main() { unitCirclePos = uv0; vec4 posProj = proj * (view * vec4(${k.VertexAttribute.POSITION}, 1.0)); vec4 quadOffset = vec4(unitCirclePos * radius, 0.0, 0.0); ${v?l.glsl`attributeValue = ${k.VertexAttribute.FEATUREATTRIBUTE};`:""} gl_Position = posProj + quadOffset; } `);d.code.add(l.glsl` void main() { float radiusRatioSquared = dot(unitCirclePos, unitCirclePos); if (radiusRatioSquared > 1.0) { discard; } float oneMinusRadiusRatioSquared = 1.0 - radiusRatioSquared; float density = oneMinusRadiusRatioSquared * oneMinusRadiusRatioSquared ${v?l.glsl` * attributeValue`:""} ${m?l.glsl` * compressionFactor`:""}; fragColor = vec4(density); } `);return e}const f=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}));a.HeatmapDensity=f;a.build=h})},"esri/views/webgl/heatmapTextureUtils":function(){define(["exports","../../core/Error","./enums"],function(a,b,q){class l{constructor(p,k,h,f){this.dataType=p;this.samplingMode=k;this.pixelFormat=h;this.internalFormat=f}}a.HeatmapTextureConfiguration=l;a.loadHeatmapTextureConfiguration=function(p,k){const {textureFloatLinear:h,colorBufferFloat:f}= p.capabilities,c=f?.textureFloat,e=f?.textureHalfFloat,g=f?.floatBlend;p=p.driverTest.floatBufferBlend.result;if(!c&&!e)throw new b("heatmap:missing-color-buffer-float","HeatmapRenderer requires the WebGL extension EXT_color_buffer_float or EXT_color_buffer_half_float or WEBGL_color_buffer_float.");if(!(g&&p||e))throw new b("heatmap:missing-float-blend",`HeatmapRenderer requires the WebGL extension EXT_float_blend or EXT_color_buffer_half_float.${p?"":" This device claims support for EXT_float_blend, but does not actually support it."}`); const d=!!f?.R32F,t=!!f?.R16F;if(c&&g&&p&&h)return h||k.warnOnce("Missing WebGL extension OES_texture_float_linear. Heatmap quality may be reduced."),new l(q.PixelType.FLOAT,h?q.TextureSamplingMode.LINEAR:q.TextureSamplingMode.NEAREST,d?q.PixelFormat.RED:q.PixelFormat.RGBA,d?q.SizedPixelFormat.R32F:q.PixelFormat.RGBA);if(e)return new l(q.PixelType.HALF_FLOAT,q.TextureSamplingMode.LINEAR,t?q.PixelFormat.RED:q.PixelFormat.RGBA,t?q.SizedPixelFormat.R16F:q.PixelFormat.RGBA);throw new b("heatmap:missing-hardware-support", "HeatmapRenderer requires WebGL extensions that allow it to render and blend to float or half float textures.");};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileFetcher3DLayerViewContext":function(){define(["exports","../../../../core/maybe","./FeatureTileFetcher3D","./featureTileQuery3D"],function(a,b,q,l){class p{constructor(k){this._capabilities=this._memoryCache=null;const h=k.layerView.layer;this._layerView=k.layerView;this.objectIdField= h.objectIdField;this.globalIdField="globalIdField"in h?h.globalIdField:null;this._returnZ=k.returnZ;this._returnM=k.returnM;k=this._layerView.view.resourceController;this.query=l.createFeatureTileQuery3D(this._layerView,k.normal);k&&this._memoryCacheEnabled&&(this._memoryCache=k.memoryController.newCache(`fl-${h.uid}`))}get _memoryCacheEnabled(){switch(this._layerView.layer.source.type){case "feature-layer":case "ogc-feature":case "oriented-imagery":return!0;case "csv":case "geojson":case "memory":case "wfs":return!1}}destroy(){this._memoryCache= b.destroyMaybe(this._memoryCache);this.query.destroy()}createQuery(){const k=this._layerView.layer.createQuery();k.outFields=this._layerView.availableFields;k.returnZ=this._returnZ;k.returnM=this._returnM;k.outSpatialReference=this.tilingScheme.spatialReference;return k}get memoryCache(){return this._memoryCache}get viewingMode(){return this._layerView.view.state.viewingMode}get tilingScheme(){return this._layerView.view.featureTiles.tilingScheme}get scheduler(){const k=this._layerView.view.resourceController; return k?k.scheduler:null}get geometryType(){return this._layerView.layer.geometryType}get fullExtent(){return this._layerView.layer.fullExtent}get tileMaxRecordCount(){return this._layerView.layer.capabilities.query.tileMaxRecordCount}get maxRecordCount(){return this._layerView.layer.capabilities.query.maxRecordCount}get capabilities(){return null!=this._capabilities?this._capabilities:this._capabilities=q.contextCapabilitiesFromLayer(this._layerView.layer)}logFetchError(k,h){k.error("#fetchTile()", this._layerView.layer,h?.message??h)}}a.FeatureTileFetcher3DLayerViewContext=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/featureTileQuery3D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/SetUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/graphics/dehydratedFeatures ../../../../rest/query/operations/query ../../support/PBFDecoder".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){let v=class extends q{constructor(u){super(u)}get implicitFields(){if(!this.layer.outFields?.includes("*"))return new Set;const u=new Set(this.layerView.requiredFields),x=new Set(this.layerView.availableFields);return k.difference(x,u)}get queryFeaturesDehydrated(){const {layer:u}=this;var x=u.capabilities;x=x&&x.query;const y=u.parsedUrl;if(x&&x.supportsFormatPBF){null==this._decoder&&(this._decoder=new w.PBFDecoder(this.controller));const z={sourceSpatialReference:u.spatialReference?.toJSON()?? null,applyTransform:!0,maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:1024};return(A,B)=>t.runQuery(y,A,"pbf",this._createRequestOptions(B)).then(C=>{p.throwIfAborted(B);return null!=this._decoder?this._decoder.invoke({buffer:C.data,options:z},B.signal):Promise.reject(p.createAbortError())})}return(z,A)=>t.executeQuery(y,z,u.spatialReference,this._createRequestOptions(A)).then(B=>d.fromFeatureSetJSON(B.data,{maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:1024}))}queryFeatureCount(u, x){return this.layer.queryFeatureCount(u,x)}destroy(){this._decoder=l.destroyMaybe(this._decoder)}_createRequestOptions(u){return{...u,query:{...this.layer.customParameters,token:this.layer.apiKey,...u?.query}}}};b.__decorate([h.property({constructOnly:!0})],v.prototype,"layer",void 0);b.__decorate([h.property({constructOnly:!0})],v.prototype,"layerView",void 0);b.__decorate([h.property({constructOnly:!0})],v.prototype,"controller",void 0);b.__decorate([h.property({readOnly:!0})],v.prototype,"implicitFields", null);b.__decorate([h.property({readOnly:!0})],v.prototype,"queryFeaturesDehydrated",null);v=b.__decorate([g.subclass("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D")],v);let m=class extends q{constructor(u){super(u)}queryFeaturesDehydrated(u,x){return this.layer.queryFeatures(u,x)}queryFeatureCount(u,x){return this.layer.queryFeatureCount(u,x)}};b.__decorate([h.property({constructOnly:!0})],m.prototype,"layer",void 0);b.__decorate([h.property({readOnly:!0})],m.prototype, "queryFeaturesDehydrated",null);m=b.__decorate([g.subclass("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceMeshQuery3D")],m);let r=class extends q{constructor(u){super(u)}queryFeaturesDehydrated(u,x){return this.layer.queryFeatures(u,x)}};b.__decorate([h.property({constructOnly:!0})],r.prototype,"layer",void 0);r=b.__decorate([g.subclass("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileOGCServiceQuery3D")],r);let n=class extends q{constructor(u){super(u)}queryFeaturesDehydrated(u, x){return this.source.queryFeaturesJSON(u,x).then(d.fromFeatureSetJSON,y=>{if(y&&"query-features-json:unsupported"===y.name)return this.layer.queryFeatures(u,x);throw y;})}queryFeatureCount(u,x){return this.layer.queryFeatureCount(u,x)}};b.__decorate([h.property({constructOnly:!0})],n.prototype,"layer",void 0);b.__decorate([h.property({constructOnly:!0})],n.prototype,"source",void 0);n=b.__decorate([g.subclass("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D")],n);a.createFeatureTileQuery3D= function(u,x){const {layer:y}=u;return"feature"===y.type&&"feature-layer"===y.source.type||"catalog-footprint"===y.type?"infoFor3D"in y&&null!=y.infoFor3D?new m({layer:y}):new v({layer:y,layerView:u,controller:x}):"feature"===y.type&&"memory"===y.source.type||"csv"===y.type||"geojson"===y.type||"oriented-imagery"===y.type||"wfs"===y.type?new n({layer:y,source:y.source}):"ogc-feature"===y.type?new r({layer:y}):null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/PBFDecoder":function(){define("exports ../../../Graphic ../../../core/typedArrayUtil ../../../core/workers/WorkerHandle ../../../geometry/SpatialReference ../../../layers/support/Field".split(" "), function(a,b,q,l,p,k){function h(e){switch(e.type){case "polyline":e.paths.reduce((g,d)=>g+d.length,0)g.map(d=>[d[0],d[1],d[2]])):e.paths.map(g=>g.map(d=>[d[0],d[1]])));break;case "polygon":e.rings.reduce((g,d)=>g+d.length,0)g.map(d=>[d[0],d[1],d[2]])):e.rings.map(g=>g.map(d=>[d[0],d[1]])))}}class f{constructor(e){this._controller=e;this._handle=new c(g=>e.schedule(g))}destroy(){this._handle.destroy()}invoke(e, g){if(!e.buffer||0===e.buffer.byteLength)return Promise.resolve(null);e.options.sourceSpatialReference&&e.options.sourceSpatialReference instanceof p&&(e.options={...e.options,sourceSpatialReference:e.options.sourceSpatialReference.toJSON()});return this._handle.invoke(e,g).then(d=>{let t=0,w=0;const v=p.fromJSON(d.spatialReference);d.spatialReference=v;const m=async r=>{var n=d.fields;if(n)for(;tm(x)); for(n=d.features;wm(x))}return d};return this._controller.schedule(r=>m(r))})}}class c extends l.WorkerHandle{constructor(e){super("PBFDecoderWorker","_parseFeatureQuery",{_parseFeatureQuery:g=>[g.buffer]},e)}}a.PBFDecoder=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/EventedSet":function(){define(["exports", "../../../core/Evented","../../../core/ObservableChangesType","../../../core/SetUtils","../../../core/signal"],function(a,b,q,l,p){class k extends b{constructor(){super(...arguments);this._set=new Set;this._length=p.signal(0)}clear(){if(0h(c)?(f=c,!0):!1);return f}forEach(h){this._set.forEach(f=>h(f))}}a.EventedSet=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/FeatureLayerView":function(){define("../../chunks/tslib.es6 ../../core/Error ../../core/has ../../core/Logger ../../core/promiseUtils ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../layers/support/FeatureEffect ../../layers/support/FeatureFilter ../../layers/support/fieldUtils ../../layers/support/floorFilterUtils ../../rest/support/Query ../../support/arcadeOnDemand ./support/popupUtils".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){return r=>{r=class extends r{constructor(...n){super(...n);this._updatingRequiredFieldsPromise=null;this.dataUpdating=!1;this.layer=this.filter=null;this.requiredFields=[];this.view=null}initialize(){this.addHandles([k.watch(()=>{const n=this.layer;return[n&&"elevationInfo"in n?n.elevationInfo?.featureExpressionInfo:null,n&&"displayField"in n?n.displayField:null,n&&"timeInfo"in n&&n.timeInfo,n&&"renderer"in n&&n.renderer,n&&"labelingInfo"in n&&n.labelingInfo, n&&"floorInfo"in n&&n.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),k.syncAndInitial),k.on(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),k.on(()=>{const n=this.layer;return n&&"sublayers"in n?n.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const {layer:n,layer:{fieldsIndex:u},requiredFields:x}=this;return"outFields"in n&&n.outFields?d.fixFields(u,[...d.unpackFieldNames(u, n.outFields),...x]):d.fixFields(u,x)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(n){this._override("featureEffect",n)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(n){l.getLogger(this).error("#maximumNumberOfFeatures\x3d","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(n){throw Error("missing implementation");}createQuery(){var n={outFields:["*"], returnGeometry:!0,outSpatialReference:this.view.spatialReference};n=null!=this.filter?this.filter.createQuery(n):new w(n);if("floorInfo"in this.layer&&this.layer.floorInfo){const u=t.getFloorFilterClause(this);null!=u&&(n.where=n.where?`(${n.where}) AND (${u})`:u)}null!=this.timeExtent&&(n.timeExtent=null!=n.timeExtent?n.timeExtent.intersection(this.timeExtent):this.timeExtent.clone());return n}createAggregateQuery(){return new w({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryFeatures(n, u){throw Error("missing implementation");}queryObjectIds(n,u){throw Error("missing implementation");}queryFeatureCount(n,u){throw Error("missing implementation");}queryExtent(n,u){throw Error("missing implementation");}async fetchPopupFeaturesFromGraphics(n,u){this._validateFetchPopupFeatures(n,u);return this._fetchPopupFeatures(n,u)}_loadArcadeModules(n){return n.expressionInfos?.length||Array.isArray(n.content)&&n.content.some(u=>"expression"===u.type)?v.loadArcade():Promise.resolve()}_handleRequiredFieldsChange(){const n= this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",n);n.then(()=>{this._updatingRequiredFieldsPromise===n&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(this.layer&&this.view){var n="3d"===this.view.type,{layer:u,layer:{fieldsIndex:x,objectIdField:y}}=this,z="renderer"in u&&u.renderer,A="orderBy"in u&&u.orderBy,B="featureReduction"in u?u.featureReduction:null,C=new Set;z=await Promise.allSettled([z?z.collectRequiredFields(C,x):null,d.collectLabelingFields(C, u),n&&"elevationInfo"in u?d.collectElevationFields(C,u):null,null!=this.filter?d.collectFilterFields(C,u,this.filter):null,n||null==this.featureEffect?null:d.collectFilterFields(C,u,this.featureEffect.filter),!n&&B?d.collectFeatureReductionFields(C,u,B):null,!n&&A?d.collectOrderByInfos(C,u,A):null]);"timeInfo"in u&&u.timeInfo&&this.timeExtent&&d.collectFields(C,u.fieldsIndex,[u.timeInfo.startField,u.timeInfo.endField]);"floorInfo"in u&&u.floorInfo&&d.collectFields(C,u.fieldsIndex,[u.floorInfo.floorField]); "feature"===u.type&&n&&null!=u.infoFor3D&&(null==u.globalIdField&&l.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),d.collectFields(C,u.fieldsIndex,[u.globalIdField]));"subtype-group"===u.type&&(d.collectField(C,x,u.subtypeField),A=u.sublayers.map(D=>Promise.all([D.renderer?.collectRequiredFields(C,x),d.collectLabelingFields(C,D)])),await Promise.allSettled(A));"catalog-footprint"===u.type&&u.parent&&(A=u.parent,d.collectFields(C,x,[A.itemNameField,A.itemSourceField,A.itemTypeField, A.maxScaleField,A.minScaleField]));for(const D of z)"rejected"===D.status&&l.getLogger(this).error(D.reason);d.collectField(C,x,y);n&&"displayField"in u&&u.displayField&&d.collectField(C,x,u.displayField);n=Array.from(C).sort();this._set("requiredFields",n)}}_validateFetchPopupFeatures(n,u){if(null!=u)for(const x of n){n=x.origin&&"layer"in x.origin?x.origin.layer:x.layer;if("popupEnabled"in n&&!n.popupEnabled)throw new b("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:n});if(x.isAggregate){const y= "featureReduction"in n?n.featureReduction:null;if(!(y&&"popupTemplate"in y&&y.popupEnabled&&y.popupTemplate))throw new b("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:n});}else if("popupTemplate"in n&&!m.getFetchPopupTemplate(n,u))throw new b("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:n});}}_popupFeatureHasRequiredFields(n,u){return d.featureHasFields(u,n)}async _fetchPopupFeatures(n,u){const x=Array(n.length),y=new Map,z=await this._createPopupQuery(n.map(B=> B.origin?.layer??B.layer),u);for(let B=0;B{c=class extends c{initialize(){this.addHandles(l.on(()=>this.layer,"refresh",e=>{this.doRefresh(e.dataChanged).catch(g=>{q.isAbortError(g)||b.getLogger(this).error(g)})}),"RefreshableLayerView")}};return c=a.__decorate([f.subclass("esri.views.layers.RefreshableLayerView")],c)}})},"esri/views/3d/layers/PointCloudLayerView3D":function(){define("../../../chunks/tslib.es6 ../../../core/arrayUtils ../../../core/asyncUtils ../../../core/Collection ../../../core/handleUtils ../../../core/has ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/screenUtils ../../../core/typedArrayUtil ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f32 ../../../geometry/support/aaBoundingBox ../../../geometry/support/plane ../../../layers/support/CodedValue ../../../layers/support/CodedValueDomain ../../../layers/support/Domain ../../../layers/support/InheritedDomain ../../../layers/support/RangeDomain ../../../layers/support/fieldUtils ../../../layers/support/PromiseQueue ../../../support/elevationInfoUtils ./LayerView3D ./PointCloudLayerViewPerformanceInfo ./PointCloudWorkerHandle ./i3s/I3SUtil ./i3s/LoDUtil ./i3s/PagedNodeIndex ./i3s/PointCloudRendererUtil ./i3s/PointCloudWorkerUtil ./i3s/PointGraphic ./i3s/PointRenderer ./support/PopupSceneLayerView ../support/extentUtils ../support/hitTest ../support/index ../support/orientedBoundingBox ../support/updatingProperties ../../layers/LayerView ../../support/layerViewUtils ../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y){function ha(U){return Z=>U.immediate.schedule(Z)}const ba=n.create();k=class extends K.PopupSceneLayerView(F.LayerView3D(V)){constructor(){super(...arguments);this.type="point-cloud-3d";this.maximumPointCount=4E6;this.slicePlaneEnabled=!1;this._renderer=null;this._rendererAdded=!1;this._renderedNodes=new Set;this._updateViewNeeded=!0;this._lodFactor=1;this._maxLoggedBoxWarnings=5;this._pageMultiplier= 1;this._nodeLoadEpoch=0;this._indexQueue=[];this._workQueue=[];this._idleQueue=new C.PromiseQueue;this._indexPagesLoading=new Map;this._loadingNodes=new Map;this._recalcWork=!0;this._layerIsVisible=!1;this._codedDomainPopulationAbortController=this._codedDomainPopulationPromise=null;this._totalWork=0;this._index=null;this._loadingInitNodePage=!1;this._nodeIdArray=[];this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl?.path??""}get pointScale(){const U=O.getSplatSizeAlgorithm(this.layer?.renderer); return null!=U?.scaleFactor?U.scaleFactor:1}get useRealWorldSymbolSizes(){const U=O.getFixedSizeAlgorithm(this.layer?.renderer);return null!=U?.useRealWorldSymbolSizes?U.useRealWorldSymbolSizes:!1}get pointSize(){const U=O.getFixedSizeAlgorithm(this.layer?.renderer);return null!=U?.size?U.size:0}get inverseDensity(){return this.layer?.renderer?96/this.layer.renderer.pointsPerInch:5}get availableFields(){var U=O.getRendererInfo(this.layer);const Z=new Set;U.primaryAttribute&&Z.add(U.primaryAttribute.name); U.modulationAttribute&&Z.add(U.modulationAttribute.name);if(U=O.getFilterInfo(this.layer))for(const ca of U)ca.attributeInfo&&Z.add(ca.attributeInfo.name);if(this.layer.outFields)for(const ca of B.unpackFieldNames(this.layer.fieldsIndex,this.layer.outFields))Z.add(ca);return Array.from(Z)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const U=r.create();return J.projectToBoundingBox(this.view.clippingArea,U,this.view.renderSpatialReference)?U:null}get _elevationOffset(){const U= this.layer&&this.layer.elevationInfo;return U&&"absolute-height"===U.mode?D.getElevationOffset(U,this.layer.spatialReference):0}initialize(){const U=this.view.resourceController;var Z=ha(U);this._worker=new N.PointCloudWorkerHandle(Z);this.addResolvingPromise(this._worker.promise);E.checkPointCloudLayerValid(this.layer);E.checkPointCloudLayerCompatibleWithView(this.layer,this.view);this._indexRequester=U.createStreamDataRequester(Q.ClientType.I3S_INDEX);this._dataRequester=U.createStreamDataRequester(Q.ClientType.I3S_DATA); this._initRenderer();Z=this._initNodePages();this._memCache=this.view.resourceController.memoryController.newCache(`pcl-${this.layer.uid}`);this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),e.initial);this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),e.initial);this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),e.initial);this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),e.initial);this._updatingHandles.add(()=> this.layer.outFields,()=>this._reload(),e.initial);this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded());this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded());this.addHandles([e.watch(()=>this.view.quality,()=>this._setUpdateViewNeeded(),e.sync)]);this.addResolvingPromise(Z);this.when(()=>{this.addHandles([U.scheduler.registerTask(Y.TaskPriority.POINT_CLOUD_LAYER,this),U.scheduler.registerIdleStateCallbacks(()=>this._idleBegin(), ()=>this._idleEnd()),this._updatingHandles.add(()=>this.suspended,ca=>{ca?this._clearNodeState():this._setUpdateViewNeeded()},e.initial)])},()=>{this._updatingHandles.removeAll();this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0;this._updateLoading()}destroy(){this.cancelLoading();this._worker=f.destroyMaybe(this._worker);this._destroyRenderer();this._memCache=f.destroyMaybe(this._memCache);this._codedDomainPopulationAbortController=f.abortMaybe(this._codedDomainPopulationAbortController); this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new M.PointRenderer({createGraphic:(U,Z,ca)=>this._createGraphic(U,Z,ca)});this._renderer.layerUid=this.layer.uid;this._updatingHandles.add(()=>this._clippingBox,U=>this._renderer.clippingBox=U,e.initial);this._updatingHandles.add(()=>this.suspended,U=>this._setPointsVisible(!U),e.initial);this._updatingHandles.add(()=>this.pointScale,U=>this._renderer.scaleFactor=U,e.initial);this._renderer.minSizePx=Math.sqrt(2);this._updatingHandles.add(()=> this.useRealWorldSymbolSizes,U=>this._renderer.useRealWorldSymbolSizes=U,e.initial);this._updatingHandles.add(()=>this.pointSize,U=>{const Z=g.pt2px(U);this._renderer.size=U;this._renderer.sizePx=Z},e.initial);this._updatingHandles.add(()=>this.slicePlaneEnabled,U=>this._renderer.slicePlaneEnabled=U,e.initial);this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),e.initial);this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),e.initial); this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,U=>{this._lodFactor=U;this._setUpdateViewNeeded()},e.initial)}_destroyRenderer(){this._renderer.removeAll();this._setPointsVisible(!1)}_createGraphic(U,Z,ca){const ea=null!=U.pointIdFilterMap?U.pointIdFilterMap[Z]:Z;ca=R.computeMapPointFromVec3d(this.view,ca);const da=this._createGraphicAttributes(U,ea);return new P.PointGraphic({pointCloudMetadata:{nodeId:U.id,pointIndexInNode:Z,attributePointIndexInNode:ea, epoch:this._nodeLoadEpoch},geometry:ca,attributes:da,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(U,Z){const ca={};for(const ea of U.attributes)this._encodeGraphicAttribute(ea.attributeInfo,ea.values,Z,ca);return ca}_encodeGraphicAttribute(U,Z,ca,ea){var da=U.storageInfo?.attributeValues;const ia=da?.valuesPerElement??1;if(1===ia)ea[U.name]=Z[ca];else if("UInt8"===da?.valueType&&4>=ia){da=0;ca*=ia;for(let ka=ca;ka U.push(Z));this._loadingNodes.clear();for(const Z of U)Z.abort();this._workQueue=[];this._idleQueue.cancelAll();this._totalWork=this._computeWork();this._updateLoading()}_updateQueues(){const U=new Set;this._workQueue.forEach(ea=>ea.load.forEach(da=>U.add(da)));const Z=[],ca=new Map;this._loadingNodes.forEach((ea,da)=>{U.has(da)?ca.set(da,ea):Z.push(ea)});this._loadingNodes=ca;for(const {abortController:ea}of Z)ea.abort();this._workQueue=this._workQueue.filter(ea=>{for(const da of ea.load)if(this._loadingNodes.has(da))return this._recalcWork= !0,!1;return!0});this._totalWork=this._computeWork();this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[];this._indexPagesLoading.forEach(({abortController:U})=>U.abort());this._indexPagesLoading.clear();this._totalWork=this._computeWork();this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++;this._renderedNodes.forEach(U=>this._removeFromRenderer(U));this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended? this._updateViewNeeded:this._updateViewNeeded||0this._updateWorkQueues());0this._processIndexQueue()););this._processWorkQueue(U);this._idleQueue.runTask(U)}}_processIndexQueue(){const U= this._indexQueue.shift(),Z=this._loadNodePage(U);this._indexPagesLoading.set(U,Z);Z.promise.then(ca=>{this._index.addPage(U,ca,this._elevationOffset);this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(U)},()=>{this._indexPagesLoading.delete(U)});return!0}_processWorkQueue(U){for(;!U.done;){const Z=this._scheduleWorkEntry();if(null==Z){U.madeProgress();break}this._processWorkEntry(Z);U.madeProgress()}}_scheduleWorkEntry(){let U=this._workQueue.length;for(;U--;){const Z=this._workQueue.shift(); if(Z.remove.find(ca=>!this._renderedNodes.has(ca)))this._workQueue.push(Z);else return Z}return null}_processWorkEntry(U){if(0===U.load.length)for(const Z of U.remove)this._removeFromRenderer(Z);else Promise.all(U.load.map(Z=>{const ca=new AbortController,ea=this._memCache.pop(Z.toString());null!=ea?this._loadingNodes.set(Z,{abortController:ca,promise:Promise.resolve(ea)}):this._loadingNodes.has(Z)||this._loadingNodes.set(Z,{abortController:ca,promise:this._loadNode(Z,ca.signal)});return this._loadingNodes.get(Z).promise})).then(Z=> {for(let ca=0;ca{}).then(()=>{for(const Z of U.load)this._loadingNodes.delete(Z);this._updateLoading();this._recalcWork&&!this._idleQueue.running&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading()}async _populateClassCodeCodedDomain(U,Z){const ca=this.layer.fieldsIndex.get("CLASS_CODE"); ca&&!ca.domain&&U.includes(ca.name)&&(U=await q.result(this.layer.queryCachedStatistics("CLASS_CODE",{signal:Z})),!1!==U.ok&&(U=U.value?.stats?.labels?.labels)&&Array.isArray(U)&&(ca.domain=new x({name:"CLASS_CODE",codedValues:U.map(ea=>new u.CodedValue({code:ea.value,name:ea.label}))})))}async prepareFetchPopupFeatures(U){this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(U,this._codedDomainPopulationAbortController.signal).then(()=> {this._codedDomainPopulationAbortController=null}));return this._codedDomainPopulationPromise}async whenGraphicAttributes(U,Z){const ca=this._splitGraphicsPerNode(U),ea=this.layer.attributeStorageInfo,da=Z.map(fa=>O.getAttributeInfo(ea,fa)).filter(b.isSome),ia=async(fa,X)=>{const ja=this._index.getNode(X);await q.forEach(da,async la=>{const na=la.useElevation?await this._loadElevationAttributeFromGeometry(ja.resourceId):await this._loadAndParseAttribute(ja,la);if(na)for(const va of fa)this._isValidPointGraphic(va)&& this._encodeGraphicAttribute(la,na,va.pointCloudMetadata.attributePointIndexInNode,va.attributes)})},ka=[];ca.forEach((fa,X)=>{ka.push(ia(fa,X))});await Promise.allSettled(ka);return U}_isValidPointGraphic(U){return U instanceof P.PointGraphic&&U.pointCloudMetadata?.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(U){const Z=new Map;for(const ca of U){if(!this._isValidPointGraphic(ca))continue;U=ca.pointCloudMetadata;const ea=Z.get(U.nodeId);ea?ea.push(ca):Z.set(U.nodeId,[ca])}return Z}async _loadAndParseAttribute(U, Z){const ca=await this._loadAttribute(U.resourceId,Z,null);return null!=ca?L.getAttributeValues({attributeInfo:Z,buffer:ca},null,U.vertexCount):null}async _loadElevationAttributeFromGeometry(U){U=L.readGeometry(this.layer.store.defaultGeometrySchema,await this._loadGeometry(U,null));return L.elevationFromPositions(U,U.length/3)}highlight(U){if(!U)return p.makeHandle();U=l.isCollection(U)?U.toArray():Array.isArray(U)?U:[U];return this._renderer.highlight(U.map(Z=>this._graphicToPointDefinition(Z)))}_graphicToPointDefinition(U){if(!this._isValidPointGraphic(U))return null; const {nodeId:Z,pointIndexInNode:ca}=U.pointCloudMetadata;return null!=Z&&null!=ca?{nodeId:Z,pointId:ca}:null}_computeWork(){let U=0;for(const Z of this._workQueue)U+=Z.load.length+Z.remove.length;U+=this._loadingNodes.size;U+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize;U+=this._loadingInitNodePage?100:0;return U+=this._updateViewNeeded?100:0}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const U=this._computeWork();return 1-Math.min(this._totalWork, U)/this._totalWork}_updateLoading(){this.notifyChange("updating");this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:0{this._index.addPage(0,Z,this._elevationOffset);this._loadingInitNodePage=!1;this._setUpdateViewNeeded()})}_loadNodePage(U){const Z=new AbortController;return{promise:this._requestNodePage(`${this.baseUrl}/nodepages/${U* this._pageMultiplier}`,Z.signal).then(ca=>ca.nodes.map((ea,da)=>({resourceId:null!=ea.resourceId?ea.resourceId:U*this._index.pageSize+da,obb:W.Obb.fromJSON(ea.obb),obbInRenderSR:new W.Obb,firstChild:ea.firstChild,childCount:ea.childCount,vertexCount:ea.vertexCount??ea.pointCount,lodThreshold:ea.lodThreshold??ea.effectiveArea}))),abortController:Z}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;var U=this.view.quality;let Z=this.inverseDensity/this._lodFactor*U;U*=this.maximumPointCount*this._lodFactor; let ca=this._computeNodesForMinimumDensity(Z),ea=this._computePointCount(ca),da=Math.sqrt(ea/(.75*U));for(;ea>U;)Z*=da,ca=this._computeNodesForMinimumDensity(Z),ea=this._computePointCount(ca),da=Math.sqrt(2);this._displayNodes(ca);this._updateViewNeeded=!1;this._updateLoading();return!0}_computePointCount(U){let Z=0;for(let ca=0;ca{U=ea;return!1},pageMiss:()=>{}});return U}_computeNodesForMinimumDensity(U){const Z=this.view.state.contentCamera,ca=Z.frustum,ea=this._clippingBox,da=Z.viewForward,ia=v.dot(da,Z.eye),ka=n.fromNormalAndOffset(da,-ia,ba),fa=Z.perScreenPixelRatio/2,X=U*U,ja=this._nodeIdArray;ja.length=0;this._traverseVisible({frustum:ca,clippingBox:ea},{predicate:(la,na,va)=>{if(!va)return!1;if(0===na.childCount)return ja.push(la),!1;va=this._index.getRenderObb(la); return this._computeAveragePixelArea(va,na.lodThreshold,na.vertexCount,ka,fa)<=X?(ja.push(la),!1):!0},pageMiss:(la,na)=>{ja.push(la);this._indexQueue.includes(na)||this._indexQueue.push(na)}});return ja}_computeAveragePixelArea(U,Z,ca,ea,da){U=Math.max(1E-7,U.minimumDistancePlane(ea));return Z/(U*U)/(4*da*da)/ca}_loadNode(U,Z){try{return this._loadNodeAsync(U,Z)}catch(ca){throw c.isAbortError(ca)||h.getLogger(this).error(ca),ca;}}async _loadAdditionalUserAttributes(U,Z,ca){var ea=this.layer.outFields; if(!ea)return[];ea=B.unpackFieldNames(this.layer.fieldsIndex,ea);U=new Set(U.map(ka=>null!=ka?ka.name:null));const da=this.layer.attributeStorageInfo,ia=[];for(const ka of ea)U.has(ka)||(ea=O.getAttributeInfo(da,ka))&&ia.push(Z(ea));Z=await c.allSettledValues(ia);c.throwIfAborted(ca);return Z.filter(b.isSome)}async _loadNodeAsync(U,Z){const ca=this._index.getNode(U),ea=O.getRendererInfo(this.layer),da=O.getFilterInfo(this.layer),ia=ca.resourceId,ka=async fa=>{if(!fa)return null;if(fa.useElevation)return{attributeInfo:fa, buffer:null};const X=await this._loadAttribute(ia,fa,Z);return null!=X?{attributeInfo:fa,buffer:X}:null};return this._idleQueue.push(async()=>{var fa=this._loadGeometry(ia,Z);const {primaryAttribute:X,modulationAttribute:ja}=ea,la=ka(X),na=ka(ja);var va=da.map(Ga=>Ga.attributeInfo);const za=va.map(Ga=>ka(Ga));va=this._loadAdditionalUserAttributes([X,ja,...va],ka,Z);const [ya,Da,ra,xa,Ma]=await Promise.all([fa,la,na,Promise.all(za),va]);c.throwIfAborted(Z);fa={geometryBuffer:ya,primaryAttributeData:Da, modulationAttributeData:ra,filterAttributesData:xa,userAttributesData:Ma,schema:this.layer.store.defaultGeometrySchema,rendererInfo:ea,filterInfo:da,obbData:this._index.getRenderObb(U).data,elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(fa,Z)},Z)}async _loadGeometry(U,Z){return this._requestData(`${this.baseUrl}/nodes/${U}/geometries/0`,Z)}async _loadAttribute(U,Z,ca){return Z?.storageInfo? this._requestData(`${this.baseUrl}/nodes/${U}/attributes/${Z.storageInfo.key}`,ca):null}_requestNodePage(U,Z){return this._indexRequester.request(U,"json",{query:{f:"json",...this.layer.customParameters,token:this.layer.apiKey},signal:Z})}_requestData(U,Z){return this._dataRequester.request(U,"binary",{query:{...this.layer.customParameters,token:this.layer.apiKey},signal:Z})}_removeFromRenderer(U){if(this._renderedNodes.has(U)){const Z=this._renderer.removeNode(U);this._renderedNodes.delete(U);this._memCache.put(Z.id.toString(), Z,5*Z.coordinates.length+128)}}_addToRenderer(U){this._renderedNodes.has(U.id)||(this._renderedNodes.add(U.id),this._renderer.addNode(U))}_setupRendererData(U,Z){const ca=this._index.getNode(U),ea=Math.sqrt(ca.lodThreshold/ca.vertexCount),da=this._index.getRenderObb(U);if(M.isPointRendererNode(Z))return Z.splatSize=ea,Z.obb=da,v.copy(Z.origin,Z.obb.center),Z;const ia=W.Obb.fromData(Z.obbData),ka=ia.halfSize,fa=da.halfSize,X=.01*Math.max(fa[0],fa[1],fa[2]);if(ka[0]>fa[0]+X||ka[1]>fa[1]+X||ka[2]>fa[2]+ X)0{U+=160;U+=d.estimateSize(Z.coordinates);for(const ca of Z.attributes)Z=ca.values,d.isArrayBuffer(Z.buffer)&&(U+=d.estimateSize(Z))});return U}get unloadedMemory(){const U=this._renderedNodes.size;if(4>U)return 0;const Z=[...this._renderedNodes].reduce((ea,da)=>ea+this._index.getNode(da).vertexCount);let ca=this._loadingNodes.size;for(let ea=0;eaca?0:ca*Z/U*((this.usedMemory-160*U)/Z)+160*ca}get performanceInfo(){return new H.PointCloudLayerViewPerformanceInfo(this.usedMemory,this._renderedNodes.size,[...this._renderedNodes].reduce((U,Z)=>U+this._index.getNode(Z).vertexCount,0),this.maximumPointCount,new H.QueuePerformanceInfo(this._loadingNodes.size,this._indexQueue.length,this._workQueue.length,this._idleQueue.length))}get test(){}};a.__decorate([t.property()],k.prototype,"layer",void 0);a.__decorate([t.property()],k.prototype, "baseUrl",null);a.__decorate([t.property()],k.prototype,"pointScale",null);a.__decorate([t.property()],k.prototype,"useRealWorldSymbolSizes",null);a.__decorate([t.property()],k.prototype,"pointSize",null);a.__decorate([t.property()],k.prototype,"inverseDensity",null);a.__decorate([t.property()],k.prototype,"maximumPointCount",void 0);a.__decorate([t.property({readOnly:!0})],k.prototype,"availableFields",null);a.__decorate([t.property({readOnly:!0})],k.prototype,"_clippingBox",null);a.__decorate([t.property({readOnly:!0})], k.prototype,"_elevationOffset",null);a.__decorate([t.property({type:Boolean})],k.prototype,"slicePlaneEnabled",void 0);a.__decorate([t.property()],k.prototype,"updating",void 0);a.__decorate([t.property(S.updatingProgress)],k.prototype,"updatingProgress",void 0);a.__decorate([t.property({readOnly:!0})],k.prototype,"updatingProgressValue",null);a.__decorate([t.property({readOnly:!0})],k.prototype,"visibleAtCurrentScale",null);return k=a.__decorate([w.subclass("esri.views.3d.layers.PointCloudLayerView3D")], k)})},"esri/views/3d/layers/PointCloudLayerViewPerformanceInfo":function(){define(["exports","./support/LayerViewPerformanceInfo"],function(a,b){class q extends b.LayerViewPerformanceInfo{constructor(p,k,h,f,c){super(p,k,-1,h,f);this.queue=c}}class l{constructor(p,k,h,f){this.loading=p;this.indexLoading=k;this.processing=h;this.idleProcessing=f}}a.PointCloudLayerViewPerformanceInfo=q;a.QueuePerformanceInfo=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/PointCloudWorkerHandle":function(){define(["exports", "../../../core/workers/WorkerHandle"],function(a,b){class q extends b.WorkerHandle{constructor(l){super("PointCloudWorker","transform",{transform:p=>{const k=[p.geometryBuffer];null!=p.primaryAttributeData&&p.primaryAttributeData.buffer&&k.push(p.primaryAttributeData.buffer);null!=p.modulationAttributeData&&p.modulationAttributeData.buffer&&k.push(p.modulationAttributeData.buffer);if(null!=p.filterAttributesData)for(const h of p.filterAttributesData)null!=h&&h.buffer&&k.push(h.buffer);for(const h of p.userAttributesData)h.buffer&& k.push(h.buffer);return k}},l)}}a.PointCloudWorkerHandle=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/LoDUtil":function(){define(["exports","../../../../chunks/vec32"],function(a,b){function q(c,e,g){for(;0w&&(w=d.length,d.push(r),t.push([]));t[w].push(e.load[m])}}e.load=d;for(e=0;e{if(0===d.load.length&&0===t.load.length)return 0; if(0===d.load.length)return-1;if(0===t.load.length)return 1;if(0===d.remove.length&&0===t.remove.length)return d=g.getRenderObb(d.load[0]).center,t=g.getRenderObb(t.load[0]).center,b.dot(d,e)-b.dot(t,e);if(0===d.remove.length)return-1;if(0===t.remove.length)return 1;if(1===d.load.length&&1===t.load.length)return d=g.getRenderObb(d.load[0]).center,t=g.getRenderObb(t.load[0]).center,b.dot(d,e)-b.dot(t,e);if(1===d.load.length)return-1;if(1===t.load.length)return 1;d=g.getRenderObb(d.remove[0]).center; t=g.getRenderObb(t.remove[0]).center;return b.dot(d,e)-b.dot(t,e)})};a.splitWorkEntries=function(c,e,g){for(let d=0;de&&1===t.remove.length&&l(c,t,g)}};a.splitWorkEntry=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/PagedNodeIndex":function(){define(["exports","../../../../geometry/spatialReferenceEllipsoidUtils","../../../../geometry/support/aaBoundingBox"],function(a,b,q){class l{constructor(p,k,h){this._pages= [];this.pageSize=0;this._nodeSR=p;this._renderSR=k;this._renderSRSphericalPCPF=b.getSphericalPCPF(k);this.pageSize=h}addPage(p,k,h=0){for(;this._pages.length{if(p.hasNodes(0,1))for(k.length=0,k.push(0),h.length=0,h.push(0);0n&&(r|=m)}}if(e.predicate(g,d,w)){t=d.firstChild;d=d.childCount;w=!1;m=t/p.pageSize|0;for(v=(t+d-1)/p.pageSize|0;m<=v;m++)if(!p.hasPage(m)){e.pageMiss(g,m);w=!0;break}if(!w)for(g=0;g({filterJSON:k.toJSON(),attributeInfo:q(l.attributeStorageInfo,k.field)})):[]};a.getFixedSizeAlgorithm=function(l){return(l=l?.pointSizeAlgorithm)&&"fixed-size"===l.type?l:null};a.getRendererInfo=function(l){const p=l.renderer;var k=p?.type;const h=p?.toJSON()??null;let f=null,c=!1;l=l.attributeStorageInfo;"point-cloud-unique-value"===k?f=q(l,p.field):"point-cloud-stretch"===k?f=q(l,p.field):"point-cloud-class-breaks"===k?f=q(l,p.field): (f="point-cloud-rgb"===k?b(l,p.field):b(l,"RGB"),c=null!=f);k=null;p?.colorModulation&&(k=q(l,p.colorModulation.field));return{rendererJSON:h,isRGBRenderer:c,primaryAttribute:f,modulationAttribute:k}};a.getSplatSizeAlgorithm=function(l){return(l=l?.pointSizeAlgorithm)&&"splat"===l.type?l:null};a.rendererUsesFixedSizes=function(l){l=l?.pointSizeAlgorithm;return l?.type?"fixed-size"===l.type:!1};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/PointCloudWorkerUtil":function(){define("exports ../../../../core/has ../../../../renderers/PointCloudClassBreaksRenderer ../../../../renderers/PointCloudStretchRenderer ../../../../renderers/PointCloudUniqueValueRenderer ./I3SBinaryReader ./LEPCC".split(" "), function(a,b,q,l,p,k,h){function f(g,d){const t=new Float64Array(d);for(let w=0;wd;case "low-four-bit":return d=>d&15;case "high-four-bit":return d=>(d&240)>>4;case "absolute-value":return d=>Math.abs(d);case "modulo-ten":return d=>d%10}}function e(g){let d=0;for(const t of g||[])d|=1<=n[z].value)g[3*x]=n[z].color.r,g[3*x+1]=n[z].color.g,g[3*x+2]=n[z].color.b;else for(z=1;z=n[z].minValue&&y<=n[z].maxValue){g[3*x]=n[z].color.r;g[3*x+1]=n[z].color.g;g[3*x+2]=n[z].color.b;break}}else g=(new Uint8Array(3*w)).fill(255);if(t&&r?.colorModulation)for(d=r.colorModulation.minValue,r=r.colorModulation.maxValue,n=0;n=r?1:u<=d?.3:.3+.7*(u-d)/(r-d),g[3*n]*=u,g[3*n+1]*=u,g[3*n+2]*=u;return g};a.filterInPlace=function(g,d,t,w,v){const m=g.length/3;let r=0;for(let A= 0;A>>4&15;u=1S.id!==W);return 0===Q.length? null:Q}function M(Q){return null!=Q.dist&&null!=Q.point&&null!=Q.pointId&&null!=Q.node}const K={positions:[new G.VertexElementDescriptor(C.VertexAttribute.POSITION,3,E.DataType.FLOAT,0,12)],colors:[new G.VertexElementDescriptor(C.VertexAttribute.COLOR,3,E.DataType.UNSIGNED_BYTE,0,3,!0)]};a.PointRenderer=class extends u.SyncPrepareRenderPlugin{constructor(Q){super(Q);this.type=z.IntersectorType.PCL;this.isGround=!1;this._passParameters=new D.PointRendererPassParameters;this._highlights=new r.PointHighlights({forEachNode:W=> this.forEachNode(W),addHighlight:(W,S,V)=>this._addHighlight(W,S,V),removeHighlight:(W,S)=>this._removeHighlight(W,S)});this.produces=new Map([[A.RenderSlot.OPAQUE_MATERIAL,W=>!n.isDepth(W)&&(W!==n.ShaderOutput.Highlight||!this._highlights.empty)],[A.RenderSlot.OPAQUE_NO_SSAO_DEPTH,W=>n.isDepth(W)]]);this.layerUid="";this._slicePlaneEnabled=!1;this._techniqueConfig=new H.PointRendererTechniqueConfiguration;this._nodes=new l}initializeRenderContext(Q){this._context=Q;Q.requestRender()}uninitializeRenderContext(){}intersect(Q, W,S,V){const T=g.create(),Y=g.create(),ha=g.create(),ba=g.create(),U=w.create(),Z=Q.camera.perScreenPixelRatio/2,ca=Q.camera.near;e.subtract(Y,V,S);const ea=1/e.length(Y);e.scale(Y,Y,ea);e.negate(ha,Y);d.set(U,Y[0],Y[1],Y[2],-e.dot(Y,S));const da=new R,ia=new R,ka=[],fa=t.create(),X=t.create(this._passParameters.clipBox);t.offset(X,-S[0],-S[1],-S[2],X);this._nodes.forAll(va=>{const za=va.splatSize*this._passParameters.scaleFactor;var ya=va.obb.minimumDistancePlane(U),Da=va.obb.maximumDistancePlane(U); ya-=O(za,ya+ca,this._passParameters,Z,va.isLeaf);Da-=O(za,Da+ca,this._passParameters,Z,va.isLeaf);ya=null!=da.dist&&null!=ia.dist&&da.distDa*ea;if(!(0>Da||ya)&&(Da=I(za,Da+ca,this._passParameters,Z,va.isLeaf),va.obb.intersectRay(S,Y,Da))){Da*=Da;va.obb.toAaBoundingBox(fa);t.offset(fa,-S[0],-S[1],-S[2],fa);ya=!t.contains(X,fa);e.subtract(ba,va.origin,S);var ra=va.coordinates.length/3;for(let Pa=0;PaDa)continue;var Ga=xa+ca;const Qa=O(za,Ga,this._passParameters,Z,va.isLeaf);if(0>xa-Qa)continue;Ga-=Qa;Ga=I(za,Ga,this._passParameters,Z,va.isLeaf);if(Ma>Ga*Ga)continue;const Ea=(xa-Qa)*ea;xa=ua=>{var Na=Pa,Ua=ua.point;null==Ua&&(Ua=g.create());Ua[0]=va.origin[0]+va.coordinates[3*Na];Ua[1]=va.origin[1]+va.coordinates[3*Na+1];Ua[2]=va.origin[2]+va.coordinates[3*Na+2];ua.point=Ua;ua.dist= Ea;ua.normal=ha;ua.node=va;ua.pointId=Pa;ua.layerUid=this.layerUid;return ua};(null==da.dist||Eaia.dist)&&(null==W||W(S,V,Ea))&&xa(ia);Q.options.store!==z.StoreResults.ALL||null!=W&&!W(S,V,Ea)||(Ma=new R,ka.push(xa(Ma)))}}});const ja=va=>{const {layerUid:za,node:ya,pointId:Da}=va;return new m.PclTarget(va.point,za,Da,()=>this.createGraphic(ya,Da,va.point))},la=(va,za)=>{const ya=ja(za);va.set(this.type, ya,za.dist,za.normal)};if(M(da)){var na=Q.results.min;(null==na.dist||da.distna.dist)&&la(na,ia));if(Q.options.store===z.StoreResults.ALL){na=v.fromPoints(S,V);for(const va of ka){const za=y.newIntersectorResult(na);la(za,va);Q.results.all.push(za)}}}prepareTechnique(Q){if(0===this._nodes.length||!(Q.output===n.ShaderOutput.Color||n.isDepth(Q.output)&&Q.bindParameters.slot===A.RenderSlot.OPAQUE_NO_SSAO_DEPTH|| Q.output===n.ShaderOutput.Highlight))return null;this._nodes.forAll(W=>{null==W.vao&&this._initNode(Q,W)});this._techniqueConfig.drawScreenSize=this._passParameters.drawScreenSpace;this._techniqueConfig.useFixedSizes=this._passParameters.useFixedSizes;this._techniqueConfig.hasSlicePlane=this._slicePlaneEnabled;this._techniqueConfig.hasOccludees=Q.bindParameters.hasOccludees;this._techniqueConfig.clippingEnabled=this._clippingEnabled;this._techniqueConfig.output=Q.output;return this._context.techniques.releaseAndAcquire(F.PointRendererTechnique, this._techniqueConfig,this._technique)}renderNode(Q,W){const S=Q.rctx,V=S.bindTechnique(W,Q.bindParameters,this._passParameters),T=Q.output===n.ShaderOutput.Highlight;this._nodes.forAll(Y=>{0===Y.coordinates.length||T&&!Y.highlights||(V.bindDraw(Y,Q.bindParameters,this._passParameters),S.bindVAO(Y.vao),T?this._renderHighlightFragments(S,Y):S.drawArrays(E.PrimitiveType.POINTS,0,Y.coordinates.length/3))})}_renderHighlightFragments(Q,W){var S=W.highlights;if(null!=S){W=S[0].component;var V=W+1;for(let T= 1;TQ===W)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(Q){this._slicePlaneEnabled!==Q&&(this._slicePlaneEnabled=Q,this._requestRender())}addNode(Q){this._nodes.push(Q);this._highlights.nodeAdded(Q); this._requestRender()}removeNode(Q){let W=null;this._nodes.filterInPlace(S=>S.id===Q?(W=S,S.vao=q.disposeMaybe(S.vao),this._highlights.nodeRemoved(S),!1):!0);this._requestRender();return W}forEachNode(Q){this._nodes.forAll(Q)}removeAll(){this._nodes.forAll(Q=>Q.vao=q.disposeMaybe(Q.vao));this._highlights.removeAll();this._nodes.clear();this._requestRender()}highlight(Q){return this._highlights.add(Q)}_addHighlight(Q,W,S){var V=Q.highlights;null==V&&(V=[]);W={component:W,id:S};V.push(W);W=L(W);for(S= V.length-1;0this._removeSet(f))}_removeSet(h){this._disableSet(h); this._highlights.delete(h)}_enableSet(h){h.enabled||(h.enabled=!0,this._context.forEachNode(f=>this._enableSetForNode(h,f)))}_enableSetForNode(h,f){if(h.enabled){var c=h.ids.get(f.id);c&&c.forEach(e=>this._context.addHighlight(f,e,h.id))}}_disableSet(h){h.enabled&&(h.enabled=!1,this._context.forEachNode(f=>this._disableSetForNode(h,f)))}_disableSetForNode(h,f){h.enabled||this._context.removeHighlight(f,h.id)}nodeAdded(h){this._highlights.forEach(f=>this._enableSetForNode(f,h))}nodeRemoved(h){this._highlights.forEach(f=> this._disableSetForNode(f,h))}removeAll(){this._highlights.forEach(h=>this._disableSet(h))}}class k{constructor(h){this.id=new l.Object3DStateID(q.Object3DState.Highlight);this.ids=new Map;this.enabled=!1;for(const f of h)null!=f&&this._add(f.nodeId,f.pointId)}_add(h,f){const c=this.ids.get(h);c?c.add(f):this.ids.set(h,new Set([f]))}}a.PointHighlights=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/PointRenderer.glsl":function(){define("exports ../core/mathUtils ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/support/aaBoundingBox ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3DrawUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){function z(N){const E=new x.ShaderBuilder,G=N.output===e.ShaderOutput.Color,I=N.output===e.ShaderOutput.Highlight,{vertex:O,fragment:L}=E;E.include(g.SliceDraw,N);E.attributes.add(y.VertexAttribute.POSITION,"vec3");E.attributes.add(y.VertexAttribute.COLOR,"vec3");O.uniforms.add(new n.Matrix4DrawUniform("modelView",(P,M)=>q.multiply(D,M.camera.viewMatrix,q.fromTranslation(D,P.origin))),new u.Matrix4PassUniform("proj",(P,M)=>M.camera.projectionMatrix), new w.Float2DrawUniform("screenMinMaxSize",(P,M,K)=>p.set(H,K.useFixedSizes?0:K.minSizePx*M.camera.pixelRatio,(P.isLeaf?256:64)*M.camera.pixelRatio)),N.useFixedSizes?new v.Float2PassUniform("pointScale",(P,M)=>p.set(H,P.fixedSize*M.camera.pixelRatio,M.camera.fullHeight)):new w.Float2DrawUniform("pointScale",(P,M,K)=>p.set(H,P.splatSize*K.scaleFactor*M.camera.pixelRatio,M.camera.fullHeight/M.camera.pixelRatio)));N.clippingEnabled?O.uniforms.add(new m.Float3DrawUniform("clipMin",(P,M,K)=>h.set(F,K.clipBox[0]- P.origin[0],K.clipBox[1]-P.origin[1],K.clipBox[2]-P.origin[2])),new m.Float3DrawUniform("clipMax",(P,M,K)=>h.set(F,K.clipBox[3]-P.origin[0],K.clipBox[4]-P.origin[1],K.clipBox[5]-P.origin[2]))):(O.constants.add("clipMin","vec3",[-b.numberMaxFloat32,-b.numberMaxFloat32,-b.numberMaxFloat32]),O.constants.add("clipMax","vec3",[b.numberMaxFloat32,b.numberMaxFloat32,b.numberMaxFloat32]));G&&E.varyings.add("vColor","vec3");O.code.add(r.glsl` void main(void) { // Move clipped points outside of clipspace if (position.x < clipMin.x || position.y < clipMin.y || position.z < clipMin.z || position.x > clipMax.x || position.y > clipMax.y || position.z > clipMax.z) { gl_Position = vec4(0.0,0.0,0.0,2.0); gl_PointSize = 0.0; return; } if (rejectBySlice(position)) { gl_Position = vec4(0.0,0.0,0.0,2.0); gl_PointSize = 0.0; return; } // Position in camera space vec4 camera = modelView * vec4(position, 1.0); float pointSize = pointScale.x; vec4 position = proj * camera; ${N.drawScreenSize?r.glsl` float clampedScreenSize = pointSize;`:r.glsl` float pointRadius = 0.5 * pointSize; vec4 cameraOffset = camera + vec4(0.0, pointRadius, 0.0, 0.0); vec4 positionOffset = proj * cameraOffset; float radius = abs(positionOffset.y - position.y); float viewHeight = pointScale.y; // screen diameter = (2 * r / w) * (h / 2) float screenPointSize = (radius / position.w) * viewHeight; float clampedScreenSize = clamp(screenPointSize, screenMinMaxSize.x, screenMinMaxSize.y); // Shift towards camera, to move rendered point out of terrain i.e. to // the camera-facing end of the virtual point when considering it as a // 3D sphere. camera.xyz -= normalize(camera.xyz) * pointRadius * clampedScreenSize / screenPointSize; position = proj * camera;`} gl_PointSize = clampedScreenSize; gl_Position = position; ${G?r.glsl`vColor = color;`:""} } `);L.include(t.RgbaFloatEncoding,N);I&&E.include(d.OutputHighlight,N);L.code.add(r.glsl` void main(void) { vec2 vOffset = gl_PointCoord - vec2(0.5, 0.5); float r2 = dot(vOffset, vOffset); if (r2 > 0.25) { discard; } ${I?r.glsl`outputHighlight();`:""} ${G?r.glsl`fragColor = vec4(vColor, 1.0);`:""} } `);return E}function A(N){return N?256:64}class B extends r.NoParameters{constructor(){super(...arguments);this.clipBox=c.create(c.positiveInfinity);this.useRealWorldSymbolSizes=this.useFixedSizes=!1;this.scaleFactor=1;this.sizePx=this.size=this.minSizePx=0}get fixedSize(){return this.drawScreenSpace?this.sizePx:this.size}get screenMinSize(){return this.useFixedSizes?0:this.minSizePx}get drawScreenSpace(){return this.useFixedSizes&&!this.useRealWorldSymbolSizes}}class C extends g.SlicePlaneParameters{constructor(N, E,G){super(N);this.origin=N;this.isLeaf=E;this.splatSize=G}}const D=l.create(),F=f.create(),H=k.create();l=Object.freeze(Object.defineProperty({__proto__:null,PointRendererDrawParameters:C,PointRendererPassParameters:B,build:z,getMaxPointSizeScreenspace:A},Symbol.toStringTag,{value:"Module"}));a.PointRendererDrawParameters=C;a.PointRendererPassParameters=B;a.PointRendererShader=l;a.build=z;a.getMaxPointSizeScreenspace=A})},"esri/views/3d/webgl-engine/shaders/PointRendererTechnique":function(){define("require exports ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../lib/StencilUtils ../../../../chunks/PointRenderer.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){class d extends p.ShaderTechnique{constructor(t,w,v){super(t,w,v)}initializeProgram(t){return new h.Program(t.rctx,d.shader.get().build(this.configuration),k.Default3D)}initializePipeline(){return g.makePipelineState({depthTest:{func:e.CompareFunction.LESS},depthWrite:g.defaultDepthWriteParams,colorWrite:g.defaultColorWriteParams,stencilWrite:this.configuration.hasOccludees?f.stencilWriteMaskOn:null,stencilTest:this.configuration.hasOccludees?f.stencilBaseAllZerosParams: null,drawBuffers:this.configuration.output===q.ShaderOutput.Depth?{buffers:[e.SpecialDrawBuffers.NONE]}:null})}}d.shader=new l.ReloadableShaderModule(c.PointRendererShader,()=>new Promise((t,w)=>a(["./PointRenderer.glsl"],t,w)));b.PointRendererTechnique=d;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/PointRendererTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderLibrary/ShaderOutput","../core/shaderTechnique/ShaderTechniqueConfiguration", "../materials/DefaultTechniqueConfiguration"],function(a,b,q,l,p){class k extends p.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.clippingEnabled=this.hasOccludees=this.useFixedSizes=this.drawScreenSize=this.hasSlicePlane=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],k.prototype,"output",void 0);b.__decorate([l.parameter()],k.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],k.prototype,"drawScreenSize",void 0);b.__decorate([l.parameter()], k.prototype,"useFixedSizes",void 0);b.__decorate([l.parameter()],k.prototype,"hasOccludees",void 0);b.__decorate([l.parameter()],k.prototype,"clippingEnabled",void 0);b.__decorate([l.parameter({constValue:!0})],k.prototype,"hasSliceInVertexProgram",void 0);a.PointRendererTechniqueConfiguration=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/PopupSceneLayerView":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Error ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/support/fieldUtils ../../../layers/support/popupUtils".split(" "), function(a,b,q,l,p,k,h,f,c){a.PopupSceneLayerView=e=>{e=class extends e{_validateFetchPopupFeatures(g){const {layer:d}=this,{popupEnabled:t}=d;if(!t)throw new q("scenelayerview3d:fetchPopupFeatures","Popups are disabled",{layer:d});if(!c.getFetchPopupTemplate(d,g))throw new q("scenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{layer:d});}async prepareFetchPopupFeatures(g){}async fetchPopupFeaturesFromGraphics(g,d){this._validateFetchPopupFeatures(d);if(0===g.length)return[]; const t="scene"===this.layer.type&&null!=this.layer.associatedLayer?this.layer.associatedLayer:this.layer;var w=[];"fieldsIndex"in this.layer&&(w=f.unpackFieldNames(this.layer.fieldsIndex,await c.getRequiredFields(t,c.getFetchPopupTemplate(this.layer,d))));await this.prepareFetchPopupFeatures(w);d=new Set;const v=[],m=[];for(const n of g)f.populateMissingFields(w,n,d)?m.push(n):v.push(n);if(0===m.length)return v;const r=new Map;for(w=0;wm).then(n=>v.concat(n));g.sort((n,u)=>{n=n.getObjectId()??0;n=r.get(n)??0;u=u.getObjectId()??0;u=r.get(u)??0;return n-u});return g}};return e=b.__decorate([h.subclass("esri.views.3d.layers.support.PopupSceneLayerView")],e)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/SceneLayerView3D":function(){define("../../../chunks/tslib.es6 ../../../Graphic ../../../core/Logger ../../../core/maybe ../../../core/ReactiveSet ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/sql/WhereClause ../../../layers/support/FeatureFilter ../../../layers/support/floorFilterUtils ../../../rest/support/Query ../../../support/featureFlags ./I3SMeshView3D ./II3SMeshView3D ./LayerView3D ./i3s/featureEditing ./i3s/I3SGeometryUtil ./i3s/I3SMeshViewFilter ./i3s/I3SNode ./i3s/I3SOverrides ./i3s/I3SQueryEngine ./i3s/I3SQueryFeatureAdapter ./i3s/I3SQueryFeatureStore ./i3s/I3SUtil ./support/DefinitionExpressionSceneLayerView ./support/fieldProperties ./support/PopupSceneLayerView ./support/SceneLayerViewRequiredFields ./support/TemporalSceneLayerView ../support/updatingProperties ../../layers/SceneLayerView ../../layers/support/popupUtils ../../support/layerViewUtils ../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K){f=N.defineFieldProperties();m=class extends m.I3SMeshView3D(I.TemporalSceneLayerView(H.DefinitionExpressionSceneLayerView(E.PopupSceneLayerView(n.LayerView3D(L))))){constructor(){super(...arguments);this.type="scene-layer-3d";this._setVisibilityHiddenObjectIds=new p;this.progressiveLoadFactor=1;this._elevationContext="scene";this._isIntegratedMesh=!1;this._supportsLabeling=!0;this._pendingEditsQueue=Promise.resolve(); this._interactiveEditingSessions=new Map;this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(J,R){return J.url===this.layer.url&&this.i3sOverrides.isEmpty?J.load(R).then(()=>{F.checkRecyclable(this.layer,J,this.i3sOverrides);this.layer=J;this.i3sOverrides.destroy();this.i3sOverrides=new A.I3SOverrides({view:this.view,layer:J,memoryController:this.view.resourceController?.memoryController});this.resetHighlights()}):null}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&& P.hasPopupTemplate(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(J){this._set("filter",y.I3SMeshViewFilter.checkSupport(J)?J:null)}get viewFilter(){const J=this.mergedFilter,R=this.layerFilter;if(null==J&&null==R)return null;const Q=this._get("viewFilter");if(null==Q)return new y.I3SMeshViewFilter({layerFilter:R,viewFilter:J,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:W=>this._loadAsyncModule(W),addSqlFilter:(W,S)=>this.addSqlFilter(W, S,this.logError),addTimeFilter:(W,S)=>this.addTimeFilter(W,S)});Q.viewFilter=J;Q.layerFilter=R;return Q}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){const J=t.getFloorFilterClause(this);return null!=J?g.WhereClause.create(J,this.layer.fieldsIndex):null}get _excludeObjectIdsSorted(){const J=this.layer.excludeObjectIds.toArray();return J.length?J.sort((R,Q)=>R-Q):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size? Array.from(this._setVisibilityHiddenObjectIds).sort((J,R)=>J-R):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.object?.lodFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return M.isInEffectiveScaleRange(this.i3slayer.effectiveScaleRange,this.view.terrainScale)}initialize(){this._fieldsHelper=new G.SceneLayerViewRequiredFields({layerView:this}); this._updatingHandles.add(()=>this.layer.rangeInfos,R=>this._rangeInfosChanged(R),k.initial);this._updatingHandles.add(()=>this.layer.renderer,R=>this._updatingHandles.addPromise(this._rendererChange(R)),k.initial);const J=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,J);this._updatingHandles.add(()=>this.mergedFilter,J);this._updatingHandles.add(()=>this._floorFilterClause,J);this._updatingHandles.add(()=>this._excludeObjectIdsSorted,J);this._updatingHandles.add(()=> this._setVisibilityHiddenObjectIdsSorted,J);this._updatingHandles.add(()=>this.viewFilter?.sortedObjectIds,J);this._updatingHandles.add(()=>this.viewFilter?.parsedWhereClause,J);this._updatingHandles.add(()=>this.getTimeFilterDependencies(),J);this._updatingHandles.add(()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship],()=>this._geometryFilterChange());v.sceneLayerEditingEnabled()&&this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=> this.i3sOverrides.sortedGeometryChangedObjectIds,J);this.addHandles(this.layer.on("apply-edits",R=>this._updatingHandles.addPromise(R.result)));this.addHandles(this.layer.on("edits",R=>{const Q=this._pendingEditsQueue.then(()=>this._handleEdits(R)).then();this._pendingEditsQueue=Q;this._updatingHandles.addPromise(Q)}))}destroy(){this._fieldsHelper=l.destroyMaybe(this._fieldsHelper)}_rangeInfosChanged(J){null!=J&&0{if(!Q?.features)return Q;const W=this.layer;for(const S of Q.features)S.layer= W,S.sourceLayer=W;return Q})}queryObjectIds(J,R){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(J),R?.signal)}_ensureQueryEngine(){this._queryEngine||(this._queryEngine=this._createQueryEngine());return this._queryEngine}_createQueryEngine(){const J=x.createGetFeatureExtent(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new B.I3SQueryEngine({layerView:this,priority:K.TaskPriority.FEATURE_QUERY_ENGINE,spatialIndex:new D.I3SQueryFeatureStore({featureAdapter:new C.I3SQueryFeatureAdapter({objectIdField:this.layer.objectIdField, attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:J}),forAllFeatures:(R,Q)=>this._forAllFeatures((W,S,V)=>R({id:W,index:S,meta:V}),Q,r.ForAllFeaturesMode.QUERYABLE),getFeatureExtent:J,sourceSpatialReference:F.getIndexCrs(this.layer),viewSpatialReference:this.view.spatialReference})})}highlight(J){const R=this._highlights;if(J instanceof w){const {set:Q,handle:W}=R.acquireSet();this.queryObjectIds(J).then(S=>R.setFeatureIds(Q,S));return W}return super.highlight(J)}createInteractiveEditSession(J){return u.createInteractiveEditSession(this._attributeEditingContext, J)}_createLayerGraphic(J){return new b({attributes:J,layer:this.layer,sourceLayer:this.layer})}getFilters(){const J=super.getFilters();v.sceneLayerEditingEnabled()&&this.i3sOverrides.is3DOFL&&0{0<=S.node.index&&F.objectIdFilter(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,W)});const R=this._setVisibilityHiddenObjectIdsSorted;null!=R&&J.push(W=>F.objectIdFilter(R,!1,W));const Q=this._excludeObjectIdsSorted;null!=Q&&J.push(W=> F.objectIdFilter(Q,!1,W));this._floorFilterClause&&this.addSqlFilter(J,this._floorFilterClause,this.logError);this.addSqlFilter(J,this.parsedDefinitionExpression,this.logError);null!=this.viewFilter&&this.viewFilter.addFilters(J,this.view,this._controller.crsIndex,this._collection);return J}setVisibility(J,R){R?this._setVisibilityHiddenObjectIds.delete(J):this._setVisibilityHiddenObjectIds.add(J)}isUpdating(){return super.isUpdating()||this.layerFilterUpdating||null!=this.viewFilter&&this.viewFilter.updating|| null!=this.i3sOverrides&&this.i3sOverrides.updating}_ensureQuery(J){return this._addDefinitionExpressionToQuery(null==J?this.createQuery():w.from(J))}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:J=>this._forAllNodes(R=>null!=R?J(R.node,R.featureIds):null),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides, getAttributeData:J=>this.getAttributeData(J),setAttributeData:(J,R)=>this.setAttributeData(J,R),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(J){const R=v.sceneLayerEditingEnabled(),Q=this._attributeEditingContext;J=await u.normalizeEditResultsEvent(Q,J);R&&u.processGeometryEdits(Q,J);u.processAttributeEdits(Q,J)}get hasGeometryFilter(){return null!=this.viewFilter?.parsedGeometry}computeNodeFiltering(J){const R=this.viewFilter;return null==R||!this.view.spatialReference||R.isMBSGeometryVisible(J, this.view.spatialReference,this._controller.crsIndex)?z.NodeFilterImpact.Unmodified:z.NodeFilterImpact.Culled}};a.__decorate([h.property()],m.prototype,"i3slayer",null);a.__decorate([h.property(O.updatingProgress)],m.prototype,"updatingProgress",void 0);a.__decorate([h.property({type:d})],m.prototype,"filter",null);a.__decorate([h.property({readOnly:!0})],m.prototype,"viewFilter",null);a.__decorate([h.property(f.requiredFields)],m.prototype,"requiredFields",null);a.__decorate([h.property(f.availableFields)], m.prototype,"availableFields",void 0);a.__decorate([h.property()],m.prototype,"_fieldsHelper",void 0);a.__decorate([h.property()],m.prototype,"_floorFilterClause",null);a.__decorate([h.property()],m.prototype,"_excludeObjectIdsSorted",null);a.__decorate([h.property()],m.prototype,"_setVisibilityHiddenObjectIds",void 0);a.__decorate([h.property()],m.prototype,"_setVisibilityHiddenObjectIdsSorted",null);a.__decorate([h.property()],m.prototype,"lodFactor",null);a.__decorate([h.property()],m.prototype, "updatingProgressValue",null);a.__decorate([h.property({readOnly:!0})],m.prototype,"visibleAtCurrentScale",null);return m=a.__decorate([e.subclass("esri.views.3d.layers.SceneLayerView3D")],m)})},"esri/core/ReactiveSet":function(){define(["./accessorSupport/tracking","./accessorSupport/tracking/SimpleObservable"],function(a,b){class q{constructor(l){this._observable=new b.SimpleObservable;this._set=new Set(l)}get size(){a.trackAccess(this._observable);return this._set.size}add(l){const p=this._set.size; this._set.add(l);this._set.size!==p&&this._observable.notify();return this}clear(){0l.call(p,k,h,this),p)}has(l){a.trackAccess(this._observable);return this._set.has(l)}keys(){a.trackAccess(this._observable);return this._set.keys()}values(){a.trackAccess(this._observable); return this._set.values()}[Symbol.iterator](){a.trackAccess(this._observable);return this._set[Symbol.iterator]()}get [Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}return q})},"esri/views/3d/layers/I3SMeshView3D":function(){define("require exports ../../../chunks/tslib.es6 ../../../Color ../../../Graphic ../../../symbols ../../../core/arrayUtils ../../../core/ByteSizeUnit ../../../core/Collection ../../../core/handleUtils ../../../core/has ../../../core/Logger ../../../core/MapUtils ../../../core/maybe ../../../core/PooledArray ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/scheduling ../../../core/typedArrayUtil ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/factories/quatf64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../core/support/UpdatingHandles ../../../geometry/projection/localLinearScaleFactors ../../../geometry/projection/projectBoundingSphere ../../../geometry/projection/projectBuffer ../../../geometry/projection/projectors ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/DoubleArray ../../../geometry/support/FloatArray ../../../geometry/support/Indices ../../../chunks/sphere ../../../geometry/support/UByteArray ../../../layers/LayerConstants ../../../layers/graphics/controllers/I3SOnDemandController ../../../layers/support/fieldUtils ../../../layers/support/SceneModification ../../../renderers/visualVariables/support/visualVariableUtils ../../../support/arcadeOnDemand ../../../support/basemapUtils ../../../support/elevationInfoUtils ../../../symbols/Symbol3D ./I3SMeshViewLabeler ./I3SMeshViewPerformanceInfo ./I3SMeshWorkerHandle ./II3SMeshView3D ./SceneLayerWorker ./graphics/graphicUtils ./graphics/Labeler ./i3s/enums ./i3s/Highlights ./i3s/I3SAsyncElevationUpdater ./i3s/I3SCrossfadeHelper ./i3s/I3SGeometryUtil ./i3s/I3SIntersectionHandler ./i3s/I3SMaterialUtil ./i3s/I3SNode ./i3s/I3SOverrides ./i3s/I3SProjectionUtil ./i3s/I3SUtil ./i3s/IDBCache ./i3s/IDBMockCache ./i3s/LayerElevationProvider ./support/attributeUtils ./support/makeScheduleFunction ./support/symbolColorUtils ../support/debugFlags ../support/ElevationRange ../support/extentUtils ../support/orientedBoundingBox ../support/updatingProperties ../support/buffer/glUtil ../webgl-engine/collections/Component/ObjectParameters ../webgl-engine/collections/Component/SourceGeometry ../webgl-engine/collections/Component/Transform ../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../webgl-engine/lib/BasisUtil ../webgl-engine/lib/edgeRendering/interfaces ../../../symbols/SimpleFillSymbol".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va,za,ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua,Na,Ua,wa,sa,Ha,Ka,Aa,Sa,Ya,qa,aa,Ja,Ta,Ra,$a,bb,pa,Ba){function Ia(lb,oa){m.isAbortError(lb)||d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn("Error while processing edges. Edges on this layer might not display correctly",oa,lb)}function Wa(lb){if(null==lb)return!1;const oa=lb.metallicRoughness;return oa&&0<=oa.baseColorTextureId|| oa&&0<=oa.metallicRoughnessTextureId||0<=lb.normalTextureId||0<=lb.emissiveTextureId||0<=lb.occlusionTextureId}function gb(lb){return null!=lb&&u.isArrayBuffer(lb.data)}function ib(lb,oa){lb=1024+lb.interleavedVertexData.byteLength+(lb.indices?lb.indices.byteLength:0)+lb.positionData.data.byteLength+lb.positionData.indices.byteLength;if(null!=oa)for(const Fa of oa)null!=Fa&&u.isArrayBuffer(Fa.data)&&(lb+=Fa.data.byteLength);return lb}function La(lb,oa){return oa.byteSize>xb?(d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Node is too big to store in IndexedDB cache: ${lb.id} (${oa.byteSize} bytes)`), !1):0{let Za=Va.serviceObbInIndexSR;null==Za&&(Za=Ib,Za.center=S.getCenter(Va.serviceMbsInIndexSR),Za.halfSize=[Va.serviceMbsInIndexSR[3],Va.serviceMbsInIndexSR[3],Va.serviceMbsInIndexSR[3]]);Va=Za.data;oa[Fa++]=Va[0];oa[Fa++]=Va[1];oa[Fa++]=Va[2];oa[Fa++]=Va[3];oa[Fa++]=Va[4];oa[Fa++]=Va[5];oa[Fa++]=Va[6];oa[Fa++]=Va[7];oa[Fa++]=Va[8];oa[Fa++]=Va[9]});return oa}}function eb(lb,oa){lb.forEach(Fa=> Fa.opacity=oa)}function db(lb,oa,Fa){let Va=lb.elevationRangeMin,Za=lb.elevationRangeMax;if(0{lb=class extends lb{constructor(){super(...arguments);this._needsNormals=!0;this._updatingHandles=new G.UpdatingHandles;this._nodeId2Meta=new Map;this._nodeId2MetaReloading= new Map;this._i3sWasmLoaded=!1;this._snappingSourcesTrackers=[];this._hasLoadedPBRTextures=!1;this._asyncModuleLoading=0;this._addTasks=new Map;this._currentRenderer=null;this._rendererVersion=0;this._symbologyOverrideFields=this._symbologyOverride=this._symbologyFields=this._rendererFields=this._opacityVariable=this._colorVariable=null;this._symbolInfos=new Map;this._visibleGeometryChangedSchedulerHandle=null;this._hasVertexColors=this._hasComponentData=!1;this._nodeColorOverride=null;this.updating= !0;this.holeFilling="auto";this.slicePlaneEnabled=this._hasData=this._hasTextures=this._hasColors=!1;this._modifications=[];this.ignoresMemoryFactor=!1;this._layerUrl="";this._cacheKeySuffix=null;this._planetRadiusInGlobalMode=0;this._elevationTask=null;this._filters=[];this._arcade=null;this._tmpAttributeOnlyGraphic=new p;this._crossfadeHelper=new Da.I3SCrossfadeHelper(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&& this.i3slayer.uid}get sublayerUid(){return null}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ea.rendererNeedsTextures(this._currentRenderer)? this._usePBR||this._hasLoadedPBRTextures?va.TextureUsage.AllTexturesPBR:va.TextureUsage.AllTextures:this._usePBR||this._hasLoadedPBRTextures?va.TextureUsage.GeometryTexturesPBR:va.TextureUsage.GeometryTextures}get elevationOffset(){const oa=null!=this.i3slayer?this.i3slayer.elevationInfo:null;return null!=oa&&"absolute-height"===oa.mode?ea.getElevationOffset(oa,this.i3slayer.spatialReference):0}get elevationInfo(){const oa=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==oa)return new Pb(X.ElevationMode.Absolute, 0);const Fa=ea.getElevationOffset(oa,this.i3slayer.spatialReference);switch(oa.mode){case "absolute-height":return new Pb(X.ElevationMode.Absolute,Fa);case "relative-to-ground":return new Pb(X.ElevationMode.RelativeToGround,Fa);case "on-the-ground":return new Pb(X.ElevationMode.OnTheGround,0);default:return new Pb(X.ElevationMode.Absolute,0)}}get supportedTextureEncodings(){return Ma.getSupportedEncodings(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){const oa= 0===(this.supportedTextureEncodings&va.TextureEncoding.DDS_S3TC);return this.view?.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled&&oa}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){var oa=this._nodeId2Meta;const Fa=new Aa.ElevationRange;for(const Va of oa.values()){if(null==Va)continue;({node:{serviceMbsInIndexSR:oa}}=Va);const [,,Za,fb]=oa;Fa.expandElevationRangeValues(Za-fb,Za+fb)}return Fa.elevationRangeValid?Fa:null}get fullExtent(){return this.i3slayer.fullExtent}initialize(){var oa= g("enable-feature:idb-mock-cache");this._idbCache=oa?new Na.IDBMockCache(this.view,oa):new ua.IDBCache("esri-scenelayer-cache","geometries");this._preLoadBasis();this.addResolvingPromise(this.i3slayer.indexInfo);oa=this.view.resourceController;this.i3sOverrides=new Pa.I3SOverrides({view:this.view,layer:this.i3slayer,memoryController:oa.memoryController});this._worker=new fa.I3SMeshWorkerHandle(sa.makeScheduleFunction(oa));this.addResolvingPromise(this._worker.promise);oa=this.i3slayer.store;this._worker.setLegacySchema(this.uid, oa.defaultGeometrySchema);Ea.checkSceneLayerValid(this.i3slayer);Ea.checkSceneLayerCompatibleWithView(this.i3slayer,this.view);this._layerUrl=this.i3slayer.parsedUrl.path;this._controller=new Y({layerView:this,worker:this._worker});this._geoMemoryEstimate=this._texMemoryEstimate=this._gpuMemoryEstimate=0;this._stage=this.view._stage;this._collection=this._stage.renderView.componentObjectCollection;this.resetHighlights();oa=oa.defaultGeometrySchema;if(this._isIntegratedMesh||!oa)this._hasComponentData= !1;else{const mb=oa.featureAttributes;this._hasComponentData=!!(mb&&mb.faceRange&&mb.id)}this._hasVertexColors=null!=(oa?.vertexAttributes.color??null)&&!this.i3slayer.cachedDrawingInfo?.color;this._memCache=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,mb=>this._deleteComponentObject(mb));const Fa=this._controller,Va=this._nodeId2Meta,Za=this._nodeId2MetaReloading;this._intersectionHandler=new xa.I3SIntersectionHandler({layerUid:this.layerUid,sublayerUid:this.sublayerUid, collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:mb=>{const rb=Fa.index;if(rb){var tb=rb.rootNode;tb&&rb.traverse(tb,yb=>{var zb=yb.index;zb=Va.get(zb)||Za.get(zb);return mb(yb,zb?.objectHandle??null)})}}});this._updatingHandles.add(()=>this.layerUid,mb=>this._intersectionHandler.layerUid=mb);this._updatingHandles.add(()=>this.sublayerUid,mb=>this._intersectionHandler.sublayerUid=mb);this._elevationProvider=new Ua.LayerElevationProvider({view:this.view, layerElevationSource:this,intersectionHandler:this._intersectionHandler});this._hasLoadedPBRTextures=this._usePBR;this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),r.initial);this._updatingHandles.add(()=>this.fullOpacity,mb=>this._opacityChange(mb));this._updatingHandles.add(()=>this.slicePlaneEnabled,mb=>this._slicePlaneEnabledChange(mb));this._updatingHandles.add(()=>this.elevationOffset,(mb,rb)=>{this._reloadAll(rb);this._controller.invalidateVisibilityObbs()}); this._updatingHandles.add(()=>this.elevationInfo,(mb,rb)=>this._elevationInfoChanged(mb,rb),r.initial);this._updatingHandles.add(()=>!this.suspended&&this.elevationInfo.mode!==X.ElevationMode.Absolute,(mb,rb)=>{mb?this.addHandles(this.view.basemapTerrain.on("elevation-change",({extent:tb})=>this._ensureElevationTask().addExtent(tb)),"elevation-change"):rb&&this.removeHandles("elevation-change")},r.initial);this._updatingHandles.add(()=>this._usePBR,mb=>this._updatePBR(mb));oa=()=>{this._reloadAll(); this.clearMemCache()};this._updatingHandles.add(()=>this.rendererTextureUsage,oa);this._updatingHandles.add(()=>this.uncompressedTextureDownsamplingEnabled,oa);this._updatingHandles.add(()=>this.contentVisible,mb=>this._contentVisibleChanged(mb),r.initial);this._updatingHandles.add(()=>this.i3slayer.labelsVisible,()=>this._labelingChanged(),r.initial);this._updatingHandles.add(()=>this.i3slayer.labelingInfo,()=>this._labelingChanged(),r.initial);this._updatingHandles.add(()=>this._modifications,()=> this._modificationsChanged(),r.initial);this.addHandles([r.watch(()=>Ka.debugFlags.I3S_TREE_SHOW_TILES,mb=>{if(mb&&!this._treeDebugger){const rb=this._controller.crsIndex;(new Promise((tb,yb)=>a(["./support/I3STreeDebugger"],tb,yb))).then(({I3STreeDebugger:tb})=>{!this._treeDebugger&&Ka.debugFlags.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new tb({lv:this,view:this.view,nodeSR:rb}))})}else mb||Ka.debugFlags.I3S_TREE_SHOW_TILES||(this._treeDebugger=w.destroyMaybe(this._treeDebugger))},r.initial),r.watch(()=> Ka.debugFlags.I3S_SHOW_MODIFICATIONS,()=>this._showModifications(),r.initial)]);this._cacheKeySuffix=Ea.getCacheKeySuffix(this.i3slayer.spatialReference,this.view.renderSpatialReference);this._idbCache.init().catch(mb=>d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Failed to initialize IndexedDB cache: ${mb}`));({view:oa}=this);const {viewingMode:fb,renderCoordsHelper:kb}=oa;this._planetRadiusInGlobalMode="local"===fb?0:kb.referenceEllipsoid.radius}destroy(){this._clearAddTasks();this._elevationTask= w.destroyMaybe(this._elevationTask);this.i3sOverrides=w.destroyMaybe(this.i3sOverrides);this._elevationProvider&&(this._elevationProvider.objectsChanged(this.getVisibleObbs()),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null);this._intersectionHandler&&(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const oa=this._worker;oa&&(oa.destroyContext(this.uid).then(()=>oa.destroy()), this._worker=null);this._removeAllNodeDataFromStage();this._memCache=w.destroyMaybe(this._memCache);this._edgeView=this._stage=this._collection=null;this._labeler=w.destroyMaybe(this._labeler);this._treeDebugger=w.destroyMaybe(this._treeDebugger);this._controller=w.destroyMaybe(this._controller);this._highlights.destroy();this._nodeId2Meta.clear();this._nodeId2MetaReloading.clear();this._crossfadeHelper=w.destroyMaybe(this._crossfadeHelper);this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle&& (this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null);this._updatingHandles=w.destroyMaybe(this._updatingHandles)}_memEstimateTextureAdded(oa){oa=oa.memoryEstimate;this._gpuMemoryEstimate+=oa;this._texMemoryEstimate+=oa;return oa}_memEstimateTextureRemoved(oa){null!=oa&&(oa=oa.memoryEstimate,this._gpuMemoryEstimate-=oa,this._texMemoryEstimate-=oa)}_memEstimateGeometryAdded(oa){oa=this._collection.getObjectGPUMemoryUsage(oa);this._gpuMemoryEstimate+= oa;this._geoMemoryEstimate+=oa;return oa}_memEstimateGeometryRemoved(oa){oa=this._collection.getObjectGPUMemoryUsage(oa);this._gpuMemoryEstimate-=oa;this._geoMemoryEstimate-=oa}isNodeLoaded(oa){return this._nodeId2Meta.has(oa)}isNodeReloading(oa){return this._nodeId2MetaReloading.has(oa)}get usedMemory(){let oa=null!=this._labeler?this._labeler.usedMemory:0;this._nodeId2Meta.forEach(Fa=>oa+=null!=Fa?Fa.node.memory:0);this._nodeId2MetaReloading.forEach(Fa=>oa+=null!=Fa?Fa.node.memory:0);return oa}get unloadedMemory(){return(null!= this._controller?this._controller.unloadedMemoryEstimate:0)+(null!=this._labeler?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!na.areLabelsVisible(this.i3slayer)||!this._supportsLabeling)null!=this._labeler&&(this._labeler.destroy(),this._labeler=null);else if(null==this._labeler){var oa=new ia({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides});this._nodeId2Meta.forEach(Fa=>null!=Fa&&this._addMetaToLabeler(oa,Fa));this._labeler=oa}}_loadAsyncModule(oa){++this._asyncModuleLoading; return oa.then(Fa=>{--this._asyncModuleLoading;return Fa},Fa=>{--this._asyncModuleLoading;throw Fa;})}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)this._i3sWasmLoaded=ja.initialize().then(()=>{this._i3sWasmLoaded=!0;this._modificationsChanged();this.notifyUpdate()}),this.notifyUpdate();else if(!0===this._i3sWasmLoaded){var oa=this.uid,Fa=this.i3slayer.spatialReference;this._worker.setModifications(oa,this._layerClippingArea,this._modifications,Fa);var Va=fa.toWasmModification(this._layerClippingArea, this._modifications,Fa);ja.setModificationsSync({context:oa,modifications:Va,isGeodetic:Fa.isGeographic});this._controller.modificationsChanged();var Za=this.hasModifications?new v:null;this._nodeId2Meta.forEach((fb,kb)=>{null==fb?(this._nodeId2Meta.delete(kb),this._controller.updateLoadStatus(kb,!1)):fb.node.hasModifications?(this._nodeId2Meta.delete(kb),this._nodeId2MetaReloading.set(kb,fb)):null!=Za&&Za.push(fb.node)});this.notifyChange("elevationRange");null!=Za&&this._nodeId2MetaReloading.forEach(fb=> Za.push(fb.node));null!=Za&&0{if(fb.imModificationImpact!==Ga.NodeIMModificationImpact.Culled){const kb=this._nodeId2Meta.get(fb.index);this._controller.invalidateGeometryVisibility(fb.index);null!=kb?(this._nodeId2Meta.delete(fb.index),this._nodeId2MetaReloading.set(fb.index,kb),this.notifyChange("elevationRange")):this._nodeId2Meta.has(fb.index)&&(this._nodeId2Meta.delete(fb.index),this._controller.updateLoadStatus(fb.index,!1))}})); this.clearMemCache();this._controller.restartNodeLoading();this._showModifications()}}_showModifications(){null!=this._modificationGraphics&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null);if(Ka.debugFlags.I3S_SHOW_MODIFICATIONS&&0!==this._modifications.length){var oa={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},Fa={outline:{color:[255,255,255],width:1}};this._modificationGraphics=[];for(const Va of this._modifications){const Za=Va.geometry; Za.spatialReference=this.i3slayer.spatialReference;const fb=new Ba({...Fa,color:oa[Va.type]});this._modificationGraphics.push(new p({geometry:Za,symbol:fb}))}this.view.graphics.addMany(this._modificationGraphics)}}_addMetaToLabeler(oa,Fa){oa.addNodeMeta(Fa,(Va,Za)=>this._createAttributes(Va,Za))}_contentVisibleChanged(oa){oa?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)): (this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(oa){oa=this._nodeId2Meta.get(oa);if(null!=oa?.attributeInfo)return oa.attributeInfo.loadedAttributes}getAttributeData(oa){oa=this._nodeId2Meta.get(oa);if(null!=oa?.attributeInfo)return oa.attributeInfo.attributeData}setAttributeData(oa,Fa){oa=this._nodeId2Meta.get(oa); null!=oa?.attributeInfo&&(oa.attributeInfo.attributeData=Fa,this._attributeValuesChanged(oa))}async updateAttributes(oa,Fa,Va){const Za=this._nodeId2Meta.get(oa);null!=Za&&(await this.i3sOverrides.applyAttributeOverrides(Za.featureIds,Fa,Va,this._controller.requiredAttributes),Za.attributeInfo=Fa,this._controller.reschedule(()=>this._attributeValuesChanged(Za),Va).catch(fb=>{m.isAbortError(fb)||d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn("Error while updating attribute values. Layer might not display correctly.", fb)}))}_attributeValuesChanged(oa){oa.cachedRendererVersion=this._getInvalidRendererVersion();oa.filteredIds=null;null!=this._labeler&&this._labeler.setNodeMetaAttributes(oa,(Fa,Va)=>this._createAttributes(Fa,Va));this._updateEngineObject(oa)}clearMemCache(){null!=this._memCache&&this._memCache.clear()}getVisibleNodes(){const oa=[];this._nodeId2Meta.forEach(Fa=>null!=Fa&&oa.push(Fa.node));return oa}getVisibleObbs(){const oa=[];this._nodeId2Meta.forEach(Fa=>{null!=Fa&&(Fa=this.getNodeComponentObb(Fa.node), null!=Fa&&oa.push(Fa))});return oa}getNodeComponentObb(oa){oa=this._nodeId2Meta.get(oa.index)??this._nodeId2MetaReloading.get(oa.index);return null!=oa?this._collection.getComponentObb(oa.objectHandle):null}getLoadedNodeIndices(oa){this._nodeId2Meta.forEach((Fa,Va)=>oa.push(Va));this._nodeId2MetaReloading.forEach((Fa,Va)=>oa.push(Va))}_preLoadBasis(){!g("disable-feature:i3s-basis")&&0!==(this.supportedTextureEncodings&va.TextureEncoding.Basis)&&this.i3slayer.textureSetDefinitions?.some(oa=>oa.formats.some(Fa=> "basis"===Fa.format||"ktx2"===Fa.format))&&bb.loadBasis()}_getVertexBufferLayout(oa,Fa){oa={hasTexture:Wa(oa.params.material),hasNormals:Fa.normal,hasRegions:Fa.uvRegion};return aa.glLayout(Ta.createVertexBufferLayout(this._getGeometryParameters(oa)))}_getObjectIdField(){return this.i3slayer.objectIdField||T.fallbackObjectIDAttribute}_getGlobalIdField(){return this.i3slayer.associatedLayer?.globalIdField}_findGraphicNodeAndIndex(oa){const Fa=wa.attributeLookup(this.i3slayer.fieldsIndex,oa.attributes, this._getObjectIdField());let Va=null;t.someMap(this._nodeId2Meta,Za=>{if(null==Za)return!1;const fb=Za.featureIds.indexOf(Fa);if(-1===fb)return!1;Va={node:Za.node,index:fb};return!0});return Va}_getGraphicIndices(oa,Fa){oa=this._nodeId2Meta.get(oa.index);if(null==oa)return[];const Va=[],Za=this._getObjectIdField(),fb=this.i3slayer.fieldsIndex;for(const kb of Fa)Fa=wa.attributeLookup(fb,kb.attributes,Za),Fa=oa.featureIds.indexOf(Fa),-1!==Fa&&Va.push(Fa);return Va}whenGraphicBounds(oa){oa=this._findGraphicNodeAndIndex(oa); if(!oa)return Promise.reject();oa=this._getAABB(oa.node.index,oa.index);return null==oa?Promise.reject():Promise.resolve({boundingBox:oa,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(oa){return null==oa.nodeIndex||null==oa.componentIndex?null:this._getAABB(oa.nodeIndex,oa.componentIndex)}_getAABB(oa,Fa){oa=this._nodeId2Meta.get(oa);if(null==oa?.featureIds||Fa>=oa.featureIds.length)return null;Fa=ra.boundingBoxCornerPoints(Fa,this._collection,oa.objectHandle,R.newDoubleArray(24),0);if(!L.projectBuffer(Fa, this.view.renderSpatialReference,0,Fa,this.view.spatialReference,0,8))return null;oa=K.empty();K.expandWithBuffer(oa,Fa,0,8);return oa}whenGraphicAttributes(oa,Fa){return Ea.whenGraphicAttributes(this.i3slayer,oa,this._getObjectIdField(),Fa,()=>[...this._nodeId2Meta.values()].filter(h.isSome))}getGraphicFromIntersectorTarget(oa){if(null==oa.nodeIndex||null==oa.componentIndex)return null;const Fa=this._nodeId2Meta.get(oa.nodeIndex);return null==Fa?.featureIds||oa.componentIndex>=Fa.featureIds.length? null:this._createGraphic(oa.componentIndex,Fa)}_getCacheKey(oa){return`${this._layerUrl}/v${24}/${oa}${this._cacheKeySuffix}`}_getMemCacheKey(oa,Fa=this.elevationOffset){return oa+"#"+Fa}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(oa){return null!=this._memCache?this._memCache.pop(this._getMemCacheKey(oa)):null}deleteCachedGPUData(oa){null!=oa&&this._deleteComponentObject(oa)}_cacheGPUData(oa, Fa=this.elevationOffset){if(null==this._memCache)this._deleteComponentObject(oa);else{var Va=this._controller.indexDepth-oa.node.level;this._memCache.put(this._getMemCacheKey(oa.node.index,Fa),oa,oa.node.memory,Va)}}loadMissingTextures(oa,Fa,Va,Za){const fb=oa?.filter((kb,mb)=>{if(0===(kb.usage&this.rendererTextureUsage))return!1;if(null==Fa)return!0;kb=Ma.selectEncoding(kb.encodings,this.supportedTextureEncodings);mb=Fa[mb];return null==mb?.data||kb&&mb.encoding!==kb.encoding?!0:!1})??[];return 0=== fb.length?Promise.resolve(!1):Va(fb,Za).then(kb=>{let mb=0;for(let rb=0;rb{if(null==Za)return null;if(Za.nodeVersion!==oa.version)return this._idbCache.remove(this._getCacheKey(oa.id)),null;this.elevationInfo.mode===X.ElevationMode.Absolute&&(oa.geometryObbInRenderSR=Ya.Obb.fromData(Za.geometryObbData)); return this.loadMissingTextures(Za.requiredTextures,Za.textureData,Va,Fa).then(fb=>{fb&&this._idbCache.initialized&&null!=Za.textureData&&(Za.byteSize=ib(Za.transformedGeometry,Za.textureData),Za.textureData.every(gb)&&La(oa,Za)&&this._idbCache.put(this._getCacheKey(oa.id),Za).catch(kb=>d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Failed to update node with textures in IndexedDB cache: ${oa.id}: ${kb}`)));m.throwIfAborted(Fa);return Za})}):Promise.resolve(null)}addNode(oa,Fa,Va){return"geometryData"in Fa?null==Fa.geometryBuffer?(this._addNodeMeta(oa.index,null),Promise.resolve()):this._addData(oa,Fa.attributeDataInfo,()=>this._transformNode(oa,Fa,Va).then(Za=>this._safeReschedule(()=>{if(null==Za)return oa.hasModifications=!1,this._addCachedNodeData(oa,null,Va);oa.hasModifications=Za.transformedGeometry.hasModifications;const {obb:fb,componentOffsets:kb,featureIds:mb,anchorIds:rb,anchors:tb,transformedGeometry:yb,globalTrafo:zb}=Za;var Ab=F.set(Cb,fb.center.x,fb.center.y,fb.center.z);F.transformMat4(Ab, Ab,zb);Ab=new Ya.Obb(Ab,[fb.extents.x,fb.extents.y,fb.extents.z],D.fromValues(fb.orientation.x,fb.orientation.y,fb.orientation.z,fb.orientation.w));this.elevationInfo.mode===X.ElevationMode.Absolute&&(oa.geometryObbInRenderSR=Ab);Fa.geometryData.componentOffsets=kb;mb&&(Fa.geometryData.featureIds=Array.from(mb));Fa.geometryData.anchorIds=rb;Fa.geometryData.anchors=tb;Ab={nodeVersion:oa.version,geometryData:Fa.geometryData,requiredTextures:Fa.requiredTextures,textureData:Fa.textureData,transformedGeometry:yb, globalTrafo:zb,geometryObbData:Ab.data,byteSize:ib(yb,Fa.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&La(oa,Ab)){const Fb=null!=Ab.textureData?Ab.textureData.map(Qb=>gb(Qb)?Qb:null):null;this._idbCache.put(this._getCacheKey(oa.id),{...Ab,textureData:Fb}).catch(Qb=>d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Failed to store node in IndexedDB cache: ${oa.id}: ${Qb}`))}return this._addCachedNodeData(oa,Ab,Va)},Va))):Promise.reject()}getElevationRange(oa){const Fa=new Aa.ElevationRange; var Va=this._controller;const {index:Za}=Va;if(!Za)return Fa;const {rootNode:fb}=Za;if(!fb)return Fa;const kb=this._nodeId2Meta,mb=oa[3],rb=Va.viewportQueries,tb=this._planetRadiusInGlobalMode;({view:Va}=this);const {renderCoordsHelper:yb}=Va,zb=yb.referenceEllipsoid.radius,Ab=this._collection;Za.traverse(fb,Fb=>{const {childrenLoaded:Qb}=Fb;if(0===Qb)return!1;var sb=rb.getAndUpdateVisibilityObbInRenderSR(Fb),vb=null;let Gb=-1;if(sb){if(Gb=sb.radius,!sb.intersectSphereWithMBS(oa,Gb))return!1}else(vb= rb.getServiceMbsInRenderSR(Fb))&&(Gb=vb[3]);if(0<=Gb&&mb>=1*Gb)return null!=sb?db(Fa,sb,tb):null!=vb&&0<=vb[3]&&jb(Fa,vb,tb),!1;Lb.elevationRangeMin=Infinity;Lb.elevationRangeMax=-Infinity;if(null!=sb||null!=vb)if(null!=sb?db(Lb,sb,tb):null!=vb&&jb(Lb,vb,tb),Lb.elevationRangeMin>=Fa.elevationRangeMin&&Lb.elevationRangeMax<=Fa.elevationRangeMax)return!1;if(sb=kb.get(Fb.index))if({geometryObbInRenderSR:Fb}=Fb,!Fb||Fb.intersectSphereWithMBS(oa)){if(Fb&&mb>0*Fb.radius)return db(Fa,Fb,tb),!1;({objectHandle:Fb}= sb);vb=Ab.getObjectTransform(Fb);vb=yb.getAltitude(vb.position);Ab.expandRangeWithComponentObjectElevationRange(Fb,vb,zb,Fa)}return 0this._addCachedNodeData(oa,Fa,Za))}async deleteCachedNodeData(oa){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(oa))}async _addCachedNodeData(oa, Fa,Va){if(this.contentVisible&&this._controller.isGeometryVisible(oa))if(null==Fa)this._addNodeMeta(oa.index,null);else{var Za=this._addTasks.get(oa.index),{geometryData:fb,transformedGeometry:kb,globalTrafo:mb}=Fa;await this.i3sOverrides.applyAttributeOverrides(fb.featureIds,Za.attributeInfo,Va,this._controller.requiredAttributes);var rb=null!=Fa.textureData?Fa.textureData.filter(Yb=>null!=Yb&&0!==(Yb.usage&this.rendererTextureUsage)):[];!g("disable-feature:i3s-basis")&&rb.some(Yb=>null!=Yb&&(Yb.encoding=== va.TextureEncoding.Basis||Yb.encoding===va.TextureEncoding.KTX2))&&await bb.loadBasis();oa.memory=0;var {componentOffsets:tb,geometries:yb,featureIds:zb,anchorIds:Ab,anchors:Fb}=fb,Qb=this._collection,sb=yb[0],{layout:vb,indices:Gb,interleavedVertexData:Hb,positionData:Tb,hasColors:lc}=kb,{material:Ub,geometryParameters:Zb}=this._materialParameters(sb,vb),ac=tb||new Uint32Array([0,Gb?Gb.length:Hb.byteLength/vb[0].stride]);ac={vertices:{data:Hb,count:Hb.byteLength/vb[0].stride,layoutParameters:Zb}, positionData:{positions:Q.compactFloatArray(Tb.data),indices:W.compactIndices(Tb.indices)},indices:Gb,componentOffsets:ac};var Mb=sb.transformation?C.clone(sb.transformation):C.create();B.multiply(Mb,mb,Mb);sb=B.getTranslation(H.create(),Mb);Mb=z.fromMat4(A.create(),Mb);var Jb=this.view.renderSpatialReference,Wb=this.view.basemapTerrain.spatialReference,cc=Ya.Obb.fromData(Fa.geometryObbData).center,Db=[1,1,1];I.localLinearScaleFactors(cc,Jb,Db,Wb)||d.getLogger("esri.views.3d.layers.I3SMeshView3D").errorOnce("Unsupported coordinate system for IM overlay"); var Nb=H.create();M.projectVectorToVector(cc,Jb,Nb,Wb);Jb=A.create();z.invert(Jb,Mb);Wb=H.create();F.transformMat3(Wb,F.sub(Wb,cc,sb),Jb);var hc=Qb.createObject(new Ja.ObjectParameters(E.fromValues(Nb[0]-Wb[0]*Db[0],Nb[1]-Wb[1]*Db[1],Db[0],Db[1]),new Ra.Transform(sb,Mb),Ya.Obb.fromData(Fa.geometryObbData),ac)),{textures:xc,texturePromise:nc}=this._initMaterialAndTextures(hc,Ub,rb,Zb.textureCoordinates===$a.TextureCoordinateAttributeType.Atlas);oa.memory+=this._memEstimateGeometryAdded(hc);oa.memory+= xc.reduce((Yb,dc)=>Yb+(null!=dc?this._memEstimateTextureAdded(dc):0),0);rb=!!Ub.hasParametersFromSource;ac="blend"!==Ub.alphaMode&&1<=Ub.metallicRoughness.baseColorFactor[3];var Xb=new qb(oa,zb,hc,this._getInvalidRendererVersion(),Za.attributeInfo,{hasParametersFromSource:rb,isOpaque:ac},xc,Ab,Fb);Za.meta=Xb;!this._hasTextures&&Fa.requiredTextures?.some(({usage:Yb})=>0!==(Yb&va.TextureUsage.ColorTextures))&&(this._hasTextures=!0);this._hasData=!0;this._hasColors=this._hasColors||lc;this._hasTextures= this._hasTextures||!!oa.resources.texture;this.notifyChange("hasTexturesOrVertexColors");var tc=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(Xb),nc]).then(([Yb])=>{this._addTasks.has(oa.index)&&Yb?.updateObjectVisibility(Xb.objectHandle,!1).catch(dc=>Ia(dc,this.i3slayer.title));return this._safeReschedule(()=>{var dc=this._addTasks.get(oa.index);if(dc)if(this._addNodeMeta(oa.index,Xb),dc.meta=null,this.contentVisible){Qb.setObjectVisibility(hc,!0);Yb?.updateObjectVisibility(Xb.objectHandle, !0).catch(oc=>Ia(oc,this.i3slayer.title));Xb.attributeInfo=dc.attributeInfo;dc=Xb.cachedRendererVersion!==this._rendererVersion;var Gc=tc!==this.slicePlaneEnabled;this._updateElevationOffsets(Xb);var Cc=Xb.elevationOffsets;this._updateComponentData(Xb);var uc=this._applyFiltersToNode(Xb);(dc||null!=Yb&&(Gc||uc||Cc))&&this._addOrUpdateEdgeRendering(Xb);null!=this._labeler&&this._addMetaToLabeler(this._labeler,Xb);this._visibleGeometryChanged(Xb,pb.ADD);this._highlights.objectCreated(Xb);this._updateMaterial(Xb); this._setNewNodeOpacity(Xb);null!=this._treeDebugger&&this._treeDebugger.update()}else this._removeNodeStageData(oa.index,this.elevationOffset)},Va)}).catch(Yb=>{null!=Za.meta&&(this._cacheGPUData(Za.meta),Za.meta=null);throw Yb;})}else this._removeNodeStageData(oa.index,this.elevationOffset,this._nodeId2MetaReloading)}_addNodeMeta(oa,Fa){this._removeNodeStageData(oa,this.elevationOffset,this._nodeId2MetaReloading);if(this._nodeId2Meta.has(oa)){d.getLogger("esri.views.3d.layers.I3SMeshView3D").error("Removing duplicated node"); const Va=this._nodeId2Meta.get(oa);null!=Va&&this._deleteComponentObject(Va)}else this._controller.updateLoadStatus(oa,!0);null!=Fa&&(Fa.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&eb(Fa.cachedEdgeMaterials,0));this._nodeId2Meta.set(oa,Fa);this.notifyChange("elevationRange")}_updateElevationOffsets(oa){const Fa=this.view.renderSpatialReference,Va=this._controller.crsIndex,Za=this.elevationInfo,fb=this.view.basemapTerrain,kb=fb.spatialReference,mb=Za.mode;if(null==Fa||null==kb||mb===X.ElevationMode.Absolute)oa.elevationOffsets= null;else{var rb=this._collection.getObjectTransform(oa.objectHandle);oa.elevationOffsets=oa.elevationOffsets??[];var tb=mb===X.ElevationMode.OnTheGround,yb=this.view.renderCoordsHelper,zb=oa.featureIds.length,Ab=(()=>{if(oa.cachedElevationAnchors)return oa.cachedElevationAnchors;const sb=R.newDoubleArray(3*zb);oa.cachedElevationAnchors=sb;for(let vb=0;vb{const Gb=tb? Ab[3*sb+2]:0;Qb[sb]=Fb+(null!=vb?vb-Gb:0)})}}_ensureElevationTask(){return null!=this._elevationTask?this._elevationTask:this._elevationTask=new ya.I3SAsyncElevationUpdater(this.view.resourceController.scheduler,oa=>{oa=this._controller.updateElevationChanged(oa,this.view.basemapTerrain.spatialReference);return null!=oa?oa.filterInPlace(Fa=>null!=this._nodeId2Meta.get(Fa)):null},oa=>{oa=this._nodeId2Meta.get(oa);this._nodeElevationAlignmentChanged(oa)},()=>this.elevationInfo?.mode)}_elevationInfoChanged(oa, Fa){const Va=oa.mode!==X.ElevationMode.Absolute;oa=!!Fa&&Fa!==oa&&Fa.mode!==X.ElevationMode.Absolute;this._intersectionHandler.updateElevationAlignState(Va,this.view.state.viewingMode);Va&&!oa&&this._controller.removeAllGeometryObbs();this._nodeId2Meta.forEach(Za=>this._nodeElevationAlignmentChanged(Za))}_nodeElevationAlignmentChanged(oa){null!=oa&&(this._updateElevationOffsets(oa),this._updateComponentData(oa),this._updateEdgeRendering(oa),null!=this._labeler&&this._labeler.updateLabelPositions(oa), this._updateSnappingSources(oa,pb.UPDATE))}_safeReschedule(oa,Fa){m.throwIfAborted(Fa);return this._controller.reschedule(oa,Fa)}_materialParameters(oa,Fa){oa=null!=oa.params.material?oa.params.material:Ma.defaultMaterial();const Va=Fa.some(fb=>"uvRegion"===fb.name);Fa=Fa.some(fb=>"normalCompressed"===fb.name);const Za=Wa(oa);return{geometryParameters:this._getGeometryParameters({hasTexture:Za,hasNormals:Fa,hasRegions:Va}),material:oa}}_initMaterialAndTextures(oa,Fa,Va,Za){const fb=this._stage.renderView, kb=Va.map(rb=>Ma.createTexture(rb,Fa,Za,fb));this._stage.addMany(kb);let mb=null;this._collection.updateMaterial(oa,rb=>{mb=Ma.configureMaterial(rb,Fa,kb,Va,this.view._stage.renderView.textures,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference});this._updateMaterialOverlay(rb)});return{textures:kb,texturePromise:mb}}_getGeometryParameters(oa){return{textureCoordinates:oa.hasTexture? oa.hasRegions?$a.TextureCoordinateAttributeType.Atlas:$a.TextureCoordinateAttributeType.Default:$a.TextureCoordinateAttributeType.None,colors:this._hasVertexColors,hasNormals:oa.hasNormals&&this._needsNormals,needsNormals:this._needsNormals}}_addData(oa,Fa,Va){let Za=this._addTasks.get(oa.index);Za?Za.attributeInfo=Fa:(Za={...m.createResolver(),attributeInfo:Fa,meta:null},this._addTasks.set(oa.index,Za),Va().then(Za.resolve,Za.reject).then(()=>this._addTasks.delete(oa.index)).catch(fb=>{this._addTasks.delete(oa.index); throw fb;}));return Za.promise}_clearAddTasks(){this._addTasks.forEach(oa=>{null!=oa.meta&&(this._cacheGPUData(oa.meta),oa.meta=null)});this._addTasks.clear()}_clippingAreaChanged(){var oa=this.view.renderSpatialReference;const Fa=this.i3slayer.spatialReference,Va=J.create();this._renderClippingArea=Sa.toBoundingRect(this.view.clippingArea,Va,oa)?Va:null;oa=J.create();this._layerClippingArea=Sa.toBoundingRect(this.view.clippingArea,oa,Fa)?oa:null;this._filterChange();this._controller&&this._controller.updateClippingArea(this.view.clippingArea); this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const oa=this.hasGeometryFilter;this._controller.geometryFilterChanged(oa);this._applyFilters(oa)}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(oa){this._filters=this.getFilters();oa?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach(Fa=>{null!=Fa&&this._applyFiltersToNode(Fa)&&(this._addOrUpdateEdgeRendering(Fa),this._visibleGeometryChanged(Fa, pb.UPDATE))})}getFilters(){const oa=[],Fa=this._renderClippingArea;null!=Fa&&oa.push((Va,Za)=>this._boundingRectFilter(Va,Za,Fa));return oa}addSqlFilter(oa,Fa,Va){if(null!=Fa){const Za=Fa.fieldNames;oa.push((fb,kb)=>this._sqlFilter(fb,kb,Fa,Za,Va))}}_sqlFilter(oa,Fa,Va,Za,fb){const kb={},mb=this._createLayerGraphic(kb),rb=this.i3slayer.objectIdField,tb=Fa.featureIds,yb=Fa.attributeInfo?.attributeData;Za.every(zb=>zb===rb||null!=yb?.[zb])&&Ea.filterInPlace(oa,tb,zb=>{kb[rb]=tb[zb];for(const Ab of Za)Ab!== rb&&(kb[Ab]=yb?Ea.getCachedAttributeValue(yb[Ab],zb):null);try{return Va.testFeature(mb)}catch(Ab){return fb(Ab),!1}})}_boundingRectNodeTest(oa,Fa){O.projectBoundingSphere(oa.node.serviceMbsInIndexSR,this._controller.crsIndex,fc,this.view.renderSpatialReference);return Ea.intersectBoundingRectWithMbs(Fa,fc)}_boundingRectFeatureTest(oa,Fa,Va){this._collection.getComponentAabb(oa.objectHandle,Fa,Bb);K.toRect(Bb,Kb);return J.intersects(Va,Kb)}_boundingRectFilter(oa,Fa,Va){var Za=this._collection;const fb= this._boundingRectNodeTest(Fa,Va);if(fb!==Ea.MbsIntersectResult.INSIDE)if(fb===Ea.MbsIntersectResult.OUTSIDE)oa.length=0;else if(Za=Za.getComponentCount(Fa.objectHandle),Za.invisible+Za.visible===Fa.featureIds.length){var kb=this._transformClippingArea(bc,Va,Fa.objectHandle);Ea.filterInPlace(oa,Fa.featureIds,mb=>this._boundingRectFeatureTest(Fa,mb,kb))}}_transformClippingArea(oa,Fa,Va){var Za=this._collection.getObjectTransform(Va);Va=Za.position;Za=Za.rotationScale;oa[0]=(Fa[0]-Va[0])/Za[0];oa[1]= (Fa[1]-Va[1])/Za[4];oa[2]=(Fa[2]-Va[0])/Za[0];oa[3]=(Fa[3]-Va[1])/Za[4];return oa}async _addOrUpdateEdgeRendering(oa,Fa=!0){const Va=oa.objectHandle,{hasEdges:Za,perFeatureEdgeMaterials:fb}=this._getFilteredEdgeMaterials(oa),kb={hasSlicePlane:this.slicePlaneEnabled};Za&&!this._edgeView&&(this._edgeView=await this._stage.renderer.loadEdgeView());const mb=this._edgeView;if(!mb)return null;var rb=mb.hasObject(Va);if(Za){if(rb)return this.nodeCrossfadingEnabled&&(rb=this.getNodeOpacity(oa),eb(fb,rb)), mb.updateAllComponentMaterials(Va,fb,kb,Fa).catch(tb=>Ia(tb,this.i3slayer.title)),mb.updateObjectVisibility(Va,!0).catch(tb=>Ia(tb,this.i3slayer.title)),mb.updateAllVerticalOffsets(Va,oa.elevationOffsets).catch(tb=>Ia(tb,this.i3slayer.title)),mb;Fa=await this._collection.addEdges(Va,mb,fb,kb,oa.elevationOffsets);oa.edgeMemoryUsage=Fa;oa.node.memory+=Fa;return mb}rb&&(oa.node.memory-=oa.edgeMemoryUsage,oa.edgeMemoryUsage=0,mb.removeObject(Va));return null}_applyFiltersToNode(oa){return this._applyFiltersToNodeComponents(oa)? (null!=this._labeler&&this._labeler.applyFilterChange(oa),!0):!1}_applyFiltersToNodeComponents(oa){const Fa=this._collection;var Va=Fa.getComponentCount(oa.objectHandle),Za=null!=oa.filteredIds;Va=0===Va.invisible;Fa.setAllComponentVisibilities(oa.objectHandle,"all");if(0===this._filters.length)return oa.filteredIds=null,!Va;this._updateCachedFilteredIds(oa);if(Za&&oa.filteredIds===oa.featureIds)return!Va;Za=this._computeFilteredComponentIndices(oa);Fa.setAllComponentVisibilities(oa.objectHandle, Za);return!0}_updateCachedFilteredIds(oa){if(null==oa.filteredIds||oa.appliedFilters!==this._filters)oa.filteredIds=this._computeFilteredIds(oa),oa.appliedFilters=this._filters}_computeFilteredIds(oa){const Fa=oa.featureIds.slice();for(const Va of this._filters)if(Va(Fa,oa),0===Fa.length)break;return Fa.length===oa.featureIds.length?oa.featureIds:Fa}_computeFilteredComponentIndices(oa){const Fa=[],Va=oa.filteredIds;null!=Va&&oa.featureIds.forEach((Za,fb)=>{Va[Fa.length]===Za&&Fa.push(fb)});return Fa}_removeAllNodeDataFromStage(oa= this.elevationOffset){this._nodeId2Meta.forEach((Fa,Va)=>this._removeNodeStageData(Va,oa));this._nodeId2MetaReloading.forEach((Fa,Va)=>this._removeNodeStageData(Va,oa,this._nodeId2MetaReloading));this._elevationTask=w.destroyMaybe(this._elevationTask)}removeNode(oa){const Fa=this.elevationOffset;this._removeNodeStageData(oa,Fa);this._removeNodeStageData(oa,Fa,this._nodeId2MetaReloading);null!=this._elevationTask&&this._elevationTask.remove(oa)}_removeNodeStageData(oa,Fa,Va=this._nodeId2Meta){Va.has(oa)&& this._controller.updateLoadStatus(oa,!1);const Za=Va.get(oa);null==Za?Va.delete(oa):(this._collection.setObjectVisibility(Za.objectHandle,!1),null!=this._edgeView&&this._edgeView.hasObject(Za.objectHandle)&&this._edgeView.updateObjectVisibility(Za.objectHandle,!1).catch(fb=>Ia(fb,this.i3slayer.title)),this._visibleGeometryChanged(Za,pb.REMOVE),null!=this._labeler&&this._labeler.removeNodeMeta(Za),Va.delete(oa),this._highlights.objectDeleted(Za),Va===this._nodeId2Meta?(this._cacheGPUData(Za,Fa),this.nodeCrossfadingEnabled&& this._crossfadeHelper.stopNodeFading(Za)):this._deleteComponentObject(Za),null!=this._treeDebugger&&this._treeDebugger.update())}_deleteComponentObject(oa){null!=this._edgeView&&this._edgeView.removeObject(oa.objectHandle);this._memEstimateGeometryRemoved(oa.objectHandle);this._collection.destroyObject(oa.objectHandle);if(oa.textures)for(const Fa of oa.textures)this._memEstimateTextureRemoved(Fa),this._stage.remove(Fa)}updateNodeState(oa,Fa){oa=this._nodeId2Meta.get(oa);null!=oa&&this._collection.updateMaterial(oa.objectHandle, Va=>Va.polygonOffsetEnabled=Fa===Ga.NodeState.Hole)}updateNodeIndex(oa,Fa){if(this._nodeId2Meta.has(oa)){var Va=this._nodeId2Meta.get(oa);this._nodeId2Meta.delete(oa);this._nodeId2Meta.set(Fa,Va);this.notifyChange("elevationRange")}if(Va=this._nodeId2MetaReloading.get(oa))this._nodeId2MetaReloading.delete(oa),this._nodeId2MetaReloading.set(Fa,Va)}_invalidateAllSymbols(){this._rendererVersion=Ea.addWraparound(this._rendererVersion,1);this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Ea.addWraparound(this._rendererVersion, -1)}async _rendererChange(oa){this._currentRenderer=oa;this.notifyChange("rendererTextureUsage");this._rendererVersion=Ea.addWraparound(this._rendererVersion,1);this._opacityVariable=this._colorVariable=this._rendererFields=null;this._invalidateAllSymbols();oa&&(this._rendererFields=await oa.getRequiredFields(this.i3slayer.fieldsIndex));this._updateSymbologyFields();!this._arcade&&oa&&"arcadeRequired"in oa&&oa.arcadeRequired&&(this._arcade=await Z.loadArcade());if(oa&&"visualVariables"in oa&&oa.visualVariables)for(const Fa of oa.visualVariables)"color"=== Fa.type?this._colorVariable=Fa:"opacity"===Fa.type?this._opacityVariable=Fa:d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Unsupported visual variable type for 3D Object Scene Services: ${Fa.type}`);if(oa)for(const Fa of oa.getSymbols())"mesh-3d"!==Fa.type&&d.getLogger("esri.views.3d.layers.I3SMeshView3D").error(`Symbols of type '${Fa.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(oa){this._hasComponentData&& oa.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(oa);return oa.cachedEdgeMaterials}_getComponentParameters(oa){this._hasComponentData&&oa.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(oa);const Fa=oa.cachedSymbology;return(Va,Za)=>{const fb=5*Va;N.set(Za.externalColor,Fa[fb]/255,Fa[fb+1]/255,Fa[fb+2]/255,Fa[fb+3]/255);if(null!=this._stage.renderView.objectAndLayerIdRenderHelper){const kb=oa.featureIds[Va],mb=ca.isBasemapLayer(this.view.map, this.layerUid);this._stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(kb,kb,this.layerId,this.layerUid+"_"+this.sublayerId,this.layerPopupEnabledAndHasTemplate&&!mb,oa.node.resources.attributes,Va,this.sublayerId);Za.objectAndLayerIdColor=this._stage.renderView.getObjectAndLayerIdColor({graphicUid:kb,layerUid:this.layerUid+"_"+this.sublayerId})}Za.externalColorMixMode=Fa[fb+4]&(1<=sb[3]?pa.Transparency.INVISIBLE:1<=sb[3]&&(oa.material.isOpaque||fb.colorMixMode===Ha.ColorMixModeEnum.Replace)?pa.Transparency.OPAQUE:pa.Transparency.TRANSPARENT;if(fb.edgeMaterial!==zb||vb!==Ab)Fb={...fb.edgeMaterial,opacity:yb,objectTransparency:vb},zb=fb.edgeMaterial, Ab=vb;oa.cachedEdgeMaterials[Hb]=Fb}else oa.cachedEdgeMaterials[Hb]=Ea.transparentEdgeMaterial;oa.cachedSymbology[Qb++]=Math.round(255*sb[0]);oa.cachedSymbology[Qb++]=Math.round(255*sb[1]);oa.cachedSymbology[Qb++]=Math.round(255*sb[2]);oa.cachedSymbology[Qb++]=Math.round(255*sb[3]);oa.cachedSymbology[Qb++]=fb.colorMixMode|+fb.castShadows<kb!==Ea.transparentEdgeMaterial),perFeatureEdgeMaterials:Fa};let Za=0,fb=!1;Fa=Fa.map((kb,mb)=>{if(oa.featureIds[mb]!==Va[Za])return Ea.transparentEdgeMaterial;fb=fb||kb!==Ea.transparentEdgeMaterial;Za++;return kb});return{hasEdges:fb,perFeatureEdgeMaterials:Fa}}_updateComponentData(oa){if(this._hasComponentData){var Fa=oa.objectHandle;oa=this._getComponentParameters(oa);this._collection.setComponentData(Fa,oa);this._stage.renderView.requestRender()}}_reloadAll(oa= this.elevationOffset){this._removeAllNodeDataFromStage(oa);null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(oa){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading();this._nodeId2Meta.forEach(Fa=>{null!=Fa&&(this._collection.updateMaterial(Fa.objectHandle,Va=>Va.objectOpacity=oa),eb(Fa.cachedEdgeMaterials,oa),this._updateEdgeRendering(Fa))})}_updateMaterial(oa){this._collection.updateMaterial(oa.objectHandle,Fa=>{Fa.commonMaterialParameters.hasSlicePlane= this.slicePlaneEnabled;Fa.usePBR=this._usePBR;this._updateMaterialOverlay(Fa)})}_updateMaterialOverlay(oa){}_updateEngineObject(oa){this._updateComponentData(oa);this._applyFiltersToNode(oa);this._addOrUpdateEdgeRendering(oa);this._visibleGeometryChanged(oa,pb.UPDATE)}_slicePlaneEnabledChange(oa){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=oa);null!=this._labeler&&(this._labeler.slicePlaneEnabled=oa);this._nodeId2Meta.forEach(Fa=>{null!=Fa&&(this._collection.updateMaterial(Fa.objectHandle, Va=>Va.commonMaterialParameters.hasSlicePlane=oa),this._updateEdgeRendering(Fa,!1))})}_updatePBR(oa){this._nodeId2Meta.forEach(Fa=>{null!=Fa&&this._collection.updateMaterial(Fa.objectHandle,Va=>Va.usePBR=oa)});this._hasLoadedPBRTextures=!0}get _usePBR(){return this._needsNormals&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(oa,Fa=!0){null!=this._edgeView&&this._edgeView.hasObject(oa.objectHandle)&&this._addOrUpdateEdgeRendering(oa,Fa)}_forAllNodes(oa){this._nodeId2Meta.forEach(oa)}_ignoreClientNodeOverriddenFeatures(oa){return this.i3sOverrides.hasGeometryChanges? (Fa,Va,Za)=>0<=Za.node.index&&this.i3sOverrides.featureHasGeometryChanges(Fa)?X.ForAllFeaturesReturnType.CONTINUE:oa(Fa,Va,Za):oa}_forAllFeatures(oa,Fa,Va){t.someMap(this._nodeId2Meta,Za=>{if(null==Za)return!1;if(null!=Fa)switch(Fa(Za)){case X.ForAllFeaturesReturnType.EXIT:return!0;case X.ForAllFeaturesReturnType.SKIP:return!1}let fb=X.ForAllFeaturesReturnType.CONTINUE;switch(Va){case X.ForAllFeaturesMode.ALL:fb=this._forAllFeaturesOfNode(Za,oa);break;case X.ForAllFeaturesMode.VISIBLE_ONLY:fb=this._forAllVisibleFeaturesOfNode(Za, oa);break;case X.ForAllFeaturesMode.QUERYABLE:fb=this._forAllQueryableFeaturesOfNode(Za,oa)}return fb===X.ForAllFeaturesReturnType.EXIT})}_forAllFeaturesOfNode(oa,Fa){let Va=X.ForAllFeaturesReturnType.CONTINUE;const Za=oa.featureIds;for(let fb=0;fb{Va= Fa(Za[fb],fb,oa);return Va===X.ForAllFeaturesReturnType.CONTINUE});return Va}_forAllQueryableFeaturesOfNode(oa,Fa){Fa=this._ignoreClientNodeOverriddenFeatures(Fa);if(null==this._renderClippingArea)return this._forAllFeaturesOfNode(oa,Fa);var Va=this._boundingRectNodeTest(oa,this._renderClippingArea);if(Va===Ea.MbsIntersectResult.OUTSIDE)return X.ForAllFeaturesReturnType.CONTINUE;if(Va===Ea.MbsIntersectResult.INSIDE)return this._forAllFeaturesOfNode(oa,Fa);Va=X.ForAllFeaturesReturnType.CONTINUE;const Za= oa.featureIds,fb=Ea.getClipRect(this._renderClippingArea,this._collection.getObjectTransform(oa.objectHandle));for(let kb=0;kbwa.attributeLookup(Fa,kb.attributes,Va));const {set:Za,handle:fb}=this._highlights.acquireSet();this._highlights.setFeatureIds(Za,oa);return fb}if("number"===typeof oa[0]){const {set:Fa, handle:Va}=this._highlights.acquireSet();this._highlights.setFeatureIds(Fa,oa);return Va}}return e.makeHandle()}resetHighlights(){w.destroyMaybe(this._highlights);this._highlights=new za({collection:this._collection,forAllFeatures:oa=>this._forAllFeatures(oa,null,X.ForAllFeaturesMode.ALL),forAllFeaturesOfNode:(oa,Fa)=>this._forAllFeaturesOfNode(oa,Fa)})}_visibleGeometryChanged(oa,Fa){if(this._elevationProvider){var Va=this.getNodeComponentObb(oa.node);Va&&this._elevationProvider.objectChanged(Va); null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=n.schedule(()=>{this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle=null}));this._updateSnappingSources(oa,Fa)}}get performanceInfo(){return new ka.I3SMeshViewPerformanceInfo(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/ 1048576),this._idbCacheEnabled?Math.round(100*this._idbCache.getHitRate()):0)}get test(){}getNodeOpacityByIndex(oa){oa=this._nodeId2Meta.get(oa);return this.getNodeOpacity(oa)}getNodeOpacity(oa){return null!=oa?this._collection.getMaterial(oa.objectHandle).objectOpacity:0}isNodeFullyFadedIn(oa){return this._crossfadeHelper.isNodeFullyFadedIn(oa)}getNodeCrossfadeMetaData(oa){return this._nodeId2Meta.get(oa)}markNodeToRemove(oa){this._controller&&this._controller.markNodeToRemove(oa)}removeMarkedNodes(){this._controller&& this._controller.removeMarkedNodes()}foreachCrossfadeNode(oa){this._nodeId2Meta.forEach(oa)}fadeNode(oa,Fa,Va){if(this.nodeCrossfadingEnabled){var Za=this._nodeId2Meta.get(oa);null!=Za&&this._crossfadeHelper.fadeNode(oa,Za,Fa,Va)}}setNodeOpacityByIndex(oa,Fa){oa=this._nodeId2Meta.get(oa);null!=oa&&this._setNodeOpacity(oa,Fa)}_setNodeOpacity(oa,Fa){this._collection.updateMaterial(oa.objectHandle,Va=>Va.objectOpacity=Fa);this._setNodeEdgeOpacity(oa,Fa)}_setNodeEdgeOpacity(oa,Fa){null!=this._edgeView&& oa.cachedEdgeMaterials&&(eb(oa.cachedEdgeMaterials,Fa),oa=oa.objectHandle,this._edgeView.hasObject(oa)&&this._edgeView.updateAllComponentOpacities(oa,Fa).catch(Va=>Ia(Va,this.i3slayer.title)))}get hasModifications(){return this._isIntegratedMesh&&null!=this._layerClippingArea||this._modifications&&0=Fa)&&!0===this._i3sWasmLoaded){Fa=this.uid;var Va=Xa(oa);if(Va){ja.filterObbsForModificationsSync({context:Fa, buffer:Va.buffer});const Za=new Float64Array(Va.buffer);oa.forAll((fb,kb)=>{kb=ja.interpretObbModificationResults(Za[kb]);fb.imModificationImpact=kb;kb!==Ga.NodeIMModificationImpact.Unmodified&&this._controller.invalidateGeometryVisibility(fb.index)})}}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||null!=this._labeler&&this._labeler.updating|| this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||0{Va=this._nodeId2Meta.get(Va);if(null==Va)throw Error("invalid-node");const {origin:kb,buffer:mb}=await this._collection.extractEdgeInformation(Va.objectHandle,Za,fb);this._snappingLocationsApplyElevation(Va,mb,kb);return{type:"components",objectIds:Va.featureIds, locations:mb,origin:kb}},remove:()=>h.removeUnordered(this._snappingSourcesTrackers,Fa)};this._snappingSourcesTrackers.push(Fa);this._nodeId2Meta.forEach((Va,Za)=>{null!=Va&&(Va=this._controller.getRenderMbs(Va.node))&&oa.add(Za,Va)});return Fa}_snappingLocationsApplyElevation(oa,Fa,Va){if(oa.elevationOffsets&&this.elevationInfo.mode!==X.ElevationMode.Absolute){var Za=Fa.position0,fb=Fa.position1;Fa=Fa.componentIndex;var kb=H.create(),mb=H.create(),rb=(tb,yb)=>{F.add(tb,tb,Va);this.view.renderCoordsHelper.worldUpAtPosition(tb, mb);F.add(tb,tb,F.scale(mb,mb,yb));F.subtract(tb,tb,Va)};for(let tb=0;tbg)return Number.MAX_VALUE;e=Math.abs(c*e)+Math.asin(d/g);return e>=Math.PI/2?Number.MAX_VALUE:d/Math.cos(e)}const h=q.create(),f=l.createEmptyProjectorCache(),c=b.deg2rad(1);a.projectBoundingSphere=function(e,g,d,t){if(null==g||null== t)return!1;g=l.populateProjectorCache(g,t,f);if(g.projector===l.copy3)return d[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],!0;if(null==g.projector)return!1;const {source:w,dest:v}=g;if(v.spatialReferenceId===l.ProjectionID.WEB_MERCATOR){g=l.projectionTable[w.spatialReferenceId][l.ProjectionID.WGS84];if(null==g)return!1;g(e,0,h,0);l.wgs84ToWebMercator(h,0,d,0);d[3]=k(h[1],e[2],e[3],p.earth.radius);return!0}if(w.spatialReferenceId!==l.ProjectionID.WGS84&&w.spatialReferenceId!==l.ProjectionID.CGCS2000||v.spatialReferenceId!== l.ProjectionID.PLATE_CARREE)g.projector(e,0,d,0),d[3]=e[3]*(w.metersPerUnit??1)/(v.metersPerUnit??1);else{t=l.projectionTable[l.ProjectionID.SPHERICAL_ECEF][l.ProjectionID.PLATE_CARREE];let m=e[3];null!=l.projectionTable[w.spatialReferenceId][l.ProjectionID.SPHERICAL_ECEF]&&null!=t&&(m=k(e[1],e[2],e[3],p.earth.radius));g.projector(e,0,d,0);d[3]=m}return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/UByteArray":function(){define(["exports","../../core/typedArrayUtil"], function(a,b){a.newUByteArray=function(q,l=!1){return q<=b.nativeArrayMaxSize?l?Array(q).fill(0):Array(q):new Uint8Array(q)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/controllers/I3SOnDemandController":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/Logger ../../../core/PooledArray ../../../core/Promise ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/projection/projectBoundingRect ../../../geometry/support/aaBoundingRect ../../support/PromiseQueue ../../../views/ViewingMode ../../../views/3d/layers/i3s/I3SClientNodeLoader ../../../views/3d/layers/i3s/I3SFrameTask ../../../views/3d/layers/i3s/I3SIndex ../../../views/3d/layers/i3s/I3SLodHandling ../../../views/3d/layers/i3s/I3SNode ../../../views/3d/layers/i3s/I3SNodeLoader ../../../views/3d/layers/i3s/I3SStreamDataController ../../../views/3d/layers/i3s/I3SUtil ../../../views/3d/layers/i3s/I3SViewportQueries ../../../views/3d/layers/support/I3SLayerView ../../../views/3d/support/extentUtils ../../../views/3d/support/index ../../../views/3d/support/MemoryController ../../../views/support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N){function E(K,J){return null!=K&&K.length===J.length&&K.every(R=>0<=G(J,R.name))}function G(K,J){J=J.toLowerCase();for(let R=0;R{if(!this.destroyed&&K&&!K.destroyed&&R){var {view:Q,clientGeometry:W}=K,{resourceController:S}=Q;this._setClippingArea(Q.clippingArea); this.addHandles([f.watch(()=>Q?.pointsOfInterest?.focus?.renderLocation,V=>this._pointOfInterestChanged(V),f.initial),f.watch(()=>Q.quality,()=>this._setCameraDirty(),f.sync),f.watch(()=>K.contentVisible,V=>{const T=V?()=>this._updateIdleState(!0):()=>this._updateViewData(),Y=V?()=>this._updateIdleState(!1):()=>{};V&&null!=this._index&&this._index.invalidateAllElevationRanges();this._idleStateCallbacks?(V||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=T,this._idleStateCallbacks.idleEnd= Y):this._idleStateCallbacks=S.scheduler.registerIdleStateCallbacks(T,Y)},f.initial),r.addCallback(K.view.resourceController.scheduler,this),f.watch(()=>K.uncompressedTextureDownsamplingEnabled,()=>this.restartNodeLoading()),f.watch(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty();this._stableFeatureLOD=!1}),f.watch(()=>Q.state?.contentCamera,()=>this._setCameraDirty()),f.watch(()=>J.elevationInfo,V=>this._elevationInfoChanged(V)),f.watch(()=>K.lodFactor,()=>this._setCameraDirty()), f.watch(()=>K.availableFields,()=>this._requiredFieldsChange()),f.watch(()=>K.holeFilling,V=>null!=this._index&&(this._index.holeFilling=V))]);this._viewportQueries=new B(this.crsIndex,Q.renderCoordsHelper,Q.state.contentCamera,!Q.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?Q.basemapTerrain:Q.elevationProvider,v.viewingModeFromString(Q.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod, angleDependentLoD:.5>this._lod});this._clientNodeLoader=new m.I3SClientNodeLoader(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:Q.renderCoordsHelper.spatialReference,localMode:"local"===Q.viewingMode},Q.resourceController.memoryController,this.worker);this._index=new n.I3SIndex(v.viewingModeFromString(Q.viewingMode),J,R,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,l.getLogger(this),K.holeFilling,V=>K.isNodeLoaded(V),V=>K.isNodeReloading(V),V=>this._shouldLoadNode(V), V=>this._enableFromGPUCache(V,x.NodeState.Leaf),V=>this._needsUpdate(V),()=>!this.indexStreamController.busy,V=>K.computeVisibilityObb?.(V)??null,K?.computeNodeFiltering?V=>K.computeNodeFiltering(V):void 0);this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D);this._index.imModificationsChanged(!!K.hasModifications);this._index.layerFilterChanged(!!K.hasGeometryFilter);if(null!=W){for(const V of W)this._addMesh(V.mesh,V.oid);this.addHandles(W.on("change", V=>{for(const T of V.removed)this._removeMesh(T.oid);for(const T of V.added)this._addMesh(T.mesh,T.oid)}))}this._startNodeLoading()}}))}updateNodeModificationStatus(K){const J=this._index,R=this.layerView;null!=J&&R?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),K.forAll(Q=>{Q=J.getNode(Q);null!=Q&&this._modificationsNodeFilteringArray.push(Q)}),R.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(); this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null);this._nodeLoader=null;I.prune();null!=O&&(O.hide(),O=null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const K=this._attributeStorageInfo,J=this._fields,R=this.layer.objectIdField;return this.layerView.availableFields.map(Q=>{const W=G(K,Q);Q=G(J,Q);return 0<=W&&0<=Q? {index:W,name:J[Q].name,field:J[Q],attributeStorageInfo:K[W]}:null}).filter(Q=>null!=Q&&Q.name!==R)}_requiredFieldsChange(){const K=this._getRequiredAttributes();E(this._requiredAttributes,K)||(this._requiredAttributes=K,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0;this.restartNodeLoading()}_setClippingArea(K){const J=t.create();D.toBoundingRect(K,J,this.layerView.view.renderSpatialReference)?this._clippingArea=J:this._clippingArea=null}_pointOfInterestChanged(K){null!= this._viewportQueries&&(this._viewportQueries.setPointOfInterest(K),null!=this._index&&(this._index.progressiveLoadPenalty=L.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(K){this._setClippingArea(K);null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache());this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0;this._lodHandling.setLodGlobalDirty(); this._evaluateUpdating()}_addMesh(K,J){null!=this._index&&(K=this._clientNodeLoader.createMeshNodeInfo(K,J),J=this._index.addClientNodeToIndex(K.id,K.mbs),this._clientNodeLoader.addMeshNode(J,K),this._evaluateUpdating(),this.notifyChange("rootNodeVisible"))}_removeMesh(K){K=this._clientNodeLoader.getMeshNodeIndex(K);if(null!=K)if(null!=this._index)this._index.removeClientNodeFromIndex(K,(J,R)=>{this.layerView.removeNode(R);this._clientNodeLoader.removeNode(J);this.layerView.deleteCachedNodeData&& null!=J&&this.layerView.deleteCachedNodeData(J);this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(R))},(J,R,Q)=>{this._clientNodeLoader.updateNodeIndex(J,R,Q);this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(R,Q)}),this.notifyChange("rootNodeVisible");else throw Error("delayed removal of client side i3s node geometry not supported yet.");}updateElevationChanged(K,J){const R=this._index;if(null==R?.rootNode||null==J)return null;this.crsIndex.equals(J)||(d.projectBoundingRect(K, J,P,this.crsIndex),K=P);const Q=this._elevationUpdateNodes;Q.clear();A.findIntersectingNodes(K,R.rootNode,R,W=>Q.push(W.index));Q.length&&(Q.forAll(W=>R.updateElevationChanged(W)),this._setCameraDirty());return Q}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(K){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(K):null}_elevationInfoChanged(K){null!=this._index&&(this._index.updateElevationInfo(K,this.isMeshPyramid||this.isGraphics3D), this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0;this.cancelNodeLoading();this._evaluateUpdating()}schedule(K,J){return this._idleQueue.push(K,J)}reschedule(K,J){return this._idleQueue.unshift(K,J)}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(K,J){return 0>K.index?this._clientNodeLoader.loadNodeData(K.id, J):this._nodeLoader.loadNodeData(K,J)}async _loadAttributes(K,J,R){return(0>K.index?this._clientNodeLoader:this._nodeLoader).loadAttributes(K,J,R)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(K){this._disableMemCache=this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?K:!0}runTask(K,J){if(!this.layerView.contentVisible)return this._updateViewData(),this._evaluateUpdating(),-Infinity;if(!this.layerView.visible||null==this._index)return-Infinity; this._processWithErrorLogging(K,J);return this._index.maxPriority}_processWithErrorLogging(K,J){try{this._process(K,J)}catch(R){50>this._errorCount?l.getLogger(this).error(`Error during processing: ${R} at ${R.stack}`):50===this._errorCount&&l.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(K,J){this._restartNodeLoading&&this._startNodeLoading();null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&& this._removeInvisibleNodes(K)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(K.enabled=!1),K.run(()=>this._processIndex(K)),this._updateFeatureLOD(),K.run(()=>this._processCache(K)),this._isIntegratedMesh&&(K.enabled=!0),K.run(()=>this._processNodes(K,J)),this._idleQueue.runTask(K),K.run(()=>this._prefetchIndex()),J.numIndexLoading+=this._index.indexLoading,J.numNodesLoading+=this._downloadingCount,K.run(()=>this._lodHandling.lodGlobalHandling(K)),this._evaluateUpdating())}_processIndex(K){if(null== this._index)return!1;this._index.dirty&&(this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),K,J=>this.updateNodeModificationStatus(J)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length)),K=this._index.featureEstimate.leavesReached,this._index.isLoading||K===this._get("leavesReached")||this._set("leavesReached", K));return this._index.load()}_prefetchIndex(){return null==this._index||0=this._featureLOD)return;this._featureLOD/=1.5;this._stableFeatureLOD=!1}else if(K&& R.estimate1.2*J||K&&R.estimate>J){if(1E-4>=this._featureLOD)return;this._featureLOD/=1+.25*(R.estimate/J-1);this._stableFeatureLOD=!1}else return;this._featureLOD=Math.min(1E4,Math.max(1E-4,this._featureLOD));this._viewportQueries.updateScreenSpaceErrorBias(this._lod); this._index.requestUpdate()}}_processCache(K){const J=this._index;if(null==J)return!1;for(;0 K.abort());this._loadingNodes.clear();this._updatingNodes.forEach(K=>K.abort());this._updatingNodes.clear()}_cancelNode(K){const J=this._loadingNodes.get(K);J&&(J.abort(),this._loadingNodes.delete(K))}_hasNodeLoadToken(K){return!this._isIdle&&2<=K.numNodesLoading+this._loadingNodes.size?!1:this._downloadingCountthis.layerView.view.quality?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const K=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(0(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*J}_startNodeLoading(){this._restartNodeLoading=!1;const K=this._index;if(!this._updatesDisabled&&null!=K&&null!=this._viewportQueries){this._updateViewData(); this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);var J={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new y(this.layer,this.dataStreamController,l.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes, J);K.requestUpdate();this._lodHandling.startNodeLoading((R,Q)=>this._removeNodes(R,Q,M.fadeout),K,{maxLodLevel:this._viewportQueries.maxLodLevel});this._evaluateUpdating()}}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(K){const J=this._index; if(null==J||null==this._viewportQueries)return!1;I.clear();this.layerView.getLoadedNodeIndices(I);const R=0===this._viewportQueries.maxDistance,Q=R?()=>!1:W=>this._shouldDropNode(W);I.filterInPlace(W=>{const S=J.getNode(W);return null==S||!J.isGeometryVisible(W)||Q(S)});0this._lodDropFactor)return!1;if(0===I.length)return!0;I.clear();return!1}markNodeToRemove(K){I.push(K)}removeMarkedNodes(){this._removeNodes(I, N.noBudget,M.pop)}_removeNodes(K,J,R){if(0!==K.length&&!J.done)for(null!=this._index&&this._index.requestUpdate();0this.layerView.updateAttributes(K.index,{loadedAttributes:this._requiredAttributes,attributeData:Q},J.signal),J.signal)}catch(R){if(!h.isAbortError(R))return this.layerView.updateAttributes(K.index, {loadedAttributes:this._requiredAttributes,attributeData:{}},J.signal)}this._updatingNodes.delete(K.index);this._evaluateUpdating()}_loadNode(K){if(this._loadingNodes.has(K.index))l.getLogger(this).error("already loading node "+K.index);else{var J=new AbortController;this._loadingNodes.set(K.index,J);this._evaluateUpdating();this._loadAndAddNode(K,J.signal).then(R=>{R&&null!=this._index&&this._loadingNodes.get(K.index)===J&&(this._loadingNodes.delete(K.index),this._index.requestUpdate())}).catch(R=> {if(!h.isAbortError(R))throw R;}).finally(()=>{this._loadingNodes.get(K.index)===J&&this._loadingNodes.delete(K.index);this._evaluateUpdating()})}}_loadAndAddNode(K,J){return K.cacheState===x.CacheState.Uncached?this._loadUncached(K,J).then(()=>!1):this._loadCached(K,J).then(R=>{if(R)return!1;K.cacheState=x.CacheState.Uncached;return!0}).catch(R=>h.isAbortError(R)?!1:(K.cacheState=x.CacheState.Uncached,!0))}_enableFromGPUCache(K,J){if(this._disableMemCache||null==this._index)return!1;if(J===x.NodeState.Hole&& !this._index.useNodeAsHole(K.index))return!0;const R=this._loadCachedGPUData(K);if(!R)return!1;this.layerView.addCachedGPUData(K,R,J);this._nodeAdded();return!0}_loadCachedGPUData(K){K=this.layerView.loadCachedGPUData(K.index);if(null!=K?.attributeInfo&&E(K.attributeInfo.loadedAttributes,this._requiredAttributes))return K;this.layerView.deleteCachedGPUData(K);return null}_nodeAdded(){null!=this._index&&this._index.requestUpdate();this._lodHandling.setLodGlobalDirty();this._evaluateUpdating()}updateLoadStatus(K, J){const R=this._index;null!=R&&R.updateChildrenLoaded(K,J?1:-1)}async _loadCached(K,J){if(this._enableFromGPUCache(K,x.NodeState.Leaf))return!0;const R=this.layerView;if(this.disableIDBCache||!R.loadCachedNodeData||!R.addCachedNodeData)return!1;const Q=(ha,ba)=>this._nodeLoader.loadTextures(K,ha,ba),W=(ha,ba)=>this._clientNodeLoader.loadTextures(K,ha,ba),S=0<=K.index?Q:W,V=await this.schedule(()=>R.loadCachedNodeData(K,J,S),J);if(null==V)return!1;const T=this._requiredAttributes,Y=await this.reschedule(()=> this._loadAttributes(K,T,J),J);await this.reschedule(()=>R.addCachedNodeData(K,V,{loadedAttributes:T,attributeData:Y},J),J);this._nodeAdded();return!0}_loadUncached(K,J){this._downloadingCount++;return this._loadNodeData(K,J).catch(R=>{this._downloadingCount--;throw R;}).then(R=>{this._downloadingCount--;return this.schedule(()=>this.layerView.addNode(K,R,J),J)}).then(()=>{this._nodeAdded();K.cacheState=x.CacheState.Cached}).catch(R=>{if(!h.isAbortError(R))throw l.getLogger(this).error("#loadNodeData()", this.layer,`Failed to load node '${K.id}'`,R),K.failed=!0,null!=this._index&&this._index.requestUpdate(),R;})}_updateIdleState(K){K!==this._isIdle&&(this._isIdle=K,this._evaluateUpdating(),K&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty();this._evaluateUpdating();null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(K){const J=this._index;null!=J&&J.layerFilterChanged(K);this._setCameraDirty()}};a.__decorate([c.property({readOnly:!0})], b.prototype,"isMeshPyramid",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"isGraphics3D",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"useMaximumNumberOfFeatures",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"indexStreamController",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"dataStreamController",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"crsVertex",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"crsIndex",null); a.__decorate([c.property()],b.prototype,"screenSizeFactor",void 0);a.__decorate([c.property()],b.prototype,"featureTarget",void 0);a.__decorate([c.property()],b.prototype,"fixedFeatureTarget",void 0);a.__decorate([c.property()],b.prototype,"layerView",void 0);a.__decorate([c.property()],b.prototype,"layer",null);a.__decorate([c.property()],b.prototype,"updating",void 0);a.__decorate([c.property({readOnly:!0})],b.prototype,"running",null);a.__decorate([c.property()],b.prototype,"updatingProgress", void 0);a.__decorate([c.property({readOnly:!0})],b.prototype,"leavesReached",void 0);a.__decorate([c.property({constructOnly:!0})],b.prototype,"worker",void 0);a.__decorate([c.property({readOnly:!0,dependsOn:[]})],b.prototype,"rootNodeVisible",null);b=a.__decorate([g.subclass("esri.layers.graphics.controllers.I3SOnDemandController")],b);const I=new p({deallocator:null});let O;const L={factorIM:.2,factor3dObject:.05,distancePenalty:10},P=t.create();var M;(function(K){K[K.pop=0]="pop";K[K.fadeout=1]= "fadeout"})(M||={});return b})},"esri/views/3d/layers/i3s/I3SClientNodeLoader":function(){define("exports ../../../../core/Error ../../../../core/maybe ../../../../core/MemCache ../../../../core/promiseUtils ../../../../core/uuid ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/support/meshVertexSpaceUtils ../../../../chunks/sphere ./I3SClientMaterialUtil".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){async function v(x){return{id:x.id,version:x.meshNodeInfo.version,mbs:x.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}function m(x,y){var {spatialReference:z}=x;const A=[1,-1],B=[.5*x.width,.5*x.height,x.hasZ?.5*(x.zmax-x.zmin):0];z=z.isGeographic?z.metersPerUnit:1;const C=x.center;let D=0;if(x.hasZ)for(x=0;2>x;++x)for(var F=0;2>F;++F)for(var H=0;2>H;++H){var N=(C.x+A[x]*B[0]-y.x)*z;const E=(C.y+ A[F]*B[1]-y.y)*z,G=C.z+A[H]*B[2]-y.z;D=Math.max(N*N+E*E+G*G,D)}else for(x=0;2>x;++x)for(F=0;2>F;++F)H=(C.x+A[x]*B[0]-y.x)*z,N=(C.y+A[F]*B[1]-y.y)*z,D=Math.max(H*H+N*N,D);return t.fromCenterAndRadius([y.x,y.y,y.z],Math.sqrt(D))}async function r(x,y,z,A){const {transform:B,vertexAttributes:C}=y.loadedMesh;x="source"===x.shading?C.normal:null;if(null==x||null==B||0===B.rotationAngle&&c.exactEquals(B.scale,e.ONES))return{transformed:x,original:C.normal};if(!y.normalsTransformPromise){q.assertIsSome(z, "SceneLayerWorker is needed to transform mesh normals");const D=f.create();h.normalFromMat4(D,B.localMatrix);y.normalsTransformPromise=z.transformNormals({normalMatrix:D,normals:x},A)}return y.normalsTransformPromise}function n(x,y,z){x[y]=255&z;x[y+1]=255&z>>8;x[y+2]=255&z>>16;x[y+3]=255&z>>24}class u{constructor(x,y,z,A){this._uid=x;this._worker=A;this._id2Meta=new Map;this._oid2Meta=new Map;this._indexSR=y.indexSR;this._vertexSR=y.vertexSR;this._renderSR=y.renderSR;this._localMode=y.localMode; this._memCache=z.newCache(`sl-client-mesh-data-${this._uid}`)}get uid(){return this._uid}get worker(){return this._worker}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(x,y){const z=`mesh${y}`;var A=x.extent,B=A.spatialReference,C=this._indexSR;A=m(A,x.origin);g.projectBoundingSphere(A,B,A,C);C=x.metadata.displaySource?.source;if(null==C||!Array.isArray(C)||!C.length||C[0]instanceof File)B=k.generateUUID();else{B="";for(var D of C)B+=D.makeHash();D=JSON.stringify(x.transform?.toJSON()?? "");C=d.isRelativeVertexSpace(x.vertexSpace)?JSON.stringify(x.vertexSpace.origin):"";var F=JSON.stringify(x.spatialReference);B=B+D+C+F}return{type:"mesh",id:z,version:B,oid:y,mbs:A,componentNodeIds:[],unloadedMesh:x,nodeIndex:null,loadMeshPromise:null}}addMeshNode(x,y){if(null!=this.getMeshNodeIndex(y.oid))throw new b(`I3SClientNodeLoader: client side mesh for feature oid=${y.oid} already exists`);y.nodeIndex=x;this._id2Meta.set(y.id,y);this._oid2Meta.set(y.oid,y)}getMeshNodeIndex(x){x=this._oid2Meta.get(x); return null==x||"mesh"!==x.type?null:x.nodeIndex}getMeshNodeInfo(x){const y=this._oid2Meta.values();for(const z of y)if("mesh"===z.type&&z.id===x)return z;return null}removeNode(x){const y=this._id2Meta.get(x);null!=y&&(this._id2Meta.delete(x),"mesh"===y.type&&this._oid2Meta.delete(y.oid))}async loadNodeJSON(x){const y=this._id2Meta.get(x);if(null==y)throw new b(`I3SClientNodeLoader::loadNodeJSON unable to find node ${x}`);switch(y.type){case "mesh":return this._loadMeshNodeJSON(y);case "mesh-component":return v(y); default:throw new b(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${x}`);}}async _loadMeshNodeJSON(x){const y=x.id;var z=(await this._getMeshData(x)).loadedMesh;if(null==z.components||0===z.components.length)return{id:y,version:null,mbs:x.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const A=[];z=z.components;for(let B=0;Bfa;++fa){var Z=y[ka+fa],ca=3*Z,ea=9*Q+3*fa;J[ea]=O[ca];J[ea+1]=O[ca+1];J[ea+2]=O[ca+2];null!=W&&(W[ea]=M[ca],W[ea+1]=M[ca+1],W[ea+2]=M[ca+2]);null!=V&&(ca=2*Z,ea=6*Q+2*fa,V[ea]=B[ca],V[ea+1]=B[ca+1]);null!=Y&&(Z*=4,ca=12*Q+4*fa,Y[ca]=C[Z],Y[ca+1]=C[Z+1],Y[ca+2]=C[Z+2],Y[ca+3]=C[Z+3])}}n(U,ha,A);n(U,ha+4,A/2**32);n(U,ba,0);n(U,ba+4,x-1);const {geometryBuffer:da,geometryDescriptor:ia}={geometryBuffer:R,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:T, normal:N,uv0:S,uvRegion:!1,featureIndex:!0}};return{geometryData:{featureDataPosition:P,featureIds:[],geometries:[z]},attributeDataInfo:{attributeData:{},loadedAttributes:[]},geometryBuffer:da,geometryDescriptor:ia,requiredTextures:F,textureData:H,normalReferenceFrame:this._vertexSR.isGeographic?"east-north-up":"vertex-reference-frame"}}async loadAttributes(x,y,z){x=x.numFeatures;z={};for(const {field:{name:A}}of y)z[A]=Array(x);return z}async loadTextures(x,y,z){z=this._id2Meta.get(x.id);if(null== z||"mesh-component"!==z.type)throw Error(`Failed to load textures for node ${x.id} (unexpected node info)`);x=[];for(const A of y)x.push(z.textureData.get(A.id)||null);return x}async _getMeshData(x){const y=x.version,z=this._memCache.get(y);if(null==z){if(null!=x.loadMeshPromise)return x.loadMeshPromise;const A=async(B,C)=>{var D=x.unloadedMesh.clone();try{await D.load()}catch(F){C(F)}C=D.memoryUsage;D={loadedMesh:D,projectionPromise:null,normalsTransformPromise:null,usedMemoryInBytes:C};this._memCache.put(y, D,C,l.MinPriority);x.loadMeshPromise=null;B(D)};x.loadMeshPromise=new Promise((B,C)=>A(B,C));return x.loadMeshPromise}return z}}a.I3SClientNodeLoader=u;a.createSphereFromExtent=m;a.sizeOfFloat32=4;a.sizeOfInt32=4;a.sizeOfUInt64=8;a.sizeOfUInt8=1;a.transformNormals=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SClientMaterialUtil":function(){define("exports ../../../../Color ../../../../core/Error ../../../../support/requestUtils ../../glTF/internal/resourceUtils ./enums ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/textureUtils ../../webgl-engine/materials/pbrUtils".split(" "), function(a,b,q,l,p,k,h,f,c){async function e(g,d,t,w){if(null==g)return-1;const v=t.length;var m=g.data;g=g.url;if(null!=m){if(m instanceof HTMLImageElement||m instanceof HTMLCanvasElement)return m=f.downsampleImage(m),t.push({id:v,usage:w,data:m,encoding:k.TextureEncoding.PNG,downsampled:!1}),d.push({id:v,usage:w,encodings:[{name:void 0,encoding:k.TextureEncoding.PNG}]}),v;if(!(m instanceof HTMLVideoElement)){if(m instanceof ImageData)throw new q("ImageData textures not supported yet for client side I3S nodes"); if(m instanceof p.EncodedMeshTexture)throw new q("EncodedMeshTexture textures not supported yet for client side I3S nodes");}}else if(null!=g)return m=new Image,m.src=g,m=await l.loadImageAsync(m,m.src,!1,void 0),m=f.downsampleImage(m),t.push({id:v,usage:w,data:m,encoding:k.TextureEncoding.PNG,downsampled:!1}),d.push({id:v,usage:w,encodings:[{name:void 0,encoding:k.TextureEncoding.PNG}]}),v;return-1}a.convertMeshMaterialToPBRMaterial=async function(g){const d=[],t=[];if(null==g)return{material:{alphaMode:"opaque", alphaCutoff:.1,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[1,1,1,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6000000238418579},wrapTextures:!1,hasParametersFromSource:!0},requiredTextures:d,textureData:t};const w=g.hasOwnProperty("metallicRoughnessTexture");"auto"===g.alphaMode&&console.warn('alphaMode "auto" not supported by I3S PBRMaterial - defaulting to "blend".'); const v=c.useSchematicPBR({normalTexture:g.normalTexture,emissiveTexture:w?g.emissiveTexture:null,emissiveFactor:w?b.toUnitRGB(g.emissiveColor):null,occlusionTexture:w?g.occlusionTexture:null,metallicRoughnessTexture:w?g.metallicRoughnessTexture:null,metallicFactor:w?g.metallic:null,roughnessFactor:w?g.roughness:null}),m=v?c.defaultSchematicMRRFactors[0]:w?g.metallic:0,r=v?c.defaultSchematicMRRFactors[1]:w?g.roughness:0;return{material:{alphaMode:"auto"===g.alphaMode?"blend":g.alphaMode,alphaCutoff:g.alphaCutoff, doubleSided:g.doubleSided,cullFace:g.doubleSided?h.CullFaceOptions.None:h.CullFaceOptions.Back,normalTextureId:await e(g.normalTexture,d,t,k.TextureUsage.Normal),emissiveTextureId:w?await e(g.emissiveTexture,d,t,k.TextureUsage.Emissive):-1,occlusionTextureId:w?await e(g.occlusionTexture,d,t,k.TextureUsage.Occlusion):-1,emissiveFactor:w&&null!=g.emissiveColor?b.toUnitRGB(g.emissiveColor):[0,0,0],metallicRoughness:{baseColorFactor:null!=g.color?b.toUnitRGBA(g.color):[1,1,1,1],baseColorTextureId:await e(g.colorTexture, d,t,k.TextureUsage.Color),metallicRoughnessTextureId:w?await e(g.metallicRoughnessTexture,d,t,k.TextureUsage.MetallicRoughness):-1,metallicFactor:m,roughnessFactor:r},wrapTextures:!0,hasParametersFromSource:v},requiredTextures:d,textureData:t}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/enums":function(){define(["exports"],function(a){a.TextureEncoding=void 0;(function(b){b[b.KTX2=1]="KTX2";b[b.Basis=2]="Basis";b[b.DDS_S3TC=4]="DDS_S3TC";b[b.PNG=8]="PNG"; b[b.JPG=16]="JPG";b[b.KTX_ETC2=32]="KTX_ETC2"})(a.TextureEncoding||(a.TextureEncoding={}));a.TextureUsage=void 0;(function(b){b[b.None=0]="None";b[b.Color=1]="Color";b[b.MetallicRoughness=2]="MetallicRoughness";b[b.Normal=4]="Normal";b[b.Occlusion=8]="Occlusion";b[b.Emissive=16]="Emissive";b[b.AlphaMask=32]="AlphaMask";b[b.ColorTextures=19]="ColorTextures";b[b.GeometryTextures=36]="GeometryTextures";b[b.GeometryTexturesPBR=44]="GeometryTexturesPBR";b[b.AllTextures=37]="AllTextures";b[b.AllTexturesPBR= 63]="AllTexturesPBR"})(a.TextureUsage||(a.TextureUsage={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SFrameTask":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/handleUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/accessorSupport/decorators/subclass ../../../support/Scheduler".split(" "),function(a, b,q,l,p,k,h,f,c,e){let g=class extends q{constructor(){super();this.referenceCount=0;this.callbacks=[];this.runIndex=0}get running(){return this.callbacks.some(w=>w.running)}runTask(w){this._sort();const v=this.callbacks,m={numIndexLoading:0,numNodesLoading:0};for(let r=0;r{null!=m&&(m.task.remove(v),0E?-1:0E?-E-1:0===G?E:E%G}function v(E,G,I){return-1===G?-(E+1):0===I?E:G*I+E}function m(E){if(E)for(let G=0;Gha;this._isEditable=!1;this._urlPrefix="";this._loadingNodes=new Set;this._loadingPages=new Set;this._failedNodes=new Set; this._failedPages=new Set;this._indexMissing=1;this._maxUnloadedPrio=Number.NEGATIVE_INFINITY;this._maxProcessingPrio=Number.POSITIVE_INFINITY;this._version=c.addWraparound(0,2);this._visibilityCacheVersion=c.addWraparound(0,2);this._maxLevel=1;this._featureEstimate={estimate:0,leavesReached:!1};this._unloadedMemoryEstimate=0;this._missingPagesAndNodes=new q({deallocator:null});this._prefetchNodes=new q({deallocator:null});this._updates=new z(this._missingPagesAndNodes);this._imModificationUncategorized= new q({deallocator:null});this.ignoreServiceObb=!1;this.progressiveLoadPenalty=0;this._pageQueue=[];this._newPages=[];this._layerHasFilter=this.layerHasModifications=this.needNodeElevationRange=!1;this._frameNumber=0;this._traverseDescendantsQueue=[0];this._traverseDescendantsNestingLevel=0;this._isEditable=h.i3sPatchingEnabled()&&null!=G.associatedLayer?.infoFor3D;G.serviceUpdateTimeStamp?.lastUpdate&&(this._lastUpdate=`${G.serviceUpdateTimeStamp.lastUpdate}`);this._maxLodLevel=this._viewportQueries? this._viewportQueries.maxLodLevel:1;this._init(I)}_init(E){if("page"===E.type){var G=E.rootPage;this._urlPrefix=E.urlPrefix;this._pageSize=E.pageSize;switch(E.lodMetric){case "maxScreenThreshold":this._lodMetric=f.LodMetric.MaxScreenThreshold;break;case "maxScreenThresholdSQ":this._lodMetric=f.LodMetric.MaxScreenThreshold,this._lodConversion=r}if(this._isEditable){this._rootIndex=-1;var I=w(E.rootIndex,E.pageSize);I=G.nodes[I];I={nodes:[{index:this._rootIndex,children:[E.rootIndex],mesh:void 0,obb:I.obb, lodThreshold:I.lodThreshold}]};this._addPage(t(this._rootIndex,this._pageSize),I);this.getNode(-1).serviceObbInIndexSR=void 0}else this._rootIndex=E.rootIndex;this._addPage(t(E.rootIndex,this._pageSize),G);this._updateParentsAndLevel()}else"node"===E.type&&(this._urlPrefix=E.urlPrefix,G=new u,this._nodePages.set(0,G),this._isEditable?(this._clientNodePage=new u,G={id:"-1",version:null,mbs:E.rootNode.mbs,obb:E.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root", href:"../root",mbs:E.rootNode.mbs,obb:E.rootNode.obb}]},this._rootIndex=this._makeClientRefNode(new f.NodeBase(G.id,null),-1),(G=this._validateNode(G.id,G))&&this._addNode(G,this._rootIndex)):this._rootIndex=this._makeRefNode(new f.NodeBase(E.rootNode.id,null),-1),(E=this._validateNode(E.rootNode.id,E.rootNode))&&this._addNode(E,0))}addClientNodeToIndex(E,G){E=new f.NodeBase(E,G);E=this._makeClientRefNode(E,-1);this._linkChildToParentNode(-1,E);this.requestUpdate();return E}removeClientNodeFromIndex(E, G,I){this._destroyClientRefNode(E,G,I);this.requestUpdate()}_loadPage(E){this._loadingPages.add(E);this._streamDataController.request(this._urlPrefix+E,"json").then(G=>{this._pageQueue.push({pageIndex:E,page:G})}).catch(G=>{this._loadingPages.delete(E);l.isAbortError(G)||(this._failedPages.add(E),this._logger.error("#loadPage()",this._layer,`Error when loading page ${E}`,G))})}_addQueuedPages(E){for(;0{for(G=G.parent;null!=G&&G!==this._rootIndex;){const I=this.getNode(G);I&&!Number.isNaN(I?.elevationRangeMin)&&(I.invalidateElevationRange(),this.invalidateBoundingVolumeCache(G));G=this.getParentIndex(G)}})}_addPage(E, G){const I=[],O=[];G=G.nodes.map((L,P)=>{const M=I.length,K=L.children?L.children.length:0;O.push(this._rootIndex);for(var J=0;J{var P=this._getPage(I);if(null!=P){const M=w(I,this._pageSize);P=P.nodes[M];P.parent=null!=O?O:-1;O=P.node;null!=O&&(O.level=L,E.push(I))}};for(G(this._rootIndex,null,0);E.length;){const I=E.pop(),O=this.getNode(I);if(null!=O)for(let L=0;LE?this._clientNodePage: this._nodePages.get(E)}_getNodeInternal(E){const G=this._getPage(E);if(null==G)return null;G.lastTraversed=this._frameNumber;return G.nodes[w(E,this._pageSize)]}_addNode(E,G){E.children&&this.populateChildren(G,E.children);var I=this.getParent(G);const O=null!=I?I.level+1:0;this._maxLevel=Math.max(this._maxLevel,E.children?O+1:O);const {lodMetric:L,maxError:P}=m(E.lodSelection);I=this._getNodeInternal(G);G=new f.Node(E.id,G,E.mbs,I.childCount,O,E.resources,E.version,L,P,E.numFeatures);I.node=G;E.obb&& (G.serviceObbInIndexSR=d.Obb.fromJSON(E.obb));G.visibilityObbInRenderSR=this._computeVisibilityObb(G);I=I.ref;null!=I&&(null==I.serviceMbsInIndexSR&&(I.serviceMbsInIndexSR=E.mbs),G.shareServiceBVsInRenderSRWith(I),I.visibilityObbInRenderSR=G.visibilityObbInRenderSR);return G}_makeRefNode(E,G){const I=this._nodePages.get(0);if(-1>G)return this._makeClientRefNode(E,G);if(null==I)return-1;const O=I.nodes.length,L=new n(0,0,c.addWraparound(this._visibilityCacheVersion,-2),E,null);I.nodes.push(L);L.parent= G;E.invalidateServiceBVsInRenderSR();return O}_makeClientRefNode(E,G){const I=this._clientNodePage;if(null==I)return-1;if(0<=G)throw Error("I3SIndex::client side nodes can not be made children of service side nodes.");const O=-(I.nodes.length+1),L=new n(0,0,c.addWraparound(this._visibilityCacheVersion,-2),E,null);I.nodes.push(L);L.parent=G;E.invalidateServiceBVsInRenderSR();return O}_linkChildToParentNode(E,G){const I=this._clientNodePage;if(!(null==I||0<=E)){var O=w(E,this._pageSize),L=w(G,this._pageSize); O=I.nodes[O];var P=O.childOffset;I.children.splice(O.childOffset+O.childCount,0,G);O.childCount+=1;null!=O.node&&(O.node.childCount+=1);for(const M of I.nodes)M.childOffset>P&&(M.childOffset+=1);I.nodes[L].parent=E;this._updateParentBoundingInformation(E)}}_destroyClientRefNode(E,G,I){const O=this._clientNodePage;if(null!=O){var L=this.getParentIndex(E);if(null!=L){var P=new Set,M=new Map,K=ha=>{var ba=w(ha,this._pageSize);ba=O.nodes[ba];if(0-1),Q=[],W=[];for(var S=0;S{null!=I.node&&I.node.id===E? G=O:null!=I.ref&&I.ref.id===E&&(G=O)});return G}getNodeById(E){E=this.getIndexById(E);return null!=E&&0<=E?this.getNode(E):null}getChildIndex(E,G){const I=this._getPage(E);if(null==I)return-1;E=I.nodes[w(E,this._pageSize)];return I.children[E.childOffset+G]}getParentIndex(E){const G=this._getPage(E);return null!=G&&E!==this._rootIndex?G.nodes[w(E,this._pageSize)].parent:null}getParent(E){E=this.getParentIndex(E);return null!=E?this.getNode(E):null}isLeaf(E){E=this._getNodeInternal(E);return null!= E&&0===E.childCount}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(E=>{null!=E.node&&(E.node.geometryObbInRenderSR=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=c.addWraparound(this._visibilityCacheVersion,2)}invalidateNodeVisibilityCache(E){E=this._getNodeInternal(E);null!=E&&this.invalidateNodeVisibilityCacheInternal(E)}invalidateNodeVisibilityCacheInternal(E){E.visibilityCache=c.addWraparound(this._visibilityCacheVersion, -2)}invalidateBoundingVolumeCache(E){E=this._getNodeInternal(E);null!=E&&(E?.invalidateBounds(),this.invalidateNodeVisibilityCacheInternal(E))}updateElevationChanged(E){const G=this._getNodeInternal(E);null!=G&&(this.needNodeElevationRange?(E=null!=G.node?G.node:G.ref,null!=E&&E.invalidateElevationRange()):this.invalidateBoundingVolumeCache(E))}invalidateGeometryVisibility(E){if(E=this._getNodeInternal(E)?.node)E.geometryObbInRenderSR=null,E.invalidateServiceBVsInRenderSR()}invalidateVisibilityObbs(){null!= this.rootNode&&this.traverse(this.rootNode,E=>{E.visibilityObbInRenderSR=this._computeVisibilityObb(E);E.geometryObbInRenderSR=null;return!0})}_isElevationRangeUpToDate(E){return this.needNodeElevationRange?(E=E?.node??E?.ref)?E.elevationRangeValid:!0:!0}updateElevationRange(E){this._updateElevationRangeInternal(E,null)}_updateElevationRangeInternal(E,G){const I=this._getNodeInternal(E);if(!I)return!1;const O=I?.node??I?.ref;if(!O)return!1;if(O.elevationRangeValid)return G?.expandElevationRange(O), !0;const L=new g.ElevationRange;var P=!1;for(let K=0;K=I.delta*I.coverage;G.useAsHole=this._version+(E?1:0);return E}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.add.prune();this._updates.update.prune()}requestUpdate(){this._dirty=!0;this._indexMissing=1;this._version=c.addWraparound(this._version,2)}imModificationsChanged(E){this.layerHasModifications= E;this._forAllNodes(({node:G})=>{null!=G&&(G.imModificationImpact=f.NodeIMModificationImpact.NotChecked,G.visibilityObbInRenderSR=this._computeVisibilityObb(G),G.hasModifications&&this.invalidateGeometryVisibility(G.index))});this.invalidateVisibilityCache()}layerFilterChanged(E){this._layerHasFilter=E;this._forAllNodes(G=>{null!=G&&(G.filterImpact=f.NodeFilterImpact.NotChecked,G=G.node,null!=G&&this.invalidateNodeVisibilityCache(G.index))});this.invalidateVisibilityCache()}update(E,G,I){if(this._dirty){0< this._pageQueue.length&&this._addQueuedPages(G);this._invalidateElevationRangeForNewPages(G);this._maxProcessingPrio=this._maxUnloadedPrio=Number.NEGATIVE_INFINITY;this._missingPagesAndNodes.clear();this._prefetchNodes.clear();this._updates.reset(E);y.clear();var O=!0,L=new B,P=new B,M=this._imModificationUncategorized;M.clear();var K=new Set,J=0;this.traverseVisible((R,Q,W)=>{var S=t(R,this._pageSize);if(null==Q)R=this._entryPriority(R),Infinity===R&&(R=this._entryPriority(W)),y.set(S,Math.max(R, y.get(S)||0)),this._loadingPages.has(S)||this._failedPages.has(S)||(this._missingPagesAndNodes.push(S),++J),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,R);else{var V=Q.node;this._updateNodeFeatureEstimate(V,P);if(null==V)Q=this._entryPriority(R),this._loadingNodes.has(R)||this._failedNodes.has(R)||(this._missingPagesAndNodes.push(R),y.set(R,Q)),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,Q);else{W=this._getPage(R);if(0===this._missingPagesAndNodes.length&&!this._useNodePages)for(S= 0;ST!==V.index)):!G.done&&this._enable(V)?G.madeProgress():(Q=this._entryPriority(R),y.set(R,Q),this._maxProcessingPrio= Math.max(this._maxProcessingPrio,Q),this._updates.add.push(R),this.layerHasModifications&&I&&null!=V&&V.imModificationImpact===f.NodeIMModificationImpact.NotChecked&&M.push(R))):this._isReloading(R)&&this._updates.remove.push(R))}}},K);this._frameNumber++;this._missingPagesAndNodes.sort((R,Q)=>R-Q);this._missingPagesAndNodes.filterInPlace((R,Q)=>1>Q||this._missingPagesAndNodes.data[Q-1]!==R);this._missingPagesAndNodes.sort((R,Q)=>y.get(R)-y.get(Q));0{var Q=this._getNodeInternal(R);(Q=null==Q?.node||Q.node.imModificationImpact!==f.NodeIMModificationImpact.Culled)||this.invalidateNodeVisibilityCache(R);return Q}));this._unloadedMemoryEstimate=L.missing-L.unremoved;3y.get(R)>=this._maxUnloadedPrio).sort((R,Q)=>y.get(R)-y.get(Q));this._updates.update.sort((R,Q)=>y.get(R)-y.get(Q));this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.length;this._dirty=0=G||0N&&G> I){I=[];for(const [L,P]of O)0!==P.numNodesWithLoadedChildren||E.has(L)||I.push([P.lastTraversed,L]);I.sort((L,P)=>L[0]-P[0]).some(L=>{this._deleteNodePage(L[1]);return O.size<=N})}}}_updateFeatureEstimate(E,G){this._version=c.addWraparound(this._version,2);this._viewportQueries.updateScreenSpaceErrorBias(E);this.traverseVisible((I,O)=>this._updateNodeFeatureEstimate(null!=O?O.node:void 0,G))}_updateNodeFeatureEstimate(E,G){null!=E&&!E.failed&&null!=E.numFeatures&&this._isSelected(E)&&(null!=E.numFeatures? (G.missing+=E.numFeatures,G.known+=E.numFeatures,++G.knownNodes):++G.missingNodes)}_computeFeatureEstimate(E){let G=E.known-E.unremoved;3y.get(E)-y.get(G));return this._load(this._prefetchNodes)}_load(E){if(0===E.length||!this._canRequest())return!1;for(;0E.lodLevel):M=0{this._loadingNodes.delete(E);0===this._missingPagesAndNodes.length&&0===this._loadingNodes.size&&this.requestUpdate()},L=null;try{L=0<=E?await this._streamDataController.request(I,"json"):await this._clientNodeLoader.loadNodeJSON(G)}catch(P){O();l.isAbortError(P)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+I),this._failedNodes.add(E));return}O();G=this._validateNode(G, L);null!=G&&(G.obb&&this.invalidateNodeVisibilityCache(E),G=this._addNode(G,E),this.nodeTraversalState(G))}}_validateNode(E,G){if(null==G||"object"!==typeof G||G.id!==E)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${E}"`),null;if(!Array.isArray(G.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${E}.`),null;G.sharedResource&&"./shared"!==G.sharedResource.href&&"./shared/"!==G.sharedResource.href&&this._logger.warn("#validateNode()", this._layer,`Invalid shared resource href on node "${E}"`);var I=G.geometryData;null==I||Array.isArray(I)&&0===I.length||Array.isArray(I)&&1===I.length&&"./geometries/0"===I[0].href||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${E}"`);I=G.attributeData;const O=this._layer.attributeStorageInfo;null==I||Array.isArray(I)&&!I.some((K,J)=>K.href!==`./attributes/${O?.[J]?.key??`f_${J}`}/0`)||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${E}"`); G.featureData&&1{if(null==K)return null;var J=R=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${E}: ${R}`); if("number"===typeof K.id)J(`id ${K.id} is a number instead of a string.`);else if("string"!==typeof K.id||!Array.isArray(K.mbs))return J("Missing or invalid id."),null;if(!Array.isArray(K.mbs))return J(`Invalid bounding volume on reference ${K.id}.`),null;K.href&&K.href!=="../"+K.id&&this._logger.error("#validateNode()",this._layer,`Invalid node href on node "${E}"`);J=new f.NodeBase(`${K.id}`,K.mbs);J.serviceObbInIndexSR=!this.ignoreServiceObb&&K.hasOwnProperty("obb")&&K.obb?d.Obb.fromJSON(K.obb): null;J.visibilityObbInRenderSR=this._computeVisibilityObb(J);return J};P=Array.isArray(G.children)?G.children.map(P).filter(K=>null!=K):null;const M=!0===G.isEmpty;return new e.ValidatedNode(E,G.mbs,I,"string"===typeof G.version?G.version:null,{isEmpty:!(G.featureData?.length??!1)&&M,hasSharedResource:null!=G.sharedResource,attributes:G.attributeData?E:void 0,texture:G.textureData&&0{null!=E.node&&(E.node.failed=!1)})}_entryPriority(E){var G=this._getNodeInternal(E),I=this.getParentIndex(E);if(null==G||null==I&&null==G.node)return null==I?Infinity:this._entryPriority(I);let O=0;G.node&&null!=I&&(I=this._getNodeInternal(I).traversalState,null!=I&&(O=I.lodLevel));for(I=this.progressiveLoadPenalty;null!=E;E=this.getParentIndex(E))if(this._isLoaded(E)){I=0;break}G=null!=G.ref?this._viewportQueries.distToPOI(G.ref): null!=G.node?this._viewportQueries.distToPOI(G.node):0;return-G-O*(G+this.progressiveLoadPenalty)+I}traverseVisible(E,G){const I=this._getNodeInternal(this._rootIndex);null==I?E(this._rootIndex,null,null):this._traverseVisible(this._rootIndex,null,I,E,G)}_traverseVisible(E,G,I,O,L){var P=t(E,this._pageSize);L&&L.add(P);if(I.node&&0===I.childCount)this.isGeometryVisible(E)&&O(E,I,G);else if(this.isNodeVisible(E)&&(O(E,I,G),null!=I.node&&(G=this.nodeTraversalState(I.node),!G?.nodeHasLOD||G.lodLevel!== this._maxLodLevel)))for(P=this._getPageFromPageIndex(P),G=0;G{let O=this._isLoaded(I.index)||this._isReloading(I.index)?1:0;this.traverseDescendants(I, L=>{O+=G(L);return!1});I.childrenLoaded!==O&&E.push(I.index);return O};G(this.rootNode);E.length&&this._logger.error("childrenLoaded invariant broken at following nodes: "+E.join(","));return 0{E?.invalidateBounds(); E.node?.invalidateElevationRange();E.ref?.invalidateElevationRange()})}_forAllNodes(E){if(null!=this._clientNodePage){var G=this._clientNodePage;for(var I=0;IG.add(t(I,this._pageSize)));for(const [I,O]of E)if(0!==O.numNodesWithLoadedChildren||G.has(I))for(const L of O.nodes)L.traversalState= null;else this._deleteNodePage(I)}}_deleteNodePage(E){this._nodePages.delete(E)}get test(){}}const y=new Map;class z{constructor(E){this.missing=E;this.update=new q({deallocator:null});this.add=new q({deallocator:null});this.remove=new q({deallocator:null});this.cancel=[]}reset(E){this.add.clear();this.update.clear();this.cancel=E}}const A=[["maxScreenThreshold",f.LodMetric.MaxScreenThreshold],["screenSpaceRelative",f.LodMetric.ScreenSpaceRelative],["removedFeatureDiameter",f.LodMetric.RemovedFeatureDiameter], ["distanceRangeFromDefaultCamera",f.LodMetric.DistanceRangeFromDefaultCamera]];class B{constructor(){this.unremoved=this.missingNodes=this.missing=this.knownNodes=this.known=0}}const C=k.create(),D=k.create(),F=k.create(),H=k.create(),N=b("esri-mobile")?100:300;a.I3SIndex=x;a.selectErrorMetric=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SNode":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec4f64","../../../../chunks/sphere", "./I3SUtil","../../support/ElevationRange"],function(a,b,q,l,p){class k extends p.ElevationRange{constructor(c,e){super(NaN,NaN);this.id=c;this.serviceMbsInIndexSR=e;this.serviceMbsInRenderSR=q.fromValues(0,0,0,-1)}invalidateServiceBVsInRenderSR(){l.invalidateMbs(this.serviceMbsInRenderSR);this.serviceObbInRenderSR?.invalidate()}shareServiceBVsInRenderSRWith(c){this.serviceObbInRenderSR=c.serviceObbInRenderSR;this.serviceMbsInRenderSR=c.serviceMbsInRenderSR}}a.NodeFilterImpact=void 0;(function(c){c[c.Unmodified= 0]="Unmodified";c[c.Culled=1]="Culled";c[c.NotChecked=2]="NotChecked"})(a.NodeFilterImpact||(a.NodeFilterImpact={}));a.NodeIMModificationImpact=void 0;(function(c){c[c.Unmodified=0]="Unmodified";c[c.PotentiallyModified=1]="PotentiallyModified";c[c.Culled=2]="Culled";c[c.Unknown=3]="Unknown";c[c.NotChecked=4]="NotChecked"})(a.NodeIMModificationImpact||(a.NodeIMModificationImpact={}));class h extends k{constructor(c,e,g,d,t,w,v,m,r,n){super(c,g);this.index=e;this.childCount=d;this.level=t;this.resources= w;this.version=v;this.lodMetric=m;this.maxError=r;this.numFeatures=n;this.failed=!1;this.cacheState=a.CacheState.Unknown;this.childrenLoaded=this.memory=this.vertexCount=0;this.hasModifications=!1;this.imModificationImpact=a.NodeIMModificationImpact.NotChecked;this.elevationAgnosticBoundingVolume=b.fromValues(0,0,0,-1)}invalidateServiceBVsInRenderSR(){super.invalidateServiceBVsInRenderSR();this.elevationAgnosticBoundingVolume[3]=-1}}a.CacheState=void 0;(function(c){c[c.Unknown=0]="Unknown";c[c.Uncached= 1]="Uncached";c[c.Cached=2]="Cached"})(a.CacheState||(a.CacheState={}));a.LodMetric=void 0;(function(c){c[c.None=0]="None";c[c.MaxScreenThreshold=1]="MaxScreenThreshold";c[c.ScreenSpaceRelative=2]="ScreenSpaceRelative";c[c.RemovedFeatureDiameter=3]="RemovedFeatureDiameter";c[c.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"})(a.LodMetric||(a.LodMetric={}));a.NodeState=void 0;(function(c){c[c.Hole=0]="Hole";c[c.Leaf=1]="Leaf"})(a.NodeState||(a.NodeState={}));class f{constructor(c, e,g,d){this.nodeHasLOD=c;this.isChosen=e;this.lodLevel=g;this.version=d}}a.Node=h;a.NodeBase=k;a.NodeTraversalState=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/ValidatedNode":function(){define(["exports"],function(a){class b{constructor(q,l,p,k,h,f,c,e){this.id=q;this.mbs=l;this.obb=p;this.version=k;this.resources=h;this.children=f;this.lodSelection=c;this.numFeatures=e}}a.ValidatedNode=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/3d/layers/i3s/I3SLodHandling":function(){define(["../../../../core/PooledArray","./I3SNode","../support/I3SLayerView"],function(a,b,q){class l{constructor(k){this._layerView=k;this._lodGlobalDirty=!1}startNodeLoading(k,h,f){this._maxLodLevel=f.maxLodLevel;this._index=h;this._removeNodes=k}shouldLoadNode(k){if(null==k)return!1;const h=this._index.nodeTraversalState(k);return this._isChosenMaxLOD(h)?!0:h.isChosen?this._childrenRequireLoading(k):!1}setLodGlobalDirty(){this._lodGlobalDirty= !0}get requiresLODGlobalHandling(){return null!=this._index&&!0===this._lodGlobalDirty}lodGlobalHandling(k){if(!this.requiresLODGlobalHandling)return!1;this._lodGlobalDirty=!1;var h=Math.max(0,Math.floor(10*(this._layerView.view.resourceController.memoryController.usedMemory-1)));p.clear();this._lodGlobalHandling(this._index.rootNode,h,!1,!!this._layerView.nodeCrossfadingEnabled);h=p.length;this._removeNodes(p,k);k=p.length{(this._layerView.isNodeLoaded(h.index)||this._layerView.isNodeReloading(h.index))&&p.push(h.index); return 0h&&this._index.isNodeVisible(f.index)?this._layerView.isNodeLoaded(f.index)?h=!1:0{if(!f||!this._index.isNodeVisible(c.index))return!1;const e=this._index.nodeTraversalState(c);this._isChosenMaxLOD(e)&&this._index.isGeometryVisible(c.index)&&(h=!0);return this._layerView.isNodeLoaded(c.index)? f=!1:0f.getMaterialAndTextures(m,r,"integrated-mesh"===e.type))}}_load(e,g,d){return this._streamDataController.request(e, g,d)}_loadAttribute(e,g,d){return this._load(`${this._layerUrl}/nodes/${e.resources.attributes}/attributes/${g.key}/0`,"binary",d).then(t=>h.readBinaryAttribute(g,t))}async loadAttributes(e,g,d){const t=await Promise.allSettled(g.map(m=>this._loadAttribute(e,m.attributeStorageInfo,d))),w={};for(let m=0;mv)&&(t=0<=v?t[v].geometryBuffers:null,null!=t))for(v=0;vp.makeAbsolute(w,g)):t.hrefConcat=p.makeAbsolute(t.href,g)}static _fixTextureEncodings(e){e=e.textureDefinitions;if(null!=e)for(const d in e){const t= e[d];if(Array.isArray(t.encoding))for(var g=0;g({id:g,usage:d,data:r,encoding:w,downsampled:m})):this._load(e,"image",v).then(r=>{var n=r;if(t&&4096<=r.width*r.height){n=Math.ceil(r.width/2);const u=Math.ceil(r.height/2),x=document.createElement("canvas");x.width=n;x.height=u;x.getContext("2d").drawImage(r,0,0,n,u);n=x;m=!0}return{id:g,usage:d,data:n,encoding:w,downsampled:m}})}loadTextures(e,g,d){const t=!!this._options.uncompressedTextureDownsamplingEnabled, w=this._options.textureUsageMask;return Promise.all(g.map(v=>{if(0===(v.usage&w))return null;const m=f.selectEncoding(v.encodings,this._options.textureEncodings);return null==m?(this._logger.error("#loadTextures",this._logLayer,`No known encoding for texture found on node ${e.id}`),Promise.reject()):this._loadTexture(`${this._layerUrl}/nodes/${e.resources.texture||e.id}/textures/${m.name}`,v.id,v.usage,t,m.encoding,d)}))}_loadFeatureData(e,g){return this._load(`${this._layerUrl}/nodes/${e}/features/0`, "json",g)}_loadGeometry(e,g,d){return this._load(`${this._layerUrl}/nodes/${e}/geometries/${g}`,"binary",d)}}return c})},"esri/views/3d/layers/i3s/I3SMaterialUtil":function(){define("exports ../../../../core/has ../../../../core/mathUtils ./enums ../../webgl-engine/core/material/RenderTexture ../../webgl-engine/core/shaderLibrary/util/AlphaCutoff ../../webgl-engine/core/shaderLibrary/util/EllipsoidMode ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Texture ../../webgl-engine/materials/pbrUtils ../../../webgl/enums".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(x){return x.sort((y,z)=>y.encoding-z.encoding)}function t(x,y,z){if(null==x||z===l.TextureUsage.None)return null;for(let A=0;A({alphaMode:"opaque",alphaCutoff:k.defaultMaskAlphaCutoff,doubleSided:!0,cullFace:f.CullFaceOptions.None,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[.8,.8,.8,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6},wrapTextures:!1,hasParametersFromSource:!0}), n={s:g.TextureWrapMode.CLAMP_TO_EDGE,t:g.TextureWrapMode.CLAMP_TO_EDGE},u={s:g.TextureWrapMode.REPEAT,t:g.TextureWrapMode.REPEAT};a.configureMaterial=function(x,y,z,A,B,C){const D=C.rendererTextureUsage;var F=y.metallicRoughness.baseColorFactor,H=q.clamp(y.metallicRoughness.baseColorFactor[3],0,1);x.baseColor=[F[0],F[1],F[2],H];x.hasParametersFromSource=!!y.hasParametersFromSource;x.usePBR=C.usePBR;x.mrrFactors=[y.metallicRoughness.metallicFactor,y.metallicRoughness.roughnessFactor,y.hasParametersFromSource? e.defaultSchematicMRRFactors[2]:e.defaultAdvancedMRRFactors[2]];x.emissiveFactor=y.emissiveFactor;x.isIntegratedMesh=C.isIntegratedMesh;x.textureAlphaCutoff="mask"===y.alphaMode?y.alphaCutoff:k.defaultMaskAlphaCutoff;x.alphaDiscardMode="opaque"===y.alphaMode?f.AlphaDiscardMode.Opaque:"mask"===y.alphaMode?f.AlphaDiscardMode.Mask:f.AlphaDiscardMode.MaskBlend;F=[];H=t(A,z,(l.TextureUsage.Color|l.TextureUsage.AlphaMask)&D);null!=H&&(x.baseColorTexture=new p.RenderTexture(B,H),F.push(x.baseColorTexture.loadPromise)); H=t(A,z,l.TextureUsage.MetallicRoughness&D);null!=H&&(x.metallicRoughnessTexture=new p.RenderTexture(B,H),F.push(x.metallicRoughnessTexture.loadPromise));H=t(A,z,l.TextureUsage.Emissive&D);null!=H&&(x.emissionTexture=new p.RenderTexture(B,H),F.push(x.emissionTexture.loadPromise));H=t(A,z,l.TextureUsage.Occlusion&D);null!=H&&(x.occlusionTexture=new p.RenderTexture(B,H),F.push(x.occlusionTexture.loadPromise));z=t(A,z,l.TextureUsage.Normal&D);null!=z&&(x.normalTexture=new p.RenderTexture(B,z),F.push(x.normalTexture.loadPromise)); x.commonMaterialParameters.hasSlicePlane=C.slicePlaneEnabled;x.commonMaterialParameters.doubleSided=y.doubleSided;x.commonMaterialParameters.cullFace=y.cullFace;x.ellipsoidMode=h.getEllipsoidMode(C.viewSpatialReference);return Promise.all(F)};a.createTexture=function(x,y,z,A){if(null==x?.data)return null;const B=x.data;A=A.renderingContext.parameters.maxMaxAnisotropy;const C=1{if(null==G)return-1;var O=A.get(G.id);if(O)return O.usage|=I,O.id;O=A.size;A.set(G.id,{id:O,usage:I});return O};var C=y.pbrMetallicRoughness;const D=C?.baseColorFactor,F=y.emissiveFactor,H=(z=b("disable-feature:diffuse-rendering-i3s")||z?e.useSchematicPBRI3S({normalTexture:y.normalTexture,emissiveTexture:y.emissiveTexture,emissiveFactor:y.emissiveFactor, occlusionTexture:y.occlusionTexture,metallicRoughnessTexture:C?.metallicRoughnessTexture,metallicFactor:C?.metallicFactor,roughnessFactor:C?.roughnessFactor}):e.useSchematicPBR({normalTexture:y.normalTexture,emissiveTexture:y.emissiveTexture,emissiveFactor:y.emissiveFactor,occlusionTexture:y.occlusionTexture,metallicRoughnessTexture:C?.metallicRoughnessTexture,metallicFactor:C?.metallicFactor,roughnessFactor:C?.roughnessFactor}))?e.defaultSchematicMRRFactors[0]:C?.metallicFactor??e.defaultAdvancedMRRFactors[0], N=z?e.defaultSchematicMRRFactors[1]:C?.roughnessFactor??e.defaultAdvancedMRRFactors[1];C={baseColorFactor:D?[D[0],D[1],D[2],D[3]]:[1,1,1,1],baseColorTextureId:B(C?.baseColorTexture,"mask"===y.alphaMode?l.TextureUsage.Color|l.TextureUsage.AlphaMask:l.TextureUsage.Color),metallicRoughnessTextureId:B(C?.metallicRoughnessTexture,l.TextureUsage.MetallicRoughness),metallicFactor:H,roughnessFactor:N};y={alphaMode:y.alphaMode,alphaCutoff:y.alphaCutoff,doubleSided:y.doubleSided,cullFace:"none"===y.cullFace? f.CullFaceOptions.None:"back"===y.cullFace?f.CullFaceOptions.Back:"front"===y.cullFace?f.CullFaceOptions.Front:f.CullFaceOptions.None,normalTextureId:B(y.normalTexture,l.TextureUsage.Normal),emissiveTextureId:B(y.emissiveTexture,l.TextureUsage.Emissive),occlusionTextureId:B(y.occlusionTexture,l.TextureUsage.Occlusion),emissiveFactor:F?[F[0],F[1],F[2]]:[0,0,0],metallicRoughness:C,wrapTextures:!1,hasParametersFromSource:z};const E=[];A.forEach(({usage:G},I)=>{var O=null!=x&&x[I]&&x[I].formats;O=O?d(O.map(({name:L, format:P})=>({name:L,encoding:v[P]}))):[];E.push({id:I,usage:G,encodings:O})});return{material:y,textures:E}};a.getMaterialAndTexturesFromShared=function(x){var y=x?.materialDefinitions?Object.keys(x.materialDefinitions)[0]:null,z=x?.textureDefinitions?Object.keys(x.textureDefinitions)[0]:null;y=y?x.materialDefinitions?.[y]:null;z=z?x.textureDefinitions?.[z]:null;x=r();if(null!=y){y=y.params;y.diffuse&&(x.metallicRoughness.baseColorFactor=[y.diffuse[0],y.diffuse[1],y.diffuse[2],1]);null!=y.doubleSided&& (x.doubleSided=y.doubleSided,x.cullFace=y.doubleSided?f.CullFaceOptions.None:f.CullFaceOptions.Back);if("none"===y.cullFace||"front"===y.cullFace||"back"===y.cullFace)x.cullFace="none"===y.cullFace?f.CullFaceOptions.None:"back"===y.cullFace?f.CullFaceOptions.Back:f.CullFaceOptions.Front;y.transparency&&(x.metallicRoughness.baseColorFactor[3]=q.clamp(1-y.transparency,0,1));if(y.useVertexColorAlpha||1>x.metallicRoughness.baseColorFactor[3])x.alphaMode="blend"}y=[];if(null!=z){!z.wrap||"repeat"!==z.wrap[0]&& "repeat"!==z.wrap[1]||(x.wrapTextures=!0);let A=l.TextureUsage.Color;"rgba"===z.channels&&(x.alphaMode="blend",A|=l.TextureUsage.AlphaMask);const B=z.images[z.images.length-1];z=Array.isArray(z.encoding)?d(z.encoding.map((C,D)=>({name:B.href[D]?.split("/").pop(),encoding:m[C]||0}))):[{name:B.href?.split("/").pop(),encoding:m[z.encoding]||0}];y.push({id:0,usage:A,encodings:z});x.metallicRoughness.baseColorTextureId=0}return{material:x,textures:y}};a.getSupportedEncodings=function(x){const y=!!x.compressedTextureS3TC; x=!!x.compressedTextureETC;const z=b("disable-feature:i3s-basis")?0:l.TextureEncoding.Basis|l.TextureEncoding.KTX2,A=z|l.TextureEncoding.DDS_S3TC;return l.TextureEncoding.JPG|l.TextureEncoding.PNG|(y?A:0)|(x?z:0)};a.selectEncoding=function(x,y){if(null!=y)return x.find(z=>0!==(z.encoding&y))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/material/RenderTexture":function(){define(["exports","../../../../../core/maybe","../../../../../core/promiseUtils"], function(a,b,q){class l{constructor(p,k){this._textures=p;this.loadPromise=null;this._disposed=!1;p=this._textures.acquire(k);q.isPromiseLike(p)?(p.then(h=>{this._disposed?b.releaseMaybe(h):this._textureRef=h}),this.loadPromise=p):this._textureRef=p}dispose(){this._textureRef=b.releaseMaybe(this._textureRef);this._disposed=!0}get glTexture(){return null!=this._textureRef?this._textureRef.glTexture:null}}a.RenderTexture=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SStreamDataController":function(){define(["exports", "../../../../core/promiseUtils"],function(a,b){class q{constructor(l,p,k){this._requester=l;this._customParameters=p;this._apiKey=k;this._activeRequests=new Set}get busy(){return this._requester.busy}request(l,p,k){const h=new AbortController;k=b.onAbortOrThrow(k,()=>h.abort());l=this._requester.request(l,p,{signal:h.signal,query:{...this._customParameters,token:this._apiKey}});const f={response:l,abortController:h,abortHandle:k};this._activeRequests.add(f);b.always(l,()=>{f.abortController=null; f.abortHandle?.remove();f.abortHandle=null;this._activeRequests.delete(f)});return l}cancelAll(){this._activeRequests.forEach(l=>{l.abortController?.abort();l.abortController=null;l.abortHandle?.remove()});this._activeRequests.clear()}}a.I3SStreamDataController=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SViewportQueries":function(){define("../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/spatialReferenceEllipsoidUtils ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/projection/projectors ../../../../geometry/support/frustum ../../../../geometry/support/plane ../../../../geometry/support/spatialReferenceUtils ../../../../chunks/sphere ../../../../layers/graphics/dehydratedPoint ../../../ViewingMode ../graphics/elevationAlignmentUtils ../graphics/ElevationContext ../graphics/featureExpressionInfoUtils ./I3SNode ./I3SUtil ../../support/orientedBoundingBox".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){class y{get _frustumMbsCenter(){return this._frustumMbs}get _frustumMbsRadius(){return this._frustumMbs[3]}get _frustumPlanes(){return this._frustum}constructor(M,K,J,R,Q,W,S,V,T={}){this._indexSR=M;this._renderCoordsHelper=K;this._clippingArea=Q;this._elevationProvider=W;this._viewingMode=S;this._options=T;this._frustum=c.create();this._frustumMbs=l.create();this._useFrustumCulling=!1;this._poi=b.create();this._elevationContext=null;this.minDistance= Infinity;this.maxDistance=0;this.maxLodLevel=2;this._tmpObb=new x.Obb;this._tmp1=b.create();this._tmp2=b.create();this._tmp3=b.create();this._tmp0=b.create();this._screenspaceErrorBias=T.screenspaceErrorBias||1;this._progressiveLoadFactor=T.progressiveLoadFactor||1;this.updateCamera(J,R);this._renderSR=K=this._renderCoordsHelper.spatialReference;this._renderSRSphericalPCPF=k.getSphericalPCPF(K);this._isGlobalMode=K===this._renderSRSphericalPCPF;this.updateElevationInfo(V);this._tmpPoint=t.makeDehydratedPoint(0, 0,0,M);this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(K.isWebMercator||g.isPlateCarree(K));this._indexSREllipsoidRadius=p.getReferenceEllipsoid(this._indexSR).radius;this._indexSRSphericalPCPF=k.getSphericalPCPF(M);this._projectorIndexSRToIndexSRSphericalPCPF=f.getProjector(this._indexSR,this._indexSRSphericalPCPF)}updateElevationInfo(M){null==M?this._elevationContext=null:(this._elevationContext=m.ElevationContext.fromElevationInfo(M),this._elevationContext.updateFeatureExpressionInfoContext(r.createContextWithoutExpressionSupport(r.extractExpressionInfo(M, !1))))}updateCamera(M,K){if(this._useFrustumCulling=K){c.fromMatrix(M.viewMatrix,M.projectionMatrix,this._frustum,A);K=M.eye;const Q=z;a.normalize(Q,M.viewForward);var J=B;a.sub(J,A[4],K);var R=a.dot(J,J);J=a.dot(Q,J);R=.5*R/J;J=this._frustumMbs;a.scaleAndAdd(J,K,Q,R);J[3]=1+R}this._screenSizeFactor=1/(M.perScreenPixelRatio/2);this._camPos=M.eye;this.minDistance=Infinity;this.maxDistance=0}setPointOfInterest(M){this._poi=M}updateScreenSpaceErrorBias(M){const K=this._screenspaceErrorBias;this._screenspaceErrorBias= M;return K}updateClippingArea(M){this._clippingArea=M}expandElevationRange(M,K,J){if(null!=this._elevationContext&&(M=M.serviceMbsInIndexSR)){var R="relative-to-scene"===this._elevationContext.mode?"scene":"ground";this._elevationProvider.getSphereElevationBounds?(K=this._elevationProvider.getSphereElevationBounds(M,this._indexSR,R))&&J.expandElevationRange(K):((M=this._elevationProvider.getElevation(M[0],M[1],M[2],this._indexSR,R))&&J.expandElevationRangeValues(M,M),(K=K?null:this._elevationProvider.getRootElevationBounds?.())&& J.expandElevationRange(K))}}getServiceMbsInRenderSR(M){const K=M.serviceMbsInRenderSR;if(u.isValidMbs(K))return K;M.serviceMbsInIndexSR&&q.copy(K,M.serviceMbsInIndexSR);const J=M.elevationRangeMin;if(this._elevationContext&&Number.isFinite(J)){let R=0,Q=0;M=M.elevationRangeMax;switch(this._elevationContext.mode){case "relative-to-ground":case "relative-to-scene":R=this._elevationContext.geometryZWithOffset(K[2],this._renderCoordsHelper)+J-K[2];Q=M-J;break;case "on-the-ground":R=J-K[2],Q=M-J}K[2]+= R+.5*Q;K[3]+=.5*Q}else this._elevationContext&&1E5>K[3]&&(this._tmpPoint.x=K[0],this._tmpPoint.y=K[1],this._tmpPoint.z=K[2],K[2]=v.evaluateElevationAlignmentAtPoint(this._tmpPoint,this._elevationProvider,this._elevationContext,this._renderCoordsHelper));h.projectBoundingSphere(K,this._indexSR,K,this._renderSR);return K}getAndUpdateVisibilityObbInRenderSR(M){var K=M.visibilityObbInRenderSR;if(K)return K;K=.01*this._indexSREllipsoidRadius;const {serviceMbsInIndexSR:J,serviceObbInIndexSR:R}=M;if(null== R||!J||!R.isValid||this._isECEFOBBInLocalMode&&(R.halfSizeX>K||R.halfSizeY>K||R.halfSizeZ>K))return null;K=M.serviceObbInRenderSR;if(null==K)K=new x.Obb,M.serviceObbInRenderSR=K;else if(K.isValid)return K;var Q=J[3],W=0;let S=0;var V=R.centerZ;const T=this._renderCoordsHelper,Y=this._elevationContext;if(Y&&M.elevationRangeValid)switch(Q=M.elevationRangeMin,M=M.elevationRangeMax,Y.mode){case "relative-to-ground":case "relative-to-scene":W=Y.geometryZWithOffset(V,T)+Q-V;S=M-Q;break;case "on-the-ground":W= Q-V,S=M-Q}else Y&&1E5>Q&&(W=this._tmpPoint,W.x=R.centerX,W.y=R.centerY,W.z=V,W=v.evaluateElevationAlignmentAtPoint(W,this._elevationProvider,Y,T)-V);V=(M=0=K){J[3]=-1;return}R=Math.max(R,Math.sqrt(1-K*K))}}else if(R=M.serviceMbsInRenderSR,u.isValidMbs(R)){Q=a.copy(E,d.getCenter(R));R=R[3];K=a.len(Q);if(K=W)return!0;Q=a.scale(D,M,W);const S=a.scale(F,M,R);K/=Math.sqrt(1-K*K);for(const T of J){J=e.getNormal(T);var V=a.normalize(H,J);const Y=a.dot(V,M);if(!(.01>Math.abs(1-Y)||(J=O,a.scale(J,M,Y),a.sub(J,J,V),a.normalize(J,J),V=L,a.scaleAndAdd(V,Q,J,W*K),0>=e.signedDistance(T,V)||(a.scaleAndAdd(V,S,J,R*K),0>=e.signedDistance(T,V)))))return!1}return!0}_isConeVisibleInFrustumMbs(M){const K=M[3];if(.9=W)return-R=V)return!0;for(var T of Q){Q=!0;for(var Y of W){J=a.dot(Y, M);R=P;a.scale(R,Y,V/J);if(0>=e.signedDistance(T,R)){Q=!1;break}R=P;a.scale(R,Y,S/J);if(0>=e.signedDistance(T,R)){Q=!1;break}}if(Q)return!1}}else{M=R[2]-J;T=R[2]+J;for(V of Q){Y=!0;R=e.getNormal(V);Q=R[0];J=R[1];R=R[2];K=V[3];for(S of W){const ha=Q*S[0]+J*S[1]+K;if(0>=ha+R*M||0>=ha+R*T){Y=!1;break}}if(Y)return!1}}return!0}_isCylinderVisibleInFrustum(M){const K=this._frustumMbsRadius,J=a.copy(C,this._frustumMbsCenter);J[2]=0;const R=M[3];return a.dist(J,M)<=R+K}isGeometryVisible(M){return this._useFrustumCulling? M.geometryObbInRenderSR?.doesIntersectFrustumConservativeApproximation(this._frustum)??this.isNodeVisible(M):!0}_isMBSinClippingArea(M){return null==this._clippingArea?!0:u.intersectBoundingRectWithMbs(this._clippingArea,M)!==u.MbsIntersectResult.OUTSIDE}_screenSpaceDiameterMbs(M,K){var J=this.getServiceMbsInRenderSR(M);M=Math.sqrt(a.squaredDistance(d.getCenter(J),this._camPos));J=M-J[3];this._updateMinMaxDistance(M);return 0>J?.5*Number.MAX_VALUE:K/J*this._screenSizeFactor}calcCameraDistance(M){return this.calcCameraDistanceToCenter(M)- this.getServiceMbsInRenderSR(M)[3]}calcCameraDistanceToCenter(M){M=this.getServiceMbsInRenderSR(M);M=a.distance(d.getCenter(M),this._camPos);this._updateMinMaxDistance(M);return M}calcAngleDependentLoD(M){M=this.getServiceMbsInRenderSR(M);const K=M[3];M=(Math.abs(M[0]*(M[0]-this._camPos[0])+M[1]*(M[1]-this._camPos[1])+M[2]*(M[2]-this._camPos[2]))/a.length(d.getCenter(M))+K)/a.distance(d.getCenter(M),this._camPos);return Math.min(1,M)}hasLOD(M){return M.lodMetric!==n.LodMetric.None}_getDistanceGlobeMode(M, K){var J=a.length(d.getCenter(K));const R=a.length(M)-J;a.scale(this._tmp0,M,a.dot(M,d.getCenter(K))/a.squaredLength(M));var Q=a.squaredDistance(d.getCenter(K),this._tmp0),W=K[3];if(Q<=W*W)return Math.abs(R);K=a.scale(this._tmp0,d.getCenter(K),1/J);J=a.scale(this._tmp1,K,J-W*W/2/J);Q=a.subtract(this._tmp2,M,J);Q=a.subtract(this._tmp2,Q,a.scale(this._tmp3,K,a.dot(K,Q)));J=a.add(this._tmp2,J,a.scale(this._tmp2,Q,W/a.length(Q)));W=a.distance(M,J);2E5<=R&&(M=a.subtract(this._tmp1,M,J),M=a.dot(M,K)/a.length(M), .08>M&&(M=1E-4),W/=M);return W}_getDistance(M,K){if(this._isGlobalMode)return this._getDistanceGlobeMode(M,K);{var J=M[0]-K[0];const R=M[1]-K[1];M=M[2]-K[2];J=J*J+R*R;K=K[3];J<=K*K?M=Math.abs(M):(K=Math.sqrt(J)-K,M=Math.sqrt(M*M+K*K))}return M}_updateMinMaxDistance(M){0this._progressiveLoadFactor){const K=this._screenspaceErrorBias;return this.evaluateLODmetric(M,this._progressiveLoadFactor*this._screenspaceErrorBias)?this.evaluateLODmetric(M,K)?2:1:0}return this.evaluateLODmetric(M,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(M,K){switch(M.lodMetric){case n.LodMetric.ScreenSpaceRelative:const J=this.getServiceMbsInRenderSR(M),R=this._getDistance(this._camPos,J),Q=2*R/this._screenSizeFactor;this._updateMinMaxDistance(R+ J[3]);return M.maxError*K<=Q;case n.LodMetric.MaxScreenThreshold:return K=this._screenSpaceDiameterMbs(M,M.serviceMbsInIndexSR[3]*K),this._options.angleDependentLoD&&(K*=this.calcAngleDependentLoD(M)),Kthis._screenSpaceDiameterMbs(M,M.maxError)*K;case n.LodMetric.DistanceRangeFromDefaultCamera:return this.calcCameraDistance(M)>M.maxError*K}return!1}distToPOI(M){M=this.getServiceMbsInRenderSR(M);return a.distance(d.getCenter(M),this._poi)- M[3]}distCameraToPOI(){return a.distance(this._camPos,this._poi)}}const z=b.create(),A=c.createPoints(),B=b.create(),C=b.create(),D=b.create(),F=b.create(),H=b.create(),N=new x.Obb,E=b.create(),G=[b.create(),b.create(),b.create(),b.create(),b.create(),b.create(),b.create(),b.create()],I=b.create(),O=b.create(),L=b.create(),P=b.create();return y})},"esri/layers/support/SceneModification":function(){define("../../chunks/tslib.es6 ../../geometry ../../core/JSONSupport ../../core/lang ../../core/Warning ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../core/accessorSupport/decorators/persistable ../../geometry/projection ../../geometry/Polygon".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){var w;b=w=class extends q.JSONSupport{constructor(v){super(v);this.geometry=null;this.type="clip"}writeGeometry(v,m,r,n){if(n.layer?.spatialReference&&!n.layer.spatialReference.equals(this.geometry.spatialReference)){if(!d.canProjectWithoutEngine(v.spatialReference,n.layer.spatialReference)){n?.messages&&n.messages.push(new p("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:n.layer.spatialReference, context:n}));return}const u=new t;d.projectPolygon(v,u,n.layer.spatialReference);m[r]=u.toJSON(n)}else m[r]=v.toJSON(n);delete m[r].spatialReference}clone(){return new w({geometry:l.clone(this.geometry),type:this.type})}};a.__decorate([k.property({type:t}),g.persistable()],b.prototype,"geometry",void 0);a.__decorate([e.writer(["web-scene","portal-item"],"geometry")],b.prototype,"writeGeometry",null);a.__decorate([k.property({type:["clip","mask","replace"],nonNullable:!0}),g.persistable()],b.prototype, "type",void 0);return b=w=a.__decorate([c.subclass("esri.layers.support.SceneModification")],b)})},"esri/views/3d/layers/I3SMeshViewLabeler":function(){define("../../../chunks/tslib.es6 ../../../symbols ../../../core/Accessor ../../../core/arrayUtils ../../../core/has ../../../core/lang ../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/uid ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/diffUtils ../../../geometry/projection/projectBuffer ../../../geometry/support/aaBoundingBox ../../../geometry/support/DoubleArray ../../../layers/graphics/dehydratedPoint ./graphics/Graphics3DCore ./graphics/Graphics3DScaleVisibility ./i3s/I3SGeometryUtil ../support/LimitGraphicsMap ../webgl-engine/lib/UpdatePolicy ../../../symbols/PointSymbol3D".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){class C{constructor(E,G){this.meta=E;this.index=G}}class D{constructor(E,G){this.graphic=E;this.geometry=G;this.components=[];this.overridesDirty=!1}}b=class extends q{get updating(){return this._graphicsCore?.updating??!1}constructor(E){super(E);this.loadedGraphics=new z.LimitGraphicsMap(5E4);this.slicePlaneEnabled=!1;this._renderingInfo={symbol:new B};this._featuresMap=new Map}initialize(){const E=this.view.basemapTerrain;this._graphicsCore= new u.Graphics3DCore({owner:this,layer:this.layer,preferredUpdatePolicy:A.UpdatePolicy.ASYNC,elevationFeatureExpressionEnabled:!1,graphicSymbolSupported:!1,getRenderingInfoWithoutRenderer:!0,hasZ:!0,hasM:!1,componentFactories:{deconflictor:G=>this.view.deconflictor.addGraphicsOwner(G),labeler:(G,I)=>this.view.labeler.addGraphicsOwner(G,I,{emptySymbolLabelSupported:!0,elevationInfoOverride:{mode:"absolute-height",offset:0},disablePlacement:{logEntityDescription:"3D Object Scene Layer features"}}), scaleVisibility:(G,I)=>new x.Graphics3DScaleVisibility({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:I,graphicsCore:G,basemapTerrain:E,layerScaleEnabled:!1})}});this._graphicsCore.initializePromise.then(()=>this._graphicsCore.startCreateGraphics()).catch(()=>{});this.addHandles(c.watch(()=>this.layer.labelingInfo,(G,I)=>{w.diff(G,I)&&this._graphicsCore.updateLabelingInfo()}))}destroy(){this._graphicsCore=f.destroyMaybe(this._graphicsCore);this.loadedGraphics=f.destroyMaybe(this.loadedGraphics); this.view=null}addNodeMeta(E,G){let I=0;const O=E.filteredIds,L=this.view.spatialReference,P=[];for(let J=0;J{O=this._graphicsCore.getGraphics3DGraphicById(O.uid);null!=O&&this._updateLabelGeometry(E.featureIds[I])&&O.alignWithAbsoluteElevation(L.z??0,G,!1)})}setNodeMetaAttributes(E,G){const I=[];this._forEachGraphic(E,(O,L)=>{O=G(O,E);k.equalsShallow(L.attributes,O)||(L.attributes=O,I.push(L.uid))});this._graphicsCore.updateLabelingInfo(I)}applyFilterChange(E){this._forEachFeature(E, (G,I,O)=>{if(this._enabledForFeatureInNode(E,G))G=I.graphic,I=G.visible,I!==O&&(G.visible=O,F.graphic=G,F.property="visible",F.oldValue=I,F.newValue=O,this._graphicsCore.graphicUpdateHandler(F));else switch(O=E.featureIds[G],this._removeFeature(I,E,G)){case H.REMOVED:this.loadedGraphics.removeManyByObjectId([O]);break;case H.MODIFIED:this._updateLabelPosition(O)}})}removeNodeMeta(E){const G=[];this._forEachGraphic(E,I=>{const O=E.featureIds[I],L=this._featuresMap.get(O);if(L)switch(this._removeFeature(L, E,I)){case H.MODIFIED:this._updateLabelPosition(O);break;case H.REMOVED:G.push(O)}});this.loadedGraphics.removeManyByObjectId(G)}_removeFeature(E,G,I){const O=E.components.length;l.filterInPlace(E.components,L=>!(L.meta===G&&L.index===I));return 0===E.components.length?(this._featuresMap.delete(G.featureIds[I]),H.REMOVED):O!==E.components.length?H.MODIFIED:H.UNMODIFIED}getRenderingInfo(){return this._renderingInfo}notifyGraphicGeometryChanged(){}notifyGraphicVisibilityChanged(){}_updateLabelPosition(E){const G= this._featuresMap.get(E);G&&this._updateLabelGeometry(E)&&(this.loadedGraphics.removeManyByObjectId([E]),this.loadedGraphics.addMany([G.graphic]))}_updateLabelGeometry(E){E=this._featuresMap.get(E);if(!E)return!1;const G=E.geometry,I=this.view.spatialReference,O=this.view.renderCoordsHelper,L=G.x,P=G.y,M=G.z??0,K=r.newDoubleArray(E.components.length*y.boundingBoxCornersPointsStride);let J=0;for(const {meta:R,index:Q}of E.components)y.boundingBoxCornerPoints(Q,this.collection,R.objectHandle,K,J),J+= y.boundingBoxCornersPointsStride;v.projectBuffer(K,O.spatialReference,0,K,I,0,K.length/3);m.set(N,m.negativeInfinity);m.expandWithBuffer(N,K);G.x=(N[0]+N[3])/2;G.y=(N[1]+N[4])/2;G.z=N[5];return!h.floatEqualUlp(G.x,L)||!h.floatEqualUlp(G.y,P)||!h.floatEqualUlp(G.z,M)}_forEachGraphic(E,G){this._forEachFeature(E,(I,{graphic:O,geometry:L},P)=>{this._enabledForFeatureInNode(E,I)&&G(I,O,L,P)})}_forEachFeature(E,G){let I=0;for(let O=0;OE.node.index||!this.overrides?.featureHasGeometryChanges(E.featureIds[G])}get updatePolicy(){return this._graphicsCore.effectiveUpdatePolicy}get usedMemory(){return this._graphicsCore.usedMemory}get unloadedMemoryEstimate(){return this._graphicsCore.unprocessedMemoryEstimate}get test(){}};a.__decorate([g.property()],b.prototype,"view",void 0);a.__decorate([g.property()], b.prototype,"layer",void 0);a.__decorate([g.property()],b.prototype,"collection",void 0);a.__decorate([g.property()],b.prototype,"loadedGraphics",void 0);a.__decorate([g.property()],b.prototype,"overrides",void 0);a.__decorate([g.property()],b.prototype,"updating",null);a.__decorate([g.property()],b.prototype,"slicePlaneEnabled",void 0);a.__decorate([g.property()],b.prototype,"_graphicsCore",void 0);b=a.__decorate([t.subclass("esri.views.3d.layers.I3SMeshViewLabeler")],b);const F={graphic:null,property:null, oldValue:null,newValue:null};var H;(function(E){E[E.UNMODIFIED=0]="UNMODIFIED";E[E.MODIFIED=1]="MODIFIED";E[E.REMOVED=2]="REMOVED"})(H||={});const N=m.create();return b})},"esri/views/3d/layers/i3s/I3SGeometryUtil":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectBuffer ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/DoubleArray".split(" "),function(a,b,q,l,p,k){function h(e,g,d,t, w){e=g.getComponentAabb(d,e,f);g=g.getObjectTransform(d);for(d=0;8>d;++d)c[0]=d&1?e[0]:e[3],c[1]=d&2?e[1]:e[4],c[2]=d&4?e[2]:e[5],b.transformMat3(c,c,g.rotationScale),b.add(c,c,g.position),t[w++]=c[0],t[w++]=c[1],t[w++]=c[2];return t}const f=p.create(),c=q.create();a.boundingBoxCornerPoints=h;a.boundingBoxCornersPointsStride=24;a.createGetFeatureExtent=function(e,g,d){const t=k.newDoubleArray(24);return w=>{var v=w.meta.featureExtents;if(null==v){v=new Float64Array(6*w.meta.featureIds.length);w.meta.featureExtents= v;for(let m=0;mthis._handleChanges(e))}destroy(){this._handle.remove()}get length(){return this._active.length}toArray(){return this._active.toArray()}find(c){return this._active.find(c)}forEach(c){this._active.forEach(c)}addMany(c){this._all.addMany(c)}removeManyByObjectId(c){this._all.removeManyByObjectId(c)}_handleChanges(c){let e= c.removed;if(0{h.sample()&&(e.push(t),this._pending.set(t.objectId,t))}),g=this._limit-this._active.length+e.length);let d=c.added;if(g{h.sample()&&(d.push(t),this._pending.delete(t.objectId))}));this._active.addAndRemove(d,e)}}class k{constructor(){this._percentage=1;this._last=-1;this._index=0}reset(c){this._percentage=c;this._last=-1}sample(){const c=Math.floor(this._index*this._percentage);++this._index;if(c===this._last)return!1;this._last=c;return!0}}const h=new k;class f{constructor(c){this._parent=c;this._map=new Map}get length(){return this._map.size}forEach(c){this._map.forEach(e=> c(e))}find(c){let e=void 0;q.someMap(this._map,g=>c(g)?(e=g,!0):!1);return e}toArray(){return[...this._map.values()]}addAndRemove(c,e){for(const g of c)this._map.set(g.objectId,g);for(const g of e)this._map.delete(g.objectId);(0!k.has(h.objectId)):p;0=--f.refCount)&&(this._map.delete(p),k.push(h))}0=--p.refCount)&& (this._map.delete(h),k.push(p));0p(h)?(k=h,!0):!1);return k}forEach(p){this._map.forEach(k=>p(k))}}a.GraphicsMap=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/I3SMeshViewPerformanceInfo":function(){define(["exports","./support/LayerViewPerformanceInfo"],function(a,b){class q extends b.LayerViewPerformanceInfo{constructor(l,p,k,h, f,c,e){super(l,0,0,0,p);this.gpuMB=k;this.geometryMB=h;this.textureMB=f;this.unloadedMB=c;this.idbHitRate=e}}a.I3SMeshViewPerformanceInfo=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/I3SMeshWorkerHandle":function(){define("exports ../../../core/Logger ../../../core/PooledArray ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../core/workers/WorkerHandle ../../../geometry/projection ../../../geometry/projection/projectVectorToVector ../../../libs/i3s/enums".split(" "), function(a,b,q,l,p,k,h,f){function c(t,w,v){g.clear();var m=Infinity;let r=Infinity,n=-Infinity,u=-Infinity,x=!1;for(const z of w){var y="clip"===z.type?f.ModificationType.Inside:"mask"===z.type?f.ModificationType.Outside:f.ModificationType.Replace;const A=z.geometry;w=B=>B;if(A.spatialReference){if(!k.canProjectWithoutEngine(A.spatialReference,v)){b.getLogger("esri.views.3d.layers.I3SMeshWorkerHandle").warn("Can't project modification polygon into layer spatial reference, ignoring modification"); continue}w=B=>{h.projectVectorToVector(B,A.spatialReference,d,v);return d}}else A.hasZ||(d[2]=0,w=B=>{d[0]=B[0];d[1]=B[1];return d});x=x||y===f.ModificationType.Outside;g.push(y);g.push(A.rings.length);for(const B of A.rings){g.push(B.length);for(const C of B)y=w(C),g.push(y[0]),g.push(y[1]),g.push(y[2]),m=Math.min(m,y[0]),r=Math.min(r,y[1]),n=Math.max(n,y[0]),u=Math.max(u,y[1])}}null!=t&&(x?(g.push(f.ModificationType.Inside),g.push(2),g.push(4),g.push(m-1E-4),g.push(r-1E-4),g.push(0),g.push(n+1E-4), g.push(r-1E-4),g.push(0),g.push(n+1E-4),g.push(u+1E-4),g.push(0),g.push(m-1E-4),g.push(u+1E-4),g.push(0)):(g.push(f.ModificationType.Outside),g.push(1)),g.push(4),g.push(t[0]),g.push(t[1]),g.push(0),g.push(t[2]),g.push(t[1]),g.push(0),g.push(t[2]),g.push(t[3]),g.push(0),g.push(t[0]),g.push(t[3]),g.push(0));g.push(f.ModificationType.Finished);t=new Float64Array(g.length);for(m=0;m [w.geometryBuffer],project:w=>[w.positions.buffer],transformNormals:w=>[w.normals.buffer]},t,{hasInitialize:!0})}setModifications(t,w,v,m){t={context:t,modifications:c(w,v,m),isGeodetic:m.isGeographic};this.broadcast(t,"setModifications")}setLegacySchema(t,w){w=JSON.stringify(w);return this.broadcast({context:t,jsonSchema:w},"setLegacySchema")}destroyContext(t){return this.broadcast(t,"destroyContext")}project(t,w){return this.invokeMethod("project",t,w)}transformNormals(t,w){return this.invokeMethod("transformNormals", t,w)}}const g=new q({deallocator:null}),d=l.create();a.I3SMeshWorkerHandle=e;a.toWasmModification=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/libs/i3s/enums":function(){define(["exports"],function(a){a.IndexType=void 0;(function(b){b[b.None=0]="None";b[b.Int16=1]="Int16";b[b.Int32=2]="Int32"})(a.IndexType||(a.IndexType={}));a.ModificationType=void 0;(function(b){b[b.Replace=0]="Replace";b[b.Outside=1]="Outside";b[b.Inside=2]="Inside";b[b.Finished=3]="Finished"})(a.ModificationType|| (a.ModificationType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/II3SMeshView3D":function(){define(["exports"],function(a){a.ForAllFeaturesMode=void 0;(function(b){b[b.VISIBLE_ONLY=0]="VISIBLE_ONLY";b[b.ALL=1]="ALL";b[b.QUERYABLE=2]="QUERYABLE"})(a.ForAllFeaturesMode||(a.ForAllFeaturesMode={}));a.ForAllFeaturesReturnType=void 0;(function(b){b[b.EXIT=0]="EXIT";b[b.CONTINUE=1]="CONTINUE";b[b.SKIP=2]="SKIP"})(a.ForAllFeaturesReturnType||(a.ForAllFeaturesReturnType= {}));a.ElevationMode=void 0;(function(b){b[b.Absolute=0]="Absolute";b[b.RelativeToGround=1]="RelativeToGround";b[b.OnTheGround=2]="OnTheGround"})(a.ElevationMode||(a.ElevationMode={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/SceneLayerWorker":function(){define("require exports ../../../core/mathUtils ../../../geometry/SpatialReference ../../../geometry/support/DoubleArray ../../../geometry/support/MeshGeoreferencedVertexSpace ../../../geometry/support/MeshLocalVertexSpace ../../../chunks/vec3 ../../../libs/i3s/enums ../../../libs/i3s/I3SModule ./i3s/I3SNode".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){function d(y){if(u){var z=y.modifications,A=u._malloc(8*z.length),B=new Float64Array(u.HEAPU8.buffer,A,z.length);for(let C=0;CW.some(S=>"color"===S.name)),normal:z.needNormals&&z.layouts.some(W=>W.some(S=>"normalCompressed"===S.name)), uv0:z.layouts.some(W=>W.some(S=>"uv0"===S.name)),uvRegion:z.layouts.some(W=>W.some(S=>"uvRegion"===S.name)),featureIndex:E.featureIndex};P=y.process(B,!!z.obbData,O,P.byteLength,E,M,L,H,G,I,z.normalReferenceFrame);y._free(L);y._free(O);if(0{u=y;n=null;return u});return n}let n,u;const x={transform:(y,z)=>u&&t(u,y,z),destroy:v};b.destroyContext=function(y){v(y)};b.dracoDecompressPointCloudData=async function(y){u=await r(); const z=[y.geometryBuffer];var {geometryBuffer:A}=y,B=A.byteLength;y=u._malloc(B);B=new Uint8Array(u.HEAPU8.buffer,y,B);B.set(new Uint8Array(A));A=u.dracoDecompressPointCloudData(y,B.byteLength);u._free(y);if(0a(["../../../geometry/projection/projectBuffer"],P,M)),new Promise((P,M)=>a(["../../../geometry/projection"],P,M))]);await E(F,H);y=[0,0,0];if(!N(A,F,0,y,H,0,1))throw Error("Failed to project");if("georeferenced"===C.type&&null==C.origin){var G=new Float64Array(B.length);if(!N(B,F,0,G,H, 0,G.length/3))throw Error("Failed to project");}else{G="georeferenced"===C.type?k.fromJSON(C):h.fromJSON(C);const {project:P}=await new Promise((M,K)=>a(["../../../geometry/support/meshUtils/projection"],M,K));F=P({positions:B,transform:z?{localMatrix:z}:void 0,vertexSpace:G,inSpatialReference:F,outSpatialReference:H,localMode:D});if(!F)throw Error("Failed to project");G=p.toFloat64Array(F)}F=G.length;const [I,O,L]=y;for(H=0;H(new Promise((h,f)=>a(["../../chunks/i3s"],h,f))).then(h=>h.i3s).then(({default:h})=>{const f=h({locateFile:l,onRuntimeInitialized:()=>k(f)});delete f.then}))).catch(k=>{throw k;});return p};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/Highlights":function(){define(["../../../../core/arrayUtils", "../../../../core/handleUtils","../II3SMeshView3D"],function(a,b,q){class l{constructor(){this.ids=new Set}}class p{constructor({collection:k,forAllFeatures:h,forAllFeaturesOfNode:f}){this._highlights=[];this._collection=k;this._forAllFeatures=h;this._forAllFeaturesOfNode=f}destroy(){this._highlights.forEach(k=>this._releaseSet(k));this._highlights=null}acquireSet(){const k=new l;this._highlights.push(k);const h=b.makeHandle(()=>{this._highlights&&(this._releaseSet(k),a.removeUnordered(this._highlights, k))});return{set:k,handle:h}}setFeatureIds(k,h){h.forEach(f=>k.ids.add(f));this._initializeSet(k)}_initializeSet(k){this._forAllFeatures((h,f,c)=>{k.ids.has(h)&&this._collection.addComponentHighlight(c.objectHandle,f);return q.ForAllFeaturesReturnType.CONTINUE})}_releaseSet(k){this._forAllFeatures((h,f,c)=>{k.ids.has(h)&&this._collection.removeComponentHighlight(c.objectHandle,f);return q.ForAllFeaturesReturnType.CONTINUE})}objectCreated(k){this._highlights.forEach(h=>{this._forAllFeaturesOfNode(k, (f,c)=>{h.ids.has(f)&&this._collection.addComponentHighlight(k.objectHandle,c);return q.ForAllFeaturesReturnType.CONTINUE})})}objectDeleted(k){this._collection.clearHighlights(k.objectHandle)}}return p})},"esri/views/3d/layers/i3s/I3SAsyncElevationUpdater":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../II3SMeshView3D ../graphics/ExtentSet ../../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){a.I3SAsyncElevationUpdater=class extends q{constructor(d,t,w,v){super({});this._updateExtent=t;this._updateNode=w;this._getElevationMode=v;this.running=!1;this._extentSet=new e.ExtentSet;this._nodeSet=new Set;t=this._taskPriority;d=d.registerTask(this._taskPriority,this);this.addHandles(d);this._task=d;this._lastTaskPriority=t}get _taskPriority(){const d=this._getElevationMode();return d?d===c.ElevationMode.RelativeToGround?g.TaskPriority.ELEVATION_ALIGNMENT_SCENE: g.TaskPriority.ELEVATION_ALIGNMENT:g.TaskPriority.ELEVATION_ALIGNMENT}_updateTaskPriority(){const d=this._taskPriority;d!==this._lastTaskPriority&&(this._lastTaskPriority=this._task.priority=d)}normalizeCtorArgs(){return{}}addExtent(d){this._extentSet.add(d);this._updateTaskPriority();this.running=!0}schedule(d){this._nodeSet.add(d);this._updateTaskPriority();this.running=!0}remove(d){this._nodeSet.delete(d);this._updateRunning()}runTask(d){const t=this._extentSet;for(d.run(()=>t.merge(d));!t.empty&& !d.done;){var w=this._updateExtent(t.pop());null!=w&&w.forAll(v=>this.schedule(v));d.madeProgress()}if(!d.done){w=this._nodeSet;for(const v of w)if(w.delete(v),this._updateNode(v),d.madeProgress(),d.done)break;this._updateRunning()}}_updateRunning(){this.running=0this._updateAllNodeFading(e)}),this._view.notifyLODUpdate()); null==h.lodCrossfadeProgress&&(this._numFadingNodes++,this._view.notifyUpdate());h.lodCrossfadeSignedDuration=c;h.lodCrossfadeProgress=f}_updateAllNodeFading(h){const f=this._view.nodeCrossfadingEnabled;this._view.foreachCrossfadeNode((c,e)=>{if(null!=c?.lodCrossfadeProgress){const g=c.lodCrossfadeSignedDuration,d=c.lodCrossfadeProgress+Math.abs(h.deltaTime/g),t=!f||1<=d||0===g,w=(0g&&this._view.markNodeToRemove(e)):c.lodCrossfadeProgress= d;this._view.setNodeOpacityByIndex(e,w)}});this._view.removeMarkedNodes()}stopAllNodeFading(){this._view.foreachCrossfadeNode((h,f)=>{null!=h?.lodCrossfadeProgress&&(this.stopNodeFading(h),h=h.lodCrossfadeSignedDuration,0>h&&this._view.markNodeToRemove(f),this._view.setNodeOpacityByIndex(f,0C,z=C=>C;const A=f.getVerticalOffsetI3S(g.verticalOffset??(this._needVerticalOffset?0:null));null!=g.verticalOffset&&null!=A&&(y=C=>A.applyToMbs(C),z=C=>A.applyToObb(C));const B=new h.MeshIntersectionOptions(v,g.options.normalRequired);this._traverseNodeHierarchy((C,D)=>{if(0===C.childrenLoaded)return!1;const F=C.serviceObbInRenderSR?.isValid?C.serviceObbInRenderSR: null;if(F&&!z(F).intersectRay(t,u,x))return!1;!D||!F&&q.isValidMbs(C.serviceMbsInRenderSR)&&!c(y(C.serviceMbsInRenderSR),t,u,x)||null!=C.geometryObbInRenderSR&&!z(C.geometryObbInRenderSR).intersectRay(t,u,x)||this._collection.intersect(D,t,w,x,A,B,(H,N,E,G)=>{if(!(0>N||null!=d&&!d(t,w,N))){var I=O=>{const L=new l.I3sTarget(this.layerUid,this.sublayerUid,C.index,H,G);O.set(this.type,L,N,E)};this.isGround&&(null==r.ground.dist||Nr.max.dist)&&I(r.max),n)){const O=p.newIntersectorResult(g.ray);I(O);g.results.all.push(O)}}});return!0})}}a.I3SIntersectionHandler=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SOverrides":function(){define("exports ../../../../chunks/tslib.es6 ../../../../request ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/asyncUtils ../../../../core/byteSizeEstimations ../../../../core/Collection ../../../../core/handleUtils ../../../../core/has ../../../../core/Logger ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/ReactiveSet ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/spatialReferenceUtils ../../../../intl/number ../../../../layers/support/featureQueryAll ../../../../rest/support/meshFeatureSet ../../../../support/featureFlags ../../../../support/requestUtils ../../../ViewingMode ../FeatureLayerView3D".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){function D(N,E,G,I){return`Displaying the edits of a SceneLayer with a${I===H.Mode?N.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${N.wkid}) in ${G} viewing mode${I===H.SpatialReference?` with spatial reference (wkid:${E.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${I===H.Mode?"viewing mode":"view spatial reference"} to display edits.`} a.I3SOverrides=class extends l{constructor(N){super(N);this._warnMaximumChangedObjectsExceeded=!1;this._maximumNumberOfEditOVerrides=5E4;this._original3DOFLDefinitionExpression=null;this._interactiveEditingSessions=new f;this.geometryOverrides=new f;this._clientGeometryCache=new Map;this._associatedLayerView=null;this._attributeChangedObjectIds=new w;this._geometryChangedObjectIds=new w;this._pendingFetchChangedObjectIds=null;this._pendingFetchAbortController=new AbortController;this._featureIdLocks= new Map}initialize(){this._memCache=this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`);this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal);this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchChangedObjectIds=this._pendingFetchAbortController=null});this.is3DOFL&&null!=this._associatedLayer&&(z.direct3DObjectFeatureLayerDisplayEnabled()?this._associatedLayer.load().then(N=>{this.destroyed||(this._original3DOFLDefinitionExpression= N.definitionExpression,this.addHandles(v.watch(()=>this._definitionExpression,E=>N.definitionExpression=E,v.initial)),this._associatedLayerView=new C({layer:this._associatedLayer,view:this.view}))}):z.i3sPatchingEnabled())}destroy(){this.is3DOFL&&null!=this._associatedLayer&&(z.direct3DObjectFeatureLayerDisplayEnabled()?null!=this._associatedLayerView&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression):z.i3sPatchingEnabled());this._set("layer",null);this._memCache= d.destroyMaybe(this._memCache);this._pendingFetchAbortController=d.abortMaybe(this._pendingFetchAbortController);this._pendingFetchChangedObjectIds=null;this._featureIdLocks.clear()}get is3DOFL(){return z.sceneLayerEditingEnabled()&&null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((N,E)=>N-E):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return 0{E.remove(G)});E.unshift(G);return G}async applyAttributeOverrides(N,E,G,I=[]){this._pendingFetchChangedObjectIds&&await t.whenOrAbort(this._pendingFetchChangedObjectIds,G);if(null!=E){var {attributeData:O,loadedAttributes:L}=E;if(null!=L&&null!=O&&0!==this._attributeChangedObjectIds.size){E=new Set;for(var P of L)E.add(P.index);for(const K of I)E.has(K.index)||(L.push(K),O[K.name]=Array(N.length));I=await this._lockFeatureIds(N);try{P={attributeData:O, loadedAttributes:L};const K=this._getOverridesFromCache(N,P,this._attributeChangedObjectIds),{objectIds:J,fieldNames:R}=K;if(0!==J.length&&0!==R.length){var M=await this._queryAttributeOverridesFromAssociatedLayer(J,R,G);null!=M&&this._processOverridesFromAssociatedLayer(N,M,R,P)}}finally{I.remove()}}}}updateGeometry(N,E){this._geometryChangedObjectIds.add(N);const G=this._clientGeometryCache.get(N);null!=G&&(this.geometryOverrides.remove(G),this._clientGeometryCache.delete(N));null!=E&&(E={oid:N, mesh:E},this.geometryOverrides.add(E),this._clientGeometryCache.set(N,E))}updateAttributeValue(N,E,G){this._attributeChangedObjectIds.add(N);this._cacheAttributeValue(N,E,G)}featureAdded(N){this.is3DOFL&&z.i3sPatchingEnabled()&&this._geometryChangedObjectIds.add(N);this._attributeChangedObjectIds.add(N)}_cacheAttributeValue(N,E,G){this._memCache.put(this._getAttributeCacheKey(N,E),G,this._memCacheAttributeValueSize(G))}_getOverridesFromCache(N,{loadedAttributes:E,attributeData:G},I){const O=new Set, L=[];for(var P of E)L[P.index]=G[P.name];G=new Set;for(P=0;PL-P);E=p.splitIntoChunks(E,O).map(L=>{const P=G.clone();P.objectIds=L;return k.resultOrAbort(x.queryAllJSON(N,P,{signal:I}))});return Promise.all(E)}_processOverridesFromAssociatedLayer(N, E,G,{loadedAttributes:I,attributeData:O}){var L=this._associatedLayer;if(null!=L){L=L.objectIdField;var P=G.map(J=>{J in O||(O[J]=Array(N.length));return O[J]}),M=new Map(I.map(J=>[J.name,J.index]));I=G.map(J=>M.get(J));var K=new Map(Array.from(N,(J,R)=>[J,R]));for(const J of E){E=J.attributes[L];for(let R=0;RK-J);for(L=0;L{for(const O of N)E.delete(O);I.resolve()})}get test(){}};b.__decorate([m.property({constructOnly:!0})],a.I3SOverrides.prototype,"view",void 0);b.__decorate([m.property({constructOnly:!0})],a.I3SOverrides.prototype,"layer",void 0);b.__decorate([m.property({readOnly:!0})],a.I3SOverrides.prototype, "is3DOFL",null);b.__decorate([m.property()],a.I3SOverrides.prototype,"_interactiveEditingSessions",void 0);b.__decorate([m.property({readOnly:!0})],a.I3SOverrides.prototype,"sortedGeometryChangedObjectIds",null);b.__decorate([m.property({readOnly:!0})],a.I3SOverrides.prototype,"geometryOverrides",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_clientGeometryCache",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_associatedLayer",null);b.__decorate([m.property()],a.I3SOverrides.prototype, "_associatedLayerView",void 0);b.__decorate([m.property({constructOnly:!0})],a.I3SOverrides.prototype,"memoryController",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_attributeChangedObjectIds",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_geometryChangedObjectIds",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"hasGeometryChanges",null);b.__decorate([m.property()],a.I3SOverrides.prototype,"_pendingFetchChangedObjectIds",void 0);b.__decorate([m.property()], a.I3SOverrides.prototype,"_pendingFetchAbortController",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_definitionExpression",null);b.__decorate([m.property()],a.I3SOverrides.prototype,"updating",null);b.__decorate([m.property()],a.I3SOverrides.prototype,"isEmpty",null);a.I3SOverrides=b.__decorate([r.subclass("esri.views.3d.layers.i3s.I3SOverrides")],a.I3SOverrides);class F{constructor(N,E){this.objectId=N;this._remove=E;this._updates=new Map;this._isActive=!0}getAttribute(N){return this._updates.get(N)}setAttribute(N, E){this.isActive&&this._updates.set(N,E)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}var H;(function(N){N[N.Mode=0]="Mode";N[N.SpatialReference=1]="SpatialReference"})(H||={});Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/rest/support/meshFeatureSet":function(){define("exports ../../Graphic ../../core/Logger ../../core/MapUtils ../../geometry/Extent ../../geometry/Mesh ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/MeshTransform ../../geometry/support/meshUtils/External ../../layers/support/infoFor3D ./FeatureSet".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d){function t(u){return({attributes:x})=>{if(!x)return{};if(!u)return x;for(const y in x)u.has(y)||delete x[y];return x}}function w(u,x,y,z,A){var B=A.get(u.attributes[x]);if(null==B||!u.geometry)return null;x=v(u,y,z);A=p.fromJSON(u.geometry);A.spatialReference=y;u=m(u.attributes,z);y=y.isGeographic?"local":"georeferenced";a:{B=Array.from(B.files.values());z=[];for(C of B){if(C.status!==n.COMPLETED){var C=null;break a}B=[];for(const D of C.parts){if(!D){C=null;break a}B.push(new e.ServiceAssetPart(D.url, D.hash))}z.push(new e.ServiceAsset(C.name,C.mimeType,B))}C=z}return C?k.createWithExternalSource(x,C,{extent:A,transform:u,vertexSpace:y}):k.createIncomplete(x,{extent:A,transform:u,vertexSpace:y})}function v({attributes:u},x,{transformFieldRoles:y}){return new h({x:u[y.originX],y:u[y.originY],z:u[y.originZ],spatialReference:x})}function m(u,{transformFieldRoles:x}){return new c({translation:[u[x.translationX],-u[x.translationZ],u[x.translationY]],rotationAxis:[u[x.rotationX],-u[x.rotationZ],u[x.rotationY]], rotationAngle:u[x.rotationDeg],scale:[u[x.scaleX],u[x.scaleZ],u[x.scaleY]]})}function r(u,x){const y=new Map;for(const A of x){var z=A.parentGlobalId;if(null==z)continue;const B=A.assetName,C=A.assetType;x=A.assetHash;const D=A.assetURL,F=A.conversionStatus,H=A.seqNo,N=g.getFormatIdMimeType(C,u.supportedFormats);N?(z=l.getOrCreateMapValue(y,z,()=>({files:new Map})),l.getOrCreateMapValue(z.files,B,()=>{a:switch(F){case "COMPLETED":case "SUBMITTED":var E=n.COMPLETED;break a;case "INPROGRESS":E=n.PENDING; break a;default:E=n.FAILED}return{name:B,type:C,mimeType:N,status:E,parts:[]}}).parts[H]={hash:x,url:D}):q.getLogger("esri.rest.support.meshFeatureSet").error("mesh-feature-set:unknown-format",`Service returned an asset of type ${C}, but it does not list it as a supported type`)}return y}var n;(function(u){u[u.FAILED=0]="FAILED";u[u.PENDING=1]="PENDING";u[u.COMPLETED=2]="COMPLETED"})(n||={});a.assetMapFromAssetMapsJSON=r;a.extractMesh=w;a.meshFeatureSetFromJSON=function(u,x,y){var z=y.features;y.features= [];delete y.geometryType;const A=d.fromJSON(y);A.geometryType="mesh";if(!y.assetMaps)return A;const B=r(x,y.assetMaps),C=u.sourceSpatialReference??f.WGS84;y=y.globalIdFieldName;({outFields:u}=u);u=null!=u&&0({});for(const D of z)z=w(D,y,C,x,B),A.features.push(new b({geometry:z,attributes:u(D)}));return A};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/IDBCache":function(){define(["exports","../../../../core/ByteSizeUnit", "../../../../core/Error","../../../../core/promiseUtils"],function(a,b,q,l){function p(f){return new Promise((c,e)=>{f.oncomplete=()=>c();f.onerror=()=>e(f.error);f.onabort=()=>e(f.error)})}function k(f){return new Promise((c,e)=>{"done"===f.readyState?null!=f.error?e(f.error):c(f.result):(f.onsuccess=()=>c(f.result),f.onerror=()=>e(f.error))})}class h{constructor(f,c,e=14){this._version=e;this._quotaReductionPromise=this._db=null;this._miss=this._hit=this._gcCounter=0;this._destroyed=!1;this.gcFrequency= 50;this.maxByteSize=b.ByteSizeUnit.GIGABYTES;this.quotaReductionFactor=.2;this._dbName=f;this._storeName=c}init(){return Promise.resolve().then(()=>{const f=indexedDB.open(this._dbName,this._version);f.onupgradeneeded=c=>{var e=f.result;const g=f.transaction,d=e.objectStoreNames.contains(this._storeName)?g.objectStore(this._storeName):e.createObjectStore(this._storeName);e=e.objectStoreNames.contains("last_access")?g.objectStore("last_access"):e.createObjectStore("last_access");e.indexNames.contains("date")|| e.createIndex("date","date",{unique:!1});e.indexNames.contains("byteSize")||e.createIndex("byteSize","byteSize",{unique:!1});c.oldVersion{this._destroyed?f.close():this._db=f})}destroy(){this._db&&(this._db.close(),this._db=null);this._destroyed=!0}get initialized(){return null!=this._db}getHitRate(){return this._hit/(this._hit+this._miss)}put(f,c){return null==this._db?Promise.reject(new q("indexedb:not-initialized","IndexedDB Cache is not initialized")): (null!=this._quotaReductionPromise?this._quotaReductionPromise:Promise.resolve()).then(()=>this._put(f,c)).catch(e=>{if(e&&"QuotaExceededError"===e.name)return null==this._quotaReductionPromise&&(this._quotaReductionPromise=this._getCacheSize().then(g=>this._removeLeastRecentlyAccessed(c.byteSize+Math.ceil(g*this.quotaReductionFactor))),this._quotaReductionPromise.then(()=>this._quotaReductionPromise=null,()=>this._quotaReductionPromise=null)),this._quotaReductionPromise.then(()=>this._put(f,c)); throw e;}).then(()=>{this._gcCounter--;0>this._gcCounter&&null!=this._db&&(this._gcCounter=this.gcFrequency,this._getCacheSize().then(e=>this._removeLeastRecentlyAccessed(e-this.maxByteSize)))})}get(f,c){const e=this._db;if(null==e)return Promise.resolve(void 0);let g=null;return Promise.resolve().then(()=>{const d=e.transaction(this._storeName,"readonly");g=l.onAbort(c,()=>{d.abort()});const t=d.objectStore(this._storeName).get(f);return k(t)}).then(d=>{null==d?++this._miss:this._db&&(++this._hit, this._db.transaction("last_access","readwrite").objectStore("last_access").put({date:Date.now(),byteSize:d.byteSize},f));null!=g&&g.remove();return d}).catch(()=>{++this._miss;l.throwIfAborted(c);null!=g&&g.remove()})}remove(f){const c=this._db;return null==c?Promise.resolve():Promise.resolve().then(async()=>{const e=c.transaction([this._storeName,"last_access"],"readwrite");var g=e.objectStore(this._storeName),d=e.objectStore("last_access");g=g.delete(f);d=d.delete(f);await Promise.all([k(g),k(d), p(e)])})}_put(f,c){var e=this._db;if(null==e)return Promise.resolve();e=e.transaction([this._storeName,"last_access"],"readwrite");var g=e.objectStore(this._storeName);const d=e.objectStore("last_access");g=g.put(c,f);f=d.put({date:Date.now(),byteSize:c.byteSize},f);return Promise.all([k(g),k(f),p(e)])}_removeLeastRecentlyAccessed(f){if(0>=f||!this._db)return Promise.resolve();const c=this._db.transaction([this._storeName,"last_access"],"readwrite"),e=c.objectStore(this._storeName),g=c.objectStore("last_access"); let d=0;const t=g.index("date").openCursor(null,"next");t.onsuccess=()=>{const w=t.result;null!=w&&(null!=w.value.byteSize&&(d+=w.value.byteSize),e.delete(w.primaryKey),g.delete(w.primaryKey),d{const g=e.result;if(g){var d=g.key;null!=d&&(c+=d);g.continue()}};return p(f).then(()=> c)}}a.IDBCache=h;a.whenRequest=k;a.whenTransaction=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/IDBMockCache":function(){define(["exports"],function(a){const b=new WeakMap;class q{constructor(l,p){this._hit=this._miss=0;this.initialized=!0;switch(p){case "layer":this._data=new Map;break;case "view":(p=b.get(l))?this._data=p:(this._data=p=new Map,b.set(l,p))}}init(){return Promise.resolve()}async get(l,p){if(this._data.has(l))return this._hit++,this._data.get(l)?? void 0;this._miss++}destroy(){}put(l,p){this._data.set(l,p);return Promise.resolve()}remove(l){this._data.delete(l);return Promise.resolve()}getHitRate(){return this._hit/(this._hit+this._miss)}}a.IDBMockCache=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/LayerElevationProvider":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/Logger ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/support/aaBoundingRect ../../../../chunks/sphere ../../support/ElevationRange ../../support/ElevationUpdateEvent ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){a.LayerElevationProvider=class extends l.EventedMixin(q){constructor(D){super(D);this._tmpEvent=new n.ElevationUpdateEvent;this._renderCoordsHelper=D.view.renderCoordsHelper;this._renderSR=this._renderCoordsHelper.spatialReference;this._layerElevationSource=D.layerElevationSource}initialize(){this._intersector=u.newIntersector(this.view.state.viewingMode);this._intersector.options.store=x.StoreResults.MIN;this._intersector.options.normalRequired=!1; this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}get spatialReference(){return this.view?.elevationProvider?.spatialReference}getElevation(D,F,H,N){const E=this._renderCoordsHelper;D=d.set(A,D,F,H);if(!E.toRenderCoords(D,N,D))return p.getLogger(this).error("could not project point to compute elevation"),null;const {layerElevationSource:G,_intersector:I,intersectionHandler:O}=this;N=G.fullExtent;F=null!=N&&Number.isFinite(N.xmin)&&Number.isFinite(N.xmax)&&Number.isFinite(N.ymin)&& Number.isFinite(N.ymax)&&Number.isFinite(N.zmin)&&Number.isFinite(N.zmax)?new r.ElevationRange(N.zmin,N.zmax):G.elevationRange;if(null==F)return null;H=G.elevationOffset;N=F.elevationRangeMin+H;F=E.setAltitude(B,F.elevationRangeMax+H,D);N=E.setAltitude(C,N,D);I.reset(F,N,null);O.intersect(I,null,F,N,null,!0);return I.results.min.getIntersectionPoint(D)?E.getAltitude(D):null}getSphereElevationBounds(D,F){w.projectBoundingSphere(D,F,z,this._renderSR);return this._layerElevationSource.getElevationRange(z)}getRootElevationBounds(){const D= this.layerElevationSource.fullExtent;return D?.hasZ?new r.ElevationRange(D.zmin,D.zmax):null}objectsChanged(D){this.spatialReference&&(this._computeLayerExtent(D,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}objectChanged(D){this.spatialReference&&(this._computeObjectExtent(D,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(D,F){v.empty(F); this._expandExtent(D,F)}_computeLayerExtent(D,F){v.empty(F);for(const H of D)this._expandExtent(H,F)}_expandExtent(D,F){const H=this.spatialReference;if(null!=H&&null!=D){e.fromQuat(y,D.quaternion);y[12]=D.center[0];y[13]=D.center[1];y[14]=D.center[2];D=D.halfSize;for(let N=0;8>N;++N)A[0]=N&1?D[0]:-D[0],A[1]=N&2?D[1]:-D[1],A[2]=N&4?D[2]:-D[2],d.transformMat4(A,A,y),this._renderCoordsHelper.fromRenderCoords(A,A,H),v.expand(F,A,F)}}};b.__decorate([k.property({constructOnly:!0})],a.LayerElevationProvider.prototype, "layerElevationSource",void 0);b.__decorate([k.property({constructOnly:!0})],a.LayerElevationProvider.prototype,"intersectionHandler",void 0);b.__decorate([k.property({constructOnly:!0})],a.LayerElevationProvider.prototype,"view",void 0);b.__decorate([k.property()],a.LayerElevationProvider.prototype,"spatialReference",null);a.LayerElevationProvider=b.__decorate([c.subclass("esri.views.3d.layers.i3s.LayerElevationProvider")],a.LayerElevationProvider);const y=g.create(),z=m.fromValues(0,0,0,0),A=t.create(), B=t.create(),C=t.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/makeScheduleFunction":function(){define(["exports"],function(a){a.makeScheduleFunction=function(b){return q=>{if(b.immediate)return b.immediate.schedule(q);console.error("No immediate scheduler");throw Error("No immediate scheduler");}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ObjectParameters":function(){define(["exports"], function(a){class b{constructor(q,l,p,k){this.toMapSpace=q;this.transform=l;this.obb=p;this.geometry=k}}a.ObjectParameters=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Transform":function(){define(["exports"],function(a){class b{constructor(q,l){this.position=q;this.rotationScale=l;this.origin=void 0}}a.Transform=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/featureEditing":function(){define(["exports", "../../../../core/asyncUtils","../../../../core/lang","../../../../layers/support/featureQueryAll"],function(a,b,q,l){function p(t,w,v,m,r=null,n=!0){const u=[];t={gidToFeatureInfo:new Map,oidToFeatureInfo:new Map,featuresResolved:null==v,fieldsIndex:t.fieldsIndex,objectIdField:t.objectIdField,globalIdField:t.globalIdField,featureOrIdentifierList:v};for(const A of w)if(null==A.error){w=A.objectId??-1;v=A.globalId;if(-1===w||n){var x=w;var y=v,z=t;const {gidToFeatureInfo:B,oidToFeatureInfo:C,fieldsIndex:D, objectIdField:F,globalIdField:H,featureOrIdentifierList:N}=z;if(!z.featuresResolved&&null!=N){for(const E of N){const G={feature:null,oid:-1,gid:null};if("attributes"in E){G.feature=E;const I=E.attributes;if(null!=I)for(const O in I){if(-1!==G.oid&&null!=G.gid)break;const L=D.normalizeFieldName(O);L===F&&(G.oid=I[O]??-1);L===H&&(G.gid=I[O])}}else G.oid=E.objectId??-1,G.gid=E.globalId;null!=G.gid&&B.set(G.gid,G);-1!==G.oid&&C.set(G.oid,G)}z.featuresResolved=!0}x=(-1!==x?C.get(x):null)??(null!=y?B.get(y): null)}else x=null;x=x??{feature:null,oid:w,gid:v};w={oid:-1===w?x.oid:w,gid:v??x.gid,feature:x.feature,result:A};u.push(w);-1===w.oid&&null!=w.gid&&null!=r&&(w.oid=r.get(w.gid)??-1);-1===w.oid&&null!=w.gid&&(v=m.get(w.gid),null==v&&(v=[],m.set(w.gid,v)),v.push(w))}return u}async function k(t,w){t=t.i3sOverrides.layer.associatedLayer;if(null!=t?.globalIdField){var v=t.createQuery(),{objectIdField:m,globalIdField:r}=t;v.where=Array.from(w.keys()).map(n=>`${r}='${n}'`).join(" OR ");v.returnGeometry= !1;v.outFields=[m,r];v.cacheHint=!1;t=await b.resultOrAbort(l.queryAllJSON(t,v));if(t.ok){t=t.value.features;for(const n of t)if(v=n.attributes[r],t=n.attributes[m],null!=v&&null!=t&&-1!==t&&(v=w.get(v),null!=v))for(const u of v)u.oid=t}}}function h(t,w){const v=new Map;w=w.adds;if(!w||0===w.length||null==t.globalIdField)return v;for(const m of w)t=m.oid,w=m.feature,"mesh"===w?.geometry?.type&&v.set(t,w);return v}function f(t,w){const v=w.updates;if(!v||0===v.length)return new d;const m=new d;w=new Map; for(let r=0;r{for(const A of v){if(null==A.feature)continue;const B=A.feature,C=A.oid,D=n.indexOf(C);for(const F in B.attributes){var u=t.fieldsIndex.normalizeFieldName(F);var x=m;var y=r.index,z=x.get(y);z?x=z:(z=new g,x.set(y,z),x=z);(y=null!=u&&x.get(u))?u=y:(y=[],x.set(u,y),u=y);u.push({featureIndex:D,featureId:C,value:B.attributes[F]})}}});return m}const c={setAttribute(){},rollback(){},commit(){}}; var e;(function(t){t[t.EDITING=0]="EDITING";t[t.ROLLED_BACK=1]="ROLLED_BACK";t[t.COMMITTED=2]="COMMITTED"})(e||={});const g=Map,d=Map;a.createInteractiveEditSession=function(t,w){const v=w.attributes[t.objectIdField];if(null==v)return c;var m=t.sessions.get(v);if(m)return m;const r=q.clone(w.attributes),n=new Set,u=t.i3sOverrides.createInteractiveEditSession(v),x=new Map;let y=e.EDITING;m={setAttribute(z,A){if(y===e.EDITING){var B=t.fieldsIndex.get(z);if(B){var C=t.attributeStorageInfo.findIndex(H=> H.name===B.name);if(!(0>C)){if(!(z in r))throw Error(`Attribute "${z}" is not an attribute of the edited feature.`);u.setAttribute(C,A);var D=t.attributeStorageInfo[C],F=!1;n.add(z);t.forEachNode((H,N)=>{var E=x.get(H);null==E?(N=N.indexOf(v),x.set(H,N)):N=E;if(-1!==N&&(E=t.getAttributeData(H.index))){const G=E[D.name];G&&(G[N]=A,t.setAttributeData(H.index,E,w),F=!0)}});F&&t.clearMemCache()}}}},rollback(){if(y===e.EDITING){for(const z of n)this.setAttribute(z,r[z]);u.remove();y=e.ROLLED_BACK;t.sessions.delete(v)}}, commit(){y===e.EDITING&&(u.remove(),y=e.COMMITTED,t.sessions.delete(v))}};t.sessions.set(v,m);return m};a.normalizeEditResultsEvent=async function(t,w){const v=new Map,m=p(t,w.addedFeatures,w.edits?.addFeatures,v),r=p(t,w.updatedFeatures,w.edits?.updateFeatures,v);w=p(t,w.deletedFeatures,w.edits?.deleteFeatures,v,w.globalIdToObjectId,!1);0-1!==n.oid),updates:r.filter(n=>-1!==n.oid),deletes:w.filter(n=>-1!==n.oid)}};a.processAttributeEdits=function(t,w){var v= f(t,w);w=h(t,w);if(0!==v.size||0!==w.size){var m=new Map;for(var r=0;r{const C=t.getAttributeData(B);let D=!1;A.forEach((F,H)=>{const N=null!=C?C[H]:null;H=m.get(H);for(const {featureIndex:E,value:G,featureId:I}of F)N&&(N[E]=G,n=D=!0),t.i3sOverrides.updateAttributeValue(I,H,G)});D&&t.setAttributeData(B,C,null)});n&&t.clearMemCache();var {fieldsIndex:u,i3sOverrides:x,objectIdField:y,globalIdField:z}= t;v=x.layer.associatedLayer?.infoFor3D;v=new Set(v?[...Object.values(v.assetMapFieldRoles),...Object.values(v.transformFieldRoles)]:[]);for(const [A,B]of w){x.featureAdded(A);({attributes:w}=B);for(const C in w)C!==y&&C!==z&&v.has(C)||(r=u.normalizeFieldName(C),r=null!=r?m.get(r):null,null!=r&&x.updateAttributeValue(A,r,w[C]))}}};a.processGeometryEdits=function(t,w){const v=new Map,m=r=>{for(const {oid:n,feature:u}of r)r=u?.geometry,"mesh"===r?.type&&v.set(n,r)};m(w.adds);m(w.updates);for(const r of w.deletes)v.set(r.oid, null);for(const [r,n]of v)t.i3sOverrides.updateGeometry(r,n)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SMeshViewFilter":function(){define("require exports ../../../../chunks/tslib.es6 ../../../../geometry ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/Logger ../../../../core/mathUtils ../../../../core/maybeUpdating ../../../../core/reactiveUtils ../../../../core/unitUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/sql/WhereClause ../../../../geometry/ellipsoidUtils ../../../../geometry/projection ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/projection/projectVectorToVector ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/DoubleArray ../../../../geometry/support/Ellipsoid ../../../../geometry/support/spatialReferenceUtils ../../../../chunks/sphere ../../../../geometry/support/webMercatorUtils ../../../../layers/support/FeatureFilter ./I3SUtil ../../../../geometry/SpatialReference".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G){function I(Y,ha,ba){if(null==ha)return null;if("disjoint"===ba&&"polygon"===ha.type){ba=ha.rings.length;const U=ha.spatialReference,Z=Array(ba);for(let da=0;dada.aabr[0]-ia.aabr[0]);const ca=new Set,ea=new k.PositionHint; for(ha=0;ha{ia>=ka.aabr[2]?ca.delete(ka):da.aabr[1]>ka.aabr[3]||da.aabr[3]=.5*(ha[2]+n.getReferenceEllipsoid(U).radius))return!0;const ca=M(Y,ha,U);return ba.every(ea=> K(Y,ea,ca,Z)!==S.DISCARD)}function L(Y,ha,ba,U,Z,ca,ea,da){const ia=ea[0].spatialReference||Z.spatialReference;if(x.projectBoundingSphere(ba.node.serviceMbsInIndexSR,ca,V,ia)){ca=M(Y,V,ia);var ka=P(da,Z,ia,U,ba.objectHandle);for(const fa of ea){if(0===ha.length)break;switch(K(Y,fa,ca,da)){case S.DISCARD:ha.length=0;return;case S.KEEP:continue}E.filterInPlace(ha,ba.featureIds,X=>Q(Y,fa,X,ka))}}else h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter")} function P(Y,ha,ba,U,Z){ha=ha.renderSpatialReference;const ca=new Map,ea={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:ba};ea.rings[0][3]=ea.rings[0][0];let da,ia;switch(Y){case "intersects":da=(ka,fa,X)=>ka.intersects(fa,X)?S.KEEP:S.TEST;ia=J;break;case "contains":da=(ka,fa,X)=>ka.contains(fa,X)?S.TEST:S.DISCARD;ia=J;break;default:da=(ka,fa,X)=>ka.disjoint(fa,X)?S.TEST:S.DISCARD,ia=R}return{collection:U,object:Z,type:Y,maskSR:ba,renderSR:ha,aabbCache:ca,triangle:ea,positions:{indices:null, data:null,stride:0,startIndex:0,endIndex:0},triangleTest:da,geometryTest:ia}}function M(Y,ha,ba){const U={type:"point",x:ha[0],y:ha[1],hasZ:!1,hasM:!1,spatialReference:ba};ba=!D.isWGS84(ba)&&!D.isWebMercator(ba);ha=Number.isNaN(ha[3])?0:f.clamp(ha[3],0,2*C.earth.radius);Y=ba?Y.buffer(U,ha,1):Y.geodesicBuffer(U,ha,1);Y.type="polygon";return Y}function K(Y,ha,ba,U){switch(U){case "intersects":case "contains":return J(Y,ha,ba);case "disjoint":return R(Y,ha,ba)}}function J(Y,ha,ba){return Y.intersects(ha, ba)?Y.contains(ha,ba)?S.KEEP:S.TEST:S.DISCARD}function R(Y,ha,ba){return Y.intersects(ha,ba)?Y.contains(ha,ba)?S.DISCARD:S.TEST:S.KEEP}function Q(Y,ha,ba,U){const {collection:Z,object:ca,renderSR:ea,maskSR:da,geometryTest:ia,aabbCache:ka}=U;var fa=ka.get(ba);if(!fa){fa=Z.getObjectTransform(ca);Z.getComponentAabb(ca,ba,T);var X=[m.fromValues(T[0],T[1],0),m.fromValues(T[0],T[4],0),m.fromValues(T[3],T[4],0),m.fromValues(T[3],T[1],0)];for(var ja=0;4>ja;++ja)v.transformMat3(X[ja],X[ja],fa.rotationScale), v.add(X[ja],X[ja],fa.position),y.projectVectorToVector(X[ja],ea,X[ja],da);fa={type:"polygon",rings:[X],spatialReference:da,cache:{}};fa.rings[0][4]=fa.rings[0][0];ka.set(ba,fa)}switch(ia(Y,ha,fa)){case S.DISCARD:return!1;case S.KEEP:return!0}const {triangle:la,triangleTest:na,positions:va}=U;fa=la.rings[0][0];X=la.rings[0][1];ja=la.rings[0][2];const za=Z.getObjectTransform(ca);Z.getComponentPositions(ca,ba,va);const {indices:ya,data:Da,stride:ra,startIndex:xa,endIndex:Ma}=va;for(ba=xa;bathis.viewFilter?.geometry||null!=this.layerFilter).then(()=>this.loadAsyncModule((new Promise((Y,ha)=>a(["../../../../geometry/geometryEngine"],Y,ha))).then(Y=>{this.destroyed||(this._geometryEngine=Y)})))}get sortedObjectIds(){if(null==this.viewFilter?.objectIds)return null;const Y=B.doubleArrayFrom(this.viewFilter.objectIds);Y.sort();return Y}get parsedWhereClause(){const Y= this.viewFilter?.where;if(null==Y||!Y)return null;try{return r.WhereClause.create(Y,this.layerFieldsIndex)}catch(ha){h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").error(`Failed to parse filter where clause: ${ha}`)}return null}addFilters(Y,ha,ba,U){const Z=this.sortedObjectIds;null!=Z&&Y.push(ia=>E.objectIdFilter(Z,!0,ia));this.addSqlFilter(Y,this.parsedWhereClause);this.addTimeFilter(Y,this.viewFilter?.timeExtent);const ca=c.unwrapUpdating(this._layerMaskGeometries),ea=this._geometryEngine; if(null!=ca&&null!=this.layerFilter&&null!=ea){const ia=this.layerFilter.spatialRelationship;Y.push((ka,fa)=>L(ea,ka,fa,U,ha,ba,ca,ia))}const da=c.unwrapUpdating(this._viewMaskGeometries);if(null!=da&&null!=this.viewFilter&&null!=ea){const ia=this.viewFilter.spatialRelationship;Y.push((ka,fa)=>L(ea,ka,fa,U,ha,ba,da,ia))}}isMBSGeometryVisible(Y,ha,ba){var U=c.unwrapUpdating(this._layerMaskGeometries);const Z=this._geometryEngine;if(null!=U&&null!=this.layerFilter&&null!=Z){var ca=this.layerFilter.spatialRelationship; ha=U[0].spatialReference||ha;return x.projectBoundingSphere(Y,ba,V,ha)?O(Z,V,U,ha,ca):(h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0)}U=c.unwrapUpdating(this._viewMaskGeometries);return null!=U&&null!=this.viewFilter&&null!=Z?(ca=this.viewFilter.spatialRelationship,ha=U[0].spatialReference||ha,x.projectBoundingSphere(Y,ba,V,ha)?O(Z,V,U,ha,ca):(h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"), !0)):!0}get parsedGeometry(){const Y=c.unwrapUpdating(this._viewMaskGeometries),ha=c.unwrapUpdating(this._layerMaskGeometries);return null==Y||null==ha?Y||ha:ha.concat(Y)}get _layerMaskGeometries(){const Y=this.layerFilter;return null==Y?null:null==this._geometryEngine?c.updating:"disjoint"===Y.spatialRelationship?Y.geometries.map(ha=>({type:"polygon",rings:ha.rings,spatialReference:ha.spatialReference,cache:{}})):[Y.geometries.reduce((ha,ba)=>{ha.rings=[...ha.rings,...ba.rings];return ha},{type:"polygon", rings:[],spatialReference:Y.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;var {geometry:Y}=this.viewFilter;if(null==Y)return null;if(null==this.viewFilter||null==this._geometryEngine)return c.updating;const {distance:ha,units:ba}=this.viewFilter,U=this.viewFilter.spatialRelationship;Y="mesh"===Y.type?Y.extent:Y;if(null==ha||0===ha)return I(this._geometryEngine,Y,U);const Z=ba||g.getUnitString(Y.spatialReference);if(Y.spatialReference.isWGS84)return Y= this._geometryEngine.geodesicBuffer(Y,ha,Z),I(this._geometryEngine,Y,U);var ca=H.project(Y,G.WGS84);if(null!=ca)return Y=H.project(this._geometryEngine.geodesicBuffer(ca,ha,Z),Y.spatialReference),I(this._geometryEngine,Y,U);if(!this._projectionEngineLoaded&&(this.loadAsyncModule(u.load().then(()=>this._projectionEngineLoaded=!0)),!this._projectionEngineLoaded))return null;ca=null;try{ca=u.project(Y,G.WGS84)}catch(ea){}if(ca)try{ca=u.project(this._geometryEngine.geodesicBuffer(ca,ha,Z),Y.spatialReference)}catch(ea){ca= null}ca||h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${Y.spatialReference.wkid}) to WGS84.`);return I(this._geometryEngine,ca,U)}get updating(){return c.isUpdating(this._layerMaskGeometries)||c.isUpdating(this._viewMaskGeometries)}static checkSupport(Y){if(null==Y)return!1;Y=Y.spatialRelationship;return null!=Y&&W.includes(Y)?!0:(h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").warn(`Filters with spatialRelationship other than ${W.join(", ")} are not supported for mesh scene layers`), !1)}};q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"layerFilter",void 0);q.__decorate([d.property({type:N})],b.I3SMeshViewFilter.prototype,"viewFilter",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"layerFieldsIndex",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"loadAsyncModule",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"addSqlFilter",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"addTimeFilter",void 0); q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"sortedObjectIds",null);q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"parsedWhereClause",null);q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"parsedGeometry",null);q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"_layerMaskGeometries",null);q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"_viewMaskGeometries",null);q.__decorate([d.property()], b.I3SMeshViewFilter.prototype,"updating",null);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"_projectionEngineLoaded",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"_geometryEngine",void 0);b.I3SMeshViewFilter=q.__decorate([w.subclass("esri.views.3d.layers.i3s.I3SMeshViewFilter")],b.I3SMeshViewFilter);const W=["contains","intersects","disjoint"];var S;(function(Y){Y[Y.KEEP=0]="KEEP";Y[Y.DISCARD=1]="DISCARD";Y[Y.TEST=2]="TEST"})(S||={});const V=F.fromValues(0,0,0,0), T=z.create();Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/core/maybeUpdating":function(){define(["exports"],function(a){a.isUpdating=function(b){return"updating"===b};a.unwrapUpdating=function(b){return"updating"===b?null:b};a.updating="updating";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SQueryEngine":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Error ../../../../core/maybe ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Extent ../../../../layers/LayerConstants ../../../../layers/graphics/data/QueryEngine ../../../../layers/support/FieldsIndex ../../../../rest/support/FeatureSet ../../../../rest/support/Query".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){const r=t.QueryEngine;a.I3SQueryEngine=class extends q{get spatialReference(){return this.layerView.view.spatialReference}get layer(){return this.layerView.i3slayer}get defaultQueryJSON(){return(new m({outSpatialReference:this.spatialReference})).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}constructor(n){super(n)}initialize(){this.addHandles(this.layerView.on("visible-geometry-changed",()=>this.spatialIndex.events.emit("changed")))}destroy(){this._dataQueryEngineInstance= p.destroyMaybe(this._dataQueryEngineInstance);this._set("layerView",null)}async executeQueryForCount(n,u){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(n),u)}async executeQueryForExtent(n,u){const {count:x,extent:y}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(n),u);n=g.fromJSON(y);return{count:x,extent:n}}async executeQueryForIds(n,u){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(n),u)}async executeQuery(n,u){n=this._ensureQueryJSON(n); if(n.returnGeometry)throw new l("unsupported-query","returnGeometry is not supported when querying a mesh scene layer view, it is only supported when directly querying a scene layer");if(n.returnCentroid)throw new l("unsupported-query","returnCentroid is not yet supported for mesh scene layer queries");u=await this._dataQueryEngine.executeQuery(n,u);u=v.fromJSON(u);u.features.forEach(x=>x.geometry=null);return u}_ensureQueryJSON(n){return null==n?this.defaultQueryJSON:n.toJSON()}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance; const n=this.layer.objectIdField||d.fallbackObjectIDAttribute,u=this.layer.fieldsIndex?.toJSON()||new w([]),x=this.layerView.view.resourceController.scheduler,y=this.spatialReference.toJSON();return this._dataQueryEngineInstance=new r({hasZ:!0,hasM:!1,geometryType:"esriGeometryPolygon",fieldsIndex:u,timeInfo:null,spatialReference:y,objectIdField:n,featureStore:this.spatialIndex,scheduler:x,priority:this.priority})}};b.__decorate([k.property({constructOnly:!0})],a.I3SQueryEngine.prototype,"layerView", void 0);b.__decorate([k.property({constructOnly:!0})],a.I3SQueryEngine.prototype,"priority",void 0);b.__decorate([k.property({constructOnly:!0})],a.I3SQueryEngine.prototype,"spatialIndex",void 0);b.__decorate([k.property()],a.I3SQueryEngine.prototype,"spatialReference",null);b.__decorate([k.property()],a.I3SQueryEngine.prototype,"layer",null);b.__decorate([k.property()],a.I3SQueryEngine.prototype,"defaultQueryJSON",null);a.I3SQueryEngine=b.__decorate([e.subclass("esri.views.3d.layers.i3s.I3SQueryEngine")], a.I3SQueryEngine);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SQueryFeatureAdapter":function(){define(["exports","../../../../geometry/support/aaBoundingBox","../../../../layers/graphics/centroid","../../../../layers/graphics/OptimizedGeometry","./I3SUtil"],function(a,b,q,l,p){class k{constructor(f){this._objectIdField=f.objectIdField;this._getFeatureExtent=f.getFeatureExtent}getObjectId(f){return f.id}getAttributes(f){const {meta:c,index:e}=f,g={}; this._objectIdField&&(g[this._objectIdField]=f.id);f=c.attributeInfo?.attributeData;if(null!=f)for(const d of Object.keys(f))g[d]=p.getCachedAttributeValue(f[d],e);return g}getAttribute(f,c){if(c===this._objectIdField)return f.id;const {meta:e,index:g}=f;f=e.attributeInfo?.attributeData;return null!=f?p.getCachedAttributeValue(f[c],g):null}getGeometry(f){if(f.geometry)return f.geometry;const [c,e,g,d,t]=this._getFeatureExtent(f,h);return new l([5],[c,e,g,d,e,g,d,t,g,c,t,g,c,e,g])}getCentroid(f,c){if(f.geometry)return q.getCentroidOptimizedGeometry(new l, f.geometry,c.hasZ,c.hasM);const [e,g,d,t,w,v]=this._getFeatureExtent(f,h);return new l([0],[(e+t)/2,(g+w)/2,(d+v)/2])}cloneWithGeometry(f,c){const {id:e,index:g,meta:d}=f;return{id:e,index:g,meta:d,geometry:c}}}const h=b.create();a.I3SQueryFeatureAdapter=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SQueryFeatureStore":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../chunks/sphere ../II3SMeshView3D".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){const v=g.create();a.I3SQueryFeatureStore=class extends q{constructor(u){super(u);this.events=new l}forEach(u){this.forAllFeatures(x=>{u(x);return w.ForAllFeaturesReturnType.CONTINUE})}forEachBounds(u,x){const y=this.getFeatureExtent;for(const z of u)x(y(z,v))}forEachInBounds(u,x){this.forAllFeatures(y=>{const z=this.getFeatureExtent(y,r);d.intersects(u,g.toRect(z,n))&&x(y);return w.ForAllFeaturesReturnType.CONTINUE},y=>{e.projectBoundingSphere(y.node.serviceMbsInIndexSR, this.sourceSpatialReference,m,this.viewSpatialReference);if(m[0]>=u[0]&&m[2]<=u[2]&&m[1]>=u[1]&&m[3]<=u[3])return w.ForAllFeaturesReturnType.CONTINUE;y=m[0]-Math.max(u[0],Math.min(m[0],u[2]));const z=m[1]-Math.max(u[1],Math.min(m[1],u[3]));return y*y+z*z<=m[3]*m[3]?w.ForAllFeaturesReturnType.CONTINUE:w.ForAllFeaturesReturnType.SKIP})}};b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,"featureAdapter",void 0);b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype, "forAllFeatures",void 0);b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,"getFeatureExtent",void 0);b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,"sourceSpatialReference",void 0);b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,"viewSpatialReference",void 0);a.I3SQueryFeatureStore=b.__decorate([c.subclass("esri.views.3d.layers.i3s.I3SQueryFeatureStore")],a.I3SQueryFeatureStore);const m=t.fromValues(0,0,0, 0),r=g.create(),n=d.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/DefinitionExpressionSceneLayerView":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Logger ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/sql/WhereClause ../i3s/I3SUtil".split(" "),function(a,b,q,l,p,k,h,f,c){a.DefinitionExpressionSceneLayerView= e=>{e=class extends e{constructor(){super(...arguments);this._definitionExpressionErrors=0;this._maxDefinitionExpressionErrors=20;this.logError=g=>{this._definitionExpressionErrors{const {fieldsIndex:g,renderer:d}=this.layer; return d?this._getFieldsAsync(t=>d.collectRequiredFields(t,g)):null}),this.autoUpdateAsync("labelingFields",async()=>{const {layer:g}=this;return g.labelsVisible?this._getFieldsAsync(d=>e.collectLabelingFields(d,g)):null}),this.autoUpdateAsync("viewFilterFields",()=>{const {layer:g,mergedFilter:d}=this.layerView;return this._getFieldsAsync(t=>e.collectFilterFields(t,g,d))})])}async _getFieldsAsync(g){const d=new Set;try{return await g(d),Array.from(d).sort()}catch(t){return p.getLogger(this).error(t), null}}};b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"layerView",void 0);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"layer",null);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"requiredFields",null);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"rendererFields",void 0);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"labelingFields",void 0);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype, "viewFilterFields",void 0);a.SceneLayerViewRequiredFields=b.__decorate([c.subclass("esri.views.3d.layers.support.SceneLayerViewRequiredFields")],a.SceneLayerViewRequiredFields);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/AsyncUpdate":function(){define("exports ../chunks/tslib.es6 ./Accessor ./Logger ./promiseUtils ./reactiveUtils ./accessorSupport/decorators/property ./accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){const c=e=>{e=class extends e{constructor(){super(...arguments); this._numUpdating=0}get updating(){return 0{++this._numUpdating;try{const v=await w;this.destroyed||this._set(g,v)}catch(v){l.getLogger(this).warn(`Async update of "${String(g)}" failed. Async update functions should not throw exceptions.`)}--this._numUpdating});return k.watch(d,t,k.initial)}};b.__decorate([h.property({readOnly:!0})],e.prototype,"updating",null);b.__decorate([h.property()],e.prototype,"_numUpdating",void 0);return e= b.__decorate([f.subclass("esri.core.AsyncUpdate")],e)};a.AsyncUpdate=class extends c(q){};a.AsyncUpdate=b.__decorate([f.subclass("esri.core.AsyncUpdate")],a.AsyncUpdate);a.AsyncUpdateMixin=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/TemporalSceneLayerView":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/graphics/data/timeSupport ../../../../layers/support/FeatureFilter ../../../../layers/support/timeSupport ../i3s/I3SUtil".split(" "), function(a,b,q,l,p,k,h,f,c,e,g){class d{constructor(t){this.attributeData=t}getAttribute(t,w){return g.getCachedAttributeValue(this.attributeData[w],t)}getAttributeAsTimestamp(t,w){t=this.getAttribute(t,w);return"string"===typeof t?(new Date(t)).getTime():"number"===typeof t||null==t?t:null}}a.TemporalSceneLayerView=t=>{t=class extends t{get timeExtent(){return e.combineTimeExtent(this.i3slayer,this.view?.timeExtent,this._get("timeExtent"))}get mergedFilter(){const {filter:w,timeExtent:v}=this;if(null== v)return w;const m=w?.clone()??new c;null!=v&&(m.timeExtent=m.timeExtent?.intersection(v)??v);return m}getTimeFilterDependencies(){const {timeInfo:w}=this.i3slayer;if(null==w)return[];const {startField:v,endField:m}=w;return[v,m]}addTimeFilter(w,v){if(null!=v){var {timeInfo:m}=this.i3slayer;if(null!=m){var {startField:r,endField:n,useTime:u}=m;if(u&&(null!=r||null!=n)){var x=m.toJSON(),y=v.toJSON();w.push((z,A)=>{var B=A.attributeInfo?.attributeData;if(null!=B){var {startTimeField:C,endTimeField:D}= x;null!=C&&null==B[C]||null!=D&&null==B[D]||(B=f.getTimeOperator(x,y,new d(B)),null!=B&&({featureIds:A}=A,g.filterInPlace(z,A,B)))}})}}}}};b.__decorate([q.property({readOnly:!0})],t.prototype,"timeExtent",null);b.__decorate([q.property()],t.prototype,"mergedFilter",null);return t=b.__decorate([h.subclass("esri.views.3d.layers.support.TemporalSceneLayerView")],t)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/SceneLayerView":function(){define("require ../../chunks/tslib.es6 ../../core/arrayUtils ../../core/Logger ../../core/maybe ../../core/maybeUpdating ../../core/promiseUtils ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/accessorSupport/decorators/subclass ../../geometry/projection ./LayerView".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t){e=class extends t{constructor(){super(...arguments);this._geometryEngine=this.filter=this.layer=null;this._projectionEngineLoaded=!1;this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(w){throw Error("Not implemented");}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return k.unwrapUpdating(this._layerFilter)}get _layerFilter(){const w=this.layer?.filter;if(null== w||1>w.geometries.length)return null;const v=this._geometryEngine;if(null==v||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return k.updating;const m=w.geometries.at(0).spatialReference,r=w.geometries.toArray().map(y=>{try{y=v.simplify(y)}catch(z){return l.getLogger(this).warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(null==y)return null;if(y.spatialReference.equals(m))return y;try{return d.project(y,m)}catch(z){return l.getLogger(this).warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."), null}}).filter(q.isSome).sort((y,z)=>y.extent.xmin-z.extent.xmin),n=new Set,u=[],x=[];for(let y of r){const z=y.extent.xmin;u.length=0;n.forEach(A=>{z>=A.extent.xmax?(x.push(A),n.delete(A)):y.extent.ymin<=A.extent.ymax&&y.extent.ymax>=A.extent.ymin&&v.intersects(y,A)&&u.push(A)});if(0n.delete(A))}n.add(y)}n.forEach(y=>x.push(y)); return 0=w.geometries.length)return!1;const v=w.geometries.at(0).spatialReference;return w.geometries.some(({spatialReference:m})=>!m.equals(v)&&!d.canProjectWithoutEngine(m,v))}get layerFilterUpdating(){return k.isUpdating(this._layerFilter)}initialize(){const {signal:w}=this._abortController;f.whenOnce(()=>this.destroyed||!this._geometryEngine&&this.layer?.filter?.geometries?.length, w).then(async()=>{h.throwIfAbortError(w);this._geometryEngine=await new Promise((v,m)=>a(["../../geometry/geometryEngine"],v,m))}).catch(h.throwIfNotAbortError);this._projectionEngineLoaded=d.isLoaded();f.whenOnce(()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine,w).then(async()=>{h.throwIfAbortError(w);await d.load();this._projectionEngineLoaded=!0}).catch(h.throwIfNotAbortError)}destroy(){this._abortController=p.abortMaybe(this._abortController)}highlight(w){throw Error("Not implemented"); }queryFeatures(w,v){throw Error("Not implemented");}queryObjectIds(w,v){throw Error("Not implemented");}queryFeatureCount(w,v){throw Error("Not implemented");}createQuery(){throw Error("Not implemented");}queryExtent(w,v){throw Error("Not implemented");}};b.__decorate([c.property()],e.prototype,"layer",void 0);b.__decorate([c.property()],e.prototype,"availableFields",null);b.__decorate([c.property()],e.prototype,"maximumNumberOfFeatures",null);b.__decorate([c.property({readOnly:!0})],e.prototype, "maximumNumberOfFeaturesExceeded",null);b.__decorate([c.property()],e.prototype,"filter",void 0);b.__decorate([c.property({readOnly:!0})],e.prototype,"layerFilter",null);b.__decorate([c.property({readOnly:!0})],e.prototype,"_layerFilter",null);b.__decorate([c.property()],e.prototype,"_geometryEngine",void 0);b.__decorate([c.property()],e.prototype,"_projectionEngineLoaded",void 0);b.__decorate([c.property()],e.prototype,"_filterNeedsProjectionEngine",null);b.__decorate([c.property()],e.prototype, "layerFilterUpdating",null);return e=b.__decorate([g.subclass("esri.views.layers.SceneLayerView")],e)})},"esri/views/3d/layers/SceneLayerGraphicsView3D":function(){define("require ../../../chunks/tslib.es6 ../../../Graphic ../../../core/arrayUtils ../../../core/has ../../../core/Logger ../../../core/maybe ../../../core/reactiveUtils ../../../core/typedArrayUtil ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection/projectBuffer ../../../geometry/projection/projectVectorToVector ../../../geometry/support/contains ../../../geometry/support/DoubleArray ../../../geometry/support/zscale ../../../layers/LayerConstants ../../../layers/graphics/dehydratedFeatures ../../../layers/graphics/dehydratedPoint ../../../layers/graphics/hydratedFeatures ../../../layers/graphics/controllers/I3SOnDemandController ../../../layers/support/FeatureFilter ../../../rest/support/Query ../../../support/basemapUtils ./I3SPointsWorkerHandle ./LayerView3D ./graphics/Graphics3DFeatureProcessor ./graphics/QueryEngine ./i3s/featureEditing ./i3s/I3SGraphicsMap ./i3s/I3SOverrides ./i3s/I3SUtil ./support/DefinitionExpressionSceneLayerView ./support/fieldProperties ./support/LayerViewPerformanceInfo ./support/PopupSceneLayerView ./support/SceneLayerViewRequiredFields ./support/TemporalSceneLayerView ../support/debugFlags ../support/orientedBoundingBox ../support/updatingProperties ../webgl-engine/lib/Attribute ../webgl-engine/lib/UpdatePolicy ../../layers/SceneLayerView ../../layers/support/popupUtils ../../support/Scheduler".split(" "), function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U){function Z(fa){return"geometryBuffer"in fa&&null!==fa.geometryBuffer}function ca(fa){const X=fa.attributeInfo,ja=fa.node.index;if(null!=X?.loadedAttributes&&null!=X.attributeData)for(let la=0;la {{const la=X.attributeInfo;if(null==la?.loadedAttributes||null==la.attributeData)fa=!1;else{X=!1;for(const {name:na}of la.loadedAttributes)if(la.attributeData[na]){const va=L.getCachedAttributeValue(la.attributeData[na],ja);va!==fa.attributes[na]&&(fa.attributes[na]=va,X=!0)}fa=X}}return fa},fa=>this.processor.graphicsCore.recreateGraphics(fa));this.holeFilling="always";this.progressiveLoadFactor=1;this.supportsHeightUnitConversion=!0;this._coordinatesOutsideExtentErrors=0;this._maxCoordinatesOutsideExtentErrors= 20}tryRecycleWith(fa,X){return fa.url===this.layer.url&&this._i3sOverrides.isEmpty?fa.load(X).then(()=>{L.checkRecyclable(this.layer,fa,this._i3sOverrides);this.layer=fa;this._i3sOverrides.destroy();this._i3sOverrides=new O.I3SOverrides({view:this.view,layer:fa,memoryController:this.view.resourceController?.memoryController});h.destroyMaybe(this._queryEngine);this._setupQueryEngine();this.processor.resetObjectStates()}):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);this._i3sOverrides= new O.I3SOverrides({view:this.view,layer:this.layer,memoryController:this.view.resourceController?.memoryController});L.checkSpatialReferences(this.layer,this.view.spatialReference,this.view.viewingMode);this._fieldsHelper=new R.SceneLayerViewRequiredFields({layerView:this});this._updatingHandles.add(()=>this.layer.rangeInfos,fa=>this._rangeInfosChanged(fa),f.initial);this._updatingHandles.add(()=>this.layer.renderer,(fa,X)=>this._rendererChange(fa,X));this._updatingHandles.add(()=>[this.parsedDefinitionExpression, this._excludeObjectIdsSorted],()=>this._filterChange());this.addHandles(f.watch(()=>W.debugFlags.I3S_TREE_SHOW_TILES,fa=>{if(fa&&!this._treeDebugger){const X=this._controller.crsIndex;(new Promise((ja,la)=>a(["./support/I3STreeDebugger"],ja,la))).then(({I3STreeDebugger:ja})=>{!this._treeDebugger&&W.debugFlags.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new ja({lv:this,view:this.view,nodeSR:X}))})}else fa||!this._treeDebugger||W.debugFlags.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger= null)},f.initial));this._set("processor",new N.Graphics3DFeatureProcessor({owner:this,preferredUpdatePolicy:Y.UpdatePolicy.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:fa=>this._updateClippingExtent(fa)}));this.processor.elevationAlignment?.events.on("invalidate-elevation",({extent:fa,spatialReference:X})=> this._controller.updateElevationChanged(fa,X));this.supportsHeightUnitConversion&&(this._verticalScale=n.getGeometryZScaler("point",this.layer.spatialReference,this.view.spatialReference));this.addResolvingPromise(this.processor.initializePromise);this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`);this._controller=new A({layerView:this});L.containsDraco(this.layer.geometryDefinitions)&&(this._worker=new F.I3SPointsWorkerHandle(fa=>this.view.resourceController.immediate.schedule(fa))); this.addHandles(this.layer.on("apply-edits",fa=>this._updatingHandles.addPromise(fa.result)));this.addHandles(this.layer.on("edits",fa=>{const X=this._pendingEditsQueue.then(()=>this._handleEdits(fa)).then();this._pendingEditsQueue=X;this._updatingHandles.addPromise(X)}));this.when(()=>{this._setupQueryEngine();this._updatingHandles.add(()=>this.maximumNumberOfFeatures,fa=>this._controller.featureTarget=fa,f.initial);this._updatingHandles.add(()=>this.suspended,fa=>{fa&&this._removeAllNodeData()})})}destroy(){this._treeDebugger= h.destroyMaybe(this._treeDebugger);this._i3sOverrides=h.destroyMaybe(this._i3sOverrides);this._set("processor",h.destroyMaybe(this.processor));this._controller=h.destroyMaybe(this._controller);this._queryEngine=h.destroyMaybe(this._queryEngine);this._worker=h.destroyMaybe(this._worker);this._memCache=h.destroyMaybe(this._memCache);this.loadedGraphics.clear();this._fieldsHelper=h.destroyMaybe(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress?? 1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){return this.processor?.graphicsCore?.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(fa){null!=fa?(this._override("maximumNumberOfFeatures",fa),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return this.suspended?!1:!!this._controller?.useMaximumNumberOfFeatures&& !this._controller.leavesReached}get _excludeObjectIdsSorted(){const fa=this.layer.excludeObjectIds;return fa.length?fa.toArray().sort((X,ja)=>X-ja):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}async whenGraphicAttributes(fa,X){return L.whenGraphicAttributes(this.layer, fa,this._getObjectIdField(),X,()=>[...this.loadedGraphics.nodes()])}getHit(fa){if(!this.loadedGraphics)return null;const X=z.hydrateGraphic(this.loadedGraphics.find(la=>la.uid===fa),this.layer),ja=this._getObjectIdField();if(!X?.attributes?.[ja])return null;X.layer=this.layer;X.sourceLayer=this.layer;return{type:"graphic",graphic:X,layer:X.layer}}whenGraphicBounds(fa,X){return this.processor.whenGraphicBounds(fa,X)}computeAttachmentOrigin(fa,X){return this.processor.computeAttachmentOrigin(fa,X)}isUpdating(){return!!(this._controller?.updating|| this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(fa){return this.processor.highlight(fa,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(fa){return G.createInteractiveEditSession(this._attributeEditingContext,fa)}async _decompressBinaryPointData(fa,X){fa={geometryBuffer:fa.geometryBuffer};null==this._worker&&(this._worker=new F.I3SPointsWorkerHandle(ja=>this.view.resourceController.immediate.schedule(ja))); X=await this._worker.invoke(fa,X);if(null==X)throw Error("Failed to decompress Draco point data");return{positionData:X.positions,featureIds:X.featureIds}}async addNode(fa,X,ja){if(!(Z(X)||"pointData"in X))throw Error();if(this.loadedGraphics.hasNode(fa.index))k.getLogger(this).error("I3S node "+fa.id+" already added");else{if(null!=this.layer.fullExtent){var la=this.layer.fullExtent.clone();la.xmin-=.5;la.ymin-=.5;la.xmax+=.5;la.ymax+=.5;null!=la.zmin&&null!=la.zmax&&(la.zmin-=.5,la.zmax+=.5);null!= la.mmin&&null!=la.mmax&&(la.mmin-=.5,la.mmax+=.5)}else la=null;var na=la,{featureIds:va,pointPositions:za}=Z(X)?await this._extractBinaryPointPositions(fa,X,ja):this._extractLegacyPointPositions(X);la=[];this._validatePositions(fa,va,za,na,la);var ya=this._controller.crsVertex;w.projectBuffer(za,ya,0,za,this.view.spatialReference,0,va.length);na=Z(X)?fa.level:0;na=this._createGraphics(va,za,fa.index,na);na=new ea(na,va,X.attributeDataInfo,fa);await this._i3sOverrides.applyAttributeOverrides(na.featureIds, X.attributeDataInfo,ja);fa.numFeatures=na.graphics.length;this._updateNodeMemory(fa);ca(na);0Da||3x.estimateSize(la)+ja,c.estimateSize(fa.featureIds)+1024);this._memCache.put(this._getMemCacheKey(fa.node),fa,X)}_getMemCacheKey(fa){return`${fa.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((fa,X)=>{fa&&(this._updateNodeMemory(fa.node), this._cacheNodeData(fa));this._controller.updateLoadStatus(X,!1)});this._treeDebugger&&this._treeDebugger.update();this.loadedGraphics.clear()}removeNode(fa){if(fa=this._removeNodeStageData(fa))this._updateNodeMemory(fa.node),this._cacheNodeData(fa)}_removeNodeStageData(fa){const X=this.loadedGraphics.getNode(fa);if(null==X)return null;this._controller.updateLoadStatus(fa,!1);this.loadedGraphics.removeNode(fa);this._treeDebugger&&this._treeDebugger.update();return X}async loadCachedNodeData(fa){return this._memCache?.pop(this._getMemCacheKey(fa))}async addCachedNodeData(fa, X,ja,la){this.loadedGraphics.hasNode(fa.index)?k.getLogger(this).error("I3S node "+fa.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(X.featureIds,ja,la),X.attributeInfo=ja,this.loadedGraphics.addNode(fa.index,X),this._controller.updateLoadStatus(fa.index,!0),this._updateNodeMemory(fa),ca(X),this._filterNode(X),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const fa=[];this.loadedGraphics.forEachNode(X=>fa.push(X.node.id));return fa.sort()}getVisibleNodes(){const fa= [];this.loadedGraphics.forEachNode(X=>fa.push(X.node));return fa}getLoadedNodeIndices(fa){this.loadedGraphics.forEachNode((X,ja)=>fa.push(ja))}getLoadedAttributes(fa){fa=this.loadedGraphics.getNode(fa);if(null!=fa?.attributeInfo)return fa.attributeInfo.loadedAttributes}getAttributeData(fa){fa=this.loadedGraphics.getNode(fa);if(null!=fa?.attributeInfo)return fa.attributeInfo.attributeData}_setAttributeData(fa,X){fa=this.loadedGraphics.getNode(fa);null!=fa?.attributeInfo&&(fa.attributeInfo.attributeData= X,this._attributeValuesChanged(fa))}async updateAttributes(fa,X,ja){fa=this.loadedGraphics.getNode(fa);null!=fa&&(await this._i3sOverrides.applyAttributeOverrides(fa.featureIds,X,ja),fa.attributeInfo=X,this._attributeValuesChanged(fa))}_attributeValuesChanged(fa){ca(fa);this._filterNode(fa);if(this.processor.graphicsCore.labelsEnabled){const X=fa.node.index,ja=[];fa.graphics.forEach(la=>la.nodeIndex===X&&ja.push(la.uid));this.processor.graphicsCore.updateLabelingInfo(ja)}}_updateClippingExtent(fa){this._controller&& this._controller.updateClippingArea(fa);return!1}_getObjectIdField(){return this.layer.objectIdField||u.fallbackObjectIDAttribute}_getGlobalIdField(){return this.layer.associatedLayer?.globalIdField}async _rendererChange(fa,X){const {layer:{fieldsIndex:ja}}=this,la=new Set;let na;fa?(await fa.collectRequiredFields(la,ja),na=Array.from(la).sort()):na=[];la.clear();let va;X?(await X.collectRequiredFields(la,ja),va=Array.from(la).sort()):va=[];na.length===va.length&&na.every((za,ya)=>na[ya]===va[ya])|| this._reloadAllNodes()}_rangeInfosChanged(fa){null!=fa&&0this._filterNode(fa))}_reloadAllNodes(){this._removeAllNodeData();this._controller&&this._controller.restartNodeLoading()}_filterNode(fa){const X=this.parsedDefinitionExpression,ja=this._excludeObjectIdsSorted,la=this._getObjectIdField();for(const na of fa.graphics){fa= na.visible;const va=!X||this._evaluateClause(X,na),za=null==ja||0>l.binaryIndexOf(ja,na.attributes[la]);na.visible=va&&za;fa!==na.visible&&(ka.graphic=na,ka.property="visible",ka.oldValue=fa,ka.newValue=na.visible,this.processor.graphicsCore.graphicUpdateHandler(ka))}}createQuery(){const fa={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(fa):new C(fa)}queryFeatures(fa,X){return this._queryEngine.executeQuery(this._ensureQuery(fa), X?.signal)}queryObjectIds(fa,X){return this._queryEngine.executeQueryForIds(this._ensureQuery(fa),X?.signal)}queryFeatureCount(fa,X){return this._queryEngine.executeQueryForCount(this._ensureQuery(fa),X?.signal)}queryExtent(fa,X){return this._queryEngine.executeQueryForExtent(this._ensureQuery(fa),X?.signal)}_ensureQuery(fa){return this._addDefinitionExpressionToQuery(null==fa?this.createQuery():C.from(fa))}_setupQueryEngine(){const fa=()=>this.processor.featureStore;this._queryEngine=new E.QueryEngine({context:{spatialReference:this.view.spatialReference, layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return fa()},hasZ:this.hasZ,hasM:this.hasM},priority:U.TaskPriority.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(fa){const X= this._attributeEditingContext;fa=await G.normalizeEditResultsEvent(X,fa);G.processAttributeEdits(X,fa)}get _attributeEditingContext(){const fa=this._getObjectIdField(),X=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:fa,globalIdField:X,forEachNode:ja=>this.loadedGraphics.forEachNode(la=>ja(la.node,la.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:ja=> this.getAttributeData(ja),setAttributeData:(ja,la,na)=>{this._setAttributeData(ja,la);ja=this.loadedGraphics.getNode(ja);null!=na?(na=this.loadedGraphics.get(na.attributes[fa]),null!=na&&this.processor.graphicsCore.recreateGraphics([na])):null!=ja&&this.processor.graphicsCore.recreateGraphics(ja.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new K.LayerViewPerformanceInfo(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}}; b.__decorate([e.property()],H.prototype,"processor",void 0);b.__decorate([e.property({type:B})],H.prototype,"filter",void 0);b.__decorate([e.property()],H.prototype,"loadedGraphics",void 0);b.__decorate([e.property()],H.prototype,"i3slayer",null);b.__decorate([e.property()],H.prototype,"_controller",void 0);b.__decorate([e.property()],H.prototype,"updating",void 0);b.__decorate([e.property()],H.prototype,"suspended",void 0);b.__decorate([e.property()],H.prototype,"holeFilling",void 0);b.__decorate([e.property(V.updatingProgress)], H.prototype,"updatingProgress",void 0);b.__decorate([e.property()],H.prototype,"updatingProgressValue",null);b.__decorate([e.property(p.requiredFields)],H.prototype,"requiredFields",null);b.__decorate([e.property(p.availableFields)],H.prototype,"availableFields",void 0);b.__decorate([e.property()],H.prototype,"_fieldsHelper",void 0);b.__decorate([e.property({type:Number})],H.prototype,"maximumNumberOfFeatures",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"maximumNumberOfFeaturesExceeded", null);b.__decorate([e.property()],H.prototype,"_excludeObjectIdsSorted",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"lodFactor",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"hasM",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"hasZ",null);b.__decorate([e.property()],H.prototype,"contentVisible",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"legendEnabled",null);b=H=b.__decorate([g.subclass("esri.views.3d.layers.SceneLayerGraphicsView3D")],H); const da={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},ia=t.create(),ka={graphic:null,property:null,oldValue:null,newValue:null};return b})},"esri/views/3d/layers/I3SPointsWorkerHandle":function(){define(["exports","../../../core/workers/WorkerHandle"],function(a,b){class q extends b.WorkerHandle{constructor(l){super("SceneLayerWorker","dracoDecompressPointCloudData",{dracoDecompressPointCloudData:p=> [p.geometryBuffer]},l,{hasInitialize:!0})}}a.I3SPointsWorkerHandle=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SGraphicsMap":function(){define(["exports","../../../../core/Evented","../../../../core/has","../../../../core/MapUtils"],function(a,b,q,l){class p extends b{constructor(k,h){super();this._updateAndCompare=k;this._notifyUpdated=h;this._nodes=new Map;this._graphics=new Map;this._duplicates=new Map}clear(){if(0!c.has(g.objectId)):f;0e.node.level)e=w}null!=e&&f.add(e)}1===t.length&&this._duplicates.delete(h)}}else this._graphics.delete(h),c.push(d)}0this._updateForeignGraphics(d))}}_updateForeignGraphics(k){const h=[],f=k.node.index,c=k.node.level;let e=0;for(;ec))for(g=e;gk(f)?(h=f,!0):!1);return h}forEach(k){this._graphics.forEach(h=>k(h))}forEachNode(k){this._nodes.forEach((h,f)=>k(h,f))}get nodeCount(){return this._nodes.size}_checkInvariants(){const k= new Map;this._nodes.forEach((h,f)=>{h.graphics.forEach(c=>{k.set(c.objectId,1+(k.get(c.objectId)??0));this._duplicates.get(c.objectId)})});k.forEach((h,f)=>{(h=this._graphics.get(f))&&this._nodes.get(h.nodeIndex)&&(f=this._duplicates.get(f))&&f.forEach(c=>{this._nodes.get(c)})})}}a.I3SGraphicsMap=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"*noref":1}}); define("require ../chunks/tslib.es6 ../Camera ../geometry ../Viewpoint ../core/Collection ../core/domUtils ../core/Error ../core/events ../core/handleUtils ../core/has ../core/Logger ../core/maybe ../core/ObservableChangesType ../core/promiseUtils ../core/reactiveUtils ../core/scheduling ../core/screenUtils ../core/workers/workers ../core/accessorSupport/decorators/property ../core/accessorSupport/decorators/cast ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../core/accessorSupport/ensureType ../core/accessorSupport/overrideDefaultsFrom ../core/libs/gl-matrix-2/factories/vec3f64 ../core/support/OwningCollection ../geometry/HeightModelInfo ../geometry/projection ../geometry/projection/projectBoundingRect ../geometry/projection/projectPointToVector ../geometry/support/aaBoundingRect ../chunks/boundedPlane ../geometry/support/coordinateSystem ../geometry/support/scaleUtils ../layers/support/layerUtils ../support/AnalysesCollection ./BreakpointsOwner ./DOMContainer ./GroundView ./PopupView ./View ./ViewAnimation ./ViewingMode ./3d/layerViewModuleImportUtils ./3d/analysis/AnalysisViewManager3D ./3d/constraints/Constraints ./3d/environment/SceneViewEnvironment ./3d/environment/SceneViewEnvironmentManager ./3d/input/SceneInputManager ./3d/layers/graphics/GraphicsDeconflictor ./3d/layers/graphics/Labeler ./3d/layers/support/FeatureTileTree3D ./3d/state/ViewState ./3d/state/ViewStateManager ./3d/state/helpers/SceneIntersectionHelper ./3d/support/CombinedElevationProvider ./3d/support/debugFlags ./3d/support/DisplayQualityProfile ./3d/support/ElevationProvider ./3d/support/HighlightOptions ./3d/support/hitTest ./3d/support/MapCoordsHelper ./3d/support/popupHitTest ./3d/support/PropertiesPool ./3d/support/QualitySettings ./3d/support/RenderCoordsHelper ./3d/support/ResourceController ./3d/support/SceneViewPerformanceInfo ./3d/support/SharedSymbolResources ./3d/support/TextureCollection ./3d/support/pointsOfInterest/PointsOfInterest ./3d/terrain/TerrainSurface ./3d/terrain/terrainUtils ./3d/webgl-engine/Stage ./3d/webgl-engine/lib/basicInterfaces ./3d/webgl-engine/lib/Intersector ./3d/webgl-engine/lib/verticalOffsetUtils ./support/layerViewUtils ./support/screenshotUtils ./support/screenUtils ./support/spatialReferenceSupport ./support/WebGLRequirements ./ui/DefaultUI ./ui/3d/DefaultUI3D ../webscene/Environment ../geometry/Extent ../geometry/SpatialReference ../geometry/Point".split(" "),function(a, b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va,za,ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua,Na,Ua,wa,sa,Ha,Ka,Aa,Sa,Ya,qa,aa,Ja,Ta,Ra,$a,bb,pa,Ba){function Ia(La,Xa){return null!=La&&N.canProjectWithoutEngine(La.spatialReference,Xa)?N.project(La,Xa):null}l=class extends J.BreakpointsOwner(W.PopupView(R.DOMContainer(S))){constructor(La){super(La);this._createGraphicsViewController=this._initialDefaultSpatialReference=this._clippingArea= this._userClippingArea=null;this._resolveWhenReady=[];this._propertiesPool=new xa.PropertiesPool({slicePlane:O.BoundedPlaneClass},this);this._resourceController=Pa.newResourceController(this);this._defaultToMapOptions={include:new Set};this._defaultHitTestOptions={exclude:new Set};this.deconflictor=new ea.GraphicsDeconflictor({view:this});this.labeler=new da.Labeler({view:this,deconflictor:this.deconflictor.labels});this.sharedSymbolResources=null;this.analyses=new K.AnalysesCollection;this.canvas= this.elevationProvider=this.basemapTerrain=null;this.constraints=new ba.Constraints;this.environment=new U;this.environmentManager=new Z.SceneViewEnvironmentManager;this.floors=new k;this.fullOpacity=1;this.graphicsView=null;this.analysisViewManager=new ha({view:this});this.map=this.groundView=null;this.screenSizePerspectiveEnabled=!0;this.state=new ka;this.spatialReference=null;this.preserveDrawingBufferEnabled=this.alphaCompositingEnabled=!1;this.supersampleScreenshotsEnabled=!0;this.type="3d"; this.ui=new Ra;this._lastUpdateTime=this._numUpdating=0;this.updatingProgress=.5;this.highlightOptions=new za;u.initialize();const Xa=(eb=null)=>{if(null==eb||eb.type!==w.ObservableChangesType.MOVE)this._updatingChanged(),this.map&&this.map.allLayers.forEach(async db=>{try{await db.when()}catch{}this._updatingChanged()})};this.addHandles([m.on(()=>this.map?.allLayers,"after-changes",eb=>Xa(eb),{onListenerAdd:()=>Xa(),onListenerRemove:()=>Xa(),sync:!0}),this.allLayerViews.on("after-changes",eb=>this._updateUpdatingMonitors(eb)), m.watch(()=>this.map,eb=>{eb&&"load"in eb&&eb.load&&eb.load().catch(()=>{})})]);this.inputManager=new ca({view:this});this.stateManager=new fa.ViewStateManager({view:this})}initialize(){this.groundView=new Q({view:this});this._updateUpdatingMonitors();const La=()=>this._updateDefaultToMapOptions();this.addHandles(m.on(()=>this.map?.allLayers,"after-changes",La,{onListenerAdd:La,onListenerRemove:La}));this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,Xa=>{this.resourceController&&(this.resourceController.memoryController.maxMemory= Xa)},m.initial);this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,Xa=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=Xa)},m.initial);this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,Xa=>r.setFrameDuration(0this.map?.ground,La,m.syncAndInitial);this.updatingHandles.add(()=>this.map?.ground?.opacity,()=>this._updateDefaultHitTestOptions(),m.syncAndInitial); this.addHandles(m.watch(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),m.sync))}destroy(){this.destroyed||(this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=t.destroyMaybe(this.sharedSymbolResources),this._set("labeler",t.destroyMaybe(this.labeler)),this._set("deconflictor",t.destroyMaybe(this.deconflictor)),this._resourceController=t.destroyMaybe(this._resourceController), this._set("stateManager",t.destroyMaybe(this.stateManager)),this._set("inputManager",t.destroyMaybe(this.inputManager)),this.state.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",t.destroyMaybe(this.environmentManager)),this._set("environment",t.destroyMaybe(this.environment)),this.groundView=t.destroyMaybe(this.groundView),this._exitBasemapTerrain(),this._stage?.destroy())}get renderSpatialReference(){return this.renderCoordsHelper&& this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(La){this.stateManager&&(this.stateManager.camera=La)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(La){this.stateManager&&(this.stateManager.contentCamera=La)}installContentCameraReset(La={sticky:!1}){return this.stateManager.installContentCameraReset(La)}get center(){return this.stateManager?.center}set center(La){this.stateManager&& (this.stateManager.center=La)}get clippingArea(){if("global"===this.viewingMode)return null;const La=this.map;let Xa=this._userClippingArea||t.maybeProperty(La,"clippingArea");if(!this._userClippingArea&&!t.maybeProperty(La,"clippingEnabled")||null==Xa)return this._clippingArea=null;if(!(Xa instanceof bb))return d.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea;if(this.spatialReference&&(Xa=Ia(Xa,this.spatialReference),null==Xa))return d.getLogger(this).error("#clippingArea", "setting clippingArea with incompatible SpatialReference"),this._clippingArea;Xa=Xa.clone();null==Xa.intersection(this._groundAndLayersExtent)&&(Xa.xmin=Xa.xmax,Xa.ymin=Xa.ymax);Xa.zmin=void 0;Xa.zmax=void 0;Xa.equals(this._clippingArea)||(this._clippingArea=Xa);return this._clippingArea}set clippingArea(La){this.ready&&"global"===this.viewingMode&&null!=La?d.getLogger(this).error("#clippingArea\x3d","Clipping area is only supported in local viewingMode"):this._userClippingArea=La}get renderDataExtent(){if(this.state.viewingMode=== T.ViewingMode.Global)return null;const La=this.renderSpatialReference,Xa=this.dataExtent;return null==Xa||null==La||Xa.spatialReference.equals(La)?Xa:Ia(Xa,La)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let La=this._groundAndLayersExtent;var Xa=Ia(this.clippingArea,this.spatialReference||pa.WGS84);null!=Xa&&(La=null!=La?La.intersection(Xa):Xa);Xa=this._get("dataExtent");return null!=La&&La.equals(Xa)?Xa:La}get _groundAndLayersExtent(){const La=this.spatialReference|| pa.WGS84;let Xa;const eb=jb=>{jb=Ia(jb,La);null!=jb&&(null!=Xa?Xa.union(jb):Xa=jb.clone())};var db=this.basemapTerrain;if(db?.spatialReference){const jb=db.groundExtent;eb(new bb({xmin:jb[0],ymin:jb[1],zmin:0,xmax:jb[2],ymax:jb[3],zmax:0,spatialReference:db.spatialReference}))}this.map&&this.map.allLayers.forEach(jb=>{null==jb.fullExtent||"graphics"===jb.type&&jb.internal||eb(jb.fullExtent)});if(null==Xa)return null;Xa.hasZ?(Xa.zmin=Math.min(0,Xa.zmin??0),Xa.zmax=Math.max(0,Xa.zmax??0)):(Xa.zmin= 0,Xa.zmax=0);db=this._get("_groundAndLayersExtent");return Xa.equals(db)?db:Xa}castEnvironment(La){return La?La instanceof U?La:La instanceof $a?this.environment?.cloneWithWebsceneEnvironment(La)??U.fromWebsceneEnvironment(La):B.ensureType(U,La):new U}get extent(){return this.stateManager?.extent}set extent(La){this.stateManager&&(this.stateManager.extent=La)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&& !this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(null==this.state||this.state.stationary)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(La){this.stateManager&&(this.stateManager.padding=La)}set qualityProfile(La){na.isValidProfile(La)&& (na.apply(La,this.qualitySettings),this._set("qualityProfile",La))}get qualityProfile(){return this._get("qualityProfile")||na.getDefaultProfile()}set slicePlane(La){null!=this._stage&&this._stage.renderer.setParameters({slicePlane:La});if(null==La)this._set("slicePlane",null);else{var Xa=this._propertiesPool.get("slicePlane");O.copy(La,Xa);this._set("slicePlane",Xa)}}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){return null!= this.spatialReference?P.getResolutionForScale(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(La){this.stateManager&&(this.stateManager.scale=La)}get terrainScale(){return this.stateManager?.terrainScale}get heightModelInfo(){const La=this.getDefaultHeightModelInfo();return null!=La?H.deriveUnitFromSR(La,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let La=0,Xa=this.layerViewManager.updating,eb=Xa?this.layerViewManager.updatingRemaining: 0;this.allLayerViews.forEach(nb=>{nb.isFulfilled()?nb.updating&&(Xa=!0,nb.suspended||wa.isSurfaceLayerView(nb)||(++eb,La+=nb.updatingProgress)):++eb});for(var db of this._updatingObjects)null!=db&&db.updating&&(eb+=.1,La+=.05);for(var jb of this._updatingObjectsWithProgress)null!=jb&&jb.updating&&(++eb,La+=jb.updatingProgress);db=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;(Xa=!!(Xa||0!nb.isFulfilled())||this.textures?.updating))?(this._numUpdating=Math.max(eb,this._numUpdating),La+=this._numUpdating-eb):this._numUpdating=0;La=0La&&(jb=Math.min((db-this._lastUpdateTime)/2E3,1),La=this.updatingProgress*(1-jb)+La*jb),this._set("updatingProgress",La),this._lastUpdateTime=Xa&&1>La?db:0);return Xa}get _updatingObjects(){return[this.graphicsView, this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){var La=this._predeterminedViewingMode;return null!=La?T.stringFromViewingMode(La):(La=this.spatialReference)?null!=this.defaultsFromMap?.viewingMode&&La.equals(this.defaultsFromMap.spatialReference)? T.stringFromViewingMode(this.defaultsFromMap.viewingMode):aa.isSpatialReferenceSupported(La,T.ViewingMode.Global)?"global":"local":"global"}set viewingMode(La){this.ready?d.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",La)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(La){this.stateManager&&(this.stateManager.viewpoint=La)}get zoom(){return this.stateManager.zoom}set zoom(La){this.stateManager&&(this.stateManager.zoom= La)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Qa(this)}on(La,Xa,eb,db){return(eb=this.viewEvents.on(La,Xa,eb,db))?eb:super.on(La,Xa)}hasEventListener(La){return super.hasEventListener(La)||this.viewEvents.hasHandler(La)}toMap(La,Xa){if(!this.ready)return d.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"), null;La=qa.isSupportedScreenPointEvent(La)?qa.createScreenPointFromSupportedEvent(this,La):La;return ya.toMap(this,La,Xa,this._defaultToMapOptions)}toScreen(La){if(!this.ready)return d.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const Xa=(null==La.z?va.getElevationAtPoint(this.elevationProvider,La):null)??0;G.projectPointToVector(La,Wa,this.renderSpatialReference,Xa);this.state.camera.projectToScreen(Wa,gb);return n.createScreenPoint(gb[0],gb[1])}pixelSizeAt(La){if(!this.ready)return d.getLogger(this).error("#pixelSizeAt()", "Scene view cannot be used before it is ready"),null;if(!La)return 0;G.projectPointToVector(La,Wa,this.renderSpatialReference);return this.state.camera.computeScreenPixelSizeAt(Wa)}overlayPixelSizeInMapUnits(La){const Xa=this.basemapTerrain.overlayManager;return Xa?Xa.overlayPixelSizeInMapUnits(La,()=>this.pixelSizeAt(La)):1}hitTest(La,Xa){if(!this.ready)return d.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;La=qa.isSupportedScreenPointEvent(La)?qa.createScreenPointFromSupportedEvent(this, La):La;return ya.hitTest(this,La,Xa,this._defaultHitTestOptions)}async popupHitTest(La){return ra.popupHitTest(this,La)}goTo(La,Xa){return this.updatingHandles.addPromise(this.stateManager.goTo(La,Xa))}async whenAnalysisView(La){if(null==La.parent)throw new f("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:La});switch(La.parent.type){case "line-of-sight":case "dimension":return(await this.whenLayerView(La.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(La)}}whenLayerView(La){return super.whenLayerView(La)}async takeScreenshot(La){La= this._completeSettings(La);await this.whenReady();const Xa=await this._stage.renderView.takeScreenshot(La);return Ya.encode(Xa,La,this._pixelFormat())}async _takeScreenshot(La){La=this._completeSettings(La);await this.whenReady();La=await this._stage.renderView.takeScreenshot(La);return Ya.encodeData(La,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(La){La=this._completeSettings(La);await this.whenReady();La=await this._stage.renderView.takeScreenshotWithOID(La);return[Ya.encodeData(La[0], this._pixelFormat()),Ya.encodeData(La[1],this._pixelFormat())]}_completeSettings(La){La=Ya.toRenderSettings(La,this);La.pixelRatio/=this.state.pixelRatio;return Ya.screenshotSuperSampleSettings(La,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){}async takeScreenshotWithObjectAndLayerId(La){if(!g("enable-feature:objectAndLayerId-rendering"))throw Error("has enable-feature:objectAndLayerId-rendering must be true"); var Xa=this._completeSettings(La);await this.whenReady();var eb=await this._stage.renderView.takeScreenshotWithOID(Xa);Xa=Ya.encode(eb[0],Xa,this._pixelFormat());La=this._completeSettings(La);La.format="png";eb=Ya.encode(eb[1],La,this._pixelFormat());return[Xa,eb]}getColorToObjectAndLayerIdMapping(){if(null==this._stage.renderView.objectAndLayerIdRenderHelper)throw Error("has enable-feature:objectAndLayerId-rendering must be true");return this._stage.renderView.objectAndLayerIdRenderHelper.getColorToObjectAndLayerIdMapping()}addUpdatingPromise(La){return this.updatingHandles.addPromise(La)}importLayerView(La){return Y.layerView3DImporter.importLayerView(La)}hasLayerViewModule(La){return Y.layerView3DImporter.hasLayerViewModule(La)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&& "initialViewProperties"in this.map&&this.map.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let La=Ja.check(this.type);const Xa=g("safari");Xa&&9>Xa&&(La=new f("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari \x3c 9)",{type:"safari",requiredVersion:9,detectedVersion:Xa}));if(null!=La)throw d.getLogger(this).warn("#validate()",La.message),La; }get _predeterminedViewingMode(){const La=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=La?T.viewingModeFromString(La):null}getSpatialReferenceSupport(La,Xa){var eb=this._predeterminedViewingMode;if(null!=eb)return this._validateSpatialReferenceForViewingMode(La,Xa,eb)?{constraints:this._makeSpatialReferenceConstraints(La,Xa,eb)}:null;eb=this._validateSpatialReferenceForViewingMode(La, Xa,T.ViewingMode.Local);const db=this._validateSpatialReferenceForViewingMode(La,Xa,T.ViewingMode.Global);return eb||db?eb&&db?{constraints:this._makeSpatialReferenceConstraints(La,Xa,null)}:eb?{constraints:this._makeSpatialReferenceConstraints(La,Xa,T.ViewingMode.Local)}:{constraints:this._makeSpatialReferenceConstraints(La,Xa,T.ViewingMode.Global)}:null}_validateSpatialReferenceForViewingMode(La,Xa,eb){return aa.isSpatialReferenceSupported(La,eb)?null==Xa||M.isImageryTileLayer(Xa)?!0:M.isTiledLayer(Xa)&& null==wa.getTiledLayerInfo(Xa,La,eb)||M.isVoxelLayer(Xa)&&eb===T.ViewingMode.Global?!1:!0:!1}_makeSpatialReferenceConstraints(La,Xa,eb){if(null==Xa)return[{spatialReference:La,viewingMode:eb}];const {isWebMercator:db,isWGS84:jb}=La;return M.isImageryTileLayer(Xa)&&(db||jb)?(jb&&eb!==T.ViewingMode.Local?null===wa.checkIfTileInfoSupportedForView(Xa.tileInfo,Xa.fullExtent,La,T.ViewingMode.Global):1)?[{spatialReference:La,viewingMode:eb},{spatialReference:pa.WebMercator,viewingMode:eb}]:[{spatialReference:db? pa.WGS84:pa.WebMercator,viewingMode:eb}]:M.isTiledLayer(Xa)||M.isVoxelLayer(Xa)||!db&&!jb?M.isTiledLayer(Xa)&&db&&eb!==T.ViewingMode.Global?[{spatialReference:La,viewingMode:eb},{spatialReference:pa.WGS84,viewingMode:T.ViewingMode.Local}]:[{spatialReference:La,viewingMode:eb}]:[{spatialReference:La,viewingMode:eb},{spatialReference:db?pa.WGS84:pa.WebMercator,viewingMode:eb}]}_validateSpatialReference(La){const Xa=null!=this.getSpatialReferenceSupport(La),eb=this._predeterminedViewingMode;Xa||(null!= eb?d.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${T.stringFromViewingMode(eb)} viewing mode.`):La.isGeographic&&d.getLogger(this).warnOnce("Spatial reference is geographic but not supported."));return Xa}whenReady(){return new Promise(La=>{this.ready?La(this):this._resolveWhenReady.push(La)})}trackGraphicState(La){if(!La.graphic)return d.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const Xa= this.getViewForGraphic(La.graphic);let eb=null,db=!1;const jb=nb=>{!db&&null!=nb&&"processor"in nb&&"graphics-3d"===nb.processor?.type&&nb.processor.graphicsCore&&(eb=nb.processor.graphicsCore.trackGraphicState(La))};null!=Xa?jb(Xa):this.whenViewForGraphic(La.graphic,{waitForLayer:!0}).then(nb=>jb(nb),()=>{}).catch(()=>{});return e.makeHandle(()=>{db=!0;null!=eb&&(eb.remove(),eb=null)})}highlight(La){if(Array.isArray(La))return e.handlesGroup(La.map(eb=>this.highlight(eb)));if(k.isCollection(La))return e.handlesGroup(La.toArray().map(eb=> this.highlight(eb)));const Xa=this.getViewForGraphic(La);return Xa&&"highlight"in Xa?Xa.highlight(La):e.makeHandle()}maskOccludee(La){if(!La)return d.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const Xa=this.getViewForGraphic(La);let eb=null,db=!1;const jb=nb=>{!db&&null!=nb&&Sa.occludeesSupported(nb)&&(eb=nb.maskOccludee(La))};null!=Xa?jb(Xa):this.whenViewForGraphic(La,{waitForLayer:!0}).then(nb=>jb(nb),()=>{}).catch(()=>{}); return e.makeHandle(()=>{db=!0;null!=eb&&(eb.remove(),eb=null)})}getViewForGraphic(La){return La.layer===this.graphics?this.graphicsView:La.layer?this.allLayerViews.find(Xa=>Xa.layer===La.layer):null}graphicChanged(La){null!=this.graphicsView&&this.graphicsView.graphicChanged(La)}async whenViewForGraphic(La,Xa){if(La.layer===this)return await m.whenOnce(()=>this.graphicsView),this.graphicsView;if(!La.layer||!this.map)throw new f("no-view-for-graphic");return Xa&&Xa.waitForLayer&&!this.map.allLayers.includes(La.layer)? new Promise((eb,db)=>{const jb=this.map.allLayers.on("change",nb=>{nb.added.includes(La.layer)&&(jb.remove(),this.whenLayerView(La.layer).then(eb,db))})}):this.whenLayerView(La.layer)}_initBasemapTerrain(){this._set("basemapTerrain",new Ua({view:this}));this._set("elevationProvider",new ja.CombinedElevationProvider({view:this}));this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(), this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem();this.state.createInitialCamera();this._initBasemapTerrain();this._set("pointsOfInterest",new Na.PointsOfInterest({view:this}));this._set("featureTiles",new ia.FeatureTileTree3D({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state, scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const La=()=>{var Xa=this.basemapTerrain?.extent;this.clippingArea||Xa?Xa&&this.basemapTerrain.spatialReference?(Xa=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?N.project(I.toExtent(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null,this.featureTiles.filterExtent=null!=this.clippingArea?this.clippingArea.intersection(Xa):Xa):this.featureTiles.filterExtent= this.clippingArea:this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add(()=>la.debugFlags.FEATURE_TILE_TREE_SHOW_TILES,Xa=>{Xa&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(new Promise((eb,db)=>a(["./3d/layers/support/FeatureTileTree3DDebugger"],eb,db))).then(({FeatureTileTree3DDebugger:eb})=>{!this._featureTreeDebugger&&la.debugFlags.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new eb({view:this}))}):Xa||!this._featureTreeDebugger|| la.debugFlags.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)},m.syncAndInitial),this.updatingHandles.add(()=>this.clippingArea,La,m.syncAndInitial),this.updatingHandles.add(()=>this.basemapTerrain.extent,La,m.syncAndInitial)],"feature-tiles");this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles", null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){var La=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(La)||this._set("mapCoordsHelper",new Da.MapCoordsHelper(this.map,La));const Xa=this.state.isGlobal;La=L.renderSRFromViewSR(Xa,La);La!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ga.RenderCoordsHelper.create(this.state.viewingMode, La)),Xa||this.addHandles(m.watch(()=>this.basemapTerrain?.extent,eb=>{const db=this.renderCoordsHelper.spatialReference;null==eb||0===eb[0]&&0===eb[1]&&0===eb[2]&&0===eb[3]||!E.projectBoundingRect(eb,this.basemapTerrain.spatialReference,ib,db)||(this.renderCoordsHelper.extent=ib)},m.sync),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Ka.defaultTolerance/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper", null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(La=null){if(null==La||La.type!==w.ObservableChangesType.MOVE)this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(Xa=>{Xa.destroyed||(this.addHandles(m.watch(()=>[Xa.updating,Xa.updatingProgress],()=>this._updatingChanged(),m.sync),"updatingMonitors"), Xa.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged()}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(La,Xa,eb){if(!this.overlay||!this.overlay.hasVisibleItems)return eb;const db=La.getContext("2d");db.putImageData(eb,0,0);this.overlay.renderCanvas(La,{disableDecorations:Xa===Ha.Decorations.OFF});return db.getImageData(0,0,eb.width,eb.height)}_initStage(){const La={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions, debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(eb,db,jb)=>this._renderScreenshotOverlay(eb,db,jb)}};var Xa=new X.SceneIntersectionHelper(this.state.viewingMode,eb=>this._stage.layers.forAll(eb),this);this._set("sceneIntersectionHelper",Xa);Xa=h.byId(this.surface);this._stage=new sa.Stage({view:this,options:La, container:Xa});this._stage.renderer.setParameters({slicePlane:this.slicePlane});this.addHandles([this.updatingHandles.add(()=>this.qualitySettings.highQualityTransparency,eb=>this._stage.renderer.setParameters({highQualityTransparency:eb}),m.initial),this.on("pointer-move",()=>this._stage?.renderer.resetAnimation()),c.on(this._stage.renderView.canvas,"webglcontextlost",eb=>{this.fatalError=new f("webgl-context-lost",eb.statusMessage)})],"stage");this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Ka.defaultTolerance/ this.renderCoordsHelper.unitInMeters);this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null);this._stage=t.destroyMaybe(this._stage);this.removeHandles("stage");this._set("canvas",null)}_initSurface(La){this._exitSurface();this.state.init(La,this.spatialReference);this._initStage();this._initGlobe();this.sharedSymbolResources=new Ea.SharedSymbolResources({view:this,viewingMode:La,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest, viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(!this.graphicsView&&!this._createGraphicsViewController&&0!==this.graphics.length){this.removeHandles("graphics-view");this._createGraphicsViewController=new AbortController;var La=()=>{this._createGraphicsViewController=null;this._updatingChanged()}; this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(La,La);this._updatingChanged()}}async _createGraphicsViewAsync(La){const Xa=(await new Promise((eb,db)=>a(["./3d/layers/GraphicsView3D"],jb=>eb(Object.freeze(Object.defineProperty({__proto__:null,default:jb},Symbol.toStringTag,{value:"Module"}))),db))).default;v.throwIfAborted(La);await m.whenOnce(()=>this.basemapTerrain?.ready,La);this._set("graphicsView",new Xa({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&& (this._createGraphicsViewController.abort(),this._createGraphicsViewController=null);this.removeHandles("graphics-view");null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){var La=T.viewingModeFromString(this.viewingMode);La===T.ViewingMode.Global&&(this._clippingArea=null);this._initSurface(La);this._set("ready",!0);this.addHandles(m.on(()=>this.graphics,"after-changes",()=>this._createGraphicsViewIfNeeded()), "graphics-view");this._createGraphicsViewIfNeeded();La=this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties:null;const Xa=La?.environment;Xa&&C.overrideDefaultsFrom(this.environment,Xa);this.timeExtent=La?.timeExtent;this.labeler.setup();this.environmentManager.connectView(this);this.inputManager.connect();this._set("textures",new ua.TextureCollection(this._stage,this.resourceController.scheduler));La=this._resolveWhenReady;this._resolveWhenReady=[];La.forEach(eb=>eb(this))}_teardown(){this._initialDefaultSpatialReference= null;this.inputManager.disconnect();this.environmentManager.disconnectView();this.labeler.dispose();this._disposeGraphicsView();this.removeHandles("graphics-view");this._set("textures",t.destroyMaybe(this.textures));this._exitSurface();this._set("ready",!1)}_updateDefaultToMapOptions(){this._defaultToMapOptions.include.clear();if(this.map){this.map.ground&&this._defaultToMapOptions.include.add(Aa.terrainId);for(const La of this.map.allLayers.items)M.isIntegratedMeshLayer(La.type)&&this._defaultToMapOptions.include.add(La.uid)}}_updateDefaultHitTestOptions(){this._defaultHitTestOptions.exclude.clear(); if(this.map){this.map.ground&&1>this.map.ground.opacity&&this._defaultHitTestOptions.exclude.add(Aa.terrainId);for(const La of this.map.allLayers.items)M.isIntegratedMeshLayer(La.type)&&1>La.opacity&&this._defaultHitTestOptions.exclude.add(La.uid)}}};l.type="3d";b.__decorate([x.property()],l.prototype,"_userClippingArea",void 0);b.__decorate([x.property()],l.prototype,"_resourceController",void 0);b.__decorate([x.property()],l.prototype,"_stage",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype, "deconflictor",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"labeler",void 0);b.__decorate([x.property(F.owningCollectionProperty(K.AnalysesCollection,"analyses"))],l.prototype,"analyses",void 0);b.__decorate([x.property({type:V,readOnly:!0})],l.prototype,"animation",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"basemapTerrain",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"elevationProvider",void 0);b.__decorate([x.property()],l.prototype,"camera",null); b.__decorate([x.property({type:q})],l.prototype,"contentCamera",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"canvas",void 0);b.__decorate([x.property({type:Ba})],l.prototype,"center",null);b.__decorate([x.property({type:bb})],l.prototype,"clippingArea",null);b.__decorate([x.property({type:ba.Constraints})],l.prototype,"constraints",void 0);b.__decorate([x.property({type:bb,readOnly:!0})],l.prototype,"renderDataExtent",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"tileInfo", null);b.__decorate([x.property({type:bb,readOnly:!0})],l.prototype,"dataExtent",null);b.__decorate([x.property({type:bb,readOnly:!0})],l.prototype,"_groundAndLayersExtent",null);b.__decorate([x.property({type:U})],l.prototype,"environment",void 0);b.__decorate([y.cast("environment")],l.prototype,"castEnvironment",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"environmentManager",void 0);b.__decorate([x.property({type:bb})],l.prototype,"extent",null);b.__decorate([x.property()],l.prototype, "floors",void 0);b.__decorate([x.property()],l.prototype,"screenCenter",null);b.__decorate([x.property()],l.prototype,"frustum",null);b.__decorate([x.property({type:Number,readOnly:!0})],l.prototype,"fullOpacity",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"graphicsView",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"analysisViewManager",void 0);b.__decorate([x.property()],l.prototype,"groundView",void 0);b.__decorate([x.property({type:Boolean})],l.prototype,"initialExtentRequired", null);b.__decorate([x.property()],l.prototype,"_defaultsFromMapSettings",null);b.__decorate([x.property()],l.prototype,"interacting",null);b.__decorate([x.property()],l.prototype,"stationary",null);b.__decorate([x.property()],l.prototype,"navigating",null);b.__decorate([x.property()],l.prototype,"map",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"mapCoordsHelper",void 0);b.__decorate([x.property()],l.prototype,"padding",null);b.__decorate([x.property({type:Na.PointsOfInterest,readOnly:!0})], l.prototype,"pointsOfInterest",void 0);b.__decorate([x.property({type:ia.FeatureTileTree3D,readOnly:!0})],l.prototype,"featureTiles",void 0);b.__decorate([x.property()],l.prototype,"_featureTreeDebugger",void 0);b.__decorate([x.property({type:Boolean})],l.prototype,"screenSizePerspectiveEnabled",void 0);b.__decorate([x.property({constructOnly:!0})],l.prototype,"deactivatedWebGLExtensions",void 0);b.__decorate([x.property({constructOnly:!0})],l.prototype,"debugWebGLExtensions",void 0);b.__decorate([x.property({constructOnly:!0})], l.prototype,"renderCanvas",void 0);b.__decorate([x.property({constructOnly:!0})],l.prototype,"state",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"inputManager",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"stateManager",void 0);b.__decorate([x.property({type:["low","medium","high"]})],l.prototype,"qualityProfile",null);b.__decorate([x.property({type:Ma,get(){let La=this._get("qualitySettings");La||(La=new Ma,na.apply(this.qualityProfile,La));return La}})],l.prototype, "qualitySettings",void 0);b.__decorate([x.property()],l.prototype,"slicePlane",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"typeSpecificPreconditionsReady",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"renderCoordsHelper",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"sceneIntersectionHelper",void 0);b.__decorate([x.property({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],l.prototype,"resolution",null);b.__decorate([x.property({type:Number})], l.prototype,"scale",null);b.__decorate([x.property()],l.prototype,"heightModelInfo",null);b.__decorate([x.property()],l.prototype,"spatialReference",void 0);b.__decorate([x.property({type:Boolean,constructOnly:!0})],l.prototype,"alphaCompositingEnabled",void 0);b.__decorate([x.property({constructOnly:!0})],l.prototype,"preserveDrawingBufferEnabled",void 0);b.__decorate([x.property({type:Boolean})],l.prototype,"supersampleScreenshotsEnabled",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype, "type",void 0);b.__decorate([x.property(),y.cast(La=>La instanceof Ta?La:B.ensureClass(Ra,La))],l.prototype,"ui",void 0);b.__decorate([x.property({type:Boolean,readOnly:!0,dependsOn:"graphicsView.updating basemapView.updating basemapTerrain.updating layerViewManager.updating layerViewManager.updatingRemaining _resourceController.updating _stage.updating featureTiles.updating pointsOfInterest.updating environmentManager.updating overlay.updating updatingHandles.updating featureTreeDebugger.updating labeler.updating deconflictor.updating ready stationary inputManager.updating toolViewManager.updating analysisViewManager.updating state.updating textures.updating".split(" ")})], l.prototype,"updating",null);b.__decorate([x.property()],l.prototype,"_updatingObjects",null);b.__decorate([x.property()],l.prototype,"_updatingObjectsWithProgress",null);b.__decorate([x.property({type:Number,readOnly:!0,dependsOn:["updating"]})],l.prototype,"updatingProgress",void 0);b.__decorate([x.property({type:["global","local"]})],l.prototype,"viewingMode",null);b.__decorate([x.property({type:p})],l.prototype,"viewpoint",null);b.__decorate([x.property({type:Number})],l.prototype,"zoom",null); b.__decorate([x.property({type:za})],l.prototype,"highlightOptions",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"quality",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"resolutionScale",null);b.__decorate([x.property()],l.prototype,"textures",void 0);l=b.__decorate([A.subclass("esri.views.SceneView")],l);const Wa=D.create(),gb=n.createScreenPointArray(),ib=I.create();return l});