@arcgis/core 5.1.0-next.60 → 5.1.0-next.62
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/{ab223c508f3dd562e7d3.js → 32e9e92bbbd000fbbaf7.js} +2 -2
- package/assets/esri/core/workers/chunks/{68475eba323b4aa892a3.js → 354351ab3fc79dedf9a8.js} +1 -1
- package/assets/esri/core/workers/chunks/45f1e682668cffc00b44.js +1 -0
- package/assets/esri/core/workers/chunks/4dbbf59c79d9e72f20ee.js +1 -0
- package/assets/esri/core/workers/chunks/{6172715b2b2853819d8a.js → 5eeb6d3a7b815d41621e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f74147597805828cb38.js → 5ff41f43e57be0557541.js} +22 -29
- package/assets/esri/core/workers/chunks/{6355de3ee89916b74dae.js → 6b32b3f98872771ff81e.js} +1 -1
- package/assets/esri/core/workers/chunks/71326d16b5cc35c3ff7f.js +1 -0
- package/assets/esri/core/workers/chunks/{c69fefe9d51ac7c2b0a6.js → 75f7c1f600c4051bc905.js} +1 -1
- package/assets/esri/core/workers/chunks/{8083dface1ca2dbd12b2.js → 811b378fa5bf8a4d3d66.js} +1 -1
- package/assets/esri/core/workers/chunks/{8432ffc33843e898bab7.js → 8166ad6bbd7d7a8f91cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{58614f12796dbba013f4.js → 9d289cee96e7c7fe1029.js} +1 -1
- package/assets/esri/core/workers/chunks/{c4da2ca1dee0c44051d0.js → 9d7ffd83f69d6e639f09.js} +1 -1
- package/assets/esri/core/workers/chunks/{0622e238693c257abacb.js → 9eef3cd5f519c8ae88c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{2541ac6e0ed1184edc9b.js → af3bd661b355eed3da21.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4144ccc85ad4c76a9b7.js → af40e2e6eaf3d2226812.js} +1 -1
- package/assets/esri/core/workers/chunks/{0fd191f9c10b3b7c83f4.js → c319c3b85cdec73a9f45.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e1ef2a55f8d123f31e2.js → cbb50415f7de8746ee1a.js} +1 -1
- package/assets/esri/core/workers/chunks/{48d289db3145ce6c02bb.js → d4368e281c12fa7c17c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{266933f1139ed0e8919f.js → e645f992ec6f935ee3a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf4bad2c9a541cd425f5.js → e9dd60d0220036545ebb.js} +1 -1
- package/assets/esri/core/workers/chunks/ed60b5eaa5765bfcb99c.js +1 -0
- package/assets/esri/core/workers/chunks/{a226ba96d9a3ecc14e3e.js → f550fc8c078ebd47d7a3.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/chunks/GlowComposition.glsl.js +4 -5
- package/chunks/ShadowHighlight.glsl.js +5 -5
- package/config.js +1 -1
- package/geometry/libtess.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/circularArcUtils.js +1 -1
- package/geometry/support/curves/ellipticArc4Utils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/interfaces.d.ts +14 -0
- package/kernel.js +1 -1
- package/layers/CSVLayer.d.ts +38 -6
- package/layers/CatalogLayer.d.ts +39 -8
- package/layers/FeatureLayer.d.ts +25 -23
- package/layers/GeoJSONLayer.d.ts +36 -6
- package/layers/ParquetLayer.d.ts +58 -0
- package/layers/SubtypeGroupLayer.d.ts +27 -25
- package/layers/WFSLayer.d.ts +51 -8
- package/layers/catalog/CatalogFootprintLayer.d.ts +37 -7
- package/layers/graphics/sources/csv/csv.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +41 -17
- package/layers/mixins/ArcGISImageService.d.ts +58 -0
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/support/csvUtils.js +1 -1
- package/package.json +3 -3
- package/popup/Feature.d.ts +33 -35
- package/popup/Feature.js +1 -1
- package/popup/Features.d.ts +663 -0
- package/popup/Features.js +2 -0
- package/popup/support/FeatureAbilities.d.ts +30 -0
- package/popup/support/FeatureAbilities.js +2 -0
- package/support/revision.js +1 -1
- package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -11
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/{ScreenSpaceShadowHighlight.glsl.js → ShadowHighlightBuffer.glsl.js} +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBufferTechnique.js +2 -0
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +11 -11
- package/views/3d/webgl-engine/shaders/ReceiveShadowsConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +2 -0
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/plugins/TangentArcSegmentPlugin.js +1 -1
- package/views/support/AnalysisViewManager.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView3D.js +1 -1
- package/widgets/Feature/FeatureViewModel.d.ts +2 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.d.ts +27 -0
- package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.js +2 -0
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +10 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/TableMenuVisibleElements.d.ts +0 -1
- package/widgets/FeatureTable/TableMenuVisibleElements.js +1 -1
- package/widgets/FeatureTable/VisibleElements.d.ts +23 -1
- package/widgets/FeatureTable/VisibleElements.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +10 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Widget.js +1 -1
- package/assets/esri/core/workers/chunks/16806f5044a9da553b66.js +0 -1
- package/assets/esri/core/workers/chunks/5f3f50fec18d1642fdf9.js +0 -1
- package/assets/esri/core/workers/chunks/b42487c6a989e11a2559.js +0 -1
- package/assets/esri/core/workers/chunks/dba479176db0a23c8034.js +0 -1
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightRenderNode.js +0 -2
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/Dithering.glsl.js +0 -4
- /package/assets/esri/core/workers/chunks/{ab223c508f3dd562e7d3.js.LICENSE.txt → 32e9e92bbbd000fbbaf7.js.LICENSE.txt} +0 -0
- /package/chunks/{ScreenSpaceShadowHighlight.glsl.js → ShadowHighlightBuffer.glsl.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3354,6349,9397],{28491(e,t,r){r.d(t,{D:()=>j,b:()=>G});var i=r(32680),n=r(49255),o=r(68317),s=r(76597),a=r(24321),l=r(72722),c=r(43519),u=r(96336),d=r(71955),h=r(53466),m=r(92700),p=r(72824),f=r(54154),g=r(9169),v=r(77695),_=r(71651),x=r(35017),b=r(98619),w=r(62602),y=r(22393),T=r(59469),
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3354,6349,9397],{28491(e,t,r){r.d(t,{D:()=>j,b:()=>G});var i=r(32680),n=r(49255),o=r(68317),s=r(76597),a=r(24321),l=r(72722),c=r(43519),u=r(96336),d=r(71955),h=r(53466),m=r(92700),p=r(72824),f=r(54154),g=r(9169),v=r(77695),_=r(71651),x=r(35017),b=r(98619),w=r(62602),y=r(22393),T=r(59469),M=r(32482),S=r(96598),C=r(51406),E=r(91899),A=r(58614),R=r(27950),I=r(20693),O=r(33079),F=r(71988),P=r(20304),D=r(31821),N=r(63761),B=r(27832),H=r(19245),L=r(73541),z=r(14113),U=r(49788);function G(e){const t=new z.N5,{attributes:r,vertex:G,fragment:j,varyings:V}=t,{output:k,normalType:W,offsetBackfaces:$,spherical:Z,snowCover:q,pbrMode:Y,textureAlphaPremultiplied:X,instancedDoublePrecision:K,hasVertexColors:J,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie}=e;if((0,I.NB)(G,e),r.add("position","vec3"),V.add("vpos","vec3",{invariant:!0}),t.include(E.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(C.q2,e),!(0,n._o)(k))return t.include(g.E,e),t;t.include(C.Sx,e),t.include(C.MU,e),t.include(C.O1,e),t.include(C.QM,e),(0,I.yu)(G,e),t.include(u.Y,e),t.include(s.d);const ne=0===W||1===W;return ne&&$&&t.include(i.M),t.include(v.J,e),t.include(p.Mh,e),t.include(a.v,e),V.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(d.K,e),t.include(m.c,e),G.uniforms.add(new F.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),V.add("vcolorExt","vec4"),t.include(S.Z,e),G.include(c.WD),G.include(c.oF),t.include(K?M.G:M.Bz,e),G.main.add(D.H`
|
|
2
2
|
forwardVertexColor();
|
|
3
3
|
|
|
4
4
|
MaskedColor maskedColor =
|
|
@@ -248,7 +248,7 @@ return mat3(tangent, bitangent, n);
|
|
|
248
248
|
vec2 encodedEmission = encodeRGBtoVec2(blurredEmission.rgb);
|
|
249
249
|
float occlusion = occlusionSum / occlusionWeightSum;
|
|
250
250
|
fragColor = vec4(vec3(encodedEmission.x, encodedEmission.y, centerOcclusionWeight), occlusion);
|
|
251
|
-
`),e}const v=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationBlurDrawParameters:f,build:g},Symbol.toStringTag,{value:"Module"}))},57323(e,t,r){r.d(t,{R:()=>L,b:()=>H});var i=r(32680),n=r(49255),o=r(68317),s=r(76597),a=r(24321),l=r(72722),c=r(43519),u=r(96336),d=r(71955),h=r(53466),m=r(92700),p=r(54154),f=r(9169),g=r(71651),v=r(35017),_=r(98619),x=r(22393),b=r(59469),w=r(32482),y=r(96598),T=r(91899),
|
|
251
|
+
`),e}const v=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationBlurDrawParameters:f,build:g},Symbol.toStringTag,{value:"Module"}))},57323(e,t,r){r.d(t,{R:()=>L,b:()=>H});var i=r(32680),n=r(49255),o=r(68317),s=r(76597),a=r(24321),l=r(72722),c=r(43519),u=r(96336),d=r(71955),h=r(53466),m=r(92700),p=r(54154),f=r(9169),g=r(71651),v=r(35017),_=r(98619),x=r(22393),b=r(59469),w=r(32482),y=r(96598),T=r(91899),M=r(58614),S=r(27950),C=r(20693),E=r(33079),A=r(71988),R=r(20304),I=r(31821),O=r(63761),F=r(27832),P=r(19245),D=r(26934),N=r(73541),B=r(14113);function H(e){const t=new B.N5,{attributes:r,vertex:H,fragment:L,varyings:z}=t,{output:U,offsetBackfaces:G,pbrMode:j,snowCover:V,spherical:k}=e,W=1===j||2===j;if((0,C.NB)(H,e),r.add("position","vec3"),z.add("vpos","vec3",{invariant:!0}),t.include(T.A,e),t.include(l.B,e),t.include(p.Ge,e),t.include(y.Z,e),!(0,n._o)(U))return t.include(f.E,e),t;(0,C.yu)(t.vertex,e),t.include(u.Y,e),t.include(s.d),G&&t.include(i.M),z.add("vNormalWorld","vec3"),z.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(d.K,e),t.include(a.v,e),t.include(m.c,e),H.include(c.WD),H.include(c.oF),H.uniforms.add(new A.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),z.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?w.G:w.Bz,e),H.include(D.Q),H.main.add(I.H`
|
|
252
252
|
forwardVertexColor();
|
|
253
253
|
|
|
254
254
|
MaskedColor maskedColorExt =
|
|
@@ -271,7 +271,7 @@ return mat3(tangent, bitangent, n);
|
|
|
271
271
|
forwardLinearDepthToReadShadowMap();
|
|
272
272
|
gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
|
|
273
273
|
${(0,I.If)(G,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
|
|
274
|
-
`);const{hasColorTexture:$,hasColorTextureTransform:Z}=e;return L.include(v.kA,e),L.include(g.n,e),t.include(
|
|
274
|
+
`);const{hasColorTexture:$,hasColorTextureTransform:Z}=e;return L.include(v.kA,e),L.include(g.n,e),t.include(M.S,e),L.include(o.HQ,e),t.include(N.D,e),(0,C.yu)(L,e),(0,_.Gc)(L),(0,v.a8)(L),(0,v.eU)(L),L.uniforms.add(H.uniforms.get("localOrigin"),H.uniforms.get("view"),new E.t("ambient",e=>e.ambient),new E.t("diffuse",e=>e.diffuse),new R.m("opacity",e=>e.opacity),new R.m("layerOpacity",e=>e.layerOpacity)),$&&L.uniforms.add(new O.N("tex",e=>e.texture)),t.include(b._,e),L.include(x.c,e),L.include(S.N),L.include(F.b,e),(0,_.O4)(L),L.main.add(I.H`
|
|
275
275
|
discardBySlice(vpos);
|
|
276
276
|
discardByTerrainDepth();
|
|
277
277
|
vec4 texColor = ${$?`texture(tex, ${Z?"colorUV":"vuv0"})`:" vec4(1.0)"};
|
|
@@ -411,7 +411,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
411
411
|
vec2 uvOffset = uv + rf * blurSize;
|
|
412
412
|
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
|
|
413
413
|
}
|
|
414
|
-
fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}))},43609(e,t,r){r.d(t,{a:()=>o,f:()=>s,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let s=0,a=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[s]=t[a],e[s+1]=t[a+1],s+=r,a+=n;return}const l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[s]=Math.max(t[a]/l,-1),e[s+1]=Math.max(t[a+1]/l,-1),s+=r,a+=n;else for(let i=0;i<o;++i)e[s]=t[a]/l,e[s+1]=t[a+1]/l,s+=r,a+=n}function s(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,s=i?.count??e.count;let a=(i?.dstIndex??0)*o;for(let e=0;e<s;++e)n[a]=t,n[a+1]=r,a+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:s,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>h,b:()=>l,c:()=>a,d:()=>o,e:()=>m,f:()=>d,l:()=>u,n:()=>p,t:()=>s});var i=r(40876),n=(r(44208),r(72727));function o(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),l=Math.min(s,a),c=r[0],u=r[1],d=r[2],h=r[4],m=r[5],p=r[6],f=r[8],g=r[9],v=r[10],_=r[12],x=r[13],b=r[14];let w=0,y=0;for(let r=0;r<l;r++){const r=t[w],n=t[w+1],s=t[w+2];e[y]=c*r+h*n+f*s+_,e[y+1]=u*r+m*n+g*s+x,e[y+2]=d*r+p*n+v*s+b,w+=o,y+=i}return e}function a(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function l(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),l=Math.min(s,a),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],p=r[5],f=r[6],g=r[7],v=r[8];let _=0,x=0;for(let r=0;r<l;r++){const r=t[_],n=t[_+1],s=t[_+2];e[x]=c*r+h*n+f*s,e[x+1]=u*r+m*n+g*s,e[x+2]=d*r+p*n+v*s,_+=o,x+=i}}function c(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let s=0,a=0;for(let l=0;l<o;l++)e[a]=r*t[s],e[a+1]=r*t[s+1],e[a+2]=r*t[s+2],s+=n,a+=i;return e}function u(e,t,r,i){d(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r,n,o=3,s=o){const a=Math.min(e.length/o,t.length/s);let l=0,c=0;const u=1/i.Tf;for(let i=0;i<a;i++)e[c]=n*(r*t[l])**u,e[c+1]=n*(r*t[l+1])**u,e[c+2]=n*(r*t[l+2])**u,l+=s,c+=o}function h(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),l=Math.min(s,a);let c=0,u=0;for(let n=0;n<l;n++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=o,u+=i;return e}function m(e,t){p(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function p(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,s=0;for(let a=0;a<n;a++){const n=t[o],a=t[o+1],l=t[o+2],c=n*n+a*a+l*l;if(c>0){const t=1/Math.sqrt(c);e[s]=t*n,e[s+1]=t*a,e[s+2]=t*l}o+=i,s+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:d,linearToSRGBView:u,normalize:p,normalizeView:m,scale:c,scaleView:function(e,t,r){c(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)n[c]=s[l]>>r,n[c+1]=s[l+1]>>r,n[c+2]=s[l+2]>>r,l+=a,c+=o},transformMat3:l,transformMat3View:a,transformMat4:s,transformMat4View:o,translate:h},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n,ie:()=>l,uC:()=>a});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+s(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=s(e,t-i):i>r&&(i-=s(e,i-r)),o&&i===r&&(i=t),i+n}function s(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const a=new n(0,2*Math.PI),l=(new n(-Math.PI,Math.PI),new n(0,360))},4341(e,t,r){r.d(t,{I:()=>n});var i=r(26390);class n{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,o));e++)this._items.push(this._allocator())}}const o=1024},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new n(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),s=/^\s*\d+\s*$/;if(!r?.match||!s.test(r))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o?.match||!s.test(o))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(r,10),l=parseInt(o,10);return new n(a,l,t)}}},61473(e,t,r){function i(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function n(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(s)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,s=/^qaext\.arcgis\.com$/,a=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,s,/^jsapps\.esri\.com$/,a,l]},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function s(){return n(1,1)}function a(){return n(1,0)}function l(){return n(0,1)}r.d(t,{Un:()=>u,fA:()=>n,uY:()=>c,vt:()=>i});const c=o(),u=s(),d=a(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:s,unitX:a,unitY:l,zeros:o},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{Qf:()=>l,Qh:()=>s,RS:()=>n,Ul:()=>m,i5:()=>h,lM:()=>o,qK:()=>u});var i=r(34275);const n=16;function o(e){if(!e)return 0;let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function s(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return c(e,8);let r=d;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?s(e):u;case"string":return function(e){return 32+e.length}(e);case"number":return n;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+h:Array.isArray(t)?c(t,n):0:0),0)}function c(e,t){return d+e.length*t}const u=32,d=16,h=145,m=64},65806(e,t,r){r.d(t,{g:()=>s});var i=r(51850),n=r(91218),o=r(9762);function s(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return a[0]=e.x,a[1]=e.y,a[2]=e.z??0,(0,o.projectBuffer)(a,e.spatialReference,0,t,r,0);const s=(0,n.tryProject)(e,r,i);return!!s&&(t[0]=s.x,t[1]=s.y,t[2]=s.z??0,!0)}const a=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>a});var i=r(91218),n=r(16930),o=r(9762),s=r(65806);function a(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,s.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,my:()=>s,tM:()=>u,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<i.y9)return e}else if(e.length<i.y9)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return l;if(e<i.y9)return new Array(e).fill(0);if(e>h.length){const t=Math.max(2*h.length,e);h=new Uint8Array(t)}return new Uint8Array(h.buffer,0,e)}(e.length):n?u(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function s(e){return e<=i.y9?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let a=d(131072);const l=[0],c=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function u(e){return 1===e?l:e<i.y9?Array.from(new Uint16Array(c.buffer,0,e)):e<c.length?new Uint16Array(c.buffer,0,e):(e>a.length&&(a=d(Math.max(2*a.length,e))),new Uint32Array(a.buffer,0,e))}function d(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let h=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;const i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},90239(e,t,r){function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},82919(e,t,r){r.d(t,{DV:()=>v,C:()=>f,vt:()=>m,Qy:()=>p,ui:()=>g,ST:()=>b,bU:()=>w,pw:()=>x,m7:()=>_,c8:()=>T});var i=r(4341),n=r(58083),o=r(35522),s=r(51850),a=r(78955),l=r(91829),c=r(71351);function u(e){return e?{ray:(0,c.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,c.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>u());var d=r(27921),h=r(32114);function m(e){return e?[(0,d.vt)(e[0]),(0,d.vt)(e[1]),(0,d.vt)(e[2]),(0,d.vt)(e[3]),(0,d.vt)(e[4]),(0,d.vt)(e[5])]:[(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)()]}function p(){return[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()]}function f(e,t){for(let r=0;r<S;r++)(0,d.C)(e[r],t[r]);return e}function g(e,t,r,i=A){const s=(0,n.lw)(h.Rc.get(),t,e);(0,n.B8)(s,s);for(let e=0;e<M;++e){const t=(0,a.Z0)(h.Km.get(),C[e],s);(0,o.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}v(r,i)}function v(e,t){(0,d.Cr)(t[4],t[0],t[3],e[0]),(0,d.Cr)(t[1],t[5],t[6],e[1]),(0,d.Cr)(t[4],t[5],t[1],e[2]),(0,d.Cr)(t[3],t[2],t[6],e[3]),(0,d.Cr)(t[0],t[1],t[2],e[4]),(0,d.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<S;r++){const i=e[r];if(i[0]*t.center[0]+i[1]*t.center[1]+i[2]*t.center[2]+i[3]>=t.radius)return!1}return!0}function x(e,t){return y(e,function(e,t=u()){return(0,c.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function b(e,t,r){return y(e,function(e,t,r=u()){const i=(0,o.Bw)(e.vector);return(0,c.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function w(e,t){for(let r=0;r<S;r++)if((0,d.mN)(e[r],t)>0)return!1;return!0}function y(e,t){for(let r=0;r<S;r++)if(!(0,d.$Q)(e[r],t))return!1;return!0}const T={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},S=6,M=8,C=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],E=new i.I(u),A=p()},11964(e,t,r){r.d(t,{Cr:()=>u,LV:()=>c,_I:()=>d,vt:()=>l});var i=r(34727),n=r(4341),o=r(35522),s=r(51850),a=r(32114);function l(e){return e?{origin:(0,s.o8)(e.origin),vector:(0,s.o8)(e.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function c(e,t){const r=h.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,o.C)(r.origin,e),(0,o.Re)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,n,s){const{vector:l,origin:c}=e,u=(0,o.Re)(a.rq.get(),t,c),d=(0,o.Om)(l,u)/(0,o.m3)(l);return(0,o.hs)(s,l,(0,i.qE)(d,0,1)),(0,o.WQ)(s,s,e.origin)}(e,t,0,0,r)}(0,s.vt)(),(0,s.vt)();const h=new n.I(()=>l())},17136(e,t,r){r.d(t,{Y_:()=>A,O7:()=>C,el:()=>M});var i=r(92602),n=r(69052),o=r(49186),s=r(53966),a=r(39829),l=r(82799),c=r(16930),u=r(80754),d=r(21325),h=r(28735),m=r(11254),p=r(60408),f=r(65864),g=r(2272),v=r(84952),_=r(92300);const x=()=>s.A.getLogger("esri.geometry.support.normalizeUtils");function b(e){return"polygon"===e[0].type}function w(e){return"polyline"===e[0].type}function y(e,t,r){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof a.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new o.A("internal:geometry",e)}const r=(0,u.r8)(e),i=[];for(const e of r){const r=[];i.push(r),r.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],o=e[i][1],s=e[i+1][0],a=e[i+1][1],l=Math.sqrt((s-n)*(s-n)+(a-o)*(a-o)),c=(a-o)/l,u=(s-n)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const i=e*t,s=u*i+n,a=c*i+o;r.push([s,a])}const e=(l+Math.floor(d-1)*t)/2,i=u*e+n,s=c*e+o;r.push([i,s])}r.push([s,a])}}return function(e){return"polygon"===e.type}(e)?new a.A({rings:i,spatialReference:e.spatialReference}):new l.A({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.ci)(t,!0)}return r&&(e=(0,u.kS)(e,r)),e}function T(e,t,r){if(Array.isArray(e)){const i=e[0];if(i>t){const r=(0,u.kd)(i,t);e[0]=i+r*(-2*t)}else if(i<r){const t=(0,u.kd)(i,r);e[0]=i+t*(-2*r)}}else{const i=e.x;if(i>t){const r=(0,u.kd)(i,t);e=e.clone().offset(r*(-2*t),0)}else if(i<r){const t=(0,u.kd)(i,r);e=e.clone().offset(t*(-2*r),0)}}return e}function S(e,t){let r=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],o=t.geometries[i],s=(0,u.r8)(o);for(let e=0;e<s.length;e++){const t=s[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const i=t[e][0];r=i>r?i:r}r=Number(r.toFixed(9));const i=-360*(0,u.kd)(r,180);for(let r=0;r<t.length;r++){const t=o.getPoint(e,r);o.setPoint(e,r,t.clone().offset(i,0))}return!0}})}if(n===r){if(b(e))for(const t of(0,u.r8)(o))e[n]=e[n].addRing(t);else if(w(e))for(const t of(0,u.r8)(o))e[n]=e[n].addPath(t)}else r=n,e[n]=o}return e}async function M(e,t,r){if(!Array.isArray(e))return M([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.A.geometryServiceUrl;let o,s,c,b,w,C,E,A,R=0;const I=[],O=[];for(const t of e)if(null!=t)if(o||(o=t.spatialReference,s=(0,d.Vp)(o),c=o.isWebMercator,C=c?102100:4326,b=u.j7[C].maxX,w=u.j7[C].minX,E=u.j7[C].plus180Line,A=u.j7[C].minus180Line),s)if("mesh"===t.type)O.push(t);else if("point"===t.type)O.push(T(t.clone(),b,w));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>T(e,b,w)),O.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,s);O.push(e.rings?new a.A(e):e)}else if(t.extent){const e=t.extent,r=(0,u.kd)(e.xmin,w)*(2*b);let i=0===r?t.clone():(0,u.kS)(t.clone(),r);e.offset(r,0);let{xmin:n,xmax:o}=e;n=Number(n.toFixed(9)),o=Number(o.toFixed(9)),e.intersects(E)&&o!==b?(R=o>R?o:R,i=y(i,c),I.push(i),O.push("cut")):e.intersects(A)&&n!==w?(R=o*(2*b)>R?o*(2*b):R,i=y(i,c,360),I.push(i),O.push("cut")):O.push(i)}else O.push(t.clone());else O.push(t);else O.push(t);let F=(0,u.kd)(R,b),P=-90;const D=F,N=new l.A;for(;F>0;){const e=360*F-180;N.addPath([[e,P],[e,-1*P]]),P*=-1,F--}if(I.length>0&&D>0){const t=S(I,await async function(e,t,r,i){const n=(0,g.Dl)(e),o=t[0].spatialReference,s={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,d.YX)(o),target:JSON.stringify({geometryType:(0,p.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},a=await(0,m.A)(n.path+"/cut",s),{cutIndexes:l,geometries:c=[]}=a.data;return{cutIndexes:l,geometries:c.map(e=>{const t=(0,f.rS)(e);return t.spatialReference=o,t})}}(n,I,N,r)),i=[],o=[];for(let r=0;r<O.length;r++){const n=O[r];if("cut"!==n)o.push(n);else{const n=t.shift(),s=e[r];null!=s&&"polygon"===s.type&&s.rings&&s.rings.length>1&&n.rings.length>=s.rings.length?(i.push(n),o.push("simplify")):o.push(c?(0,h.Gh)(n):n)}}if(!i.length)return o;const s=await async function(e,t,r){const i="string"==typeof e?(0,v.An)(e):e,n=t[0].spatialReference,o=(0,p.$B)(t[0]),s={...r,query:{...i.query,f:"json",sr:(0,d.YX)(n),geometries:JSON.stringify((0,_.X)(t))}},{data:a}=await(0,m.A)(i.path+"/simplify",s);return(0,_.V)(a.geometries,o,n)}(n,i,r),a=[];for(let e=0;e<o.length;e++){const t=o[e];"simplify"!==t?a.push(t):a.push(c?(0,h.Gh)(s.shift()):s.shift())}return a}const B=[];for(let e=0;e<O.length;e++){const t=O[e];if("cut"!==t)B.push(t);else{const e=I.shift();B.push(!0===c?(0,h.Gh)(e):e)}}return B}function C(e,t,r){const i=(0,d.Vp)(r);if(null==i)return e;const[n,o]=i.valid,s=2*o;let a=0,l=0;t>o?a=Math.ceil(Math.abs(t-o)/s):t<n&&(a=-Math.ceil(Math.abs(t-n)/s)),e>o?l=Math.ceil(Math.abs(e-o)/s):e<n&&(l=-Math.ceil(Math.abs(e-n)/s));let c=e+(a-l)*s;const u=c-t;return u>o?c-=s:u<n&&(c+=s),c}function E(e){const t=(0,d.Vp)(e);if(null==t)return null;const[r,i]=t.valid;return new n.hr(r,i)}const A=E(c.A.WGS84);E(c.A.WebMercator)},80754(e,t,r){r.d(t,{j7:()=>s,kS:()=>l,kd:()=>a,r8:()=>c});var i=r(82799),n=r(16930),o=r(60408);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const r=c(e);for(const e of r)for(const r of e)r[0]+=t;return e}function c(e){return(0,o.Bi)(e)?e.rings:e.paths}},71351(e,t,r){r.d(t,{C:()=>u,Cr:()=>d,LV:()=>c,fA:()=>h,oC:()=>m,vt:()=>a}),r(4576);var i=r(4341),n=(r(77690),r(29242)),o=r(35522),s=r(51850);function a(e){return e?l((0,s.o8)(e.origin),(0,s.o8)(e.direction)):l((0,s.vt)(),(0,s.vt)())}function l(e,t){return{origin:e,direction:t}}function c(e,t){const r=p.get();return r.origin=e,r.direction=t,r}function u(e,t=a()){return h(e.origin,e.direction,t)}function d(e,t,r=a()){return(0,o.C)(r.origin,e),(0,o.Re)(r.direction,t,e),r}function h(e,t,r=a()){return(0,o.C)(r.origin,e),(0,o.C)(r.direction,t),r}function m(e,t,r){const i=(0,o.Om)(e.direction,(0,o.Re)(r,t,e.origin));return(0,o.WQ)(r,e.origin,(0,o.hs)(r,e.direction,i)),r}r(32114);const p=new i.I(()=>a());(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,n.vt)()},94008(e,t,r){r.d(t,{iy:()=>m}),r(44208),r(53966);var i=r(34727),n=r(34304),o=r(58083),s=r(35522),a=r(51850),l=r(91829),c=r(34275);var u=r(71351),d=r(44280),h=r(32114);class m{constructor(e=0,t=0,r=0,i=0){this.radius=i,"number"==typeof e?this._center=(0,a.fA)(e,t,r):function(e){return t=e,(0,c.vZ)(t)&&t.length>=3||function(e){return((0,c.aI)(e)||Array.isArray(e))&&e.length>=3}(e);var t}(e)||function(e){return(t=e)instanceof Float32Array&&t.length>=4||function(e){return Array.isArray(e)&&e.length>=4}(e);var t}(e)?(this._center=(0,a.ci)(e),this.radius=4===e.length?e[3]:t):(this._center=(0,a.o8)(e.center),this.radius=e.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(e){(0,s.C)(this.center,e)}exactEquals(e){return(0,s.aI)(this._center,e.center)&&this.radius===e.radius}copyFrom(e){return e!==this&&((0,s.C)(this._center,e.center),this.radius=e.radius),this}clone(){return new m(this.center,this.radius)}toVec4(){return(0,l.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(e){return(0,s.hG)(this.center,e)<=this.radius**2}intersectRay(e,t){if(null==e)return!1;if(!this._intersect(e,p))return!1;let{t0:r,t1:i}=p;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(t){const{origin:i,direction:n}=e;t[0]=i[0]+n[0]*r,t[1]=i[1]+n[1]*r,t[2]=i[2]+n[2]*r}return!0}intersectLine(e,t){const r=(0,u.Cr)(e,t);if(!this._intersect(r,p))return[];const{origin:i,direction:o}=r,{t0:l,t1:c}=p,d=e=>{const t=(0,a.vt)();return(0,s.Ln)(t,i,o,e),this.projectPoint(t,t)};return Math.abs(l-c)<(0,n.FD)()?[d(l)]:[d(l),d(c)]}_intersect(e,t){const{origin:r,direction:i}=e,n=f;n[0]=r[0]-this.center[0],n[1]=r[1]-this.center[1],n[2]=r[2]-this.center[2];const o=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===o)return!1;const s=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),a=s*s-4*o*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-this.radius**2);if(a<0)return!1;const l=Math.sqrt(a);return t.t0=(-s-l)/(2*o),t.t1=(-s+l)/(2*o),!0}projectPoint(e,t){const r=(0,s.Re)(h.rq.get(),e,this.center),i=(0,s.hs)(h.rq.get(),r,this.radius/(0,s.Bw)(r));return(0,s.WQ)(t,i,this.center)}closestPointOnSilhouette(e,t){const r=h.rq.get(),i=h.Rc.get();(0,s.$A)(r,e.origin,e.direction),(0,s.$A)(t,r,e.origin),(0,s.hs)(t,t,1/(0,s.Bw)(t)*this.radius);const n=this._angleToSilhouette(e.origin),a=(0,d.g7)(e.origin,t);return(0,o.$0)(i,a+n,r),(0,s.Z0)(t,t,i),t}frustumCoverage(e,t,r){const i=this.radius,n=i*i,o=e+.5*Math.PI,s=t*t+n-2*Math.cos(o)*t*i,a=Math.sqrt(s),l=s-n;if(l<=0)return.5;const c=Math.sqrt(l),u=Math.acos(c/a)-Math.asin(i/(a/Math.sin(o)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const t=(0,s.Re)(h.rq.get(),e,this.center),r=(0,s.Bw)(t),n=this.radius,o=n+Math.abs(n-r);return(0,i.XM)(n/o)}union(e){const t=(0,s.Io)(this._center,e.center),r=this.radius,i=e.radius;return t+i<r?this:t+r<i?(this.copyFrom(e),this):((0,s.Cc)(this._center,this._center,e.center,(t+i-r)/(2*t)),this.radius=(t+r+i)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(e){const{center:t,radius:r}=this,i=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3];return i<0?Math.min(i+r,0):Math.max(i-r,0)}}new m;const p={t0:0,t1:0},f=(0,a.vt)();(0,a.vt)(),(0,a.vt)()},38969(e,t,r){r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},31217(e,t,r){r.d(t,{D:()=>n});var i=r(11254);async function n(e,t){return(await(0,i.A)(e,{responseType:"image",...t})).data}},92300(e,t,r){r.d(t,{V:()=>s,X:()=>o});var i=r(60408),n=r(65864);function o(e){return{geometryType:(0,i.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function s(e,t,r){const i=(0,n.xD)(t);return e.map(e=>{const t=i.fromJSON(e);return t.spatialReference=r,t})}},21015(e,t,r){r.d(t,{R:()=>l});var i=r(11254),n=r(60999),o=r(49186),s=r(17676),a=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,a.DB)(e)?((0,s.Te)(t),(0,a.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const a=await(0,n.Ke)((0,i.A)(t,{responseType:e,...r}));if(a.ok)return a.value.data;throw(0,s.QP)(a.error),new o.A("gltf-loader-request-error",`Request for resource failed: ${a.error}`)}}},84498(e,t,r){r.d(t,{x:()=>s});var i=r(34275),n=r(97146),o=r(63907);function s(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],s=0;for(let t=0;t<r;++t){const r=e[t+2];i[s++]=n,i[s++]=o,i[s++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>s,Xi:()=>n,pn:()=>a,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function a(e,t){if("image/ktx2"===t)return new n(e);const r=new Blob([e],{type:t});let o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}const s=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{n(),e(s)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),s.removeEventListener("load",r),s.removeEventListener("error",i)};s.addEventListener("load",r),s.addEventListener("error",i),s.src=o});try{s.src=o,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(o),s}},76349(e,t,r){r.d(t,{fetch:()=>Ar});var i=r(40876),n=r(61473),o=r(34727),s=r(77690),a=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),h=r(51850),m=r(70328),p=r(34275);function f(e,t=!1){return e<=p.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var g=r(13030),v=r(73354),_=r(50867),x=r(43609),b=r(21015),w=r(84498),y=r(51530),T=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:T.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:T.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),o=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,s.lw)(c,o,l),(0,s.lw)(c,n,c),c}class M{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new M,this.numberOfVertices=0}}var E=r(11254),A=r(60999),R=r(49186),I=r(53966),O=r(69397);class F{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}copy(){const e=new F;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var P=r(17676),D=r(46140),N=r(97146),B=r(31217),H=r(46610),L=r(20498);function z(e){if(e.length<p.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,p.LW)(e)?(0,L.pX)().from(e):(0,p.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var U=r(15142),G=r(620);class j{get center(){return(0,h.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,h.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,h.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,G.vA)(e.length>=1),(0,G.vA)(3===r.size||4===r.size);const{data:i,size:n,indices:o}=r;(0,G.vA)(o.length%this._numIndexPerPrimitive===0),(0,G.vA)(o.length>=e.length*this._numIndexPerPrimitive);const s=e.length;let a=n*o[this._numIndexPerPrimitive*e[0]];V.clear(),V.push(a);const l=(0,h.fA)(i[a],i[a+1],i[a+2]),c=(0,h.o8)(l);for(let t=0;t<s;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){a=n*o[r+e],V.push(a);let t=i[a];l[0]=Math.min(t,l[0]),c[0]=Math.max(t,c[0]),t=i[a+1],l[1]=Math.min(t,l[1]),c[1]=Math.max(t,c[1]),t=i[a+2],l[2]=Math.min(t,l[2]),c[2]=Math.max(t,c[2])}}for(let e=0;e<3;++e)this._data[4+e]=l[e],this._data[7+e]=c[e];const u=(0,d.Cc)((0,h.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(c[0]-l[0],c[1]-l[1]),c[2]-l[2]),p=m*m;for(let e=0;e<V.length;++e){a=V.at(e);const t=i[a]-u[0],r=i[a+1]-u[1],n=i[a+2]-u[2],o=t*t+r*r+n*n;if(o<=p)continue;const s=Math.sqrt(o),l=.5*(s-m);m+=l,p=m*m;const c=l/s;u[0]+=t*c,u[1]+=r*c,u[2]+=n*c}this._data[3]=m;for(let e=0;e<3;++e)this._data[0+e]=u[e];V.clear()}getChildren(){if(this._children||(0,d.hG)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,d.Cc)((0,h.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:o,indices:s}=this.position;for(let a=0;a<t;++a){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[a];let c=o*s[l],u=n[c],d=n[c+1],h=n[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=o*s[l+e];const t=n[c],r=n[c+1],i=n[c+2];t<u&&(u=t),r<d&&(d=r),i<h&&(h=i)}u<e[0]&&(t|=1),d<e[1]&&(t|=2),h<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new j(l[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){V.prune()}}const V=new U.A({deallocator:null});var k=r(24326);class W{constructor(e){this.id=(0,k.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,N.Dg)(r.indices)})}get attributes(){return this._attributes}}var $=r(4341),Z=r(11964);function q(e,t,r){return(0,d.Re)(Y,t,e),(0,d.Re)(X,r,e),.5*(0,d.Bw)((0,d.$A)(Y,Y,X))}r(32114),new $.I(Z.vt),new $.I(()=>{return e?{p0:(0,h.o8)(e.p0),p1:(0,h.o8)(e.p1),p2:(0,h.o8)(e.p2)}:{p0:(0,h.vt)(),p1:(0,h.vt)(),p2:(0,h.vt)()};var e});const Y=(0,h.vt)(),X=(0,h.vt)(),K=(0,h.vt)(),J=(0,h.vt)(),Q=(0,h.vt)(),ee=(0,h.vt)();class te{constructor(){this.uid=(0,k.c)()}}class re extends te{constructor(e){super(),this.highlightName=e,this.channel=0}}var ie=r(94656);class ne extends W{constructor(e,t,r=null,i=0,n=null,o=-1,s,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=s,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,G.vA)((e?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const l=this.positionAttribute;null!=l&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=l.indices.length)}instantiate(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,ie.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){const r=new Array;for(const i of e)r.push(t.indices[i]);this._vertexPositionIndicesCache=r}else this._vertexPositionIndicesCache=t?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this.drawIndices??this.positionAttribute?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,d.Z0)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t,r=t?.indices){if(!t||!r)return!1;const{size:i,data:n}=t;(0,d.hZ)(e,0,0,0),(0,d.hZ)(ee,0,0,0);let o=0,s=0;for(let t=0;t<r.length-2;t+=3){const a=r[t]*i,l=r[t+1]*i,c=r[t+2]*i;(0,d.hZ)(K,n[a],n[a+1],n[a+2]),(0,d.hZ)(J,n[l],n[l+1],n[l+2]),(0,d.hZ)(Q,n[c],n[c+1],n[c+2]);const u=q(K,J,Q);u?((0,d.WQ)(K,K,J),(0,d.WQ)(K,K,Q),(0,d.hs)(K,K,1/3*u),(0,d.WQ)(e,e,K),o+=u):((0,d.WQ)(ee,ee,K),(0,d.WQ)(ee,ee,J),(0,d.WQ)(ee,ee,Q),s+=3)}return!(0===s&&0===o||(0!==o?((0,d.hs)(e,e,1/o),0):0===s||((0,d.hs)(e,ee,1/s),0)))}(e,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(e){const t=this.positionAttribute,r=this.primitivePositionIndices;return function(e,t,r,i=t?.indices){if(!t||!i)return!1;(0,d.hZ)(e,0,0,0),(0,d.hZ)(ee,0,0,0);let n=0,o=0;const{size:s,data:a}=t,l=i.length-1,c=l+(r?2:0);for(let t=0;t<c;t+=2){const r=t<l?t+1:0,c=i[t<l?t:l]*s,u=i[r]*s;K[0]=a[c],K[1]=a[c+1],K[2]=a[c+2],J[0]=a[u],J[1]=a[u+1],J[2]=a[u+2],(0,d.hs)(K,(0,d.WQ)(K,K,J),.5);const h=(0,d.xg)(K,J);h>0?((0,d.WQ)(e,e,(0,d.hs)(K,K,h)),n+=h):0===n&&((0,d.WQ)(ee,ee,K),o++)}return 0!==n?((0,d.hs)(e,e,1/n),!0):0!==o&&((0,d.hs)(e,ee,1/o),!0)}(e,t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),r)}_computeAttachmentOriginPoints(e){return function(e,t,r=t?.indices){if(!t||!r)return!1;const{size:i,data:n}=t;(0,d.hZ)(e,0,0,0);let o=-1,s=0;for(let t=0;t<r.length;t++){const a=r[t]*i;o!==a&&(e[0]+=n[a],e[1]+=n[a+1],e[2]+=n[a+2],s++),o=a}return s>1&&(0,d.hs)(e,e,1/s),s>0}(e,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const e=this.positionAttribute,t=this.primitivePositionIndices;if(!e||!t||0===t.length)return null;const r=t===e.indices?e:new H.n(e.data,t,e.size,!1,e.stride),i=0===this.type?3:1;(0,G.vA)(t.length%i===0,"Indexing error: "+t.length+" not divisible by "+i);const n=(0,N.tM)(t.length/i);return new j(n,i,r)}get transformation(){return this._transformation??c.zK}set transformation(e){this._transformation=e&&e!==c.zK?(0,c.o8)(e):null}get highlights(){return this._highlights||oe}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new re(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const oe=new Set;var se=r(65529),ae=r(97768),le=r(84952),ce=r(38969),ue=r(95117),de=r(2741);let he;var me=r(63907),pe=r(76284),fe=r(42293);let ge=null,ve=null;async function _e(){return null==ve&&(he??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,de.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),ve=he,ge=await ve),ve}function xe(e,t,r,i,n){const o=(0,fe.MW)(t?me.CQ.COMPRESSED_RGBA8_ETC2_EAC:me.CQ.COMPRESSED_RGB8_ETC2),s=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*s)}function be(e){return e.getNumImages()>=1&&!e.isUASTC()}function we(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function ye(e,t,r,i,n,o,s,a){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[1,me.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,me.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(s(e,u))),a(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new pe.A(e,t,{type:"compressed",levels:m})}const Te=()=>I.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Se(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Me=Se("DXT1"),Ce=Se("DXT3"),Ee=Se("DXT5");function Ae(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function Re(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const s=Math.min(Math.sqrt(r/o),i/n);return[Ae(Math.round(e*s),i),Ae(Math.round(t*s),i)]}(e,t);return e.width===r&&e.height===i?e:Ie(e,r,i)}function Ie(e,t,r){if(e instanceof ImageData)return Ie(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new R.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}var Oe=r(67171);class Fe{constructor(e,t){this._data=e,this.id=(0,k.c)(),this.events=new se.bk,this._parameters={...De,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,le.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,ce.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,le.DB)(e.src)||(0,le.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Oe.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,p.mw)(e)||(0,p.mg)(e))return"image/ktx2"===t.encoding?function(e,t){if(null==ge)return e.byteLength;const r=new ge.KTX2File(new Uint8Array(e)),i=we(r)?xe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):"image/x.basis"===t.encoding?function(e,t){if(null==ge)return e.byteLength;const r=new ge.BasisFile(new Uint8Array(e)),i=be(r)?xe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Pe(e):t,n=t.pixelFormat??6408,o=(0,fe.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new pe.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,p.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,p.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,p.mw)(t)||(0,p.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,p.mw)(t)||(0,p.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,p.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,p.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return Te().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Te().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case Me:n=8,o=me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ee:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Te().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let s=1,a=r[4],l=r[3];(3&a||3&l)&&(Te().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,l=l+3&-4);const c=a,u=l;let d,h;131072&r[2]&&!1!==t&&(s=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<s;++t)h=(a+3>>2)*(l+3>>2)*n,d=new Uint8Array(e.buffer,m,h),p.push(d),m+=h,a=Math.max(1,a>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:s,height:a}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=s,t.height=a,new pe.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==ge&&(ge=await _e());const i=new ge.KTX2File(new Uint8Array(r));if(!we(i))return null;i.startTranscoding();const n=ye(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==ge&&(ge=await _e());const i=new ge.BasisFile(new Uint8Array(r));if(!be(i))return null;i.startTranscoding();const n=ye(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,G.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new pe.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,B.D)(t,{signal:r});return(0,P.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,ue.y)(t,t.src,!1,r);return(0,P.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,n)=>{const o=()=>{t.removeEventListener("loadeddata",s),t.removeEventListener("error",a),(0,ae.xt)(l)},s=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(o(),i(this._loadFromImage(e,t)))},a=e=>{o(),n(e||new R.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",s),t.addEventListener("error",a);const l=(0,P.u7)(r,()=>a((0,P.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=Re(r,e.parameters));const i=Pe(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._texture=new pe.A(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,ae.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function Pe(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const De={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};var Ne=r(49255);class Be{constructor(e){this._material=e.material,this._techniques=e.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(t))}ensureResources(e){return 2}}var He=r(65786);class Le extends Be{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,ae.Gz)(this._texture),this._textureNormal=(0,ae.Gz)(this._textureNormal),this._textureEmissive=(0,ae.Gz)(this._textureEmissive),this._textureOcclusion=(0,ae.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,ae.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new Ue(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,ae.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,P.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,ae.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class ze extends He.Y{constructor(e=null){super(),this.textureEmissive=e}}class Ue extends ze{constructor(e,t,r,i,n,o,s){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=s}}var Ge=r(19245);class je{constructor(e,t){this.id=(0,k.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,Ge.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,Ge.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,Ne._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value}}He.Y;class Ve{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const ke=(0,m.vt)();function We(e,t,r,i,n,o){if(!e.visible)return;const s=(0,d.jb)(nt,i,r),{tolerance:a}=t,l=new Ve(a,!1,t.options.normalRequired);if(e.boundingInfo)(0,G.vA)(0===e.type),Ze(e.boundingInfo,r,s,a,n,l,o);else{const t=e.positionAttribute,i=e.primitivePositionIndices;!function(e,t,r,i,n,o,s,a,l,c){const u=t,h=ot,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),g=m>=p?m>=f?0:2:p>=f?1:2,v=g,_=u[v]<0?2:1,x=(g+_)%3,b=(g+(3-_))%3,w=u[x]/u[v],y=u[b]/u[v],T=1/u[v],S=Ye,M=Xe,C=Ke,{normalRequired:E}=l;for(let t=r;t<i;++t){const r=3*t,i=s*n[r];(0,d.hZ)(h[0],o[i+0],o[i+1],o[i+2]);const l=s*n[r+1];(0,d.hZ)(h[1],o[l+0],o[l+1],o[l+2]);const u=s*n[r+2];(0,d.hZ)(h[2],o[u+0],o[u+1],o[u+2]),a&&((0,d.C)(h[0],a.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.C)(h[1],a.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.C)(h[2],a.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.jb)(S,h[0],e),(0,d.jb)(M,h[1],e),(0,d.jb)(C,h[2],e);const m=S[x]-w*S[v],p=S[b]-y*S[v],f=M[x]-w*M[v],g=M[b]-y*M[v],_=C[x]-w*C[v],A=C[b]-y*C[v],R=_*g-A*f,I=m*A-p*_,O=f*p-g*m;if((R<0||I<0||O<0)&&(R>0||I>0||O>0))continue;const F=R+I+O;if(0===F)continue;const P=R*(T*S[v])+I*(T*M[v])+O*(T*C[v]);if(P*Math.sign(F)<0)continue;const D=P/F;D>=0&&c(D,E?Qe(h):null,t)}}(r,s,0,i.length/3,i,t.data,t.stride,n,l,o)}}const $e=(0,h.vt)();function Ze(e,t,r,i,n,o,s){if(null==e)return;const a=function(e,t){return(0,d.hZ)(t,1/e[0],1/e[1],1/e[2])}(r,$e);if((0,m.Ne)(ke,e.bbMin),(0,m.vI)(ke,e.bbMax),null!=n&&n.applyToAabb(ke),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let s=Math.min(n,o),a=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(a=Math.min(a,Math.max(l,c)),a<0)return!1;if(s=Math.max(s,Math.min(l,c)),s>a)return!1;const u=(e[2]-i-t[2])*r[2],d=(e[5]+i-t[2])*r[2];return a=Math.min(a,Math.max(u,d)),!(a<0)&&(s=Math.max(s,Math.min(u,d)),!(s>a)&&s<1/0)}(e,t,r,i)}(ke,t,a,i)){const{primitiveIndices:a,position:l}=e,c=a?a.length:l.indices.length/3;if(c>rt){const a=e.getChildren();if(void 0!==a){for(const e of a)Ze(e,t,r,i,n,o,s);return}}!function(e,t,r,i,n,o,s,a,l,c,u){const d=e[0],h=e[1],m=e[2],p=t[0],f=t[1],g=t[2],{normalRequired:v}=c;for(let e=0;e<i;++e){const t=a[e],r=3*t,i=s*n[r];let c=o[i],_=o[i+1],x=o[i+2];const b=s*n[r+1];let w=o[b],y=o[b+1],T=o[b+2];const S=s*n[r+2];let M=o[S],C=o[S+1],E=o[S+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[w,y,T]=l.applyToVertex(w,y,T,e),[M,C,E]=l.applyToVertex(M,C,E,e));const A=w-c,R=y-_,I=T-x,O=M-c,F=C-_,P=E-x,D=f*P-F*g,N=g*O-P*p,B=p*F-O*f,H=A*D+R*N+I*B;if(Math.abs(H)<=it)continue;const L=d-c,z=h-_,U=m-x,G=L*D+z*N+U*B;if(H>0){if(G<0||G>H)continue}else if(G>0||G<H)continue;const j=z*I-R*U,V=U*A-I*L,k=L*R-A*z,W=p*j+f*V+g*k;if(H>0){if(W<0||G+W>H)continue}else if(W>0||G+W<H)continue;const $=(O*j+F*V+P*k)/H;$>=0&&u($,v?Je(A,R,I,O,F,P,qe):null,t)}}(t,r,0,c,l.indices,l.data,l.stride,a,n,o,s)}}const qe=(0,h.vt)();const Ye=(0,h.vt)(),Xe=(0,h.vt)(),Ke=(0,h.vt)();function Je(e,t,r,i,n,o,s){return(0,d.hZ)(et,e,t,r),(0,d.hZ)(tt,i,n,o),(0,d.$A)(s,et,tt),(0,d.S8)(s,s),s}function Qe(e){return(0,d.jb)(et,e[1],e[0]),(0,d.jb)(tt,e[2],e[0]),(0,d.$A)(qe,et,tt),(0,d.S8)(qe,qe),qe}const et=(0,h.vt)(),tt=(0,h.vt)(),rt=1e3,it=1e-7,nt=(0,h.vt)(),ot=[(0,h.vt)(),(0,h.vt)(),(0,h.vt)()];var st=r(16396);function at(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length;r*=s;for(let e=0;e<a;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=s}}function lt(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,l=o.length;if(r*=a,1===i)for(let e=0;e<l;++e){const t=3*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}}function ct(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,l=o.length;if(r*=a,1===i)for(let e=0;e<l;++e){const t=4*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}}function ut(e,t,r,i,n=1){const o=t.typedBuffer,s=t.typedBufferStride;if(i*=s,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=s;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=s}function dt(e,t,r,i,n,o){switch(e){case"position":{(0,G.vA)(3===t.size);const i=n.getField(e,g.xs);(0,G.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void lt(e,r,i,n);const{data:o,indices:s}=e,a=r.typedBuffer,c=r.typedBufferStride,u=s.length,d=t[0],h=t[1],m=t[2],p=t[4],f=t[5],g=t[6],v=t[8],_=t[9],x=t[10],b=t[12],w=t[13],y=t[14];i*=c;let T=0,S=0,M=0;const C=(0,l.tZ)(t)?e=>{T=o[e]+b,S=o[e+1]+w,M=o[e+2]+y}:e=>{const t=o[e],r=o[e+1],i=o[e+2];T=d*t+p*r+v*i+b,S=h*t+f*r+_*i+w,M=m*t+g*r+x*i+y};if(1===n)for(let e=0;e<u;++e)C(3*s[e]),a[i]=T,a[i+1]=S,a[i+2]=M,i+=c;else for(let e=0;e<u;++e){C(3*s[e]);for(let e=0;e<n;++e)a[i]=T,a[i+1]=S,a[i+2]=M,i+=c}}(t,r,i,o);break}case"normal":{(0,G.vA)(3===t.size);const r=n.getField(e,g.xs);(0,G.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void lt(e,r,i,n);const{data:o,indices:s}=e,a=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=a[0],m=a[1],p=a[2],f=a[4],g=a[5],v=a[6],_=a[8],x=a[9],b=a[10],w=!(0,l.ut)(a),y=1e-6,T=1-y;i*=u;let S=0,M=0,C=0;const E=(0,l.tZ)(a)?e=>{S=o[e],M=o[e+1],C=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];S=h*t+f*r+_*i,M=m*t+g*r+x*i,C=p*t+v*r+b*i};if(1===n)if(w)for(let e=0;e<d;++e){E(3*s[e]);const t=S*S+M*M+C*C;if(t<T&&t>y){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=M*e,c[i+2]=C*e}else c[i]=S,c[i+1]=M,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)E(3*s[e]),c[i]=S,c[i+1]=M,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(E(3*s[e]),w){const e=S*S+M*M+C*C;if(e<T&&e>y){const t=1/Math.sqrt(e);S*=t,M*=t,C*=t}}for(let e=0;e<n;++e)c[i]=S,c[i+1]=M,c[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,G.vA)(2===t.size);const r=n.getField(e,g.mJ);(0,G.vA)(!!r,`No buffer view for ${e}`),at(t,r,o);break}case"uv0":{(0,G.vA)(2===t.size);const r=n.getField(e,g.ZD)??n.getField(e,g.gH);(0,G.vA)(!!r,`No buffer view for ${e}`),at(t,r,o);break}case"uvi":{(0,G.vA)(2===t.size);const r=n.getField(e,g.mJ);(0,G.vA)(!!r,`No buffer view for ${e}`),at(t,r,o);break}case"color":case"symbolColor":{const r=n.getField(e,g.XP);(0,G.vA)(!!r,`No buffer view for ${e}`),(0,G.vA)(3===t.size||4===t.size),function(e,t,r,i,n=1){const{data:o,indices:s}=e,a=r.typedBuffer,l=r.typedBufferStride,c=s.length;if(i*=l,t===o.length&&4===t){a[i]=o[0],a[i+1]=o[1],a[i+2]=o[2],a[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,s=e[i/=4];i+=t;const u=c*n;for(let r=1;r<u;++r)e[i]=s,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=l}}}(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=n.getField(e,g.Y$)??n.getField(e,g.Y$);(0,G.vA)(!!r,`No buffer view for ${e}`),(0,G.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length,l=i[0];r*=s;for(let e=0;e<a;++e)o[r]=l,r+=s}(t,r,o);break}case"tangent":{(0,G.vA)(4===t.size);const i=n.getField(e,g.Eq);(0,G.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void ct(e,r,i,n);const{data:o,indices:s}=e,a=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=a[0],m=a[1],p=a[2],f=a[4],g=a[5],v=a[6],_=a[8],x=a[9],b=a[10],w=!(0,l.ut)(a),y=1e-6,T=1-y;if(i*=u,1===n)for(let e=0;e<d;++e){const t=4*s[e],r=o[t],n=o[t+1],a=o[t+2],l=o[t+3];let d=h*r+f*n+_*a,S=m*r+g*n+x*a,M=p*r+v*n+b*a;if(w){const e=d*d+S*S+M*M;if(e<T&&e>y){const t=1/Math.sqrt(e);d*=t,S*=t,M*=t}}c[i]=d,c[i+1]=S,c[i+2]=M,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*s[e],r=o[t],a=o[t+1],l=o[t+2],d=o[t+3];let S=h*r+f*a+_*l,M=m*r+g*a+x*l,C=p*r+v*a+b*l;if(w){const e=S*S+M*M+C*C;if(e<T&&e>y){const t=1/Math.sqrt(e);S*=t,M*=t,C*=t}}for(let e=0;e<n;++e)c[i]=S,c[i+1]=M,c[i+2]=C,c[i+3]=d,i+=u}}(t,r,i,o);break}case"profileVertexAndNormal":{(0,G.vA)(4===t.size);const r=n.getField(e,g.jz)??n.getField(e,g.Eq);(0,G.vA)(!!r,`No buffer view for ${e}`),ct(t,r,o);break}case"profileAuxData":{(0,G.vA)(3===t.size);const r=n.getField(e,g.EC)??n.getField(e,g.xs);(0,G.vA)(!!r,`No buffer view for ${e}`),lt(t,r,o);break}}}(0,h.vt)();class ht{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return function(e,t,r,i,n,o,s){let a={numItems:0,numVerticesPerItem:0};for(const l of r.fields.keys()){const r=e.get(l),c=r?.indices;if(r&&c)"position"===l&&(a={numItems:1,numVerticesPerItem:c.length}),dt(l,r,i,n,o,s);else if("olidColor"===l&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;ut(t,o.getField(l,g.XP),e,s)}}}return a}(r,i,this.layout,e,t,n,o)}}const mt={factor:1,units:1},pt={factor:-1,units:-2},ft=new Array;ft[0]=null,ft[1]=mt,ft[2]={factor:-5,units:-5},ft[3]={factor:0,units:-4},ft[4]={factor:1,units:2};const gt=ft.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(pt,e));function vt({output:e,enableOITOffset:t,polygonOffset:r}){return(0,Ne.Sp)(e)&&t?gt[r]:ft[r]}ft[1]=mt;const _t=(0,h.vt)();var xt=r(5482),bt=r(91429),wt=r(91829),yt=r(4431),Tt=r(1843),St=r(72824),Mt=r(13840),Ct=r(42958),Et=r(16943),At=r(90644);const Rt=(0,At.p3)(1,0,1,771);function It(e,t=!1){switch(e){case 0:return t?At.RC:At.T8;case 1:return Rt;default:return null}}function Ot(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?At.Uy:null;case 1:return null}}function Ft(e,t=513){return{func:(0,Ne.Sp)(e)?515:t}}const Pt={mask:255},Dt={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},Nt={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var Bt=r(4576);r(66289);var Ht=r(69622),Lt=r(32728);class zt{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",g.Eq),this.color=e.getField("instanceColor",g.XP),this.olidColor=e.getField("instanceOlidColor",g.XP),this.state=e.getField("state",g.SL),this.lodLevel=e.getField("lodLevel",g.SL)}}let Ut=class extends Ht.A{constructor(e,t){super(e),this.events=new se.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return jt(Gt.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Zt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new zt(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,G.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,G.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=Vt,i=kt;t.localTransform.getMat(e,Wt),t.globalTransform.getMat(e,$t);const n=(0,l.lw)($t,$t,Wt);(0,d.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,s.z0)(i,n),t.model.setMat(e,i);const o=(0,Lt.wp)(Vt,n);o.sort(),t.modelScaleFactors.set(e,0,o[1]),t.modelScaleFactors.set(e,1,o[2]),(0,s.B8)(i,i),(0,s.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,kt),r.modelOrigin.getVec(e,Vt),t[0]=kt[0],t[1]=kt[1],t[2]=kt[2],t[3]=0,t[4]=kt[3],t[5]=kt[4],t[6]=kt[5],t[7]=0,t[8]=kt[6],t[9]=kt[7],t[10]=kt[8],t[11]=0,t[12]=Vt[0],t[13]=Vt[1],t[14]=Vt[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Vt,this,e),t*=Math.max(Vt[0],Vt[1],Vt[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Vt,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Vt[0],Vt[1],Vt[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(Zt,Math.floor(this._capacity*Bt.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new zt(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,xt.Cg)([(0,bt.MZ)({constructOnly:!0})],Ut.prototype,"shaderTransformation",void 0),(0,xt.Cg)([(0,bt.MZ)()],Ut.prototype,"_size",void 0),(0,xt.Cg)([(0,bt.MZ)({readOnly:!0})],Ut.prototype,"size",null),Ut=(0,xt.Cg)([(0,bt.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],Ut);const Gt=(0,Tt.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function jt(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Et.E)()&&e.vec4u8("instanceOlidColor"),e}const Vt=(0,h.vt)(),kt=(0,a.vt)(),Wt=(0,c.vt)(),$t=(0,c.vt)(),Zt=64,qt=(0,Tt.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var Yt=r(74810),Xt=r(28491),Kt=r(49788);class Jt extends St.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Yt.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=h.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,h.CN)(.2,.2,.2),this.diffuse=(0,h.CN)(.8,.8,.8),this.externalColor=(0,wt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,h.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Kt.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}St.gy;let Qt=class extends Ct.w{constructor(e,t){let i=(0,yt.U)(rr(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,yt.U)(function(e){return jt(qt.clone(),e)}(t)))),super(e,t,i),this.shader=new Mt.r(Xt.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:i,cullFace:n,customDepthTest:o,hasOccludees:s}=e;return(0,At.Ey)({blending:i?It(r):null,culling:tr(e)?(0,At.Xt)(n):null,depthTest:Ft(r,er(o)),depthWrite:Ot(e),colorWrite:At.kn,stencilWrite:s?Pt:null,stencilTest:s?t?Nt:Dt:null,polygonOffset:vt(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function er(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function tr(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function rr(e){const t=(0,Tt.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Et.E)()&&t.vec4u8("olidColor"),t}Qt=(0,xt.Cg)([(0,bt.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Qt);var ir=r(51976),nr=r(68317);class or extends nr.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,xt.Cg)([(0,ir.W)()],or.prototype,"hasHighlightMixTexture",void 0);class sr extends or{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,xt.Cg)([(0,ir.W)({count:5})],sr.prototype,"polygonOffset",void 0),(0,xt.Cg)([(0,ir.W)()],sr.prototype,"transparent",void 0),(0,xt.Cg)([(0,ir.W)()],sr.prototype,"enableOITOffset",void 0);class ar extends sr{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,xt.Cg)([(0,ir.W)({count:4})],ar.prototype,"alphaDiscardMode",void 0),(0,xt.Cg)([(0,ir.W)({count:3})],ar.prototype,"doubleSidedMode",void 0),(0,xt.Cg)([(0,ir.W)({count:7})],ar.prototype,"pbrMode",void 0),(0,xt.Cg)([(0,ir.W)({count:3})],ar.prototype,"cullFace",void 0),(0,xt.Cg)([(0,ir.W)({count:3})],ar.prototype,"normalType",void 0),(0,xt.Cg)([(0,ir.W)({count:3})],ar.prototype,"customDepthTest",void 0),(0,xt.Cg)([(0,ir.W)({count:8})],ar.prototype,"emissionSource",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasVertexColors",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasSymbolColors",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasVerticalOffset",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasColorTexture",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasMetallicRoughnessTexture",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasOcclusionTexture",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasNormalTexture",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasScreenSizePerspective",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasVertexTangents",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasOccludees",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"instanced",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"instancedDoublePrecision",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasModelTransformation",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"offsetBackfaces",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasVVSize",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasVVColor",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"receiveShadows",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasShadowHighlights",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"receiveAmbientOcclusion",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"receiveGlobalIllumination",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"textureAlphaPremultiplied",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"instancedFeatureAttribute",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"instancedColor",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"writeDepth",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"terrainDepthTest",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"cullAboveTerrain",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"snowCover",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasColorTextureTransform",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasEmissionTextureTransform",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasNormalTextureTransform",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasOcclusionTextureTransform",void 0),(0,xt.Cg)([(0,ir.W)()],ar.prototype,"hasMetallicRoughnessTextureTransform",void 0);var lr=r(57323);let cr=class extends Qt{constructor(){super(...arguments),this.shader=new Mt.r(lr.R,()=>r.e(2314).then(r.bind(r,39933)))}};cr=(0,xt.Cg)([(0,bt.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],cr);class ur extends ir.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,xt.Cg)([(0,ir.W)()],ur.prototype,"receiveShadows",void 0);class dr extends je{constructor(e,t){super(e,mr),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(0,Ne.uw)(e)&&!this.transparent],[4,e=>(0,Ne.uw)(e)&&this.transparent&&this.parameters.writeDepth],[9,e=>(0,Ne.uw)(e)&&this.transparent&&!this.parameters.writeDepth]]),this._layout=rr(this.parameters),this._configuration=new ar(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=Kt.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,h.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:i,doubleSided:n,doubleSidedType:o}=t;r.hasVertexTangents=!i&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.writeDepth=t.writeDepth,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.cullAboveTerrain=e.cullAboveTerrain,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:n&&"normal"===o?1:n&&"winding-order"===o?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,Ne._o)(e.output)?(r.terrainDepthTest=e.terrainDepthTest,r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.screenSpaceShadowHighlightFbo?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&null!=e.globalIllumination):(r.terrainDepthTest=!1,r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1),r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersect(e,t,r,i,n,o){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.hZ)(xr,t[12],t[13],t[14]);let o=null;switch(r.viewingMode){case 1:o=(0,d.S8)(vr,xr);break;case 2:o=(0,d.C)(vr,gr)}const s=(0,d.Re)(br,xr,e.eye),a=(0,d.Bw)(s),l=(0,d.hs)(s,s,1/a);let c=null;this.parameters.screenSizePerspective&&(c=(0,d.Om)(o,l));const u=(0,Ge.kE)(e,a,this.parameters.verticalOffset,c??0,this.parameters.screenSizePerspective,null);(0,d.hs)(o,o,u),(0,d.ei)(_r,o,r.transform.inverseRotation),i=(0,d.Re)(pr,i,_r),n=(0,d.Re)(fr,n,_r)}o=function(e,t,r,i){const n=vt(t);if(!n)return e;const o=5e-6*n.units,s=(0,d.S8)(_t,(0,d.jb)(_t,i,r));return(t,r,i)=>{const a=(r?1-Math.abs((0,d.Om)(s,r)):0)*n.factor*5e-5+o;return e(t+a,r,i)}}(o,this._configuration,i,n),We(e,r,i,n,(0,st.ou)(r.verticalOffset),o)}createGLMaterial(e){return new hr(e)}createBufferWriter(){return new ht(this._layout)}get transparent(){return function(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:s,textureAlphaMode:a,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=s)&&1!==a&&2!==a&&"replace"!==l}(this.parameters)}}class hr extends Le{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?cr:Qt,e)}}class mr extends Jt{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const pr=(0,h.vt)(),fr=(0,h.vt)(),gr=(0,h.fA)(0,0,1),vr=(0,h.vt)(),_r=(0,h.vt)(),xr=(0,h.vt)(),br=(0,h.vt)(),wr=()=>I.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class yr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function Tr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(wr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(wr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(wr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(wr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else wr().warn("Indexed geometries must specify faces"),i=!1;break}default:wr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(wr().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(wr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Sr(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&((0,m.iT)(t,r.bbMin),(0,m.iT)(t,r.bbMax))}),t}function Mr(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function Cr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Er=new D.A(1,2,"wosr");async function Ar(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,A.Ke)((0,E.A)(e,t));if(r.ok)return r.value.data;(0,P.QP)(r.error),function(e){throw new R.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){wr().warn("Externally referenced texture data is not yet supported");continue}const s=n.encoding+";base64,"+o,a="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==Mr(l)},u=t?.disableTextures?Promise.resolve(null):(0,B.D)(s,t);r.push(u.then(e=>({refId:a,image:e,parameters:c,alphaChannelUsage:l})))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new yr(r,i,n+(0,O.Qh)(r))}(a.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new F,s=e.resource,a=D.A.parse(s.version||"1.0","wosr");Er.validate(a);const l=s.model.name,c=s.model.geometries,u=s.materialDefinitions??{},d=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const s=c[e];if(!Tr(s))continue;const a=Cr(s),l=s.params.vertexAttributes,f=[],g=e=>{if("PerAttributeArray"===s.params.topology)return null;const t=s.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=l.position,_=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,N.tM)(_);f.push([e,new H.n(r,i,t.valuesPerElement,!0)])}const x=a.texture,b=d&&d[x];if(b&&!p.has(x)){const{image:e,parameters:t}=b,r=new Fe(e,t);i.push(r),p.set(x,r)}const w=p.get(x),y=w?w.id:void 0,T=a.material;let S=o.get(T,x);if(null==S){const e=u[T.slice(T.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=b?Mr(b.alphaChannelUsage):void 0,i={ambient:(0,h.ci)(e.diffuse),diffuse:(0,h.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:y,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),S=new dr(i,t),o.set(T,x,S)}n.push(S);const M=new ne(S,f);m+=f.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(M)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:s.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Sr(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let p;if(t.cache)p=await t.cache.loadGLTF(a.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));p=await e(new b.R,a.url,t,t.usePBR,t.useEmissive)}const{engineResources:T,referenceBoundingBox:M}=function(e,t,r){const n=e.model,a=e.meta,p=n.meta?.ESRI_proxyEllipsoid,b=a.isEsriSymbolResource&&null!=p&&"EsriRealisticTreesStyle"===a.ESRI_webstyle;b&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const n=e.model.lods[r];for(const o of n.parts){const n=o.attributes.normal;if(null==n)return;const s=o.attributes.position,a=s.count,u=(0,h.vt)(),m=(0,h.vt)(),p=(0,h.vt)(),f=new Float32Array(4*a),v=new Float32Array(3*a),_=(0,l.B8)((0,c.vt)(),o.transform);let x=0,b=0;for(let l=0;l<a;l++){s.getVec(l,m),n.getVec(l,u),(0,d.Z0)(m,m,o.transform),(0,d.Re)(p,m,t.center),(0,d.Qr)(p,p,t.radius);const a=p[2],c=(0,d.Bw)(p),h=Math.min(.45+.55*c*c,1)**i.Tf;(0,d.Qr)(p,p,t.radius),null!==_&&(0,d.Z0)(p,p,_),(0,d.S8)(p,p),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.Cc)(p,p,u,a>-1?.2:Math.min(-4*a-3.8,1)),v[x]=p[0],v[x+1]=p[1],v[x+2]=p[2],x+=3,f[b]=h,f[b+1]=h,f[b+2]=h,f[b+3]=1,b+=4}o.attributes.normal=new g.xs(v.buffer),o.attributes.color=new g.Eq(f.buffer)}}}(e,p));const T=!!t.usePBR,M=a.isEsriSymbolResource?{usePBR:T,isSchematic:!1,treeRendering:b,mrrFactors:Yt.SY}:{usePBR:T,isSchematic:!1,treeRendering:!1,mrrFactors:Yt.mb},E={...t.materialParameters,treeRendering:b},A=new Array,R=new Map,I=new Map,O=n.lods.length,F=(0,m.Ie)();return n.lods.forEach((e,a)=>{const l=!0===t.skipHighLods&&(O>1&&0===a||O>3&&1===a)||!1===t.skipHighLods&&null!=r&&a!==r;if(l&&0!==a)return;const c=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new dr({},t):function(e,t,r,n,o,s,a,l,c){const d=e.materials.get(t.material);if(null==d)return null;const{normal:h,color:m,texCoord0:p,tangent:f}=t.attributes,g=t.material+(h?"_normal":"")+(m?"_color":"")+(p?"_texCoord0":"")+(f?"_tangent":""),v=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,x=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!s.has(g)){if(v){const t=(t,r=!1,i=!1)=>{if(null!=t&&!a.has(t)){const n=e.textures.get(t);if(n){const e=n.data,o=r&&!(0,y.x3)(e)?l.compressionOptions:void 0;a.set(t,new Fe((0,y.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&i,encoding:(0,y.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==x&&!c;t(d.colorTexture,r,1!==x),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}const r=(0,i.xV)(d.color[0]),h=(0,i.xV)(d.color[1]),m=(0,i.xV)(d.color[2]),p=null!=d.colorTexture&&v?a.get(d.colorTexture):null,f=(0,Yt.Jr)(d),b=null!=d.normalTextureTransform?.scale?d.normalTextureTransform?.scale:u.Un;s.set(g,new dr({...n,customDepthTest:1,textureAlphaMode:x,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,h,m],ambient:[r,h,m],opacity:"OPAQUE"===d.alphaMode?1:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,textureId:null!=p?p.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&v?a.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&v?a.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&v?a.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&v?a.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null!=d.emissiveStrengthKHR?d.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=o.emissiveStrengthFromSymbol?o.emissiveStrengthFromSymbol:void 0,mrrFactors:f?Yt.Bt:[d.metallicFactor,d.roughnessFactor,n.mrrFactors[2]],isSchematic:f,colorTextureTransformMatrix:S(d.colorTextureTransform),normalTextureTransformMatrix:S(d.normalTextureTransform),scale:[b[0],b[1]],occlusionTextureTransformMatrix:S(d.occlusionTextureTransform),emissiveTextureTransformMatrix:S(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(d.metallicRoughnessTextureTransform),...o},l))}const b=s.get(g);if(r.stageResources.materials.push(b),v){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return b}(n,e,c,M,E,R,I,t,b),{geometry:d,vertexCount:h}=function(e,t){const r=e.attributes.position.count,i=(0,w.x)(e.indices||r,e.primitiveType),n=f(3*r),{typedBuffer:a,typedBufferStride:l}=e.attributes.position;(0,v.t)(n,a,e.transform,3,l);const c=[["position",new H.n(n,i,3,!0)]];if(null!=e.attributes.normal){const t=f(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,s.Ge)(Rr,e.transform),(0,v.b)(t,n,Rr,3,a),(0,o.or)(Rr)&&(0,v.n)(t,t),c.push(["normal",new H.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=f(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,s.z0)(Rr,e.transform),(0,_.t)(t,n,Rr,4,a),(0,o.or)(Rr)&&(0,v.n)(t,t,4),c.push(["tangent",new H.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=f(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,x.a)(t,n,2,o),c.push(["uv0",new H.n(t,i,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof g.Eq?(0,_.b)(t,u,1,255):(u instanceof g.XP||u instanceof g.Uz)&&(0,_.b)(t,u,1/255,255):(t.fill(255),u instanceof g.xs?(0,v.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof g.eI||e.attributes.color instanceof g.nS)&&(0,v.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new H.n(t,i,4,!0)])}return{geometry:new ne(t,c),vertexCount:r}}(e,r??new dr({},t)),p=d.boundingInfo;null!=p&&0===a&&((0,m.iT)(F,p.bbMin),(0,m.iT)(F,p.bbMax)),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=h)}),l||A.push(c)}),{engineResources:A,referenceBoundingBox:F}}(p,t,a.specifiedLodIndex);return{lods:T,referenceBoundingBox:M,isEsriSymbolResource:p.meta.isEsriSymbolResource,isWosr:!1}}const Rr=(0,a.vt)()},1843(e,t,r){r.d(t,{BP:()=>d,l5:()=>h});var i=r(20498),n=r(13030),o=r(90239),s=r(4431),a=r(620),l=r(85079);class c{constructor(e,t,r=0){this.layout=e,this.byteOffset=r,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const i=e.fields.get(t);this[t]=new i.constructor(this.buffer,r+i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new c(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:f(e[1].constructor)})))}freeze(){return this}get locations(){return(0,l.Xk)((0,s.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}vec4i16(e,t){return this._appendField(e,n.E7,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new c(this,e)}createView(e,t){return new c(this,e,t)}clone(){const e=new u;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function d(){return new u}class h{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:p(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const m=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function p(e){return`${e.ElementType}_${e.ElementCount}`}function f(e){return g.get(e)}const g=new Map;m.forEach(e=>g.set(p(e),e))},4431(e,t,r){r.d(t,{U:()=>o});var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map(o=>{const s=e.fields.get(o),a=s.constructor.ElementCount,l=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(s.constructor.ElementType),c=s.offset,u=s.optional?.glNormalized??!1,d=s.optional?.integer??!1;return new n._(o,a,l,c,r,u,t,d)})}},26857(e,t,r){r.d(t,{b:()=>a});var i=r(5482),n=r(69622),o=r(91429);let s=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],s.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),s=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],s);const a=new s},46686(e,t,r){r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
|
|
414
|
+
fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}))},43609(e,t,r){r.d(t,{a:()=>o,f:()=>s,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let s=0,a=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[s]=t[a],e[s+1]=t[a+1],s+=r,a+=n;return}const l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[s]=Math.max(t[a]/l,-1),e[s+1]=Math.max(t[a+1]/l,-1),s+=r,a+=n;else for(let i=0;i<o;++i)e[s]=t[a]/l,e[s+1]=t[a+1]/l,s+=r,a+=n}function s(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,s=i?.count??e.count;let a=(i?.dstIndex??0)*o;for(let e=0;e<s;++e)n[a]=t,n[a+1]=r,a+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:s,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>h,b:()=>l,c:()=>a,d:()=>o,e:()=>m,f:()=>d,l:()=>u,n:()=>p,t:()=>s});var i=r(40876),n=(r(44208),r(72727));function o(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),l=Math.min(s,a),c=r[0],u=r[1],d=r[2],h=r[4],m=r[5],p=r[6],f=r[8],g=r[9],v=r[10],_=r[12],x=r[13],b=r[14];let w=0,y=0;for(let r=0;r<l;r++){const r=t[w],n=t[w+1],s=t[w+2];e[y]=c*r+h*n+f*s+_,e[y+1]=u*r+m*n+g*s+x,e[y+2]=d*r+p*n+v*s+b,w+=o,y+=i}return e}function a(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function l(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),l=Math.min(s,a),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],p=r[5],f=r[6],g=r[7],v=r[8];let _=0,x=0;for(let r=0;r<l;r++){const r=t[_],n=t[_+1],s=t[_+2];e[x]=c*r+h*n+f*s,e[x+1]=u*r+m*n+g*s,e[x+2]=d*r+p*n+v*s,_+=o,x+=i}}function c(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let s=0,a=0;for(let l=0;l<o;l++)e[a]=r*t[s],e[a+1]=r*t[s+1],e[a+2]=r*t[s+2],s+=n,a+=i;return e}function u(e,t,r,i){d(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r,n,o=3,s=o){const a=Math.min(e.length/o,t.length/s);let l=0,c=0;const u=1/i.Tf;for(let i=0;i<a;i++)e[c]=n*(r*t[l])**u,e[c+1]=n*(r*t[l+1])**u,e[c+2]=n*(r*t[l+2])**u,l+=s,c+=o}function h(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),l=Math.min(s,a);let c=0,u=0;for(let n=0;n<l;n++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=o,u+=i;return e}function m(e,t){p(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function p(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,s=0;for(let a=0;a<n;a++){const n=t[o],a=t[o+1],l=t[o+2],c=n*n+a*a+l*l;if(c>0){const t=1/Math.sqrt(c);e[s]=t*n,e[s+1]=t*a,e[s+2]=t*l}o+=i,s+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:d,linearToSRGBView:u,normalize:p,normalizeView:m,scale:c,scaleView:function(e,t,r){c(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)n[c]=s[l]>>r,n[c+1]=s[l+1]>>r,n[c+2]=s[l+2]>>r,l+=a,c+=o},transformMat3:l,transformMat3View:a,transformMat4:s,transformMat4View:o,translate:h},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n,ie:()=>l,uC:()=>a});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+s(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=s(e,t-i):i>r&&(i-=s(e,i-r)),o&&i===r&&(i=t),i+n}function s(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const a=new n(0,2*Math.PI),l=(new n(-Math.PI,Math.PI),new n(0,360))},4341(e,t,r){r.d(t,{I:()=>n});var i=r(26390);class n{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,o));e++)this._items.push(this._allocator())}}const o=1024},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new n(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),s=/^\s*\d+\s*$/;if(!r?.match||!s.test(r))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o?.match||!s.test(o))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(r,10),l=parseInt(o,10);return new n(a,l,t)}}},61473(e,t,r){function i(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function n(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(s)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,s=/^qaext\.arcgis\.com$/,a=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,s,/^jsapps\.esri\.com$/,a,l]},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function s(){return n(1,1)}function a(){return n(1,0)}function l(){return n(0,1)}r.d(t,{Un:()=>u,fA:()=>n,uY:()=>c,vt:()=>i});const c=o(),u=s(),d=a(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:s,unitX:a,unitY:l,zeros:o},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{Qf:()=>l,Qh:()=>s,RS:()=>n,Ul:()=>m,i5:()=>h,lM:()=>o,qK:()=>u});var i=r(34275);const n=16;function o(e){if(!e)return 0;let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function s(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return c(e,8);let r=d;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?s(e):u;case"string":return function(e){return 32+e.length}(e);case"number":return n;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+h:Array.isArray(t)?c(t,n):0:0),0)}function c(e,t){return d+e.length*t}const u=32,d=16,h=145,m=64},65806(e,t,r){r.d(t,{g:()=>s});var i=r(51850),n=r(91218),o=r(9762);function s(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return a[0]=e.x,a[1]=e.y,a[2]=e.z??0,(0,o.projectBuffer)(a,e.spatialReference,0,t,r,0);const s=(0,n.tryProject)(e,r,i);return!!s&&(t[0]=s.x,t[1]=s.y,t[2]=s.z??0,!0)}const a=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>a});var i=r(91218),n=r(16930),o=r(9762),s=r(65806);function a(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,s.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,my:()=>s,tM:()=>u,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<i.y9)return e}else if(e.length<i.y9)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return l;if(e<i.y9)return new Array(e).fill(0);if(e>h.length){const t=Math.max(2*h.length,e);h=new Uint8Array(t)}return new Uint8Array(h.buffer,0,e)}(e.length):n?u(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function s(e){return e<=i.y9?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let a=d(131072);const l=[0],c=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function u(e){return 1===e?l:e<i.y9?Array.from(new Uint16Array(c.buffer,0,e)):e<c.length?new Uint16Array(c.buffer,0,e):(e>a.length&&(a=d(Math.max(2*a.length,e))),new Uint32Array(a.buffer,0,e))}function d(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let h=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;const i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},90239(e,t,r){function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},82919(e,t,r){r.d(t,{DV:()=>v,C:()=>f,vt:()=>m,Qy:()=>p,ui:()=>g,ST:()=>b,bU:()=>w,pw:()=>x,m7:()=>_,c8:()=>T});var i=r(4341),n=r(58083),o=r(35522),s=r(51850),a=r(78955),l=r(91829),c=r(71351);function u(e){return e?{ray:(0,c.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,c.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>u());var d=r(27921),h=r(32114);function m(e){return e?[(0,d.vt)(e[0]),(0,d.vt)(e[1]),(0,d.vt)(e[2]),(0,d.vt)(e[3]),(0,d.vt)(e[4]),(0,d.vt)(e[5])]:[(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)()]}function p(){return[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()]}function f(e,t){for(let r=0;r<M;r++)(0,d.C)(e[r],t[r]);return e}function g(e,t,r,i=A){const s=(0,n.lw)(h.Rc.get(),t,e);(0,n.B8)(s,s);for(let e=0;e<S;++e){const t=(0,a.Z0)(h.Km.get(),C[e],s);(0,o.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}v(r,i)}function v(e,t){(0,d.Cr)(t[4],t[0],t[3],e[0]),(0,d.Cr)(t[1],t[5],t[6],e[1]),(0,d.Cr)(t[4],t[5],t[1],e[2]),(0,d.Cr)(t[3],t[2],t[6],e[3]),(0,d.Cr)(t[0],t[1],t[2],e[4]),(0,d.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<M;r++){const i=e[r];if(i[0]*t.center[0]+i[1]*t.center[1]+i[2]*t.center[2]+i[3]>=t.radius)return!1}return!0}function x(e,t){return y(e,function(e,t=u()){return(0,c.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function b(e,t,r){return y(e,function(e,t,r=u()){const i=(0,o.Bw)(e.vector);return(0,c.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function w(e,t){for(let r=0;r<M;r++)if((0,d.mN)(e[r],t)>0)return!1;return!0}function y(e,t){for(let r=0;r<M;r++)if(!(0,d.$Q)(e[r],t))return!1;return!0}const T={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},M=6,S=8,C=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],E=new i.I(u),A=p()},11964(e,t,r){r.d(t,{Cr:()=>u,LV:()=>c,_I:()=>d,vt:()=>l});var i=r(34727),n=r(4341),o=r(35522),s=r(51850),a=r(32114);function l(e){return e?{origin:(0,s.o8)(e.origin),vector:(0,s.o8)(e.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function c(e,t){const r=h.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,o.C)(r.origin,e),(0,o.Re)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,n,s){const{vector:l,origin:c}=e,u=(0,o.Re)(a.rq.get(),t,c),d=(0,o.Om)(l,u)/(0,o.m3)(l);return(0,o.hs)(s,l,(0,i.qE)(d,0,1)),(0,o.WQ)(s,s,e.origin)}(e,t,0,0,r)}(0,s.vt)(),(0,s.vt)();const h=new n.I(()=>l())},17136(e,t,r){r.d(t,{Y_:()=>A,O7:()=>C,el:()=>S});var i=r(92602),n=r(69052),o=r(49186),s=r(53966),a=r(39829),l=r(82799),c=r(16930),u=r(80754),d=r(21325),h=r(28735),m=r(11254),p=r(60408),f=r(65864),g=r(2272),v=r(84952),_=r(92300);const x=()=>s.A.getLogger("esri.geometry.support.normalizeUtils");function b(e){return"polygon"===e[0].type}function w(e){return"polyline"===e[0].type}function y(e,t,r){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof a.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new o.A("internal:geometry",e)}const r=(0,u.r8)(e),i=[];for(const e of r){const r=[];i.push(r),r.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],o=e[i][1],s=e[i+1][0],a=e[i+1][1],l=Math.sqrt((s-n)*(s-n)+(a-o)*(a-o)),c=(a-o)/l,u=(s-n)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const i=e*t,s=u*i+n,a=c*i+o;r.push([s,a])}const e=(l+Math.floor(d-1)*t)/2,i=u*e+n,s=c*e+o;r.push([i,s])}r.push([s,a])}}return function(e){return"polygon"===e.type}(e)?new a.A({rings:i,spatialReference:e.spatialReference}):new l.A({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.ci)(t,!0)}return r&&(e=(0,u.kS)(e,r)),e}function T(e,t,r){if(Array.isArray(e)){const i=e[0];if(i>t){const r=(0,u.kd)(i,t);e[0]=i+r*(-2*t)}else if(i<r){const t=(0,u.kd)(i,r);e[0]=i+t*(-2*r)}}else{const i=e.x;if(i>t){const r=(0,u.kd)(i,t);e=e.clone().offset(r*(-2*t),0)}else if(i<r){const t=(0,u.kd)(i,r);e=e.clone().offset(t*(-2*r),0)}}return e}function M(e,t){let r=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],o=t.geometries[i],s=(0,u.r8)(o);for(let e=0;e<s.length;e++){const t=s[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const i=t[e][0];r=i>r?i:r}r=Number(r.toFixed(9));const i=-360*(0,u.kd)(r,180);for(let r=0;r<t.length;r++){const t=o.getPoint(e,r);o.setPoint(e,r,t.clone().offset(i,0))}return!0}})}if(n===r){if(b(e))for(const t of(0,u.r8)(o))e[n]=e[n].addRing(t);else if(w(e))for(const t of(0,u.r8)(o))e[n]=e[n].addPath(t)}else r=n,e[n]=o}return e}async function S(e,t,r){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.A.geometryServiceUrl;let o,s,c,b,w,C,E,A,R=0;const I=[],O=[];for(const t of e)if(null!=t)if(o||(o=t.spatialReference,s=(0,d.Vp)(o),c=o.isWebMercator,C=c?102100:4326,b=u.j7[C].maxX,w=u.j7[C].minX,E=u.j7[C].plus180Line,A=u.j7[C].minus180Line),s)if("mesh"===t.type)O.push(t);else if("point"===t.type)O.push(T(t.clone(),b,w));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>T(e,b,w)),O.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,s);O.push(e.rings?new a.A(e):e)}else if(t.extent){const e=t.extent,r=(0,u.kd)(e.xmin,w)*(2*b);let i=0===r?t.clone():(0,u.kS)(t.clone(),r);e.offset(r,0);let{xmin:n,xmax:o}=e;n=Number(n.toFixed(9)),o=Number(o.toFixed(9)),e.intersects(E)&&o!==b?(R=o>R?o:R,i=y(i,c),I.push(i),O.push("cut")):e.intersects(A)&&n!==w?(R=o*(2*b)>R?o*(2*b):R,i=y(i,c,360),I.push(i),O.push("cut")):O.push(i)}else O.push(t.clone());else O.push(t);else O.push(t);let F=(0,u.kd)(R,b),P=-90;const D=F,N=new l.A;for(;F>0;){const e=360*F-180;N.addPath([[e,P],[e,-1*P]]),P*=-1,F--}if(I.length>0&&D>0){const t=M(I,await async function(e,t,r,i){const n=(0,g.Dl)(e),o=t[0].spatialReference,s={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,d.YX)(o),target:JSON.stringify({geometryType:(0,p.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},a=await(0,m.A)(n.path+"/cut",s),{cutIndexes:l,geometries:c=[]}=a.data;return{cutIndexes:l,geometries:c.map(e=>{const t=(0,f.rS)(e);return t.spatialReference=o,t})}}(n,I,N,r)),i=[],o=[];for(let r=0;r<O.length;r++){const n=O[r];if("cut"!==n)o.push(n);else{const n=t.shift(),s=e[r];null!=s&&"polygon"===s.type&&s.rings&&s.rings.length>1&&n.rings.length>=s.rings.length?(i.push(n),o.push("simplify")):o.push(c?(0,h.Gh)(n):n)}}if(!i.length)return o;const s=await async function(e,t,r){const i="string"==typeof e?(0,v.An)(e):e,n=t[0].spatialReference,o=(0,p.$B)(t[0]),s={...r,query:{...i.query,f:"json",sr:(0,d.YX)(n),geometries:JSON.stringify((0,_.X)(t))}},{data:a}=await(0,m.A)(i.path+"/simplify",s);return(0,_.V)(a.geometries,o,n)}(n,i,r),a=[];for(let e=0;e<o.length;e++){const t=o[e];"simplify"!==t?a.push(t):a.push(c?(0,h.Gh)(s.shift()):s.shift())}return a}const B=[];for(let e=0;e<O.length;e++){const t=O[e];if("cut"!==t)B.push(t);else{const e=I.shift();B.push(!0===c?(0,h.Gh)(e):e)}}return B}function C(e,t,r){const i=(0,d.Vp)(r);if(null==i)return e;const[n,o]=i.valid,s=2*o;let a=0,l=0;t>o?a=Math.ceil(Math.abs(t-o)/s):t<n&&(a=-Math.ceil(Math.abs(t-n)/s)),e>o?l=Math.ceil(Math.abs(e-o)/s):e<n&&(l=-Math.ceil(Math.abs(e-n)/s));let c=e+(a-l)*s;const u=c-t;return u>o?c-=s:u<n&&(c+=s),c}function E(e){const t=(0,d.Vp)(e);if(null==t)return null;const[r,i]=t.valid;return new n.hr(r,i)}const A=E(c.A.WGS84);E(c.A.WebMercator)},80754(e,t,r){r.d(t,{j7:()=>s,kS:()=>l,kd:()=>a,r8:()=>c});var i=r(82799),n=r(16930),o=r(60408);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const r=c(e);for(const e of r)for(const r of e)r[0]+=t;return e}function c(e){return(0,o.Bi)(e)?e.rings:e.paths}},71351(e,t,r){r.d(t,{C:()=>u,Cr:()=>d,LV:()=>c,fA:()=>h,oC:()=>m,vt:()=>a}),r(4576);var i=r(4341),n=(r(77690),r(29242)),o=r(35522),s=r(51850);function a(e){return e?l((0,s.o8)(e.origin),(0,s.o8)(e.direction)):l((0,s.vt)(),(0,s.vt)())}function l(e,t){return{origin:e,direction:t}}function c(e,t){const r=p.get();return r.origin=e,r.direction=t,r}function u(e,t=a()){return h(e.origin,e.direction,t)}function d(e,t,r=a()){return(0,o.C)(r.origin,e),(0,o.Re)(r.direction,t,e),r}function h(e,t,r=a()){return(0,o.C)(r.origin,e),(0,o.C)(r.direction,t),r}function m(e,t,r){const i=(0,o.Om)(e.direction,(0,o.Re)(r,t,e.origin));return(0,o.WQ)(r,e.origin,(0,o.hs)(r,e.direction,i)),r}r(32114);const p=new i.I(()=>a());(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,n.vt)()},94008(e,t,r){r.d(t,{iy:()=>m}),r(44208),r(53966);var i=r(34727),n=r(34304),o=r(58083),s=r(35522),a=r(51850),l=r(91829),c=r(34275);var u=r(71351),d=r(44280),h=r(32114);class m{constructor(e=0,t=0,r=0,i=0){this.radius=i,"number"==typeof e?this._center=(0,a.fA)(e,t,r):function(e){return t=e,(0,c.vZ)(t)&&t.length>=3||function(e){return((0,c.aI)(e)||Array.isArray(e))&&e.length>=3}(e);var t}(e)||function(e){return(t=e)instanceof Float32Array&&t.length>=4||function(e){return Array.isArray(e)&&e.length>=4}(e);var t}(e)?(this._center=(0,a.ci)(e),this.radius=4===e.length?e[3]:t):(this._center=(0,a.o8)(e.center),this.radius=e.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(e){(0,s.C)(this.center,e)}exactEquals(e){return(0,s.aI)(this._center,e.center)&&this.radius===e.radius}copyFrom(e){return e!==this&&((0,s.C)(this._center,e.center),this.radius=e.radius),this}clone(){return new m(this.center,this.radius)}toVec4(){return(0,l.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(e){return(0,s.hG)(this.center,e)<=this.radius**2}intersectRay(e,t){if(null==e)return!1;if(!this._intersect(e,p))return!1;let{t0:r,t1:i}=p;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(t){const{origin:i,direction:n}=e;t[0]=i[0]+n[0]*r,t[1]=i[1]+n[1]*r,t[2]=i[2]+n[2]*r}return!0}intersectLine(e,t){const r=(0,u.Cr)(e,t);if(!this._intersect(r,p))return[];const{origin:i,direction:o}=r,{t0:l,t1:c}=p,d=e=>{const t=(0,a.vt)();return(0,s.Ln)(t,i,o,e),this.projectPoint(t,t)};return Math.abs(l-c)<(0,n.FD)()?[d(l)]:[d(l),d(c)]}_intersect(e,t){const{origin:r,direction:i}=e,n=f;n[0]=r[0]-this.center[0],n[1]=r[1]-this.center[1],n[2]=r[2]-this.center[2];const o=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===o)return!1;const s=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),a=s*s-4*o*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-this.radius**2);if(a<0)return!1;const l=Math.sqrt(a);return t.t0=(-s-l)/(2*o),t.t1=(-s+l)/(2*o),!0}projectPoint(e,t){const r=(0,s.Re)(h.rq.get(),e,this.center),i=(0,s.hs)(h.rq.get(),r,this.radius/(0,s.Bw)(r));return(0,s.WQ)(t,i,this.center)}closestPointOnSilhouette(e,t){const r=h.rq.get(),i=h.Rc.get();(0,s.$A)(r,e.origin,e.direction),(0,s.$A)(t,r,e.origin),(0,s.hs)(t,t,1/(0,s.Bw)(t)*this.radius);const n=this._angleToSilhouette(e.origin),a=(0,d.g7)(e.origin,t);return(0,o.$0)(i,a+n,r),(0,s.Z0)(t,t,i),t}frustumCoverage(e,t,r){const i=this.radius,n=i*i,o=e+.5*Math.PI,s=t*t+n-2*Math.cos(o)*t*i,a=Math.sqrt(s),l=s-n;if(l<=0)return.5;const c=Math.sqrt(l),u=Math.acos(c/a)-Math.asin(i/(a/Math.sin(o)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const t=(0,s.Re)(h.rq.get(),e,this.center),r=(0,s.Bw)(t),n=this.radius,o=n+Math.abs(n-r);return(0,i.XM)(n/o)}union(e){const t=(0,s.Io)(this._center,e.center),r=this.radius,i=e.radius;return t+i<r?this:t+r<i?(this.copyFrom(e),this):((0,s.Cc)(this._center,this._center,e.center,(t+i-r)/(2*t)),this.radius=(t+r+i)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(e){const{center:t,radius:r}=this,i=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3];return i<0?Math.min(i+r,0):Math.max(i-r,0)}}new m;const p={t0:0,t1:0},f=(0,a.vt)();(0,a.vt)(),(0,a.vt)()},38969(e,t,r){r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},31217(e,t,r){r.d(t,{D:()=>n});var i=r(11254);async function n(e,t){return(await(0,i.A)(e,{responseType:"image",...t})).data}},92300(e,t,r){r.d(t,{V:()=>s,X:()=>o});var i=r(60408),n=r(65864);function o(e){return{geometryType:(0,i.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function s(e,t,r){const i=(0,n.xD)(t);return e.map(e=>{const t=i.fromJSON(e);return t.spatialReference=r,t})}},21015(e,t,r){r.d(t,{R:()=>l});var i=r(11254),n=r(60999),o=r(49186),s=r(17676),a=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,a.DB)(e)?((0,s.Te)(t),(0,a.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const a=await(0,n.Ke)((0,i.A)(t,{responseType:e,...r}));if(a.ok)return a.value.data;throw(0,s.QP)(a.error),new o.A("gltf-loader-request-error",`Request for resource failed: ${a.error}`)}}},84498(e,t,r){r.d(t,{x:()=>s});var i=r(34275),n=r(97146),o=r(63907);function s(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],s=0;for(let t=0;t<r;++t){const r=e[t+2];i[s++]=n,i[s++]=o,i[s++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>s,Xi:()=>n,pn:()=>a,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function a(e,t){if("image/ktx2"===t)return new n(e);const r=new Blob([e],{type:t});let o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}const s=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{n(),e(s)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),s.removeEventListener("load",r),s.removeEventListener("error",i)};s.addEventListener("load",r),s.addEventListener("error",i),s.src=o});try{s.src=o,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(o),s}},76349(e,t,r){r.d(t,{fetch:()=>Ir});var i=r(40876),n=r(61473),o=r(34727),s=r(77690),a=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),h=r(51850),m=r(70328),p=r(34275);function f(e,t=!1){return e<=p.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var g=r(13030),v=r(73354),_=r(50867),x=r(43609),b=r(21015),w=r(84498),y=r(51530),T=r(88340);function M(e){if(null==e)return null;const t=null!=e.offset?e.offset:T.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:T.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),o=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,s.lw)(c,o,l),(0,s.lw)(c,n,c),c}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var E=r(11254),A=r(60999),R=r(49186),I=r(53966),O=r(69397);class F{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}copy(){const e=new F;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var P=r(17676),D=r(46140),N=r(97146),B=r(31217),H=r(46610),L=r(20498);function z(e){if(e.length<p.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,p.LW)(e)?(0,L.pX)().from(e):(0,p.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var U=r(15142),G=r(620);class j{get center(){return(0,h.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,h.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,h.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,G.vA)(e.length>=1),(0,G.vA)(3===r.size||4===r.size);const{data:i,size:n,indices:o}=r;(0,G.vA)(o.length%this._numIndexPerPrimitive===0),(0,G.vA)(o.length>=e.length*this._numIndexPerPrimitive);const s=e.length;let a=n*o[this._numIndexPerPrimitive*e[0]];V.clear(),V.push(a);const l=(0,h.fA)(i[a],i[a+1],i[a+2]),c=(0,h.o8)(l);for(let t=0;t<s;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){a=n*o[r+e],V.push(a);let t=i[a];l[0]=Math.min(t,l[0]),c[0]=Math.max(t,c[0]),t=i[a+1],l[1]=Math.min(t,l[1]),c[1]=Math.max(t,c[1]),t=i[a+2],l[2]=Math.min(t,l[2]),c[2]=Math.max(t,c[2])}}for(let e=0;e<3;++e)this._data[4+e]=l[e],this._data[7+e]=c[e];const u=(0,d.Cc)((0,h.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(c[0]-l[0],c[1]-l[1]),c[2]-l[2]),p=m*m;for(let e=0;e<V.length;++e){a=V.at(e);const t=i[a]-u[0],r=i[a+1]-u[1],n=i[a+2]-u[2],o=t*t+r*r+n*n;if(o<=p)continue;const s=Math.sqrt(o),l=.5*(s-m);m+=l,p=m*m;const c=l/s;u[0]+=t*c,u[1]+=r*c,u[2]+=n*c}this._data[3]=m;for(let e=0;e<3;++e)this._data[0+e]=u[e];V.clear()}getChildren(){if(this._children||(0,d.hG)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,d.Cc)((0,h.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:o,indices:s}=this.position;for(let a=0;a<t;++a){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[a];let c=o*s[l],u=n[c],d=n[c+1],h=n[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=o*s[l+e];const t=n[c],r=n[c+1],i=n[c+2];t<u&&(u=t),r<d&&(d=r),i<h&&(h=i)}u<e[0]&&(t|=1),d<e[1]&&(t|=2),h<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new j(l[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){V.prune()}}const V=new U.A({deallocator:null});var k=r(24326);class W{constructor(e){this.id=(0,k.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,N.Dg)(r.indices)})}get attributes(){return this._attributes}}var $=r(4341),Z=r(11964);function q(e,t,r){return(0,d.Re)(Y,t,e),(0,d.Re)(X,r,e),.5*(0,d.Bw)((0,d.$A)(Y,Y,X))}r(32114),new $.I(Z.vt),new $.I(()=>{return e?{p0:(0,h.o8)(e.p0),p1:(0,h.o8)(e.p1),p2:(0,h.o8)(e.p2)}:{p0:(0,h.vt)(),p1:(0,h.vt)(),p2:(0,h.vt)()};var e});const Y=(0,h.vt)(),X=(0,h.vt)(),K=(0,h.vt)(),J=(0,h.vt)(),Q=(0,h.vt)(),ee=(0,h.vt)();class te{constructor(){this.uid=(0,k.c)()}}class re extends te{constructor(e){super(),this.highlightName=e,this.channel=0}}var ie=r(94656);class ne extends W{constructor(e,t,r=null,i=0,n=null,o=-1,s,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=s,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,G.vA)((e?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const l=this.positionAttribute;null!=l&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=l.indices.length)}instantiate(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,ie.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){const r=new Array;for(const i of e)r.push(t.indices[i]);this._vertexPositionIndicesCache=r}else this._vertexPositionIndicesCache=t?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this.drawIndices??this.positionAttribute?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,d.Z0)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t,r=t?.indices){if(!t||!r)return!1;const{size:i,data:n}=t;(0,d.hZ)(e,0,0,0),(0,d.hZ)(ee,0,0,0);let o=0,s=0;for(let t=0;t<r.length-2;t+=3){const a=r[t]*i,l=r[t+1]*i,c=r[t+2]*i;(0,d.hZ)(K,n[a],n[a+1],n[a+2]),(0,d.hZ)(J,n[l],n[l+1],n[l+2]),(0,d.hZ)(Q,n[c],n[c+1],n[c+2]);const u=q(K,J,Q);u?((0,d.WQ)(K,K,J),(0,d.WQ)(K,K,Q),(0,d.hs)(K,K,1/3*u),(0,d.WQ)(e,e,K),o+=u):((0,d.WQ)(ee,ee,K),(0,d.WQ)(ee,ee,J),(0,d.WQ)(ee,ee,Q),s+=3)}return!(0===s&&0===o||(0!==o?((0,d.hs)(e,e,1/o),0):0===s||((0,d.hs)(e,ee,1/s),0)))}(e,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(e){const t=this.positionAttribute,r=this.primitivePositionIndices;return function(e,t,r,i=t?.indices){if(!t||!i)return!1;(0,d.hZ)(e,0,0,0),(0,d.hZ)(ee,0,0,0);let n=0,o=0;const{size:s,data:a}=t,l=i.length-1,c=l+(r?2:0);for(let t=0;t<c;t+=2){const r=t<l?t+1:0,c=i[t<l?t:l]*s,u=i[r]*s;K[0]=a[c],K[1]=a[c+1],K[2]=a[c+2],J[0]=a[u],J[1]=a[u+1],J[2]=a[u+2],(0,d.hs)(K,(0,d.WQ)(K,K,J),.5);const h=(0,d.xg)(K,J);h>0?((0,d.WQ)(e,e,(0,d.hs)(K,K,h)),n+=h):0===n&&((0,d.WQ)(ee,ee,K),o++)}return 0!==n?((0,d.hs)(e,e,1/n),!0):0!==o&&((0,d.hs)(e,ee,1/o),!0)}(e,t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),r)}_computeAttachmentOriginPoints(e){return function(e,t,r=t?.indices){if(!t||!r)return!1;const{size:i,data:n}=t;(0,d.hZ)(e,0,0,0);let o=-1,s=0;for(let t=0;t<r.length;t++){const a=r[t]*i;o!==a&&(e[0]+=n[a],e[1]+=n[a+1],e[2]+=n[a+2],s++),o=a}return s>1&&(0,d.hs)(e,e,1/s),s>0}(e,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const e=this.positionAttribute,t=this.primitivePositionIndices;if(!e||!t||0===t.length)return null;const r=t===e.indices?e:new H.n(e.data,t,e.size,!1,e.stride),i=0===this.type?3:1;(0,G.vA)(t.length%i===0,"Indexing error: "+t.length+" not divisible by "+i);const n=(0,N.tM)(t.length/i);return new j(n,i,r)}get transformation(){return this._transformation??c.zK}set transformation(e){this._transformation=e&&e!==c.zK?(0,c.o8)(e):null}get highlights(){return this._highlights||oe}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new re(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const oe=new Set;var se=r(65529),ae=r(97768),le=r(84952),ce=r(38969),ue=r(95117),de=r(2741);let he;var me=r(63907),pe=r(76284),fe=r(42293);let ge=null,ve=null;async function _e(){return null==ve&&(he??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,de.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),ve=he,ge=await ve),ve}function xe(e,t,r,i,n){const o=(0,fe.MW)(t?me.CQ.COMPRESSED_RGBA8_ETC2_EAC:me.CQ.COMPRESSED_RGB8_ETC2),s=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*s)}function be(e){return e.getNumImages()>=1&&!e.isUASTC()}function we(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function ye(e,t,r,i,n,o,s,a){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[1,me.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,me.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(s(e,u))),a(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new pe.A(e,t,{type:"compressed",levels:m})}const Te=()=>I.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Me(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Se=Me("DXT1"),Ce=Me("DXT3"),Ee=Me("DXT5");function Ae(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function Re(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const s=Math.min(Math.sqrt(r/o),i/n);return[Ae(Math.round(e*s),i),Ae(Math.round(t*s),i)]}(e,t);return e.width===r&&e.height===i?e:Ie(e,r,i)}function Ie(e,t,r){if(e instanceof ImageData)return Ie(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new R.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}var Oe=r(67171);class Fe{constructor(e,t){this._data=e,this.id=(0,k.c)(),this.events=new se.bk,this._parameters={...De,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,le.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,ce.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,le.DB)(e.src)||(0,le.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Oe.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,p.mw)(e)||(0,p.mg)(e))return"image/ktx2"===t.encoding?function(e,t){if(null==ge)return e.byteLength;const r=new ge.KTX2File(new Uint8Array(e)),i=we(r)?xe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):"image/x.basis"===t.encoding?function(e,t){if(null==ge)return e.byteLength;const r=new ge.BasisFile(new Uint8Array(e)),i=be(r)?xe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Pe(e):t,n=t.pixelFormat??6408,o=(0,fe.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new pe.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,p.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,p.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,p.mw)(t)||(0,p.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,p.mw)(t)||(0,p.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,p.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,p.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return Te().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Te().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case Se:n=8,o=me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ee:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Te().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let s=1,a=r[4],l=r[3];(3&a||3&l)&&(Te().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,l=l+3&-4);const c=a,u=l;let d,h;131072&r[2]&&!1!==t&&(s=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<s;++t)h=(a+3>>2)*(l+3>>2)*n,d=new Uint8Array(e.buffer,m,h),p.push(d),m+=h,a=Math.max(1,a>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:s,height:a}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=s,t.height=a,new pe.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==ge&&(ge=await _e());const i=new ge.KTX2File(new Uint8Array(r));if(!we(i))return null;i.startTranscoding();const n=ye(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==ge&&(ge=await _e());const i=new ge.BasisFile(new Uint8Array(r));if(!be(i))return null;i.startTranscoding();const n=ye(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,G.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new pe.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,B.D)(t,{signal:r});return(0,P.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,ue.y)(t,t.src,!1,r);return(0,P.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,n)=>{const o=()=>{t.removeEventListener("loadeddata",s),t.removeEventListener("error",a),(0,ae.xt)(l)},s=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(o(),i(this._loadFromImage(e,t)))},a=e=>{o(),n(e||new R.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",s),t.addEventListener("error",a);const l=(0,P.u7)(r,()=>a((0,P.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=Re(r,e.parameters));const i=Pe(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._texture=new pe.A(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,ae.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function Pe(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const De={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};var Ne=r(49255);class Be{constructor(e){this._material=e.material,this._techniques=e.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(t))}ensureResources(e){return 2}}var He=r(65786);class Le extends Be{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,ae.Gz)(this._texture),this._textureNormal=(0,ae.Gz)(this._textureNormal),this._textureEmissive=(0,ae.Gz)(this._textureEmissive),this._textureOcclusion=(0,ae.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,ae.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new Ue(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,ae.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,P.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,ae.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class ze extends He.Y{constructor(e=null){super(),this.textureEmissive=e}}class Ue extends ze{constructor(e,t,r,i,n,o,s){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=s}}var Ge=r(19245);class je{constructor(e,t){this.id=(0,k.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,Ge.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,Ge.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,Ne._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value}}He.Y;class Ve{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const ke=(0,m.vt)();function We(e,t,r,i,n,o){if(!e.visible)return;const s=(0,d.jb)(nt,i,r),{tolerance:a}=t,l=new Ve(a,!1,t.options.normalRequired);if(e.boundingInfo)(0,G.vA)(0===e.type),Ze(e.boundingInfo,r,s,a,n,l,o);else{const t=e.positionAttribute,i=e.primitivePositionIndices;!function(e,t,r,i,n,o,s,a,l,c){const u=t,h=ot,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),g=m>=p?m>=f?0:2:p>=f?1:2,v=g,_=u[v]<0?2:1,x=(g+_)%3,b=(g+(3-_))%3,w=u[x]/u[v],y=u[b]/u[v],T=1/u[v],M=Ye,S=Xe,C=Ke,{normalRequired:E}=l;for(let t=r;t<i;++t){const r=3*t,i=s*n[r];(0,d.hZ)(h[0],o[i+0],o[i+1],o[i+2]);const l=s*n[r+1];(0,d.hZ)(h[1],o[l+0],o[l+1],o[l+2]);const u=s*n[r+2];(0,d.hZ)(h[2],o[u+0],o[u+1],o[u+2]),a&&((0,d.C)(h[0],a.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.C)(h[1],a.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.C)(h[2],a.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.jb)(M,h[0],e),(0,d.jb)(S,h[1],e),(0,d.jb)(C,h[2],e);const m=M[x]-w*M[v],p=M[b]-y*M[v],f=S[x]-w*S[v],g=S[b]-y*S[v],_=C[x]-w*C[v],A=C[b]-y*C[v],R=_*g-A*f,I=m*A-p*_,O=f*p-g*m;if((R<0||I<0||O<0)&&(R>0||I>0||O>0))continue;const F=R+I+O;if(0===F)continue;const P=R*(T*M[v])+I*(T*S[v])+O*(T*C[v]);if(P*Math.sign(F)<0)continue;const D=P/F;D>=0&&c(D,E?Qe(h):null,t)}}(r,s,0,i.length/3,i,t.data,t.stride,n,l,o)}}const $e=(0,h.vt)();function Ze(e,t,r,i,n,o,s){if(null==e)return;const a=function(e,t){return(0,d.hZ)(t,1/e[0],1/e[1],1/e[2])}(r,$e);if((0,m.Ne)(ke,e.bbMin),(0,m.vI)(ke,e.bbMax),null!=n&&n.applyToAabb(ke),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let s=Math.min(n,o),a=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(a=Math.min(a,Math.max(l,c)),a<0)return!1;if(s=Math.max(s,Math.min(l,c)),s>a)return!1;const u=(e[2]-i-t[2])*r[2],d=(e[5]+i-t[2])*r[2];return a=Math.min(a,Math.max(u,d)),!(a<0)&&(s=Math.max(s,Math.min(u,d)),!(s>a)&&s<1/0)}(e,t,r,i)}(ke,t,a,i)){const{primitiveIndices:a,position:l}=e,c=a?a.length:l.indices.length/3;if(c>rt){const a=e.getChildren();if(void 0!==a){for(const e of a)Ze(e,t,r,i,n,o,s);return}}!function(e,t,r,i,n,o,s,a,l,c,u){const d=e[0],h=e[1],m=e[2],p=t[0],f=t[1],g=t[2],{normalRequired:v}=c;for(let e=0;e<i;++e){const t=a[e],r=3*t,i=s*n[r];let c=o[i],_=o[i+1],x=o[i+2];const b=s*n[r+1];let w=o[b],y=o[b+1],T=o[b+2];const M=s*n[r+2];let S=o[M],C=o[M+1],E=o[M+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[w,y,T]=l.applyToVertex(w,y,T,e),[S,C,E]=l.applyToVertex(S,C,E,e));const A=w-c,R=y-_,I=T-x,O=S-c,F=C-_,P=E-x,D=f*P-F*g,N=g*O-P*p,B=p*F-O*f,H=A*D+R*N+I*B;if(Math.abs(H)<=it)continue;const L=d-c,z=h-_,U=m-x,G=L*D+z*N+U*B;if(H>0){if(G<0||G>H)continue}else if(G>0||G<H)continue;const j=z*I-R*U,V=U*A-I*L,k=L*R-A*z,W=p*j+f*V+g*k;if(H>0){if(W<0||G+W>H)continue}else if(W>0||G+W<H)continue;const $=(O*j+F*V+P*k)/H;$>=0&&u($,v?Je(A,R,I,O,F,P,qe):null,t)}}(t,r,0,c,l.indices,l.data,l.stride,a,n,o,s)}}const qe=(0,h.vt)();const Ye=(0,h.vt)(),Xe=(0,h.vt)(),Ke=(0,h.vt)();function Je(e,t,r,i,n,o,s){return(0,d.hZ)(et,e,t,r),(0,d.hZ)(tt,i,n,o),(0,d.$A)(s,et,tt),(0,d.S8)(s,s),s}function Qe(e){return(0,d.jb)(et,e[1],e[0]),(0,d.jb)(tt,e[2],e[0]),(0,d.$A)(qe,et,tt),(0,d.S8)(qe,qe),qe}const et=(0,h.vt)(),tt=(0,h.vt)(),rt=1e3,it=1e-7,nt=(0,h.vt)(),ot=[(0,h.vt)(),(0,h.vt)(),(0,h.vt)()];var st=r(16396);function at(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length;r*=s;for(let e=0;e<a;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=s}}function lt(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,l=o.length;if(r*=a,1===i)for(let e=0;e<l;++e){const t=3*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}}function ct(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,l=o.length;if(r*=a,1===i)for(let e=0;e<l;++e){const t=4*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}}function ut(e,t,r,i,n=1){const o=t.typedBuffer,s=t.typedBufferStride;if(i*=s,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=s;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=s}function dt(e,t,r,i,n,o){switch(e){case"position":{(0,G.vA)(3===t.size);const i=n.getField(e,g.xs);(0,G.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void lt(e,r,i,n);const{data:o,indices:s}=e,a=r.typedBuffer,c=r.typedBufferStride,u=s.length,d=t[0],h=t[1],m=t[2],p=t[4],f=t[5],g=t[6],v=t[8],_=t[9],x=t[10],b=t[12],w=t[13],y=t[14];i*=c;let T=0,M=0,S=0;const C=(0,l.tZ)(t)?e=>{T=o[e]+b,M=o[e+1]+w,S=o[e+2]+y}:e=>{const t=o[e],r=o[e+1],i=o[e+2];T=d*t+p*r+v*i+b,M=h*t+f*r+_*i+w,S=m*t+g*r+x*i+y};if(1===n)for(let e=0;e<u;++e)C(3*s[e]),a[i]=T,a[i+1]=M,a[i+2]=S,i+=c;else for(let e=0;e<u;++e){C(3*s[e]);for(let e=0;e<n;++e)a[i]=T,a[i+1]=M,a[i+2]=S,i+=c}}(t,r,i,o);break}case"normal":{(0,G.vA)(3===t.size);const r=n.getField(e,g.xs);(0,G.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void lt(e,r,i,n);const{data:o,indices:s}=e,a=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=a[0],m=a[1],p=a[2],f=a[4],g=a[5],v=a[6],_=a[8],x=a[9],b=a[10],w=!(0,l.ut)(a),y=1e-6,T=1-y;i*=u;let M=0,S=0,C=0;const E=(0,l.tZ)(a)?e=>{M=o[e],S=o[e+1],C=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];M=h*t+f*r+_*i,S=m*t+g*r+x*i,C=p*t+v*r+b*i};if(1===n)if(w)for(let e=0;e<d;++e){E(3*s[e]);const t=M*M+S*S+C*C;if(t<T&&t>y){const e=1/Math.sqrt(t);c[i]=M*e,c[i+1]=S*e,c[i+2]=C*e}else c[i]=M,c[i+1]=S,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)E(3*s[e]),c[i]=M,c[i+1]=S,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(E(3*s[e]),w){const e=M*M+S*S+C*C;if(e<T&&e>y){const t=1/Math.sqrt(e);M*=t,S*=t,C*=t}}for(let e=0;e<n;++e)c[i]=M,c[i+1]=S,c[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,G.vA)(2===t.size);const r=n.getField(e,g.mJ);(0,G.vA)(!!r,`No buffer view for ${e}`),at(t,r,o);break}case"uv0":{(0,G.vA)(2===t.size);const r=n.getField(e,g.ZD)??n.getField(e,g.gH);(0,G.vA)(!!r,`No buffer view for ${e}`),at(t,r,o);break}case"uvi":{(0,G.vA)(2===t.size);const r=n.getField(e,g.mJ);(0,G.vA)(!!r,`No buffer view for ${e}`),at(t,r,o);break}case"color":case"symbolColor":{const r=n.getField(e,g.XP);(0,G.vA)(!!r,`No buffer view for ${e}`),(0,G.vA)(3===t.size||4===t.size),function(e,t,r,i,n=1){const{data:o,indices:s}=e,a=r.typedBuffer,l=r.typedBufferStride,c=s.length;if(i*=l,t===o.length&&4===t){a[i]=o[0],a[i+1]=o[1],a[i+2]=o[2],a[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,s=e[i/=4];i+=t;const u=c*n;for(let r=1;r<u;++r)e[i]=s,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=l}}}(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=n.getField(e,g.Y$)??n.getField(e,g.Y$);(0,G.vA)(!!r,`No buffer view for ${e}`),(0,G.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length,l=i[0];r*=s;for(let e=0;e<a;++e)o[r]=l,r+=s}(t,r,o);break}case"tangent":{(0,G.vA)(4===t.size);const i=n.getField(e,g.Eq);(0,G.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void ct(e,r,i,n);const{data:o,indices:s}=e,a=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=a[0],m=a[1],p=a[2],f=a[4],g=a[5],v=a[6],_=a[8],x=a[9],b=a[10],w=!(0,l.ut)(a),y=1e-6,T=1-y;if(i*=u,1===n)for(let e=0;e<d;++e){const t=4*s[e],r=o[t],n=o[t+1],a=o[t+2],l=o[t+3];let d=h*r+f*n+_*a,M=m*r+g*n+x*a,S=p*r+v*n+b*a;if(w){const e=d*d+M*M+S*S;if(e<T&&e>y){const t=1/Math.sqrt(e);d*=t,M*=t,S*=t}}c[i]=d,c[i+1]=M,c[i+2]=S,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*s[e],r=o[t],a=o[t+1],l=o[t+2],d=o[t+3];let M=h*r+f*a+_*l,S=m*r+g*a+x*l,C=p*r+v*a+b*l;if(w){const e=M*M+S*S+C*C;if(e<T&&e>y){const t=1/Math.sqrt(e);M*=t,S*=t,C*=t}}for(let e=0;e<n;++e)c[i]=M,c[i+1]=S,c[i+2]=C,c[i+3]=d,i+=u}}(t,r,i,o);break}case"profileVertexAndNormal":{(0,G.vA)(4===t.size);const r=n.getField(e,g.jz)??n.getField(e,g.Eq);(0,G.vA)(!!r,`No buffer view for ${e}`),ct(t,r,o);break}case"profileAuxData":{(0,G.vA)(3===t.size);const r=n.getField(e,g.EC)??n.getField(e,g.xs);(0,G.vA)(!!r,`No buffer view for ${e}`),lt(t,r,o);break}}}(0,h.vt)();class ht{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return function(e,t,r,i,n,o,s){let a={numItems:0,numVerticesPerItem:0};for(const l of r.fields.keys()){const r=e.get(l),c=r?.indices;if(r&&c)"position"===l&&(a={numItems:1,numVerticesPerItem:c.length}),dt(l,r,i,n,o,s);else if("olidColor"===l&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;ut(t,o.getField(l,g.XP),e,s)}}}return a}(r,i,this.layout,e,t,n,o)}}const mt=xt(-1),pt=xt(1),ft=mt,gt=new Array;gt[0]=null,gt[1]=pt,gt[2]=mt,gt[3]={factor:0,units:-4},gt[4]=xt(-3);const vt=gt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(ft,e));function _t({output:e,enableOITOffset:t,polygonOffset:r}){return(0,Ne.Sp)(e)&&t?vt[r]:gt[r]}function xt(e){return{factor:1*e,units:2*e}}gt[1]=pt;const bt=(0,h.vt)();var wt=r(5482),yt=r(91429),Tt=r(91829),Mt=r(4431),St=r(1843),Ct=r(72824),Et=r(13840),At=r(42958),Rt=r(16943),It=r(90644);const Ot=(0,It.p3)(1,0,1,771);function Ft(e,t=!1){switch(e){case 0:return t?It.RC:It.T8;case 1:return Ot;default:return null}}function Pt(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?It.Uy:null;case 1:return null}}function Dt(e,t=513){return{func:(0,Ne.Sp)(e)?515:t}}const Nt={mask:255},Bt={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},Ht={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var Lt=r(4576);r(66289);var zt=r(69622),Ut=r(32728);class Gt{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",g.Eq),this.color=e.getField("instanceColor",g.XP),this.olidColor=e.getField("instanceOlidColor",g.XP),this.state=e.getField("state",g.SL),this.lodLevel=e.getField("lodLevel",g.SL)}}let jt=class extends zt.A{constructor(e,t){super(e),this.events=new se.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return kt(Vt.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Yt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Gt(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,G.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,G.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=Wt,i=$t;t.localTransform.getMat(e,Zt),t.globalTransform.getMat(e,qt);const n=(0,l.lw)(qt,qt,Zt);(0,d.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,s.z0)(i,n),t.model.setMat(e,i);const o=(0,Ut.wp)(Wt,n);o.sort(),t.modelScaleFactors.set(e,0,o[1]),t.modelScaleFactors.set(e,1,o[2]),(0,s.B8)(i,i),(0,s.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,$t),r.modelOrigin.getVec(e,Wt),t[0]=$t[0],t[1]=$t[1],t[2]=$t[2],t[3]=0,t[4]=$t[3],t[5]=$t[4],t[6]=$t[5],t[7]=0,t[8]=$t[6],t[9]=$t[7],t[10]=$t[8],t[11]=0,t[12]=Wt[0],t[13]=Wt[1],t[14]=Wt[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Wt,this,e),t*=Math.max(Wt[0],Wt[1],Wt[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Wt,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Wt[0],Wt[1],Wt[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(Yt,Math.floor(this._capacity*Lt.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new Gt(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,wt.Cg)([(0,yt.MZ)({constructOnly:!0})],jt.prototype,"shaderTransformation",void 0),(0,wt.Cg)([(0,yt.MZ)()],jt.prototype,"_size",void 0),(0,wt.Cg)([(0,yt.MZ)({readOnly:!0})],jt.prototype,"size",null),jt=(0,wt.Cg)([(0,yt.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],jt);const Vt=(0,St.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function kt(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Rt.E)()&&e.vec4u8("instanceOlidColor"),e}const Wt=(0,h.vt)(),$t=(0,a.vt)(),Zt=(0,c.vt)(),qt=(0,c.vt)(),Yt=64,Xt=(0,St.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var Kt=r(74810),Jt=r(28491),Qt=r(49788);class er extends Ct.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Kt.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=h.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,h.CN)(.2,.2,.2),this.diffuse=(0,h.CN)(.8,.8,.8),this.externalColor=(0,Tt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,h.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Qt.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}Ct.gy;let tr=class extends At.w{constructor(e,t){let i=(0,Mt.U)(nr(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,Mt.U)(function(e){return kt(Xt.clone(),e)}(t)))),super(e,t,i),this.shader=new Et.r(Jt.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:i,cullFace:n,customDepthTest:o,hasOccludees:s}=e;return(0,It.Ey)({blending:i?Ft(r):null,culling:ir(e)?(0,It.Xt)(n):null,depthTest:Dt(r,rr(o)),depthWrite:Pt(e),colorWrite:It.kn,stencilWrite:s?Nt:null,stencilTest:s?t?Ht:Bt:null,polygonOffset:_t(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function rr(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function ir(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function nr(e){const t=(0,St.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Rt.E)()&&t.vec4u8("olidColor"),t}tr=(0,wt.Cg)([(0,yt.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],tr);var or=r(51976),sr=r(68317);class ar extends sr.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,wt.Cg)([(0,or.W)()],ar.prototype,"hasHighlightMixTexture",void 0);class lr extends ar{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,wt.Cg)([(0,or.W)({count:5})],lr.prototype,"polygonOffset",void 0),(0,wt.Cg)([(0,or.W)()],lr.prototype,"transparent",void 0),(0,wt.Cg)([(0,or.W)()],lr.prototype,"enableOITOffset",void 0);class cr extends lr{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,wt.Cg)([(0,or.W)({count:4})],cr.prototype,"alphaDiscardMode",void 0),(0,wt.Cg)([(0,or.W)({count:3})],cr.prototype,"doubleSidedMode",void 0),(0,wt.Cg)([(0,or.W)({count:7})],cr.prototype,"pbrMode",void 0),(0,wt.Cg)([(0,or.W)({count:3})],cr.prototype,"cullFace",void 0),(0,wt.Cg)([(0,or.W)({count:3})],cr.prototype,"normalType",void 0),(0,wt.Cg)([(0,or.W)({count:3})],cr.prototype,"customDepthTest",void 0),(0,wt.Cg)([(0,or.W)({count:8})],cr.prototype,"emissionSource",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasVertexColors",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasSymbolColors",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasVerticalOffset",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasColorTexture",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasMetallicRoughnessTexture",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasOcclusionTexture",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasNormalTexture",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasScreenSizePerspective",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasVertexTangents",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasOccludees",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"instanced",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"instancedDoublePrecision",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasModelTransformation",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"offsetBackfaces",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasVVSize",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasVVColor",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"receiveShadows",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasShadowHighlights",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"receiveAmbientOcclusion",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"receiveGlobalIllumination",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"textureAlphaPremultiplied",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"instancedFeatureAttribute",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"instancedColor",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"writeDepth",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"terrainDepthTest",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"cullAboveTerrain",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"snowCover",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasColorTextureTransform",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasEmissionTextureTransform",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasNormalTextureTransform",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasOcclusionTextureTransform",void 0),(0,wt.Cg)([(0,or.W)()],cr.prototype,"hasMetallicRoughnessTextureTransform",void 0);var ur=r(57323);let dr=class extends tr{constructor(){super(...arguments),this.shader=new Et.r(ur.R,()=>r.e(2314).then(r.bind(r,39933)))}};dr=(0,wt.Cg)([(0,yt.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],dr);class hr extends or.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,wt.Cg)([(0,or.W)()],hr.prototype,"receiveShadows",void 0);class mr extends je{constructor(e,t){super(e,fr),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(0,Ne.uw)(e)&&!this.transparent],[4,e=>(0,Ne.uw)(e)&&this.transparent&&this.parameters.writeDepth],[9,e=>(0,Ne.uw)(e)&&this.transparent&&!this.parameters.writeDepth]]),this._layout=nr(this.parameters),this._configuration=new cr(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=Qt.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,h.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:i,doubleSided:n,doubleSidedType:o}=t;r.hasVertexTangents=!i&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.writeDepth=t.writeDepth,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.cullAboveTerrain=e.cullAboveTerrain,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:n&&"normal"===o?1:n&&"winding-order"===o?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,Ne._o)(e.output)?(r.terrainDepthTest=e.terrainDepthTest,r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&null!=e.globalIllumination):(r.terrainDepthTest=!1,r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1),r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersect(e,t,r,i,n,o){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.hZ)(wr,t[12],t[13],t[14]);let o=null;switch(r.viewingMode){case 1:o=(0,d.S8)(xr,wr);break;case 2:o=(0,d.C)(xr,_r)}const s=(0,d.Re)(yr,wr,e.eye),a=(0,d.Bw)(s),l=(0,d.hs)(s,s,1/a);let c=null;this.parameters.screenSizePerspective&&(c=(0,d.Om)(o,l));const u=(0,Ge.kE)(e,a,this.parameters.verticalOffset,c??0,this.parameters.screenSizePerspective,null);(0,d.hs)(o,o,u),(0,d.ei)(br,o,r.transform.inverseRotation),i=(0,d.Re)(gr,i,br),n=(0,d.Re)(vr,n,br)}o=function(e,t,r,i){const n=_t(t);if(!n)return e;const o=5e-6*n.units,s=(0,d.S8)(bt,(0,d.jb)(bt,i,r));return(t,r,i)=>{const a=(r?1-Math.abs((0,d.Om)(s,r)):0)*n.factor*5e-5+o;return e(t+a,r,i)}}(o,this._configuration,i,n),We(e,r,i,n,(0,st.ou)(r.verticalOffset),o)}createGLMaterial(e){return new pr(e)}createBufferWriter(){return new ht(this._layout)}get transparent(){return function(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:s,textureAlphaMode:a,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=s)&&1!==a&&2!==a&&"replace"!==l}(this.parameters)}}class pr extends Le{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?dr:tr,e)}}class fr extends er{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const gr=(0,h.vt)(),vr=(0,h.vt)(),_r=(0,h.fA)(0,0,1),xr=(0,h.vt)(),br=(0,h.vt)(),wr=(0,h.vt)(),yr=(0,h.vt)(),Tr=()=>I.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class Mr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function Sr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Tr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Tr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Tr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Tr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Tr().warn("Indexed geometries must specify faces"),i=!1;break}default:Tr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Tr().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(Tr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Cr(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&((0,m.iT)(t,r.bbMin),(0,m.iT)(t,r.bbMax))}),t}function Er(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function Ar(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Rr=new D.A(1,2,"wosr");async function Ir(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,A.Ke)((0,E.A)(e,t));if(r.ok)return r.value.data;(0,P.QP)(r.error),function(e){throw new R.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){Tr().warn("Externally referenced texture data is not yet supported");continue}const s=n.encoding+";base64,"+o,a="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==Er(l)},u=t?.disableTextures?Promise.resolve(null):(0,B.D)(s,t);r.push(u.then(e=>({refId:a,image:e,parameters:c,alphaChannelUsage:l})))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new Mr(r,i,n+(0,O.Qh)(r))}(a.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new F,s=e.resource,a=D.A.parse(s.version||"1.0","wosr");Rr.validate(a);const l=s.model.name,c=s.model.geometries,u=s.materialDefinitions??{},d=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const s=c[e];if(!Sr(s))continue;const a=Ar(s),l=s.params.vertexAttributes,f=[],g=e=>{if("PerAttributeArray"===s.params.topology)return null;const t=s.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=l.position,_=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,N.tM)(_);f.push([e,new H.n(r,i,t.valuesPerElement,!0)])}const x=a.texture,b=d&&d[x];if(b&&!p.has(x)){const{image:e,parameters:t}=b,r=new Fe(e,t);i.push(r),p.set(x,r)}const w=p.get(x),y=w?w.id:void 0,T=a.material;let M=o.get(T,x);if(null==M){const e=u[T.slice(T.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=b?Er(b.alphaChannelUsage):void 0,i={ambient:(0,h.ci)(e.diffuse),diffuse:(0,h.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:y,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),M=new mr(i,t),o.set(T,x,M)}n.push(M);const S=new ne(M,f);m+=f.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(S)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:s.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Cr(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let p;if(t.cache)p=await t.cache.loadGLTF(a.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));p=await e(new b.R,a.url,t,t.usePBR,t.useEmissive)}const{engineResources:T,referenceBoundingBox:S}=function(e,t,r){const n=e.model,a=e.meta,p=n.meta?.ESRI_proxyEllipsoid,b=a.isEsriSymbolResource&&null!=p&&"EsriRealisticTreesStyle"===a.ESRI_webstyle;b&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const n=e.model.lods[r];for(const o of n.parts){const n=o.attributes.normal;if(null==n)return;const s=o.attributes.position,a=s.count,u=(0,h.vt)(),m=(0,h.vt)(),p=(0,h.vt)(),f=new Float32Array(4*a),v=new Float32Array(3*a),_=(0,l.B8)((0,c.vt)(),o.transform);let x=0,b=0;for(let l=0;l<a;l++){s.getVec(l,m),n.getVec(l,u),(0,d.Z0)(m,m,o.transform),(0,d.Re)(p,m,t.center),(0,d.Qr)(p,p,t.radius);const a=p[2],c=(0,d.Bw)(p),h=Math.min(.45+.55*c*c,1)**i.Tf;(0,d.Qr)(p,p,t.radius),null!==_&&(0,d.Z0)(p,p,_),(0,d.S8)(p,p),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.Cc)(p,p,u,a>-1?.2:Math.min(-4*a-3.8,1)),v[x]=p[0],v[x+1]=p[1],v[x+2]=p[2],x+=3,f[b]=h,f[b+1]=h,f[b+2]=h,f[b+3]=1,b+=4}o.attributes.normal=new g.xs(v.buffer),o.attributes.color=new g.Eq(f.buffer)}}}(e,p));const T=!!t.usePBR,S=a.isEsriSymbolResource?{usePBR:T,isSchematic:!1,treeRendering:b,mrrFactors:Kt.SY}:{usePBR:T,isSchematic:!1,treeRendering:!1,mrrFactors:Kt.mb},E={...t.materialParameters,treeRendering:b},A=new Array,R=new Map,I=new Map,O=n.lods.length,F=(0,m.Ie)();return n.lods.forEach((e,a)=>{const l=!0===t.skipHighLods&&(O>1&&0===a||O>3&&1===a)||!1===t.skipHighLods&&null!=r&&a!==r;if(l&&0!==a)return;const c=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new mr({},t):function(e,t,r,n,o,s,a,l,c){const d=e.materials.get(t.material);if(null==d)return null;const{normal:h,color:m,texCoord0:p,tangent:f}=t.attributes,g=t.material+(h?"_normal":"")+(m?"_color":"")+(p?"_texCoord0":"")+(f?"_tangent":""),v=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,x=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!s.has(g)){if(v){const t=(t,r=!1,i=!1)=>{if(null!=t&&!a.has(t)){const n=e.textures.get(t);if(n){const e=n.data,o=r&&!(0,y.x3)(e)?l.compressionOptions:void 0;a.set(t,new Fe((0,y.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&i,encoding:(0,y.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==x&&!c;t(d.colorTexture,r,1!==x),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}const r=(0,i.xV)(d.color[0]),h=(0,i.xV)(d.color[1]),m=(0,i.xV)(d.color[2]),p=null!=d.colorTexture&&v?a.get(d.colorTexture):null,f=(0,Kt.Jr)(d),b=null!=d.normalTextureTransform?.scale?d.normalTextureTransform?.scale:u.Un;s.set(g,new mr({...n,customDepthTest:1,textureAlphaMode:x,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,h,m],ambient:[r,h,m],opacity:"OPAQUE"===d.alphaMode?1:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,textureId:null!=p?p.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&v?a.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&v?a.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&v?a.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&v?a.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null!=d.emissiveStrengthKHR?d.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=o.emissiveStrengthFromSymbol?o.emissiveStrengthFromSymbol:void 0,mrrFactors:f?Kt.Bt:[d.metallicFactor,d.roughnessFactor,n.mrrFactors[2]],isSchematic:f,colorTextureTransformMatrix:M(d.colorTextureTransform),normalTextureTransformMatrix:M(d.normalTextureTransform),scale:[b[0],b[1]],occlusionTextureTransformMatrix:M(d.occlusionTextureTransform),emissiveTextureTransformMatrix:M(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(d.metallicRoughnessTextureTransform),...o},l))}const b=s.get(g);if(r.stageResources.materials.push(b),v){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return b}(n,e,c,S,E,R,I,t,b),{geometry:d,vertexCount:h}=function(e,t){const r=e.attributes.position.count,i=(0,w.x)(e.indices||r,e.primitiveType),n=f(3*r),{typedBuffer:a,typedBufferStride:l}=e.attributes.position;(0,v.t)(n,a,e.transform,3,l);const c=[["position",new H.n(n,i,3,!0)]];if(null!=e.attributes.normal){const t=f(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,s.Ge)(Or,e.transform),(0,v.b)(t,n,Or,3,a),(0,o.or)(Or)&&(0,v.n)(t,t),c.push(["normal",new H.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=f(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,s.z0)(Or,e.transform),(0,_.t)(t,n,Or,4,a),(0,o.or)(Or)&&(0,v.n)(t,t,4),c.push(["tangent",new H.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=f(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,x.a)(t,n,2,o),c.push(["uv0",new H.n(t,i,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof g.Eq?(0,_.b)(t,u,1,255):(u instanceof g.XP||u instanceof g.Uz)&&(0,_.b)(t,u,1/255,255):(t.fill(255),u instanceof g.xs?(0,v.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof g.eI||e.attributes.color instanceof g.nS)&&(0,v.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new H.n(t,i,4,!0)])}return{geometry:new ne(t,c),vertexCount:r}}(e,r??new mr({},t)),p=d.boundingInfo;null!=p&&0===a&&((0,m.iT)(F,p.bbMin),(0,m.iT)(F,p.bbMax)),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=h)}),l||A.push(c)}),{engineResources:A,referenceBoundingBox:F}}(p,t,a.specifiedLodIndex);return{lods:T,referenceBoundingBox:S,isEsriSymbolResource:p.meta.isEsriSymbolResource,isWosr:!1}}const Or=(0,a.vt)()},1843(e,t,r){r.d(t,{BP:()=>d,l5:()=>h});var i=r(20498),n=r(13030),o=r(90239),s=r(4431),a=r(620),l=r(85079);class c{constructor(e,t,r=0){this.layout=e,this.byteOffset=r,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const i=e.fields.get(t);this[t]=new i.constructor(this.buffer,r+i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new c(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:f(e[1].constructor)})))}freeze(){return this}get locations(){return(0,l.Xk)((0,s.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}vec4i16(e,t){return this._appendField(e,n.E7,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new c(this,e)}createView(e,t){return new c(this,e,t)}clone(){const e=new u;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function d(){return new u}class h{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:p(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const m=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function p(e){return`${e.ElementType}_${e.ElementCount}`}function f(e){return g.get(e)}const g=new Map;m.forEach(e=>g.set(p(e),e))},4431(e,t,r){r.d(t,{U:()=>o});var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map(o=>{const s=e.fields.get(o),a=s.constructor.ElementCount,l=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(s.constructor.ElementType),c=s.offset,u=s.optional?.glNormalized??!1,d=s.optional?.integer??!1;return new n._(o,a,l,c,r,u,t,d)})}},26857(e,t,r){r.d(t,{b:()=>a});var i=r(5482),n=r(69622),o=r(91429);let s=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],s.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),s=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],s);const a=new s},46686(e,t,r){r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
|
|
415
415
|
void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
|
|
416
416
|
`)}},33120(e,t,r){r.d(t,{i$:()=>s,xJ:()=>o}),r(46686),r(62308);var i=r(77108),n=r(31821);function o(e){e.vertex.uniforms.add(new i.E("nearFar",e=>e.camera.nearFar))}function s(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
417
417
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
@@ -461,7 +461,7 @@ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
|
|
|
461
461
|
}
|
|
462
462
|
bool rejectBySlice(vec3 pos) {
|
|
463
463
|
return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
|
|
464
|
-
}`;function v(e,t,r){return e.instancedDoublePrecision?(0,s.hZ)(w,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function _(e,t){return null!=e?(0,s.Re)(y,t.origin,e):t.origin}function x(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,n.Tl)(
|
|
464
|
+
}`;function v(e,t,r){return e.instancedDoublePrecision?(0,s.hZ)(w,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function _(e,t){return null!=e?(0,s.Re)(y,t.origin,e):t.origin}function x(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,n.Tl)(M,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function b(e,t,r,i){if(null==i||null==r.slicePlane)return a.uY;const n=v(e,t,r),o=_(n,r.slicePlane),l=x(e,n,r);return null!=l?((0,s.WQ)(T,i,o),(0,s.Z0)(y,o,l),(0,s.Z0)(T,T,l),(0,s.Re)(T,T,y)):i}const w=(0,a.vt)(),y=(0,a.vt)(),T=(0,a.vt)(),M=(0,o.vt)()},76597(e,t,r){r.d(t,{d:()=>o});var i=r(33120),n=r(31821);function o(e){(0,i.i$)(e),e.vertex.code.add(n.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
|
|
465
465
|
vec4 eye = view * vec4(pos, 1.0);
|
|
466
466
|
depth = calculateLinearDepth(nearFar,eye.z);
|
|
467
467
|
return proj * eye;
|
|
@@ -613,13 +613,13 @@ float fragDepth = _calculateFragDepth(_linearDepth);
|
|
|
613
613
|
gl_FragDepth = fragDepth;
|
|
614
614
|
}`);break;case 9:e.fragment.code.add(a.H`void outputDepth(float _linearDepth){
|
|
615
615
|
gl_FragDepth = _linearDepth;
|
|
616
|
-
}`)}}var h=r(42593),m=r(91899),p=r(58614),f=r(20693),g=r(63761);function v(e,t){const{vertex:r,fragment:v,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:b}=t,w=x&&1!==b,{output:y,normalType:T,hasColorTextureTransform:
|
|
616
|
+
}`)}}var h=r(42593),m=r(91899),p=r(58614),f=r(20693),g=r(63761);function v(e,t){const{vertex:r,fragment:v,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:b}=t,w=x&&1!==b,{output:y,normalType:T,hasColorTextureTransform:M}=t;switch(y){case 3:(0,f.NB)(r,t),e.include(o.d),v.include(n.HQ,t),e.include(c.U,t),w&&v.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(a.H`vpos = getVertexInLocalOriginSpace();
|
|
617
617
|
vpos = subtractOrigin(vpos);
|
|
618
618
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
619
619
|
gl_Position = transformPosition(proj, view, vpos);
|
|
620
620
|
forwardTextureCoordinates();`),e.include(p.S,t),v.main.add(a.H`
|
|
621
621
|
discardBySlice(vpos);
|
|
622
|
-
${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${
|
|
622
|
+
${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${M?"colorUV":"vuv0"});
|
|
623
623
|
discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:(0,f.NB)(r,t),e.include(o.d),e.include(c.U,t),e.include(m.A,t),e.include(d,t),v.include(n.HQ,t),e.include(l,t),(0,i.xJ)(e),_.add("depth","float",{invariant:!0}),w&&v.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(a.H`vpos = getVertexInLocalOriginSpace();
|
|
624
624
|
vpos = subtractOrigin(vpos);
|
|
625
625
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
@@ -627,7 +627,7 @@ gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
|
627
627
|
forwardTextureCoordinates();
|
|
628
628
|
forwardObjectAndLayerIdColor();`),e.include(p.S,t),v.main.add(a.H`
|
|
629
629
|
discardBySlice(vpos);
|
|
630
|
-
${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${
|
|
630
|
+
${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${M?"colorUV":"vuv0"});
|
|
631
631
|
discardOrAdjustAlpha(texColor);`)}
|
|
632
632
|
${11===y?a.H`outputObjectAndLayerIdColor();`:a.H`outputDepth(depth);`}`);break;case 4:{(0,f.NB)(r,t),e.include(o.d),e.include(s.Y,t),e.include(u.Mh,t),e.include(c.U,t),e.include(m.A,t),w&&v.uniforms.add(new g.N("tex",e=>e.texture)),2===T&&_.add("vPositionView","vec3",{invariant:!0});const i=0===T||1===T;r.main.add(a.H`
|
|
633
633
|
vpos = getVertexInLocalOriginSpace();
|
|
@@ -637,7 +637,7 @@ forwardObjectAndLayerIdColor();`),e.include(p.S,t),v.main.add(a.H`
|
|
|
637
637
|
gl_Position = transformPosition(proj, view, vpos);
|
|
638
638
|
forwardTextureCoordinates();`),v.include(n.HQ,t),e.include(p.S,t),v.main.add(a.H`
|
|
639
639
|
discardBySlice(vpos);
|
|
640
|
-
${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${
|
|
640
|
+
${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${M?"colorUV":"vuv0"});
|
|
641
641
|
discardOrAdjustAlpha(texColor);`)}
|
|
642
642
|
|
|
643
643
|
${2===T?a.H`vec3 normal = screenDerivativeNormal(vPositionView);`:a.H`vec3 normal = normalize(vNormalWorld);
|
|
@@ -650,7 +650,7 @@ vpos = addVerticalOffset(vpos, localOrigin);
|
|
|
650
650
|
gl_Position = transformPosition(proj, view, vpos);
|
|
651
651
|
forwardTextureCoordinates();`),v.include(n.HQ,t),e.include(p.S,t),e.include(h.Q,t),v.main.add(a.H`
|
|
652
652
|
discardBySlice(vpos);
|
|
653
|
-
${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${
|
|
653
|
+
${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${M?"colorUV":"vuv0"});
|
|
654
654
|
discardOrAdjustAlpha(texColor);`)}
|
|
655
655
|
calculateOcclusionAndOutputHighlight();`)}}},22911(e,t,r){r.d(t,{NL:()=>f});var i=r(34727),n=r(49255),o=r(99208),s=r(65261),a=r(40710),l=r(33079),c=r(28421),u=r(20304),d=r(31821),h=r(15976),m=r(63761),p=r(66211);function f(e,t){if(!(0,n._o)(t.output))return;e.fragment.include(s.C);const{emissionSource:r,hasEmissiveTextureTransform:f,bindType:g,useFloatBlend:v}=t,_=3===r||4===r||5===r;_&&(e.include(o.r,t),e.fragment.uniforms.add(1===g?new m.N("texEmission",e=>e.textureEmissive):new h.o("texEmission",e=>e.textureEmissive)));const x=2===r||_;x&&e.fragment.uniforms.add(1===g?new l.t("emissiveBaseColor",e=>e.emissiveBaseColor):new a.W("emissiveBaseColor",e=>e.emissiveBaseColor));const b=0!==r;if(b&&7!==r&&6!==r&&4!==r&&5!==r){const t=e=>null!=e?v?e:(0,i.qE)(e,0,p.m):0;e.fragment.uniforms.add(1===g?new u.m("emissiveStrength",e=>t(e.emissiveStrength)):new c.J("emissiveStrength",e=>t(e.emissiveStrength)))}const w=7===r,y=5===r,T=1===r||6===r||w;e.fragment.code.add(d.H`
|
|
656
656
|
vec4 getEmissions(vec3 symbolColor) {
|
|
@@ -749,7 +749,7 @@ return vec2(color.r, color.b);
|
|
|
749
749
|
}
|
|
750
750
|
vec3 decodeVec2ToRGB(vec2 encoded) {
|
|
751
751
|
return vec3(encoded.x, (encoded.x + encoded.y)/2.0, encoded.y);
|
|
752
|
-
}`)}},71651(e,t,r){r.d(t,{n:()=>F});var i=r(31821),n=r(12791),o=r(5482),s=r(34727),a=r(97768),l=r(36708),c=r(78659),u=r(91429),d=r(37585),h=r(14239),m=r(94401);var p=r(15581),f=r(13840),g=r(42958),v=r(95774),_=r(90644);let x=class extends g.w{constructor(){super(...arguments),this.shader=new f.r(v.S,()=>r.e(1285).then(r.bind(r,91285)))}initializePipeline(){return(0,_.Ey)({colorWrite:_.kn})}};x=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],x);var b=r(48163),w=r(65786);class y extends w.Y{constructor(){super(...arguments),this.projScale=1}}class T extends y{constructor(){super(...arguments),this.intensity=1}}class
|
|
752
|
+
}`)}},71651(e,t,r){r.d(t,{n:()=>F});var i=r(31821),n=r(12791),o=r(5482),s=r(34727),a=r(97768),l=r(36708),c=r(78659),u=r(91429),d=r(37585),h=r(14239),m=r(94401);var p=r(15581),f=r(13840),g=r(42958),v=r(95774),_=r(90644);let x=class extends g.w{constructor(){super(...arguments),this.shader=new f.r(v.S,()=>r.e(1285).then(r.bind(r,91285)))}initializePipeline(){return(0,_.Ey)({colorWrite:_.kn})}};x=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],x);var b=r(48163),w=r(65786);class y extends w.Y{constructor(){super(...arguments),this.projScale=1}}class T extends y{constructor(){super(...arguments),this.intensity=1}}class M extends w.Y{}class S extends M{constructor(){super(...arguments),this.blurSize=(0,b.vt)()}}let C=class extends g.w{constructor(){super(...arguments),this.shader=new f.r(p.S,()=>r.e(6122).then(r.bind(r,86122)))}initializePipeline(){return(0,_.Ey)({colorWrite:_.kn})}};C=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],C);var E=r(63907),A=r(76284),R=r(67171);let I=class extends m.A{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=h.OG.AMBIENT_ILLUMINATION,this._enableTime=(0,c.l5)(0),this._passParameters=new T,this._drawParameters=new S}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new R.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new A.A(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this.view.stage.renderer.hasAmbientIllumination,()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,a.WD)(this._passParameters.noiseTexture)}precompile(){this.techniques.precompile(C),this.techniques.precompile(x)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(E.nI);if(!r||!i)return;const n=this.techniques.getCompiled(C),o=this.techniques.getCompiled(x);if(!n||!o)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const a=this.renderingContext,l=this.view.qualitySettings.fadeDuration,u=this.bindParameters,m=u.camera,f=m.relativeElevation,g=(0,s.qE)((5e5-f)/2e5,0,1),v=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,_=v*g;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/m.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*O/(0,p.g)(m)**6*_;const b=m.fullViewport[2],w=m.fullViewport[3],y=this.fboCache.acquire(b,w,"ssao input",2);a.bindFramebuffer(y.fbo),a.setViewport(0,0,b,w),a.bindTechnique(n,u,this._passParameters,this._drawParameters),a.screen.draw();const T=Math.round(b/2),M=Math.round(w/2),S=this.fboCache.acquire(T,M,"ssao blur",0);a.bindFramebuffer(S.fbo),this._drawParameters.colorTexture=y.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,0,2/w),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,T,M),a.screen.draw(),y.release();const A=this.fboCache.acquire(T,M,h.OG.AMBIENT_ILLUMINATION,0);return a.bindFramebuffer(A.fbo),a.setViewport(0,0,b,w),a.setClearColor(1,1,1,0),a.clear(16384),this._drawParameters.colorTexture=S.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,2/b,0),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,T,M),a.screen.draw(),a.setViewport4fv(m.fullViewport),S.release(),v<1&&this.requestRender(2),A}};(0,o.Cg)([(0,u.MZ)()],I.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],I.prototype,"produces",void 0),I=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],I);const O=.5;function F(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
753
753
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
754
754
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
755
755
|
}
|
|
@@ -792,7 +792,7 @@ vec3 calculateAmbientRadiance()
|
|
|
792
792
|
{
|
|
793
793
|
vec3 ambientLight = 1.2 * (0.282095 * vec3(shR[0], shG[0], shB[0])) - 0.2;
|
|
794
794
|
return ambientLight *= skyTransmittance;
|
|
795
|
-
}`)}var a=r(71651),l=r(65261),c=r(98619),u=r(22393),d=r(89786),h=r(8578),m=r(12791),p=r(5482),f=(r(44208),r(53966)),g=r(97768),v=r(17676),_=r(36708),x=r(91429),b=r(37585),w=r(31217),y=r(14239),T=r(94401),
|
|
795
|
+
}`)}var a=r(71651),l=r(65261),c=r(98619),u=r(22393),d=r(89786),h=r(8578),m=r(12791),p=r(5482),f=(r(44208),r(53966)),g=r(97768),v=r(17676),_=r(36708),x=r(91429),b=r(37585),w=r(31217),y=r(14239),T=r(94401),M=r(13840),S=r(42958),C=r(52516),E=r(90644);let A=class extends S.w{constructor(){super(...arguments),this.shader=new M.r(C.a,()=>r.e(4434).then(r.bind(r,84434)))}initializePipeline(){return(0,E.Ey)({colorWrite:E.kn})}};A=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationBlurTechnique")],A);var R=r(587);let I=class extends S.w{constructor(){super(...arguments),this.shader=new M.r(R.a,()=>r.e(8225).then(r.bind(r,18225)))}initializePipeline(){return(0,E.Ey)({colorWrite:E.kn})}};I=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationTechnique")],I);var O=r(51976);class F extends O.K{constructor(){super(...arguments),this.hasEmission=!1}}(0,p.Cg)([(0,O.W)()],F.prototype,"hasEmission",void 0);var P=r(63907),D=r(76284),N=r(67171);let B=class extends T.A{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=y.OG.AMBIENT_ILLUMINATION,this._passParameters=new R.G,this._drawParameters=new C.G,this._accumulatedFrames=0,this._maxFrames=255,this._configuration=new F,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await r.e(5354).then(r.bind(r,45354))).data;(0,v.Te)(e),await this._loadBlueNoiseTexture(t,e),(0,v.Te)(e)}catch(e){(0,v.zf)(e)||f.A.getLogger(this).errorOnce("Failed to load blue noise texture:",e)}this.addHandles((0,_.wB)(()=>this.view.stage.renderer.hasAmbientIllumination,e=>{e&&this.resetAccumulation(),this.requestRender(1)},_.pc))}precompile(){this._canRender&&(this._configuration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(I,this._configuration),this.techniques.precompile(A))}destroy(){this._abortController=(0,g.DC)(this._abortController),this._passParameters.noiseTexture=(0,g.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(P.nI);if(!r||!i)return this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const n=this.bindParameters;this._configuration.hasEmission=n.hasEmission;const o=this.techniques.getCompiled(I,this._configuration),s=this.techniques.getCompiled(A);if(!o||!s)return this.requestRender(1),this._emptyOutput;this.view.stage.renderView.updating&&this.resetAccumulation();const a=this.renderingContext,{camera:l}=n;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/l.computeScreenPixelSizeAtDist(1);const{fullWidth:c,fullHeight:u}=l,d=this.fboCache.acquire(c,u,"global illumination input");a.bindFramebuffer(d.fbo),a.setViewport(0,0,c,u),a.bindTechnique(o,n,this._passParameters,this._drawParameters),a.screen.draw();const h=Math.round(c/1),m=Math.round(u/1),p=this.fboCache.acquire(h,m,"global illumination blur");a.bindFramebuffer(p.fbo),this._drawParameters.colorTexture=d.getTexture(),(0,b.hZ)(this._drawParameters.blurSize,0,1/u),a.bindTechnique(s,n,this._passParameters,this._drawParameters),a.setViewport(0,0,h,m),a.screen.draw(),d.release();const f=this.fboCache.acquire(c,u,y.OG.AMBIENT_ILLUMINATION);return a.bindFramebuffer(f.fbo),a.setViewport(0,0,c,u),a.setClearColor(1,1,1,0),a.clear(16384),this._drawParameters.colorTexture=p.getTexture(),(0,b.hZ)(this._drawParameters.blurSize,1/c,0),a.bindTechnique(s,n,this._passParameters,this._drawParameters),a.setViewport(0,0,h,m),a.screen.draw(),a.setViewport4fv(l.fullViewport),p.release(),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._accumulatedFrames,this._accumulatedFrames<this._maxFrames&&this.requestRender(1),f}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,i=this.fboCache.acquire(t,r,y.OG.AMBIENT_ILLUMINATION);return e.bindFramebuffer(i.fbo),e.setViewport(0,0,t,r),e.setClearColor(0,0,0,1),e.clear(16384),i}async _loadBlueNoiseTexture(e,t){(0,v.Te)(t);const r=await(0,w.D)(e,{signal:t});if((0,v.Te)(t),!r)return;const i=new N.R;i.internalFormat=P.H0.RGBA8,i.wrapMode=10497,i.isImmutable=!0,this._passParameters.noiseTexture=new D.A(this.renderingContext,i,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}resetAccumulation(){this._accumulatedFrames=0}get test(){}};function H(e,t){t.receiveGlobalIllumination?(e.include(h.k),e.uniforms.add(new m.x("globalIlluminationTexture",e=>e.globalIllumination?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1),e.code.add(o.H`vec3 readGlobalIlluminationOcclusionInverse() {
|
|
796
796
|
ivec2 texel = ivec2(gl_FragCoord.xy * blurSizePixelsInverse);
|
|
797
797
|
return vec3(texelFetch(globalIlluminationTexture, texel, 0).a);
|
|
798
798
|
}
|
|
@@ -1089,28 +1089,23 @@ vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
|
|
|
1089
1089
|
return vec3(uvShadow, lvpos.z);
|
|
1090
1090
|
}`)}function g(e){e.fragment.code.add(o.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
|
|
1091
1091
|
return texture(_shadowMap, uvzShadow);
|
|
1092
|
-
}`)}h.Y;var v=r(33094),_=r(12791);class x extends c.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function b(e,t){t.receiveShadows&&e.include(m),y(e,t)}function w(e,t){t.receiveShadows&&e.include(p),y(e,t)}function y(e,t){e.fragment.uniforms.add(new v.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{hasShadowHighlights:r,receiveShadows:i,spherical:n}=t;e.include(s,t),i&&
|
|
1092
|
+
}`)}h.Y;var v=r(33094),_=r(12791);class x extends c.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function b(e,t){t.receiveShadows&&e.include(m),y(e,t)}function w(e,t){t.receiveShadows&&e.include(p),y(e,t)}function y(e,t){e.fragment.uniforms.add(new v.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{hasShadowHighlights:r,receiveShadows:i,spherical:n}=t;e.include(s,t),i&&T(e,r),e.fragment.code.add(o.H`
|
|
1093
|
+
float readShadow(float additionalAmbientScale, vec3 vpos) {
|
|
1094
|
+
return ${i?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,o.If)(n,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
1095
|
+
}
|
|
1096
|
+
`)}function T(e,t){e.include(g),function(e,t){e.include(g),e.fragment.uniforms.add(new x("shadowMap",({shadowMap:e})=>e.getOutput(5)??e.getOutput(7))),t&&e.fragment.uniforms.add(new _.x("shadowHighlight",({shadowHighlight:e})=>e?.getTexture())),e.fragment.code.add(o.H`
|
|
1093
1097
|
float readShadowMaps(const in vec3 uvzShadow) {
|
|
1094
1098
|
if (uvzShadow.z < 0.0) {
|
|
1095
1099
|
return 0.0;
|
|
1096
1100
|
}
|
|
1097
1101
|
|
|
1098
1102
|
float shadow1 = readShadowMapUVZ(uvzShadow, shadowMap);
|
|
1099
|
-
|
|
1100
|
-
${(0,o.If)(t,o.H`
|
|
1101
|
-
// matching full-resolution receiver viewport when this helper is used.
|
|
1102
|
-
float shadow2 = texelFetch(screenSpaceShadowHighlight, ivec2(gl_FragCoord.xy), 0).r;
|
|
1103
|
-
return shadow1 > shadow2 ? shadow1 : shadow2;
|
|
1104
|
-
`,o.H`return shadow1;`)}
|
|
1103
|
+
${(0,o.If)(t,"float shadow2 = texelFetch(shadowHighlight, ivec2(gl_FragCoord.xy), 0).r;\n return shadow1 > shadow2 ? shadow1 : shadow2;","return shadow1;")}
|
|
1105
1104
|
}
|
|
1106
1105
|
`)}(e,t),e.fragment.code.add(o.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
|
|
1107
1106
|
vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap, 0));
|
|
1108
1107
|
return readShadowMaps(uvzShadow);
|
|
1109
|
-
}`)}(e,r),e.fragment.
|
|
1110
|
-
float readShadow(float additionalAmbientScale, vec3 vpos) {
|
|
1111
|
-
return ${i?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,o.If)(n,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
1112
|
-
}
|
|
1113
|
-
`)}h.Y},96608(e,t,r){r.d(t,{t:()=>c});var i=r(52540),n=r(77108),o=r(33094),s=r(31821),a=r(58029),l=r(12791);function c(e,t){if(!t.screenSpaceReflections)return;const r=e.fragment;r.include(i.E),r.uniforms.add(new n.E("nearFar",e=>e.camera.nearFar),new l.x("depthMap",e=>e.depth?.attachment),new a.F("proj",e=>e.camera.projectionMatrix),new o.U("invResolutionHeight",e=>1/e.camera.height),new a.F("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(s.H`
|
|
1108
|
+
}`)}h.Y},96608(e,t,r){r.d(t,{t:()=>c});var i=r(52540),n=r(77108),o=r(33094),s=r(31821),a=r(58029),l=r(12791);function c(e,t){if(!t.screenSpaceReflections)return;const r=e.fragment;r.include(i.E),r.uniforms.add(new n.E("nearFar",e=>e.camera.nearFar),new l.x("depthMap",e=>e.depth?.attachment),new a.F("proj",e=>e.camera.projectionMatrix),new o.U("invResolutionHeight",e=>1/e.camera.height),new a.F("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(s.H`
|
|
1114
1109
|
vec2 reprojectionCoordinate(vec3 projectionCoordinate)
|
|
1115
1110
|
{
|
|
1116
1111
|
vec4 zw = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);
|
|
@@ -1403,13 +1398,11 @@ smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
|
|
|
1403
1398
|
return snow * snowCover;
|
|
1404
1399
|
}`),e.code.add(n.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
|
|
1405
1400
|
return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
1406
|
-
}`))}},49718(e,t,r){r(51850),r(6867).i},6867(e,t,r){r.d(t,{i:()=>u});var i=r(58083),n=r(9093),o=r(35522),s=r(51850),a=r(78955),l=r(91829),c=r(71351);class u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.hs)(h,this.ray.direction,this.distance),(0,o.Bw)(h))}withinDistance(e){return!!d(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!d(this)&&((0,o.hs)(h,this.ray.direction,this.distance),(0,o.WQ)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.C)(m,this.normal),m[3]=0,(0,a.Z0)(m,m,this.transformation),(0,o.C)(e,m),(0,o.S8)(e,e)}constructor(e){this.intersector=4,this.normal=(0,s.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,a,l,c,u){this.intersector=e,this.distance=r,(0,o.C)(this.normal,a??s.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=u}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.C)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function d(e){return null!=e?.distance}const h=(0,s.vt)(),m=(0,l.vt)()},16396(e,t,r){r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(35522),n=r(51850),o=r(94008),s=r(57005);const a=new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)(),this._tmpSphere=new o.iy}applyToVertex(e,t,r){const n=this.objectTransform.transform,o=(0,i.hZ)(c,e,t,r),s=(0,i.Z0)(o,o,n),a=this.offset/(0,i.Bw)(s);(0,i.Ln)(s,s,s,a);const l=this.objectTransform.inverse;return(0,i.Z0)(this.tmpVertex,s,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.Bw)(e);(0,i.Ln)(e,e,e,r);const n=this.offset/(0,i.Bw)(t);(0,i.Ln)(t,t,t,n)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=e.center,r=(0,i.Bw)(t),n=this.offset/r;return(0,i.Ln)(this._tmpSphere.center,t,t,n),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null!=e?(a.offset=e,a):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=new o.iy,this._tmpObb=new s.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.Bw)(e)}applyToVertex(e,t,r){const n=(0,i.hZ)(c,e,t,r),o=(0,i.hZ)(u,e,t,r+this.componentLocalOriginLength),s=this._totalOffset/(0,i.Bw)(o);return(0,i.Ln)(this._tmpVertex,n,o,s),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],s=e[4],a=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(n),d=Math.abs(o),h=Math.abs(s),m=Math.abs(a),p=.5*(1+Math.sign(r*o))*Math.min(l,d),f=.5*(1+Math.sign(i*s))*Math.min(c,h),g=.5*(1+Math.sign(n*a))*Math.min(u,m),v=Math.max(l,d),_=Math.max(c,h),x=Math.max(u,m),b=Math.sqrt(p*p+f*f+g*g),w=Math.sign(l+r),y=Math.sign(c+i),T=Math.sign(u+n),
|
|
1407
|
-
return (1.0 / 255.0) * (fract(52.9829189 * fract(dot(gl_FragCoord.xy + gl_FragCoord.z, vec2(0.06711056, 0.00583715)))) - 0.5);
|
|
1408
|
-
}`)}var u=r(66211);function d(e,t){e.include(o.Q,t),e.include(n.NL,t);const{fragment:r,outputs:d}=e;r.include(s.a);const{output:h,hasEmission:m,discardInvisibleFragments:p,oitPremultipliedAlpha:f,snowCover:g}=t,v=11===h,_=(0,i.Sp)(h),x=(0,i.Rb)(h),b=(0,i._o)(h)&&!_;let w=0;(b||_)&&d.add("fragColor","vec4",w++),m&&d.add("fragEmission","vec4",w++),_&&d.add("fragAlpha","float",w++),r.include(l.Q),r.include(u.H,t),r.include(c,t),r.code.add(a.H`
|
|
1401
|
+
}`))}},49718(e,t,r){r(51850),r(6867).i},6867(e,t,r){r.d(t,{i:()=>u});var i=r(58083),n=r(9093),o=r(35522),s=r(51850),a=r(78955),l=r(91829),c=r(71351);class u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.hs)(h,this.ray.direction,this.distance),(0,o.Bw)(h))}withinDistance(e){return!!d(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!d(this)&&((0,o.hs)(h,this.ray.direction,this.distance),(0,o.WQ)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.C)(m,this.normal),m[3]=0,(0,a.Z0)(m,m,this.transformation),(0,o.C)(e,m),(0,o.S8)(e,e)}constructor(e){this.intersector=4,this.normal=(0,s.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,a,l,c,u){this.intersector=e,this.distance=r,(0,o.C)(this.normal,a??s.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=u}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.C)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function d(e){return null!=e?.distance}const h=(0,s.vt)(),m=(0,l.vt)()},16396(e,t,r){r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(35522),n=r(51850),o=r(94008),s=r(57005);const a=new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)(),this._tmpSphere=new o.iy}applyToVertex(e,t,r){const n=this.objectTransform.transform,o=(0,i.hZ)(c,e,t,r),s=(0,i.Z0)(o,o,n),a=this.offset/(0,i.Bw)(s);(0,i.Ln)(s,s,s,a);const l=this.objectTransform.inverse;return(0,i.Z0)(this.tmpVertex,s,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.Bw)(e);(0,i.Ln)(e,e,e,r);const n=this.offset/(0,i.Bw)(t);(0,i.Ln)(t,t,t,n)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=e.center,r=(0,i.Bw)(t),n=this.offset/r;return(0,i.Ln)(this._tmpSphere.center,t,t,n),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null!=e?(a.offset=e,a):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=new o.iy,this._tmpObb=new s.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.Bw)(e)}applyToVertex(e,t,r){const n=(0,i.hZ)(c,e,t,r),o=(0,i.hZ)(u,e,t,r+this.componentLocalOriginLength),s=this._totalOffset/(0,i.Bw)(o);return(0,i.Ln)(this._tmpVertex,n,o,s),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],s=e[4],a=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(n),d=Math.abs(o),h=Math.abs(s),m=Math.abs(a),p=.5*(1+Math.sign(r*o))*Math.min(l,d),f=.5*(1+Math.sign(i*s))*Math.min(c,h),g=.5*(1+Math.sign(n*a))*Math.min(u,m),v=Math.max(l,d),_=Math.max(c,h),x=Math.max(u,m),b=Math.sqrt(p*p+f*f+g*g),w=Math.sign(l+r),y=Math.sign(c+i),T=Math.sign(u+n),M=Math.sign(d+o),S=Math.sign(h+s),C=Math.sign(m+a),E=this._totalOffset;if(b<E)return e[0]-=(1-w)*E,e[1]-=(1-y)*E,e[2]-=(1-T)*E,e[3]+=M*E,e[4]+=S*E,e[5]+=C*E,e;const A=E/Math.sqrt(v*v+_*_+x*x),R=E/b,I=R-A,O=-I;return e[0]+=r*(w*O+R),e[1]+=i*(y*O+R),e[2]+=n*(T*O+R),e[3]+=o*(M*I+A),e[4]+=s*(S*I+A),e[5]+=a*(C*I+A),e}applyToMbs(e){const t=e.center,r=(0,i.Bw)(t),n=this._totalOffset/r;return(0,i.Ln)(this._tmpMbs.center,t,t,n),this._tmpMbs.radius=e.radius+e.radius*this._totalOffset/r,this._tmpMbs}applyToObb(e){return(0,s.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=(0,i.hZ)(c,e,t,r),o=(0,i.WQ)(u,n,this.localOrigin),s=this.offset/(0,i.Bw)(o);return(0,i.Ln)(this.tmpVertex,n,o,s),this.tmpVertex}applyToAabb(e){const t=d,r=h,i=m;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let s=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(s|=1<<e);if(0!==s&&7!==s)for(let e=0;e<8;++e)if(0===(s&e)){for(let n=0;n<3;++n)i[n]=s&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const c=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),h=(0,n.vt)(),m=(0,n.vt)()},19245(e,t,r){r.d(t,{Um:()=>l,MB:()=>a,kE:()=>o});var i=r(4576),n=r(34727);r(44208);function o(e,t,r,i,o,s){let a=r.screenLength*e.pixelRatio;null!=o&&(c.update(i,t,o,s),a=c.apply(a));const l=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const s=(0,i.VO)();function a(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&s(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}const l={multiply:1,ignore:2,replace:3,tint:4},c=new class{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null!=i?Math.min(r.minPixelSize/i,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){const{_scale:t,_angleFactor:r,_minScale:i}=this;return e*(0,n.qE)((0,n.Cc)(t,1,r),i,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}},74810(e,t,r){r.d(t,{Bt:()=>a,Jr:()=>o,SY:()=>l,mb:()=>s});var i=r(35522),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:s,emissiveFactor:a,occlusionTexture:l}){return null==e&&null==t&&null==s&&(null==a||(0,i.t2)(a,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const s=(0,n.CN)(1,1,.5),a=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2)},73541(e,t,r){r.d(t,{D:()=>d});var i=r(49255),n=r(22911),o=r(42593),s=r(63365),a=r(31821),l=r(26934);function c(e,t){t.useFloatBlend?e.code.add(a.H`float ditherNoise(vec4 color) { return 0.0; }`):e.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 }")}var u=r(66211);function d(e,t){e.include(o.Q,t),e.include(n.NL,t);const{fragment:r,outputs:d}=e;r.include(s.a);const{output:h,hasEmission:m,discardInvisibleFragments:p,oitPremultipliedAlpha:f,snowCover:g}=t,v=11===h,_=(0,i.Sp)(h),x=(0,i.Rb)(h),b=(0,i._o)(h)&&!_;let w=0;(b||_)&&d.add("fragColor","vec4",w++),m&&d.add("fragEmission","vec4",w++),_&&d.add("fragAlpha","float",w++),r.include(l.Q),r.include(u.H,t),r.include(c,t),r.code.add(a.H`
|
|
1409
1402
|
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,a.If)(g,", float snow")}) {
|
|
1410
1403
|
${(0,a.If)(v,"finalColor.a = 1.0;")}
|
|
1411
1404
|
${(0,a.If)(p,"if (finalColor.a < alphaCutoff) { discard; }")}
|
|
1412
|
-
${(0,a.If)(_||m,"float noise = ditherNoise();")}
|
|
1405
|
+
${(0,a.If)(_||m,"float noise = ditherNoise(finalColor);")}
|
|
1413
1406
|
|
|
1414
1407
|
${(0,a.If)(_,`fragColor = ${(0,a.If)(f,"finalColor","premultiplyAlpha(finalColor)")};\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n fragAlpha = finalColor.a * floatBlendOutputScale + noise;`)}
|
|
1415
1408
|
${(0,a.If)(x&&f&&p,"finalColor.rgb /= finalColor.a;")}
|
|
@@ -1418,4 +1411,4 @@ return (1.0 / 255.0) * (fract(52.9829189 * fract(dot(gl_FragCoord.xy + gl_FragCo
|
|
|
1418
1411
|
calculateOcclusionAndOutputHighlight();
|
|
1419
1412
|
${(0,a.If)(v,"outputObjectAndLayerIdColor();")}
|
|
1420
1413
|
}
|
|
1421
|
-
`)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q)}},66211(e,t,r){function i(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/n),e.constants.add("floatBlendInputScale","float",n))}r.d(t,{H:()=>i,m:()=>n});const n=16},14239(e,t,r){r.d(t,{OG:()=>We,gP:()=>Ve});var i=r(5482),n=r(69540),o=r(91429);let s=class extends n.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"rows",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"columns",void 0),s=(0,i.Cg)([(0,o.$K)("esri.CameraLayout")],s);const a=s;var l=r(69052),c=r(25482),u=r(34727),d=r(56507),h=r(86738),m=r(43937),p=r(36005);let f=class extends((0,n.OU)(c.o)){constructor(...e){super(...e),this.position=new h.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,d.GB)(e.x||0),n.y=(0,d.GB)(e.y||0),n.z=e.hasZ?(0,d.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new h.A;return r.read(e,t),r.x=(0,d.GB)(r.x||0),r.y=(0,d.GB)(r.y||0),r.z=r.hasZ?(0,d.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,i.Cg)([(0,o.MZ)({type:h.A,json:{write:{isRequired:!0}}})],f.prototype,"position",void 0),(0,i.Cg)([(0,m.K)("position")],f.prototype,"writePosition",null),(0,i.Cg)([(0,p.w)("position")],f.prototype,"readPosition",null),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>l.ie.normalize((0,d.GB)(e)))],f.prototype,"heading",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>(0,u.qE)((0,d.GB)(e),-180,180))],f.prototype,"tilt",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,o.wg)(e=>(0,u.qE)((0,d.GB)(e,55),1,170))],f.prototype,"fov",void 0),(0,i.Cg)([(0,o.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"layout",void 0),f=(0,i.Cg)([(0,o.$K)("esri.Camera")],f);var g=r(9093),v=r(35522),_=r(51850),x=r(16930),b=(r(48353),r(9762),r(65806)),w=r(27993),y=r(73941),T=(r(19419),r(71351)),S=r(69622),M=r(53966),C=r(90629),E=r(58083),A=r(37585),R=r(48163),I=r(78955),O=r(91829),F=r(82919),P=r(44280);function D(e,t,r){e.worldUpAtPosition(t,N),(0,v.Re)(B,r,t);const i=(0,v.Bw)(B);return 0===i?0:(0,u.XM)((0,v.Om)(B,N)/i)}const N=(0,_.vt)(),B=(0,_.vt)();var H;let L=H=class extends S.A{constructor(e){super(e),this._ray=(0,T.vt)(),this._viewport=(0,O.fA)(0,0,1,1),this._padding=(0,O.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,R.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,g.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,g.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,g.vt)(),this._frustumDirty=!0,this._frustum=(0,F.vt)(),this._fullViewport=(0,O.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,_.vt)(),this._up=(0,_.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,v.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,E.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,v.hZ)((0,_.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,v.hZ)((0,_.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,v.hZ)((0,_.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,I.hs)((0,O.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,I.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,I.hs)((0,O.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,I.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(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(e){(0,I.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,I.C)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,E.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,E.B8)((0,g.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,g.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,v.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,E.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,E.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}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 e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,s=-i/2+this.column*o,a=s+o,l=-r/2+this.row*n,c=l+n,u=(0,E.$h)((0,g.vt)(),s*(1+2*this._padding[3]/e),a*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,E.aI)(d,u)?d:u}copyFrom(e){(0,v.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,I.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,I.C)(this._padding,e.padding),this.notifyChange("_padding"),(0,A.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,E.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,F.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,E.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,I.C)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new H).copyFrom(this)}equals(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&(0,I.t2)(this._viewport,e.viewport)&&(0,I.t2)(this._padding,e.padding)&&(0,A.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,I.hG)(e.screenPadding,this.screenPadding)>=t||(0,I.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,v.jb)(G,e.eye,e.center),(0,v.jb)(j,this.eye,this.center);const r=(0,v.Om)(G,j),i=(0,v.uE)(G),n=(0,v.uE)(j),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,v.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,P.gr)(this.viewForward,(0,v.Re)(G,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,C.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==z&&(0,v.C)(z,e),z[3]=1,(0,I.Z0)(z,z,this.projectionMatrix);const r=Math.abs(z[3]);(0,v.hs)(z,z,1/r);const i=this.fullViewport;t[0]=(0,u.Cc)(0,i[0]+i[2],.5+.5*z[0]),t[1]=(0,u.Cc)(0,i[1]+i[3],.5+.5*z[1]),t[2]=.5*(z[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;z[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],z[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],z[2]=(2*e[2]-1)*e[3],z[3]=e[3],null!=this.inverseProjectionMatrix&&((0,I.Z0)(z,z,this.inverseProjectionMatrix),t[0]=z[0],t[1]=z[1],t[2]=z[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,V),this.renderToScreen(V,t),t}projectToRenderScreen(e,t){if(z[0]=e[0],z[1]=e[1],z[2]=e[2],z[3]=1,(0,I.Z0)(z,z,this.viewProjectionMatrix),0===z[3])return null;const r=z;(0,v.hs)(r,r,1/Math.abs(z[3]));const i=this.fullViewport,n=(0,u.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,u.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,V),t)}unprojectFromRenderScreen(e,t){if((0,E.lw)(U,this.projectionMatrix,this.viewMatrix),!(0,E.B8)(U,U))return null;const r=this.fullViewport;return z[0]=2*(e[0]-r[0])/r[2]-1,z[1]=2*(e[1]-r[1])/r[3]-1,z[2]=2*e[2]-1,z[3]=1,(0,I.Z0)(z,z,U),0===z[3]?null:(t[0]=z[0]/z[3],t[1]=z[1]/z[3],t[2]=z[2]/z[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,s=Math.max(n-r/2,0),a=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),u=r-l- -Math.min(this.fullWidth-n-r/2,0),d=i-c- -Math.min(o-i/2,0);return[Math.round(s),Math.round(a),Math.round(u),Math.round(d)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,s=Math.abs(Math.PI/2-D(t,r,i));return e.frustumCoverage(s,n,o)}_computeUpGlobal(){(0,v.Re)(G,this.center,this.eye);const e=(0,v.Bw)(this.center);e<1?(0,v.t2)(this._up,_.Cb)&&((0,v.C)(this._up,_.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,v.Om)(G,this.center))>.9999*(0,v.Bw)(G)*e||((0,v.$A)(j,G,this.center),(0,v.$A)(j,j,G),(0,v.S8)(j,j),(0,v.t2)(this._up,j)||((0,v.C)(this._up,j),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,v.oW)(G,this.eye,this.center),Math.abs(G[2])<=.9999&&((0,v.hs)(G,G,G[2]),(0,v.hZ)(G,-G[0],-G[1],1-G[2]),(0,v.S8)(G,G),(0,v.t2)(this._up,G)||((0,v.C)(this._up,G),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,v.t2)(e,t)||((0,v.C)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):M.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,F.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,E.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,o.MZ)()],L.prototype,"_viewport",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_padding",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_fov",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_nearFar",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"pixelRatio",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_rows",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"rows",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_columns",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"columns",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"eye",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"center",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_center",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"up",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_up",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"viewMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"viewForward",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"viewUp",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"viewRight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"nearFar",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"near",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"far",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"viewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"screenViewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"screenPadding",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"x",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"y",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"width",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"height",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fullWidth",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fullHeight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"_aspect",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"padding",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"projectionMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fov",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fovX",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fovY",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"relativeElevation",void 0),L=H=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl.RenderCamera")],L);const z=(0,O.vt)(),U=(0,g.vt)(),G=(0,_.vt)(),j=(0,_.vt)(),V=(0,C.r_)();r(49718),r(6867),r(16396),(0,_.vt)(),(0,_.vt)(),(0,_.vt)();var k=r(5443),W=r(39829),$=r(95108);function Z(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,s)=>{if(t[r]<i&&s[r]<i)return 1===n?0:1;if(t[r]>i&&s[r]>i)return 1===n?1:0;const a=(s[o]-t[o])/(s[r]-t[r]),l=t[o]+a*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(Y,t[0],t[0])&&q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(Y,t[r],i)){case 1:q(e,i);break;case 3:q(e,(0,R.o8)(Y));break;case 2:q(e,(0,R.o8)(Y)),q(e,i)}}}}function q(e,t){0!==e.length&&(0,A.aI)(e.at(-1),t)||e.push(t)}const Y=(0,R.vt)();var X=r(11964),K=r(27921);const J=(0,_.vt)(),Q=(0,_.vt)();function ee(){return{direction:(0,_.vt)(),up:(0,_.vt)()}}function te(e,t,r,i,n){let o=(0,v.S8)(J,e),s=(0,v.Om)(o,i);const a=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,v.Om)(t,i)),s<.99?((0,v.C)(o,t),a&&(0,v.hs)(o,o,-1)):o=null);let l=0;if(o){(0,v.hs)(Q,i,(0,v.Om)(i,o)),(0,v.Re)(o,o,Q);const e=(0,v.Om)(o,n)/((0,v.Bw)(o)*(0,v.Bw)(n));(0,v.$A)(Q,o,n),l=((0,v.Om)(Q,i)>0?1:-1)*(0,u.KJ)((0,u.XM)(e))}const c=(0,u.KJ)((0,u.XM)(-(0,v.Om)(i,e)/(0,v.Bw)(e)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}function re(e,t,r,i){(0,v.Re)(ie,r,t),(0,K.T7)(i,(0,X.LV)(t,ie),e)||e===r||(0,v.C)(e,r)}const ie=(0,_.vt)(),ne=(0,_.fA)(0,1,0),oe=(0,_.fA)(0,0,1),se=(0,g.vt)(),ae=(0,_.vt)(),le=(0,_.vt)();function ce(e,t,r,i=ee()){const{direction:n,up:o}=i;return(0,E.N9)(se,-(0,u.kU)(t)),(0,E.eL)(se,se,(0,u.kU)(r)),(0,v.Z0)(n,oe,se),(0,v.hs)(n,n,-1),(0,v.Z0)(o,ne,se),i}function ue(e,t,r,i,n){const o=t.lines[11].direction,s=(n-r.getAltitude(i))/o[2];(0,v.Ln)(e,i,o,s)}const de=(0,_.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return te(t,r,i,oe,ne)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=ce(0,r,i),o=(0,_.vt)();return(0,v.hs)(o,n.direction,-t),(0,v.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,u.kU)(e)},headingTiltToDirectionUp:ce,lookAtTiltToEyeTilt:function(e){return(0,u.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,s=e.state.camera.eye,a=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,T.LV)(t.origin,t.direction),n,de)||ue(de,r,i,t.endpoint,n),re(de,s,de,l),a.push((0,R.fA)(de[0],de[1]))}return function(e,t,r){const i=e.map(e=>((0,v.hZ)(de,e[0],e[1],0),t.fromRenderCoords(de,de,r),[de[0],de[1]]));return i.length<=2?new W.A({spatialReference:r}):(i.push(i[0].slice()),(0,$.$3)(i)||i.reverse(),new W.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return Z(r,e,t,0),Z(i,r,t,1),Z(r,i,t,2),Z(i,r,t,3),i}(a,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,s=e.spatialReference??t.spatialReference;return(0,b.g)(t,ae,o),(0,b.g)(t,le,o),ae[0]-=r/2,le[0]+=r/2,ae[1]-=i/2,le[1]+=i/2,(0,w.F)(ae,o,ae,s),(0,w.F)(le,o,le,s),n?(n.xmin=ae[0],n.ymin=ae[1],n.xmax=le[0],n.ymax=le[1],n.spatialReference=s):n=new k.A(ae[0],ae[1],le[0],le[1],s),n}},Symbol.toStringTag,{value:"Module"}));var he=r(34304),me=r(17136),pe=r(94008),fe=r(28735);class ge{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(e){this.renderCoordsHelper=e,this.frustum=(0,F.vt)(),this._points=(0,F.Qy)(),this.lines=new Array(12),this._origin=(0,_.vt)(),this._direction=(0,_.vt)(),this._boundingSphere=new pe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,_.vt)(),endpoint:null}}update(e){(0,F.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,v.C)(this._origin,e.eye),(0,v.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,v.C)(this._points[t],e[t]);(0,F.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,F.m7)(this.frustum,e)}intersectsRay(e){return(0,F.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,F.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,F.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ve(this.lines[t],e[t],e[r]),ve(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ve(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=xe;(0,v.S8)(t,this.direction);const r=_e;(0,v.jb)(r,this.points[4],e);const i=.5*(0,v.Om)(r,r)/(0,v.Om)(t,r),n=this._boundingSphere,o=(0,v.Ln)(be,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=F.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ve(e,t,r){e.origin=t,e.endpoint=r,(0,v.oW)(e.direction,t,r)}const _e=(0,_.vt)(),xe=(0,_.vt)(),be=(0,_.vt)();r(86211);const we=(0,_.fA)(5802e-9,13558e-9,331e-7),ye=(0,_.fA)(65e-8*3,5643e-9,255e-9);(0,_.fA)(we[0]+ye[0],we[1]+ye[1],we[2]+ye[2]);class Te{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Te(0,0)}static{this.Infinite=new Te}}(0,_.vt)(),(0,_.vt)(),new pe.iy,(0,T.vt)(),new k.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Se=r(32728);const Me=(0,_.fA)(0,0,1),Ce=(0,v.S8)((0,_.vt)(),(0,_.fA)(1,1,1)),Ee=(0,g.vt)(),Ae=(0,_.vt)(),Re=(0,_.vt)();function Ie(e,t,r,i=ee()){(0,v.$A)(Ae,e,Me),0===(0,v.Om)(Ae,Ae)&&(0,v.$A)(Ae,e,Ce),(0,E.$0)(Ee,-(0,u.kU)(t),e),(0,E.e$)(Ee,Ee,-(0,u.kU)(r),Ae);const{up:n,direction:o}=i;return(0,v.$A)(n,Ae,e),(0,v.S8)(n,n),(0,v.Z0)(n,n,Ee),(0,v.S8)(o,e),(0,v.ze)(o,o),(0,v.Z0)(o,o,Ee),i}function Oe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Fe(e,t){const r=Ie(t,e.heading,e.tilt);return e.up=r.up,e}function Pe(e,t){const r=[],i=[],n=(0,he.FD)();for(let o=0;o<e.length;o++){const s=e[o],a=o===e.length-1?e[0]:e[o+1],l=(0,X.Cr)(s,a,Ge),c=(0,K.vE)(t,l.origin,l.vector,0,ze);switch(c){case 2:r.push(s);break;case 3:i.push(s);break;case 0:case 1:{const[e,o,a]=0===c?[1,r,i]:[-1,i,r],l=(0,K.Qj)(t),u=(0,v.Ln)((0,_.vt)(),ze,l,e*n),d=(0,v.Ln)((0,_.vt)(),ze,l,e*-n);o.push(s),o.push(u),a.push(d)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const De={minCurvature:(0,u.kU)(5),maxCurvature:(0,u.kU)(50),minSamples:1,maxSamples:6},Ne=(0,_.fA)(1,0,0),Be=(0,_.fA)(0,1,0),He=(0,_.vt)(),Le=(0,_.vt)(),ze=(0,_.vt)(),Ue=new pe.iy,Ge=(0,X.vt)(),je=(0,O.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Ae,o=Re;return(0,v.S8)(n,e),(0,v.$A)(Re,n,Me),0===(0,v.Om)(Re,Re)&&(0,v.$A)(Re,n,Ce),(0,v.$A)(o,Re,n),te(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,_.vt)(),up:null,tilt:i,heading:r},o=Ae;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,a=(0,u.kU)(r),l=(0,u.kU)(i),c=Math.sin(a),d=Math.cos(a),h=Math.sin(l),m=Math.cos(l),p=(0,v.Bw)(o);let f;if(Math.abs(l)<1e-8)f=s+p;else{const e=p/h,t=(0,u.YN)(s/e),r=Math.PI-l-t;f=e*Math.sin(r)}const g=m*s,x=s*s*(h*h),b=d*d*x,w=f-g,y=w*w,T=b*(b+y-o[1]*o[1]);if(T<0)return(0,v.hs)(n.eye,o,f/p),n.tilt=0,Fe(n,e);const S=Math.sqrt(T),M=o[1]*w,C=b+y;let E;if(E=d>0?-S+M:S+M,Math.abs(C)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,v.hs)(n.eye,o,f/p),n.tilt=0,Oe(n.eye),Fe(n,e);n.eye[1]=E/C;const A=c*c*x,R=h*s,I=d*R*n.eye[1],O=n.eye[1]*n.eye[1],F=1-O,P=Math.sqrt(F),D=b*O+A-2*I*P*w+F*y;return Math.abs(D)<1e-8?((0,v.hs)(n.eye,o,f/p),n.tilt=0,Oe(n.eye),Fe(n,e)):(n.eye[0]=(F*(f*o[0]-g*o[0])-R*P*(o[0]*n.eye[1]*d+o[2]*c))/D,n.eye[2]=(F*(f*o[2]-g*o[2])-R*P*(o[2]*n.eye[1]*d-o[0]*c))/D,(0,v.hs)(n.eye,n.eye,f),Oe(n.eye),Fe(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,u.kU)(e),n=(0,v.Bw)(t);return(0,u.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Ie,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,v.Bw)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,u.YN)(r/(n/Math.sin(e)));return(0,u.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new ge(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,a=r.referenceEllipsoid.radius,l=i.eye,c=1+(0,v.Io)(l,t)/(a+o),d=Math.sqrt(c*c-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=De,g=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return Ue.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(Ue,t)}(e),x=(0,u.qE)((d-h)/(m-h),0,1),b=Math.round((0,u.Cc)(p,f,x)),w=i.aboveGround,y=n.planes[5],S=[],M=(0,K.O_)(_.uY,Ne,(0,K.vt)()),C=(0,K.O_)(_.uY,Be,(0,K.vt)());(0,I.hZ)(je,0,0,0,0);const E=e=>{};for(let e=0;e<4;e++){const t=1===e&&!w||3===e&&w?1-g:0,i=1===e&&w||3===e&&!w?g:1,s=n.lines[e],a=n.lines[3===e?0:e+1];for(let n=0;n<b;n++){const c=n/b,d=0===n?0:(0,u.Cc)(t,i,1===e?1-(1-c)**2:3===e?c**2:c),h=(0,v.Cc)(Le,s.origin,a.origin,d),m=(0,Se.nu)(s.direction,a.direction,d,He);r.intersectManifoldClosestSilhouette((0,T.LV)(h,m),o,ze),re(ze,l,ze,y),S.push((0,_.o8)(ze)),0!==S.length&&E((0,v.lo)(S.at(-1),ze));const p=((0,K.Tj)(M,ze)?1:0)|((0,K.Tj)(C,ze)?2:0);je[p]=1}}S.length>2&&(0,v.lo)(S[0],S.at(-1));const A=function(e,t,r){const i=2*(0,he.FD)();return e.map(e=>{const n=[];let o=!1;for(const s of e)t.fromRenderCoords(s,ze,r),Math.abs(s[0])<i&&Math.abs(s[1])<i?(n.push([null,ze[1]]),n.push([null,ze[1]]),o=!0):n.push([ze[0],ze[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,$.$3)(n)||n.reverse(),n})}((0,I.m3)(je)>1?function(e,t){const r=[];for(const i of e)r.push(...Pe(i,t));return r}(Pe(S,M),C):[S],r,s);return new W.A({rings:A,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,a,c;const d=t.latitude,h=(0,y.tO)(e.spatialReference).radius,m=t.longitude,p=function(e,t,r){const i=t/r,n=(0,u.kU)(e),o=Math.sin(i/2),s=Math.cos(n),a=2*(0,u.YN)(Math.sqrt(o*o/(s*s)));return(0,u.KJ)(a)}(d,r,h)/2;o=m-p,s=m+p;const f=(0,u.kU)(d),g=(1+Math.sin(f))/(1-Math.sin(f)),v=(g+1)*Math.tan(i/h/2),_=v*v;function b(e){const t=Math.PI/2;return(e=l.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(a=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*g+_))),c=a+i/h,a=b(a),c=b(c),c<a){const e=c;c=a,a=e}if(a=Math.max((0,u.KJ)(a),-90),c=Math.min((0,u.KJ)(c),90),s=me.Y_.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:x.A.WGS84;return n?(n.xmin=o,n.ymin=a,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new k.A(o,a,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,fe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Ve={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},ke=[Ve.FINAL,Ve.COMPOSITE,Ve.OPAQUE,Ve.TRANSPARENT],We={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GROUND_DEPTH:"ground-depth",PRE_TRANSPARENT:"pre-transparent",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SCREEN_SPACE_SHADOW_HIGHLIGHT:"screen-space-shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VIEWSHED:"viewshed"};Array.from(Object.values(We)).concat(ke),(0,_.vt)()},94401(e,t,r){r.d(t,{A:()=>P});var i=r(5482),n=r(69622),o=r(49186),s=r(36708),a=r(10107),l=r(64108),c=r(14239),u=r(44208),d=r(53966),h=(r(17676),r(94656)),m=r(63907);r(93637),r(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,u.A)("esri-tests-disable-gpu-memory-measurements"),(0,h.en)();(0,h.en)();r(90644);var p=r(76284),f=r(97768),g=r(48852),v=r(42293);const _=!!(0,u.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(m.vt.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:s}=t;s?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return _?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,v.MW)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m.vt.Renderbuffer,this),this._context=null)}}class b{constructor(e,t,r){if(this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m.vt.FramebufferObject,this),null!=t){const r=function(e,t){return w(t)||y(t)?t:T(t)?new p.A(e,t):function(e){return 3===S(e)||null!=e&&"samples"in e}(t)?new x(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(m.r6,r),w(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(m.r6)}if(null!=r)if(function(e){return w(e)||T(e)}(r))this._depthStencilTexture=w(r)?r:new p.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=y(r)?r:new x(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}dispose(){const{_colorAttachments:e,_glName:t}=this;if(0===e.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;const{_context:r}=this,i=r.getBoundFramebufferObject(),n=Array.from(e.values());this.detachColorTextures(...e.keys()),n.forEach(e=>e.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),r.gl.deleteFramebuffer(t),this._glName=null,r.bindFramebuffer(i===this?null:i),r.instanceCounter.decrement(m.vt.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(m.r6);return w(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.r6)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.r6)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&w(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=m.r6){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=m.r6){const t=this._colorAttachments.get(e);if(!t)return;const r=w(t);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._initialized){const t=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{e.forEach(e=>{w(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=m.r6,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,0,r):this._framebufferTexture2D(i.glName,t,e,36160,0))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===m.ld.UNSIGNED_INT_24_8?6402!==r||i===m.ld.UNSIGNED_INT||i===m.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,E(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):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 e=this._depthStencilTexture;return e&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,E(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){const{_context:t}=this,r=t.getBoundFramebufferObject();t.bindFramebuffer(this);const{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebufferObject(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,s){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const a=s.descriptor;3553!==s.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||e+r>this.width||t+i>this.height||n+r>a.width||o+i>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(s,p.A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(p.A.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),l.bindTexture(c,p.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,s){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),s||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,s)}async readPixelsAsync(e,t,r,i,n,o,s){const{gl:a}=this._context,l=g.g.createPixelPack(this._context,35041,s.byteLength);this._context.bindBuffer(l);const c=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),a.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(c),await l.getSubDataAsync(s),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(M(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(M(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,h.en)())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((t,r)=>{if(w(t)){const i=C(t);35866===i?this._framebufferTextureLayer(t.glName,r,e,0,0):this._framebufferTexture2D(t.glName,r,i,e)}else if(y(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=E(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,C(this._depthStencilTexture),e)}(0,h.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.r6,r=3553,i=36160,n=0){this._context.gl.framebufferTexture2D(i,t,r,e,n)}_framebufferTextureLayer(e,t=m.r6,r=36160,i=0,n=0){this._context.gl.framebufferTextureLayer(r,t,e,i,n)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,f.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,E(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,f.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),M(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){M(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.SB.DEPTH_COMPONENT16:case m.SB.DEPTH_COMPONENT24:case m.SB.DEPTH_COMPONENT32F:return m.xL;case m.iE.DEPTH24_STENCIL8:case m.iE.DEPTH32F_STENCIL8:return m.nI;case 36168:return m.uH;default:return m.r6}}_validateColorAttachmentPoint(e){if(-1===b._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;b._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const t=e-m.r6;t+1>b._MAX_COLOR_ATTACHMENTS&&d.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${b._MAX_COLOR_ATTACHMENTS} color attachments`)}}function w(e){return 1===S(e)}function y(e){return 2===S(e)}function T(e){return 0===S(e)}function S(e){return null!=e&&"type"in e?e.type:null}function M(e,t){const r=Math.max(e.width,e.height);if(r>t){d.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function E(e){return 6402===e?m.xL:m.nI}r(67171),r(21818),r(69397);var A=r(85079),R=r(74038);const I=[new R._("position",2,m.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,m.pe.BYTE,0,2),new R._("a_pos",2,m.pe.BYTE,0,4),new R._("a_tex",2,m.pe.BYTE,2,4),(0,A.Xk)(I),r(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 F=class extends n.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=c.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,s.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},s.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new o.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 e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){var t;e.initializeAndBind(),this.gl.drawBuffers((t=e)?t.colorAttachments.length>0?t.colorAttachments:[m.$0]:[m.C5])}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);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(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}};(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],F.prototype,"view",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],F.prototype,"consumes",void 0),(0,i.Cg)([(0,a.MZ)()],F.prototype,"produces",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],F.prototype,"techniques",null),F=(0,i.Cg)([(0,l.$)("esri.views.3d.webgl.RenderNode")],F);const P=F},48852(e,t,r){r.d(t,{g:()=>d});var i=r(4576),n=r(44208),o=r(53966),s=r(34275),a=r(94656),l=r(63907);const c=()=>o.A.getLogger("esri.views.webgl.BufferObject"),u=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class d{static createIndex(e,t,r){return new d(e,34963,t,r)}static createUniform(e,t,r){return new d(e,35345,t,r)}static createPixelPack(e,t=35041,r){const i=new d(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new d(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){const i=new d(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(l.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case l.pe.UNSIGNED_INT:return this._sizeBytes/4;case l.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case l.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(l.vt.BufferObject,this),this._context=null):this._glName&&c().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case l.pe.UNSIGNED_SHORT:e*=2;break;case l.pe.UNSIGNED_INT:e*=4;case l.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;const t=e.byteLength;34963===this.bufferType&&((0,s.mg)(e)?this._indexType=l.pe.UNSIGNED_BYTE:(0,s.jq)(e)?this._indexType=l.pe.UNSIGNED_SHORT:(0,s.XJ)(e)&&(this._indexType=l.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,a.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,a.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;const o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&c().warn("Potential problem getting subdata: requested data exceeds buffer size!");const s=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),s.getBufferSubData(35982,t,e,r,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),s.getBufferSubData(36662,t,e,r,n),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i){await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)}}},65786(e,t,r){r.d(t,{Y:()=>i});const i=class{};new i},14113(e,t,r){r.d(t,{N5:()=>a});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class a extends s{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new h,this.varyings=new m,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),s=n.code.generateSource(),a=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?v:g,u=n.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${s.join("\n")}\n${a.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let s=0;s<i;++s)r[s](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class d extends s{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new u(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"uint":i=f._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])}, ${f._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#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 "},76284(e,t,r){r.d(t,{A:()=>S});var i=r(49186),n=r(44208),o=r(53966),s=r(97768),a=r(93637),l=r(17676),c=r(94656),u=r(63907),d=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(p(n)||f(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,a.a4)(u.SB,e)}function f(e){return(0,a.a4)(u.iE,e)}function g(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!g(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function b(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case 6408:return u.H0.RGBA32F;case 6407:return u.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return u.H0.RGBA8;case 6407:return u.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?u.iE.DEPTH24_STENCIL8:6402===t?u.SB.DEPTH_COMPONENT24:t,e.internalFormat}class w extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R32F:case u.H0.R8_SNORM:case u.H0.R8:this.pixelFormat=6403;break;case u.H0.R8I:case u.H0.R8UI:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32I:case u.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new w(e,t)}}const y=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),T=()=>o.A.getLogger("esri/views/webgl/Texture");class S{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=w.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,d.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(u.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!g(e)&&this._descriptor.internalFormat&&(0,a.a4)(u.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!g(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,n,o,s,a=0){s||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=b(l);const{context:c,pixelFormat:u,dataType:d,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+n>l.width||r+o>l.height)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;a&&(n&&o||T().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,a)),v(s)?f.texSubImage2D(h,e,t,r,n,o,u,d,s):g(s)?f.compressedTexSubImage2D(h,e,t,r,n,o,l.internalFormat,s.levels[e]):f.texSubImage2D(h,e,t,r,n,o,u,d,s),a&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,S.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,n,o,s,a,l){l||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=b(c);const{context:u,pixelFormat:d,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||T().warn("Attempting to set 3D texture data on a non-3D texture");const f=u.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||n<0||t+o>c.width||r+s>c.height||n+a>c.depth)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=u;if(g(l))l=l.levels[e],v.compressedTexSubImage3D(p,e,t,r,n,o,s,a,c.internalFormat,l);else{const i=l;v.texSubImage3D(p,e,t,r,n,o,s,a,d,h,i)}u.bindTexture(f,S.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,S.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(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,s.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,n=r.context?.gl;if(!n)return;(0,c.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),r.context.instanceCounter.increment(u.vt.Texture,this)),m(r);const o=r.context.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(n);const s=t??r.target,l=_(s);if(v(e))this._setDataFromTexImageSource(e,s);else{const{width:t,height:o,depth:d}=r;if(null==t||null==o)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==d)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=b(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,r.internalFormat,r.hasMipmap,t,o,d),g(e)){if(!function(e){return null!=e&&(0,a.a4)(u.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,s)}else this._texImage(s,0,r.internalFormat,t,o,d,e),(0,c.Y2)(n),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(n),r.context.bindTexture(o,S.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=b(i);const n=_(t),{width:o,height:s,depth:a}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=s),n&&i.depth,n&&(i.depth=a),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,s,a),this._texImage(t,0,i.internalFormat,o,s,a,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:s}=i,a=e.levels,l=x(r,n,o,s),c=Math.min(l,a.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,n,o)=>{const s=a[Math.min(e,a.length-1)];this._compressedTexImage(r,e,t,i,n,o,s)},c)}_texStorage(e,t,r,n,o,s){const{gl:a}=this._descriptor.context;if(!function(e){return u.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,n,o,s):1;if(_(e)){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(e,l,t,n,o,s)}else a.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,s,a){const l=this._descriptor.context.gl,c=_(e),{isImmutable:u,pixelFormat:d,dataType:h}=this._descriptor;if(u){if(null!=a){const r=a;if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,s,d,h,r)}else l.texSubImage2D(e,t,0,0,n,o,d,h,r)}}else{const u=a;if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,s,0,d,h,u)}else l.texImage2D(e,t,r,n,o,0,d,h,u)}}_compressedTexImage(e,t,r,n,o,s,a){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=a)if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,s,r,a)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,a)}else if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,s,0,a)}else l.compressedTexImage2D(e,t,r,n,o,0,a)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:n,preMultiplyAlpha:o,hasMipmap:s}=this._descriptor,a=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:d}=i.capabilities;if(!S.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!u&&!d)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,a?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:n?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:o,hasMipmap:s,hasETC:!!u,hasS3TC:!!d},a=await S.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),a.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||T().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:s,target:a}=this._descriptor;const l=32879===a;if(null==r||null==n||l&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),s&&(1!==r||1!==n||l&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},67171(e,t,r){r.d(t,{R:()=>o,e:()=>s});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.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 s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.MW)(e.internalFormat))*(34067===e.target?6:1))}},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},42293(e,t,r){r.d(t,{MW:()=>l,wH:()=>a,yu:()=>s});var i=r(94656),n=r(63907);const o=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function s(e,t,r,n=0){const s=e.gl;e.bindBuffer(r);for(const a of r.layout){const r=t.get(a.name);if(null==r){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const l=n*a.stride;if(a.count<=4)a.integer&&o.has(a.type)?s.vertexAttribIPointer(r,a.count,a.type,a.stride,a.offset+l):s.vertexAttribPointer(r,a.count,a.type,a.normalized,a.stride,a.offset+l),s.enableVertexAttribArray(r),a.divisor>0&&s.vertexAttribDivisor(r,a.divisor);else if(9===a.count)for(let e=0;e<3;e++)s.vertexAttribPointer(r+e,3,a.type,a.normalized,a.stride,a.offset+12*e+l),s.enableVertexAttribArray(r+e),a.divisor>0&&s.vertexAttribDivisor(r+e,a.divisor);else if(16===a.count)for(let e=0;e<4;e++)s.vertexAttribPointer(r+e,4,a.type,a.normalized,a.stride,a.offset+16*e+l),s.enableVertexAttribArray(r+e),a.divisor>0&&s.vertexAttribDivisor(r+e,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,i.en)()){const t=(0,i.u1)(e.gl);t&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${l}:`,t,a)}}}function a(e){switch(e){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 l(e){switch(e){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}},85079(e,t,r){r.d(t,{Sk:()=>s,Xk:()=>n,_u:()=>o});var i=r(21818);function n(e){let t=0;return(0,i.z)(new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i})))}function o(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}function s(e){return o(Array.from(e.values()).map(({layout:e})=>e))}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},74038(e,t,r){r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,s=0,a=!1){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=s,this.integer=a}}},94656(e,t,r){r.d(t,{Y2:()=>c,en:()=>l,u1:()=>s});var i=r(49186),n=r(44208),o=r(53966);function s(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.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 e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function l(){return a}function c(e,t=l()){if(t){const t=s(e);if(t){const e=(new Error).stack;o.A.getLogger("esri.views.webgl.checkWebGLError").error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},63907(e,t,r){r.d(t,{$0:()=>h,C5:()=>d,CQ:()=>v,H0:()=>o,SB:()=>l,WR:()=>i,XN:()=>s,iE:()=>a,ld:()=>c,nI:()=>p,pe:()=>n,r6:()=>m,uH:()=>g,vt:()=>u,xL:()=>f});const i={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},o={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},s=Object.values(o),a={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},l={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},c={FLOAT:n.FLOAT,UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:n.BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,SHORT:n.SHORT,UNSIGNED_INT:n.UNSIGNED_INT,INT:n.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},u={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},d=1029,h=0,m=36064,p=33306,f=36096,g=36128,v={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},90644(e,t,r){function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}r.d(t,{Ey:()=>w,RC:()=>s,T8:()=>a,Uy:()=>d,Xt:()=>u,iD:()=>o,kn:()=>h,p3:()=>n}),r(4718);const o=i(0,771),s=(i(1,0),i(1,1),i(1,771)),a=n(770,1,771,771),l=(n(0,0,768,1),{face:1029,mode:2305}),c={face:1028,mode:2305},u=e=>2===e?l:1===e?c:null,d={zNear:0,zFar:1},h={r:!0,g:!0,b:!0,a:!0};function m(e){return S.intern(e)}function p(e){return C.intern(e)}function f(e){return A.intern(e)}function g(e){return I.intern(e)}function v(e){return F.intern(e)}function _(e){return D.intern(e)}function x(e){return B.intern(e)}function b(e){return L.intern(e)}function w(e){return U.intern(e)}class y{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function T(e){return"["+e.join(",")+"]"}const S=new y(M,e=>({__tag:"Blending",...e}));function M(e){return e?T([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const C=new y(E,e=>({__tag:"Culling",...e}));function E(e){return e?T([e.face,e.mode]):null}const A=new y(R,e=>({__tag:"PolygonOffset",...e}));function R(e){return e?T([e.factor,e.units]):null}const I=new y(O,e=>({__tag:"DepthTest",...e}));function O(e){return e?T([e.func]):null}const F=new y(P,e=>({__tag:"StencilTest",...e}));function P(e){return e?T([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const D=new y(N,e=>({__tag:"DepthWrite",...e}));function N(e){return e?T([e.zNear,e.zFar]):null}const B=new y(H,e=>({__tag:"ColorWrite",...e}));function H(e){return e?T([e.r,e.g,e.b,e.a]):null}const L=new y(z,e=>({__tag:"StencilWrite",...e}));function z(e){return e?T([e.mask]):null}const U=new y(function(e){return e?T([M(e.blending),E(e.culling),R(e.polygonOffset),O(e.depthTest),P(e.stencilTest),N(e.depthWrite),H(e.colorWrite),z(e.stencilWrite)]):null},e=>({blending:m(e.blending),culling:p(e.culling),polygonOffset:f(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:_(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:b(e.stencilWrite)}))},49788(e,t,r){r.d(t,{Q:()=>i});const i=1/255.5}}]);
|
|
1414
|
+
`)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q)}},66211(e,t,r){function i(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/n),e.constants.add("floatBlendInputScale","float",n))}r.d(t,{H:()=>i,m:()=>n});const n=16},14239(e,t,r){r.d(t,{OG:()=>We,gP:()=>Ve});var i=r(5482),n=r(69540),o=r(91429);let s=class extends n.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"rows",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"columns",void 0),s=(0,i.Cg)([(0,o.$K)("esri.CameraLayout")],s);const a=s;var l=r(69052),c=r(25482),u=r(34727),d=r(56507),h=r(86738),m=r(43937),p=r(36005);let f=class extends((0,n.OU)(c.o)){constructor(...e){super(...e),this.position=new h.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,d.GB)(e.x||0),n.y=(0,d.GB)(e.y||0),n.z=e.hasZ?(0,d.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new h.A;return r.read(e,t),r.x=(0,d.GB)(r.x||0),r.y=(0,d.GB)(r.y||0),r.z=r.hasZ?(0,d.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,i.Cg)([(0,o.MZ)({type:h.A,json:{write:{isRequired:!0}}})],f.prototype,"position",void 0),(0,i.Cg)([(0,m.K)("position")],f.prototype,"writePosition",null),(0,i.Cg)([(0,p.w)("position")],f.prototype,"readPosition",null),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>l.ie.normalize((0,d.GB)(e)))],f.prototype,"heading",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>(0,u.qE)((0,d.GB)(e),-180,180))],f.prototype,"tilt",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,o.wg)(e=>(0,u.qE)((0,d.GB)(e,55),1,170))],f.prototype,"fov",void 0),(0,i.Cg)([(0,o.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"layout",void 0),f=(0,i.Cg)([(0,o.$K)("esri.Camera")],f);var g=r(9093),v=r(35522),_=r(51850),x=r(16930),b=(r(48353),r(9762),r(65806)),w=r(27993),y=r(73941),T=(r(19419),r(71351)),M=r(69622),S=r(53966),C=r(90629),E=r(58083),A=r(37585),R=r(48163),I=r(78955),O=r(91829),F=r(82919),P=r(44280);function D(e,t,r){e.worldUpAtPosition(t,N),(0,v.Re)(B,r,t);const i=(0,v.Bw)(B);return 0===i?0:(0,u.XM)((0,v.Om)(B,N)/i)}const N=(0,_.vt)(),B=(0,_.vt)();var H;let L=H=class extends M.A{constructor(e){super(e),this._ray=(0,T.vt)(),this._viewport=(0,O.fA)(0,0,1,1),this._padding=(0,O.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,R.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,g.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,g.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,g.vt)(),this._frustumDirty=!0,this._frustum=(0,F.vt)(),this._fullViewport=(0,O.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,_.vt)(),this._up=(0,_.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,v.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,E.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,v.hZ)((0,_.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,v.hZ)((0,_.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,v.hZ)((0,_.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,I.hs)((0,O.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,I.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,I.hs)((0,O.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,I.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(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(e){(0,I.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,I.C)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,E.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,E.B8)((0,g.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,g.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,v.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,E.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,E.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}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 e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,s=-i/2+this.column*o,a=s+o,l=-r/2+this.row*n,c=l+n,u=(0,E.$h)((0,g.vt)(),s*(1+2*this._padding[3]/e),a*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,E.aI)(d,u)?d:u}copyFrom(e){(0,v.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,I.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,I.C)(this._padding,e.padding),this.notifyChange("_padding"),(0,A.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,E.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,F.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,E.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,I.C)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new H).copyFrom(this)}equals(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&(0,I.t2)(this._viewport,e.viewport)&&(0,I.t2)(this._padding,e.padding)&&(0,A.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,I.hG)(e.screenPadding,this.screenPadding)>=t||(0,I.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,v.jb)(G,e.eye,e.center),(0,v.jb)(j,this.eye,this.center);const r=(0,v.Om)(G,j),i=(0,v.uE)(G),n=(0,v.uE)(j),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,v.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,P.gr)(this.viewForward,(0,v.Re)(G,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,C.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==z&&(0,v.C)(z,e),z[3]=1,(0,I.Z0)(z,z,this.projectionMatrix);const r=Math.abs(z[3]);(0,v.hs)(z,z,1/r);const i=this.fullViewport;t[0]=(0,u.Cc)(0,i[0]+i[2],.5+.5*z[0]),t[1]=(0,u.Cc)(0,i[1]+i[3],.5+.5*z[1]),t[2]=.5*(z[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;z[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],z[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],z[2]=(2*e[2]-1)*e[3],z[3]=e[3],null!=this.inverseProjectionMatrix&&((0,I.Z0)(z,z,this.inverseProjectionMatrix),t[0]=z[0],t[1]=z[1],t[2]=z[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,V),this.renderToScreen(V,t),t}projectToRenderScreen(e,t){if(z[0]=e[0],z[1]=e[1],z[2]=e[2],z[3]=1,(0,I.Z0)(z,z,this.viewProjectionMatrix),0===z[3])return null;const r=z;(0,v.hs)(r,r,1/Math.abs(z[3]));const i=this.fullViewport,n=(0,u.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,u.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,V),t)}unprojectFromRenderScreen(e,t){if((0,E.lw)(U,this.projectionMatrix,this.viewMatrix),!(0,E.B8)(U,U))return null;const r=this.fullViewport;return z[0]=2*(e[0]-r[0])/r[2]-1,z[1]=2*(e[1]-r[1])/r[3]-1,z[2]=2*e[2]-1,z[3]=1,(0,I.Z0)(z,z,U),0===z[3]?null:(t[0]=z[0]/z[3],t[1]=z[1]/z[3],t[2]=z[2]/z[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,s=Math.max(n-r/2,0),a=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),u=r-l- -Math.min(this.fullWidth-n-r/2,0),d=i-c- -Math.min(o-i/2,0);return[Math.round(s),Math.round(a),Math.round(u),Math.round(d)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,s=Math.abs(Math.PI/2-D(t,r,i));return e.frustumCoverage(s,n,o)}_computeUpGlobal(){(0,v.Re)(G,this.center,this.eye);const e=(0,v.Bw)(this.center);e<1?(0,v.t2)(this._up,_.Cb)&&((0,v.C)(this._up,_.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,v.Om)(G,this.center))>.9999*(0,v.Bw)(G)*e||((0,v.$A)(j,G,this.center),(0,v.$A)(j,j,G),(0,v.S8)(j,j),(0,v.t2)(this._up,j)||((0,v.C)(this._up,j),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,v.oW)(G,this.eye,this.center),Math.abs(G[2])<=.9999&&((0,v.hs)(G,G,G[2]),(0,v.hZ)(G,-G[0],-G[1],1-G[2]),(0,v.S8)(G,G),(0,v.t2)(this._up,G)||((0,v.C)(this._up,G),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,v.t2)(e,t)||((0,v.C)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):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,F.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,E.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,o.MZ)()],L.prototype,"_viewport",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_padding",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_fov",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_nearFar",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"pixelRatio",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_rows",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"rows",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_columns",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"columns",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"eye",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"center",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_center",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"up",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"_up",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"viewMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"viewForward",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"viewUp",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"viewRight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"nearFar",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"near",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"far",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"viewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"screenViewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"screenPadding",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"x",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"y",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"width",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"height",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fullWidth",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fullHeight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"_aspect",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"padding",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"projectionMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fov",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fovX",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"fovY",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],L.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,o.MZ)()],L.prototype,"relativeElevation",void 0),L=H=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl.RenderCamera")],L);const z=(0,O.vt)(),U=(0,g.vt)(),G=(0,_.vt)(),j=(0,_.vt)(),V=(0,C.r_)();r(49718),r(6867),r(16396),(0,_.vt)(),(0,_.vt)(),(0,_.vt)();var k=r(5443),W=r(39829),$=r(95108);function Z(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,s)=>{if(t[r]<i&&s[r]<i)return 1===n?0:1;if(t[r]>i&&s[r]>i)return 1===n?1:0;const a=(s[o]-t[o])/(s[r]-t[r]),l=t[o]+a*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(Y,t[0],t[0])&&q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(Y,t[r],i)){case 1:q(e,i);break;case 3:q(e,(0,R.o8)(Y));break;case 2:q(e,(0,R.o8)(Y)),q(e,i)}}}}function q(e,t){0!==e.length&&(0,A.aI)(e.at(-1),t)||e.push(t)}const Y=(0,R.vt)();var X=r(11964),K=r(27921);const J=(0,_.vt)(),Q=(0,_.vt)();function ee(){return{direction:(0,_.vt)(),up:(0,_.vt)()}}function te(e,t,r,i,n){let o=(0,v.S8)(J,e),s=(0,v.Om)(o,i);const a=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,v.Om)(t,i)),s<.99?((0,v.C)(o,t),a&&(0,v.hs)(o,o,-1)):o=null);let l=0;if(o){(0,v.hs)(Q,i,(0,v.Om)(i,o)),(0,v.Re)(o,o,Q);const e=(0,v.Om)(o,n)/((0,v.Bw)(o)*(0,v.Bw)(n));(0,v.$A)(Q,o,n),l=((0,v.Om)(Q,i)>0?1:-1)*(0,u.KJ)((0,u.XM)(e))}const c=(0,u.KJ)((0,u.XM)(-(0,v.Om)(i,e)/(0,v.Bw)(e)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}function re(e,t,r,i){(0,v.Re)(ie,r,t),(0,K.T7)(i,(0,X.LV)(t,ie),e)||e===r||(0,v.C)(e,r)}const ie=(0,_.vt)(),ne=(0,_.fA)(0,1,0),oe=(0,_.fA)(0,0,1),se=(0,g.vt)(),ae=(0,_.vt)(),le=(0,_.vt)();function ce(e,t,r,i=ee()){const{direction:n,up:o}=i;return(0,E.N9)(se,-(0,u.kU)(t)),(0,E.eL)(se,se,(0,u.kU)(r)),(0,v.Z0)(n,oe,se),(0,v.hs)(n,n,-1),(0,v.Z0)(o,ne,se),i}function ue(e,t,r,i,n){const o=t.lines[11].direction,s=(n-r.getAltitude(i))/o[2];(0,v.Ln)(e,i,o,s)}const de=(0,_.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return te(t,r,i,oe,ne)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=ce(0,r,i),o=(0,_.vt)();return(0,v.hs)(o,n.direction,-t),(0,v.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,u.kU)(e)},headingTiltToDirectionUp:ce,lookAtTiltToEyeTilt:function(e){return(0,u.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,s=e.state.camera.eye,a=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,T.LV)(t.origin,t.direction),n,de)||ue(de,r,i,t.endpoint,n),re(de,s,de,l),a.push((0,R.fA)(de[0],de[1]))}return function(e,t,r){const i=e.map(e=>((0,v.hZ)(de,e[0],e[1],0),t.fromRenderCoords(de,de,r),[de[0],de[1]]));return i.length<=2?new W.A({spatialReference:r}):(i.push(i[0].slice()),(0,$.$3)(i)||i.reverse(),new W.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return Z(r,e,t,0),Z(i,r,t,1),Z(r,i,t,2),Z(i,r,t,3),i}(a,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,s=e.spatialReference??t.spatialReference;return(0,b.g)(t,ae,o),(0,b.g)(t,le,o),ae[0]-=r/2,le[0]+=r/2,ae[1]-=i/2,le[1]+=i/2,(0,w.F)(ae,o,ae,s),(0,w.F)(le,o,le,s),n?(n.xmin=ae[0],n.ymin=ae[1],n.xmax=le[0],n.ymax=le[1],n.spatialReference=s):n=new k.A(ae[0],ae[1],le[0],le[1],s),n}},Symbol.toStringTag,{value:"Module"}));var he=r(34304),me=r(17136),pe=r(94008),fe=r(28735);class ge{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(e){this.renderCoordsHelper=e,this.frustum=(0,F.vt)(),this._points=(0,F.Qy)(),this.lines=new Array(12),this._origin=(0,_.vt)(),this._direction=(0,_.vt)(),this._boundingSphere=new pe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,_.vt)(),endpoint:null}}update(e){(0,F.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,v.C)(this._origin,e.eye),(0,v.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,v.C)(this._points[t],e[t]);(0,F.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,F.m7)(this.frustum,e)}intersectsRay(e){return(0,F.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,F.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,F.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ve(this.lines[t],e[t],e[r]),ve(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ve(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=xe;(0,v.S8)(t,this.direction);const r=_e;(0,v.jb)(r,this.points[4],e);const i=.5*(0,v.Om)(r,r)/(0,v.Om)(t,r),n=this._boundingSphere,o=(0,v.Ln)(be,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=F.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ve(e,t,r){e.origin=t,e.endpoint=r,(0,v.oW)(e.direction,t,r)}const _e=(0,_.vt)(),xe=(0,_.vt)(),be=(0,_.vt)();r(86211);const we=(0,_.fA)(5802e-9,13558e-9,331e-7),ye=(0,_.fA)(65e-8*3,5643e-9,255e-9);(0,_.fA)(we[0]+ye[0],we[1]+ye[1],we[2]+ye[2]);class Te{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Te(0,0)}static{this.Infinite=new Te}}(0,_.vt)(),(0,_.vt)(),new pe.iy,(0,T.vt)(),new k.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Me=r(32728);const Se=(0,_.fA)(0,0,1),Ce=(0,v.S8)((0,_.vt)(),(0,_.fA)(1,1,1)),Ee=(0,g.vt)(),Ae=(0,_.vt)(),Re=(0,_.vt)();function Ie(e,t,r,i=ee()){(0,v.$A)(Ae,e,Se),0===(0,v.Om)(Ae,Ae)&&(0,v.$A)(Ae,e,Ce),(0,E.$0)(Ee,-(0,u.kU)(t),e),(0,E.e$)(Ee,Ee,-(0,u.kU)(r),Ae);const{up:n,direction:o}=i;return(0,v.$A)(n,Ae,e),(0,v.S8)(n,n),(0,v.Z0)(n,n,Ee),(0,v.S8)(o,e),(0,v.ze)(o,o),(0,v.Z0)(o,o,Ee),i}function Oe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Fe(e,t){const r=Ie(t,e.heading,e.tilt);return e.up=r.up,e}function Pe(e,t){const r=[],i=[],n=(0,he.FD)();for(let o=0;o<e.length;o++){const s=e[o],a=o===e.length-1?e[0]:e[o+1],l=(0,X.Cr)(s,a,Ge),c=(0,K.vE)(t,l.origin,l.vector,0,ze);switch(c){case 2:r.push(s);break;case 3:i.push(s);break;case 0:case 1:{const[e,o,a]=0===c?[1,r,i]:[-1,i,r],l=(0,K.Qj)(t),u=(0,v.Ln)((0,_.vt)(),ze,l,e*n),d=(0,v.Ln)((0,_.vt)(),ze,l,e*-n);o.push(s),o.push(u),a.push(d)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const De={minCurvature:(0,u.kU)(5),maxCurvature:(0,u.kU)(50),minSamples:1,maxSamples:6},Ne=(0,_.fA)(1,0,0),Be=(0,_.fA)(0,1,0),He=(0,_.vt)(),Le=(0,_.vt)(),ze=(0,_.vt)(),Ue=new pe.iy,Ge=(0,X.vt)(),je=(0,O.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Ae,o=Re;return(0,v.S8)(n,e),(0,v.$A)(Re,n,Se),0===(0,v.Om)(Re,Re)&&(0,v.$A)(Re,n,Ce),(0,v.$A)(o,Re,n),te(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,_.vt)(),up:null,tilt:i,heading:r},o=Ae;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,a=(0,u.kU)(r),l=(0,u.kU)(i),c=Math.sin(a),d=Math.cos(a),h=Math.sin(l),m=Math.cos(l),p=(0,v.Bw)(o);let f;if(Math.abs(l)<1e-8)f=s+p;else{const e=p/h,t=(0,u.YN)(s/e),r=Math.PI-l-t;f=e*Math.sin(r)}const g=m*s,x=s*s*(h*h),b=d*d*x,w=f-g,y=w*w,T=b*(b+y-o[1]*o[1]);if(T<0)return(0,v.hs)(n.eye,o,f/p),n.tilt=0,Fe(n,e);const M=Math.sqrt(T),S=o[1]*w,C=b+y;let E;if(E=d>0?-M+S:M+S,Math.abs(C)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,v.hs)(n.eye,o,f/p),n.tilt=0,Oe(n.eye),Fe(n,e);n.eye[1]=E/C;const A=c*c*x,R=h*s,I=d*R*n.eye[1],O=n.eye[1]*n.eye[1],F=1-O,P=Math.sqrt(F),D=b*O+A-2*I*P*w+F*y;return Math.abs(D)<1e-8?((0,v.hs)(n.eye,o,f/p),n.tilt=0,Oe(n.eye),Fe(n,e)):(n.eye[0]=(F*(f*o[0]-g*o[0])-R*P*(o[0]*n.eye[1]*d+o[2]*c))/D,n.eye[2]=(F*(f*o[2]-g*o[2])-R*P*(o[2]*n.eye[1]*d-o[0]*c))/D,(0,v.hs)(n.eye,n.eye,f),Oe(n.eye),Fe(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,u.kU)(e),n=(0,v.Bw)(t);return(0,u.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Ie,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,v.Bw)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,u.YN)(r/(n/Math.sin(e)));return(0,u.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new ge(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,a=r.referenceEllipsoid.radius,l=i.eye,c=1+(0,v.Io)(l,t)/(a+o),d=Math.sqrt(c*c-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=De,g=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return Ue.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(Ue,t)}(e),x=(0,u.qE)((d-h)/(m-h),0,1),b=Math.round((0,u.Cc)(p,f,x)),w=i.aboveGround,y=n.planes[5],M=[],S=(0,K.O_)(_.uY,Ne,(0,K.vt)()),C=(0,K.O_)(_.uY,Be,(0,K.vt)());(0,I.hZ)(je,0,0,0,0);const E=e=>{};for(let e=0;e<4;e++){const t=1===e&&!w||3===e&&w?1-g:0,i=1===e&&w||3===e&&!w?g:1,s=n.lines[e],a=n.lines[3===e?0:e+1];for(let n=0;n<b;n++){const c=n/b,d=0===n?0:(0,u.Cc)(t,i,1===e?1-(1-c)**2:3===e?c**2:c),h=(0,v.Cc)(Le,s.origin,a.origin,d),m=(0,Me.nu)(s.direction,a.direction,d,He);r.intersectManifoldClosestSilhouette((0,T.LV)(h,m),o,ze),re(ze,l,ze,y),M.push((0,_.o8)(ze)),0!==M.length&&E((0,v.lo)(M.at(-1),ze));const p=((0,K.Tj)(S,ze)?1:0)|((0,K.Tj)(C,ze)?2:0);je[p]=1}}M.length>2&&(0,v.lo)(M[0],M.at(-1));const A=function(e,t,r){const i=2*(0,he.FD)();return e.map(e=>{const n=[];let o=!1;for(const s of e)t.fromRenderCoords(s,ze,r),Math.abs(s[0])<i&&Math.abs(s[1])<i?(n.push([null,ze[1]]),n.push([null,ze[1]]),o=!0):n.push([ze[0],ze[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,$.$3)(n)||n.reverse(),n})}((0,I.m3)(je)>1?function(e,t){const r=[];for(const i of e)r.push(...Pe(i,t));return r}(Pe(M,S),C):[M],r,s);return new W.A({rings:A,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,a,c;const d=t.latitude,h=(0,y.tO)(e.spatialReference).radius,m=t.longitude,p=function(e,t,r){const i=t/r,n=(0,u.kU)(e),o=Math.sin(i/2),s=Math.cos(n),a=2*(0,u.YN)(Math.sqrt(o*o/(s*s)));return(0,u.KJ)(a)}(d,r,h)/2;o=m-p,s=m+p;const f=(0,u.kU)(d),g=(1+Math.sin(f))/(1-Math.sin(f)),v=(g+1)*Math.tan(i/h/2),_=v*v;function b(e){const t=Math.PI/2;return(e=l.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(a=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*g+_))),c=a+i/h,a=b(a),c=b(c),c<a){const e=c;c=a,a=e}if(a=Math.max((0,u.KJ)(a),-90),c=Math.min((0,u.KJ)(c),90),s=me.Y_.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:x.A.WGS84;return n?(n.xmin=o,n.ymin=a,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new k.A(o,a,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,fe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Ve={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},ke=[Ve.FINAL,Ve.COMPOSITE,Ve.OPAQUE,Ve.TRANSPARENT],We={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GROUND_DEPTH:"ground-depth",PRE_TRANSPARENT:"pre-transparent",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VIEWSHED:"viewshed"};Array.from(Object.values(We)).concat(ke),(0,_.vt)()},94401(e,t,r){r.d(t,{A:()=>P});var i=r(5482),n=r(69622),o=r(49186),s=r(36708),a=r(10107),l=r(64108),c=r(14239),u=r(44208),d=r(53966),h=(r(17676),r(94656)),m=r(63907);r(93637),r(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,u.A)("esri-tests-disable-gpu-memory-measurements"),(0,h.en)();(0,h.en)();r(90644);var p=r(76284),f=r(97768),g=r(48852),v=r(42293);const _=!!(0,u.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(m.vt.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:s}=t;s?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return _?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,v.MW)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m.vt.Renderbuffer,this),this._context=null)}}class b{constructor(e,t,r){if(this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m.vt.FramebufferObject,this),null!=t){const r=function(e,t){return w(t)||y(t)?t:T(t)?new p.A(e,t):function(e){return 3===M(e)||null!=e&&"samples"in e}(t)?new x(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(m.r6,r),w(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(m.r6)}if(null!=r)if(function(e){return w(e)||T(e)}(r))this._depthStencilTexture=w(r)?r:new p.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=y(r)?r:new x(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}dispose(){const{_colorAttachments:e,_glName:t}=this;if(0===e.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;const{_context:r}=this,i=r.getBoundFramebufferObject(),n=Array.from(e.values());this.detachColorTextures(...e.keys()),n.forEach(e=>e.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),r.gl.deleteFramebuffer(t),this._glName=null,r.bindFramebuffer(i===this?null:i),r.instanceCounter.decrement(m.vt.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(m.r6);return w(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.r6)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.r6)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&w(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=m.r6){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=m.r6){const t=this._colorAttachments.get(e);if(!t)return;const r=w(t);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._initialized){const t=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{e.forEach(e=>{w(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=m.r6,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,0,r):this._framebufferTexture2D(i.glName,t,e,36160,0))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===m.ld.UNSIGNED_INT_24_8?6402!==r||i===m.ld.UNSIGNED_INT||i===m.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,E(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):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 e=this._depthStencilTexture;return e&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,E(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){const{_context:t}=this,r=t.getBoundFramebufferObject();t.bindFramebuffer(this);const{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebufferObject(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,s){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const a=s.descriptor;3553!==s.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||e+r>this.width||t+i>this.height||n+r>a.width||o+i>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(s,p.A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(p.A.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),l.bindTexture(c,p.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,s){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),s||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,s)}async readPixelsAsync(e,t,r,i,n,o,s){const{gl:a}=this._context,l=g.g.createPixelPack(this._context,35041,s.byteLength);this._context.bindBuffer(l);const c=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),a.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(c),await l.getSubDataAsync(s),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(S(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(S(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,h.en)())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((t,r)=>{if(w(t)){const i=C(t);35866===i?this._framebufferTextureLayer(t.glName,r,e,0,0):this._framebufferTexture2D(t.glName,r,i,e)}else if(y(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=E(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,C(this._depthStencilTexture),e)}(0,h.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.r6,r=3553,i=36160,n=0){this._context.gl.framebufferTexture2D(i,t,r,e,n)}_framebufferTextureLayer(e,t=m.r6,r=36160,i=0,n=0){this._context.gl.framebufferTextureLayer(r,t,e,i,n)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,f.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,E(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,f.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),S(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){S(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.SB.DEPTH_COMPONENT16:case m.SB.DEPTH_COMPONENT24:case m.SB.DEPTH_COMPONENT32F:return m.xL;case m.iE.DEPTH24_STENCIL8:case m.iE.DEPTH32F_STENCIL8:return m.nI;case 36168:return m.uH;default:return m.r6}}_validateColorAttachmentPoint(e){if(-1===b._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;b._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const t=e-m.r6;t+1>b._MAX_COLOR_ATTACHMENTS&&d.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${b._MAX_COLOR_ATTACHMENTS} color attachments`)}}function w(e){return 1===M(e)}function y(e){return 2===M(e)}function T(e){return 0===M(e)}function M(e){return null!=e&&"type"in e?e.type:null}function S(e,t){const r=Math.max(e.width,e.height);if(r>t){d.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function E(e){return 6402===e?m.xL:m.nI}r(67171),r(21818),r(69397);var A=r(85079),R=r(74038);const I=[new R._("position",2,m.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,m.pe.BYTE,0,2),new R._("a_pos",2,m.pe.BYTE,0,4),new R._("a_tex",2,m.pe.BYTE,2,4),(0,A.Xk)(I),r(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 F=class extends n.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=c.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,s.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},s.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new o.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 e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){var t;e.initializeAndBind(),this.gl.drawBuffers((t=e)?t.colorAttachments.length>0?t.colorAttachments:[m.$0]:[m.C5])}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);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(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}};(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],F.prototype,"view",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],F.prototype,"consumes",void 0),(0,i.Cg)([(0,a.MZ)()],F.prototype,"produces",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],F.prototype,"techniques",null),F=(0,i.Cg)([(0,l.$)("esri.views.3d.webgl.RenderNode")],F);const P=F},48852(e,t,r){r.d(t,{g:()=>d});var i=r(4576),n=r(44208),o=r(53966),s=r(34275),a=r(94656),l=r(63907);const c=()=>o.A.getLogger("esri.views.webgl.BufferObject"),u=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class d{static createIndex(e,t,r){return new d(e,34963,t,r)}static createUniform(e,t,r){return new d(e,35345,t,r)}static createPixelPack(e,t=35041,r){const i=new d(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new d(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){const i=new d(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(l.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case l.pe.UNSIGNED_INT:return this._sizeBytes/4;case l.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case l.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(l.vt.BufferObject,this),this._context=null):this._glName&&c().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case l.pe.UNSIGNED_SHORT:e*=2;break;case l.pe.UNSIGNED_INT:e*=4;case l.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;const t=e.byteLength;34963===this.bufferType&&((0,s.mg)(e)?this._indexType=l.pe.UNSIGNED_BYTE:(0,s.jq)(e)?this._indexType=l.pe.UNSIGNED_SHORT:(0,s.XJ)(e)&&(this._indexType=l.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,a.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,a.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;const o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&c().warn("Potential problem getting subdata: requested data exceeds buffer size!");const s=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),s.getBufferSubData(35982,t,e,r,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),s.getBufferSubData(36662,t,e,r,n),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i){await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)}}},65786(e,t,r){r.d(t,{Y:()=>i});const i=class{};new i},14113(e,t,r){r.d(t,{N5:()=>a});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class a extends s{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new h,this.varyings=new m,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),s=n.code.generateSource(),a=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?v:g,u=n.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${s.join("\n")}\n${a.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let s=0;s<i;++s)r[s](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class d extends s{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new u(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"uint":i=f._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])}, ${f._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#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 "},76284(e,t,r){r.d(t,{A:()=>M});var i=r(49186),n=r(44208),o=r(53966),s=r(97768),a=r(93637),l=r(17676),c=r(94656),u=r(63907),d=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(p(n)||f(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,a.a4)(u.SB,e)}function f(e){return(0,a.a4)(u.iE,e)}function g(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!g(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function b(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case 6408:return u.H0.RGBA32F;case 6407:return u.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return u.H0.RGBA8;case 6407:return u.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?u.iE.DEPTH24_STENCIL8:6402===t?u.SB.DEPTH_COMPONENT24:t,e.internalFormat}class w extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R32F:case u.H0.R8_SNORM:case u.H0.R8:this.pixelFormat=6403;break;case u.H0.R8I:case u.H0.R8UI:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32I:case u.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new w(e,t)}}const y=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),T=()=>o.A.getLogger("esri/views/webgl/Texture");class M{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=w.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,d.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(u.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!g(e)&&this._descriptor.internalFormat&&(0,a.a4)(u.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!g(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,n,o,s,a=0){s||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=b(l);const{context:c,pixelFormat:u,dataType:d,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+n>l.width||r+o>l.height)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;a&&(n&&o||T().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,a)),v(s)?f.texSubImage2D(h,e,t,r,n,o,u,d,s):g(s)?f.compressedTexSubImage2D(h,e,t,r,n,o,l.internalFormat,s.levels[e]):f.texSubImage2D(h,e,t,r,n,o,u,d,s),a&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,M.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,n,o,s,a,l){l||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=b(c);const{context:u,pixelFormat:d,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||T().warn("Attempting to set 3D texture data on a non-3D texture");const f=u.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||n<0||t+o>c.width||r+s>c.height||n+a>c.depth)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=u;if(g(l))l=l.levels[e],v.compressedTexSubImage3D(p,e,t,r,n,o,s,a,c.internalFormat,l);else{const i=l;v.texSubImage3D(p,e,t,r,n,o,s,a,d,h,i)}u.bindTexture(f,M.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,M.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(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,s.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,n=r.context?.gl;if(!n)return;(0,c.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),r.context.instanceCounter.increment(u.vt.Texture,this)),m(r);const o=r.context.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(n);const s=t??r.target,l=_(s);if(v(e))this._setDataFromTexImageSource(e,s);else{const{width:t,height:o,depth:d}=r;if(null==t||null==o)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==d)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=b(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,r.internalFormat,r.hasMipmap,t,o,d),g(e)){if(!function(e){return null!=e&&(0,a.a4)(u.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,s)}else this._texImage(s,0,r.internalFormat,t,o,d,e),(0,c.Y2)(n),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(n),r.context.bindTexture(o,M.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=b(i);const n=_(t),{width:o,height:s,depth:a}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=s),n&&i.depth,n&&(i.depth=a),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,s,a),this._texImage(t,0,i.internalFormat,o,s,a,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:s}=i,a=e.levels,l=x(r,n,o,s),c=Math.min(l,a.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,n,o)=>{const s=a[Math.min(e,a.length-1)];this._compressedTexImage(r,e,t,i,n,o,s)},c)}_texStorage(e,t,r,n,o,s){const{gl:a}=this._descriptor.context;if(!function(e){return u.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,n,o,s):1;if(_(e)){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(e,l,t,n,o,s)}else a.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,s,a){const l=this._descriptor.context.gl,c=_(e),{isImmutable:u,pixelFormat:d,dataType:h}=this._descriptor;if(u){if(null!=a){const r=a;if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,s,d,h,r)}else l.texSubImage2D(e,t,0,0,n,o,d,h,r)}}else{const u=a;if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,s,0,d,h,u)}else l.texImage2D(e,t,r,n,o,0,d,h,u)}}_compressedTexImage(e,t,r,n,o,s,a){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=a)if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,s,r,a)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,a)}else if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,s,0,a)}else l.compressedTexImage2D(e,t,r,n,o,0,a)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:n,preMultiplyAlpha:o,hasMipmap:s}=this._descriptor,a=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:d}=i.capabilities;if(!M.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!u&&!d)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,a?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:n?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:o,hasMipmap:s,hasETC:!!u,hasS3TC:!!d},a=await M.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),a.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||T().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:s,target:a}=this._descriptor;const l=32879===a;if(null==r||null==n||l&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),s&&(1!==r||1!==n||l&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},67171(e,t,r){r.d(t,{R:()=>o,e:()=>s});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.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 s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.MW)(e.internalFormat))*(34067===e.target?6:1))}},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},42293(e,t,r){r.d(t,{MW:()=>l,wH:()=>a,yu:()=>s});var i=r(94656),n=r(63907);const o=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function s(e,t,r,n=0){const s=e.gl;e.bindBuffer(r);for(const a of r.layout){const r=t.get(a.name);if(null==r){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const l=n*a.stride;if(a.count<=4)a.integer&&o.has(a.type)?s.vertexAttribIPointer(r,a.count,a.type,a.stride,a.offset+l):s.vertexAttribPointer(r,a.count,a.type,a.normalized,a.stride,a.offset+l),s.enableVertexAttribArray(r),a.divisor>0&&s.vertexAttribDivisor(r,a.divisor);else if(9===a.count)for(let e=0;e<3;e++)s.vertexAttribPointer(r+e,3,a.type,a.normalized,a.stride,a.offset+12*e+l),s.enableVertexAttribArray(r+e),a.divisor>0&&s.vertexAttribDivisor(r+e,a.divisor);else if(16===a.count)for(let e=0;e<4;e++)s.vertexAttribPointer(r+e,4,a.type,a.normalized,a.stride,a.offset+16*e+l),s.enableVertexAttribArray(r+e),a.divisor>0&&s.vertexAttribDivisor(r+e,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,i.en)()){const t=(0,i.u1)(e.gl);t&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${l}:`,t,a)}}}function a(e){switch(e){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 l(e){switch(e){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}},85079(e,t,r){r.d(t,{Sk:()=>s,Xk:()=>n,_u:()=>o});var i=r(21818);function n(e){let t=0;return(0,i.z)(new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i})))}function o(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}function s(e){return o(Array.from(e.values()).map(({layout:e})=>e))}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},74038(e,t,r){r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,s=0,a=!1){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=s,this.integer=a}}},94656(e,t,r){r.d(t,{Y2:()=>c,en:()=>l,u1:()=>s});var i=r(49186),n=r(44208),o=r(53966);function s(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.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 e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function l(){return a}function c(e,t=l()){if(t){const t=s(e);if(t){const e=(new Error).stack;o.A.getLogger("esri.views.webgl.checkWebGLError").error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},63907(e,t,r){r.d(t,{$0:()=>h,C5:()=>d,CQ:()=>v,H0:()=>o,SB:()=>l,WR:()=>i,XN:()=>s,iE:()=>a,ld:()=>c,nI:()=>p,pe:()=>n,r6:()=>m,uH:()=>g,vt:()=>u,xL:()=>f});const i={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},o={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},s=Object.values(o),a={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},l={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},c={FLOAT:n.FLOAT,UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:n.BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,SHORT:n.SHORT,UNSIGNED_INT:n.UNSIGNED_INT,INT:n.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},u={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},d=1029,h=0,m=36064,p=33306,f=36096,g=36128,v={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},90644(e,t,r){function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}r.d(t,{Ey:()=>w,RC:()=>s,T8:()=>a,Uy:()=>d,Xt:()=>u,iD:()=>o,kn:()=>h,p3:()=>n}),r(4718);const o=i(0,771),s=(i(1,0),i(1,1),i(1,771)),a=n(770,1,771,771),l=(n(0,0,768,1),{face:1029,mode:2305}),c={face:1028,mode:2305},u=e=>2===e?l:1===e?c:null,d={zNear:0,zFar:1},h={r:!0,g:!0,b:!0,a:!0};function m(e){return M.intern(e)}function p(e){return C.intern(e)}function f(e){return A.intern(e)}function g(e){return I.intern(e)}function v(e){return F.intern(e)}function _(e){return D.intern(e)}function x(e){return B.intern(e)}function b(e){return L.intern(e)}function w(e){return U.intern(e)}class y{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function T(e){return"["+e.join(",")+"]"}const M=new y(S,e=>({__tag:"Blending",...e}));function S(e){return e?T([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const C=new y(E,e=>({__tag:"Culling",...e}));function E(e){return e?T([e.face,e.mode]):null}const A=new y(R,e=>({__tag:"PolygonOffset",...e}));function R(e){return e?T([e.factor,e.units]):null}const I=new y(O,e=>({__tag:"DepthTest",...e}));function O(e){return e?T([e.func]):null}const F=new y(P,e=>({__tag:"StencilTest",...e}));function P(e){return e?T([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const D=new y(N,e=>({__tag:"DepthWrite",...e}));function N(e){return e?T([e.zNear,e.zFar]):null}const B=new y(H,e=>({__tag:"ColorWrite",...e}));function H(e){return e?T([e.r,e.g,e.b,e.a]):null}const L=new y(z,e=>({__tag:"StencilWrite",...e}));function z(e){return e?T([e.mask]):null}const U=new y(function(e){return e?T([S(e.blending),E(e.culling),R(e.polygonOffset),O(e.depthTest),P(e.stencilTest),N(e.depthWrite),H(e.colorWrite),z(e.stencilWrite)]):null},e=>({blending:m(e.blending),culling:p(e.culling),polygonOffset:f(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:_(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:b(e.stencilWrite)}))},49788(e,t,r){r.d(t,{Q:()=>i});const i=1/255.5}}]);
|