@arcgis/core 5.2.0-next.64 → 5.2.0-next.65

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.
Files changed (90) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{bb95922cd4631d6f17fb.js → 04ac5ac6f592d8c34bbd.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{0977f4d77c36175c2895.js → 3ddd717ea12d9823eee2.js} +1 -1
  4. package/assets/esri/core/workers/chunks/5adf16c034a590b5e9f5.js +1 -0
  5. package/assets/esri/core/workers/chunks/{57824ecc10b25e3ad794.js → 903e1cd8b76eff19ebdf.js} +1 -1
  6. package/assets/esri/core/workers/chunks/93c0a620a147cbf4a0ba.js +1 -0
  7. package/assets/esri/core/workers/chunks/9be6827e5756031a56c1.js +1 -0
  8. package/assets/esri/core/workers/chunks/a52c88e2d837b525ff6c.js +1 -0
  9. package/assets/esri/core/workers/chunks/{771ead806efbe9c91fdc.js → a5fdb02b1714e93fa69e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/b4e5ee81b9eb171499a6.js +1 -0
  11. package/assets/esri/core/workers/chunks/bece22668622a9a6bfe2.js +1 -0
  12. package/assets/esri/core/workers/chunks/c02ae1d40c1fe95ae6c5.js +1 -0
  13. package/assets/esri/core/workers/chunks/d51c41c1944df0cbab3e.js +1 -0
  14. package/assets/esri/core/workers/chunks/d583bcea4d1a21da9147.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ef27bf1d7941ae265ca4.js → d7267f429a051943187b.js} +1 -1
  16. package/assets/esri/core/workers/chunks/d9c78c2db04a06ee83ed.js +1 -0
  17. package/assets/esri/core/workers/chunks/{c1e45e24f5ef719a714c.js → dc7e4f7879debf557e46.js} +143 -95
  18. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  19. package/chunks/Component.glsl.js +60 -62
  20. package/chunks/DefaultMaterial.glsl.js +27 -28
  21. package/chunks/GaussianSplat.glsl.js +7 -7
  22. package/chunks/GaussianSplatShadow.glsl.js +9 -9
  23. package/chunks/GlobalIllumination.glsl.js +35 -15
  24. package/chunks/Path.glsl.js +7 -6
  25. package/chunks/RealisticTree.glsl.js +22 -24
  26. package/chunks/SSAO.glsl.js +1 -1
  27. package/chunks/Terrain.glsl.js +3 -2
  28. package/chunks/Water.glsl.js +20 -11
  29. package/chunks/_commonjsHelpers.js +1 -1
  30. package/chunks/bundle2.js +1 -1
  31. package/config.js +1 -1
  32. package/kernel.js +1 -1
  33. package/layers/graphics/sources/ParquetSource.js +1 -1
  34. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  35. package/layers/graphics/sources/parquet/ParquetFileInfo.js +1 -1
  36. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  37. package/layers/raster/datasets/EphemeralBlockCache.js +1 -1
  38. package/layers/raster/datasets/RawBlockCache.js +1 -1
  39. package/layers/support/KMLSublayer.js +1 -1
  40. package/layers/video/VideoController.js +1 -1
  41. package/libs/parquet/parquet.js +1 -1
  42. package/package.json +1 -1
  43. package/rest/support/Query.js +1 -1
  44. package/support/revision.js +1 -1
  45. package/symbols/LabelSymbol3D.js +1 -1
  46. package/symbols/LineSymbol3D.js +1 -1
  47. package/symbols/MeshSymbol3D.js +1 -1
  48. package/symbols/PointSymbol3D.js +1 -1
  49. package/symbols/PolygonSymbol3D.js +1 -1
  50. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  51. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  52. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  53. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  54. package/views/3d/state/controllers/RotateController.js +1 -1
  55. package/views/3d/state/utils/navigationUtils.js +1 -1
  56. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  57. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  58. package/views/3d/terrain/OverlayRenderer.js +1 -1
  59. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +24 -16
  60. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +25 -0
  61. package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +2 -0
  62. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  63. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  64. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  65. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  66. package/views/3d/webgl-engine/shaders/GaussianSplatPassParameters.js +2 -0
  67. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  68. package/views/3d/webgl-engine/shaders/GaussianSplatShadowTechnique.js +1 -1
  69. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  70. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  71. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  72. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  73. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  74. package/widgets/LayerList/ListItem.js +1 -1
  75. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  76. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  77. package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
  78. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  79. package/widgets/OrientedImageryViewer.js +1 -1
  80. package/widgets/TableList/ListItem.js +1 -1
  81. package/assets/esri/core/workers/chunks/43b39abd49c4a8ce891f.js +0 -1
  82. package/assets/esri/core/workers/chunks/5dbd8ca7e7b8eb9a0bf7.js +0 -1
  83. package/assets/esri/core/workers/chunks/6123894e2ae9233cdf89.js +0 -1
  84. package/assets/esri/core/workers/chunks/6b536d03b4bef408035b.js +0 -1
  85. package/assets/esri/core/workers/chunks/6c98a64d92c9bca78203.js +0 -1
  86. package/assets/esri/core/workers/chunks/78b80da3bbc1b608fe83.js +0 -1
  87. package/assets/esri/core/workers/chunks/7d85048c6cd6ad84faf9.js +0 -1
  88. package/assets/esri/core/workers/chunks/9008090a5d8431ddfa22.js +0 -1
  89. package/assets/esri/core/workers/chunks/a2d8bc0efddd2e13b1ad.js +0 -1
  90. package/assets/esri/core/workers/chunks/c97451f75c23be979476.js +0 -1
@@ -1,20 +1,14 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9578],{28491(e,t,r){r.d(t,{b:()=>A});var o=r(32680),a=r(49255),n=r(34711),i=r(76597),s=r(24321),l=r(2585),c=r(43519),u=r(96336),d=r(39014),h=r(53466),m=r(92700),p=r(72824),f=r(35640),v=r(9169),g=r(77695),x=r(72233),b=r(32971),y=r(98619),w=r(62602),M=r(22393),S=r(59469),T=r(32482),C=r(51406),_=r(43259),I=r(58614),P=r(27950),O=r(77949),z=r(33079),R=r(71988),D=r(20304),j=r(31821),F=r(63761),E=r(27832),B=r(43616),H=r(47630),W=r(14113),N=r(49788);function A(e){const t=new W.N5,{attributes:r,vertex:A,fragment:G,varyings:L}=t,{output:V,normalType:k,offsetBackfaces:U,spherical:$,snowCover:q,pbrMode:Z,textureAlphaPremultiplied:Y,instancedDoublePrecision:J,hasVertexColors:K,hasVertexTangents:X,hasColorTexture:Q,hasNormalTexture:ee,hasNormalTextureTransform:te,hasColorTextureTransform:re}=e;if((0,O.NB)(A,e),r.add("position","vec3"),A.inputs.add("position",()=>"position"),L.add("vpos","vec3",{invariant:!0}),t.include(_.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(C.q2,e),!(0,a._o)(V))return t.include(v.E,e),t;t.include(C.Sx,e),t.include(C.MU,e),t.include(C.O1,e),t.include(C.QM,e),(0,O.yu)(A,e),t.include(u.Y,e),t.include(i.d);const oe=0===k||1===k;return oe&&U&&t.include(o.M),t.include(g.J,e),t.include(p.Mh,e),t.include(s.v,e),L.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(d.K,e),t.include(m.c,e),A.uniforms.add(new R.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),L.add("vcolorExt","vec4"),A.include(c.WD),A.include(c.oF),t.include(J?T.QH:T.LA,e),A.main.add(j.H`
2
- forwardVertexColor();
3
-
4
- MaskedColor maskedColor =
5
- applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
6
-
7
- vcolorExt = maskedColor.color;
8
- forwardColorMixMode(maskedColor.mask);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9578],{28491(e,t,r){r.d(t,{b:()=>D});var o=r(32680),a=r(49255),n=r(34711),i=r(76597),s=r(2585),l=r(96336),c=r(53466),u=r(72824),d=r(35640),h=r(9169),m=r(77068),p=r(77695),f=r(72233),v=r(32971),g=r(98619),x=r(62602),b=r(22393),y=r(59469),w=r(32482),M=r(51406),S=r(43259),T=r(58614),C=r(77949),_=r(33079),I=r(31821),P=r(63761),O=r(27832),z=r(47630),R=r(14113);function D(e){const t=new R.N5,{attributes:r,vertex:D,fragment:j,varyings:F}=t,{output:E,normalType:B,offsetBackfaces:H,spherical:W,snowCover:N,pbrMode:A,textureAlphaPremultiplied:G,instancedDoublePrecision:L,hasVertexColors:V,hasVertexTangents:k,hasColorTexture:U,hasNormalTexture:$,hasNormalTextureTransform:q,hasColorTextureTransform:Z}=e;if((0,C.NB)(D,e),r.add("position","vec3"),D.inputs.add("position",()=>"position"),F.add("vpos","vec3",{invariant:!0}),t.include(S.A,e),t.include(s.B,e),t.include(d.Ge,e),t.include(M.q2,e),!(0,a._o)(E))return t.include(h.E,e),t;t.include(M.Sx,e),t.include(M.MU,e),t.include(M.O1,e),t.include(M.QM,e),(0,C.yu)(D,e),t.include(l.Y,e),t.include(i.d);const Y=0===B||1===B;return Y&&H&&t.include(o.M),t.include(p.J,e),t.include(u.Mh,e),F.add("vPositionLocal","vec3"),t.include(c.U,e),t.include(m.F,e),t.include(L?w.QH:w.LA,e),D.main.add(I.H`
2
+ forwardDefaultMaterialExternalColor();
9
3
 
10
4
  vpos = getVertexInLocalOriginSpace();
11
5
  vPositionLocal = vpos - view[3].xyz;
12
6
  vpos = subtractOrigin(vpos);
13
- ${(0,j.If)(oe,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
7
+ ${(0,I.If)(Y,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
14
8
  vpos = addVerticalOffset(vpos, localOrigin);
15
- ${(0,j.If)(X,"vTangent = dpTransformVertexTangent(tangent);")}
9
+ ${(0,I.If)(k,"vTangent = dpTransformVertexTangent(tangent);")}
16
10
  gl_Position = transformPosition(proj, view, vpos);
17
- ${(0,j.If)(oe&&U,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
11
+ ${(0,I.If)(Y&&H,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
18
12
 
19
13
  forwardTextureCoordinates();
20
14
  forwardColorUV();
@@ -23,18 +17,18 @@
23
17
  forwardOcclusionUV();
24
18
  forwardMetallicRoughnessUV();
25
19
 
26
- if (opacityMixMode != ${j.H.int(B.Um.ignore)} && vcolorExt.a < ${j.H.float(N.Q)}) {
20
+ if (shouldCullByOpacity()) {
27
21
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
28
22
  }
29
23
  forwardLinearDepthToReadShadowMap();
30
- `),G.include(b.kA,e),G.include(x.n,e),t.include(I.SS,e),G.include(n.HQ,e),t.include(H.D,e),(0,O.yu)(G,e),G.uniforms.add(A.uniforms.get("localOrigin"),new z.t("ambient",e=>e.ambient),new z.t("diffuse",e=>e.diffuse),new D.m("opacity",e=>e.opacity),new D.m("layerOpacity",e=>e.layerOpacity)),Q&&G.uniforms.add(new F.N("tex",e=>e.texture)),t.include(S._,e),G.include(M.c,e),G.include(P.N),t.include(w.r,e),G.include(E.b,e),(0,b.a8)(G),(0,b.eU)(G),(0,y.O4)(G),G.main.add(j.H`
24
+ `),j.include(v.kA,e),j.include(f.n,e),t.include(T.SS,e),j.include(n.HQ,e),t.include(z.D,e),(0,C.yu)(j,e),j.uniforms.add(D.uniforms.get("localOrigin"),new _.t("ambient",e=>e.ambient),new _.t("diffuse",e=>e.diffuse)),U&&j.uniforms.add(new P.N("tex",e=>e.texture)),t.include(y._,e),j.include(b.c,e),t.include(x.r,e),j.include(O.b,e),(0,v.a8)(j),(0,v.eU)(j),(0,g.O4)(j),j.main.add(I.H`
31
25
  discardBySlice(vpos);
32
- ${Q?j.H`
33
- vec4 texColor = texture(tex, ${re?"colorUV":"vuv0"});
34
- ${(0,j.If)(Y,"texColor.rgb /= texColor.a;")}
35
- discardOrAdjustAlpha(texColor);`:j.H`vec4 texColor = vec4(1.0);`}
26
+ ${U?I.H`
27
+ vec4 texColor = texture(tex, ${Z?"colorUV":"vuv0"});
28
+ ${(0,I.If)(G,"texColor.rgb /= texColor.a;")}
29
+ discardOrAdjustAlpha(texColor);`:I.H`vec4 texColor = vec4(1.0);`}
36
30
  shadingParams.viewDirection = normalize(vpos - cameraPosition);
37
- ${2===k?j.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:j.H`shadingParams.normalView = vNormalWorld;
31
+ ${2===B?I.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:I.H`shadingParams.normalView = vNormalWorld;
38
32
  vec3 normal = shadingNormal(shadingParams);`}
39
33
  applyPBRFactors();
40
34
  float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
@@ -45,13 +39,18 @@
45
39
  float shadow = readShadow(additionalAmbientScale, vpos);
46
40
 
47
41
  vec3 matColor = max(ambient, diffuse);
48
- vec3 albedo = mixExternalColor(${(0,j.If)(K,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
49
- float opacity_ = layerOpacity * mixExternalOpacity(${(0,j.If)(K,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
42
+ vec3 albedo = mixExternalColor(
43
+ ${(0,I.If)(V,"vColor.rgb *")} matColor,
44
+ texColor.rgb,
45
+ vExternalColor.rgb,
46
+ colorMixMode
47
+ );
48
+ float opacity_ = getDefaultMaterialOpacity(texColor.a);
50
49
 
51
- ${ee?`mat3 tangentSpace = computeTangentSpace(${X?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${te?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
52
- vec3 normalGround = ${$?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
50
+ ${$?`mat3 tangentSpace = computeTangentSpace(${k?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${q?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
51
+ vec3 normalGround = ${W?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
53
52
 
54
- ${(0,j.If)(q,j.H`
53
+ ${(0,I.If)(N,I.H`
55
54
  float snow = getSnow(normal, normalGround);
56
55
  albedo = mix(albedo, vec3(1), snow);
57
56
  shadingNormal = mix(shadingNormal, normal, snow);
@@ -59,13 +58,13 @@
59
58
 
60
59
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
61
60
 
62
- ${1===Z||2===Z?j.H`
61
+ ${1===A||2===A?I.H`
63
62
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
64
- ${(0,j.If)(q,"mrr = applySnowToMRR(mrr, snow);")}
65
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:7===Z?j.H`vec3 shadedColor = albedo;`:j.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
63
+ ${(0,I.If)(N,"mrr = applySnowToMRR(mrr, snow);")}
64
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:7===A?I.H`vec3 shadedColor = albedo;`:I.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
66
65
  vec4 finalColor = vec4(shadedColor, opacity_);
67
- outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,j.If)(q,", snow")});
68
- `),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:A},Symbol.toStringTag,{value:"Module"}));r.d(t,["D",0,G])},587(e,t,r){r.d(t,{G:()=>b,c:()=>y});var o=r(82048),a=r(92573),n=r(65261),i=r(98619),s=r(70893),l=r(34845),c=r(33094),u=r(20304),d=r(31821),h=r(58029),m=r(12791),p=r(63761),f=r(94046),v=(r(72458),r(63907)),g=r(65786),x=r(14113);class b extends g.Y{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.rayMarchMinReach=.15,this.rayMarchMaxReach=.5,this.rayMarchWorldReach=25,this.rayMarchMinReachEmissionWeight=1,this.rayMarchMaxReachEmissionWeight=1,this.rayMarchMaxSteps=16,this.colorBleedWeight=.15,this.highQualityIdleColorBlendStart=.3}}function y(e){const t=new x.N5,r=t.fragment;t.include(o.c),t.include(l.Ir),(0,i.Gc)(r),r.include(a.V),r.include(n.C),r.include(f.R),t.include(s.O,e),r.uniforms.add(new p.N("normalMap",e=>e.normalTexture),new p.N("depthMap",e=>e.depthTexture),new m.x("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new m.x("lastFrameDepthTexture",e=>e.reprojection.lastFrameDepth?.attachment),new m.x("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new m.x("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(36065)),new h.F("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new h.F("view",e=>e.camera.viewMatrix),new u.m("accumulatedFrames",e=>e.accumulatedFrames),new u.m("temporalSampleFrame",e=>e.temporalSampleFrame),new u.m("scaleGlobalIllumination",e=>e.scaleGlobalIllumination)),r.uniforms.add(new u.m("rayMarchMinReach",e=>e.rayMarchMinReach),new u.m("rayMarchMaxReach",e=>e.rayMarchMaxReach),new u.m("rayMarchWorldReach",e=>e.rayMarchWorldReach),new u.m("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new u.m("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new u.m("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new u.m("colorBleedWeight",e=>e.colorBleedWeight),new u.m("highQualityIdleColorBlendStart",e=>e.highQualityIdleColorBlendStart));const{hasEmission:g,hasColor:b}=e;return g&&r.uniforms.add(new c.U("inputScale",e=>e.reprojection.lastFrameEmission?.attachment.descriptor.internalFormat===v.H0.RGBA8?16:1),new m.x("lastFrameEmissionTexture",e=>e.reprojection.lastFrameEmission?.attachment)),r.code.add(d.H`
66
+ outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,I.If)(N,", snow")});
67
+ `),t}const j=Object.freeze(Object.defineProperty({__proto__:null,build:D},Symbol.toStringTag,{value:"Module"}));r.d(t,["D",0,j])},587(e,t,r){r.d(t,{G:()=>b,c:()=>y});var o=r(82048),a=r(92573),n=r(65261),i=r(98619),s=r(70893),l=r(34845),c=r(33094),u=r(20304),d=r(31821),h=r(58029),m=r(12791),p=r(63761),f=r(94046),v=(r(72458),r(63907)),g=r(65786),x=r(14113);class b extends g.Y{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.rayMarchMinReach=.15,this.rayMarchMaxReach=.5,this.rayMarchWorldReach=25,this.rayMarchMinReachEmissionWeight=1,this.rayMarchMaxReachEmissionWeight=1,this.rayMarchMaxSteps=16,this.colorBleedWeight=.15,this.highQualityIdleColorBlendStart=.3}}function y(e){const t=new x.N5,r=t.fragment;t.include(o.c),t.include(l.Ir),(0,i.Gc)(r),r.include(a.V),r.include(n.C),r.include(f.R),t.include(s.O,e),r.uniforms.add(new p.N("normalMap",e=>e.normalTexture),new p.N("depthMap",e=>e.depthTexture),new m.x("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new m.x("lastFrameDepthTexture",e=>e.reprojection.lastFrameDepth?.attachment),new m.x("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new m.x("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(36065)),new h.F("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new h.F("view",e=>e.camera.viewMatrix),new u.m("accumulatedFrames",e=>e.accumulatedFrames),new u.m("temporalSampleFrame",e=>e.temporalSampleFrame),new u.m("scaleGlobalIllumination",e=>e.scaleGlobalIllumination)),r.uniforms.add(new u.m("rayMarchMinReach",e=>e.rayMarchMinReach),new u.m("rayMarchMaxReach",e=>e.rayMarchMaxReach),new u.m("rayMarchWorldReach",e=>e.rayMarchWorldReach),new u.m("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new u.m("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new u.m("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new u.m("colorBleedWeight",e=>e.colorBleedWeight),new u.m("highQualityIdleColorBlendStart",e=>e.highQualityIdleColorBlendStart));const{hasEmission:g,hasColor:b}=e;return g&&r.uniforms.add(new c.U("inputScale",e=>e.reprojection.lastFrameEmission?.attachment.descriptor.internalFormat===v.H0.RGBA8?16:1),new m.x("lastFrameEmissionTexture",e=>e.reprojection.lastFrameEmission?.attachment)),r.code.add(d.H`
69
68
  float computeIdleColorBlendWeight(float accumulatedFrames) {
70
69
  float idleColorBlendProgress = clamp(
71
70
  accumulatedFrames / ${d.H.float(150)},
@@ -155,12 +154,17 @@
155
154
 
156
155
  // Get the normal of current fragment
157
156
  ivec2 iuv = ivec2(uv * vec2(textureSize(normalMap, 0)));
157
+
158
158
  vec4 normal4 = texelFetch(normalMap, iuv, 0);
159
- if (normal4.a != 1.0) {
159
+
160
+ // 0.0 alpha excludes the surface as a receiver (e.g. water)
161
+ if (normal4.a == 0.0) {
160
162
  fragGlobalIllumination = vec4(0.0, 0.0, 0.0, 1.0);
161
163
  fragWeight = vec2(0.0);
162
164
  return;
163
165
  }
166
+
167
+ float receiverOpacity = normal4.a;
164
168
  vec3 normal = normalize(normal4.xyz * 2.0 - 1.0);
165
169
 
166
170
  // Reconstruct view space position of current fragment
@@ -249,7 +253,15 @@
249
253
  rayMarchMaxSteps
250
254
  );
251
255
 
256
+ float hitOpacity = 0.0;
252
257
  if (hit.z > 0.0) {
258
+ ivec2 normalMapSize = textureSize(normalMap, 0);
259
+ ivec2 hitIuv = clamp(ivec2(hit.xy * vec2(normalMapSize)), ivec2(0), normalMapSize - ivec2(1));
260
+ float storedHitOpacity = texelFetch(normalMap, hitIuv, 0).a;
261
+
262
+ // 0.0 alpha excludes the surface as a receiver (e.g. water), but a valid ray hit still occludes as opaque
263
+ hitOpacity = storedHitOpacity == 0.0 ? 1.0 : storedHitOpacity;
264
+
253
265
  ${(0,d.If)(b,d.H`
254
266
  // Emission and color bleed - Reproject the current receiver and sampled hit to estimate bounced color
255
267
  vec3 receiverColor = texture(lastFrameColorTexture, reprojectedCoordinate.xy).rgb;
@@ -264,21 +276,28 @@
264
276
  rayMarchMaxReachEmissionWeight,
265
277
  (rayMarchScreenReach - rayMarchMinReach) / max(rayMarchMaxReach - rayMarchMinReach, 0.00001)
266
278
  );
267
- fragGlobalIllumination.rgb += ((sourceColorLinear * colorBleedWeight * colorBleedScale) + sourceEmission * emissionWeight) * stepSize;
279
+ fragGlobalIllumination.rgb += hitOpacity * (
280
+ (sourceColorLinear * colorBleedWeight * colorBleedScale) + sourceEmission * emissionWeight
281
+ ) * stepSize;
268
282
  `)}
269
- } else {
283
+ }
284
+
285
+ if (hitOpacity < 1.0) {
270
286
  // Occlusion - heuristic modulating sky intensity based on angle to main light
271
287
  vec4 viewMainLightDirection = view * vec4(mainLightDirection, 0.0);
272
288
  float skyModulation = pow(max(dot(rayDirection, viewMainLightDirection.xyz), 0.0), 3.0) * 5.5;
273
289
  float skyFacingWeight = clamp(3.5 * dot(viewMainLightDirection.xyz, normal), 0.0, 1.0);
274
290
  skyModulation = mix(1.0, skyModulation * 0.2 + 0.8, skyFacingWeight);
275
- fragGlobalIllumination.a += skyModulation * stepSize;
291
+ fragGlobalIllumination.a += (1.0 - hitOpacity) * skyModulation * stepSize;
276
292
  }
277
293
  }
278
294
 
295
+ fragGlobalIllumination.rgb *= receiverOpacity;
296
+ fragGlobalIllumination.a = mix(1.0, fragGlobalIllumination.a, receiverOpacity);
297
+
279
298
  // Rendering trick add noise to reduce accumulation artifacts
280
299
  float accumulationDither = occlusionBlendWeight < 1.0
281
- ? randomDirectionSample.b * ${d.H.float(.0039)}
300
+ ? receiverOpacity * randomDirectionSample.b * ${d.H.float(.0039)}
282
301
  : 0.0;
283
302
 
284
303
  ${(0,d.If)(b,d.H`
@@ -479,16 +498,9 @@
479
498
  ) / jointBilateralWeightSum;
480
499
  }
481
500
  `),e.outputs.add("fragColor","vec4",0),e.outputs.add("fragWeight","vec2",1),t.main.add(l.H`sampleJointBilateralUpscale(uv, fragColor, fragWeight);
482
- fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:p,build:f},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,v])},57323(e,t,r){r.d(t,{b:()=>H});var o=r(32680),a=r(49255),n=r(34711),i=r(76597),s=r(24321),l=r(2585),c=r(43519),u=r(96336),d=r(39014),h=r(53466),m=r(92700),p=r(35640),f=r(9169),v=r(72233),g=r(32971),x=r(98619),b=r(22393),y=r(59469),w=r(32482),M=r(51406),S=r(43259),T=r(58614),C=r(27950),_=r(77949),I=r(33079),P=r(71988),O=r(20304),z=r(31821),R=r(63761),D=r(27832),j=r(43616),F=r(26934),E=r(47630),B=r(14113);function H(e){const t=new B.N5,{attributes:r,vertex:H,fragment:W,varyings:N}=t,{output:A,offsetBackfaces:G,pbrMode:L,snowCover:V,spherical:k}=e,U=1===L||2===L;if((0,_.NB)(H,e),r.add("position","vec3"),H.inputs.add("position",()=>"position"),N.add("vpos","vec3",{invariant:!0}),t.include(S.A,e),t.include(l.B,e),t.include(p.Ge,e),t.include(M.q2,e),!(0,a._o)(A))return t.include(f.E,e),t;t.include(M.MU,e),(0,_.yu)(t.vertex,e),t.include(u.Y,e),t.include(i.d),G&&t.include(o.M),N.add("vNormalWorld","vec3"),N.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(d.K,e),t.include(s.v,e),t.include(m.c,e),H.include(c.WD),H.include(c.oF),H.uniforms.add(new P.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),N.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?w.QH:w.LA,e),H.include(F.Q),H.main.add(z.H`
483
- forwardVertexColor();
484
-
485
- MaskedColor maskedColorExt =
486
- applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
487
-
488
- vcolorExt = maskedColorExt.color;
489
- forwardColorMixMode(maskedColorExt.mask);
501
+ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:p,build:f},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,v])},57323(e,t,r){r.d(t,{b:()=>O});var o=r(32680),a=r(49255),n=r(34711),i=r(76597),s=r(2585),l=r(96336),c=r(53466),u=r(35640),d=r(9169),h=r(77068),m=r(72233),p=r(32971),f=r(98619),v=r(22393),g=r(59469),x=r(32482),b=r(51406),y=r(43259),w=r(58614),M=r(77949),S=r(33079),T=r(31821),C=r(63761),_=r(27832),I=r(47630),P=r(14113);function O(e){const t=new P.N5,{attributes:r,vertex:O,fragment:z,varyings:R}=t,{output:D,offsetBackfaces:j,pbrMode:F,snowCover:E,spherical:B}=e,H=1===F||2===F;if((0,M.NB)(O,e),r.add("position","vec3"),O.inputs.add("position",()=>"position"),R.add("vpos","vec3",{invariant:!0}),t.include(y.A,e),t.include(s.B,e),t.include(u.Ge,e),t.include(b.q2,e),!(0,a._o)(D))return t.include(d.E,e),t;t.include(b.MU,e),(0,M.yu)(t.vertex,e),t.include(l.Y,e),t.include(i.d),j&&t.include(o.M),R.add("vNormalWorld","vec3"),R.add("localvpos","vec3",{invariant:!0}),t.include(c.U,e),t.include(h.F,e),t.include(e.instancedDoublePrecision?x.QH:x.LA,e),O.main.add(T.H`
502
+ forwardDefaultMaterialExternalColor();
490
503
 
491
- bool alphaCut = opacityMixMode != ${z.H.int(j.Um.ignore)} && vcolorExt.a < alphaCutoff;
492
504
  vpos = getVertexInLocalOriginSpace();
493
505
 
494
506
  localvpos = vpos - view[3].xyz;
@@ -501,12 +513,13 @@ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Obje
501
513
  forwardColorUV();
502
514
  forwardEmissiveUV();
503
515
  forwardLinearDepthToReadShadowMap();
504
- gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
505
- ${(0,z.If)(G,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
506
- `);const{hasColorTexture:$,hasColorTextureTransform:q}=e;return W.include(g.kA,e),W.include(v.n,e),t.include(T.SS,e),W.include(n.HQ,e),t.include(E.D,e),(0,_.yu)(W,e),(0,x.Gc)(W),(0,g.a8)(W),(0,g.eU)(W),W.uniforms.add(H.uniforms.get("localOrigin"),H.uniforms.get("view"),new I.t("ambient",e=>e.ambient),new I.t("diffuse",e=>e.diffuse),new O.m("opacity",e=>e.opacity),new O.m("layerOpacity",e=>e.layerOpacity)),$&&W.uniforms.add(new R.N("tex",e=>e.texture)),t.include(y._,e),W.include(b.c,e),W.include(C.N),W.include(D.b,e),(0,x.O4)(W),W.main.add(z.H`
516
+
517
+ gl_Position = shouldCullByOpacity() ? vec4(1e38, 1e38, 1e38, 1.0) :
518
+ ${(0,T.If)(j,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
519
+ `);const{hasColorTexture:W,hasColorTextureTransform:N}=e;return z.include(p.kA,e),z.include(m.n,e),t.include(w.SS,e),z.include(n.HQ,e),t.include(I.D,e),(0,M.yu)(z,e),(0,f.Gc)(z),(0,p.a8)(z),(0,p.eU)(z),z.uniforms.add(O.uniforms.get("localOrigin"),O.uniforms.get("view"),new S.t("ambient",e=>e.ambient),new S.t("diffuse",e=>e.diffuse)),W&&z.uniforms.add(new C.N("tex",e=>e.texture)),t.include(g._,e),z.include(v.c,e),z.include(_.b,e),(0,f.O4)(z),z.main.add(T.H`
507
520
  discardBySlice(vpos);
508
- vec4 texColor = ${$?`texture(tex, ${q?"colorUV":"vuv0"})`:" vec4(1.0)"};
509
- ${(0,z.If)($,`${(0,z.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
521
+ vec4 texColor = ${W?`texture(tex, ${N?"colorUV":"vuv0"})`:" vec4(1.0)"};
522
+ ${(0,T.If)(W,`${(0,T.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
510
523
  vec3 viewDirection = normalize(vpos - cameraPosition);
511
524
  applyPBRFactors();
512
525
  float ssao = evaluateAmbientOcclusionInverse();
@@ -516,16 +529,20 @@ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Obje
516
529
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
517
530
  float shadow = readShadow(additionalAmbientScale, vpos);
518
531
  vec3 matColor = max(ambient, diffuse);
519
- ${e.hasVertexColors?z.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
520
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:z.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
521
- float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, opacityMixMode);`}
532
+ vec3 albedo = mixExternalColor(
533
+ ${(0,T.If)(e.hasVertexColors,"vColor.rgb * ")} matColor,
534
+ texColor.rgb,
535
+ vExternalColor.rgb,
536
+ colorMixMode
537
+ );
538
+ float opacity_ = getDefaultMaterialOpacity(texColor.a);
522
539
 
523
540
  vec3 shadingNormal = normalize(vNormalWorld);
524
- vec3 groundNormal = ${k?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};
541
+ vec3 groundNormal = ${B?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};
525
542
 
526
- ${(0,z.If)(V,"vec3 faceNormal = screenDerivativeNormal(vpos);\n float snow = getRealisticTreeSnow(faceNormal, shadingNormal, groundNormal);\n albedo = mix(albedo, vec3(1), snow);")}
543
+ ${(0,T.If)(E,"vec3 faceNormal = screenDerivativeNormal(vpos);\n float snow = getRealisticTreeSnow(faceNormal, shadingNormal, groundNormal);\n albedo = mix(albedo, vec3(1), snow);")}
527
544
 
528
- ${z.H`albedo *= 1.2;
545
+ ${T.H`albedo *= 1.2;
529
546
  vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
530
547
  float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
531
548
  float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
@@ -533,11 +550,11 @@ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Obje
533
550
  float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
534
551
  additionalLight += backLightFactor * mainLightIntensity;`}
535
552
 
536
- ${U?z.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
537
- ${(0,z.If)(V,"mrr = applySnowToMRR(mrr, snow);")}
538
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:z.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
553
+ ${H?T.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
554
+ ${(0,T.If)(E,"mrr = applySnowToMRR(mrr, snow);")}
555
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:T.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
539
556
  vec4 finalColor = vec4(shadedColor, opacity_);
540
- outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,z.If)(V,", 1.0")});`),t}const W=Object.freeze(Object.defineProperty({__proto__:null,build:H},Symbol.toStringTag,{value:"Module"}));r.d(t,["R",0,W])},15581(e,t,r){r.d(t,{b:()=>v,g:()=>g});var o=r(37585),a=r(48163),n=r(82048),i=r(52540),s=r(65261),l=r(34845),c=r(77108),u=r(47286),d=r(33094),h=r(20304),m=r(31821),p=r(63761),f=r(14113);function v(){const e=new f.N5,t=e.fragment;return e.include(n.c),e.include(l.Ir),t.include(i.E),t.include(s.C),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(m.H`vec3 sphere[16] = vec3[16](
557
+ outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,T.If)(E,", 1.0")});`),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:O},Symbol.toStringTag,{value:"Module"}));r.d(t,["R",0,z])},15581(e,t,r){r.d(t,{b:()=>v,g:()=>g});var o=r(37585),a=r(48163),n=r(82048),i=r(52540),s=r(65261),l=r(34845),c=r(77108),u=r(47286),d=r(33094),h=r(20304),m=r(31821),p=r(63761),f=r(14113);function v(){const e=new f.N5,t=e.fragment;return e.include(n.c),e.include(l.Ir),t.include(i.E),t.include(s.C),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(m.H`vec3 sphere[16] = vec3[16](
541
558
  vec3(0.186937, 0.0, 0.0),
542
559
  vec3(0.700542, 0.0, 0.0),
543
560
  vec3(-0.864858, -0.481795, -0.111713),
@@ -575,7 +592,7 @@ return fallOffFunction(vv, vn, 0.1);
575
592
  // get the normal of current fragment
576
593
  ivec2 iuv = ivec2(uv * vec2(textureSize(normalMap, 0)));
577
594
  vec4 norm4 = texelFetch(normalMap, iuv, 0);
578
- if(norm4.a != 1.0) {
595
+ if (norm4.a == 0.0) {
579
596
  fragOcclusion = 1.0;
580
597
  return;
581
598
  }
@@ -642,7 +659,7 @@ return fallOffFunction(vv, vn, 0.1);
642
659
  vec2 uvOffset = uv + rf * blurSize;
643
660
  blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
644
661
  }
645
- fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,h])},43609(e,t,r){r.d(t,{a:()=>n,f:()=>i,n:()=>a});var o=r(34275);function a(e,t){n(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r=2,a=r){const n=t.length/2;let i=0,s=0;if(!(0,o.iu)(t)||(0,o.dk)(t)){for(let o=0;o<n;++o)e[i]=t[s],e[i+1]=t[s+1],i+=r,s+=a;return}const l=(0,o.a3)(t);if((0,o.JI)(t))for(let o=0;o<n;++o)e[i]=Math.max(t[s]/l,-1),e[i+1]=Math.max(t[s+1]/l,-1),i+=r,s+=a;else for(let o=0;o<n;++o)e[i]=t[s]/l,e[i+1]=t[s+1]/l,i+=r,s+=a}function i(e,t,r,o){const a=e.typedBuffer,n=e.typedBufferStride,i=o?.count??e.count;let s=(o?.dstIndex??0)*n;for(let e=0;e<i;++e)a[s]=t,a[s+1]=r,s+=n}Object.freeze(Object.defineProperty({__proto__:null,fill:i,normalizeIntegerBuffer:n,normalizeIntegerBufferView:a},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>s,c:()=>a,d:()=>i,e:()=>h,f:()=>u,l:()=>c,n:()=>m,t:()=>n}),r(44208);var o=r(72727);function a(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,a=3,n=a){const i=(0,o.k)(e.length,a,3),s=(0,o.k)(t.length,n,3),l=Math.min(i,s),c=r[0],u=r[1],d=r[2],h=r[4],m=r[5],p=r[6],f=r[8],v=r[9],g=r[10],x=r[12],b=r[13],y=r[14];let w=0,M=0;for(let r=0;r<l;r++){const r=t[w],o=t[w+1],i=t[w+2];e[M]=c*r+h*o+f*i+x,e[M+1]=u*r+m*o+v*i+b,e[M+2]=d*r+p*o+g*i+y,w+=n,M+=a}return e}function i(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,a=3,n=a){const i=(0,o.k)(e.length,a,3),s=(0,o.k)(t.length,n,3),l=Math.min(i,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],p=r[5],f=r[6],v=r[7],g=r[8];let x=0,b=0;for(let r=0;r<l;r++){const r=t[x],o=t[x+1],i=t[x+2];e[b]=c*r+h*o+f*i,e[b+1]=u*r+m*o+v*i,e[b+2]=d*r+p*o+g*i,x+=n,b+=a}}function l(e,t,r,o=3,a=o){const n=Math.min(e.length/o,t.length/a);let i=0,s=0;for(let l=0;l<n;l++)e[s]=r*t[i],e[s+1]=r*t[i+1],e[s+2]=r*t[i+2],i+=a,s+=o;return e}function c(e,t,r,o){u(e.typedBuffer,t.typedBuffer,r,o,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,o,a=3,n=a){const i=Math.min(e.length/a,t.length/n);let s=0,l=0;const c=1/2.2;for(let u=0;u<i;u++)e[l]=o*(r*t[s])**c,e[l+1]=o*(r*t[s+1])**c,e[l+2]=o*(r*t[s+2])**c,s+=n,l+=a}function d(e,t,r,a=3,n=a){const i=(0,o.k)(e.length,a,3),s=(0,o.k)(t.length,n,3),l=Math.min(i,s);let c=0,u=0;for(let o=0;o<l;o++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=n,u+=a;return e}function h(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,o=r){const a=Math.min(e.length/r,t.length/o);let n=0,i=0;for(let s=0;s<a;s++){const a=t[n],s=t[n+1],l=t[n+2],c=a*a+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[i]=t*a,e[i+1]=t*s,e[i+2]=t*l}n+=o,i+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:m,normalizeView:h,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const o=Math.min(e.count,t.count),a=e.typedBuffer,n=e.typedBufferStride,i=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<o;e++)a[c]=i[l]>>r,a[c+1]=i[l+1]>>r,a[c+2]=i[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:i,transformMat4:n,transformMat4View:a,translate:d},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>a});var o=r(34727);class a{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return n(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,o.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+i(this.range,e-t,r)}minimalMonotonic(e,t,r){return n(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,o=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(o)?r:o}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function n(e,t,r,o,a=0,n=!1){return(o-=a)<t?o+=i(e,t-o):o>r&&(o-=i(e,o-r)),n&&o===r&&(o=t),o+a}function i(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new a(0,2*Math.PI),l=(new a(-Math.PI,Math.PI),new a(0,360));r.d(t,["ie",0,l,"uC",0,s])},46140(e,t,r){r.d(t,{A:()=>a});var o=r(49186);class a{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 o.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new a(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),i=/^\s*\d+\s*$/;if(!r?.match||!i.test(r))throw new o.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!i.test(n))throw new o.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new a(s,l,t)}}},61473(e,t,r){function o(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function a(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(i)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>a,b5:()=>o});const n=/^devext\.arcgis\.com$/,i=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,n,i,/^jsapps\.esri\.com$/,s,l]},82534(e,t,r){function o(){return[0,0,0,1]}function a(e){return[e[0],e[1],e[2],e[3]]}r.d(t,{o8:()=>a,vt:()=>o});const n=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:n,clone:a,create:o,fromValues:function(e,t,r,o){return[e,t,r,o]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["zK",0,n])},88340(e,t,r){function o(){return new Float32Array(2)}function a(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return o()}function i(){return a(1,1)}function s(){return a(1,0)}function l(){return a(0,1)}r.d(t,{fA:()=>a,vt:()=>o});const c=n(),u=i(),d=s(),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:o,fromValues:a,ones:i,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,u,"uY",0,c])},48163(e,t,r){function o(){return[0,0]}function a(e){return[e[0],e[1]]}function n(e,t){return[e,t]}function i(){return n(1,1)}function s(){return n(-1,-1)}function l(){return n(1,0)}function c(){return n(0,1)}r.d(t,{fA:()=>n,o8:()=>a,vt:()=>o});const u=i(),d=s(),h=l(),m=c();Object.freeze(Object.defineProperty({__proto__:null,NEGATIVE_ONES:d,ONES:u,UNIT_X:h,UNIT_Y:m,ZEROS:[0,0],clone:a,create:o,freeze:function(e,t){return[e,t]},fromArray:function(e,t=[0,0]){const r=Math.min(2,e.length);for(let o=0;o<r;++o)t[o]=e[o];return t},fromValues:n,negativeOnes:s,ones:i,unitX:l,unitY:c,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["IA",0,d,"Un",0,u])},91829(e,t,r){function o(){return[0,0,0,0]}function a(e,t,r,o){return[e,t,r,o]}function n(e,t,r,o){return[e,t,r,o]}function i(){return a(1,1,1,1)}function s(){return a(1,0,0,0)}function l(){return a(0,1,0,0)}function c(){return a(0,0,1,0)}function u(){return a(0,0,0,1)}r.d(t,{CN:()=>n,_Y:()=>u,fA:()=>a,vt:()=>o});const d=[0,0,0,0],h=i(),m=s(),p=l(),f=c(),v=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_W:v,UNIT_X:m,UNIT_Y:p,UNIT_Z:f,ZEROS:d,clone:function(e){return[e[0],e[1],e[2],e[3]]},create:o,freeze:n,fromArray:function(e,t=[0,0,0,0]){const r=Math.min(4,e.length);for(let o=0;o<r;++o)t[o]=e[o];return t},fromValues:a,ones:i,unitW:u,unitX:s,unitY:l,unitZ:c,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,h,"uY",0,d])},78955(e,t,r){r.d(t,{Bw:()=>v,C:()=>a,Cc:()=>y,LI:()=>h,Om:()=>b,S8:()=>x,T9:()=>d,WQ:()=>i,Z0:()=>w,aI:()=>S,hG:()=>f,hZ:()=>n,hs:()=>m,jk:()=>u,m3:()=>g,t2:()=>M});var o=r(34304);function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function n(e,t,r,o,a){return e[0]=t,e[1]=r,e[2]=o,e[3]=a,e}function i(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function s(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function l(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function c(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function u(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function d(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function h(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function m(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function p(e,t){const r=t[0]-e[0],o=t[1]-e[1],a=t[2]-e[2],n=t[3]-e[3];return Math.sqrt(r*r+o*o+a*a+n*n)}function f(e,t){const r=t[0]-e[0],o=t[1]-e[1],a=t[2]-e[2],n=t[3]-e[3];return r*r+o*o+a*a+n*n}function v(e){const t=e[0],r=e[1],o=e[2],a=e[3];return Math.sqrt(t*t+r*r+o*o+a*a)}function g(e){const t=e[0],r=e[1],o=e[2],a=e[3];return t*t+r*r+o*o+a*a}function x(e,t){const r=t[0],o=t[1],a=t[2],n=t[3];let i=r*r+o*o+a*a+n*n;return i>0&&(i=1/Math.sqrt(i),e[0]=r*i,e[1]=o*i,e[2]=a*i,e[3]=n*i),e}function b(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function y(e,t,r,o){const a=t[0],n=t[1],i=t[2],s=t[3];return e[0]=a+o*(r[0]-a),e[1]=n+o*(r[1]-n),e[2]=i+o*(r[2]-i),e[3]=s+o*(r[3]-s),e}function w(e,t,r){const o=t[0],a=t[1],n=t[2],i=t[3];return e[0]=r[0]*o+r[4]*a+r[8]*n+r[12]*i,e[1]=r[1]*o+r[5]*a+r[9]*n+r[13]*i,e[2]=r[2]*o+r[6]*a+r[10]*n+r[14]*i,e[3]=r[3]*o+r[7]*a+r[11]*n+r[15]*i,e}function M(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function S(e,t){const r=e[0],a=e[1],n=e[2],i=e[3],s=t[0],l=t[1],c=t[2],u=t[3],d=(0,o.FD)();return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(n-c)<=d*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))}const T=s,C=l,_=c,I=p,P=f,O=v,z=g;Object.freeze(Object.defineProperty({__proto__:null,add:i,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:a,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:I,distance:p,div:_,divide:c,dot:b,equals:S,exactEquals:M,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:O,length:v,lerp:y,max:d,min:u,mul:C,multiply:l,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:x,random:function(e,t=1){const r=o.Ov;let a,n,i,s,l,c;do{a=2*r()-1,n=2*r()-1,l=a*a+n*n}while(l>=1);do{i=2*r()-1,s=2*r()-1,c=i*i+s*s}while(c>=1);const u=Math.sqrt((1-l)/c);return e[0]=t*a,e[1]=t*n,e[2]=t*i*u,e[3]=t*s*u,e},round:h,scale:m,scaleAndAdd:function(e,t,r,o){return e[0]=t[0]+r[0]*o,e[1]=t[1]+r[1]*o,e[2]=t[2]+r[2]*o,e[3]=t[3]+r[3]*o,e},set:n,sqrDist:P,sqrLen:z,squaredDistance:f,squaredLength:g,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:T,subtract:s,transformMat4:w,transformQuat:function(e,t,r){const o=t[0],a=t[1],n=t[2],i=r[0],s=r[1],l=r[2],c=r[3],u=c*o+s*n-l*a,d=c*a+l*o-i*n,h=c*n+i*a-s*o,m=-i*o-s*a-l*n;return e[0]=u*c+m*-i+d*-l-h*-s,e[1]=d*c+m*-s+h*-i-u*-l,e[2]=h*c+m*-l+u*-s-d*-i,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},56512(e,t,r){function o(e){let t,r,o=[],a=!1;return function(...n){return a&&t===this&&function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}(n,o)||(r=e.apply(this,n),t=this,o=n,a=!0),r}}r.d(t,{B:()=>o})},69397(e,t,r){r.d(t,{Qf:()=>s,Qh:()=>n,lM:()=>a});var o=r(34275);function a(e){if(!e)return 0;let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=i(e[r],!1));return t}function n(e){if(!e)return 0;if("number"==typeof e[0])return s(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=u;for(let o=0;o<t;o++)r+=i(e[o]);return r}(e);let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=i(e[r]));return t}function i(e,t=!0){switch(typeof e){case"object":return t?n(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(...e){return e.reduce((e,t)=>e+(t?(0,o.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,16):0:0),0)}function l(e,t){return u+e.length*t}const c=32,u=16,d=145},65806(e,t,r){r.d(t,{g:()=>i});var o=r(51850),a=r(91218),n=r(9762);function i(e,t,r,o){if((0,a.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,n.projectBuffer)(s,e.spatialReference,0,t,r,0);const i=(0,a.tryProject)(e,r,o);return!!i&&(t[0]=i.x,t[1]=i.y,t[2]=i.z??0,!0)}const s=(0,o.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var o=r(91218),a=r(16930),n=r(9762),i=r(65806);function s(e,t,r,a){return!(null==t||null==a||e.length<2)&&((0,o.canProjectWithoutEngine)(t,a)?(0,n.projectBuffer)(e,t,0,r,a,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,i.g)(l,r,a)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:a.A.WGS84,type:"point"}},72727(e,t,r){function o(e,t,r){if(t<=0)return 0;const o=e-r;return o<0?0:Math.floor(o/t)+1}r.d(t,{k:()=>o}),r(53966)},31411(e,t,r){r.d(t,{GS:()=>T,gh:()=>_});var o=r(49186),a=r(56512),n=r(65864),i=r(4305),s=r(50954),l=r(52006),c=r(49663),u=r(46068),d=r(15507);const h=1e-6,m=[0,0];function p(e){return{maxSegmentLength:e.maxSegmentLength??0,maxDeviation:e.maxDeviation??0,maxSegmentsPerCurve:e.maxSegmentsPerCurve??12e3,minSegmentsPerCurve:Math.max(e.minSegmentsPerCurve??1,1)}}class f{constructor(e,t){this.curveStart=e,this.curveEnd=t,this.tStart=0,this.tEnd=0,this.tEndStack=[],this.arcEndStack=[]}get stackSize(){return this.tEndStack.length}initialize(e,t){this.tStart=0,this.arcStart=e,this.tEndStack.push(1),this.arcEndStack.push(t)}splitAt(e){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(e),this.arcEndStack.push(this.interpolate(e))}splitInHalf(){return this.splitAt((this.tStart+this.tEnd)/2)}pop(){this.tEnd=this.tEndStack.pop(),this.arcEnd=this.arcEndStack.pop()}next(){this.tStart=this.tEnd,this.arcStart=this.arcEnd}densify(e,{maxDeviation:t,maxSegmentLength:r,maxSegmentsPerCurve:o,minSegmentsPerCurve:a}){const n=r*r,i=t*t,s=1/o,l=this.interpolate(0),c=this.interpolate(1);(0,d.kb)(this.curveStart,l)>h&&e.push(l),this.initialize(l,c);const u=1/a;for(let e=a-1;e>0;e--){const t=e*u;this.pop(),this.splitAt(t)}for(;this.stackSize>0;)this.pop(),this.tStart===this.tEnd||this.tEnd-this.tStart<s||(0===n||!isFinite(n)||(0,d.kb)(this.arcStart,this.arcEnd)<n)&&(0===i||!isFinite(i)||this.getDeviation2()<i)?(e.push(this.arcEnd),this.next()):this.splitInHalf();return(0,d.kb)(this.curveEnd,c)>h&&e.push([...this.curveEnd]),e}}class v extends f{constructor(e,t){const[r,o,a]=t.b;super(e,r),this._controlPointsStack=[],this._curveControlPoints=[o,a],this._arcControlPoints=[o,a],this._controlPointsStack.push(this._arcControlPoints)}splitAt(e){const{arcStart:t,arcEnd:r,tStart:o,tEnd:a}=this,[n,i]=this._arcControlPoints,s=(e-o)/(a-o),l=(0,d.RS)([],t,n,s),c=(0,d.RS)(m,n,i,s),u=(0,d.RS)([],i,r,s),h=(0,d.RS)([],l,c,s),p=(0,d.RS)([],c,u,s),f=(0,d.RS)([],h,p,s);this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this._controlPointsStack.push([p,u]),this.tEndStack.push(e),this.arcEndStack.push(f),this._arcControlPoints[0]=l,this._arcControlPoints[1]=h,this._controlPointsStack.push(this._arcControlPoints)}pop(){super.pop(),this._arcControlPoints=this._controlPointsStack.pop()}interpolate(e){const{curveStart:t,curveEnd:r}=this,[o,a]=this._curveControlPoints;return(0,i.B4)(t,o,a,r,e)}getDeviation2(){const{arcStart:e,arcEnd:t}=this,[r,o]=this._arcControlPoints;return Math.max((0,d.yE)(r,e,t),(0,d.yE)(o,e,t))}}class g extends f{constructor(e,t){const[r]=t.a;super(e,r),this._derivedEllipse=(0,u.SW)(e,t)}pop(){super.pop(),this._tMid=(this.tStart+this.tEnd)/2,this._arcMid=this.interpolate(this._tMid)}splitInHalf(){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(this._tMid),this.arcEndStack.push(this._arcMid)}interpolate(e){return(0,u.Uk)(this._derivedEllipse,e)}getDeviation2(){return(0,d.yE)(this._arcMid,this.arcStart,this.arcEnd)}}function x(e,t,r,{cx:o,cy:a,radius:n,thetaStart:i,thetaEnd:s,isInvalid:l},{maxDeviation:c,maxSegmentLength:u,maxSegmentsPerCurve:m,minSegmentsPerCurve:p}){if(l)return e.push([...r]),e;const f=2*n,v=[o+n*Math.cos(i),a+n*Math.sin(i)],g=[o+n*Math.cos(s),a+n*Math.sin(s)];(0,d.kb)(t,v)>h&&e.push(v);const x=Math.abs(s-i),b=u>0&&u<f?2*Math.asin(u/f):x,y=c>0&&c<=n?2*Math.acos(1-c/n):x,w=Math.min(b,y),M=Math.min(m,Math.max(p,Math.ceil(Math.abs(x/w)))),S=1/M;for(let t=1;t<M;t++){const r=t*S,l=i*(1-r)+s*r;e.push([o+n*Math.cos(l),a+n*Math.sin(l)])}return e.push(g),(0,d.kb)(r,g)>h&&e.push([...r]),e}function b(e,t,r,o){return new v(t,r).densify(e,o)}function y(e,t,r,o){const a=(0,s.pM)(t,r),[n]=r.c;return x(e,t,n,a,o)}function w(e,t,r,o){const a=(0,c.io)(t,r),[n]=r.a;return x(e,t,n,a,o)}function M(e,t,r,o){const[a,n,i,s,l,c,u]=r.a;return 0===c||0===u?(e.push([...a]),e):new g(t,r).densify(e,o)}function S(e,t,r,o){return(0,l.Xq)(r)?(e.push([...r]),e):(0,l.n1)(r)?b(e,t,r,o):(0,l.aO)(r)?y(e,t,r,o):(0,l.DA)(r)?w(e,t,r,o):M(e,t,r,o)}function T(e,t={}){if(!(0,l.Ed)(e))return e;const r=p(t),o=(0,l.FD)(e),a=[];for(const e of o){const t=[];for(let o=0;o<e.length-1;o++){const a=o+1,n=[...(0,l.yP)(e[o])];0===o&&t.push(n),S(t,n,e[a],r)}a.push(t)}return"curvePaths"in e?{...void 0!==e.hasZ?{hasZ:e.hasZ}:{},...void 0!==e.hasM?{hasM:e.hasM}:{},paths:a,spatialReference:e.spatialReference}:{...void 0!==e.hasZ?{hasZ:e.hasZ}:{},...void 0!==e.hasM?{hasM:e.hasM}:{},rings:a,spatialReference:e.spatialReference}}const C=(0,a.B)(e=>({maxDeviation:0,maxSegmentLength:100*e,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1}));async function _(e,t,a){const i=new Set(t);return await async function(e,t,a){let n=null;for(const i of e)if(i&&(0,l.Ed)(i)&&null==i.spatialReference.xyTolerance&&(0,l.V8)(i,t)){const e=i.spatialReference;if(!e)throw new o.A("geometry:missing-spatial-reference","Geometry contains an unsupported curve type, but it cannot be densified because it has no spatial reference.");const t=I(e);if(a.has(t))i.spatialReference=a.get(t);else{n||(n=await Promise.all([r.e(6042),r.e(1878),r.e(8885),r.e(5756),r.e(3299),r.e(1550)]).then(r.bind(r,78125)));const s=n.fromSpatialReference(e),l=s?.getTolerance();if(null==l)throw new o.A("geometry:missing-tolerance","Geometry contains an unsupported curve type, but it cannot be densified because the tolerance of its spatial reference is unknown. Set the `xyTolerance` property of the spatial reference.");const c=i.spatialReference.clone();c.read({xyTolerance:l}),i.spatialReference=c,a.set(t,c)}}}(e,i,a),e.map(e=>{if(!e||!(0,l.Ed)(e))return e;const r=e.spatialReference.xyTolerance;if(null==r)return e;const o=C(r);return(0,n.rS)(function(e,t,r){if(!(0,l.Ed)(e))return e;const o=new Set(t),a=p(r),n=(0,l.FD)(e),i=[];let s=!1;for(const e of n){const t=[];for(let r=0;r<e.length-1;r++){const n=r+1,i=[...(0,l.yP)(e[r])];0===r&&t.push(i);const c=e[n];(0,l.Xq)(c)?t.push([...c]):(0,l.n1)(c)&&!o.has("cubic-bezier")?b(t,i,c,a):(0,l.aO)(c)&&!o.has("circular-arc")?y(t,i,c,a):(0,l.DA)(c)&&!o.has("elliptic-arc")?w(t,i,c,a):(0,l.wY)(c)&&!o.has("elliptic-arc")?M(t,i,c,a):(t.push((0,l.tk)(c)),s=!0)}i.push(t)}return"curvePaths"in e?{...void 0!==e.hasZ?{hasZ:e.hasZ}:{},...void 0!==e.hasM?{hasM:e.hasM}:{},spatialReference:e.spatialReference,...s?{curvePaths:i}:{paths:i}}:{hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,...s?{curveRings:i}:{rings:i}}}(e,t,o))})}function I(e){if(null!=e.wkid)return`${e.wkid}`;if(null!=e.wkt)return e.wkt;const t="toJSON"in e&&"function"==typeof e.toJSON?e.toJSON():e;return JSON.stringify(t)}},65864(e,t,r){r.d(t,{rS:()=>u,xD:()=>h});var o=r(5443),a=r(91075),n=r(48526),i=r(86738),s=r(39829),l=r(82799),c=r(60408);function u(e){return null==e?null:e instanceof a.A?e:(0,c.fT)(e)?i.A.fromJSON(e):(0,c.Rg)(e)?l.A.fromJSON(e):(0,c.Bi)(e)?s.A.fromJSON(e):(0,c.U9)(e)?n.A.fromJSON(e):(0,c.ZC)(e)?o.A.fromJSON(e):null}const d={esriGeometryPoint:i.A,esriGeometryPolyline:l.A,esriGeometryPolygon:s.A,esriGeometryEnvelope:o.A,esriGeometryMultipoint:n.A,esriGeometryMultiPatch:s.A};function h(e){return e&&d[e]||null}},17136(e,t,r){r.d(t,{Y_:()=>z,O7:()=>P,el:()=>I});var o=r(92602),a=r(69052),n=r(49186),i=r(53966),s=r(39829),l=r(82799),c=r(16930),u=r(80754),d=r(21325),h=r(28735),m=r(52006),p=r(31411),f=r(11254),v=r(60408),g=r(65864),x=r(2272),b=r(84952),y=r(92300);const w=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function M(e){return"polygon"===e[0].type}function S(e){return"polyline"===e[0].type}function T(e,t,r){const o=1e6;if(t){const t=(0,m.Ed)(e)?(0,p.GS)(e,{maxSegmentLength:o}):function(e,t){if(!(e instanceof l.A||e instanceof s.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw w().error(e),new n.A("internal:geometry",e)}const r=(0,u.r8)(e),o=[];for(const e of r){const r=[];o.push(r),r.push([e[0][0],e[0][1]]);for(let o=0;o<e.length-1;o++){const a=e[o][0],n=e[o][1],i=e[o+1][0],s=e[o+1][1],l=Math.sqrt((i-a)*(i-a)+(s-n)*(s-n)),c=(s-n)/l,u=(i-a)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const o=e*t,i=u*o+a,s=c*o+n;r.push([i,s])}const e=(l+Math.floor(d-1)*t)/2,o=u*e+a,i=c*e+n;r.push([o,i])}r.push([i,s])}}return function(e){return"polygon"===e.type}(e)?new s.A({rings:o,spatialReference:e.spatialReference}):new l.A({paths:o,spatialReference:e.spatialReference})}(e,o);e=(0,h.ci)(t,!0)}return r&&(e=(0,u.kS)(e,r)),e}function C(e,t,r){if(Array.isArray(e)){const o=e[0];if(o>t){const r=(0,u.kd)(o,t);e[0]=o+r*(-2*t)}else if(o<r){const t=(0,u.kd)(o,r);e[0]=o+t*(-2*r)}}else{const o=e.x;if(o>t){const r=(0,u.kd)(o,t);e=e.clone().offset(r*(-2*t),0)}else if(o<r){const t=(0,u.kd)(o,r);e=e.clone().offset(t*(-2*r),0)}}return e}function _(e,t){let r=-1;for(let o=0;o<t.cutIndexes.length;o++){const a=t.cutIndexes[o],n=t.geometries[o],i=(0,u.r8)(n);for(let e=0;e<i.length;e++){const t=i[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const o=t[e][0];r=o>r?o:r}r=Number(r.toFixed(9));const o=-360*(0,u.kd)(r,180);for(let r=0;r<t.length;r++){const t=n.getPoint(e,r);n.setPoint(e,r,t.clone().offset(o,0))}return!0}})}if(a===r){if(M(e))for(const t of(0,u.r8)(n))e[a]=e[a].addRing(t);else if(S(e))for(const t of(0,u.r8)(n))e[a]=e[a].addPath(t)}else r=a,e[a]=n}return e}async function I(e,t,r){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&w().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const a="string"==typeof t?t:t?.url??o.A.geometryServiceUrl;let n,i,c,m,p,M,S,P,O=0;const z=[],R=[];for(const t of e)if(null!=t)if(n||(n=t.spatialReference,i=(0,d.Vp)(n),c=n.isWebMercator,M=c?102100:4326,m=u.j7[M].maxX,p=u.j7[M].minX,S=u.j7[M].plus180Line,P=u.j7[M].minus180Line),i)if("mesh"===t.type)R.push(t);else if("point"===t.type)R.push(C(t.clone(),m,p));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>C(e,m,p)),R.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,i);R.push(e.rings?new s.A(e):e)}else if(t.extent){const e=t.extent,r=(0,u.kd)(e.xmin,p)*(2*m);let o=0===r?t.clone():(0,u.kS)(t.clone(),r);e.offset(r,0);let{xmin:a,xmax:n}=e;a=Number(a.toFixed(9)),n=Number(n.toFixed(9)),e.intersects(S)&&n!==m?(O=n>O?n:O,o=T(o,c),z.push(o),R.push("cut")):e.intersects(P)&&a!==p?(O=n*(2*m)>O?n*(2*m):O,o=T(o,c,360),z.push(o),R.push("cut")):R.push(o)}else R.push(t.clone());else R.push(t);else R.push(t);let D=(0,u.kd)(O,m),j=-90;const F=D,E=new l.A;for(;D>0;){const e=360*D-180;E.addPath([[e,j],[e,-1*j]]),j*=-1,D--}if(z.length>0&&F>0){const t=_(z,await async function(e,t,r,o){const a=(0,x.Dl)(e),n=t[0].spatialReference,i={...o,responseType:"json",query:{...a.query,f:"json",sr:(0,d.YX)(n),target:JSON.stringify({geometryType:(0,v.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},s=await(0,f.A)(a.path+"/cut",i),{cutIndexes:l,geometries:c=[]}=s.data;return{cutIndexes:l,geometries:c.map(e=>{const t=(0,g.rS)(e);return t.spatialReference=n,t})}}(a,z,E,r)),o=[],n=[];for(let r=0;r<R.length;r++){const a=R[r];if("cut"!==a)n.push(a);else{const a=t.shift(),i=e[r];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&a.rings.length>=i.rings.length?(o.push(a),n.push("simplify")):n.push(c?(0,h.Gh)(a):a)}}if(!o.length)return n;const i=await async function(e,t,r){const o="string"==typeof e?(0,b.An)(e):e,a=t[0].spatialReference,n=(0,v.$B)(t[0]),i={...r,query:{...o.query,f:"json",sr:(0,d.YX)(a),geometries:JSON.stringify((0,y.X)(t))}},{data:s}=await(0,f.A)(o.path+"/simplify",i);return(0,y.V)(s.geometries,n,a)}(a,o,r),s=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?s.push(t):s.push(c?(0,h.Gh)(i.shift()):i.shift())}return s}const B=[];for(let e=0;e<R.length;e++){const t=R[e];if("cut"!==t)B.push(t);else{const e=z.shift();B.push(!0===c?(0,h.Gh)(e):e)}}return B}function P(e,t,r){const o=(0,d.Vp)(r);if(null==o)return e;const[a,n]=o.valid,i=2*n;let s=0,l=0;t>n?s=Math.ceil(Math.abs(t-n)/i):t<a&&(s=-Math.ceil(Math.abs(t-a)/i)),e>n?l=Math.ceil(Math.abs(e-n)/i):e<a&&(l=-Math.ceil(Math.abs(e-a)/i));let c=e+(s-l)*i;const u=c-t;return u>n?c-=i:u<a&&(c+=i),c}function O(e){const t=(0,d.Vp)(e);if(null==t)return null;const[r,o]=t.valid;return new a.hr(r,o)}const z=O(c.A.WGS84);O(c.A.WebMercator)},80754(e,t,r){r.d(t,{kS:()=>c,kd:()=>l,r8:()=>u});var o=r(82799),a=r(16930),n=r(60408),i=r(52006);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new o.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator}),minus180Line:new o.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new o.A({paths:[[[180,-180],[180,180]]],spatialReference:a.A.WGS84}),minus180Line:new o.A({paths:[[[-180,-180],[-180,180]]],spatialReference:a.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function c(e,t){if((0,i.Ed)(e))for(const r of function(e){return(0,n.Bi)(e)?e.curveRings:e.curvePaths}(e))for(const e of r){if((0,i.aO)(e)){const[r,o]=e.c;r[0]+=t,o[0]+=t;continue}if((0,i.FG)(e)){const[r,o]=e.a;r[0]+=t,o[0]+=t;continue}if((0,i.n1)(e)){const[r,o,a]=e.b;r[0]+=t,o[0]+=t,a[0]+=t;continue}e[0]+=t}for(const r of u(e))for(const e of r)e[0]+=t;return e}function u(e){return(0,n.Bi)(e)?e.rings:e.paths}r.d(t,["j7",0,s])},27921(e,t,r){r.d(t,{$Q:()=>y,C:()=>s,Cr:()=>u,H:()=>M,O_:()=>c,Qj:()=>l,T7:()=>x,Tj:()=>b,lU:()=>d,mN:()=>S,vE:()=>T,vt:()=>i});var o=r(34727),a=r(35522),n=r(51850);function i(e=C){return[e[0],e[1],e[2],e[3]]}function s(e,t){return function(e,t,r,o,a=i()){return a[0]=e,a[1]=t,a[2]=r,a[3]=o,a}(t[0],t[1],t[2],t[3],e)}function l(e){return e}function c(e,t,r){const o=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],a=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r[3]=-(r[0]*e[0]+r[1]*e[1]+r[2]*e[2]),r}function u(e,t,r,o=i()){const a=r[0]-t[0],n=r[1]-t[1],s=r[2]-t[2],l=e[0]-t[0],c=e[1]-t[1],u=e[2]-t[2],d=n*u-s*c,h=s*l-a*u,m=a*c-n*l,p=d*d+h*h+m*m,f=Math.abs(p-1)>1e-5&&p>1e-12?1/Math.sqrt(p):1;return o[0]=d*f,o[1]=h*f,o[2]=m*f,o[3]=-(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]),o}function d(e,t,r,o=0,n=Math.floor(r*(1/3)),i=Math.floor(r*(2/3))){if(r<3)return!1;t(m,o);let s=n,l=!1;for(;s<r-1&&!l;)t(p,s),s++,l=!(0,a.t2)(m,p);if(!l)return!1;for(s=Math.max(s,i),l=!1;s<r&&!l;)t(f,s),s++,(0,a.Re)(v,m,p),(0,a.S8)(v,v),(0,a.Re)(g,p,f),(0,a.S8)(g,g),l=!(0,a.t2)(m,f)&&!(0,a.t2)(p,f)&&Math.abs((0,a.Om)(v,g))<h;return l?(u(m,p,f,e),!0):(0!==o||1!==n||2!==i)&&d(e,t,r,0,1,2)}r(78955),r(44280),r(32114),r(32728);const h=.99619469809,m=(0,n.vt)(),p=(0,n.vt)(),f=(0,n.vt)(),v=(0,n.vt)(),g=(0,n.vt)();function x(e,t,r){return function(e){return 0===e||1===e}(T(e,t.origin,t.vector,0,r))}function b(e,t){return S(e,t)>=0}function y(e,t){return function(e,t,r,o,n,i,s){const l=(0,a.Om)(e,r),c=S(e,t);if(l>-1e-6&&l<1e-6)return w(c,n,i);const u=-c/l,d=w(l,n,!1);return!(s&&!d&&!w(c,n,i))&&(d?u>o.c0&&(o.c0=u):u<o.c1&&(o.c1=u),o.c0<=o.c1)}(e,t.ray.origin,t.ray.direction,t,!1,!1,!0)}function w(e,t,r){return r?t?e>=0:e<=0:t?e>0:e<0}function M(e,t,r,o=!1){let n=t.at(-1),i=S(e,n),s=o?i>0:i<=0;for(let l=0;l<t.length;l++){const c=t.at(l),u=S(e,c),d=o?u>0:u<=0;s!==d&&(0,a.Cc)(r(),n,c,i/(i-u)),d&&(0,a.C)(r(),c),n=c,i=u,s=d}}function S(e,t){return(0,a.Om)(e,t)+e[3]}function T(e,t,r,n,i){const s=(0,a.Om)(e,r),l=S(e,t);if(0===s)return l>=0?2:3;let c=-l/s;return 1&n&&(c=(0,o.qE)(c,0,1)),!(4&n)&&c<0||!(8&n)&&c>1?l>=0?2:3:((0,a.WQ)(i,t,(0,a.hs)(i,r,c)),l>=0?0:1)}const C=[0,0,1,0];(0,n.vt)()},44280(e,t,r){r.d(t,{g7:()=>s,gr:()=>i});var o=r(34727),a=r(35522),n=r(51850);function i(e,t){return(0,a.Om)(e,t)/(0,a.Bw)(e)}function s(e,t){const r=(0,a.Om)(e,t)/((0,a.Bw)(e)*(0,a.Bw)(t));return-(0,o.XM)(r)}(0,n.vt)(),(0,n.vt)()},32114(e,t,r){r.d(t,{Rc:()=>m,rq:()=>d,Km:()=>h}),r(44208);var o=r(26390),a=r(29242),n=r(9093),i=r(82534),s=r(48163),l=r(51850),c=r(91829);class u{constructor(e){this._create=e,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,o.d)(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const e=2*this._itemsPtr;this._items.length>e&&(this._items.length=e),this._itemsPtr=0}static createVec2f64(){return new u(s.vt)}static createVec3f64(){return new u(l.vt)}static createVec4f64(){return new u(c.vt)}static createMat3f64(){return new u(a.vt)}static createMat4f64(){return new u(n.vt)}static createQuatf64(){return new u(i.vt)}get test(){}}u.createVec2f64();const d=u.createVec3f64(),h=u.createVec4f64(),m=(u.createMat3f64(),u.createMat4f64());u.createQuatf64()},38969(e,t,r){r.d(t,{i:()=>a});var o=r(37955);function a(e,t){return new Promise((r,a)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,o.Oo)(e,"canplay",r)),t((0,o.Oo)(e,"error",a)))})}},92300(e,t,r){r.d(t,{V:()=>i,X:()=>n});var o=r(60408),a=r(65864);function n(e){return{geometryType:(0,o.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function i(e,t,r){const o=(0,a.xD)(t);return e.map(e=>{const t=o.fromJSON(e);return t.spatialReference=r,t})}},21015(e,t,r){r.d(t,{R:()=>l});var o=r(11254),a=r(60999),n=r(49186),i=r(17676),s=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,s.DB)(e)?((0,i.Te)(t),(0,s.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 s=await(0,a.Ke)((0,o.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,i.QP)(s.error),new n.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>i});var o=r(34275),a=r(97146),n=r(63907);function i(e,t){switch(t){case n.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,a.tM)(e):(0,o.mg)(e)?new Uint16Array(e):e}(e);case n.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,o=(0,a.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(o[e++]=t,o[e++]=t+1,o[e++]=t+2):(o[e++]=t+1,o[e++]=t,o[e++]=t+2)}else{let t=0;for(let a=0;a<r;a+=1)a%2==0?(o[t++]=e[a],o[t++]=e[a+1],o[t++]=e[a+2]):(o[t++]=e[a+1],o[t++]=e[a],o[t++]=e[a+2])}return o}(e);case n.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,o=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)o[e++]=0,o[e++]=t+1,o[e++]=t+2;return o}const a=e[0];let n=e[1],i=0;for(let t=0;t<r;++t){const r=e[t+2];o[i++]=a,o[i++]=n,o[i++]=r,n=r}return o}(e)}}},51530(e,t,r){r.d(t,{KB:()=>i,Xi:()=>a,pn:()=>s,x3:()=>n});var o=r(44208);class a{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function n(e){return"encoded-mesh-texture"===e?.type}async function i(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function s(e,t){if("image/ktx2"===t)return new a(e);const r=new Blob([e],{type:t});let n=URL.createObjectURL(r);switch(t){case"image/jpeg":n+="#.jpg";break;case"image/png":n+="#.png"}const i=new Image;if((0,o.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{a(),e(i)},o=e=>{a(),t(e)},a=()=>{URL.revokeObjectURL(n),i.removeEventListener("load",r),i.removeEventListener("error",o)};i.addEventListener("load",r),i.addEventListener("error",o),i.src=n});try{i.src=n,await i.decode()}catch{}return URL.revokeObjectURL(n),i}},77691(e,t,r){r.d(t,{fetch:()=>Ct});var o=r(40876),a=r(61473),n=r(34727),i=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),h=r(51850),m=r(70328);function p(e,t=!1){return e<=1024?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var f=r(13030),v=r(73354),g=r(50867),x=r(43609),b=r(21015),y=r(84498),w=r(51530),M=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:M.uY,r=null!=e.rotation?e.rotation:0,o=null!=e.scale?e.scale:M.Un,a=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),n=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(o[0],0,0,0,o[1],0,0,0,1),c=(0,s.vt)();return(0,i.lw)(c,n,l),(0,i.lw)(c,a,c),c}class T{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 T,this.numberOfVertices=0}}var _=r(11254),I=r(60999),P=r(49186),O=r(53966),z=r(69397);class R{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 o=this._outer.get(e);o?o.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,o]of t)yield[e,r,o]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,o)=>e(t,r,o)))}copy(){const e=new R;return this.forAll((t,r,o)=>e.set(r,o,t)),e}}var D=r(17676),j=r(46140),F=r(97146),E=r(31217),B=r(46610),H=r(67499),W=r(18845),N=r(49255),A=r(97768),G=r(92130),L=r(65786);class V extends G.A{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,A.Gz)(this._texture),this._textureNormal=(0,A.Gz)(this._textureNormal),this._textureEmissive=(0,A.Gz)(this._textureEmissive),this._textureOcclusion=(0,A.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,A.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new U(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,A.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,D.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,A.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class k extends L.Y{constructor(e=null){super(),this.textureEmissive=e}}class U extends k{constructor(e,t,r,o,a,n,i){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=o,this.textureMetallicRoughness=a,this.scale=n,this.normalTextureTransformMatrix=i}}var $=r(11725),q=r(620);class Z{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const Y=(0,m.vt)();function J(e,t,r,o,a,n){if(!e.visible)return;const i=(0,d.jb)(le,o,r),{tolerance:s}=t,l=new Z(s,!1,t.options.normalRequired);if(e.boundingInfo)(0,q.vA)(0===e.type),X(e.readPrimitivePosition,e.boundingInfo,r,i,s,a,l,n);else{const t=e.readPrimitivePosition;!function(e,t,r,o,a,n,i,s){const l=t,c=ce,u=Math.abs(l[0]),h=Math.abs(l[1]),m=Math.abs(l[2]),p=u>=h?u>=m?0:2:h>=m?1:2,f=p,v=l[f]<0?2:1,g=(p+v)%3,x=(p+(3-v))%3,b=l[g]/l[f],y=l[x]/l[f],w=1/l[f],M=ee,S=te,T=re,{normalRequired:C}=i;for(let t=r;t<o;++t){const r=3*t;a(c[0],r),a(c[1],r+1),a(c[2],r+2),n&&(n.applyToVertex(c[0],c[0][0],c[0][1],c[0][2],t),n.applyToVertex(c[1],c[1][0],c[1][1],c[1][2],t),n.applyToVertex(c[2],c[2][0],c[2][1],c[2][2],t)),(0,d.jb)(M,c[0],e),(0,d.jb)(S,c[1],e),(0,d.jb)(T,c[2],e);const o=M[g]-b*M[f],i=M[x]-y*M[f],l=S[g]-b*S[f],u=S[x]-y*S[f],h=T[g]-b*T[f],m=T[x]-y*T[f],p=h*u-m*l,v=o*m-i*h,_=l*i-u*o;if((p<0||v<0||_<0)&&(p>0||v>0||_>0))continue;const I=p+v+_;if(0===I)continue;const P=p*(w*M[f])+v*(w*S[f])+_*(w*T[f]);if(P*Math.sign(I)<0)continue;const O=P/I;O>=0&&s(O,O,C?ae(c):null,t)}}(r,i,0,e.faceCount,t,a,l,n)}}const K=(0,h.vt)();function X(e,t,r,o,a,n,i,s){if(null==t)return;const l=function(e,t){return(0,d.hZ)(t,1/e[0],1/e[1],1/e[2])}(o,K);if((0,m.C)(Y,t.box),null!=n&&n.applyToAabb(Y),function(e,t,r,o){return function(e,t,r,o){const a=(e[0]-o-t[0])*r[0],n=(e[3]+o-t[0])*r[0];let i=Math.min(a,n),s=Math.max(a,n);const l=(e[1]-o-t[1])*r[1],c=(e[4]+o-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(i=Math.max(i,Math.min(l,c)),i>s)return!1;const u=(e[2]-o-t[2])*r[2],d=(e[5]+o-t[2])*r[2];return s=Math.min(s,Math.max(u,d)),!(s<0)&&(i=Math.max(i,Math.min(u,d)),!(i>s)&&i<1/0)}(e,t,r,o)}(Y,r,l,a)){const{primitiveIndices:l}=t,c=l.length;if(c>1e3){const l=t.children;if(void 0!==l){for(const t of l)X(e,t,r,o,a,n,i,s);return}}!function(e,t,r,o,a,n,i,s,l){const c=e[0],u=e[1],d=e[2],h=t[0],m=t[1],p=t[2],{normalRequired:f}=s;for(let e=0;e<o;++e){const t=n[e],r=3*t;let[o,s,v]=a(de,r),[g,x,b]=a(de,r+1),[y,w,M]=a(de,r+2);null!=i&&([o,s,v]=i.applyToVertex(ue,o,s,v,e),[g,x,b]=i.applyToVertex(ue,g,x,b,e),[y,w,M]=i.applyToVertex(ue,y,w,M,e));const S=g-o,T=x-s,C=b-v,_=y-o,I=w-s,P=M-v,O=m*P-I*p,z=p*_-P*h,R=h*I-_*m,D=S*O+T*z+C*R,j=D*D;if(j<=se)continue;const F=c-o,E=u-s,B=d-v,H=(F*O+E*z+B*R)*D;if(H<0||H>j)continue;const W=E*C-T*B,N=B*S-C*F,A=F*T-S*E,G=(h*W+m*N+p*A)*D;if(G<0||H+G>j)continue;const L=(_*W+I*N+P*A)/D;L>=0&&l(L,L,f?oe(S,T,C,_,I,P,Q):null,t)}}(r,o,0,c,e,l,n,i,s)}}const Q=(0,h.vt)();const ee=(0,h.vt)(),te=(0,h.vt)(),re=(0,h.vt)();function oe(e,t,r,o,a,n,i){return(0,d.hZ)(ne,e,t,r),(0,d.hZ)(ie,o,a,n),(0,d.$A)(i,ne,ie),(0,d.S8)(i,i),i}function ae(e){return(0,d.jb)(ne,e[1],e[0]),(0,d.jb)(ie,e[2],e[0]),(0,d.$A)(Q,ne,ie),(0,d.S8)(Q,Q),Q}const ne=(0,h.vt)(),ie=(0,h.vt)(),se=1e-7*1e-7,le=(0,h.vt)(),ce=[(0,h.vt)(),(0,h.vt)(),(0,h.vt)()],ue=(0,h.vt)(),de=(0,h.vt)();var he=r(75956),me=r(16396),pe=r(59907);class fe{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,o,a){null!=a&&(0,pe.vJ)(r,o,this.layout,e,t,a)}}var ve=r(33442),ge=r(47724);const xe=new ge.L,be=2e-5,ye=2e-6,we=(0,h.vt)();var Me=r(43616),Se=r(5482),Te=r(91429),Ce=r(91829),_e=r(4431),Ie=r(1843),Pe=r(72824),Oe=r(13840),ze=r(98958),Re=r(16943),De=r(33524),je=r(56133);r(4576),r(66289);var Fe=r(69622),Ee=r(65529),Be=r(32728);class He{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",f.Eq),this.color=e.getField("instanceColor",f.XP),this.olidColor=e.getField("instanceOlidColor",f.XP),this.state=e.getField("state",f.SL),this.lodLevel=e.getField("lodLevel",f.SL)}}let We=class extends Fe.A{constructor(e,t){super(e),this.events=new Ee.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Ae(Ne.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Ue,this._buffer=this._layout.createBuffer(this._capacity),this._view=new He(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,q.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,q.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=Ge,o=Le;t.localTransform.getMat(e,Ve),t.globalTransform.getMat(e,ke);const a=(0,l.lw)(ke,ke,Ve);(0,d.hZ)(r,a[12],a[13],a[14]),t.modelOrigin.setVec(e,r),(0,i.z0)(o,a),t.model.setMat(e,o);const n=(0,Be.wp)(Ge,a);n.sort(),t.modelScaleFactors.set(e,0,n[1]),t.modelScaleFactors.set(e,1,n[2]),(0,i.B8)(o,o),(0,i.mg)(o,o),t.modelNormal.setMat(e,o),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,Le),r.modelOrigin.getVec(e,Ge),t[0]=Le[0],t[1]=Le[1],t[2]=Le[2],t[3]=0,t[4]=Le[3],t[5]=Le[4],t[6]=Le[5],t[7]=0,t[8]=Le[6],t[9]=Le[7],t[10]=Le[8],t[11]=0,t[12]=Ge[0],t[13]=Ge[1],t[14]=Ge[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(Ge,this,e),t*=Math.max(Ge[0],Ge[1],Ge[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Ge,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Ge[0],Ge[1],Ge[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,o=r.get(e);t?t!==o&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):o&&(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(Ue,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new He(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,Se.Cg)([(0,Te.MZ)({constructOnly:!0})],We.prototype,"shaderTransformation",void 0),(0,Se.Cg)([(0,Te.MZ)()],We.prototype,"_size",void 0),(0,Se.Cg)([(0,Te.MZ)({readOnly:!0})],We.prototype,"size",null),We=(0,Se.Cg)([(0,Te.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],We);const Ne=(0,Ie.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Ae(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Re.E)()&&e.vec4u8("instanceOlidColor"),e}const Ge=(0,h.vt)(),Le=(0,s.vt)(),Ve=(0,c.vt)(),ke=(0,c.vt)(),Ue=64,$e=(0,Ie.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var qe=r(74810),Ze=r(28491),Ye=r(90644),Je=r(49788);class Ke extends Pe.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=qe.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,Ce.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.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Je.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}}Pe.gy;let Xe=class extends ze.w{constructor(e,t){let o=(0,_e.U)(tt(t));t.instanced&&t.instancedDoublePrecision&&(o=o.concat((0,_e.U)(function(e){return Ae($e.clone(),e)}(t)))),super(e,t,o),this.shader=new Oe.r(Ze.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:o,cullFace:a,customDepthTest:n,hasOccludees:i}=e;return(0,Ye.Ey)({blending:o?(0,De.Yf)(r,!1,e.emissionDimmingPass):null,culling:et(e)?(0,Ye.Xt)(a):null,depthTest:(0,De.mt)(r,Qe(n)),depthWrite:(0,De.z5)(e),colorWrite:Ye.kn,stencilWrite:i?je.v0:null,stencilTest:i?t?je.Ax:je.cP:null,polygonOffset:(0,ve.s)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Qe(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function et(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function tt(e){const t=(0,Ie.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,Re.E)()&&t.vec4u8("olidColor"),t}Xe=(0,Se.Cg)([(0,Te.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Xe);var rt=r(51976);class ot extends ge.L{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.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,this.renderOccluded=!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}}(0,Se.Cg)([(0,rt.W)({count:4})],ot.prototype,"alphaDiscardMode",void 0),(0,Se.Cg)([(0,rt.W)({count:3})],ot.prototype,"doubleSidedMode",void 0),(0,Se.Cg)([(0,rt.W)({count:8})],ot.prototype,"pbrMode",void 0),(0,Se.Cg)([(0,rt.W)({count:3})],ot.prototype,"cullFace",void 0),(0,Se.Cg)([(0,rt.W)({count:3})],ot.prototype,"normalType",void 0),(0,Se.Cg)([(0,rt.W)({count:3})],ot.prototype,"customDepthTest",void 0),(0,Se.Cg)([(0,rt.W)({count:8})],ot.prototype,"emissionSource",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVertexColors",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasSymbolColors",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVerticalOffset",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasColorTexture",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasMetallicRoughnessTexture",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasOcclusionTexture",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasNormalTexture",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasScreenSizePerspective",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVertexTangents",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasOccludees",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"instanced",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"instancedDoublePrecision",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasModelTransformation",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"offsetBackfaces",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVVSize",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVVColor",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"receiveShadows",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasShadowHighlights",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"receiveAmbientOcclusion",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"receiveGlobalIllumination",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"textureAlphaPremultiplied",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"instancedFeatureAttribute",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"instancedColor",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"writeDepth",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"snowCover",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasColorTextureTransform",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasEmissionTextureTransform",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasNormalTextureTransform",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasOcclusionTextureTransform",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasMetallicRoughnessTextureTransform",void 0);var at=r(57323);let nt=class extends Xe{constructor(){super(...arguments),this.shader=new Oe.r(at.R,()=>r.e(2314).then(r.bind(r,39933)))}};nt=(0,Se.Cg)([(0,Te.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],nt);class it extends rt.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,Se.Cg)([(0,rt.W)()],it.prototype,"receiveShadows",void 0);class st extends $.i{constructor(e,t){super(e,ct),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,N.uw)(e)&&!this.transparent],[4,e=>(0,N.uw)(e)&&this.transparent]]),this._layout=tt(this.parameters),this._configuration=new ot(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:o}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(o[3])?1:o[3])>=Je.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,h.uY)}get emissions(){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:o,doubleSided:a,doubleSidedType:n}=t;r.hasVertexTangents=!o&&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=o?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!o&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=o?2:a&&"normal"===n?1:a&&"winding-order"===n?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,N._o)(e.output)?(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&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7: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}intersectRay(e,t,r,o,a,n){const i=this._getMaterialVerticalOffset(t,r);null!=i&&(o=(0,d.Re)(ut,o,i),a=(0,d.Re)(dt,a,i)),n=function(e,t,r,o){xe.output=t.transparent?1:0,xe.polygonOffset=t.polygonOffset,xe.enableOITOffset=t.enableOITOffset;const a=(0,ve.s)(xe);if(!a)return e;const n=ye*a.units,i=(0,d.oW)(we,o,r);return(t,r,o,s)=>{const l=(o?1-Math.abs((0,d.Om)(i,o)):0)*a.factor*be+n;return e(t,r+l,o,s)}}(n,this._configuration,o,a),J(e,r,o,a,(0,me.ou)(r.verticalOffset),n)}intersectScreenPolygon(e,t,r,o){return function(e,t,r){return null==e?null:(e.distance=function(e,t,r,o,a){const n=(0,ve.s)(r);return n?function({units:e,factor:t},r,o,a){const n=ye*e;return o+((a?1-Math.abs((0,d.Om)(r,a)):0)*t*be+n)}(n,(0,d.oW)(we,a,o),e,t):e}(e.distance,e.hasNormal?e.normal:null,t,r,e.point),e)}((0,he.MJ)(e,r,t,o,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new lt(e)}createBufferWriter(){return new fe(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:o,texture:a,textureId:n,textureAlphaMode:i,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||o<1||(null!=a||null!=n)&&1!==i&&2!==i&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){const r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,o,a)=>(e[0]=t+r[0],e[1]=o+r[1],e[2]=a+r[2],e),applyToAabb:e=>((0,m.Ne)(e,(0,d.WQ)(gt,(0,m.pg)(e,gt),r)),(0,m.vI)(e,(0,d.WQ)(gt,(0,m.Lu)(e,gt),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;const r=t.camera;(0,d.hZ)(pt,e[12],e[13],e[14]);let o=null;switch(t.viewingMode){case 1:o=(0,d.S8)(mt,pt);break;case 2:o=(0,d.C)(mt,ht)}const a=(0,d.Re)(ft,pt,r.eye),n=(0,d.Bw)(a),i=(0,d.hs)(a,a,1/n);let s=null;this.parameters.screenSizePerspective&&(s=(0,d.Om)(o,i));const l=(0,Me.kE)(r,n,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,d.hs)(o,o,l),(0,d.ei)(vt,o,t.transform.inverseRotation)}}class lt extends V{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?nt:Xe,e)}}class ct extends Ke{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!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 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 ut=(0,h.vt)(),dt=(0,h.vt)(),ht=(0,h.fA)(0,0,1),mt=(0,h.vt)(),pt=(0,h.vt)(),ft=(0,h.vt)(),vt=(0,h.vt)(),gt=(0,h.vt)(),xt=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class bt{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function yt(e){const t=e.params,r=t.topology;let o=!0;switch(t.vertexAttributes||(xt().warn("Geometry must specify vertex attributes"),o=!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&&(xt().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),o=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(xt().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),o=!1)):(xt().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),o=!1)}}else xt().warn("Indexed geometries must specify faces"),o=!1;break}default:xt().warn(`Unsupported topology '${r}'`),o=!1}e.params.material||(xt().warn("Geometry requires material"),o=!1);const a=e.params.vertexAttributes;for(const e in a)a[e].values||(xt().warn("Geometries with externally defined attributes are not yet supported"),o=!1);return o}function wt(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&(0,m.RF)(t,r.box)}),t}function Mt(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function St(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Tt=new j.A(1,2,"wosr");async function Ct(e,t){const s=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}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,a.EM)(e));if("wosr"===s.fileType){const e=await(t.cache?t.cache.loadWOSR(s.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,I.Ke)((0,_.A)(e,t));if(r.ok)return r.value.data;(0,D.QP)(r.error),function(e){throw new P.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),o=await async function(e,t){const r=new Array;for(const o in e){const a=e[o],n=a.images[0].data;if(!n){xt().warn("Externally referenced texture data is not yet supported");continue}const i=a.encoding+";base64,"+n,s="/textureDefinitions/"+o,l="rgba"===a.channels?a.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==Mt(l)},u=t?.disableTextures?Promise.resolve(null):(0,E.D)(i,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}const o=await Promise.all(r),a={};for(const e of o)a[e.refId]=e;return a}(r.textureDefinitions??{},t);let a=0;for(const e in o)if(o.hasOwnProperty(e)){const t=o[e];a+=t?.image?t.image.width*t.image.height*4:0}return new bt(r,o,a+(0,z.Qh)(r))}(s.url,t)),{engineResources:r,referenceBoundingBox:o}=function(e,t){const r=new Array,o=new Array,a=new Array,n=new R,i=e.resource,s=j.A.parse(i.version||"1.0","wosr");Tt.validate(s);const l=i.model.name,c=i.model.geometries,u=i.materialDefinitions??{},d=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const i=c[e];if(!yt(i))continue;const s=St(i),l=i.params.vertexAttributes,f=[],v=e=>{if("PerAttributeArray"===i.params.topology)return null;const t=i.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l.position,x=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,o=v(e)??(0,F.tM)(x);f.push([e,new B.n(r,o,t.valuesPerElement,!0)])}const b=s.texture,y=d&&d[b];if(y&&!p.has(b)){const{image:e,parameters:t}=y,r=new W.h(e,t);o.push(r),p.set(b,r)}const w=p.get(b),M=w?w.id:void 0,S=s.material;let T=n.get(S,b);if(null==T){const e=u[S.slice(S.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=y?Mt(y.alphaChannelUsage):void 0,o={ambient:(0,h.ci)(e.diffuse),diffuse:(0,h.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:M,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(o,t.materialParameters),T=new st(o,t),n.set(S,b,T)}a.push(T);const C=new H.V(T,f);m+=f.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(C)}return{engineResources:[{name:l,stageResources:{textures:o,materials:a,geometries:r},pivotOffset:i.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:wt(r)}}(e,t);return{lods:r,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}let M;if(t.cache)M=await t.cache.loadGLTF(s.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));M=await e(new b.R,s.url,t,t.usePBR,t.useEmissive)}const{engineResources:T,referenceBoundingBox:O}=function(e,t,r){const a=e.model,s=e.meta,b=a.meta?.ESRI_proxyEllipsoid,M=s.isEsriSymbolResource&&null!=b&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;M&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const a of o.parts){const o=a.attributes.normal;if(null==o)return;const n=a.attributes.position,i=n.count,s=(0,h.vt)(),u=(0,h.vt)(),m=(0,h.vt)(),p=new Float32Array(4*i),v=new Float32Array(3*i),g=(0,l.B8)((0,c.vt)(),a.transform);let x=0,b=0;for(let l=0;l<i;l++){n.getVec(l,u),o.getVec(l,s),(0,d.Z0)(u,u,a.transform),(0,d.Re)(m,u,t.center),(0,d.Qr)(m,m,t.radius);const i=m[2],c=(0,d.Bw)(m),h=Math.min(.45+.55*c*c,1)**2.2;(0,d.Qr)(m,m,t.radius),null!==g&&(0,d.Z0)(m,m,g),(0,d.S8)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.Cc)(m,m,s,i>-1?.2:Math.min(-4*i-3.8,1)),v[x]=m[0],v[x+1]=m[1],v[x+2]=m[2],x+=3,p[b]=h,p[b+1]=h,p[b+2]=h,p[b+3]=1,b+=4}a.attributes.normal=new f.xs(v.buffer),a.attributes.color=new f.Eq(p.buffer)}}}(e,b));const T=!!t.usePBR,_=s.isEsriSymbolResource?{usePBR:T,isSchematic:!1,treeRendering:M,mrrFactors:qe.SY}:{usePBR:T,isSchematic:!1,treeRendering:!1,mrrFactors:qe.mb},I={...t.materialParameters,treeRendering:M},P=new Array,O=new Map,z=new Map,R=a.lods.length,D=(0,m.Ie)();return a.lods.forEach((e,s)=>{const l=!0===t.skipHighLods&&(R>1&&0===s||R>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;const c=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new st({},t):function(e,t,r,a,n,i,s,l,c){const d=e.materials.get(t.material);if(null==d)return null;const{normal:m,color:p,texCoord0:f,tangent:v}=t.attributes,g=t.material+(m?"_normal":"")+(p?"_color":"")+(f?"_texCoord0":"")+(v?"_tangent":""),x=null!=t.attributes.texCoord0,b=null!=t.attributes.normal,y=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!i.has(g)){if(x){const t=(t,r=!1,o=!1)=>{if(null!=t&&!s.has(t)){const a=e.textures.get(t);if(a){const e=a.data,n=r&&!(0,w.x3)(e)?l.compressionOptions:void 0;s.set(t,new W.h((0,w.x3)(e)?e.data:e,{...a.parameters,preMultiplyAlpha:!(0,w.x3)(e)&&o,encoding:(0,w.x3)(e)?e.encoding:void 0,compressionOptions:n}))}}},r=1!==y&&!c;t(d.colorTexture,r,1!==y),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}const r=(0,o.xV)(d.color[0]),m=(0,o.xV)(d.color[1]),p=(0,o.xV)(d.color[2]),f=null!=d.colorTexture&&x?s.get(d.colorTexture):null,v=(0,qe.Jr)(d),M=null!=d.normalTextureTransform?.scale?d.normalTextureTransform?.scale:u.Un;i.set(g,new st({...a,customDepthTest:1,textureAlphaMode:y,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,m,p],ambient:[r,m,p],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:b?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,unlit:d.unlit,textureId:null!=f?f.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&x?s.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=f&&!!f.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&x?s.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&x&&!d.unlit?s.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&x?s.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:d.unlit?h.uY:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null!=d.emissiveStrengthKHR?d.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=n.emissiveStrengthFromSymbol?n.emissiveStrengthFromSymbol:void 0,mrrFactors:v?qe.Bt:[d.metallicFactor,d.roughnessFactor,a.mrrFactors[2]],isSchematic:v,colorTextureTransformMatrix:S(d.colorTextureTransform),normalTextureTransformMatrix:S(d.normalTextureTransform),scale:[M[0],M[1]],occlusionTextureTransformMatrix:S(d.occlusionTextureTransform),emissiveTextureTransformMatrix:S(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(d.metallicRoughnessTextureTransform),...n},l))}const M=i.get(g);if(r.stageResources.materials.push(M),x){const e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return M}(a,e,c,_,I,O,z,t,M),{geometry:d,vertexCount:b}=function(e,t){const r=e.attributes.position.count,o=(0,y.x)(e.indices||r,e.primitiveType),a=p(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,v.t)(a,s,e.transform,3,l);const c=[["position",new B.n(a,o,3,!0)]];if(null!=e.attributes.normal){const t=p(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.normal;(0,i.Ge)(_t,e.transform),(0,v.b)(t,a,_t,3,s),(0,n.or)(_t)&&(0,v.n)(t,t),c.push(["normal",new B.n(t,o,3,!0)])}if(null!=e.attributes.tangent){const t=p(4*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.tangent;(0,i.z0)(_t,e.transform),(0,g.t)(t,a,_t,4,s),(0,n.or)(_t)&&(0,v.n)(t,t,4),c.push(["tangent",new B.n(t,o,4,!0)])}if(null!=e.attributes.texCoord0){const t=p(2*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.texCoord0;(0,x.a)(t,a,2,n),c.push(["uv0",new B.n(t,o,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof f.Eq?(0,g.b)(t,u,1,255):(u instanceof f.XP||u instanceof f.Uz)&&(0,g.b)(t,u,1/255,255):(t.fill(255),u instanceof f.xs?(0,v.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof f.eI||e.attributes.color instanceof f.nS)&&(0,v.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new B.n(t,o,4,!0)])}return{geometry:new H.V(t,c),vertexCount:r}}(e,r??new st({},t)),T=d.boundingInfo;null!=T&&0===s&&(0,m.RF)(D,T.box),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=b)}),l||P.push(c)}),{engineResources:P,referenceBoundingBox:D}}(M,t,s.specifiedLodIndex);return{lods:T,referenceBoundingBox:O,isEsriSymbolResource:M.meta.isEsriSymbolResource,isWosr:!1}}const _t=(0,s.vt)()},32728(e,t,r){r.d(t,{YH:()=>s,hG:()=>n,nu:()=>l,wp:()=>i}),r(34727);var o=r(35522),a=r(51850);function n(e){const t=e[0]*e[0]+e[4]*e[4]+e[8]*e[8],r=e[1]*e[1]+e[5]*e[5]+e[9]*e[9],o=e[2]*e[2]+e[6]*e[6]+e[10]*e[10];return Math.sqrt(Math.max(t,r,o))}function i(e,t){const r=Math.sqrt(t[0]*t[0]+t[4]*t[4]+t[8]*t[8]),a=Math.sqrt(t[1]*t[1]+t[5]*t[5]+t[9]*t[9]),n=Math.sqrt(t[2]*t[2]+t[6]*t[6]+t[10]*t[10]);return(0,o.hZ)(e,r,a,n),e}function s(e,t,r){r=r||e;const a=(0,o.Om)(e,t);(0,o.hZ)(r,e[0]-a*t[0],e[1]-a*t[1],e[2]-a*t[2]),(0,o.S8)(r,r)}function l(e,t,r,n=(0,a.vt)()){const i=(0,o.Bw)(e),s=(0,o.Bw)(t),l=(0,o.Om)(e,t)/(i*s);if(l<.9999999999999999){const a=Math.acos(l),d=((1-r)*i+r*s)/Math.sin(a),h=d/i*Math.sin((1-r)*a),m=d/s*Math.sin(r*a);return(0,o.hs)(c,e,h),(0,o.hs)(u,t,m),(0,o.WQ)(n,c,u)}return(0,o.Cc)(n,e,t,r)}(0,a.vt)(),(0,a.vt)(),(0,a.vt)();const c=(0,a.vt)(),u=(0,a.vt)()},46686(e,t,r){r.d(t,{o:()=>a});var o=r(31821);function a(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(o.H`
662
+ fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,h])},43609(e,t,r){r.d(t,{a:()=>n,f:()=>i,n:()=>a});var o=r(34275);function a(e,t){n(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r=2,a=r){const n=t.length/2;let i=0,s=0;if(!(0,o.iu)(t)||(0,o.dk)(t)){for(let o=0;o<n;++o)e[i]=t[s],e[i+1]=t[s+1],i+=r,s+=a;return}const l=(0,o.a3)(t);if((0,o.JI)(t))for(let o=0;o<n;++o)e[i]=Math.max(t[s]/l,-1),e[i+1]=Math.max(t[s+1]/l,-1),i+=r,s+=a;else for(let o=0;o<n;++o)e[i]=t[s]/l,e[i+1]=t[s+1]/l,i+=r,s+=a}function i(e,t,r,o){const a=e.typedBuffer,n=e.typedBufferStride,i=o?.count??e.count;let s=(o?.dstIndex??0)*n;for(let e=0;e<i;++e)a[s]=t,a[s+1]=r,s+=n}Object.freeze(Object.defineProperty({__proto__:null,fill:i,normalizeIntegerBuffer:n,normalizeIntegerBufferView:a},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>s,c:()=>a,d:()=>i,e:()=>h,f:()=>u,l:()=>c,n:()=>m,t:()=>n}),r(44208);var o=r(72727);function a(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,a=3,n=a){const i=(0,o.k)(e.length,a,3),s=(0,o.k)(t.length,n,3),l=Math.min(i,s),c=r[0],u=r[1],d=r[2],h=r[4],m=r[5],p=r[6],f=r[8],v=r[9],g=r[10],x=r[12],b=r[13],y=r[14];let w=0,M=0;for(let r=0;r<l;r++){const r=t[w],o=t[w+1],i=t[w+2];e[M]=c*r+h*o+f*i+x,e[M+1]=u*r+m*o+v*i+b,e[M+2]=d*r+p*o+g*i+y,w+=n,M+=a}return e}function i(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,a=3,n=a){const i=(0,o.k)(e.length,a,3),s=(0,o.k)(t.length,n,3),l=Math.min(i,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],p=r[5],f=r[6],v=r[7],g=r[8];let x=0,b=0;for(let r=0;r<l;r++){const r=t[x],o=t[x+1],i=t[x+2];e[b]=c*r+h*o+f*i,e[b+1]=u*r+m*o+v*i,e[b+2]=d*r+p*o+g*i,x+=n,b+=a}}function l(e,t,r,o=3,a=o){const n=Math.min(e.length/o,t.length/a);let i=0,s=0;for(let l=0;l<n;l++)e[s]=r*t[i],e[s+1]=r*t[i+1],e[s+2]=r*t[i+2],i+=a,s+=o;return e}function c(e,t,r,o){u(e.typedBuffer,t.typedBuffer,r,o,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,o,a=3,n=a){const i=Math.min(e.length/a,t.length/n);let s=0,l=0;const c=1/2.2;for(let u=0;u<i;u++)e[l]=o*(r*t[s])**c,e[l+1]=o*(r*t[s+1])**c,e[l+2]=o*(r*t[s+2])**c,s+=n,l+=a}function d(e,t,r,a=3,n=a){const i=(0,o.k)(e.length,a,3),s=(0,o.k)(t.length,n,3),l=Math.min(i,s);let c=0,u=0;for(let o=0;o<l;o++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=n,u+=a;return e}function h(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,o=r){const a=Math.min(e.length/r,t.length/o);let n=0,i=0;for(let s=0;s<a;s++){const a=t[n],s=t[n+1],l=t[n+2],c=a*a+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[i]=t*a,e[i+1]=t*s,e[i+2]=t*l}n+=o,i+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:m,normalizeView:h,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const o=Math.min(e.count,t.count),a=e.typedBuffer,n=e.typedBufferStride,i=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<o;e++)a[c]=i[l]>>r,a[c+1]=i[l+1]>>r,a[c+2]=i[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:i,transformMat4:n,transformMat4View:a,translate:d},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>a});var o=r(34727);class a{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return n(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,o.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+i(this.range,e-t,r)}minimalMonotonic(e,t,r){return n(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,o=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(o)?r:o}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function n(e,t,r,o,a=0,n=!1){return(o-=a)<t?o+=i(e,t-o):o>r&&(o-=i(e,o-r)),n&&o===r&&(o=t),o+a}function i(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new a(0,2*Math.PI),l=(new a(-Math.PI,Math.PI),new a(0,360));r.d(t,["ie",0,l,"uC",0,s])},46140(e,t,r){r.d(t,{A:()=>a});var o=r(49186);class a{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 o.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new a(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),i=/^\s*\d+\s*$/;if(!r?.match||!i.test(r))throw new o.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!i.test(n))throw new o.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new a(s,l,t)}}},61473(e,t,r){function o(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function a(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(i)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>a,b5:()=>o});const n=/^devext\.arcgis\.com$/,i=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,n,i,/^jsapps\.esri\.com$/,s,l]},82534(e,t,r){function o(){return[0,0,0,1]}function a(e){return[e[0],e[1],e[2],e[3]]}r.d(t,{o8:()=>a,vt:()=>o});const n=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:n,clone:a,create:o,fromValues:function(e,t,r,o){return[e,t,r,o]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["zK",0,n])},88340(e,t,r){function o(){return new Float32Array(2)}function a(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return o()}function i(){return a(1,1)}function s(){return a(1,0)}function l(){return a(0,1)}r.d(t,{fA:()=>a,vt:()=>o});const c=n(),u=i(),d=s(),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:o,fromValues:a,ones:i,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,u,"uY",0,c])},48163(e,t,r){function o(){return[0,0]}function a(e){return[e[0],e[1]]}function n(e,t){return[e,t]}function i(){return n(1,1)}function s(){return n(-1,-1)}function l(){return n(1,0)}function c(){return n(0,1)}r.d(t,{fA:()=>n,o8:()=>a,vt:()=>o});const u=i(),d=s(),h=l(),m=c();Object.freeze(Object.defineProperty({__proto__:null,NEGATIVE_ONES:d,ONES:u,UNIT_X:h,UNIT_Y:m,ZEROS:[0,0],clone:a,create:o,freeze:function(e,t){return[e,t]},fromArray:function(e,t=[0,0]){const r=Math.min(2,e.length);for(let o=0;o<r;++o)t[o]=e[o];return t},fromValues:n,negativeOnes:s,ones:i,unitX:l,unitY:c,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["IA",0,d,"Un",0,u])},91829(e,t,r){function o(){return[0,0,0,0]}function a(e,t,r,o){return[e,t,r,o]}function n(e,t,r,o){return[e,t,r,o]}function i(){return a(1,1,1,1)}function s(){return a(1,0,0,0)}function l(){return a(0,1,0,0)}function c(){return a(0,0,1,0)}function u(){return a(0,0,0,1)}r.d(t,{CN:()=>n,_Y:()=>u,fA:()=>a,vt:()=>o});const d=[0,0,0,0],h=i(),m=s(),p=l(),f=c(),v=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_W:v,UNIT_X:m,UNIT_Y:p,UNIT_Z:f,ZEROS:d,clone:function(e){return[e[0],e[1],e[2],e[3]]},create:o,freeze:n,fromArray:function(e,t=[0,0,0,0]){const r=Math.min(4,e.length);for(let o=0;o<r;++o)t[o]=e[o];return t},fromValues:a,ones:i,unitW:u,unitX:s,unitY:l,unitZ:c,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,h,"uY",0,d])},78955(e,t,r){r.d(t,{Bw:()=>v,C:()=>a,Cc:()=>y,LI:()=>h,Om:()=>b,S8:()=>x,T9:()=>d,WQ:()=>i,Z0:()=>w,aI:()=>S,hG:()=>f,hZ:()=>n,hs:()=>m,jk:()=>u,m3:()=>g,t2:()=>M});var o=r(34304);function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function n(e,t,r,o,a){return e[0]=t,e[1]=r,e[2]=o,e[3]=a,e}function i(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function s(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function l(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function c(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function u(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function d(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function h(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function m(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function p(e,t){const r=t[0]-e[0],o=t[1]-e[1],a=t[2]-e[2],n=t[3]-e[3];return Math.sqrt(r*r+o*o+a*a+n*n)}function f(e,t){const r=t[0]-e[0],o=t[1]-e[1],a=t[2]-e[2],n=t[3]-e[3];return r*r+o*o+a*a+n*n}function v(e){const t=e[0],r=e[1],o=e[2],a=e[3];return Math.sqrt(t*t+r*r+o*o+a*a)}function g(e){const t=e[0],r=e[1],o=e[2],a=e[3];return t*t+r*r+o*o+a*a}function x(e,t){const r=t[0],o=t[1],a=t[2],n=t[3];let i=r*r+o*o+a*a+n*n;return i>0&&(i=1/Math.sqrt(i),e[0]=r*i,e[1]=o*i,e[2]=a*i,e[3]=n*i),e}function b(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function y(e,t,r,o){const a=t[0],n=t[1],i=t[2],s=t[3];return e[0]=a+o*(r[0]-a),e[1]=n+o*(r[1]-n),e[2]=i+o*(r[2]-i),e[3]=s+o*(r[3]-s),e}function w(e,t,r){const o=t[0],a=t[1],n=t[2],i=t[3];return e[0]=r[0]*o+r[4]*a+r[8]*n+r[12]*i,e[1]=r[1]*o+r[5]*a+r[9]*n+r[13]*i,e[2]=r[2]*o+r[6]*a+r[10]*n+r[14]*i,e[3]=r[3]*o+r[7]*a+r[11]*n+r[15]*i,e}function M(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function S(e,t){const r=e[0],a=e[1],n=e[2],i=e[3],s=t[0],l=t[1],c=t[2],u=t[3],d=(0,o.FD)();return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(n-c)<=d*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))}const T=s,C=l,_=c,I=p,P=f,O=v,z=g;Object.freeze(Object.defineProperty({__proto__:null,add:i,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:a,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:I,distance:p,div:_,divide:c,dot:b,equals:S,exactEquals:M,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:O,length:v,lerp:y,max:d,min:u,mul:C,multiply:l,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:x,random:function(e,t=1){const r=o.Ov;let a,n,i,s,l,c;do{a=2*r()-1,n=2*r()-1,l=a*a+n*n}while(l>=1);do{i=2*r()-1,s=2*r()-1,c=i*i+s*s}while(c>=1);const u=Math.sqrt((1-l)/c);return e[0]=t*a,e[1]=t*n,e[2]=t*i*u,e[3]=t*s*u,e},round:h,scale:m,scaleAndAdd:function(e,t,r,o){return e[0]=t[0]+r[0]*o,e[1]=t[1]+r[1]*o,e[2]=t[2]+r[2]*o,e[3]=t[3]+r[3]*o,e},set:n,sqrDist:P,sqrLen:z,squaredDistance:f,squaredLength:g,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:T,subtract:s,transformMat4:w,transformQuat:function(e,t,r){const o=t[0],a=t[1],n=t[2],i=r[0],s=r[1],l=r[2],c=r[3],u=c*o+s*n-l*a,d=c*a+l*o-i*n,h=c*n+i*a-s*o,m=-i*o-s*a-l*n;return e[0]=u*c+m*-i+d*-l-h*-s,e[1]=d*c+m*-s+h*-i-u*-l,e[2]=h*c+m*-l+u*-s-d*-i,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},56512(e,t,r){function o(e){let t,r,o=[],a=!1;return function(...n){return a&&t===this&&function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}(n,o)||(r=e.apply(this,n),t=this,o=n,a=!0),r}}r.d(t,{B:()=>o})},69397(e,t,r){r.d(t,{Qf:()=>s,Qh:()=>n,lM:()=>a});var o=r(34275);function a(e){if(!e)return 0;let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=i(e[r],!1));return t}function n(e){if(!e)return 0;if("number"==typeof e[0])return s(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=u;for(let o=0;o<t;o++)r+=i(e[o]);return r}(e);let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=i(e[r]));return t}function i(e,t=!0){switch(typeof e){case"object":return t?n(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(...e){return e.reduce((e,t)=>e+(t?(0,o.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,16):0:0),0)}function l(e,t){return u+e.length*t}const c=32,u=16,d=145},65806(e,t,r){r.d(t,{g:()=>i});var o=r(51850),a=r(91218),n=r(9762);function i(e,t,r,o){if((0,a.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,n.projectBuffer)(s,e.spatialReference,0,t,r,0);const i=(0,a.tryProject)(e,r,o);return!!i&&(t[0]=i.x,t[1]=i.y,t[2]=i.z??0,!0)}const s=(0,o.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var o=r(91218),a=r(16930),n=r(9762),i=r(65806);function s(e,t,r,a){return!(null==t||null==a||e.length<2)&&((0,o.canProjectWithoutEngine)(t,a)?(0,n.projectBuffer)(e,t,0,r,a,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,i.g)(l,r,a)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:a.A.WGS84,type:"point"}},72727(e,t,r){function o(e,t,r){if(t<=0)return 0;const o=e-r;return o<0?0:Math.floor(o/t)+1}r.d(t,{k:()=>o}),r(53966)},31411(e,t,r){r.d(t,{GS:()=>T,gh:()=>_});var o=r(49186),a=r(56512),n=r(65864),i=r(4305),s=r(50954),l=r(52006),c=r(49663),u=r(46068),d=r(15507);const h=1e-6,m=[0,0];function p(e){return{maxSegmentLength:e.maxSegmentLength??0,maxDeviation:e.maxDeviation??0,maxSegmentsPerCurve:e.maxSegmentsPerCurve??12e3,minSegmentsPerCurve:Math.max(e.minSegmentsPerCurve??1,1)}}class f{constructor(e,t){this.curveStart=e,this.curveEnd=t,this.tStart=0,this.tEnd=0,this.tEndStack=[],this.arcEndStack=[]}get stackSize(){return this.tEndStack.length}initialize(e,t){this.tStart=0,this.arcStart=e,this.tEndStack.push(1),this.arcEndStack.push(t)}splitAt(e){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(e),this.arcEndStack.push(this.interpolate(e))}splitInHalf(){return this.splitAt((this.tStart+this.tEnd)/2)}pop(){this.tEnd=this.tEndStack.pop(),this.arcEnd=this.arcEndStack.pop()}next(){this.tStart=this.tEnd,this.arcStart=this.arcEnd}densify(e,{maxDeviation:t,maxSegmentLength:r,maxSegmentsPerCurve:o,minSegmentsPerCurve:a}){const n=r*r,i=t*t,s=1/o,l=this.interpolate(0),c=this.interpolate(1);(0,d.kb)(this.curveStart,l)>h&&e.push(l),this.initialize(l,c);const u=1/a;for(let e=a-1;e>0;e--){const t=e*u;this.pop(),this.splitAt(t)}for(;this.stackSize>0;)this.pop(),this.tStart===this.tEnd||this.tEnd-this.tStart<s||(0===n||!isFinite(n)||(0,d.kb)(this.arcStart,this.arcEnd)<n)&&(0===i||!isFinite(i)||this.getDeviation2()<i)?(e.push(this.arcEnd),this.next()):this.splitInHalf();return(0,d.kb)(this.curveEnd,c)>h&&e.push([...this.curveEnd]),e}}class v extends f{constructor(e,t){const[r,o,a]=t.b;super(e,r),this._controlPointsStack=[],this._curveControlPoints=[o,a],this._arcControlPoints=[o,a],this._controlPointsStack.push(this._arcControlPoints)}splitAt(e){const{arcStart:t,arcEnd:r,tStart:o,tEnd:a}=this,[n,i]=this._arcControlPoints,s=(e-o)/(a-o),l=(0,d.RS)([],t,n,s),c=(0,d.RS)(m,n,i,s),u=(0,d.RS)([],i,r,s),h=(0,d.RS)([],l,c,s),p=(0,d.RS)([],c,u,s),f=(0,d.RS)([],h,p,s);this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this._controlPointsStack.push([p,u]),this.tEndStack.push(e),this.arcEndStack.push(f),this._arcControlPoints[0]=l,this._arcControlPoints[1]=h,this._controlPointsStack.push(this._arcControlPoints)}pop(){super.pop(),this._arcControlPoints=this._controlPointsStack.pop()}interpolate(e){const{curveStart:t,curveEnd:r}=this,[o,a]=this._curveControlPoints;return(0,i.B4)(t,o,a,r,e)}getDeviation2(){const{arcStart:e,arcEnd:t}=this,[r,o]=this._arcControlPoints;return Math.max((0,d.yE)(r,e,t),(0,d.yE)(o,e,t))}}class g extends f{constructor(e,t){const[r]=t.a;super(e,r),this._derivedEllipse=(0,u.SW)(e,t)}pop(){super.pop(),this._tMid=(this.tStart+this.tEnd)/2,this._arcMid=this.interpolate(this._tMid)}splitInHalf(){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(this._tMid),this.arcEndStack.push(this._arcMid)}interpolate(e){return(0,u.Uk)(this._derivedEllipse,e)}getDeviation2(){return(0,d.yE)(this._arcMid,this.arcStart,this.arcEnd)}}function x(e,t,r,{cx:o,cy:a,radius:n,thetaStart:i,thetaEnd:s,isInvalid:l},{maxDeviation:c,maxSegmentLength:u,maxSegmentsPerCurve:m,minSegmentsPerCurve:p}){if(l)return e.push([...r]),e;const f=2*n,v=[o+n*Math.cos(i),a+n*Math.sin(i)],g=[o+n*Math.cos(s),a+n*Math.sin(s)];(0,d.kb)(t,v)>h&&e.push(v);const x=Math.abs(s-i),b=u>0&&u<f?2*Math.asin(u/f):x,y=c>0&&c<=n?2*Math.acos(1-c/n):x,w=Math.min(b,y),M=Math.min(m,Math.max(p,Math.ceil(Math.abs(x/w)))),S=1/M;for(let t=1;t<M;t++){const r=t*S,l=i*(1-r)+s*r;e.push([o+n*Math.cos(l),a+n*Math.sin(l)])}return e.push(g),(0,d.kb)(r,g)>h&&e.push([...r]),e}function b(e,t,r,o){return new v(t,r).densify(e,o)}function y(e,t,r,o){const a=(0,s.pM)(t,r),[n]=r.c;return x(e,t,n,a,o)}function w(e,t,r,o){const a=(0,c.io)(t,r),[n]=r.a;return x(e,t,n,a,o)}function M(e,t,r,o){const[a,n,i,s,l,c,u]=r.a;return 0===c||0===u?(e.push([...a]),e):new g(t,r).densify(e,o)}function S(e,t,r,o){return(0,l.Xq)(r)?(e.push([...r]),e):(0,l.n1)(r)?b(e,t,r,o):(0,l.aO)(r)?y(e,t,r,o):(0,l.DA)(r)?w(e,t,r,o):M(e,t,r,o)}function T(e,t={}){if(!(0,l.Ed)(e))return e;const r=p(t),o=(0,l.FD)(e),a=[];for(const e of o){const t=[];for(let o=0;o<e.length-1;o++){const a=o+1,n=[...(0,l.yP)(e[o])];0===o&&t.push(n),S(t,n,e[a],r)}a.push(t)}return"curvePaths"in e?{...void 0!==e.hasZ?{hasZ:e.hasZ}:{},...void 0!==e.hasM?{hasM:e.hasM}:{},paths:a,spatialReference:e.spatialReference}:{...void 0!==e.hasZ?{hasZ:e.hasZ}:{},...void 0!==e.hasM?{hasM:e.hasM}:{},rings:a,spatialReference:e.spatialReference}}const C=(0,a.B)(e=>({maxDeviation:0,maxSegmentLength:100*e,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1}));async function _(e,t,a){const i=new Set(t);return await async function(e,t,a){let n=null;for(const i of e)if(i&&(0,l.Ed)(i)&&null==i.spatialReference.xyTolerance&&(0,l.V8)(i,t)){const e=i.spatialReference;if(!e)throw new o.A("geometry:missing-spatial-reference","Geometry contains an unsupported curve type, but it cannot be densified because it has no spatial reference.");const t=I(e);if(a.has(t))i.spatialReference=a.get(t);else{n||(n=await Promise.all([r.e(6042),r.e(1878),r.e(8885),r.e(5756),r.e(3299),r.e(1550)]).then(r.bind(r,78125)));const s=n.fromSpatialReference(e),l=s?.getTolerance();if(null==l)throw new o.A("geometry:missing-tolerance","Geometry contains an unsupported curve type, but it cannot be densified because the tolerance of its spatial reference is unknown. Set the `xyTolerance` property of the spatial reference.");const c=i.spatialReference.clone();c.read({xyTolerance:l}),i.spatialReference=c,a.set(t,c)}}}(e,i,a),e.map(e=>{if(!e||!(0,l.Ed)(e))return e;const r=e.spatialReference.xyTolerance;if(null==r)return e;const o=C(r);return(0,n.rS)(function(e,t,r){if(!(0,l.Ed)(e))return e;const o=new Set(t),a=p(r),n=(0,l.FD)(e),i=[];let s=!1;for(const e of n){const t=[];for(let r=0;r<e.length-1;r++){const n=r+1,i=[...(0,l.yP)(e[r])];0===r&&t.push(i);const c=e[n];(0,l.Xq)(c)?t.push([...c]):(0,l.n1)(c)&&!o.has("cubic-bezier")?b(t,i,c,a):(0,l.aO)(c)&&!o.has("circular-arc")?y(t,i,c,a):(0,l.DA)(c)&&!o.has("elliptic-arc")?w(t,i,c,a):(0,l.wY)(c)&&!o.has("elliptic-arc")?M(t,i,c,a):(t.push((0,l.tk)(c)),s=!0)}i.push(t)}return"curvePaths"in e?{...void 0!==e.hasZ?{hasZ:e.hasZ}:{},...void 0!==e.hasM?{hasM:e.hasM}:{},spatialReference:e.spatialReference,...s?{curvePaths:i}:{paths:i}}:{hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,...s?{curveRings:i}:{rings:i}}}(e,t,o))})}function I(e){if(null!=e.wkid)return`${e.wkid}`;if(null!=e.wkt)return e.wkt;const t="toJSON"in e&&"function"==typeof e.toJSON?e.toJSON():e;return JSON.stringify(t)}},65864(e,t,r){r.d(t,{rS:()=>u,xD:()=>h});var o=r(5443),a=r(91075),n=r(48526),i=r(86738),s=r(39829),l=r(82799),c=r(60408);function u(e){return null==e?null:e instanceof a.A?e:(0,c.fT)(e)?i.A.fromJSON(e):(0,c.Rg)(e)?l.A.fromJSON(e):(0,c.Bi)(e)?s.A.fromJSON(e):(0,c.U9)(e)?n.A.fromJSON(e):(0,c.ZC)(e)?o.A.fromJSON(e):null}const d={esriGeometryPoint:i.A,esriGeometryPolyline:l.A,esriGeometryPolygon:s.A,esriGeometryEnvelope:o.A,esriGeometryMultipoint:n.A,esriGeometryMultiPatch:s.A};function h(e){return e&&d[e]||null}},17136(e,t,r){r.d(t,{Y_:()=>z,O7:()=>P,el:()=>I});var o=r(92602),a=r(69052),n=r(49186),i=r(53966),s=r(39829),l=r(82799),c=r(16930),u=r(80754),d=r(21325),h=r(28735),m=r(52006),p=r(31411),f=r(11254),v=r(60408),g=r(65864),x=r(2272),b=r(84952),y=r(92300);const w=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function M(e){return"polygon"===e[0].type}function S(e){return"polyline"===e[0].type}function T(e,t,r){const o=1e6;if(t){const t=(0,m.Ed)(e)?(0,p.GS)(e,{maxSegmentLength:o}):function(e,t){if(!(e instanceof l.A||e instanceof s.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw w().error(e),new n.A("internal:geometry",e)}const r=(0,u.r8)(e),o=[];for(const e of r){const r=[];o.push(r),r.push([e[0][0],e[0][1]]);for(let o=0;o<e.length-1;o++){const a=e[o][0],n=e[o][1],i=e[o+1][0],s=e[o+1][1],l=Math.sqrt((i-a)*(i-a)+(s-n)*(s-n)),c=(s-n)/l,u=(i-a)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const o=e*t,i=u*o+a,s=c*o+n;r.push([i,s])}const e=(l+Math.floor(d-1)*t)/2,o=u*e+a,i=c*e+n;r.push([o,i])}r.push([i,s])}}return function(e){return"polygon"===e.type}(e)?new s.A({rings:o,spatialReference:e.spatialReference}):new l.A({paths:o,spatialReference:e.spatialReference})}(e,o);e=(0,h.ci)(t,!0)}return r&&(e=(0,u.kS)(e,r)),e}function C(e,t,r){if(Array.isArray(e)){const o=e[0];if(o>t){const r=(0,u.kd)(o,t);e[0]=o+r*(-2*t)}else if(o<r){const t=(0,u.kd)(o,r);e[0]=o+t*(-2*r)}}else{const o=e.x;if(o>t){const r=(0,u.kd)(o,t);e=e.clone().offset(r*(-2*t),0)}else if(o<r){const t=(0,u.kd)(o,r);e=e.clone().offset(t*(-2*r),0)}}return e}function _(e,t){let r=-1;for(let o=0;o<t.cutIndexes.length;o++){const a=t.cutIndexes[o],n=t.geometries[o],i=(0,u.r8)(n);for(let e=0;e<i.length;e++){const t=i[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const o=t[e][0];r=o>r?o:r}r=Number(r.toFixed(9));const o=-360*(0,u.kd)(r,180);for(let r=0;r<t.length;r++){const t=n.getPoint(e,r);n.setPoint(e,r,t.clone().offset(o,0))}return!0}})}if(a===r){if(M(e))for(const t of(0,u.r8)(n))e[a]=e[a].addRing(t);else if(S(e))for(const t of(0,u.r8)(n))e[a]=e[a].addPath(t)}else r=a,e[a]=n}return e}async function I(e,t,r){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&w().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const a="string"==typeof t?t:t?.url??o.A.geometryServiceUrl;let n,i,c,m,p,M,S,P,O=0;const z=[],R=[];for(const t of e)if(null!=t)if(n||(n=t.spatialReference,i=(0,d.Vp)(n),c=n.isWebMercator,M=c?102100:4326,m=u.j7[M].maxX,p=u.j7[M].minX,S=u.j7[M].plus180Line,P=u.j7[M].minus180Line),i)if("mesh"===t.type)R.push(t);else if("point"===t.type)R.push(C(t.clone(),m,p));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>C(e,m,p)),R.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,i);R.push(e.rings?new s.A(e):e)}else if(t.extent){const e=t.extent,r=(0,u.kd)(e.xmin,p)*(2*m);let o=0===r?t.clone():(0,u.kS)(t.clone(),r);e.offset(r,0);let{xmin:a,xmax:n}=e;a=Number(a.toFixed(9)),n=Number(n.toFixed(9)),e.intersects(S)&&n!==m?(O=n>O?n:O,o=T(o,c),z.push(o),R.push("cut")):e.intersects(P)&&a!==p?(O=n*(2*m)>O?n*(2*m):O,o=T(o,c,360),z.push(o),R.push("cut")):R.push(o)}else R.push(t.clone());else R.push(t);else R.push(t);let D=(0,u.kd)(O,m),j=-90;const F=D,E=new l.A;for(;D>0;){const e=360*D-180;E.addPath([[e,j],[e,-1*j]]),j*=-1,D--}if(z.length>0&&F>0){const t=_(z,await async function(e,t,r,o){const a=(0,x.Dl)(e),n=t[0].spatialReference,i={...o,responseType:"json",query:{...a.query,f:"json",sr:(0,d.YX)(n),target:JSON.stringify({geometryType:(0,v.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},s=await(0,f.A)(a.path+"/cut",i),{cutIndexes:l,geometries:c=[]}=s.data;return{cutIndexes:l,geometries:c.map(e=>{const t=(0,g.rS)(e);return t.spatialReference=n,t})}}(a,z,E,r)),o=[],n=[];for(let r=0;r<R.length;r++){const a=R[r];if("cut"!==a)n.push(a);else{const a=t.shift(),i=e[r];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&a.rings.length>=i.rings.length?(o.push(a),n.push("simplify")):n.push(c?(0,h.Gh)(a):a)}}if(!o.length)return n;const i=await async function(e,t,r){const o="string"==typeof e?(0,b.An)(e):e,a=t[0].spatialReference,n=(0,v.$B)(t[0]),i={...r,query:{...o.query,f:"json",sr:(0,d.YX)(a),geometries:JSON.stringify((0,y.X)(t))}},{data:s}=await(0,f.A)(o.path+"/simplify",i);return(0,y.V)(s.geometries,n,a)}(a,o,r),s=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?s.push(t):s.push(c?(0,h.Gh)(i.shift()):i.shift())}return s}const B=[];for(let e=0;e<R.length;e++){const t=R[e];if("cut"!==t)B.push(t);else{const e=z.shift();B.push(!0===c?(0,h.Gh)(e):e)}}return B}function P(e,t,r){const o=(0,d.Vp)(r);if(null==o)return e;const[a,n]=o.valid,i=2*n;let s=0,l=0;t>n?s=Math.ceil(Math.abs(t-n)/i):t<a&&(s=-Math.ceil(Math.abs(t-a)/i)),e>n?l=Math.ceil(Math.abs(e-n)/i):e<a&&(l=-Math.ceil(Math.abs(e-a)/i));let c=e+(s-l)*i;const u=c-t;return u>n?c-=i:u<a&&(c+=i),c}function O(e){const t=(0,d.Vp)(e);if(null==t)return null;const[r,o]=t.valid;return new a.hr(r,o)}const z=O(c.A.WGS84);O(c.A.WebMercator)},80754(e,t,r){r.d(t,{kS:()=>c,kd:()=>l,r8:()=>u});var o=r(82799),a=r(16930),n=r(60408),i=r(52006);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new o.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator}),minus180Line:new o.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new o.A({paths:[[[180,-180],[180,180]]],spatialReference:a.A.WGS84}),minus180Line:new o.A({paths:[[[-180,-180],[-180,180]]],spatialReference:a.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function c(e,t){if((0,i.Ed)(e))for(const r of function(e){return(0,n.Bi)(e)?e.curveRings:e.curvePaths}(e))for(const e of r){if((0,i.aO)(e)){const[r,o]=e.c;r[0]+=t,o[0]+=t;continue}if((0,i.FG)(e)){const[r,o]=e.a;r[0]+=t,o[0]+=t;continue}if((0,i.n1)(e)){const[r,o,a]=e.b;r[0]+=t,o[0]+=t,a[0]+=t;continue}e[0]+=t}for(const r of u(e))for(const e of r)e[0]+=t;return e}function u(e){return(0,n.Bi)(e)?e.rings:e.paths}r.d(t,["j7",0,s])},27921(e,t,r){r.d(t,{$Q:()=>y,C:()=>s,Cr:()=>u,H:()=>M,O_:()=>c,Qj:()=>l,T7:()=>x,Tj:()=>b,lU:()=>d,mN:()=>S,vE:()=>T,vt:()=>i});var o=r(34727),a=r(35522),n=r(51850);function i(e=C){return[e[0],e[1],e[2],e[3]]}function s(e,t){return function(e,t,r,o,a=i()){return a[0]=e,a[1]=t,a[2]=r,a[3]=o,a}(t[0],t[1],t[2],t[3],e)}function l(e){return e}function c(e,t,r){const o=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],a=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r[3]=-(r[0]*e[0]+r[1]*e[1]+r[2]*e[2]),r}function u(e,t,r,o=i()){const a=r[0]-t[0],n=r[1]-t[1],s=r[2]-t[2],l=e[0]-t[0],c=e[1]-t[1],u=e[2]-t[2],d=n*u-s*c,h=s*l-a*u,m=a*c-n*l,p=d*d+h*h+m*m,f=Math.abs(p-1)>1e-5&&p>1e-12?1/Math.sqrt(p):1;return o[0]=d*f,o[1]=h*f,o[2]=m*f,o[3]=-(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]),o}function d(e,t,r,o=0,n=Math.floor(r*(1/3)),i=Math.floor(r*(2/3))){if(r<3)return!1;t(m,o);let s=n,l=!1;for(;s<r-1&&!l;)t(p,s),s++,l=!(0,a.t2)(m,p);if(!l)return!1;for(s=Math.max(s,i),l=!1;s<r&&!l;)t(f,s),s++,(0,a.Re)(v,m,p),(0,a.S8)(v,v),(0,a.Re)(g,p,f),(0,a.S8)(g,g),l=!(0,a.t2)(m,f)&&!(0,a.t2)(p,f)&&Math.abs((0,a.Om)(v,g))<h;return l?(u(m,p,f,e),!0):(0!==o||1!==n||2!==i)&&d(e,t,r,0,1,2)}r(78955),r(44280),r(32114),r(32728);const h=.99619469809,m=(0,n.vt)(),p=(0,n.vt)(),f=(0,n.vt)(),v=(0,n.vt)(),g=(0,n.vt)();function x(e,t,r){return function(e){return 0===e||1===e}(T(e,t.origin,t.vector,0,r))}function b(e,t){return S(e,t)>=0}function y(e,t){return function(e,t,r,o,n,i,s){const l=(0,a.Om)(e,r),c=S(e,t);if(l>-1e-6&&l<1e-6)return w(c,n,i);const u=-c/l,d=w(l,n,!1);return!(s&&!d&&!w(c,n,i))&&(d?u>o.c0&&(o.c0=u):u<o.c1&&(o.c1=u),o.c0<=o.c1)}(e,t.ray.origin,t.ray.direction,t,!1,!1,!0)}function w(e,t,r){return r?t?e>=0:e<=0:t?e>0:e<0}function M(e,t,r,o=!1){let n=t.at(-1),i=S(e,n),s=o?i>0:i<=0;for(let l=0;l<t.length;l++){const c=t.at(l),u=S(e,c),d=o?u>0:u<=0;s!==d&&(0,a.Cc)(r(),n,c,i/(i-u)),d&&(0,a.C)(r(),c),n=c,i=u,s=d}}function S(e,t){return(0,a.Om)(e,t)+e[3]}function T(e,t,r,n,i){const s=(0,a.Om)(e,r),l=S(e,t);if(0===s)return l>=0?2:3;let c=-l/s;return 1&n&&(c=(0,o.qE)(c,0,1)),!(4&n)&&c<0||!(8&n)&&c>1?l>=0?2:3:((0,a.WQ)(i,t,(0,a.hs)(i,r,c)),l>=0?0:1)}const C=[0,0,1,0];(0,n.vt)()},44280(e,t,r){r.d(t,{g7:()=>s,gr:()=>i});var o=r(34727),a=r(35522),n=r(51850);function i(e,t){return(0,a.Om)(e,t)/(0,a.Bw)(e)}function s(e,t){const r=(0,a.Om)(e,t)/((0,a.Bw)(e)*(0,a.Bw)(t));return-(0,o.XM)(r)}(0,n.vt)(),(0,n.vt)()},32114(e,t,r){r.d(t,{Rc:()=>m,rq:()=>d,Km:()=>h}),r(44208);var o=r(26390),a=r(29242),n=r(9093),i=r(82534),s=r(48163),l=r(51850),c=r(91829);class u{constructor(e){this._create=e,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,o.d)(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const e=2*this._itemsPtr;this._items.length>e&&(this._items.length=e),this._itemsPtr=0}static createVec2f64(){return new u(s.vt)}static createVec3f64(){return new u(l.vt)}static createVec4f64(){return new u(c.vt)}static createMat3f64(){return new u(a.vt)}static createMat4f64(){return new u(n.vt)}static createQuatf64(){return new u(i.vt)}get test(){}}u.createVec2f64();const d=u.createVec3f64(),h=u.createVec4f64(),m=(u.createMat3f64(),u.createMat4f64());u.createQuatf64()},38969(e,t,r){r.d(t,{i:()=>a});var o=r(37955);function a(e,t){return new Promise((r,a)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,o.Oo)(e,"canplay",r)),t((0,o.Oo)(e,"error",a)))})}},92300(e,t,r){r.d(t,{V:()=>i,X:()=>n});var o=r(60408),a=r(65864);function n(e){return{geometryType:(0,o.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function i(e,t,r){const o=(0,a.xD)(t);return e.map(e=>{const t=o.fromJSON(e);return t.spatialReference=r,t})}},21015(e,t,r){r.d(t,{R:()=>l});var o=r(11254),a=r(60999),n=r(49186),i=r(17676),s=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,s.DB)(e)?((0,i.Te)(t),(0,s.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 s=await(0,a.Ke)((0,o.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,i.QP)(s.error),new n.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>i});var o=r(34275),a=r(97146),n=r(63907);function i(e,t){switch(t){case n.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,a.tM)(e):(0,o.mg)(e)?new Uint16Array(e):e}(e);case n.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,o=(0,a.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(o[e++]=t,o[e++]=t+1,o[e++]=t+2):(o[e++]=t+1,o[e++]=t,o[e++]=t+2)}else{let t=0;for(let a=0;a<r;a+=1)a%2==0?(o[t++]=e[a],o[t++]=e[a+1],o[t++]=e[a+2]):(o[t++]=e[a+1],o[t++]=e[a],o[t++]=e[a+2])}return o}(e);case n.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,o=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)o[e++]=0,o[e++]=t+1,o[e++]=t+2;return o}const a=e[0];let n=e[1],i=0;for(let t=0;t<r;++t){const r=e[t+2];o[i++]=a,o[i++]=n,o[i++]=r,n=r}return o}(e)}}},51530(e,t,r){r.d(t,{KB:()=>i,Xi:()=>a,pn:()=>s,x3:()=>n});var o=r(44208);class a{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function n(e){return"encoded-mesh-texture"===e?.type}async function i(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function s(e,t){if("image/ktx2"===t)return new a(e);const r=new Blob([e],{type:t});let n=URL.createObjectURL(r);switch(t){case"image/jpeg":n+="#.jpg";break;case"image/png":n+="#.png"}const i=new Image;if((0,o.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{a(),e(i)},o=e=>{a(),t(e)},a=()=>{URL.revokeObjectURL(n),i.removeEventListener("load",r),i.removeEventListener("error",o)};i.addEventListener("load",r),i.addEventListener("error",o),i.src=n});try{i.src=n,await i.decode()}catch{}return URL.revokeObjectURL(n),i}},77691(e,t,r){r.d(t,{fetch:()=>Ct});var o=r(40876),a=r(61473),n=r(34727),i=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),h=r(51850),m=r(70328);function p(e,t=!1){return e<=1024?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var f=r(13030),v=r(73354),g=r(50867),x=r(43609),b=r(21015),y=r(84498),w=r(51530),M=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:M.uY,r=null!=e.rotation?e.rotation:0,o=null!=e.scale?e.scale:M.Un,a=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),n=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(o[0],0,0,0,o[1],0,0,0,1),c=(0,s.vt)();return(0,i.lw)(c,n,l),(0,i.lw)(c,a,c),c}class T{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 T,this.numberOfVertices=0}}var _=r(11254),I=r(60999),P=r(49186),O=r(53966),z=r(69397);class R{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 o=this._outer.get(e);o?o.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,o]of t)yield[e,r,o]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,o)=>e(t,r,o)))}copy(){const e=new R;return this.forAll((t,r,o)=>e.set(r,o,t)),e}}var D=r(17676),j=r(46140),F=r(97146),E=r(31217),B=r(46610),H=r(67499),W=r(18845),N=r(49255),A=r(97768),G=r(92130),L=r(65786);class V extends G.A{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,A.Gz)(this._texture),this._textureNormal=(0,A.Gz)(this._textureNormal),this._textureEmissive=(0,A.Gz)(this._textureEmissive),this._textureOcclusion=(0,A.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,A.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new U(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,A.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,D.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,A.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class k extends L.Y{constructor(e=null){super(),this.textureEmissive=e}}class U extends k{constructor(e,t,r,o,a,n,i){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=o,this.textureMetallicRoughness=a,this.scale=n,this.normalTextureTransformMatrix=i}}var $=r(11725),q=r(620);class Z{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const Y=(0,m.vt)();function J(e,t,r,o,a,n){if(!e.visible)return;const i=(0,d.jb)(le,o,r),{tolerance:s}=t,l=new Z(s,!1,t.options.normalRequired);if(e.boundingInfo)(0,q.vA)(0===e.type),K(e.readPrimitivePosition,e.boundingInfo,r,i,s,a,l,n);else{const t=e.readPrimitivePosition;!function(e,t,r,o,a,n,i,s){const l=t,c=ce,u=Math.abs(l[0]),h=Math.abs(l[1]),m=Math.abs(l[2]),p=u>=h?u>=m?0:2:h>=m?1:2,f=p,v=l[f]<0?2:1,g=(p+v)%3,x=(p+(3-v))%3,b=l[g]/l[f],y=l[x]/l[f],w=1/l[f],M=ee,S=te,T=re,{normalRequired:C}=i;for(let t=r;t<o;++t){const r=3*t;a(c[0],r),a(c[1],r+1),a(c[2],r+2),n&&(n.applyToVertex(c[0],c[0][0],c[0][1],c[0][2],t),n.applyToVertex(c[1],c[1][0],c[1][1],c[1][2],t),n.applyToVertex(c[2],c[2][0],c[2][1],c[2][2],t)),(0,d.jb)(M,c[0],e),(0,d.jb)(S,c[1],e),(0,d.jb)(T,c[2],e);const o=M[g]-b*M[f],i=M[x]-y*M[f],l=S[g]-b*S[f],u=S[x]-y*S[f],h=T[g]-b*T[f],m=T[x]-y*T[f],p=h*u-m*l,v=o*m-i*h,_=l*i-u*o;if((p<0||v<0||_<0)&&(p>0||v>0||_>0))continue;const I=p+v+_;if(0===I)continue;const P=p*(w*M[f])+v*(w*S[f])+_*(w*T[f]);if(P*Math.sign(I)<0)continue;const O=P/I;O>=0&&s(O,O,C?ae(c):null,t)}}(r,i,0,e.faceCount,t,a,l,n)}}const X=(0,h.vt)();function K(e,t,r,o,a,n,i,s){if(null==t)return;const l=function(e,t){return(0,d.hZ)(t,1/e[0],1/e[1],1/e[2])}(o,X);if((0,m.C)(Y,t.box),null!=n&&n.applyToAabb(Y),function(e,t,r,o){return function(e,t,r,o){const a=(e[0]-o-t[0])*r[0],n=(e[3]+o-t[0])*r[0];let i=Math.min(a,n),s=Math.max(a,n);const l=(e[1]-o-t[1])*r[1],c=(e[4]+o-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(i=Math.max(i,Math.min(l,c)),i>s)return!1;const u=(e[2]-o-t[2])*r[2],d=(e[5]+o-t[2])*r[2];return s=Math.min(s,Math.max(u,d)),!(s<0)&&(i=Math.max(i,Math.min(u,d)),!(i>s)&&i<1/0)}(e,t,r,o)}(Y,r,l,a)){const{primitiveIndices:l}=t,c=l.length;if(c>1e3){const l=t.children;if(void 0!==l){for(const t of l)K(e,t,r,o,a,n,i,s);return}}!function(e,t,r,o,a,n,i,s,l){const c=e[0],u=e[1],d=e[2],h=t[0],m=t[1],p=t[2],{normalRequired:f}=s;for(let e=0;e<o;++e){const t=n[e],r=3*t;let[o,s,v]=a(de,r),[g,x,b]=a(de,r+1),[y,w,M]=a(de,r+2);null!=i&&([o,s,v]=i.applyToVertex(ue,o,s,v,e),[g,x,b]=i.applyToVertex(ue,g,x,b,e),[y,w,M]=i.applyToVertex(ue,y,w,M,e));const S=g-o,T=x-s,C=b-v,_=y-o,I=w-s,P=M-v,O=m*P-I*p,z=p*_-P*h,R=h*I-_*m,D=S*O+T*z+C*R,j=D*D;if(j<=se)continue;const F=c-o,E=u-s,B=d-v,H=(F*O+E*z+B*R)*D;if(H<0||H>j)continue;const W=E*C-T*B,N=B*S-C*F,A=F*T-S*E,G=(h*W+m*N+p*A)*D;if(G<0||H+G>j)continue;const L=(_*W+I*N+P*A)/D;L>=0&&l(L,L,f?oe(S,T,C,_,I,P,Q):null,t)}}(r,o,0,c,e,l,n,i,s)}}const Q=(0,h.vt)();const ee=(0,h.vt)(),te=(0,h.vt)(),re=(0,h.vt)();function oe(e,t,r,o,a,n,i){return(0,d.hZ)(ne,e,t,r),(0,d.hZ)(ie,o,a,n),(0,d.$A)(i,ne,ie),(0,d.S8)(i,i),i}function ae(e){return(0,d.jb)(ne,e[1],e[0]),(0,d.jb)(ie,e[2],e[0]),(0,d.$A)(Q,ne,ie),(0,d.S8)(Q,Q),Q}const ne=(0,h.vt)(),ie=(0,h.vt)(),se=1e-7*1e-7,le=(0,h.vt)(),ce=[(0,h.vt)(),(0,h.vt)(),(0,h.vt)()],ue=(0,h.vt)(),de=(0,h.vt)();var he=r(75956),me=r(16396),pe=r(59907);class fe{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,o,a){null!=a&&(0,pe.vJ)(r,o,this.layout,e,t,a)}}var ve=r(33442),ge=r(47724);const xe=new ge.L,be=2e-5,ye=2e-6,we=(0,h.vt)();var Me=r(43616),Se=r(5482),Te=r(91429),Ce=r(91829),_e=r(4431),Ie=r(1843),Pe=r(72824),Oe=r(13840),ze=r(98958),Re=r(16943),De=r(33524),je=r(56133);r(4576),r(66289);var Fe=r(69622),Ee=r(65529),Be=r(32728);class He{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",f.Eq),this.color=e.getField("instanceColor",f.XP),this.olidColor=e.getField("instanceOlidColor",f.XP),this.state=e.getField("state",f.SL),this.lodLevel=e.getField("lodLevel",f.SL)}}let We=class extends Fe.A{constructor(e,t){super(e),this.events=new Ee.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Ae(Ne.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Ue,this._buffer=this._layout.createBuffer(this._capacity),this._view=new He(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,q.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,q.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=Ge,o=Le;t.localTransform.getMat(e,Ve),t.globalTransform.getMat(e,ke);const a=(0,l.lw)(ke,ke,Ve);(0,d.hZ)(r,a[12],a[13],a[14]),t.modelOrigin.setVec(e,r),(0,i.z0)(o,a),t.model.setMat(e,o);const n=(0,Be.wp)(Ge,a);n.sort(),t.modelScaleFactors.set(e,0,n[1]),t.modelScaleFactors.set(e,1,n[2]),(0,i.B8)(o,o),(0,i.mg)(o,o),t.modelNormal.setMat(e,o),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,Le),r.modelOrigin.getVec(e,Ge),t[0]=Le[0],t[1]=Le[1],t[2]=Le[2],t[3]=0,t[4]=Le[3],t[5]=Le[4],t[6]=Le[5],t[7]=0,t[8]=Le[6],t[9]=Le[7],t[10]=Le[8],t[11]=0,t[12]=Ge[0],t[13]=Ge[1],t[14]=Ge[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(Ge,this,e),t*=Math.max(Ge[0],Ge[1],Ge[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Ge,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Ge[0],Ge[1],Ge[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,o=r.get(e);t?t!==o&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):o&&(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(Ue,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new He(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,Se.Cg)([(0,Te.MZ)({constructOnly:!0})],We.prototype,"shaderTransformation",void 0),(0,Se.Cg)([(0,Te.MZ)()],We.prototype,"_size",void 0),(0,Se.Cg)([(0,Te.MZ)({readOnly:!0})],We.prototype,"size",null),We=(0,Se.Cg)([(0,Te.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],We);const Ne=(0,Ie.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Ae(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Re.E)()&&e.vec4u8("instanceOlidColor"),e}const Ge=(0,h.vt)(),Le=(0,s.vt)(),Ve=(0,c.vt)(),ke=(0,c.vt)(),Ue=64,$e=(0,Ie.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var qe=r(74810),Ze=r(28491),Ye=r(90644),Je=r(49788);class Xe extends Pe.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=qe.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,Ce.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.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Je.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}}Pe.gy;let Ke=class extends ze.w{constructor(e,t){let o=(0,_e.U)(tt(t));t.instanced&&t.instancedDoublePrecision&&(o=o.concat((0,_e.U)(function(e){return Ae($e.clone(),e)}(t)))),super(e,t,o),this.shader=new Oe.r(Ze.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:o,cullFace:a,customDepthTest:n,hasOccludees:i}=e;return(0,Ye.Ey)({blending:o?(0,De.Yf)(r,!1,e.emissionDimmingPass):null,culling:et(e)?(0,Ye.Xt)(a):null,depthTest:(0,De.mt)(r,Qe(n)),depthWrite:(0,De.z5)(e),colorWrite:Ye.kn,stencilWrite:i?je.v0:null,stencilTest:i?t?je.Ax:je.cP:null,polygonOffset:(0,ve.s)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Qe(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function et(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function tt(e){const t=(0,Ie.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,Re.E)()&&t.vec4u8("olidColor"),t}Ke=(0,Se.Cg)([(0,Te.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Ke);var rt=r(51976);class ot extends ge.L{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.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,this.renderOccluded=!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}}(0,Se.Cg)([(0,rt.W)({count:4})],ot.prototype,"alphaDiscardMode",void 0),(0,Se.Cg)([(0,rt.W)({count:3})],ot.prototype,"doubleSidedMode",void 0),(0,Se.Cg)([(0,rt.W)({count:8})],ot.prototype,"pbrMode",void 0),(0,Se.Cg)([(0,rt.W)({count:3})],ot.prototype,"cullFace",void 0),(0,Se.Cg)([(0,rt.W)({count:3})],ot.prototype,"normalType",void 0),(0,Se.Cg)([(0,rt.W)({count:3})],ot.prototype,"customDepthTest",void 0),(0,Se.Cg)([(0,rt.W)({count:8})],ot.prototype,"emissionSource",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVertexColors",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasSymbolColors",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVerticalOffset",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasColorTexture",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasMetallicRoughnessTexture",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasOcclusionTexture",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasNormalTexture",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasScreenSizePerspective",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVertexTangents",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasOccludees",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"instanced",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"instancedDoublePrecision",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasModelTransformation",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"offsetBackfaces",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVVSize",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasVVColor",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"receiveShadows",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasShadowHighlights",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"receiveAmbientOcclusion",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"receiveGlobalIllumination",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"textureAlphaPremultiplied",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"instancedFeatureAttribute",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"instancedColor",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"writeDepth",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"snowCover",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasColorTextureTransform",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasEmissionTextureTransform",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasNormalTextureTransform",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasOcclusionTextureTransform",void 0),(0,Se.Cg)([(0,rt.W)()],ot.prototype,"hasMetallicRoughnessTextureTransform",void 0);var at=r(57323);let nt=class extends Ke{constructor(){super(...arguments),this.shader=new Oe.r(at.R,()=>r.e(2314).then(r.bind(r,39933)))}};nt=(0,Se.Cg)([(0,Te.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],nt);class it extends rt.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,Se.Cg)([(0,rt.W)()],it.prototype,"receiveShadows",void 0);class st extends $.i{constructor(e,t){super(e,ct),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,N.uw)(e)&&!this.transparent],[4,e=>(0,N.uw)(e)&&this.transparent]]),this._layout=tt(this.parameters),this._configuration=new ot(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:o}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(o[3])?1:o[3])>=Je.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,h.uY)}get emissions(){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:o,doubleSided:a,doubleSidedType:n}=t;r.hasVertexTangents=!o&&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=o?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!o&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=o?2:a&&"normal"===n?1:a&&"winding-order"===n?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,N._o)(e.output)?(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&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7: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}intersectRay(e,t,r,o,a,n){const i=this._getMaterialVerticalOffset(t,r);null!=i&&(o=(0,d.Re)(ut,o,i),a=(0,d.Re)(dt,a,i)),n=function(e,t,r,o){xe.output=t.transparent?1:0,xe.polygonOffset=t.polygonOffset,xe.enableOITOffset=t.enableOITOffset;const a=(0,ve.s)(xe);if(!a)return e;const n=ye*a.units,i=(0,d.oW)(we,o,r);return(t,r,o,s)=>{const l=(o?1-Math.abs((0,d.Om)(i,o)):0)*a.factor*be+n;return e(t,r+l,o,s)}}(n,this._configuration,o,a),J(e,r,o,a,(0,me.ou)(r.verticalOffset),n)}intersectScreenPolygon(e,t,r,o){return function(e,t,r){return null==e?null:(e.distance=function(e,t,r,o,a){const n=(0,ve.s)(r);return n?function({units:e,factor:t},r,o,a){const n=ye*e;return o+((a?1-Math.abs((0,d.Om)(r,a)):0)*t*be+n)}(n,(0,d.oW)(we,a,o),e,t):e}(e.distance,e.hasNormal?e.normal:null,t,r,e.point),e)}((0,he.MJ)(e,r,t,o,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new lt(e)}createBufferWriter(){return new fe(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:o,texture:a,textureId:n,textureAlphaMode:i,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||o<1||(null!=a||null!=n)&&1!==i&&2!==i&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){const r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,o,a)=>(e[0]=t+r[0],e[1]=o+r[1],e[2]=a+r[2],e),applyToAabb:e=>((0,m.Ne)(e,(0,d.WQ)(gt,(0,m.pg)(e,gt),r)),(0,m.vI)(e,(0,d.WQ)(gt,(0,m.Lu)(e,gt),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;const r=t.camera;(0,d.hZ)(pt,e[12],e[13],e[14]);let o=null;switch(t.viewingMode){case 1:o=(0,d.S8)(mt,pt);break;case 2:o=(0,d.C)(mt,ht)}const a=(0,d.Re)(ft,pt,r.eye),n=(0,d.Bw)(a),i=(0,d.hs)(a,a,1/n);let s=null;this.parameters.screenSizePerspective&&(s=(0,d.Om)(o,i));const l=(0,Me.kE)(r,n,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,d.hs)(o,o,l),(0,d.ei)(vt,o,t.transform.inverseRotation)}}class lt extends V{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?nt:Ke,e)}}class ct extends Xe{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!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 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 ut=(0,h.vt)(),dt=(0,h.vt)(),ht=(0,h.fA)(0,0,1),mt=(0,h.vt)(),pt=(0,h.vt)(),ft=(0,h.vt)(),vt=(0,h.vt)(),gt=(0,h.vt)(),xt=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class bt{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function yt(e){const t=e.params,r=t.topology;let o=!0;switch(t.vertexAttributes||(xt().warn("Geometry must specify vertex attributes"),o=!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&&(xt().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),o=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(xt().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),o=!1)):(xt().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),o=!1)}}else xt().warn("Indexed geometries must specify faces"),o=!1;break}default:xt().warn(`Unsupported topology '${r}'`),o=!1}e.params.material||(xt().warn("Geometry requires material"),o=!1);const a=e.params.vertexAttributes;for(const e in a)a[e].values||(xt().warn("Geometries with externally defined attributes are not yet supported"),o=!1);return o}function wt(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&(0,m.RF)(t,r.box)}),t}function Mt(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function St(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Tt=new j.A(1,2,"wosr");async function Ct(e,t){const s=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}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,a.EM)(e));if("wosr"===s.fileType){const e=await(t.cache?t.cache.loadWOSR(s.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,I.Ke)((0,_.A)(e,t));if(r.ok)return r.value.data;(0,D.QP)(r.error),function(e){throw new P.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),o=await async function(e,t){const r=new Array;for(const o in e){const a=e[o],n=a.images[0].data;if(!n){xt().warn("Externally referenced texture data is not yet supported");continue}const i=a.encoding+";base64,"+n,s="/textureDefinitions/"+o,l="rgba"===a.channels?a.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==Mt(l)},u=t?.disableTextures?Promise.resolve(null):(0,E.D)(i,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}const o=await Promise.all(r),a={};for(const e of o)a[e.refId]=e;return a}(r.textureDefinitions??{},t);let a=0;for(const e in o)if(o.hasOwnProperty(e)){const t=o[e];a+=t?.image?t.image.width*t.image.height*4:0}return new bt(r,o,a+(0,z.Qh)(r))}(s.url,t)),{engineResources:r,referenceBoundingBox:o}=function(e,t){const r=new Array,o=new Array,a=new Array,n=new R,i=e.resource,s=j.A.parse(i.version||"1.0","wosr");Tt.validate(s);const l=i.model.name,c=i.model.geometries,u=i.materialDefinitions??{},d=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const i=c[e];if(!yt(i))continue;const s=St(i),l=i.params.vertexAttributes,f=[],v=e=>{if("PerAttributeArray"===i.params.topology)return null;const t=i.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l.position,x=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,o=v(e)??(0,F.tM)(x);f.push([e,new B.n(r,o,t.valuesPerElement,!0)])}const b=s.texture,y=d&&d[b];if(y&&!p.has(b)){const{image:e,parameters:t}=y,r=new W.h(e,t);o.push(r),p.set(b,r)}const w=p.get(b),M=w?w.id:void 0,S=s.material;let T=n.get(S,b);if(null==T){const e=u[S.slice(S.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=y?Mt(y.alphaChannelUsage):void 0,o={ambient:(0,h.ci)(e.diffuse),diffuse:(0,h.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:M,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(o,t.materialParameters),T=new st(o,t),n.set(S,b,T)}a.push(T);const C=new H.V(T,f);m+=f.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(C)}return{engineResources:[{name:l,stageResources:{textures:o,materials:a,geometries:r},pivotOffset:i.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:wt(r)}}(e,t);return{lods:r,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}let M;if(t.cache)M=await t.cache.loadGLTF(s.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));M=await e(new b.R,s.url,t,t.usePBR,t.useEmissive)}const{engineResources:T,referenceBoundingBox:O}=function(e,t,r){const a=e.model,s=e.meta,b=a.meta?.ESRI_proxyEllipsoid,M=s.isEsriSymbolResource&&null!=b&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;M&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const a of o.parts){const o=a.attributes.normal;if(null==o)return;const n=a.attributes.position,i=n.count,s=(0,h.vt)(),u=(0,h.vt)(),m=(0,h.vt)(),p=new Float32Array(4*i),v=new Float32Array(3*i),g=(0,l.B8)((0,c.vt)(),a.transform);let x=0,b=0;for(let l=0;l<i;l++){n.getVec(l,u),o.getVec(l,s),(0,d.Z0)(u,u,a.transform),(0,d.Re)(m,u,t.center),(0,d.Qr)(m,m,t.radius);const i=m[2],c=(0,d.Bw)(m),h=Math.min(.45+.55*c*c,1)**2.2;(0,d.Qr)(m,m,t.radius),null!==g&&(0,d.Z0)(m,m,g),(0,d.S8)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.Cc)(m,m,s,i>-1?.2:Math.min(-4*i-3.8,1)),v[x]=m[0],v[x+1]=m[1],v[x+2]=m[2],x+=3,p[b]=h,p[b+1]=h,p[b+2]=h,p[b+3]=1,b+=4}a.attributes.normal=new f.xs(v.buffer),a.attributes.color=new f.Eq(p.buffer)}}}(e,b));const T=!!t.usePBR,_=s.isEsriSymbolResource?{usePBR:T,isSchematic:!1,treeRendering:M,mrrFactors:qe.SY}:{usePBR:T,isSchematic:!1,treeRendering:!1,mrrFactors:qe.mb},I={...t.materialParameters,treeRendering:M},P=new Array,O=new Map,z=new Map,R=a.lods.length,D=(0,m.Ie)();return a.lods.forEach((e,s)=>{const l=!0===t.skipHighLods&&(R>1&&0===s||R>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;const c=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new st({},t):function(e,t,r,a,n,i,s,l,c){const d=e.materials.get(t.material);if(null==d)return null;const{normal:m,color:p,texCoord0:f,tangent:v}=t.attributes,g=t.material+(m?"_normal":"")+(p?"_color":"")+(f?"_texCoord0":"")+(v?"_tangent":""),x=null!=t.attributes.texCoord0,b=null!=t.attributes.normal,y=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!i.has(g)){if(x){const t=(t,r=!1,o=!1)=>{if(null!=t&&!s.has(t)){const a=e.textures.get(t);if(a){const e=a.data,n=r&&!(0,w.x3)(e)?l.compressionOptions:void 0;s.set(t,new W.h((0,w.x3)(e)?e.data:e,{...a.parameters,preMultiplyAlpha:!(0,w.x3)(e)&&o,encoding:(0,w.x3)(e)?e.encoding:void 0,compressionOptions:n}))}}},r=1!==y&&!c;t(d.colorTexture,r,1!==y),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}const r=(0,o.xV)(d.color[0]),m=(0,o.xV)(d.color[1]),p=(0,o.xV)(d.color[2]),f=null!=d.colorTexture&&x?s.get(d.colorTexture):null,v=(0,qe.Jr)(d),M=null!=d.normalTextureTransform?.scale?d.normalTextureTransform?.scale:u.Un;i.set(g,new st({...a,customDepthTest:1,textureAlphaMode:y,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,m,p],ambient:[r,m,p],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:b?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,unlit:d.unlit,textureId:null!=f?f.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&x?s.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=f&&!!f.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&x?s.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&x&&!d.unlit?s.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&x?s.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:d.unlit?h.uY:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null!=d.emissiveStrengthKHR?d.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=n.emissiveStrengthFromSymbol?n.emissiveStrengthFromSymbol:void 0,mrrFactors:v?qe.Bt:[d.metallicFactor,d.roughnessFactor,a.mrrFactors[2]],isSchematic:v,colorTextureTransformMatrix:S(d.colorTextureTransform),normalTextureTransformMatrix:S(d.normalTextureTransform),scale:[M[0],M[1]],occlusionTextureTransformMatrix:S(d.occlusionTextureTransform),emissiveTextureTransformMatrix:S(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(d.metallicRoughnessTextureTransform),...n},l))}const M=i.get(g);if(r.stageResources.materials.push(M),x){const e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return M}(a,e,c,_,I,O,z,t,M),{geometry:d,vertexCount:b}=function(e,t){const r=e.attributes.position.count,o=(0,y.x)(e.indices||r,e.primitiveType),a=p(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,v.t)(a,s,e.transform,3,l);const c=[["position",new B.n(a,o,3,!0)]];if(null!=e.attributes.normal){const t=p(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.normal;(0,i.Ge)(_t,e.transform),(0,v.b)(t,a,_t,3,s),(0,n.or)(_t)&&(0,v.n)(t,t),c.push(["normal",new B.n(t,o,3,!0)])}if(null!=e.attributes.tangent){const t=p(4*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.tangent;(0,i.z0)(_t,e.transform),(0,g.t)(t,a,_t,4,s),(0,n.or)(_t)&&(0,v.n)(t,t,4),c.push(["tangent",new B.n(t,o,4,!0)])}if(null!=e.attributes.texCoord0){const t=p(2*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.texCoord0;(0,x.a)(t,a,2,n),c.push(["uv0",new B.n(t,o,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof f.Eq?(0,g.b)(t,u,1,255):(u instanceof f.XP||u instanceof f.Uz)&&(0,g.b)(t,u,1/255,255):(t.fill(255),u instanceof f.xs?(0,v.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof f.eI||e.attributes.color instanceof f.nS)&&(0,v.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new B.n(t,o,4,!0)])}return{geometry:new H.V(t,c),vertexCount:r}}(e,r??new st({},t)),T=d.boundingInfo;null!=T&&0===s&&(0,m.RF)(D,T.box),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=b)}),l||P.push(c)}),{engineResources:P,referenceBoundingBox:D}}(M,t,s.specifiedLodIndex);return{lods:T,referenceBoundingBox:O,isEsriSymbolResource:M.meta.isEsriSymbolResource,isWosr:!1}}const _t=(0,s.vt)()},32728(e,t,r){r.d(t,{YH:()=>s,hG:()=>n,nu:()=>l,wp:()=>i}),r(34727);var o=r(35522),a=r(51850);function n(e){const t=e[0]*e[0]+e[4]*e[4]+e[8]*e[8],r=e[1]*e[1]+e[5]*e[5]+e[9]*e[9],o=e[2]*e[2]+e[6]*e[6]+e[10]*e[10];return Math.sqrt(Math.max(t,r,o))}function i(e,t){const r=Math.sqrt(t[0]*t[0]+t[4]*t[4]+t[8]*t[8]),a=Math.sqrt(t[1]*t[1]+t[5]*t[5]+t[9]*t[9]),n=Math.sqrt(t[2]*t[2]+t[6]*t[6]+t[10]*t[10]);return(0,o.hZ)(e,r,a,n),e}function s(e,t,r){r=r||e;const a=(0,o.Om)(e,t);(0,o.hZ)(r,e[0]-a*t[0],e[1]-a*t[1],e[2]-a*t[2]),(0,o.S8)(r,r)}function l(e,t,r,n=(0,a.vt)()){const i=(0,o.Bw)(e),s=(0,o.Bw)(t),l=(0,o.Om)(e,t)/(i*s);if(l<.9999999999999999){const a=Math.acos(l),d=((1-r)*i+r*s)/Math.sin(a),h=d/i*Math.sin((1-r)*a),m=d/s*Math.sin(r*a);return(0,o.hs)(c,e,h),(0,o.hs)(u,t,m),(0,o.WQ)(n,c,u)}return(0,o.Cc)(n,e,t,r)}(0,a.vt)(),(0,a.vt)(),(0,a.vt)();const c=(0,a.vt)(),u=(0,a.vt)()},46686(e,t,r){r.d(t,{o:()=>a});var o=r(31821);function a(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(o.H`
646
663
  void forwardLinearDepth(float _linearDepth) { ${(0,o.If)(t,"linearDepth = _linearDepth;")} }
647
664
  `)}},33120(e,t,r){r.d(t,{i$:()=>i,xJ:()=>n}),r(46686),r(28682);var o=r(77108),a=r(31821);function n(e){e.vertex.uniforms.add(new o.E("nearFar",e=>e.camera.nearFar))}function i(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
648
665
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
@@ -659,12 +676,6 @@ depth = calculateLinearDepth(nearFar,eye.z);
659
676
  return proj * eye;
660
677
  }`),e.vertex.code.add(a.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
661
678
  return proj * (view * vec4(pos, 1.0));
662
- }`)}},24321(e,t,r){r.d(t,{v:()=>n});var o=r(43519),a=r(31821);function n(e,t){t.instancedColor?(e.attributes.add("instanceColor","vec4"),e.vertex.include(o.WD),e.vertex.include(o.Y1),e.vertex.include(o.ML),e.vertex.code.add(a.H`
663
- MaskedColor applyInstanceColor(MaskedColor color) {
664
- return multiplyMaskedColors( color, createMaskedFromUInt8NaNColor(${"instanceColor"}));
665
- }
666
- `)):e.vertex.code.add(a.H`MaskedColor applyInstanceColor(MaskedColor color) {
667
- return color;
668
679
  }`)}},2585(e,t,r){r.d(t,{B:()=>g});var o=r(77690),a=r(29242),n=r(9093),i=r(35522),s=r(51850),l=r(26425),c=r(77949),u=r(23205),d=r(31821),h=r(35644),m=r(74333);class p extends m.n{constructor(e,t,r){super(e,"mat4",1,(o,a,n)=>o.setUniformMatrix4fv(e,t(a,n),r))}}var f=r(28449);r(65786).Y;const v=(0,a.vt)();function g(e,t){const{hasModelTransformation:r,instancedDoublePrecision:a,instanced:s,output:m,hasVertexTangents:g}=t;r&&(e.vertex.uniforms.add(new p("model",e=>e.modelTransformation??n.zK)),e.vertex.uniforms.add(new h.k("normalLocalOriginFromModel",e=>((0,o.Ge)(v,e.modelTransformation??n.zK),v)))),s&&a&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const b=e.vertex;a&&(b.include(l.u),b.uniforms.add(new u.d("viewOriginHi",e=>(0,f.Zo)((0,i.hZ)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)),new u.d("viewOriginLo",e=>(0,f.jA)((0,i.hZ)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)))),b.code.add(d.H`
669
680
  vec3 getVertexInLocalOriginSpace() {
670
681
  return ${r?a?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":a?"instanceModel * localPosition().xyz":"localPosition().xyz"};
@@ -697,21 +708,10 @@ vec3 normalModel() {
697
708
  return decompressNormal(normalCompressed);
698
709
  }`);break;case 0:e.attributes.add("normal","vec3"),e.vertex.code.add(o.H`vec3 normalModel() {
699
710
  return normal;
700
- }`);break;default:t.normalType;case 2:case 3:}}},39014(e,t,r){r.d(t,{K:()=>s});var o=r(43519),a=r(31821),n=r(93588),i=r(43616);function s(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new n.c("symbolColorMixMode",e=>i.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(o.WD),e.vertex.include(o.Y1),e.vertex.include(o.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(a.H`
701
- MaskedColor applySymbolColor(MaskedColor color) {
702
- return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
703
- }
704
- `)):e.vertex.code.add(a.H`MaskedColor applySymbolColor(MaskedColor color) {
705
- return color;
706
- }`),e.vertex.code.add(a.H`
707
- void forwardColorMixMode(bvec4 mask) {
708
- colorMixMode = mask.r ? ${a.H.int(i.Um.ignore)} : symbolColorMixMode;
709
- opacityMixMode = mask.a ? ${a.H.int(i.Um.ignore)} : symbolColorMixMode;
710
- }
711
- `)}},53466(e,t,r){r.d(t,{U:()=>a});var o=r(31821);function a(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() {
711
+ }`);break;default:t.normalType;case 2:case 3:}}},53466(e,t,r){r.d(t,{U:()=>a});var o=r(31821);function a(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() {
712
712
  vuv0 = uv0;
713
713
  vuvRegion = uvRegion;
714
- }`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(o.H`void forwardTextureCoordinates() {}`);case 3:return}}},92700(e,t,r){r.d(t,{c:()=>a});var o=r(31821);function a(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(o.H`void forwardVertexColor() { vColor = color; }`)):e.vertex.code.add(o.H`void forwardVertexColor() {}`)}},72824(e,t,r){r.d(t,{Mh:()=>c,Zo:()=>u,gy:()=>d});var o=r(29242),a=r(91829),n=r(96336),i=r(28682),s=r(31821),l=r(35644);function c(e,t){const{vertex:r,varyings:o}=e;switch(t.normalType){case 0:case 1:e.include(n.Y,t),o.add("vNormalWorld","vec3"),o.add("vNormalView","vec3"),r.uniforms.add(new l.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)),r.code.add(s.H`void forwardNormal() {
714
+ }`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(o.H`void forwardTextureCoordinates() {}`);case 3:return}}},72824(e,t,r){r.d(t,{Mh:()=>c,Zo:()=>u,gy:()=>d});var o=r(29242),a=r(91829),n=r(96336),i=r(28682),s=r(31821),l=r(35644);function c(e,t){const{vertex:r,varyings:o}=e;switch(t.normalType){case 0:case 1:e.include(n.Y,t),o.add("vNormalWorld","vec3"),o.add("vNormalView","vec3"),r.uniforms.add(new l.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)),r.code.add(s.H`void forwardNormal() {
715
715
  vNormalWorld = normalModel();
716
716
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
717
717
  }`);break;case 2:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:t.normalType;case 3:}}class u extends i.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.vt)()}}class d extends i.EM{constructor(){super(...arguments),this.toMapSpace=(0,a.vt)()}}},28682(e,t,r){r.d(t,{EM:()=>l,dO:()=>s});var o=r(29242),a=r(51850),n=(r(26425),r(40710),r(33079),r(31821),r(74333));n.n,n.n,r(35644),r(58029),r(63761);var i=r(65786);class s extends i.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,a.vt)(),this.transformWorldFromViewTL=(0,a.vt)(),this.transformViewFromCameraRelativeRS=(0,o.vt)()}}class l extends i.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,o.vt)(),this.transformWorldFromModelTH=(0,a.vt)(),this.transformWorldFromModelTL=(0,a.vt)(),this.transformationDrawId=0}}},99208(e,t,r){r.d(t,{r:()=>i});var o=r(53466),a=r(31821);function n(e){e.fragment.code.add(a.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
@@ -741,56 +741,104 @@ return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
741
741
  vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
742
742
  return worldPos + calculateVerticalOffset(worldPos, localOrigin);
743
743
  }
744
- `)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,a.vt)()},9169(e,t,r){r.d(t,{E:()=>g});var o=r(33120),a=r(34711),n=r(76597),i=r(96336),s=r(31821);function l(e,t){if(11!==t.output)return e.vertex.code.add(s.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(s.H`void outputObjectAndLayerIdColor() {}`);const r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");const o=r?"instanceOlidColor":"olidColor";e.attributes.add(o,"vec4"),e.vertex.code.add(s.H`
744
+ `)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,a.vt)()},9169(e,t,r){r.d(t,{E:()=>x});var o=r(33120),a=r(34711),n=r(76597),i=r(96336),s=r(31821);function l(e,t){if(11!==t.output)return e.vertex.code.add(s.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(s.H`void outputObjectAndLayerIdColor() {}`);const r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");const o=r?"instanceOlidColor":"olidColor";e.attributes.add(o,"vec4"),e.vertex.code.add(s.H`
745
745
  void forwardObjectAndLayerIdColor() {
746
746
  objectAndLayerIdColorVarying = ${o} * 0.003921568627451;
747
747
  }`),e.fragment.code.add(s.H`void outputObjectAndLayerIdColor() {
748
748
  fragColor = objectAndLayerIdColorVarying;
749
- }`)}var c=r(53466),u=r(72824);function d(e,t){switch(t.output){case 5:case 6:case 7:case 8:e.fragment.code.add(s.H`void outputDepth(float _linearDepth){
749
+ }`)}var c=r(53466),u=r(72824),d=r(77068);function h(e,t){switch(t.output){case 5:case 6:case 7:case 8:e.fragment.code.add(s.H`void outputDepth(float _linearDepth){
750
750
  const float slope_scale = 2.0;
751
751
  const float bias = 20.0 * .000015259;
752
752
  float m = max(abs(dFdx(_linearDepth)), abs(dFdy(_linearDepth)));
753
753
  gl_FragDepth = _linearDepth + slope_scale * m + bias;
754
- }`)}}var h=r(3871),m=r(43259),p=r(58614),f=r(77949),v=r(63761);function g(e,t){const{vertex:r,fragment:g,varyings:x}=e,{hasColorTexture:b,alphaDiscardMode:y}=t,w=b&&1!==y,{output:M,normalType:S,hasColorTextureTransform:T}=t;switch(M){case 3:(0,f.NB)(r,t),e.include(n.d),g.include(a.HQ,t),e.include(c.U,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(s.H`vpos = getVertexInLocalOriginSpace();
754
+ }`)}}var m=r(3871),p=r(43259),f=r(58614),v=r(77949),g=r(63761);function x(e,t){const{vertex:r,fragment:x,varyings:b}=e,{hasColorTexture:y,alphaDiscardMode:w}=t,M=y&&1!==w,{output:S,normalType:T,hasColorTextureTransform:C}=t;switch(S){case 3:(0,v.NB)(r,t),e.include(n.d),x.include(a.HQ,t),e.include(c.U,t),M&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(s.H`vpos = getVertexInLocalOriginSpace();
755
755
  vpos = subtractOrigin(vpos);
756
756
  vpos = addVerticalOffset(vpos, localOrigin);
757
757
  gl_Position = transformPosition(proj, view, vpos);
758
- forwardTextureCoordinates();`),e.include(p.SS,t),g.main.add(s.H`
758
+ forwardTextureCoordinates();`),e.include(f.SS,t),x.main.add(s.H`
759
759
  discardBySlice(vpos);
760
- ${(0,s.If)(w,s.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
761
- discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:(0,f.NB)(r,t),e.include(n.d),e.include(c.U,t),e.include(m.A,t),e.include(d,t),g.include(a.HQ,t),e.include(l,t),(0,o.xJ)(e),x.add("depth","float",{invariant:!0}),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(s.H`vpos = getVertexInLocalOriginSpace();
760
+ ${(0,s.If)(M,s.H`vec4 texColor = texture(tex, ${C?"colorUV":"vuv0"});
761
+ discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:(0,v.NB)(r,t),e.include(n.d),e.include(c.U,t),e.include(p.A,t),e.include(h,t),x.include(a.HQ,t),e.include(l,t),(0,o.xJ)(e),b.add("depth","float",{invariant:!0}),M&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(s.H`vpos = getVertexInLocalOriginSpace();
762
762
  vpos = subtractOrigin(vpos);
763
763
  vpos = addVerticalOffset(vpos, localOrigin);
764
764
  gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
765
765
  forwardTextureCoordinates();
766
- forwardObjectAndLayerIdColor();`),e.include(p.SS,t),g.main.add(s.H`
766
+ forwardObjectAndLayerIdColor();`),e.include(f.SS,t),x.main.add(s.H`
767
767
  discardBySlice(vpos);
768
- ${(0,s.If)(w,s.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
768
+ ${(0,s.If)(M,s.H`vec4 texColor = texture(tex, ${C?"colorUV":"vuv0"});
769
769
  discardOrAdjustAlpha(texColor);`)}
770
- ${11===M?s.H`outputObjectAndLayerIdColor();`:s.H`outputDepth(depth);`}`);break;case 4:{(0,f.NB)(r,t),e.include(n.d),e.include(i.Y,t),e.include(u.Mh,t),e.include(c.U,t),e.include(m.A,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),2===S&&x.add("vPositionView","vec3",{invariant:!0});const o=0===S||1===S;r.main.add(s.H`
770
+ ${11===S?s.H`outputObjectAndLayerIdColor();`:s.H`outputDepth(depth);`}`);break;case 4:{(0,v.NB)(r,t),e.include(n.d),e.include(i.Y,t),e.include(u.Mh,t),e.include(c.U,t),e.include(p.A,t),e.include(d.F,t),M&&x.uniforms.add(new g.N("tex",e=>e.texture)),2===T&&b.add("vPositionView","vec3",{invariant:!0});const o=0===T||1===T;r.main.add(s.H`
771
+ forwardDefaultMaterialExternalColor();
772
+
773
+ if (shouldCullByOpacity()) {
774
+ gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
775
+ return;
776
+ }
777
+
771
778
  vpos = getVertexInLocalOriginSpace();
772
779
  ${o?s.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:s.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
773
780
  vpos = subtractOrigin(vpos);
774
781
  vpos = addVerticalOffset(vpos, localOrigin);
775
782
  gl_Position = transformPosition(proj, view, vpos);
776
- forwardTextureCoordinates();`),g.include(a.HQ,t),e.include(p.SS,t),g.main.add(s.H`
783
+ forwardTextureCoordinates();`),x.include(a.HQ,t),e.include(f.SS,t),x.main.add(s.H`
777
784
  discardBySlice(vpos);
778
- ${(0,s.If)(w,s.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
779
- discardOrAdjustAlpha(texColor);`)}
785
+ ${(0,s.If)(M,s.H`vec4 texColor = texture(tex, ${C?"colorUV":"vuv0"});
786
+ discardOrAdjustAlpha(texColor);`,s.H`vec4 texColor = vec4(1.0);`)}
787
+ float opacity = getDefaultMaterialOpacity(texColor.a);
780
788
 
781
- ${2===S?s.H`vec3 normal = screenDerivativeNormal(vPositionView);`:s.H`vec3 normal = normalize(vNormalWorld);
789
+ ${2===T?s.H`vec3 normal = screenDerivativeNormal(vPositionView);`:s.H`vec3 normal = normalize(vNormalWorld);
782
790
  if (gl_FrontFacing == false){
783
791
  normal = -normal;
784
792
  }`}
785
- fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 10:(0,f.NB)(r,t),e.include(n.d),e.include(c.U,t),e.include(m.A,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(s.H`vpos = getVertexInLocalOriginSpace();
793
+ fragColor = vec4(0.5 + 0.5 * normal, opacity);`);break}case 10:(0,v.NB)(r,t),e.include(n.d),e.include(c.U,t),e.include(p.A,t),M&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(s.H`vpos = getVertexInLocalOriginSpace();
786
794
  vpos = subtractOrigin(vpos);
787
795
  vpos = addVerticalOffset(vpos, localOrigin);
788
796
  gl_Position = transformPosition(proj, view, vpos);
789
- forwardTextureCoordinates();`),g.include(a.HQ,t),e.include(p.SS,t),e.include(h.Q,t),g.main.add(s.H`
797
+ forwardTextureCoordinates();`),x.include(a.HQ,t),e.include(f.SS,t),e.include(m.Q,t),x.main.add(s.H`
790
798
  discardBySlice(vpos);
791
- ${(0,s.If)(w,s.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
799
+ ${(0,s.If)(M,s.H`vec4 texColor = texture(tex, ${C?"colorUV":"vuv0"});
792
800
  discardOrAdjustAlpha(texColor);`)}
793
- calculateOcclusionAndOutputHighlight();`)}}},52540(e,t,r){r.d(t,{E:()=>s,l:()=>l});var o=r(37585),a=r(48163),n=r(77108),i=r(31821);function s(e){e.uniforms.add(new n.E("zProjectionMap",e=>l(e.camera))),e.code.add(i.H`float linearizeDepth(float depth, vec2 zProjectionConstants) {
801
+ calculateOcclusionAndOutputHighlight();`)}}},77068(e,t,r){r.d(t,{F:()=>p});var o=r(43519),a=r(31821);function n(e,t){t.instancedColor?(e.attributes.add("instanceColor","vec4"),e.vertex.include(o.WD),e.vertex.include(o.Y1),e.vertex.include(o.ML),e.vertex.code.add(a.H`
802
+ MaskedColor applyInstanceColor(MaskedColor color) {
803
+ return multiplyMaskedColors( color, createMaskedFromUInt8NaNColor(${"instanceColor"}));
804
+ }
805
+ `)):e.vertex.code.add(a.H`MaskedColor applyInstanceColor(MaskedColor color) {
806
+ return color;
807
+ }`)}var i=r(93588),s=r(43616);function l(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new i.c("symbolColorMixMode",e=>s.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(o.WD),e.vertex.include(o.Y1),e.vertex.include(o.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(a.H`
808
+ MaskedColor applySymbolColor(MaskedColor color) {
809
+ return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
810
+ }
811
+ `)):e.vertex.code.add(a.H`MaskedColor applySymbolColor(MaskedColor color) {
812
+ return color;
813
+ }`),e.vertex.code.add(a.H`
814
+ void forwardColorMixMode(bvec4 mask) {
815
+ colorMixMode = mask.r ? ${a.H.int(s.Um.ignore)} : symbolColorMixMode;
816
+ opacityMixMode = mask.a ? ${a.H.int(s.Um.ignore)} : symbolColorMixMode;
817
+ }
818
+ `)}function c(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(a.H`void forwardVertexColor() { vColor = color; }`)):e.vertex.code.add(a.H`void forwardVertexColor() {}`)}var u=r(27950),d=r(71988),h=r(20304),m=r(26934);function p(e,t){const{vertex:r,fragment:i,varyings:p}=e;e.include(n,t),e.include(l,t),e.include(c,t),r.include(o.WD),r.include(o.oF),r.include(m.Q),r.uniforms.add(new d.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),p.add("vExternalColor","vec4"),r.code.add(a.H`
819
+ void forwardDefaultMaterialExternalColor() {
820
+ forwardVertexColor();
821
+
822
+ MaskedColor maskedColor =
823
+ applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
824
+
825
+ vExternalColor = maskedColor.color;
826
+ forwardColorMixMode(maskedColor.mask);
827
+ }
828
+
829
+ bool shouldCullByOpacity() {
830
+ return opacityMixMode != ${a.H.int(s.Um.ignore)} && vExternalColor.a < alphaCutoff;
831
+ }
832
+ `),i.include(u.N),i.uniforms.add(new h.m("opacity",e=>e.opacity),new h.m("layerOpacity",e=>e.layerOpacity)),i.code.add(a.H`
833
+ float getDefaultMaterialOpacity(float textureOpacity) {
834
+ return layerOpacity * mixExternalOpacity(
835
+ ${(0,a.If)(t.hasVertexColors,"vColor.a * ")} opacity,
836
+ textureOpacity,
837
+ vExternalColor.a,
838
+ opacityMixMode
839
+ );
840
+ }
841
+ `)}},52540(e,t,r){r.d(t,{E:()=>s,l:()=>l});var o=r(37585),a=r(48163),n=r(77108),i=r(31821);function s(e){e.uniforms.add(new n.E("zProjectionMap",e=>l(e.camera))),e.code.add(i.H`float linearizeDepth(float depth, vec2 zProjectionConstants) {
794
842
  float depthNdc = depth * 2.0 - 1.0;
795
843
  return -(zProjectionConstants[0] / (depthNdc + zProjectionConstants[1] + 1e-7));
796
844
  }