@arcgis/core 5.2.0-next.35 → 5.2.0-next.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{3dd8145ef89f32920177.js → 7b5e628ea3d4a51f1c4e.js} +1 -1
- package/assets/esri/core/workers/chunks/bccc199af4e2e49f7acd.js +1 -0
- package/assets/esri/core/workers/chunks/{bbcb213d20693fcad5be.js → c72121076e438ed28d60.js} +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/kernel.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/types.d.ts +9 -2
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/support/ExportStrategy.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/View2D.js +1 -1
- package/views/interactive/tooltip/fields/fields.js +1 -1
- package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
- package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/Editor.d.ts +6 -0
- package/assets/esri/core/workers/chunks/3d1021f7ea9617a76ccf.js +0 -1
|
@@ -258,4 +258,4 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
258
258
|
calculateOcclusionAndOutputHighlight();
|
|
259
259
|
${(0,h.If)(x,"outputObjectAndLayerIdColor();")}
|
|
260
260
|
}
|
|
261
|
-
`)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q),t.constants.add("opacityCutoff","float",r.v)}},58243(t,e,i){function r(t,e){e.useFloatBlend?t.code.add("float ditherNoise(vec4 color) { return 0.0; }"):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}i.d(e,{t:()=>r})},92044(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>Rt});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let m=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,s.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),x=i(16930),y=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(82919)),M=i(71351);i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),C=i(48163),S=i(5443),E=i(39829),R=i(95108),I=i(37585);function O(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(P,e[0],e[0])&&D(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(P,e[i],r)){case 1:D(t,r);break;case 3:D(t,(0,C.o8)(P));break;case 2:D(t,(0,C.o8)(P)),D(t,r)}}}}function D(t,e){0!==t.length&&(0,I.aI)(t.at(-1),e)||t.push(e)}const P=(0,C.vt)();var F=i(11964),N=i(27921);const L=(0,v.vt)(),B=(0,v.vt)();function U(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function H(t,e,i,r,n){let s=(0,_.S8)(L,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(B,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,B);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(B,s,n),c=((0,_.Om)(B,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function V(t,e,i,r){(0,_.Re)(z,i,e),(0,N.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),G=(0,v.fA)(0,1,0),k=(0,v.fA)(0,0,1),W=(0,g.vt)(),Z=(0,v.vt)(),j=(0,v.vt)();function $(t,e,i,r=U()){const{direction:n,up:s}=r;return(0,A.N9)(W,-(0,l.kU)(e)),(0,A.eL)(W,W,(0,l.kU)(i)),(0,_.Z0)(n,k,W),(0,_.hs)(n,n,-1),(0,_.Z0)(s,G,W),r}function q(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const X=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return H(e,i,r,k,G)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=$(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:$,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,M.LV)(e.origin,e.direction),n,X)||q(X,i,r,e.endpoint,n),V(X,o,X,c),a.push((0,C.fA)(X[0],X[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(X,t[0],t[1],0),e.fromRenderCoords(X,X,i),[X[0],X[1]]));return r.length<=2?new E.A({spatialReference:i}):(r.push(r[0].slice()),(0,R.$3)(r)||r.reverse(),new E.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return O(i,t,e,0),O(r,i,e,1),O(i,r,e,2),O(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,y.g)(e,Z,s),(0,y.g)(e,j,s),Z[0]-=i/2,j[0]+=i/2,Z[1]-=r/2,j[1]+=r/2,(0,b.F)(Z,s,Z,o),(0,b.F)(j,s,j,o),n?(n.xmin=Z[0],n.ymin=Z[1],n.xmax=j[0],n.ymax=j[1],n.spatialReference=o):n=new S.A(Z[0],Z[1],j[0],j[1],o),n}},Symbol.toStringTag,{value:"Module"}));var Q=i(78955),Y=i(91829),K=i(34304),J=i(17136),tt=i(94008),et=i(28735);class it{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}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,T.vt)(),this._points=(0,T.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new tt.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,T.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,T.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,T.m7)(this.frustum,t)}intersectsRay(t){return(0,T.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,T.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,T.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=T.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new tt.iy,(0,M.vt)(),new S.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,g.vt)(),ft=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=U()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:n,direction:s}=r;return(0,_.$A)(n,ft,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,pt),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function xt(t,e){const i=[],r=[],n=(0,K.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,St),h=(0,N.vE)(e,c.origin,c.vector,0,At);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,N.Qj)(e),l=(0,_.Ln)((0,v.vt)(),At,c,t*n),u=(0,_.Ln)((0,v.vt)(),At,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const yt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},bt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),Mt=(0,v.vt)(),At=(0,v.vt)(),Ct=new tt.iy,St=(0,F.vt)(),Et=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=ft,s=mt;return(0,_.S8)(n,t),(0,_.$A)(mt,n,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,n,dt),(0,_.$A)(s,mt,n),H(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=ft;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(s);let m;if(Math.abs(c)<1e-8)m=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=p*o,x=o*o*(d*d),y=u*u*x,b=m-g,w=b*b,T=y*(y+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,m/f),n.tilt=0,vt(n,t);const M=Math.sqrt(T),A=s[1]*b,C=y+w;let S;if(S=u>0?-M+A:M+A,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=S/C;const E=h*h*x,R=d*o,I=u*R*n.eye[1],O=n.eye[1]*n.eye[1],D=1-O,P=Math.sqrt(D),F=y*O+E-2*I*P*b+D*w;return Math.abs(F)<1e-8?((0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(D*(m*s[0]-g*s[0])-R*P*(s[0]*n.eye[1]*u+s[2]*h))/F,n.eye[2]=(D*(m*s[2]-g*s[2])-R*P*(s[2]*n.eye[1]*u-s[0]*h))/F,(0,_.hs)(n.eye,n.eye,m),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+s),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:m}=yt,g=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return Ct.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(Ct,e)}(t),x=(0,l.qE)((u-d)/(p-d),0,1),y=Math.round((0,l.Cc)(f,m,x)),b=r.aboveGround,w=n.planes[5],T=[],A=(0,N.O_)(v.uY,bt,(0,N.vt)()),C=(0,N.O_)(v.uY,wt,(0,N.vt)());(0,Q.hZ)(Et,0,0,0,0);const S=t=>{};for(let t=0;t<4;t++){const e=1===t&&!b||3===t&&b?1-g:0,r=1===t&&b||3===t&&!b?g:1,o=n.lines[t],a=n.lines[3===t?0:t+1];for(let n=0;n<y;n++){const h=n/y,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(Mt,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,M.LV)(d,p),s,At),V(At,c,At,w),T.push((0,v.o8)(At)),0!==T.length&&S((0,_.lo)(T.at(-1),At));const f=((0,N.Tj)(A,At)?1:0)|((0,N.Tj)(C,At)?2:0);Et[f]=1}}T.length>2&&(0,_.lo)(T[0],T.at(-1));const I=function(t,e,i){const r=2*(0,K.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,At,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,At[1]]),n.push([null,At[1]]),s=!0):n.push([At[0],At[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,R.$3)(n)||n.reverse(),n})}((0,Q.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(T,A),C):[T],i,o);return new E.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=p-f,o=p+f;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function y(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=y(a),h=y(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=J.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:x.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new S.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,et.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values(Ot)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),x=i(44280);function y(t,e,i){t.worldUpAtPosition(e,b),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,b)/r)}const b=(0,f.vt)(),w=(0,f.vt)();var T;let M=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.t2)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}equalsView(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&this._fov===t.fov}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(S,t.eye,t.center),(0,p.jb)(E,this.eye,this.center);const i=(0,p.Om)(S,E),r=(0,p.uE)(S),n=(0,p.uE)(E),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,p.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,x.gr)(this.viewForward,(0,p.Re)(S,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==A&&(0,p.C)(A,t),A[3]=1,(0,m.Z0)(A,A,this.projectionMatrix);const i=Math.abs(A[3]);(0,p.hs)(A,A,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*A[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*A[1]),e[2]=.5*(A[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;A[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],A[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],A[2]=(2*t[2]-1)*t[3],A[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(A,A,this.inverseProjectionMatrix),e[0]=A[0],e[1]=A[1],e[2]=A[2])}projectToScreen(t,e){return null==this.projectToRenderScreen(t,R)?null:(this.renderToScreen(R,e),e)}projectToRenderScreen(t,e){if(A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=1,(0,m.Z0)(A,A,this.viewProjectionMatrix),0===A[3])return null;const i=A;(0,p.hs)(i,i,1/Math.abs(A[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,R),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return A[0]=2*(t[0]-i[0])/i[2]-1,A[1]=2*(t[1]-i[1])/i[3]-1,A[2]=2*t[2]-1,A[3]=1,(0,m.Z0)(A,A,C),0===A[3]?null:(e[0]=A[0]/A[3],e[1]=A[1]/A[3],e[2]=A[2]/A[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-y(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,p.Re)(S,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(S,this.center))>.9999*(0,p.Bw)(S)*t||((0,p.$A)(E,S,this.center),(0,p.$A)(E,E,S),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(S,this.eye,this.center),Math.abs(S[2])<=.9999&&((0,p.hs)(S,S,S[2]),(0,p.hZ)(S,-S[0],-S[1],1-S[2]),(0,p.S8)(S,S),(0,p.t2)(this._up,S)||((0,p.C)(this._up,S),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"relativeElevation",void 0),M=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],M);const A=(0,g.vt)(),C=(0,l.vt)(),S=(0,f.vt)(),E=(0,f.vt)(),R=(0,a.r_)()},78607(t,e,i){i.d(e,{A:()=>D});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(92044),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(21231),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class y{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===M(t)||null!=t&&"samples"in t}(e)?new x(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new x(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,S(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,S(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebuffer(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o){const{gl:a}=this._context,c=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(A(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(A(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=C(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=S(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,C(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,S(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),A(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){A(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;y._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>y._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===M(t)}function w(t){return 2===M(t)}function T(t){return 0===M(t)}function M(t){return null!=t&&"type"in t?t.type:null}function A(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function C(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function S(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let D=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("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}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0: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.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(t){return null}get input(){return this._frameBuffer}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D)},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}}},48852(t,e,i){i.d(e,{g:()=>d});var r=i(4576),n=i(44208),s=i(53966),o=i(17676),a=i(34275),c=i(94656),h=i(63907);const l=()=>s.A.getLogger("esri.views.webgl.BufferObject"),u=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class d{static createIndex(t,e,i){return new d(t,34963,e,i)}static createUniform(t,e,i){return new d(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new d(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new d(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new d(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(h.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case h.pe.UNSIGNED_INT:return this._sizeBytes/4;case h.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case h.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return u?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(h.vt.BufferObject,this),this._context=null):this._glName&&l().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case h.pe.UNSIGNED_SHORT:t*=2;break;case h.pe.UNSIGNED_INT:t*=4;case h.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,a.mg)(t)?this._indexType=h.pe.UNSIGNED_BYTE:(0,a.jq)(t)?this._indexType=h.pe.UNSIGNED_SHORT:(0,a.XJ)(t)&&(this._indexType=h.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,c.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,c.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&l().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){if(await this._context.clientWaitAsync(),!this._context||!this._glName)throw(0,o.NK)();this.getSubData(t,e,i,r)}}},14113(t,e,i){i.d(e,{Cy:()=>u,N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,n,e)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0){const t=[];for(const e of this._bodies)"string"==typeof e?t.push(e):t.push(...e());return[`void main() {\n ${t.join("\n")||""} \n}`]}if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){const t=[];for(const e of this._entries)"string"==typeof e?t.push(e):t.push(...e());return t}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>g});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class p extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new p(t,e)}}const f=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),m=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=p.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return f?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:p,isImmutable:f}=c;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(p,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(p,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(p,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:p,isImmutable:f,target:_}=h;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||m().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=l;if((0,d.Qp)(c))c=c.levels[t],x.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;x.texSubImage3D(_,t,e,i,n,s,o,a,u,p,r)}l.bindTexture(v,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:p}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,p,i)}else c.texSubImage2D(t,e,0,0,n,s,u,p,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,p,l)}else c.texImage2D(t,e,i,n,s,0,u,p,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o}=this._descriptor,a=this._descriptor.compress?.compressionTracker,h=this._descriptor.compress?.compressionCallback,{compressedTextureETC:l,compressedTextureS3TC:u}=r.capabilities;if(!g.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!l&&!u)return;this.abortCompression();const d=new AbortController;let p;this._compressionAbortController=d,a?.increment();let f=!1,_=!1;try{t instanceof ImageBitmap?p=t:t instanceof Uint8Array?(p=t.buffer,f=this.descriptor.flipped):(p=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(d),_=!0);const r={data:p,width:e,height:i,needsFlip:f,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:o,hasETC:!!l,hasS3TC:!!u},a=await g.compressionWorkerHandle.invoke(r,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),h?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||m().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_&&p instanceof ImageBitmap&&p.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),n=i(53966),s=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>T,RC:()=>o,T8:()=>a,Uy:()=>p,Xt:()=>u,iD:()=>s,kn:()=>f,nk:()=>d,p3:()=>n,uR:()=>c}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,0),h={face:1029,mode:2305},l={face:1028,mode:2305},u=t=>2===t?h:1===t?l:null;function d(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}const p={zNear:0,zFar:1},f={r:!0,g:!0,b:!0,a:!0};function m(t){return C.intern(t)}function g(t){return E.intern(t)}function _(t){return I.intern(t)}function v(t){return D.intern(t)}function x(t){return F.intern(t)}function y(t){return L.intern(t)}function b(t){return U.intern(t)}function w(t){return V.intern(t)}function T(t){return G.intern(t)}class M{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function A(t){return"["+t.join(",")+"]"}const C=new M(S,t=>({__tag:"Blending",...t}));function S(t){return t?A([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const E=new M(R,t=>({__tag:"Culling",...t}));function R(t){return t?A([t.face,t.mode]):null}const I=new M(O,t=>({__tag:"PolygonOffset",...t}));function O(t){return t?A([t.factor,t.units]):null}const D=new M(P,t=>({__tag:"DepthTest",...t}));function P(t){return t?A([t.func]):null}const F=new M(N,t=>({__tag:"StencilTest",...t}));function N(t){return t?A([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const L=new M(B,t=>({__tag:"DepthWrite",...t}));function B(t){return t?A([t.zNear,t.zFar]):null}const U=new M(H,t=>({__tag:"ColorWrite",...t}));function H(t){return t?A([t.r,t.g,t.b,t.a]):null}const V=new M(z,t=>({__tag:"StencilWrite",...t}));function z(t){return t?A([t.mask]):null}const G=new M(function(t){return t?A([S(t.blending),R(t.culling),O(t.polygonOffset),P(t.depthTest),N(t.stencilTest),B(t.depthWrite),H(t.colorWrite),z(t.stencilWrite)]):null},t=>({blending:m(t.blending),culling:g(t.culling),polygonOffset:_(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:x(t.stencilTest),depthWrite:y(t.depthWrite),colorWrite:b(t.colorWrite),stencilWrite:w(t.stencilWrite)}))},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>g,Kv:()=>f,QE:()=>c,QJ:()=>u,Qp:()=>p,mq:()=>_,re:()=>m,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function p(t){return null!=t&&"type"in t&&"compressed"===t.type}function f(t){return null!=t&&!p(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function m(t){return 32879===t||35866===t}function g(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){i.d(e,{Q:()=>r,v:()=>n});const r=1/255.5,n=1-r}}]);
|
|
261
|
+
`)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q),t.constants.add("opacityCutoff","float",r.v)}},58243(t,e,i){function r(t,e){e.useFloatBlend?t.code.add("float ditherNoise(vec4 color) { return 0.0; }"):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}i.d(e,{t:()=>r})},92044(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>Rt});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let m=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,s.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),x=i(16930),y=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(82919)),M=i(71351);i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),C=i(48163),S=i(5443),E=i(39829),R=i(95108),I=i(37585);function O(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(P,e[0],e[0])&&D(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(P,e[i],r)){case 1:D(t,r);break;case 3:D(t,(0,C.o8)(P));break;case 2:D(t,(0,C.o8)(P)),D(t,r)}}}}function D(t,e){0!==t.length&&(0,I.aI)(t.at(-1),e)||t.push(e)}const P=(0,C.vt)();var F=i(11964),N=i(27921);const L=(0,v.vt)(),B=(0,v.vt)();function U(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function H(t,e,i,r,n){let s=(0,_.S8)(L,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(B,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,B);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(B,s,n),c=((0,_.Om)(B,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function V(t,e,i,r){(0,_.Re)(z,i,e),(0,N.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),G=(0,v.fA)(0,1,0),k=(0,v.fA)(0,0,1),W=(0,g.vt)(),Z=(0,v.vt)(),j=(0,v.vt)();function $(t,e,i,r=U()){const{direction:n,up:s}=r;return(0,A.N9)(W,-(0,l.kU)(e)),(0,A.eL)(W,W,(0,l.kU)(i)),(0,_.Z0)(n,k,W),(0,_.hs)(n,n,-1),(0,_.Z0)(s,G,W),r}function q(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const X=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return H(e,i,r,k,G)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=$(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:$,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,M.LV)(e.origin,e.direction),n,X)||q(X,i,r,e.endpoint,n),V(X,o,X,c),a.push((0,C.fA)(X[0],X[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(X,t[0],t[1],0),e.fromRenderCoords(X,X,i),[X[0],X[1]]));return r.length<=2?new E.A({spatialReference:i}):(r.push(r[0].slice()),(0,R.$3)(r)||r.reverse(),new E.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return O(i,t,e,0),O(r,i,e,1),O(i,r,e,2),O(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,y.g)(e,Z,s),(0,y.g)(e,j,s),Z[0]-=i/2,j[0]+=i/2,Z[1]-=r/2,j[1]+=r/2,(0,b.F)(Z,s,Z,o),(0,b.F)(j,s,j,o),n?(n.xmin=Z[0],n.ymin=Z[1],n.xmax=j[0],n.ymax=j[1],n.spatialReference=o):n=new S.A(Z[0],Z[1],j[0],j[1],o),n}},Symbol.toStringTag,{value:"Module"}));var Q=i(78955),Y=i(91829),K=i(34304),J=i(17136),tt=i(94008),et=i(28735);class it{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}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,T.vt)(),this._points=(0,T.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new tt.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,T.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,T.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,T.m7)(this.frustum,t)}intersectsRay(t){return(0,T.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,T.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,T.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=T.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new tt.iy,(0,M.vt)(),new S.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,g.vt)(),ft=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=U()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:n,direction:s}=r;return(0,_.$A)(n,ft,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,pt),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function xt(t,e){const i=[],r=[],n=(0,K.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,St),h=(0,N.vE)(e,c.origin,c.vector,0,At);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,N.Qj)(e),l=(0,_.Ln)((0,v.vt)(),At,c,t*n),u=(0,_.Ln)((0,v.vt)(),At,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const yt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},bt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),Mt=(0,v.vt)(),At=(0,v.vt)(),Ct=new tt.iy,St=(0,F.vt)(),Et=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=ft,s=mt;return(0,_.S8)(n,t),(0,_.$A)(mt,n,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,n,dt),(0,_.$A)(s,mt,n),H(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=ft;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(s);let m;if(Math.abs(c)<1e-8)m=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=p*o,x=o*o*(d*d),y=u*u*x,b=m-g,w=b*b,T=y*(y+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,m/f),n.tilt=0,vt(n,t);const M=Math.sqrt(T),A=s[1]*b,C=y+w;let S;if(S=u>0?-M+A:M+A,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=S/C;const E=h*h*x,R=d*o,I=u*R*n.eye[1],O=n.eye[1]*n.eye[1],D=1-O,P=Math.sqrt(D),F=y*O+E-2*I*P*b+D*w;return Math.abs(F)<1e-8?((0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(D*(m*s[0]-g*s[0])-R*P*(s[0]*n.eye[1]*u+s[2]*h))/F,n.eye[2]=(D*(m*s[2]-g*s[2])-R*P*(s[2]*n.eye[1]*u-s[0]*h))/F,(0,_.hs)(n.eye,n.eye,m),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+s),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:m}=yt,g=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return Ct.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(Ct,e)}(t),x=(0,l.qE)((u-d)/(p-d),0,1),y=Math.round((0,l.Cc)(f,m,x)),b=r.aboveGround,w=n.planes[5],T=[],A=(0,N.O_)(v.uY,bt,(0,N.vt)()),C=(0,N.O_)(v.uY,wt,(0,N.vt)());(0,Q.hZ)(Et,0,0,0,0);const S=t=>{};for(let t=0;t<4;t++){const e=1===t&&!b||3===t&&b?1-g:0,r=1===t&&b||3===t&&!b?g:1,o=n.lines[t],a=n.lines[3===t?0:t+1];for(let n=0;n<y;n++){const h=n/y,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(Mt,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,M.LV)(d,p),s,At),V(At,c,At,w),T.push((0,v.o8)(At)),0!==T.length&&S((0,_.lo)(T.at(-1),At));const f=((0,N.Tj)(A,At)?1:0)|((0,N.Tj)(C,At)?2:0);Et[f]=1}}T.length>2&&(0,_.lo)(T[0],T.at(-1));const I=function(t,e,i){const r=2*(0,K.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,At,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,At[1]]),n.push([null,At[1]]),s=!0):n.push([At[0],At[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,R.$3)(n)||n.reverse(),n})}((0,Q.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(T,A),C):[T],i,o);return new E.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=p-f,o=p+f;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function y(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=y(a),h=y(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=J.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:x.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new S.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,et.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values(Ot)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),x=i(44280);function y(t,e,i){t.worldUpAtPosition(e,b),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,b)/r)}const b=(0,f.vt)(),w=(0,f.vt)();var T;let M=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.t2)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}equalsView(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&this._fov===t.fov}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(S,t.eye,t.center),(0,p.jb)(E,this.eye,this.center);const i=(0,p.Om)(S,E),r=(0,p.uE)(S),n=(0,p.uE)(E),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,p.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,x.gr)(this.viewForward,(0,p.Re)(S,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==A&&(0,p.C)(A,t),A[3]=1,(0,m.Z0)(A,A,this.projectionMatrix);const i=Math.abs(A[3]);(0,p.hs)(A,A,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*A[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*A[1]),e[2]=.5*(A[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;A[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],A[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],A[2]=(2*t[2]-1)*t[3],A[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(A,A,this.inverseProjectionMatrix),e[0]=A[0],e[1]=A[1],e[2]=A[2])}projectToScreen(t,e){return null==this.projectToRenderScreen(t,R)?null:(this.renderToScreen(R,e),e)}projectToRenderScreen(t,e){if(A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=1,(0,m.Z0)(A,A,this.viewProjectionMatrix),0===A[3])return null;const i=A;(0,p.hs)(i,i,1/Math.abs(A[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,R),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return A[0]=2*(t[0]-i[0])/i[2]-1,A[1]=2*(t[1]-i[1])/i[3]-1,A[2]=2*t[2]-1,A[3]=1,(0,m.Z0)(A,A,C),0===A[3]?null:(e[0]=A[0]/A[3],e[1]=A[1]/A[3],e[2]=A[2]/A[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-y(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,p.Re)(S,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(S,this.center))>.9999*(0,p.Bw)(S)*t||((0,p.$A)(E,S,this.center),(0,p.$A)(E,E,S),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(S,this.eye,this.center),Math.abs(S[2])<=.9999&&((0,p.hs)(S,S,S[2]),(0,p.hZ)(S,-S[0],-S[1],1-S[2]),(0,p.S8)(S,S),(0,p.t2)(this._up,S)||((0,p.C)(this._up,S),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"relativeElevation",void 0),M=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],M);const A=(0,g.vt)(),C=(0,l.vt)(),S=(0,f.vt)(),E=(0,f.vt)(),R=(0,a.r_)()},78607(t,e,i){i.d(e,{A:()=>D});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(92044),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(21231),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class y{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===M(t)||null!=t&&"samples"in t}(e)?new x(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new x(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,S(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,S(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebuffer(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o){const{gl:a}=this._context,c=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(A(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(A(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=C(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=S(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,C(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,S(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),A(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){A(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;y._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>y._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===M(t)}function w(t){return 2===M(t)}function T(t){return 0===M(t)}function M(t){return null!=t&&"type"in t?t.type:null}function A(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function C(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function S(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let D=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("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}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0: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.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(t){return null}get input(){return this._frameBuffer}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D)},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}}},48852(t,e,i){i.d(e,{g:()=>d});var r=i(4576),n=i(44208),s=i(53966),o=i(17676),a=i(34275),c=i(94656),h=i(63907);const l=()=>s.A.getLogger("esri.views.webgl.BufferObject"),u=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class d{static createIndex(t,e,i){return new d(t,34963,e,i)}static createUniform(t,e,i){return new d(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new d(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new d(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new d(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(h.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case h.pe.UNSIGNED_INT:return this._sizeBytes/4;case h.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case h.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return u?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(h.vt.BufferObject,this),this._context=null):this._glName&&l().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case h.pe.UNSIGNED_SHORT:t*=2;break;case h.pe.UNSIGNED_INT:t*=4;case h.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,a.mg)(t)?this._indexType=h.pe.UNSIGNED_BYTE:(0,a.jq)(t)?this._indexType=h.pe.UNSIGNED_SHORT:(0,a.XJ)(t)&&(this._indexType=h.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,c.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,c.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&l().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){if(await this._context.clientWaitAsync(),!this._context||!this._glName)throw(0,o.NK)();this.getSubData(t,e,i,r)}}},14113(t,e,i){i.d(e,{Cy:()=>u,N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,n,e)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0){const t=[];for(const e of this._bodies)"string"==typeof e?t.push(e):t.push(...e());return[`void main() {\n ${t.join("\n")||""} \n}`]}if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){const t=[];for(const e of this._entries)"string"==typeof e?t.push(e):t.push(...e());return t}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>g});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class p extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new p(t,e)}}const f=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),m=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=p.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return f?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:p,isImmutable:f}=c;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(p,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(p,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(p,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:p,isImmutable:f,target:_}=h;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||m().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=l;if((0,d.Qp)(c))c=c.levels[t],x.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;x.texSubImage3D(_,t,e,i,n,s,o,a,u,p,r)}l.bindTexture(v,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:p}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,p,i)}else c.texSubImage2D(t,e,0,0,n,s,u,p,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,p,l)}else c.texImage2D(t,e,i,n,s,0,u,p,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o,compress:a}=this._descriptor;if(!a)return;const{compressionTracker:h,compressionCallback:l,preserveSourceBitmap:u}=a,{compressedTextureETC:d,compressedTextureS3TC:p}=r.capabilities;if(!g.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!d&&!p)return;this.abortCompression();const f=new AbortController;let _;this._compressionAbortController=f,h?.increment();let v=!1,x=!1;try{t instanceof ImageBitmap?u?(_=await createImageBitmap(t),(0,c.Te)(f),x=!0):_=t:t instanceof Uint8Array?(_=t.buffer,v=this.descriptor.flipped):(_=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(f),x=!0);const r={data:_,width:e,height:i,needsFlip:v,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:o,hasETC:!!d,hasS3TC:!!p},a=await g.compressionWorkerHandle.invoke(r,f.signal,1);if((0,c.Te)(f),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),l?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||m().error("Texture compression failed!")}finally{h?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),x&&_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),n=i(53966),s=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>T,RC:()=>o,T8:()=>a,Uy:()=>p,Xt:()=>u,iD:()=>s,kn:()=>f,nk:()=>d,p3:()=>n,uR:()=>c}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,0),h={face:1029,mode:2305},l={face:1028,mode:2305},u=t=>2===t?h:1===t?l:null;function d(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}const p={zNear:0,zFar:1},f={r:!0,g:!0,b:!0,a:!0};function m(t){return C.intern(t)}function g(t){return E.intern(t)}function _(t){return I.intern(t)}function v(t){return D.intern(t)}function x(t){return F.intern(t)}function y(t){return L.intern(t)}function b(t){return U.intern(t)}function w(t){return V.intern(t)}function T(t){return G.intern(t)}class M{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function A(t){return"["+t.join(",")+"]"}const C=new M(S,t=>({__tag:"Blending",...t}));function S(t){return t?A([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const E=new M(R,t=>({__tag:"Culling",...t}));function R(t){return t?A([t.face,t.mode]):null}const I=new M(O,t=>({__tag:"PolygonOffset",...t}));function O(t){return t?A([t.factor,t.units]):null}const D=new M(P,t=>({__tag:"DepthTest",...t}));function P(t){return t?A([t.func]):null}const F=new M(N,t=>({__tag:"StencilTest",...t}));function N(t){return t?A([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const L=new M(B,t=>({__tag:"DepthWrite",...t}));function B(t){return t?A([t.zNear,t.zFar]):null}const U=new M(H,t=>({__tag:"ColorWrite",...t}));function H(t){return t?A([t.r,t.g,t.b,t.a]):null}const V=new M(z,t=>({__tag:"StencilWrite",...t}));function z(t){return t?A([t.mask]):null}const G=new M(function(t){return t?A([S(t.blending),R(t.culling),O(t.polygonOffset),P(t.depthTest),N(t.stencilTest),B(t.depthWrite),H(t.colorWrite),z(t.stencilWrite)]):null},t=>({blending:m(t.blending),culling:g(t.culling),polygonOffset:_(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:x(t.stencilTest),depthWrite:y(t.depthWrite),colorWrite:b(t.colorWrite),stencilWrite:w(t.stencilWrite)}))},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>g,Kv:()=>f,QE:()=>c,QJ:()=>u,Qp:()=>p,mq:()=>_,re:()=>m,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function p(t){return null!=t&&"type"in t&&"compressed"===t.type}function f(t){return null!=t&&!p(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function m(t){return 32879===t||35866===t}function g(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){i.d(e,{Q:()=>r,v:()=>n});const r=1/255.5,n=1-r}}]);
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.2.0-next.
|
|
2
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.2.0-next.36";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
package/core/has.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("min-workers-pool-size",2),has.add("max-workers-pool-size",has("esri-mobile")?3:8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-hybrid-tile-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-allow-editable",!1),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-max-page-size",8e3),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("featurelayer-pbf-true-curves",!0),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("featurelayer-relative-time-queries-enabled",!0),has.add("featurelayer-relative-time-queries-bin-window-public",1),has.add("featurelayer-relative-time-queries-bin-window-private",60),has.add("parquetlayer-full-query-feature-count",5e5),has.add("parquetlayer-persistence-enabled",!0),has.add("parquetlayer-cache-enabled",!0),has.add("parquetlayer-legacy-field-overrides-enabled",!1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",64),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",16),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:analysis-drawtool-line-of-sight",!1),has.add("enable-feature:analysis-drawtool-line-of-sight-placement-visuals",!1),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:analysis-new-viewshed-tool",!
|
|
2
|
+
const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("min-workers-pool-size",2),has.add("max-workers-pool-size",has("esri-mobile")?3:8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-hybrid-tile-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-allow-editable",!1),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-max-page-size",8e3),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("featurelayer-pbf-true-curves",!0),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("featurelayer-relative-time-queries-enabled",!0),has.add("featurelayer-relative-time-queries-bin-window-public",1),has.add("featurelayer-relative-time-queries-bin-window-private",60),has.add("parquetlayer-full-query-feature-count",5e5),has.add("parquetlayer-persistence-enabled",!0),has.add("parquetlayer-cache-enabled",!0),has.add("parquetlayer-legacy-field-overrides-enabled",!1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",64),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",16),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:analysis-drawtool-line-of-sight",!1),has.add("enable-feature:analysis-drawtool-line-of-sight-placement-visuals",!1),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:analysis-new-viewshed-tool",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:im-shading",!0),has.add("enable-feature:im-vertex-normals",!0),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.
|
|
2
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.36",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
package/layers/MapImageLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import r from"../request.js";import t from"../core/Collection.js";import i from"../core/Error.js";import{loadAll as s}from"../core/loadAll.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../request.js";import t from"../core/Collection.js";import i from"../core/Error.js";import{loadAll as s}from"../core/loadAll.js";import{floatEqualAbsolute as o}from"../core/mathUtils.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{debounce as p,throwIfAbortError as n,isAbortError as m}from"../core/promiseUtils.js";import{property as l,subclass as c}from"../core/accessorSupport/decorators.js";import{Integer as u}from"../core/accessorSupport/ensureType.js";import{nameToId as y}from"../core/accessorSupport/PropertyOrigin.js";import d from"../geometry/Extent.js";import{getScale as h}from"../geometry/support/scaleUtils.js";import{srToRESTValue as f}from"../geometry/support/spatialReferenceUtils.js";import g from"./Layer.js";import{APIKeyMixin as v}from"./mixins/APIKeyMixin.js";import{ArcGISMapService as b}from"./mixins/ArcGISMapService.js";import{ArcGISService as x}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as I}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RefreshableLayer as O}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as L}from"./mixins/SublayersOwner.js";import{TemporalLayer as T}from"./mixins/TemporalLayer.js";import{url as U}from"./support/commonProperties.js";import{ExportImageParameters as E}from"./support/ExportImageParameters.js";import{createBitmap as M}from"./support/imageBitmapUtils.js";import F from"./support/Sublayer.js";import{shouldWriteSublayerStructure as _}from"./support/sublayerUtils.js";import{serviceSupportsSpatialReference as R}from"./support/versionUtils.js";import A from"../symbols/support/ElevationInfo.js";import N from"../time/TimeExtent.js";import{timeZoneProperty as J}from"../time/timeZoneUtils.js";import{reader as q}from"../core/accessorSupport/decorators/reader.js";import{writer as k}from"../core/accessorSupport/decorators/writer.js";let V=class extends(j(T(P(L(b(x(I(w(a(O(v(S(g))))))))))))){constructor(...e){super(...e),this._exportImageParameters=new E({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.elevationInfo=new A({mode:"on-the-ground"}),this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null,this._debouncedSaveOperations=p(async(e,r,t)=>{const{save:i,saveAs:s}=await import("./save/mapImageLayerUtils.js");switch(e){case 0:return i(this,r);case 1:return s(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(n).then(()=>this._fetchService(r))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(e,r){const t=r.supportedImageFormatTypes;return t&&t.includes("PNG32")?"png32":"png24"}get loaded(){return super.loaded}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}writeSublayers(e,r,t,i){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:e})=>e&&e.toArray().reverse()).toArray();let o=!1;const a=y(i.origin);let p;if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers)if(3===a){const e=this.createSublayersForOrigin("service").sublayers;o=_(s,e,2)}else if(a>3){const e=this.createSublayersForOrigin("portal-item");o=_(s,e.sublayers,y(e.origin)),p=e.originWithPartialOverrides}const n=[],m={writeSublayerStructure:o,...i,minimumWritableOrigin:p};let l=o||this.hasVisibleLayersForOrigin(a);s.forEach(e=>{const r=e.write({},m);n.push(r),l=l||"user"===e.originOf("visible")});n.some(e=>Object.keys(e).length>1)&&(r.layers=n),l&&(r.visibleLayers=s.filter(e=>e.visible).map(e=>e.id))}createExportImageParameters(e,r,t,i){const s=i?.pixelRatio??1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian()),this._exportImageParameters.floors=i?.floors??null,this._exportImageParameters.scale=i?.scale??h({extent:e,width:r})*s;const a=this._exportImageParameters.toJSON(),p=!i?.rotation||this.version<10.3?{}:{rotation:-i.rotation},n=e?.spatialReference,m=f(n);let l=this._exportImageParameters.scale/h({extent:e,width:r});l=o(l,s)?s:l,a.dpi*=l;const c={};if(i?.timeExtent){const{start:e,end:r}=i.timeExtent.toJSON();c.time=e&&r&&e===r?""+e:`${e??"null"},${r??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(c.time="null,null");return{bbox:e?e.xmin+","+e.ymin+","+e.xmax+","+e.ymax:void 0,bboxSR:m,imageSR:m,size:r+","+t,mapScale:this._exportImageParameters.scale,...a,...p,...c}}async fetchImage(e,r,t,i){const{data:s}=await this._fetchImage("image",e,r,t,i);return s}async fetchImageBitmap(e,r,t,i){const{data:s,url:o}=await this._fetchImage("blob",e,r,t,i);return M(s,o,i)}async fetchRecomputedExtents(e={}){const t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:i}=await r(this.url,t),{extent:s,fullExtent:o,timeExtent:a}=i,p=s||o;return{fullExtent:p&&d.fromJSON(p),timeExtent:a&&N.fromJSON({start:a[0],end:a[1]})}}loadAll(){return s(this,e=>{e(this.allSublayers),e(this.subtables)})}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return R(this,e)}async _fetchImage(e,t,s,o,a){const p={responseType:e,signal:a?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,s,o,a),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},n=this.parsedUrl.path+"/export";if(null!=p.query?.dynamicLayers&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new i("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:p.query});try{const{data:e}=await r(n,p);return{data:e,url:n}}catch(l){if(m(l))throw l;throw new i("mapimagelayer:image-fetch-error",`Unable to load image: ${n}`,{error:l})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:i}=await r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});i&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(e){return!(null==e||!this.sublayersSourceJSON[e]?.visibleLayers)}};e([l(J("dateFieldsTimeReference"))],V.prototype,"dateFieldsTimeZone",void 0),e([l({type:Boolean})],V.prototype,"datesInUnknownTimezone",void 0),e([l()],V.prototype,"dpi",void 0),e([l()],V.prototype,"elevationInfo",void 0),e([l()],V.prototype,"gdbVersion",void 0),e([l()],V.prototype,"imageFormat",void 0),e([q("imageFormat",["supportedImageFormatTypes"])],V.prototype,"readImageFormat",null),e([l({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],V.prototype,"imageMaxHeight",void 0),e([l({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],V.prototype,"imageMaxWidth",void 0),e([l()],V.prototype,"imageTransparency",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],V.prototype,"isReference",void 0),e([l({json:{read:!1,write:!1}})],V.prototype,"labelsVisible",void 0),e([l({type:["ArcGISMapServiceLayer"]})],V.prototype,"operationalLayerType",void 0),e([l({json:{read:!1,write:!1}})],V.prototype,"popupEnabled",void 0),e([l(J("preferredTimeReference"))],V.prototype,"preferredTimeZone",void 0),e([l()],V.prototype,"sourceJSON",void 0),e([l({type:t.ofType(F),json:{write:{ignoreOrigin:!0}}})],V.prototype,"sublayers",void 0),e([k("sublayers",{layers:{type:[F]},visibleLayers:{type:[u]}})],V.prototype,"writeSublayers",null),e([l({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],V.prototype,"listMode",void 0),e([l({json:{read:!1},readOnly:!0,value:"map-image"})],V.prototype,"type",void 0),e([l(U)],V.prototype,"url",void 0),V=e([c("esri.layers.MapImageLayer")],V);const B=V;export{B as default};
|
package/layers/types.d.ts
CHANGED
|
@@ -1043,6 +1043,12 @@ export interface VectorTileLayerCapabilitiesExportTiles {
|
|
|
1043
1043
|
* @see [MapImageLayer.fetchImage()](https://developers.arcgis.com/javascript/latest/references/core/layers/MapImageLayer/#fetchImage)
|
|
1044
1044
|
*/
|
|
1045
1045
|
export interface FetchImageOptions extends AbortOptions {
|
|
1046
|
+
/**
|
|
1047
|
+
* The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at.
|
|
1048
|
+
*
|
|
1049
|
+
* @since 5.0
|
|
1050
|
+
*/
|
|
1051
|
+
pixelRatio?: number | null;
|
|
1046
1052
|
/**
|
|
1047
1053
|
* The rotation in degrees of the exported image. Available since ArcGIS Server 10.3.
|
|
1048
1054
|
*
|
|
@@ -1050,11 +1056,12 @@ export interface FetchImageOptions extends AbortOptions {
|
|
|
1050
1056
|
*/
|
|
1051
1057
|
rotation?: number | null;
|
|
1052
1058
|
/**
|
|
1053
|
-
* The
|
|
1059
|
+
* The map scale of the exported image.
|
|
1060
|
+
* If not specified, the scale will be calculated based on the provided `extent` and `size`.
|
|
1054
1061
|
*
|
|
1055
1062
|
* @since 5.0
|
|
1056
1063
|
*/
|
|
1057
|
-
|
|
1064
|
+
scale?: number | null;
|
|
1058
1065
|
/**
|
|
1059
1066
|
* The time instant or time extent of content to render.
|
|
1060
1067
|
*
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const c="20260702",e="9cb0f65cedee11214dc0733aff765c68de304ab6";export{c as buildDate,e as commitHash};
|