@arcgis/core 5.2.0-next.20 → 5.2.0-next.21

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 (149) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/057d288d795b853295f1.js +2 -0
  3. package/assets/esri/core/workers/chunks/{595bc41ff36c77324d01.js → 19493c9c7e1d2ac0f80f.js} +8 -8
  4. package/assets/esri/core/workers/chunks/2ef80e003b4f0393ac2e.js +1 -0
  5. package/assets/esri/core/workers/chunks/{4fdd38d7362bf09a994b.js → 33866e6e6de1bab64599.js} +1 -1
  6. package/assets/esri/core/workers/chunks/360fd810d70d21c092d9.js +1 -0
  7. package/assets/esri/core/workers/chunks/{4517630bf869205bab87.js → 38a76bc4ef5c10ab0488.js} +1 -1
  8. package/assets/esri/core/workers/chunks/5468a65698931603656d.js +1 -0
  9. package/assets/esri/core/workers/chunks/{c9e5d3f496cefb8e3934.js → 5aa375b0c6a205134703.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{db26cf2c2735183294b8.js → 6649acaceab00ad30e7f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/7175f0c6a6e56b685d20.js +680 -0
  12. package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js → 754f7ed62afc4e0a1972.js} +2 -2
  13. package/assets/esri/core/workers/chunks/{6ac09f4e85c664a17365.js → 8331e04ebe0a54b04ab6.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{72edd08a2ff08970ba38.js → 87011d2fe14c54e296af.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{5216dd0544e901039c84.js → 8c64c6b8d7376a9d1c91.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{8ce4fe00328173224ed2.js → 909e67dee8c30e391d69.js} +1 -1
  17. package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +1 -0
  18. package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +1 -0
  19. package/assets/esri/core/workers/chunks/{4104a0585969f8cd524c.js → a40ede4d3375184f21fe.js} +1 -1
  20. package/assets/esri/core/workers/chunks/a533d066cac26124c5ce.js +1 -0
  21. package/assets/esri/core/workers/chunks/a536904fe6f3b16fdbdc.js +1 -0
  22. package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +1 -0
  23. package/assets/esri/core/workers/chunks/{dd0c1cf921369e2bc48b.js → a90619adff41658f8057.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{6e8b9c03240ec372b587.js → c30ca771dd3f7198142b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{e8d65900eefff1152207.js → c593539c2cce7a2b9d44.js} +1 -1
  26. package/assets/esri/core/workers/chunks/da47fdffb5969694a2ae.js +1 -0
  27. package/assets/esri/core/workers/chunks/{764c8ba14ab74b66b391.js → e5fcd8e7a4a660ef6ad6.js} +1 -1
  28. package/assets/esri/core/workers/chunks/f0519b06987471456b69.js +1 -0
  29. package/assets/esri/core/workers/chunks/{5f63077ec5ba3560491b.js → f1ff33584680d8718400.js} +1 -1
  30. package/assets/esri/core/workers/chunks/f47319d36f1527277923.js +1 -0
  31. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  32. package/assets/esri/themes/dark/main.css +1 -1
  33. package/assets/esri/themes/light/main.css +1 -1
  34. package/assets/esri/themes/light/view.css +1 -1
  35. package/chunks/Pattern.glsl.js +17 -17
  36. package/chunks/RibbonLine.glsl.js +45 -43
  37. package/chunks/bundle2.js +1 -1
  38. package/config.js +1 -1
  39. package/geometry/support/geometryUtils.js +1 -1
  40. package/geometry/support/intersects.js +1 -1
  41. package/geometry/support/intersectsBase.js +1 -1
  42. package/kernel.js +1 -1
  43. package/layers/AnnotationFeatureLayer.d.ts +43 -0
  44. package/layers/AnnotationFeatureLayer.js +1 -1
  45. package/layers/DimensionFeatureLayer.d.ts +39 -0
  46. package/layers/DimensionFeatureLayer.js +1 -1
  47. package/layers/DimensionLayer.d.ts +1 -0
  48. package/layers/FeatureLayer.js +1 -1
  49. package/layers/IntegratedMesh3DTilesLayer.d.ts +9 -1
  50. package/layers/ParquetLayer.d.ts +6 -10
  51. package/layers/graphics/data/attributeSupport.js +1 -1
  52. package/layers/graphics/data/queryValidationUtils.js +1 -1
  53. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  54. package/layers/mixins/ArcGISImageService.js +1 -1
  55. package/layers/raster/datasets/WCSRaster.js +1 -1
  56. package/layers/support/AnnotationFeatureSublayer.d.ts +5 -3
  57. package/layers/support/SymbolLayerDrawing.js +1 -1
  58. package/package.json +2 -2
  59. package/support/revision.js +1 -1
  60. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  61. package/views/2d/engine/transitions/FadeTransition.js +1 -1
  62. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  63. package/views/2d/engine/webgl/TileCpuState.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  68. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  69. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  70. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  71. package/views/2d/layers/LayerView2D.js +1 -1
  72. package/views/2d/layers/MediaLayerView2D.js +1 -1
  73. package/views/2d/layers/features/FeatureContainer.js +1 -1
  74. package/views/2d/layers/features/RenderState.js +1 -1
  75. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  76. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  77. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  78. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  79. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  80. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  81. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  82. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  83. package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
  84. package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +2 -0
  85. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  86. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  87. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
  88. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  89. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  90. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  91. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  92. package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
  93. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  94. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  95. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -11
  96. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +6 -9
  97. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +46 -46
  98. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +46 -18
  99. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +22 -22
  100. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  101. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  102. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  103. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  104. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  105. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  106. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  107. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  108. package/views/3d/webgl-engine/lib/PathVertexInfo.js +1 -1
  109. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  110. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferUtils.js +1 -1
  111. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  112. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  113. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  114. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  115. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  116. package/views/3d/webgl-engine/shaders/PatternTextureBuffer.glsl.js +1 -1
  117. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  118. package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
  119. package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +2 -0
  120. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +10 -10
  121. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  122. package/views/webgl/ShaderBuilder.js +1 -1
  123. package/widgets/BatchAttributeForm.js +1 -1
  124. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  125. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  126. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  127. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  128. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  129. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  130. package/widgets/OrientedImageryViewer/constants.js +1 -1
  131. package/widgets/OrientedImageryViewer/support/panConstraint.js +2 -0
  132. package/widgets/OrientedImageryViewer.js +1 -1
  133. package/widgets/Print/CustomTemplate.d.ts +7 -0
  134. package/widgets/Search/LayerSearchSource.d.ts +3 -0
  135. package/assets/esri/core/workers/chunks/0a259137932211b80f0e.js +0 -1
  136. package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +0 -1
  137. package/assets/esri/core/workers/chunks/74922daaedb479ec6f03.js +0 -1
  138. package/assets/esri/core/workers/chunks/912a8743a02f467b63b0.js +0 -2
  139. package/assets/esri/core/workers/chunks/9def4619d102f1d41578.js +0 -1
  140. package/assets/esri/core/workers/chunks/a0876a52a3c2ad849370.js +0 -1
  141. package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +0 -1
  142. package/assets/esri/core/workers/chunks/a98905bf6050ad3b8721.js +0 -633
  143. package/assets/esri/core/workers/chunks/bf67e0f6064fb9d94ac8.js +0 -1
  144. package/assets/esri/core/workers/chunks/cd892f429d5ffe8de99e.js +0 -1
  145. package/assets/esri/core/workers/chunks/d34d41a350facfa9b7c0.js +0 -1
  146. package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +0 -1
  147. package/assets/esri/core/workers/chunks/e5471373f89fd7cb9844.js +0 -1
  148. /package/assets/esri/core/workers/chunks/{912a8743a02f467b63b0.js.LICENSE.txt → 057d288d795b853295f1.js.LICENSE.txt} +0 -0
  149. /package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js.LICENSE.txt → 754f7ed62afc4e0a1972.js.LICENSE.txt} +0 -0
@@ -0,0 +1,680 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[118],{72091(e,t,i){i.d(t,{H:()=>g,b:()=>p});var r=i(6733),n=i(29236),s=i(68259),o=i(20304),a=i(31821),l=i(93588),c=i(63761),u=i(9273),h=i(34053),d=i(14113);function p(){const e=new d.N5;e.include(r.Q);const{fragment:t}=e;return t.uniforms.add(new c.N("blurInput",e=>e.highlightBlurTexture),new s.t("blurSize",e=>e.blurSize),new u.R("highlightTexture",e=>e.highlightTexture),new c.N("highlightOptionsTexture",e=>e.highlightOptionsTexture),new l.c("highlightLevel",e=>e.highlightLevel),new o.m("occludedIntensityFactor",e=>e.occludedFactor)),t.constants.add("inner","float",1-(h.o-h.b)/h.o),e.include(n.y),t.main.add(a.H`vec2 highlightTextureSize = vec2(textureSize(highlightTexture,0));
2
+ vec2 uv = sUV;
3
+ vec2 center = texture(blurInput, uv).rg;
4
+ vec2 blurredHighlightValue = (vOutlinePossible == 0.0)
5
+ ? center
6
+ : center * 0.204164
7
+ + texture(blurInput, uv + blurSize * 1.407333).rg * 0.304005
8
+ + texture(blurInput, uv - blurSize * 1.407333).rg * 0.304005
9
+ + texture(blurInput, uv + blurSize * 3.294215).rg * 0.093913
10
+ + texture(blurInput, uv - blurSize * 3.294215).rg * 0.093913;
11
+ float highlightIntensity = blurredHighlightValue.r;
12
+ float occlusionWeight = blurredHighlightValue.g;
13
+ if (highlightIntensity <= 0.01) {
14
+ discard;
15
+ }
16
+ vec4 fillColor = texelFetch(highlightOptionsTexture, ivec2(highlightLevel, 0), 0);
17
+ vec4 outlineColor = texelFetch(highlightOptionsTexture, ivec2(highlightLevel, 1), 0);
18
+ uvec2 centerTexel = texelFetch(highlightTexture, ivec2(uv * highlightTextureSize), 0).rg;
19
+ uint centerBits = readLevelBits(centerTexel, highlightLevel);
20
+ bool centerFilled = (centerBits & 1u) == 1u;
21
+ bool centerOccluded = (centerBits & 3u) == 3u;
22
+ bool occluded = centerOccluded || (0.5 * highlightIntensity < occlusionWeight);
23
+ float occlusionFactor = occluded ? occludedIntensityFactor : 1.0;
24
+ float outlineFactor = centerFilled ? 1.0 : smoothstep(0.0, inner, highlightIntensity);
25
+ float fillFactor = centerFilled ? 1.0 : 0.0;
26
+ vec4 baseColor = mix(outlineColor, fillColor, fillFactor);
27
+ float intensity = baseColor.a * occlusionFactor * outlineFactor;
28
+ fragColor = vec4(baseColor.rgb, intensity);`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,build:p},Symbol.toStringTag,{value:"Module"}))},28476(e,t,i){i.d(t,{H:()=>u,a:()=>d,b:()=>h});var r=i(48163),n=i(6733),s=i(68259),o=i(31821),a=i(15976),l=i(65786),c=i(14113);class u extends l.Y{constructor(){super(...arguments),this.blurSize=(0,r.vt)()}}function h(){const e=new c.N5;return e.include(n.Q),e.outputs.add("fragHighlight","vec2",0),e.fragment.uniforms.add(new s.t("blurSize",e=>e.blurSize),new a.o("blurInput",e=>e.blurInput)).main.add(o.H`vec2 highlightTextureSize = vec2(textureSize(blurInput,0));
29
+ vec2 center = texture(blurInput, sUV).rg;
30
+ if (vOutlinePossible == 0.0) {
31
+ fragHighlight = center;
32
+ } else {
33
+ vec2 sum = center * 0.204164;
34
+ sum += texture(blurInput, sUV + blurSize * 1.407333).rg * 0.304005;
35
+ sum += texture(blurInput, sUV - blurSize * 1.407333).rg * 0.304005;
36
+ sum += texture(blurInput, sUV + blurSize * 3.294215).rg * 0.093913;
37
+ sum += texture(blurInput, sUV - blurSize * 3.294215).rg * 0.093913;
38
+ fragHighlight = sum;
39
+ }`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,HighlightBlurDrawParameters:u,build:h},Symbol.toStringTag,{value:"Module"}))},34053(e,t,i){i.d(t,{H:()=>l,a:()=>p,b:()=>d,c:()=>c,g:()=>u,o:()=>h});var r=i(82048),n=i(31821),s=i(9273),o=i(65786),a=i(14113);class l extends o.Y{}function c(){const e=new a.N5,{outputs:t,fragment:i}=e;return e.include(r.c),i.uniforms.add(new s.R("highlightTexture",e=>e.highlightTexture)),i.constants.add("outlineWidth","int",Math.ceil(h)),i.constants.add("cellSize","int",u),t.add("fragGrid","uvec2"),i.main.add(n.H`ivec2 inputTextureSize = textureSize(highlightTexture, 0);
40
+ ivec2 cellBottomLeftCornerInput = ivec2(ivec2(floor(gl_FragCoord.xy) * vec2(cellSize)));
41
+ ivec2 coordMid = cellBottomLeftCornerInput + ivec2(cellSize >> 1);
42
+ uvec2 centreTexel = texelFetch(highlightTexture, coordMid, 0).rg & uvec2(0x55u);
43
+ float marginSquare = float(outlineWidth*outlineWidth);
44
+ uvec2 outputValue = centreTexel & uvec2(0x55u);
45
+ for(int y = -outlineWidth; y <= cellSize + outlineWidth; y+=2) {
46
+ int dy = y < 0 ? -y : y > cellSize ? y-cellSize : 0;
47
+ int xMargin = dy > 0 ? int(ceil(sqrt(marginSquare - float(dy*dy)))) : outlineWidth;
48
+ for(int x = -xMargin; x <= cellSize + xMargin; x+=2) {
49
+ ivec2 coord = cellBottomLeftCornerInput + ivec2(x, y);
50
+ uvec2[4] texels = uvec2[4] (
51
+ texelFetch(highlightTexture,coord+ivec2(0,0),0).rg & uvec2(0x55u),
52
+ texelFetch(highlightTexture,coord+ivec2(1,0),0).rg & uvec2(0x55u),
53
+ texelFetch(highlightTexture,coord+ivec2(0,1),0).rg & uvec2(0x55u),
54
+ texelFetch(highlightTexture,coord+ivec2(1,1),0).rg & uvec2(0x55u)
55
+ );
56
+ if (texels[0] == texels[1] && texels[1] == texels[2] && texels[2] == texels[3] && texels[3] == centreTexel) {
57
+ continue;
58
+ }
59
+ for (int i=0; i<4; ++i){
60
+ outputValue |= ((texels[i] ^ centreTexel) << 1);
61
+ outputValue |= texels[i];
62
+ }
63
+ }
64
+ }
65
+ fragGrid = outputValue;`),e}const u=32,h=9,d=.4,p=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:l,blurSize:d,build:c,gridCellPixelSize:u,outlineSize:h},Symbol.toStringTag,{value:"Module"}))},16824(e,t,i){i.d(t,{H:()=>u,b:()=>c});var r=i(6733),n=i(29236),s=i(31821),o=i(93588),a=i(9273),l=i(14113);function c(){const e=new l.N5;e.include(r.Q),e.include(n.y);const{fragment:t}=e;return e.outputs.add("fragSingleHighlight","vec2",0),t.uniforms.add(new a.R("highlightTexture",e=>e.highlightTexture),new o.c("highlightLevel",e=>e.highlightLevel)),t.main.add(s.H`ivec2 iuv = ivec2(gl_FragCoord.xy);
66
+ uvec2 inputTexel = texelFetch(highlightTexture, iuv, 0).rg;
67
+ uint bits = readLevelBits(inputTexel, highlightLevel);
68
+ bool hasHighlight = (bits & 1u) == 1u;
69
+ bool hasOccluded = (bits & 2u) == 2u;
70
+ fragSingleHighlight = vec2(hasHighlight ? 1.0 : 0.0, hasOccluded ? 1.0 : 0.0);`),e}const u=Object.freeze(Object.defineProperty({__proto__:null,build:c},Symbol.toStringTag,{value:"Module"}))},80583(e,t,i){i.d(t,{O:()=>u,a:()=>d,b:()=>h});var r=i(82048),n=i(20304),s=i(31821),o=i(93588),a=i(63761),l=i(65786),c=i(14113);class u extends l.Y{constructor(){super(...arguments),this.overlayIndex=0,this.opacity=1}}function h(){const e=new c.N5;return e.include(r.c),e.fragment.uniforms.add(new a.N("tex",e=>e.texture)),e.fragment.uniforms.add(new o.c("overlayIdx",e=>e.overlayIndex)),e.fragment.uniforms.add(new n.m("opacity",e=>e.opacity)),e.fragment.main.add(s.H`vec2 overlayUV = overlayIdx == 0 ? vec2(uv.x * 0.5, uv.y) : vec2(uv.x * 0.5 + 0.5, uv.y);
71
+ fragColor = texture(tex, overlayUV) * opacity;`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,OverlayCompositingPassParameters:u,build:h},Symbol.toStringTag,{value:"Module"}))},32565(e,t,i){i.d(t,{R:()=>E,b:()=>A,r:()=>T});var r=i(34711),n=i(36782),s=i(84652),o=i(2923),a=i(28974),l=i(89786),c=i(82094),u=i(63365),h=i(66269),d=i(77949),p=i(77108),g=i(14314),f=i(71988),m=i(33094),v=i(20304),x=i(31821),y=i(58029),_=i(26934),b=i(54073),S=i(39122),w=i(11435),C=i(14113);const T=1;function A(e){const t=new C.N5,{attributes:i,varyings:T,vertex:A,fragment:E}=t,{applyMarkerOffset:R,draped:O,output:M,capType:L,stippleEnabled:P,falloffEnabled:I,roundJoins:D,wireframe:F,innerColorEnabled:N,hasAnimation:z,hasScreenSizePerspective:H,worldSizedImagePattern:W}=e,V=(0,w.W)().createBuilder(t,e);A.inputs.add("position",()=>V.getTextureAttribute("position")),E.include(l.p),t.include(s.s,e),t.include(o.q,e),t.include(n.g,e),t.include(b.Q,e);const j=R&&!O;j&&(A.uniforms.add(new v.m("markerScale",e=>e.markerScale)),t.include(a.r,{space:2,hasScreenSizePerspective:H})),(0,d.NB)(A,e),A.uniforms.add(new y.F("inverseProjectionMatrix",e=>e.camera.inverseProjectionMatrix),new p.E("nearFar",e=>e.camera.nearFar),new v.m("miterLimit",e=>"miter"!==e.join?0:e.miterLimit),new g.I("viewport",e=>e.camera.fullViewport)),A.constants.add("LARGE_HALF_FLOAT","float",65500),A.constants.add("EPS","float",.001),A.constants.add("NUM_JOIN_SUBDIVISIONS","float",e.numJoinSubdivisions),i.add("textureElementIndex","uint"),i.add("previousDelta","vec4"),i.add("nextDelta","vec4"),i.add("lineParameters","vec2"),i.add("u0","float"),T.add("vColor","vec4"),T.add("vpos","vec3",{invariant:!0}),T.add("vLineDistance","float"),T.add("vLineWidth","float"),P||(T.add("vIsInsideJoin","int"),T.add("vStretchFactor","float"),T.add("vJoinCenterLineSDFs","vec2"),T.add("vSubdivisionFactor","float"));const U=P;U&&T.add("vLineSizeInv","float");const B=2===L,$=P&&B,Z=I||$;Z&&T.add("vLineDistanceNorm","float"),B&&(T.add("vSegmentSDF","float"),T.add("vReverseSegmentSDF","float")),A.code.add(x.H`vec3 perpendicular(vec3 v) {
72
+ return vec3(v.y, -v.x, 0.0);
73
+ }
74
+ float interp(float ncp, vec4 a, vec4 b) {
75
+ return (-ncp - a.z) / (b.z - a.z);
76
+ }
77
+ vec3 rotateZ(vec3 v, float a) {
78
+ float s = sin(a);
79
+ float c = cos(a);
80
+ mat2 m = mat2(c, -s, s, c);
81
+ return vec3(m * v.xy, v.z);
82
+ }`),A.code.add(x.H`vec4 projectAndScale(vec4 pos) {
83
+ vec4 posNdc = proj * pos;
84
+ posNdc.xy *= viewport.zw / posNdc.w;
85
+ posNdc.z /= posNdc.w;
86
+ return posNdc;
87
+ }`),A.code.add(x.H`void clip(
88
+ inout vec4 pos,
89
+ inout vec4 prev,
90
+ inout vec4 next,
91
+ bool isStartVertex
92
+ ) {
93
+ float vnp = nearFar[0] * 0.99;
94
+ if (pos.z > -nearFar[0]) {
95
+ if (!isStartVertex) {
96
+ if (prev.z < -nearFar[0]) {
97
+ pos = mix(prev, pos, interp(vnp, prev, pos));
98
+ next = pos;
99
+ } else {
100
+ pos = vec4(0.0, 0.0, 0.0, 1.0);
101
+ }
102
+ } else {
103
+ if (next.z < -nearFar[0]) {
104
+ pos = mix(pos, next, interp(vnp, pos, next));
105
+ prev = pos;
106
+ } else {
107
+ pos = vec4(0.0, 0.0, 0.0, 1.0);
108
+ }
109
+ }
110
+ } else {
111
+ if (prev.z > -nearFar[0]) {
112
+ prev = mix(pos, prev, interp(vnp, pos, prev));
113
+ }
114
+ if (next.z > -nearFar[0]) {
115
+ next = mix(next, pos, interp(vnp, next, pos));
116
+ }
117
+ }
118
+ }`),(0,d.Nz)(A),A.constants.add("aaWidth","float",P?0:1).main.add(x.H`
119
+ vec3 position = ${V.getTextureAttribute("position")};
120
+
121
+ // unpack values from vertex type
122
+ bool isStartVertex = abs(abs(lineParameters.y) - 3.0) == 1.0;
123
+ vec3 prevPosition = position + previousDelta.xyz * previousDelta.w;
124
+ vec3 nextPosition = position + nextDelta.xyz * nextDelta.w;
125
+
126
+ float coverage = 1.0;
127
+
128
+ // Check for special value of lineParameters.y which is used by the Renderer when graphics are removed before the
129
+ // VBO is recompacted. If this is the case, then we just project outside of clip space.
130
+ if (lineParameters.y == 0.0) {
131
+ gl_Position = ${c.Z};
132
+ }
133
+ else {
134
+ vec4 pos = view * vec4(position, 1.0);
135
+ vec4 prev = view * vec4(prevPosition, 1.0);
136
+ vec4 next = view * vec4(nextPosition, 1.0);
137
+
138
+ bool isJoin = abs(lineParameters.y) < 3.0;
139
+ `),j&&A.main.add(x.H`vec4 other = isStartVertex ? next : prev;
140
+ bool markersHidden = areWorldMarkersHidden(pos.xyz, other.xyz);
141
+ if (!isJoin && !markersHidden) {
142
+ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
143
+ }`),t.include(h.F),A.main.add(x.H`
144
+ clip(pos, prev, next, isStartVertex);
145
+
146
+ vec3 clippedPos = pos.xyz;
147
+ vec3 clippedCenter = mix(pos.xyz, isStartVertex ? next.xyz : prev.xyz, 0.5);
148
+
149
+ pos = projectAndScale(pos);
150
+ next = projectAndScale(next);
151
+ prev = projectAndScale(prev);
152
+
153
+ vec3 left = (pos.xyz - prev.xyz);
154
+ vec3 right = (next.xyz - pos.xyz);
155
+
156
+ float leftLen = length(left);
157
+ float rightLen = length(right);
158
+
159
+ float lineSize = getSize(${(0,x.If)(H,"clippedPos")});
160
+ ${(0,x.If)(P&&H,"float patternLineSize = getSize(clippedCenter);")}
161
+ ${(0,x.If)(P&&!H,"float patternLineSize = lineSize;")}
162
+
163
+ ${(0,x.If)(W,x.H`
164
+ lineSize += aaWidth;
165
+ float lineWidth = lineSize * pixelRatio * worldToScreenRatio;
166
+ if (lineWidth < 1.0) {
167
+ coverage = lineWidth;
168
+ lineWidth = 1.0;
169
+ }
170
+ `,x.H`
171
+ if (lineSize < 1.0) {
172
+ coverage = lineSize; // convert sub-pixel coverage to alpha
173
+ lineSize = 1.0;
174
+ }
175
+
176
+ lineSize += aaWidth;
177
+ float lineWidth = lineSize * pixelRatio;
178
+ `)}
179
+
180
+ vLineWidth = noPerspectiveWrite(lineWidth, pos.w);
181
+ ${U?x.H`vLineSizeInv = noPerspectiveWrite(1.0 / lineSize, pos.w);`:""}
182
+ `),(P||B)&&A.main.add(x.H`
183
+ float isEndVertex = float(!isStartVertex);
184
+ vec3 segmentOrigin = mix(pos.xyz, prev.xyz, isEndVertex);
185
+ vec3 segment = mix(right, left, isEndVertex);
186
+ ${B?x.H`vec3 segmentEnd = mix(next.xyz, pos.xyz, isEndVertex);`:""}
187
+ `),A.main.add(x.H`left = (leftLen > EPS) ? left/leftLen : vec3(0.0, 0.0, 0.0);
188
+ right = (rightLen > EPS) ? right/rightLen : vec3(0.0, 0.0, 0.0);
189
+ vec3 segmentDirection = isStartVertex ? right : left;
190
+ vec3 capDisplacementDir = vec3(0.0, 0.0, 0.0);
191
+ vec3 joinDisplacementDir = vec3(0.0, 0.0, 0.0);
192
+ float displacementLen = lineWidth;
193
+ float miterDisplacementLen = lineWidth;
194
+ float innerDisplacementLen = lineWidth;`),P||A.main.add(x.H`vIsInsideJoin = 0;
195
+ vStretchFactor = 1.0;
196
+ vSubdivisionFactor = 0.0;
197
+ vJoinCenterLineSDFs = vec2(LARGE_HALF_FLOAT);`),A.main.add(x.H`float subdivisionFactor = 0.0;
198
+ bool isOutside = false;
199
+ if (isJoin) {
200
+ isOutside = (left.x * right.y - left.y * right.x) * lineParameters.y > 0.0;
201
+ vec3 joinDirection = normalize(left + right);
202
+ joinDisplacementDir = perpendicular(joinDirection);
203
+ if (leftLen > EPS && rightLen > EPS) {
204
+ float nDotSeg = dot(joinDisplacementDir, left);
205
+ displacementLen /= length(nDotSeg * left - joinDisplacementDir);
206
+ miterDisplacementLen = displacementLen;
207
+ innerDisplacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg));
208
+ if (!isOutside) {
209
+ displacementLen = innerDisplacementLen;
210
+ }
211
+ }
212
+ subdivisionFactor = lineParameters.x;`),P||A.main.add(x.H`if(subdivisionFactor > 0.0) {
213
+ vIsInsideJoin = 1;
214
+ }
215
+ vSubdivisionFactor = isOutside ? subdivisionFactor : 0.5;
216
+ if (miterDisplacementLen > miterLimit * lineWidth) {
217
+ vec2 leftScreenDir = left.xy;
218
+ vec2 rightScreenDir = right.xy;
219
+ float leftScreenLen = length(leftScreenDir);
220
+ float rightScreenLen = length(rightScreenDir);
221
+ if (leftScreenLen > EPS && rightScreenLen > EPS) {
222
+ leftScreenDir /= leftScreenLen;
223
+ rightScreenDir /= rightScreenLen;
224
+ float theta = acos(clamp(dot(leftScreenDir, rightScreenDir), -1.0, 1.0));
225
+ float subdividedTriangleHeight = (innerDisplacementLen + lineWidth) * cos(theta / (2.0 + 2.0 * NUM_JOIN_SUBDIVISIONS));
226
+ float bevelTriangleHeight = innerDisplacementLen + lineWidth * cos(theta * 0.5);
227
+ float triangleHeight = NUM_JOIN_SUBDIVISIONS > 0.0 ? subdividedTriangleHeight : bevelTriangleHeight;
228
+ vStretchFactor = noPerspectiveWrite(max(triangleHeight / (2.0 * lineWidth), 1.0), pos.w);
229
+ }
230
+ }`),A.main.add(x.H`if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),D?A.main.add(x.H`
231
+ vec3 startDir = leftLen < EPS ? right : left;
232
+ startDir = perpendicular(startDir);
233
+
234
+ vec3 endDir = rightLen < EPS ? left : right;
235
+ endDir = perpendicular(endDir);
236
+
237
+ float factor = ${P?x.H`min(1.0, subdivisionFactor * ((NUM_JOIN_SUBDIVISIONS + 1.0) / NUM_JOIN_SUBDIVISIONS))`:x.H`subdivisionFactor`};
238
+
239
+ float rotationAngle = acos(clamp(dot(startDir.xy, endDir.xy), -1.0, 1.0));
240
+ joinDisplacementDir = rotateZ(startDir, -sign(lineParameters.y) * factor * rotationAngle);
241
+ `):A.main.add(x.H`
242
+ vec3 startDir = perpendicular(leftLen < EPS ? right : left);
243
+ vec3 endDir = perpendicular(rightLen < EPS ? left : right);
244
+
245
+ ${(0,x.If)(P,x.H`joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? endDir : startDir;`,x.H`joinDisplacementDir = mix(startDir, endDir, subdivisionFactor);`)}
246
+ `);const k=0!==L;return A.main.add(x.H`
247
+ displacementLen = lineWidth;
248
+ }
249
+ } else {
250
+ // CAP handling ---------------------------------------------------
251
+ joinDisplacementDir = isStartVertex ? right : left;
252
+ joinDisplacementDir = perpendicular(joinDisplacementDir);
253
+
254
+ ${k?x.H`capDisplacementDir = vec3((isStartVertex ? -right : left).xy, 0.0);`:""}
255
+ }
256
+ `),A.main.add(x.H`
257
+ // Displacement (in pixels) caused by join/or cap
258
+ vec2 dposXY = (joinDisplacementDir.xy * sign(lineParameters.y) + capDisplacementDir.xy) * displacementLen;
259
+
260
+ /**
261
+ * To prevent z-fighting between layers, we also adjust the z value.
262
+ * We want to ensure that the orientation of the final triangles is the same, regardless of the line width.
263
+ * To do so, the below formula projects the xy displacement onto the original segment direction
264
+ * to find the z-offset necessary so the triangle orientation is independent of the width.
265
+ */
266
+ float dposZ = dot(dposXY, segmentDirection.xy) / dot(segmentDirection.xy, segmentDirection.xy) * segmentDirection.z;
267
+ vec3 dpos = vec3(dposXY, dposZ);
268
+
269
+ float lineDistNorm = noPerspectiveWrite(sign(lineParameters.y), pos.w);
270
+
271
+ vLineDistance = lineWidth * lineDistNorm;
272
+ ${Z?x.H`vLineDistanceNorm = lineDistNorm;`:""}
273
+
274
+ pos.xyz += dpos;
275
+ `),P||A.main.add(x.H`if (isJoin) {
276
+ vec2 joinCenterToVertex = dposXY;
277
+ vec2 leftCenterlineDir = left.xy;
278
+ vec2 rightCenterlineDir = right.xy;
279
+ float leftCenterlineLen = length(leftCenterlineDir);
280
+ float rightCenterlineLen = length(rightCenterlineDir);
281
+ leftCenterlineDir = leftCenterlineLen > EPS ? leftCenterlineDir / leftCenterlineLen : vec2(1.0, 0.0);
282
+ rightCenterlineDir = rightCenterlineLen > EPS ? rightCenterlineDir / rightCenterlineLen : leftCenterlineDir;
283
+ vJoinCenterLineSDFs = noPerspectiveWrite(
284
+ vec2(
285
+ dot(vec2(rightCenterlineDir.y, -rightCenterlineDir.x), joinCenterToVertex),
286
+ dot(vec2(leftCenterlineDir.y, -leftCenterlineDir.x), joinCenterToVertex)
287
+ ),
288
+ pos.w
289
+ );
290
+ }`),B&&A.main.add(x.H`vec2 segmentDir = normalize(segment.xy);
291
+ vSegmentSDF = noPerspectiveWrite((isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin.xy, segmentDir)), pos.w);
292
+ vReverseSegmentSDF = noPerspectiveWrite((isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd.xy, -segmentDir)), pos.w);`),P&&(O?A.uniforms.add(new m.U("worldToScreenRatio",e=>1/e.screenToPCSRatio)):A.main.add(x.H`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
293
+ float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),A.main.add(x.H`float segmentLengthScreenDouble = length(segment.xy);
294
+ float segmentLengthScreen = segmentLengthScreenDouble * 0.5;
295
+ float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio);
296
+ float segmentLengthRender = length(mix(nextPosition - position, position - prevPosition, isEndVertex));
297
+ vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),O?A.main.add(x.H`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio;
298
+ float startPseudoScreen = u0 * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):A.main.add(x.H`float startPseudoScreen = mix(u0, u0 - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio;
299
+ float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),A.uniforms.add(new v.m("stipplePatternPixelSize",e=>(0,o.h)(e))),A.main.add(x.H`
300
+ float patternLength = patternLineSize * stipplePatternPixelSize;
301
+
302
+ ${(0,x.If)(W,x.H`
303
+ float uu = mix(u0, u0 - segmentLengthRender, isEndVertex);
304
+ vStippleDistanceLimits = vec2(uu, uu + segmentLengthRender);
305
+ vStipplePatternStretch = 1.0;
306
+
307
+ // The v-coordinate used in case of an image pattern.
308
+ bool isLeft = sign(lineParameters.y) < 0.0;
309
+ vStippleV = isLeft ? 0.0 : 1.0;
310
+ `,x.H`
311
+ // Compute the coordinates at both start and end of the line segment, because we need both to clamp to in the
312
+ // fragment shader
313
+ vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
314
+ `)}
315
+
316
+ vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex);
317
+
318
+ // Adjust the coordinate to the displaced position (the pattern is shortened/overextended on the in/outside of
319
+ // joins)
320
+ if (segmentLengthScreenDouble >= EPS) {
321
+ // Project the actual vertex position onto the line segment. Note that the resulting factor is within [0..1]
322
+ // at the original vertex positions, and slightly outside of that range at the displaced positions
323
+ vec3 stippleDisplacement = pos.xyz - segmentOrigin;
324
+ float stippleDisplacementFactor = dot(segment.xy, stippleDisplacement.xy) / (segmentLengthScreenDouble * segmentLengthScreenDouble);
325
+
326
+ // Apply this offset to the actual vertex coordinate (can be screen or pseudo-screen space)
327
+ vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x);
328
+ }
329
+
330
+ // Cancel out perspective correct interpolation because we want this length the really represent the screen
331
+ // distance
332
+ vStippleDistanceLimits = noPerspectiveWrite(vStippleDistanceLimits, pos.w);
333
+ vStippleDistance = noPerspectiveWrite(vStippleDistance, pos.w);
334
+
335
+ // Disable stipple distance limits on caps
336
+ vStippleDistanceLimits = isJoin ?
337
+ vStippleDistanceLimits :
338
+ isStartVertex ?
339
+ vec2(-1e34, vStippleDistanceLimits.y) :
340
+ vec2(vStippleDistanceLimits.x, 1e34);
341
+ `)),A.main.add(x.H`
342
+ // Convert back into NDC
343
+ pos.xy = (pos.xy / viewport.zw) * pos.w;
344
+ pos.z = pos.z * pos.w;
345
+
346
+ vColor = getColor();
347
+ vColor.a = noPerspectiveWrite(vColor.a * coverage, pos.w);
348
+
349
+ ${F&&!O?"pos.z -= EPS * pos.w;":""}
350
+
351
+ // transform final position to camera space for slicing
352
+ vpos = (inverseProjectionMatrix * pos).xyz;
353
+ gl_Position = pos;
354
+ forwardObjectAndLayerIdColor();
355
+ }`),t.fragment.include(r.HQ,e),t.include(S.D,e),E.include(u.a),E.main.add(x.H`discardBySlice(vpos);`),t.include(h.m),E.include(_.Q),E.main.add(x.H`
356
+ float lineWidth = noPerspectiveRead(vLineWidth);
357
+ float lineDistance = noPerspectiveRead(vLineDistance);
358
+ ${(0,x.If)(Z,x.H`float lineDistanceNorm = noPerspectiveRead(vLineDistanceNorm);`)}
359
+ `),F?E.main.add(x.H`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(B&&E.main.add(x.H`float sdf = noPerspectiveRead(min(vSegmentSDF, vReverseSegmentSDF));
360
+ vec2 fragmentPosition = vec2(min(sdf, 0.0), lineDistance);
361
+ float fragmentRadius = length(fragmentPosition);
362
+ float fragmentCapSDF = (fragmentRadius - lineWidth) * 0.5;
363
+ float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
364
+ if (capCoverage < alphaCutoff) {
365
+ discard;
366
+ }`),$?E.main.add(x.H`vec2 stipplePosition = vec2(
367
+ min(getStippleSDF() * 2.0 - 1.0, 0.0),
368
+ lineDistanceNorm
369
+ );
370
+ float stippleRadius = length(stipplePosition * lineWidth);
371
+ float stippleCapSDF = (stippleRadius - lineWidth) * 0.5;
372
+ float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
373
+ float stippleAlpha = step(alphaCutoff, stippleCoverage);`):E.main.add(x.H`float stippleAlpha = getStippleAlpha(lineWidth);`),11!==M&&E.main.add(x.H`discardByStippleAlpha(stippleAlpha, alphaCutoff);`),t.include(h.m),E.uniforms.add(new f.E("intrinsicColor",e=>e.color)).main.add(x.H`vec4 color = intrinsicColor * vColor;
374
+ color.a = noPerspectiveRead(color.a);`),N&&E.uniforms.add(new f.E("innerColor",e=>e.innerColor??e.color),new v.m("innerWidth",(e,t)=>e.innerWidth*t.camera.pixelRatio)).main.add(x.H`float distToInner = abs(lineDistance) - innerWidth;
375
+ float innerAA = clamp(0.5 - distToInner, 0.0, 1.0);
376
+ float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a);
377
+ color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),E.main.add(x.H`vec4 finalColor = blendStipple(color, stippleAlpha);`),I&&(E.uniforms.add(new v.m("falloff",e=>e.falloff)),E.main.add(x.H`finalColor.a *= pow(max(0.0, 1.0 - abs(lineDistanceNorm)), falloff);`)),P||E.main.add(x.H`float stretchFactor = vIsInsideJoin == 1 ? noPerspectiveRead(vStretchFactor) : 1.0;
378
+ float featherWidth = 2.0;
379
+ float featherStartDistance = max(lineWidth - featherWidth / stretchFactor, 0.0);
380
+ float straightFeatherStartDistance = max(lineWidth - featherWidth, 0.0);
381
+ float value = abs(lineDistance);
382
+ float feather = (value - featherStartDistance) / (lineWidth - featherStartDistance);
383
+ vec2 joinCenterSDFs = noPerspectiveRead(vJoinCenterLineSDFs);
384
+ float joinCenterDistance = abs(vSubdivisionFactor > 0.5 ? joinCenterSDFs.x : joinCenterSDFs.y);
385
+ float straightFeather = (joinCenterDistance - straightFeatherStartDistance) / (lineWidth - straightFeatherStartDistance);
386
+ feather = vIsInsideJoin == 1 ? max(feather, straightFeather) : feather;
387
+ finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`),z&&E.main.add("finalColor = animate(finalColor);")),E.main.add(x.H`outputColorHighlightOLID(applySlice(finalColor, vpos), finalColor.rgb);`),t}const E=Object.freeze(Object.defineProperty({__proto__:null,build:A,ribbonlineNumRoundJoinSubdivisions:T},Symbol.toStringTag,{value:"Module"}))},92942(e,t,i){i.d(t,{T:()=>u,a:()=>d,b:()=>h});var r=i(51850),n=i(82048),s=i(33079),o=i(31821),a=i(63761),l=i(65786),c=i(14113);class u extends l.Y{constructor(){super(...arguments),this.color=(0,r.fA)(1,1,1)}}function h(){const e=new c.N5;return e.include(n.c),e.fragment.uniforms.add(new a.N("tex",e=>e.texture),new s.t("uColor",e=>e.color)).main.add(o.H`vec4 texColor = texture(tex, uv);
388
+ fragColor = texColor * vec4(uColor, 1.0);`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,TexturePassParameters:u,build:h},Symbol.toStringTag,{value:"Module"}))},83349(e,t,i){function r(e,t,i){i=i||2;var r,s,a,l,c,u,d,p=t&&t.length,g=p?t[0]*i:e.length,f=n(e,0,g,i,!0),m=[];if(!f||f.next===f.prev)return m;if(p&&(f=h(e,t,f,i)),e.length>80*i){r=a=e[0],s=l=e[1];for(var v=i;v<g;v+=i)(c=e[v])<r&&(r=c),(u=e[v+1])<s&&(s=u),c>a&&(a=c),u>l&&(l=u);d=0!==(d=Math.max(a-r,l-s))?1/d:0}return o(f,m,i,r,s,d),m}function n(e,t,i,r,n){var s,o;if(n===L(e,t,i,r)>0)for(s=t;s<i;s+=r)o=R(s,e[s],e[s+1],o);else for(s=i-r;s>=t;s-=r)o=R(s,e[s],e[s+1],o);if(o&&S(o,o.next)){var a=o.next;O(o),o=a}return o}function s(e,t){if(!e)return e;t||(t=e);var i,r=e;do{if(i=!1,r.steiner||!S(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{var n=r.prev;if(O(r),(r=t=n)===r.next)break;i=!0}}while(i||r!==t);return t}function o(e,t,i,r,n,h,d){if(e){!d&&h&&m(e,r,n,h);for(var p,g,f=e;e.prev!==e.next;)if(p=e.prev,g=e.next,h?l(e,r,n,h):a(e))t.push(p.i/i),t.push(e.i/i),t.push(g.i/i),O(e),e=g.next,f=g.next;else if((e=g)===f){d?1===d?o(e=c(s(e),t,i),t,i,r,n,h,2):2===d&&u(e,t,i,r,n,h):o(s(e),t,i,r,n,h,1);break}}}function a(e){var t=e.prev,i=e,r=e.next;if(b(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(y(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function l(e,t,i,r){var n=e.prev,s=e,o=e.next;if(b(n,s,o)>=0)return!1;for(var a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,l=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,c=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,u=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,h=v(a,l,t,i,r),d=v(c,u,t,i,r),p=e.prevZ,g=e.nextZ;p&&p.z>=h&&g&&g.z<=d;){if(p!==e.prev&&p!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,g!==e.prev&&g!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,g.x,g.y)&&b(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=d;){if(g!==e.prev&&g!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,g.x,g.y)&&b(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!S(n,o)&&w(n,r,r.next,o)&&A(n,o)&&A(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),O(r),O(r.next),r=e=o),r=r.next}while(r!==e);return s(r)}function u(e,t,i,r,n,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&_(l,c)){var u=E(l,c);return l=s(l,l.next),u=s(u,u.next),o(l,t,i,r,n,a),void o(u,t,i,r,n,a)}c=c.next}l=l.next}while(l!==e)}function h(e,t,i,r){var o,a,l,c=[];for(o=0,a=t.length;o<a;o++)(l=n(e,t[o]*r,o<a-1?t[o+1]*r:e.length,r,!1))===l.next&&(l.steiner=!0),c.push(x(l));for(c.sort(d),o=0;o<c.length;o++)i=s(i=g(c[o],i),i.next);return i}function d(e,t){return e.x-t.x}function p(e){if(e.next.prev===e)return e;let t=e;for(;;){const i=t.next;if(i.prev===t||i===t||i===e)break;t=i}return t}function g(e,t){var i=function(e,t){var i,r=t,n=e.x,s=e.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o){if(o=a,a===n){if(s===r.y)return r;if(s===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===o)return i;var l,c=i,u=i.x,h=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=u&&n!==r.x&&y(s<h?n:o,s,u,h,s<h?o:n,s,r.x,r.y)&&(l=Math.abs(s-r.y)/(n-r.x),A(r,e)&&(l<d||l===d&&(r.x>i.x||r.x===i.x&&f(i,r)))&&(i=r,d=l)),r=r.next}while(r!==c);return i}(e,t);if(!i)return t;var r=E(i,e),n=s(i,i.next);let o=p(r);return s(o,o.next),n=p(n),p(t===i?n:t)}function f(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}function m(e,t,i,r){var n=e;do{null===n.z&&(n.z=v(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,i,r,n,s,o,a,l,c=1;do{for(i=e,e=null,s=null,o=0;i;){for(o++,r=i,a=0,t=0;t<c&&(a++,r=r.nextZ);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=r}s.nextZ=null,c*=2}while(o>1)}(n)}function v(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function x(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function y(e,t,i,r,n,s,o,a){return(n-o)*(t-a)-(e-o)*(s-a)>=0&&(e-o)*(r-a)-(i-o)*(t-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&w(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(A(e,t)&&A(t,e)&&function(e,t){var i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}(e,t)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||S(e,t)&&b(e.prev,e,e.next)>0&&b(t.prev,t,t.next)>0)}function b(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,i,r){var n=T(b(e,t,i)),s=T(b(e,t,r)),o=T(b(i,r,e)),a=T(b(i,r,t));return n!==s&&o!==a||!(0!==n||!C(e,i,t))||!(0!==s||!C(e,r,t))||!(0!==o||!C(i,e,r))||!(0!==a||!C(i,t,r))}function C(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function T(e){return e>0?1:e<0?-1:0}function A(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function E(e,t){var i=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function R(e,t,i,r){var n=new M(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(e,t,i,r){for(var n=0,s=t,o=i-r;s<i;s+=r)n+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return n}i.d(t,{e:()=>r}),r.deviation=function(e,t,i,r){var n=t&&t.length,s=n?t[0]*i:e.length,o=Math.abs(L(e,0,s,i));if(n)for(var a=0,l=t.length;a<l;a++){var c=t[a]*i,u=a<l-1?t[a+1]*i:e.length;o-=Math.abs(L(e,c,u,i))}var h=0;for(a=0;a<r.length;a+=3){var d=r[a]*i,p=r[a+1]*i,g=r[a+2]*i;h+=Math.abs((e[d]-e[g])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[g+1]-e[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},r.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var s=0;s<e[n].length;s++)for(var o=0;o<t;o++)i.vertices.push(e[n][s][o]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i}},21287(e,t,i){i.d(t,{M5:()=>h,eV:()=>u});var r=i(11254),n=i(49186),s=i(17676),o=i(84952),a=i(26306);let l=null,c=!0;function u(e,t,i,r){if(!t||!i)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,i)}catch(e){c=!1}const n=function(e,t,i){return i||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),i=l),i.getContext("2d").createImageData(e,t)}(t,i,r);return n.data.set(e,0),n}async function h(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const i=(0,o.r$)(e);if(i?.isBase64)return{arrayBuffer:(0,a.M)(i.data),mediaType:i.mediaType};const n=await(0,r.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}(e,t),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:r}=await i.e(820).then(i.bind(i,10820));if(e(l))return r(l,t)}if(u){const{isAnimatedPNG:e,parseApng:r}=await i.e(2390).then(i.bind(i,22390));if(e(l))return r(l,t)}return async function(e,t){const i=window.URL.createObjectURL(e);try{const{data:e}=await(0,r.A)(i,{...t,responseType:"image"});return e}catch(e){if(!(0,s.zf)(e))throw new n.A("invalid-image",`Could not fetch requested image at ${i}`);throw e}finally{window.URL.revokeObjectURL(i)}}(new Blob([l],{type:c}),t)}},83300(e,t,i){i.r(t),i.d(t,{default:()=>Oe});var r=i(5482),n=i(69540),s=i(92474),o=i(53966),a=i(61893),l=i(17676),c=i(36708),u=i(91429),h=i(51850),d=i(91075),p=i(86738),g=i(39829),f=i(70328),m=i(24770),v=i(16939),x=i(49186);const y="Expected location to be a Point instance";class _ extends x.A{constructor(){super("invalid-input:location",y)}}var b=i(95696),S=i(18251),w=i(73836),C=i(1193),T=i(27615),A=i(35522),E=i(65806);function R(e,t){switch(e.type){case"georeferenced":return t.isGeographic;case"local":return t.isGeographic||t.isWebMercator}}var O=i(22141),M=i(72258);const L=()=>o.A.getLogger("esri.geometry.support.meshUtils.centerAt");const P=(0,h.vt)(),I=(0,h.vt)(),D=(0,h.vt)();var F=i(9093),N=i(5443),z=i(91218),H=i(98764),W=i(48353),V=i(9762),j=i(4197),U=i(73354);const B=(0,F.vt)(),$=(0,j.jh)(24);var Z=i(84952);function k(e){const t=(0,Z.nM)(e.url);return i=>{const r=(0,Z.V1)(i,t,t),n=r?r.replace(/^ *\.\//,""):null;return(n?e.files.get(n):null)??i}}async function G(e,t){switch(e.type){case"client":return Array.isArray(e.files)?function(e){if(!e.length)throw new x.A("mesh-load-external:missing-assets","There must be at least one file to load");return ee(e.map(e=>({name:e.name,mimeType:e.type,source:q(e)})))}(e.files):q(e.files);case"service":return async function(e,t){if(!e.length)throw new x.A("mesh-load-external:missing-assets","There must be at least one file to load");const i=await(0,l.nA)(e.map(async e=>{const i=await async function(e,t){const{parts:i,assetMimeType:r,assetName:n}=e;if(1===i.length)return new te(i[0].partUrl);const s=await e.toBlob(t);return(0,l.Te)(t),te.fromBlob(s,ie(n,r))}(e);return(0,l.Te)(t),{name:e.assetName,mimeType:e.assetMimeType,source:i}}));if((0,l.G4)(t))throw i.forEach(e=>e.source.dispose()),(0,l.NK)();return ee(i)}(e.assets,t);default:throw new x.A("mesh-load-external:invalid-source","Invalid source type")}}function q(e){return te.fromBlob(e,ie(e.name,e.type))}const Y=/^model\/gltf\+json$/,Q=/^model\/gltf-binary$/,X=/\.gltf$/i,K=/\.glb$/i;function J({mimeType:e,source:t,name:i}){return Y.test(e)||X.test(i)?{url:t.url,type:"gltf"}:Q.test(e)||K.test(i)?{url:t.url,type:"glb"}:null}function ee(e){const t=new Map;let i=null,r=null;for(const n of e){const{source:e,name:s}=n;i??=J(n),"ESRI3DO_NORM.glb"===s&&(r=J(n)),t.set(s,e.url),e.files.forEach((e,i)=>t.set(i,e))}const n=r??i;if(null==n)throw new x.A("mesh-load-external:missing-files","Missing files to load external mesh source");return new te(n.url,()=>e.forEach(({source:e})=>e.dispose()),t,n.type)}class te{constructor(e,t=()=>{},i=new Map,r){this.url=e,this.dispose=t,this.files=i,this.type=r}static fromBlob(e,t){const i=URL.createObjectURL(e);return new te(i,()=>URL.revokeObjectURL(i),void 0,t)}}function ie(e,t){return Y.test(t)||X.test(e)?"gltf":Q.test(t)||X.test(e)?"glb":void 0}var re=i(66895),ne=i(29461),se=i(15070),oe=i(77690),ae=i(29242),le=i(58083),ce=i(67026),ue=i(82534);const he=()=>o.A.getLogger("esri.geometry.support.meshUtils.rotate");function de(e,t,i,r=h.uY){if(null!=e){(0,le.$0)(me,(0,m.$I)(t),(0,m.yo)(t));for(let t=0;t<e.length;t+=i){for(let i=0;i<3;i++)pe[i]=e[t+i]-r[i];(0,A.Z0)(pe,pe,me);for(let i=0;i<3;i++)e[t+i]=pe[i]+r[i]}}}const pe=(0,h.vt)(),ge=(0,F.vt)(),fe=(0,m.vt)(),me=(0,F.vt)(),ve=(0,ae.vt)(),xe=(0,h.vt)(),ye=(0,ue.vt)(),_e=()=>o.A.getLogger("esri.geometry.support.meshUtils.scale");function be(e,t,i=h.uY){if(e)for(let r=0;r<e.length;r+=3){for(let t=0;t<3;t++)Se[t]=e[r+t]-i[t];(0,A.hs)(Se,Se,t);for(let t=0;t<3;t++)e[r+t]=Se[t]+i[t]}}const Se=(0,h.vt)(),we=(0,h.vt)(),Ce=(0,F.vt)(),Te=(0,h.vt)();var Ae,Ee=i(65801);const Re={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:b.A,local:S.default}};let Oe=Ae=class extends((0,n.OU)((0,s.WV)((0,a.g)(d.A)))){constructor(e){super(e),this.components=null,this.vertexSpace=new b.A,this.transform=null,this.metadata=new ne.O,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C.default,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles((0,c.wB)(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,i=this;return function(e){const{spatialReference:t,vertexSpace:i,untransformedBounds:r}=e,n=(0,f.gE)(r,$);if((0,T.Hq)(i)&&e.transform&&(0,U.a)(n,n,e.transform.localMatrix),"georeferenced"===i.type){const e=i.origin;return e&&(0,U.t)(n,n,e),(0,f.w1)((0,f.vY)(n),t)}const s=(0,H.lO)(t),o=i.origin;if(!(0,z.canProjectWithoutEngine)(s,t)){const[e,i,r]=o;return new N.A({xmin:e,ymin:i,zmin:r,xmax:e,ymax:i,zmax:r,spatialReference:t})}return(0,W.l)(t,o,B,s),(0,U.a)(n,n,B),(0,V.projectBuffer)(n,s,0,n,t,0),(0,f.w1)((0,f.vY)(n),t)}({get transform(){return i.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?(0,f.vt)(f.v_):(0,f.vY)(e)}get origin(){const e=(0,T.MW)(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:i}=this._transformedExtent;return new p.A({x:t.x,y:t.y,z:i,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(v.default.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}o.A.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}}rotate(e,t,i,r){return(0,m.AU)(e,t,i,Me),function(e,t,i){if(!e.vertexAttributes?.position||0===t[3])return;const{spatialReference:r,vertexSpace:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new p.A({x:o,y:a,z:l,spatialReference:s}),u=pe;if(c.equals(i))(0,A.hZ)(u,0,0,0);else if(!(0,M.p5)(u,i,e))return void(0,O.CN)(he(),i.spatialReference,s,O.JP);(0,ce.x8)(ye,(0,m.yo)(t),(0,m.$I)(t));const d=(0,le.O7)(ge,ye,h.uY,h.Un,u),{localMatrix:g}=n,f=(0,le.lw)(ge,d,g);n.scale=(0,le.X_)((0,h.vt)(),f),(0,le.hs)(f,f,(0,A.DI)(pe,n.scale));const v=n.rotationAxis;n.rotation=(0,m.ui)(f),0===n.rotationAngle&&(n.rotationAxis=v),n.translation=(0,le.sC)((0,h.vt)(),f)}(e,t,s):R(n,r)?function(e,t,i){const r=e.spatialReference,n=(0,H.lO)(r),s=xe;if(!(0,E.g)(i,s,n)&&((0,O.CN)(he(),i.spatialReference,n,"Falling back to mesh origin"),!(0,E.g)(e.origin,s,n)))return void(0,O.CN)(he(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),u=null!=a?new Float32Array(a.length):null,h=null!=l?new Float32Array(l.length):null;(0,W.l)(n,s,me,n),(0,oe.z0)(ve,me);const d=fe;(0,A.ei)((0,m.yo)(fe),(0,m.yo)(t),ve),d[3]=t[3],!(0,O.gr)(o,r,c,n)||null!=a&&null!=u&&!(0,O.X4)(a,o,r,c,n,u)||null!=l&&null!=h&&!(0,O.xA)(l,o,r,c,n,h)?(0,O.CN)(he(),r,n):(de(c,d,3,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=u&&(de(u,d,3),!(0,O.si)(u,o,r,c,n,a))||null!=l&&null!=h&&(de(h,d,4),!(0,O.Mv)(h,o,r,c,n,l))?(0,O.CN)(he(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=xe;if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(he(),i.spatialReference,e.spatialReference,O.JP)}de(e.vertexAttributes.position,t,3,r),de(e.vertexAttributes.normal,t,3),de(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}(e,t,s)}(this,Me,r),this}offset(e,t,i){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:n}=this,s=n?.position;if(!s)return this;if((0,T.Hq)(r)){const[n,s,o]=r.origin;r.origin=(0,h.fA)(n+e,s+t,o+i)}else{for(let r=0;r<s.length;r+=3)s[r]+=e,s[r+1]+=t,s[r+2]+=i;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new p.A({x:o,y:a,z:l,spatialReference:s}),u=Se;if(c.equals(i))(0,A.hZ)(u,0,0,0);else if(!(0,M.p5)(u,i,e))return void(0,O.CN)(_e(),i.spatialReference,s,O.JP);const d=(0,A.hZ)(we,t,t,t),g=(0,le.O7)(Ce,ue.zK,h.uY,d,u),{localMatrix:f}=n,v=(0,le.lw)(Ce,g,f);n.scale=(0,le.X_)((0,h.vt)(),v),(0,le.hs)(v,v,(0,A.DI)(Se,n.scale));const x=n.rotationAxis;n.rotation=(0,m.ui)(v),0===n.rotationAngle&&(n.rotationAxis=x),n.translation=(0,le.sC)((0,h.vt)(),v)}(e,t,s):R(r,n)?function(e,t,i){const r=e.spatialReference,n=(0,H.lO)(r),s=Te;if(!(0,E.g)(i,s,n)&&((0,O.CN)(_e(),i.spatialReference,n,"Falling back to mesh origin"),!(0,E.g)(e.origin,s,n)))return void(0,O.CN)(_e(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),u=null!=a?new Float32Array(a.length):null,h=null!=l?new Float32Array(l.length):null;!(0,O.gr)(o,r,c,n)||null!=a&&null!=u&&!(0,O.X4)(a,o,r,c,n,u)||null!=l&&null!=h&&!(0,O.xA)(l,o,r,c,n,h)?(0,O.CN)(_e(),r,n):(be(c,t,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=u&&!(0,O.si)(u,o,r,c,n,a)||null!=l&&null!=h&&!(0,O.Mv)(h,o,r,c,n,l)?(0,O.CN)(_e(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=Te;if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(_e(),i.spatialReference,e.spatialReference,O.JP)}be(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}(e,t,s)}(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,n=i?.origin??e.origin;(0,T.Hq)(r)?function(e,t,i){const{vertexSpace:r}=e;if(!(0,T.Hq)(r))return;const n=I,s=P;if(!(0,E.g)(t,s,e.spatialReference))return void(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP);if(!(0,E.g)(i,n,e.spatialReference))return void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP);const o=(0,A.Re)(D,s,n);r.origin=(0,A.WQ)((0,h.vt)(),r.origin,o)}(e,t,n):R(r,n.spatialReference)?function(e,t,i){const r=(0,h.fA)(i.x,i.y,i.z??0),n=(0,M.UR)(e,new S.default({origin:r}));if(!n)return;const s=(0,h.fA)(t.x,t.y,t.z??0),o=(0,M.UR)({vertexAttributes:n,spatialReference:e.spatialReference,vertexSpace:new S.default({origin:s})},b.A.absolute);if(!o)return;const{position:a,normal:l,tangent:c}=o;e.vertexAttributes.position=a,e.vertexAttributes.normal=l,e.vertexAttributes.tangent=c,e.vertexAttributesChanged()}(e,t,n):function(e,t,i){const r=I,n=P;if((0,E.g)(t,n,e.spatialReference)){if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP)}(function(e,t,i){if(e)for(let r=0;r<e.length;r+=3)for(let n=0;n<3;n++)e[r+n]+=t[n]-i[n]})(e.vertexAttributes.position,n,r),e.vertexAttributesChanged()}else(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP)}(e,t,n)}(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(async function(e,t,r){switch(t.source.type){case"client":case"service":return async function(e,t,r){const{source:n}=t,{loadGLTFMesh:s}=await(0,l.qr)(i.e(5841).then(i.bind(i,35841)),r),o=await G(n,r);(0,l.Te)(r);const a=s(new p.A({x:0,y:0,z:0,spatialReference:e.spatialReference}),o.url,{resolveFile:k(o),signal:r?.signal,expectedType:o.type,unitConversionDisabled:t.unitConversionDisabled});a.then(()=>o.dispose(),()=>o.dispose());const{mesh:{vertexAttributes:c,components:u},meta:{isDracoDecompressed:h}}=await a;if(h)throw new x.A("mesh-load-external:draco-not-supported","The provided mesh uses Draco compression which is not supported.");e.vertexAttributes=c,e.components=u}(e,t,r);case"loadable":return t.source.load(e,r);default:t.source}}(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(e){return super.clone((0,re.WO)((0,re.QN)(e)))}cloneShallow(){return new Ae({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([i.e(4038).then(i.bind(i,84038)),this.load(e)]);return(0,l.Te)(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce((e,t)=>e+t.memoryUsage,this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(o.A.getLogger(this).error(e,"Mesh must be loaded before applying operations"),!1)}static createBox(e,t){if(!(e instanceof p.A))return o.A.getLogger(this.prototype).error(".createBox()",y),null;const i=new Ae((0,se.UG)((0,se.H8)(),e,t));return t?.imageFace&&"all"!==t.imageFace?(0,se.bQ)(i,t.imageFace):i}static createSphere(e,t){return e instanceof p.A?new Ae((0,se.UG)((0,se.Dk)(t?.densificationFactor||0),e,t)):(o.A.getLogger(this.prototype).error(".createSphere()",y),null)}static createCylinder(e,t){return e instanceof p.A?new Ae((0,se.UG)((0,se.ai)(t?.densificationFactor||0),e,t)):(o.A.getLogger(this.prototype).error(".createCylinder()",y),null)}static createPlane(e,t){if(!(e instanceof p.A))return o.A.getLogger(this.prototype).error(".createPlane()",y),null;const i=t?.facing??"up",r=(0,se.uF)(i,t?.size);return new Ae((0,se.UG)((0,se.Uh)(i),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof g.A))return o.A.getLogger(this.prototype).error(".createFromPolygon()","Expected polygon to be a Polygon instance"),null;const i=(0,Ee.uM)(e,{method:"earcut"}),r=(0,l.$X)(i)?null:i,n=r?.positions??[],s=r?.polygonIndices??[];return new Ae({vertexAttributes:new C.default({position:n}),components:[new v.default({faces:s,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new b.A})}static async createFromGLTF(e,t,r){if(!(e instanceof p.A)){const e=new _;throw o.A.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:n}=await(0,l.qr)(i.e(5841).then(i.bind(i,35841)),r);return new Ae((await n(e,t,r)).mesh)}};(0,r.Cg)([(0,u.MZ)({type:[v.default],json:{write:!0}})],Oe.prototype,"components",void 0),(0,r.Cg)([(0,u.MZ)({nonNullable:!0,types:Re,constructOnly:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexSpace??e.clone(t)})],Oe.prototype,"vertexSpace",void 0),(0,r.Cg)([(0,u.MZ)({type:w.A,clonable:(e,t)=>{const i=(0,re.o2)(t);return i&&"transform"in i?i.transform:e?.clone()??e},json:{write:!0}})],Oe.prototype,"transform",void 0),(0,r.Cg)([(0,u.MZ)({constructOnly:!0,type:ne.O,clonable:(e,t)=>(0,re.o2)(t)?.metadata??e.clone()})],Oe.prototype,"metadata",void 0),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"hasExtent",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"_transformedExtent",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"_untransformedBounds",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"origin",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1}})],Oe.prototype,"extent",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Oe.prototype,"hasZ",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Oe.prototype,"hasM",void 0),(0,r.Cg)([(0,u.MZ)({type:C.default,nonNullable:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexAttributes??e.clone(t)})],Oe.prototype,"vertexAttributes",void 0),Oe=Ae=(0,r.Cg)([(0,u.$K)("esri.geometry.Mesh")],Oe);const Me=(0,m.vt)()},15585(e,t,i){i.d(t,{If:()=>p,O5:()=>v,O9:()=>f,QT:()=>m,l3:()=>g});var r=i(5482),n=i(2741),s=i(49186),o=i(44208),a=i(34727);let l=null,c=null,u=null,h=null;const d=(new Float32Array(0),new Uint32Array(0),new Uint32Array(0),new Uint32Array(0),{vertices:new Float64Array(0),indices:new Uint32Array(0),outlineIndices:new Uint32Array(0),outlineRingLengths:new Uint32Array(0),vertexCount:0,indexCount:0,outlineIndexCount:0,outlineRingCount:0});async function p(){return l??=async function(){const e=await i.e(2997).then(i.bind(i,42997)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});u=t}(),l}async function g(){return c??=async function(){const e=await i.e(9134).then(i.bind(i,99134)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});h=t}(),c}function f(){return null!==h}function m(e,t,i=2){const n={stack:[],error:void 0,hasError:!1};try{const a=u;if(!a)throw new s.A("libtess:not-loaded","libtessF32 not loaded");const l=(0,r.mS)(n,b.from(a,e),!1),c=(0,r.mS)(n,w.from(a,t),!1),h=e.length/i*4,d=(0,r.mS)(n,new b(a,h*i),!1),p=a.triangulate(l.ptr,c.ptr,c.size,i,d.ptr,h);if((0,o.A)("esri-tessellation-debug")){const e=a.getError();0!==e&&console.warn("libtess:triangulation",C(e))}return{buffer:d.slice(0,p*i),vertexCount:p}}catch(e){n.error=e,n.hasError=!0}finally{(0,r.hk)(n)}}function v(e,t,i=2,n=!0){const l={stack:[],error:void 0,hasError:!1};try{const c=h;if(!c)throw new s.A("libtess:not-loaded","libtessF64 not loaded");const u=(0,r.mS)(l,S.from(c,e),!1),p=(0,r.mS)(l,w.from(c,t),!1),g=(0,r.mS)(l,new w(c,1),!1),f=(0,r.mS)(l,new w(c,1),!1),m=(0,r.mS)(l,new w(c,1),!1),v=(0,r.mS)(l,new w(c,1),!1),{maxVertexCount:x,maxIndexCount:y,maxOutlineIndexCount:b,maxOutlineRingCount:T}=function(e,t){const i=e.reduce((e,t)=>e+t,0),r=e.length,n=Math.max(0,e.length-1),s=Math.max(0,i+2*n-2),o=Math.max(0,Math.ceil(2*i)),l=Math.max(0,Math.ceil(3*s*2)),c=(0,a.mP)(l,3),u=i>0?Math.max(2,Math.ceil(.25*i)):0,h=i>0?Math.max(1,Math.ceil(u/3)):0;return{maxVertexCount:o,maxIndexCount:c,maxOutlineIndexCount:t?Math.max(0,i+r+u):0,maxOutlineRingCount:t?Math.max(0,r+h):0}}(t,n);let A=0,E=0,R=0,O=0,M=0;{const e={stack:[],error:void 0,hasError:!1};try{const t=(0,r.mS)(e,new S(c,x*i),!1),s=(0,r.mS)(e,new w(c,y),!1),o=(0,r.mS)(e,n?new w(c,b):null,!1),a=(0,r.mS)(e,n?new w(c,T):null,!1);if(c.triangulateIndexed(u.ptr,p.ptr,p.size,i,t.ptr,x,i,s.ptr,y,g.ptr,f.ptr,o?.ptr??0,b,a?.ptr??0,T,m.ptr,v.ptr),M=c.getError(),A=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],E=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],R=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],O=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],0===M){const e=t.slice(0,A*i);return{vertices:e,indices:s.slice(0,E),outlineIndices:n&&o?o.slice(0,R):d.outlineIndices,outlineRingLengths:n&&a?a.slice(0,O):d.outlineRingLengths,vertexCount:A,indexCount:E,outlineIndexCount:n?R:0,outlineRingCount:n?O:0}}}catch(t){e.error=t,e.hasError=!0}finally{(0,r.hk)(e)}}if(100903!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const L=(0,r.mS)(l,new S(c,A*i),!1),P=(0,r.mS)(l,new w(c,E),!1),I=(0,r.mS)(l,n?new w(c,R):null,!1),D=(0,r.mS)(l,n?new w(c,O):null,!1);if(c.triangulateIndexed(u.ptr,p.ptr,p.size,i,L.ptr,A,i,P.ptr,E,g.ptr,f.ptr,I?.ptr??0,n?R:0,D?.ptr??0,n?O:0,m.ptr,v.ptr),M=c.getError(),0!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const F=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],N=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],z=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],H=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],W=L.slice(0,F*i);return{vertices:W,indices:P.slice(0,N),outlineIndices:n&&I?I.slice(0,z):d.outlineIndices,outlineRingLengths:n&&D?D.slice(0,H):d.outlineRingLengths,vertexCount:F,indexCount:N,outlineIndexCount:n?z:0,outlineRingCount:n?H:0}}catch(e){l.error=e,l.hasError=!0}finally{(0,r.hk)(l)}}function x(e){return e.HEAPF64}function y(e){return e.HEAPF32}function _(e){return e.HEAP32}class b{static from(e,t){const i=new b(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float32Array.BYTES_PER_ELEMENT}set(e){y(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return y(this._libtess).slice(i+e,i+t)}}class S{static from(e,t){const i=new S(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float64Array.BYTES_PER_ELEMENT}set(e){x(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return x(this._libtess).slice(i+e,i+t)}}class w{static from(e,t){const i=new w(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateLengthsArray(t)}destroy(){this._libtess.destroyLengthsArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Int32Array.BYTES_PER_ELEMENT}set(e){_(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return function(e){const t=_(e);return new Uint32Array(t.buffer,t.byteOffset,t.length)}(this._libtess).slice(i+e,i+t)}}function C(e){switch(e){case 100903:return"Insufficient output buffer";case 100902:return"Out of memory";case 100151:return"Missing begin polygon";case 100152:return"Missing begin contour";case 100153:return"Missing end polygon";case 100154:return"Missing end countour";case 100155:return"Coordinates too large";case 100156:return"Missing combine callback";default:return`Unknown: ${e}`}}},16939(e,t,i){i.r(t),i.d(t,{default:()=>p});var r,n=i(5482),s=i(69540),o=i(25482),a=i(53966),l=i(91429),c=i(56507),u=i(19211),h=i(80882),d=i(31199);let p=r=class extends((0,s.OU)(o.o)){static from(e){return(0,c.PZ)(r,e)}constructor(e){super(e),this.material=null,this.name=void 0,this.shading="source",this.trustSourceNormals=!1}get faces(){return this._get("faces")??null}set faces(e){this._set("faces",(0,d.b)(e,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},a.A.getLogger(this)))}castMaterial(e){return(0,c.PZ)(e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?h.A:u.default,e)}get memoryUsage(){let e=0;return null!=this.faces&&(e+=this.faces.byteLength),null!=this.material&&(e+=this.material.memoryUsage),e}};(0,n.Cg)([(0,l.MZ)({json:{write:d.B}})],p.prototype,"faces",null),(0,n.Cg)([(0,l.MZ)({type:u.default,json:{write:!0}})],p.prototype,"material",void 0),(0,n.Cg)([(0,l.wg)("material")],p.prototype,"castMaterial",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],p.prototype,"name",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"shading",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],p.prototype,"trustSourceNormals",void 0),p=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshComponent")],p)},95696(e,t,i){i.d(t,{A:()=>c});var r,n=i(5482),s=i(69540),o=i(25482),a=i(91429),l=i(93223);let c=class extends((0,s.OU)(o.o)){static{r=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new r}};(0,n.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=r=(0,n.Cg)([(0,a.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c)},18251(e,t,i){i.r(t),i.d(t,{default:()=>c});var r=i(5482),n=i(69540),s=i(25482),o=i(91429),a=i(51850),l=i(93223);let c=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.type="local",this.origin=(0,a.vt)()}};(0,r.Cg)([(0,l.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshLocalVertexSpace")],c)},19211(e,t,i){i.r(t),i.d(t,{default:()=>h});var r=i(5482),n=i(68197),s=i(69540),o=i(25482),a=i(91429),l=i(35063),c=i(51147),u=i(66895);let h=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.colorTextureTransform=null,this.normalTextureTransform=void 0,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}get colorTexture(){return this._get("colorTexture")}set colorTexture(e){this._set("colorTexture",null==e?null:l.default.from(e))}get normalTexture(){return this._get("normalTexture")}set normalTexture(e){this._set("normalTexture",null==e?null:l.default.from(e))}clone(e){const t=(0,u.hz)(e),i=t?.materialMap?.get(this);if(i)return i;const r=super.clone((0,u.QN)(e));return t?.materialMap?.set(this,r),r}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let e=0;return e+=null!=this.color?16:0,null!=this.colorTexture&&(e+=this.colorTexture.memoryUsage),e+=null!=this.colorTextureTransform?20:0,null!=this.normalTexture&&(e+=this.normalTexture.memoryUsage),e+=null!=this.normalTextureTransform?20:0,e}};(0,r.Cg)([(0,a.MZ)({type:n.A,json:{write:!0}})],h.prototype,"color",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],h.prototype,"colorTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],h.prototype,"colorTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],h.prototype,"normalTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],h.prototype,"normalTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"alphaMode",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"alphaCutoff",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"doubleSided",void 0),h=(0,r.Cg)([(0,a.$K)("esri.geometry.support.MeshMaterial")],h)},80882(e,t,i){i.d(t,{A:()=>c});var r=i(5482),n=i(68197),s=i(91429),o=i(19211),a=i(35063),l=i(51147);let c=class extends o.default{constructor(e){super(e),this.emissiveColor=null,this.emissiveStrength=null,this.emissiveTextureTransform=void 0,this.occlusionTextureTransform=void 0,this.metallic=1,this.roughness=1,this.metallicRoughnessTextureTransform=void 0}get emissiveTexture(){return this._get("emissiveTexture")}set emissiveTexture(e){this._set("emissiveTexture",null==e?null:a.default.from(e))}get occlusionTexture(){return this._get("occlusionTexture")}set occlusionTexture(e){this._set("occlusionTexture",null==e?null:a.default.from(e))}get metallicRoughnessTexture(){return this._get("metallicRoughnessTexture")}set metallicRoughnessTexture(e){this._set("metallicRoughnessTexture",null==e?null:a.default.from(e))}getMemoryUsage(){let e=super.getMemoryUsage();return e+=null!=this.emissiveColor?16:0,null!=this.emissiveTexture&&(e+=this.emissiveTexture.memoryUsage),e+=null!=this.emissiveTextureTransform?20:0,null!=this.occlusionTexture&&(e+=this.occlusionTexture.memoryUsage),e+=null!=this.occlusionTextureTransform?20:0,null!=this.metallicRoughnessTexture&&(e+=this.metallicRoughnessTexture.memoryUsage),e+=null!=this.metallicRoughnessTextureTransform?20:0,e}};(0,r.Cg)([(0,s.MZ)({type:n.A,json:{write:!0}})],c.prototype,"emissiveColor",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],c.prototype,"emissiveStrength",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"emissiveTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"emissiveTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"occlusionTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"occlusionTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"metallic",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"roughness",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"metallicRoughnessTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"metallicRoughnessTextureTransform",void 0),c=(0,r.Cg)([(0,s.$K)("esri.geometry.support.MeshMaterialMetallicRoughness")],c)},35063(e,t,i){i.r(t),i.d(t,{default:()=>m});var r,n=i(5482),s=i(69540),o=i(21287),a=i(25482),l=i(91429),c=i(56507),u=i(66895),h=i(97159),d=i(43937),p=i(36005);const g=new WeakMap;let f=0,m=class extends((0,s.OU)(a.o)){static{r=this}constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,i,r){if(e instanceof HTMLImageElement){const n={type:"image-element",src:(0,h.t)(e.src,r),crossOrigin:e.crossOrigin};t[i]=n}else if(e instanceof HTMLCanvasElement){const r={type:"canvas-element",imageData:v(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[i]=r}else if(e instanceof HTMLVideoElement){const n={type:"video-element",src:(0,h.t)(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[i]=n}else if(e instanceof ImageData){const r={type:"image-data",imageData:v(e)};t[i]=r}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=x(e.imageData),i=document.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").putImageData(t,0,0),i}case"image-data":return x(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this,i=e=>e?.toLowerCase().endsWith(".png")||e?.toLocaleLowerCase().startsWith("data:image/png;");return e instanceof HTMLCanvasElement?y(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?y(e):!(!t||!i(t))||!!(e instanceof HTMLImageElement&&i(e.src))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e="string"==typeof this.wrap?this.wrap:"object"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(t="")=>`d:${t},t:${this.transparent},w:${e}`;return null!=this.url?t(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(g.has(this.data)||g.set(this.data,++f),t(g.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=null!=this.url?this.url.length:0,null!=this.data){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(e){const t=(0,u.$N)(e),i=t?.textureMap?.get(this);if(i)return i;const r=super.clone(e);return t?.textureMap?.set(this,r),r}static from(e){return"string"==typeof e?new r({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new r({data:e}):(0,c.PZ)(r,e)}};function v(e){let t="";for(let i=0;i<e.data.length;i++)t+=String.fromCharCode(e.data[i]);return{data:btoa(t),width:e.width,height:e.height}}function x(e){const t=atob(e.data),i=new Uint8ClampedArray(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return(0,o.eV)(i,e.width,e.height)}function y(e){for(let t=3;t<e.data.length;t+=4)if(255!==e.data[t])return!0;return!1}(0,n.Cg)([(0,l.MZ)({type:String,json:{write:h.w}})],m.prototype,"url",null),(0,n.Cg)([(0,l.MZ)({clonable:"reference",json:{write:{overridePolicy(){return{enabled:!this.url}}}}})],m.prototype,"data",null),(0,n.Cg)([(0,d.K)("data")],m.prototype,"writeData",null),(0,n.Cg)([(0,p.w)("data")],m.prototype,"readData",null),(0,n.Cg)([(0,l.MZ)({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],m.prototype,"transparent",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],m.prototype,"wrap",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],m.prototype,"contentHash",null),m=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshTexture")],m)},51147(e,t,i){i.d(t,{A:()=>a});var r=i(5482),n=i(69540),s=i(25482),o=i(91429);let a=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.offset=[0,0],this.rotation=0,this.scale=[1,1]}};(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"offset",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],a.prototype,"rotation",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"scale",void 0),a=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshTextureTransform")],a)},1193(e,t,i){i.r(t),i.d(t,{default:()=>h});var r,n=i(5482),s=i(69540),o=i(25482),a=i(4718),l=i(53966),c=i(91429),u=i(31199);let h=r=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(e){return(0,u.b)(e,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},l.A.getLogger(this))}castPosition(e){return e&&e instanceof Float32Array&&l.A.getLogger(this).warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"),(0,u.b)(e,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},l.A.getLogger(this))}castUv(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},l.A.getLogger(this))}castNormal(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},l.A.getLogger(this))}castTangent(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},l.A.getLogger(this))}clonePositional(){const e={position:(0,a.o8)(this.position),normal:(0,a.o8)(this.normal),tangent:(0,a.o8)(this.tangent),uv:this.uv,color:this.color};return new r(e)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"color",void 0),(0,n.Cg)([(0,c.wg)("color")],h.prototype,"castColor",null),(0,n.Cg)([(0,c.MZ)({nonNullable:!0,json:{write:u.B}})],h.prototype,"position",void 0),(0,n.Cg)([(0,c.wg)("position")],h.prototype,"castPosition",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"uv",void 0),(0,n.Cg)([(0,c.wg)("uv")],h.prototype,"castUv",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"normal",void 0),(0,n.Cg)([(0,c.wg)("normal")],h.prototype,"castNormal",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"tangent",void 0),(0,n.Cg)([(0,c.wg)("tangent")],h.prototype,"castTangent",null),h=r=(0,n.Cg)([(0,c.$K)("esri.geometry.support.MeshVertexAttributes")],h)},31199(e,t,i){function r(e,t,i,r){const{loggerTag:n,stride:s}=t;return e.length%s!==0?(r.error(n,`Invalid array length, expected a multiple of ${s}`),new i([])):e}function n(e,t,i,n,s){if(!e)return e;if(e instanceof t)return r(e,n,t,s);for(const o of i)if(e instanceof o)return r(new t(e),n,t,s);if(Array.isArray(e))return r(new t(e),n,t,s);{const r=i.map(e=>`'${e.name}'`);return s.error(`Failed to set property, expected one of ${r}, but got ${e.constructor.name}`),new t([])}}function s(e,t,i){t[i]=function(e){const t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]=e[i];return t}(e)}i.d(t,{B:()=>s,b:()=>n})},40118(e,t,i){i.d(t,{H5:()=>h,wh:()=>c,createWithExternalSource:()=>u});var r=i(49186),n=(i(17676),i(83300)),s=(i(16939),i(95696),i(73836)),o=(i(1193),i(27615));i(53966),i(35522),i(51850),i(66895),i(72258);var a=i(29461),l=i(15070);function c(e,t){return new n.default((0,l.UG)((0,l.Dk)(t?.densificationFactor||0),e,t))}function u(e,t,i){const r=i?.extent??null,{spatialReference:l}=e,c=i?.transform?.clone()??new s.A,u=(0,o.TE)(e,i),h=i?.unitConversionDisabled,d={source:t,extent:r,unitConversionDisabled:h},p=new a.O;return p.externalSources.push(d),new n.default({metadata:p,transform:c,vertexSpace:u,spatialReference:l})}function h(e,t){const{spatialReference:i}=e,a=t?.transform?.clone()??new s.A,l=(0,o.TE)(e,t),c=new n.default({transform:a,vertexSpace:l,spatialReference:i});return c.addResolvingPromise(Promise.reject(new r.A("mesh-incomplete","Mesh resources are not complete"))),c}i(65801)},63579(e,t,i){i.d(t,{Bq:()=>l,Qp:()=>a,WN:()=>m,dK:()=>v,eN:()=>p,fH:()=>f,in:()=>g,yr:()=>c});var r=i(11254),n=i(4576),s=i(17676),o=i(20557);class a{constructor(e,t,i){this.assetName=e,this.assetMimeType=t,this.parts=i}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,n.aI)(this.parts,e.parts,(e,t)=>e.equals(t))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const i=await Promise.all(t.map(t=>t.toBlob(e)));return(0,s.Te)(e),new Blob(i)}}class l{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,r.A)(this.partUrl,{responseType:"blob"});return(0,s.Te)(e),t}}function c(e){return function(e){switch(e?.type){case"client":return Array.isArray(e.files)?e.files.some(d):d(e.files);case"service":return e.assets.some(d);case"loadable":return!0;default:return!1}}(e?.source)}const u=/^(model\/gltf\+json)|(model\/gltf-binary)$/,h=/\.(gltf|glb)/i;function d(e){if(e instanceof File){const{type:t,name:i}=e;return u.test(t)||h.test(i)}return u.test(e.assetMimeType)||h.test(e.assetName)}function p(e,t){if(!e)return!1;const{source:i}=e;return function(e,t){return"service"===e.type&&e.assets.every(e=>e.isOnService(t))}(i,t)}function g(e,t){if(e===t)return!0;const{source:i}=e,{source:r}=t;if(i===r)return!0;if("service"===i.type&&"service"===r.type){if(i.assets.length!==r.assets.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...i.assets].sort(e),n=[...r.assets].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(n[e]))return!1;return!0}return!1}function f(e,t){return e instanceof File?(0,o.rq)(e,t):(0,o.z$)(e.assetMimeType,e.assetName,t)}function m(e){switch(e.type){case"client":return Array.isArray(e.files)?e.files:[e.files];case"service":return e.assets;case"loadable":return}}function v(e){return!!e.original}},29461(e,t,i){i.d(t,{O:()=>c});var r=i(5482),n=i(69540),s=i(7762),o=i(36708),a=i(91429),l=i(63579);let c=class extends n.Pw{constructor(e){super(e),this.externalSources=new s.A,this._explicitDisplaySource=null,this.addHandles((0,o.on)(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(null!=e&&!(0,l.yr)(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!(0,l.in)(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>(0,l.eN)(t,e))}get _implicitDisplaySource(){return this.externalSources.find(l.yr)}};(0,r.Cg)([(0,a.MZ)()],c.prototype,"externalSources",void 0),(0,r.Cg)([(0,a.MZ)()],c.prototype,"displaySource",null),(0,r.Cg)([(0,a.MZ)()],c.prototype,"_implicitDisplaySource",null),(0,r.Cg)([(0,a.MZ)()],c.prototype,"_explicitDisplaySource",void 0),c=(0,r.Cg)([(0,a.$K)("esri.geometry.support.meshUtils.Metadata")],c)},66895(e,t,i){i.d(t,{$N:()=>u,Lz:()=>s,QN:()=>h,WO:()=>l,hz:()=>a,o2:()=>n});const r=Symbol("meshContext");function n(e){return e&&"object"==typeof e&&r in e?e[r]:void 0}function s(e,t){const i=n(e);return{...e,[r]:{...i,...t}}}const o=Symbol("meshMaterialContext");function a(e){return e&&"object"==typeof e&&o in e?e[o]:void 0}function l(e){const t=a(e);if(t?.materialMap)return e;const i={materialMap:new Map};return{...e,[o]:i}}const c=Symbol("meshTextureContext");function u(e){return e&&"object"==typeof e&&c in e?e[c]:void 0}function h(e){const t=u(e);if(t?.textureMap)return e;const i={textureMap:new Map};return{...e,[c]:i}}},15070(e,t,i){i.d(t,{Dk:()=>d,H8:()=>u,UG:()=>v,Uh:()=>f,ai:()=>p,bQ:()=>h,uF:()=>g});var r=i(29242),n=i(35522),s=i(51850),o=i(16939),a=i(1193),l=i(27615),c=i(72258);function u(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:i}=x,r=4*e.length,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let l=0,c=0,u=0,h=0;for(let r=0;r<e.length;r++){const d=e[r],p=l/3;for(const e of t)a[h++]=p+e;const g=d.corners;for(let e=0;e<4;e++){const t=g[e];let r=0;o[u++]=.25*i[e][0]+d.uvOrigin[0],o[u++]=d.uvOrigin[1]-.25*i[e][1];for(let e=0;e<3;e++)0!==d.axis[e]?(n[l++]=.5*d.axis[e],s[c++]=d.axis[e]):(n[l++]=.5*t[r++],s[c++]=0)}}return{position:n,normal:s,uv:o,faces:a}}function h(e,t){const i=e.components[0],r=i.faces,n=y[t],s=6*n,a=new Array(6),l=new Array(r.length-6);let c=0,u=0;for(let e=0;e<r.length;e++)e>=s&&e<s+6?a[c++]=r[e]:l[u++]=r[e];if(null!=e.vertexAttributes.uv){const t=new Float32Array(e.vertexAttributes.uv),i=4*n*2,r=[0,1,1,1,1,0,0,0];for(let e=0;e<r.length;e++)t[i+e]=r[e];e.vertexAttributes.uv=t}return e.components=[new o.default({faces:a,material:i.material}),new o.default({faces:l})],e}function d(e=0){const t=Math.round(8*2**e),i=2*t,r=(t-1)*(i+1)+2*i,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array((t-1)*i*2*3);let l=0,c=0,u=0,h=0;for(let e=0;e<=t;e++){const r=e/t*Math.PI+.5*Math.PI,d=Math.cos(r),p=Math.sin(r);_[2]=p;const g=0===e||e===t,f=g?i-1:i;for(let r=0;r<=f;r++){const p=r/f*2*Math.PI;_[0]=-Math.sin(p)*d,_[1]=Math.cos(p)*d;for(let e=0;e<3;e++)n[l]=.5*_[e],s[l]=_[e],++l;o[c++]=(r+(g?.5:0))/i,o[c++]=e/t,0!==e&&r!==i&&(e!==t&&(a[u++]=h,a[u++]=h+1,a[u++]=h-i),1!==e&&(a[u++]=h,a[u++]=h-i,a[u++]=h-i-1)),h++}}return{position:n,normal:s,uv:o,faces:a}}function p(e=0){const t=Math.round(16*2**e),i=4*(t+1)+2*t,r=new Float64Array(3*i),n=new Float32Array(3*i),s=new Float32Array(2*i),o=new Uint32Array(4*t*3);let a=0,l=0,c=0,u=0,h=0;for(let e=0;e<=5;e++){const i=0===e||5===e,d=e<=1||e>=4,p=2===e||4===e,g=i?t-1:t;for(let f=0;f<=g;f++){const m=f/g*2*Math.PI,v=i?0:.5;_[0]=v*Math.sin(m),_[1]=v*-Math.cos(m),_[2]=e<=2?.5:-.5;for(let t=0;t<3;t++)r[a++]=_[t],n[l++]=d?2===t?e<=1?1:-1:0:2===t?0:_[t]/v;s[c++]=(f+(i?.5:0))/t,s[c++]=e<=1?1*e/3:e<=3?1*(e-2)/3+1/3:1*(e-4)/3+2/3,p||0===e||f===t||(5!==e&&(o[u++]=h,o[u++]=h+1,o[u++]=h-t),1!==e&&(o[u++]=h,o[u++]=h-t,o[u++]=h-t-1)),h++}}return{position:r,normal:n,uv:s,faces:o}}function g(e,t){const i="number"==typeof t?t:null!=t?t.width:1,r="number"==typeof t?t:null!=t?t.height:1;switch(e){case"up":case"down":return{width:i,depth:r};case"north":case"south":return{width:i,height:r};case"east":case"west":return{depth:i,height:r}}}function f(e){const t=m.facingAxisOrderSwap[e],i=m.position,r=m.normal,n=new Float64Array(i.length),s=new Float32Array(r.length);let o=0;for(let e=0;e<4;e++){const e=o;for(let a=0;a<3;a++){const l=t[a],c=Math.abs(l)-1,u=l>=0?1:-1;n[o]=i[e+c]*u,s[o]=r[e+c]*u,o++}}return{position:n,normal:s,uv:new Float32Array(m.uv),faces:new Uint32Array(m.faces),isPlane:!0}}const m={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]}};function v(e,t,i){e.isPlane||function(e){for(let t=0;t<e.position.length;t+=3)e.position[t+2]+=.5}(e),function(e,t){if(null!=t){b[0]=t[0],b[4]=t[1],b[8]=t[2];for(let t=0;t<e.position.length;t+=3){for(let i=0;i<3;i++)_[i]=e.position[t+i];(0,n.ei)(_,_,b);for(let i=0;i<3;i++)e.position[t+i]=_[i]}if(t[0]!==t[1]||t[1]!==t[2]){b[0]=1/t[0],b[4]=1/t[1],b[8]=1/t[2];for(let t=0;t<e.normal.length;t+=3){for(let i=0;i<3;i++)_[i]=e.normal[t+i];(0,n.ei)(_,_,b),(0,n.S8)(_,_);for(let i=0;i<3;i++)e.normal[t+i]=_[i]}}}}(e,function(e,t,i){const r=(0,c.xK)(t,i);if(null==e&&1===r)return null;if(null==e)return[r,r,r];if("number"==typeof e){const t=e*r;return[t,t,t]}return[null!=e.width?e.width*r:r,null!=e.depth?e.depth*r:r,null!=e.height?e.height*r:r]}(i?.size,i?.unit,t.spatialReference));const r=(0,l.TE)(t,i),s=t.spatialReference.isGeographic?(0,l.TE)(t):r,u=(0,c.UR)({vertexAttributes:e,vertexSpace:s,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new a.default({...u,uv:e.uv}),vertexSpace:r,components:[new o.default({faces:e.faces,material:i?.material||null})],spatialReference:t.spatialReference}}const x={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},y={south:0,east:1,north:2,west:3,up:4,down:5},_=(0,s.vt)(),b=(0,r.vt)()},22141(e,t,i){i.d(t,{$5:()=>w,CN:()=>y,JP:()=>x,KM:()=>T,Mv:()=>E,X4:()=>_,gr:()=>S,qs:()=>C,si:()=>b,xA:()=>A});var r=i(34727),n=i(77690),s=i(29242),o=i(58083),a=i(9093),l=i(35522),c=i(51850),u=i(73941),h=i(48353),d=i(9762),p=(i(79258),i(21325)),g=i(28735),f=i(13030),m=i(73354),v=i(50867);const x="Projection may be possible after calling projection.load().";function y(e,t,i,r){e.error(`Failed to project from (wkid:${t.wkid}) to (wkid:${i.wkid}).${r?" ":""}${r}`)}function _(e,t,i,r,n,s){return O(0,f.xs.fromTypedArray(e),0,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s))?s:null}function b(e,t,i,r,n,s){return O(1,f.xs.fromTypedArray(e),0,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s))?s:null}function S(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function w(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function C(e,t,i){return(0,n.Ge)(I,i),(0,m.b)(t,e,I),(0,r.or)(I)&&(0,m.n)(t,t),t}function T(e,t,i){return(0,n.z0)(I,i),(0,v.t)(t,e,I),(0,r.or)(I)&&(0,m.n)(t,t,4),t}function A(e,t,i,r,n,s){if(!O(0,f.xs.fromTypedArray(e,4*Float32Array.BYTES_PER_ELEMENT),1,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function E(e,t,i,r,n,s){if(!O(1,f.xs.fromTypedArray(e,16),1,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s,16)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function R(e,t,i,r,s){switch((0,h.l)(r,i,P,r),1===e&&(0,o.B8)(P,P),t){case 0:return(0,n.Ge)(s,P);case 1:return(0,n.z0)(s,P)}}function O(e,t,i,r,n,s,o,a){if(!t)return;const c=r.count;if(function(e){return e.isWGS84||(0,p.x1)(e)||(0,u.q8)(e)||(0,u.KQ)(e)}(n))for(let r=0;r<c;r++)s.getVec(r,M),t.getVec(r,L),(0,l.ei)(L,L,R(e,i,M,o,I)),a.setVec(r,L);else for(let n=0;n<c;n++){s.getVec(n,M),t.getVec(n,L);const c=(0,g.jg)(r.get(n,1));let u=Math.cos(c);1===i!=(0===e)&&(u=1/u),R(e,i,M,o,I),0===e?(I[0]*=u,I[1]*=u,I[2]*=u,I[3]*=u,I[4]*=u,I[5]*=u):(I[0]*=u,I[3]*=u,I[6]*=u,I[1]*=u,I[4]*=u,I[7]*=u),(0,l.ei)(L,L,I),(0,l.S8)(L,L),a.setVec(n,L)}return a}const M=(0,c.vt)(),L=(0,c.vt)(),P=(0,a.vt)(),I=(0,s.vt)()},72258(e,t,i){i.d(t,{UR:()=>b,p5:()=>_,xK:()=>E});var r=i(53966),n=i(34727),s=i(86211),o=i(77690),a=i(29242),l=i(58083),c=i(9093),u=i(35522),h=i(51850),d=i(73941),p=i(98764),g=i(48353),f=i(65806),m=i(27615),v=i(73354),x=i(22141);const y=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function _(e,t,{vertexSpace:i,spatialReference:r}){if("georeferenced"===i.type){const n=e;if(!(0,f.g)(t,n,r))return!1;const{origin:s}=i;return(0,u.Re)(e,n,s),!0}const n=(0,p.lO)(r),s=e;if(!(0,f.g)(t,s,n))return!1;const{origin:o}=i,a=P;if(!(0,g.l)(r,o,a,n))return!1;const c=(0,l.B8)(P,a);return null!=c&&((0,u.Z0)(e,s,c),!0)}function b(e,t,i){const{vertexSpace:r,transform:n,vertexAttributes:s}=e,a=(0,m.Hq)(r)?n:null,h=T(e.spatialReference,i,3);if((0,m.yJ)(r,t)&&(!a||(0,l.t2)(a.localMatrix,c.zK))&&A(h)){const{position:e,normal:t,tangent:r}=s,n=i?.allowBufferReuse;return{position:n?e:e.slice(),normal:n?t:t?.slice(),tangent:n?r:r?.slice()}}switch(e.vertexSpace.type){case"local":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const o=S(t,s);if(!(0,g.l)(t,r,R,o))return(0,x.CN)(y(),t,o),null;if(i&&(0,l.lw)(R,R,i.localMatrix),!(0,g.l)(t,n,O,o))return(0,x.CN)(y(),o,t),null;(0,l.B8)(O,O);const a=(0,l.lw)(R,O,R);return C(a,t,s,3),w(e,a)}(e,e.vertexSpace,t.origin,i):function({spatialReference:e,vertexAttributes:t,transform:i},{origin:r},n,s){const o=S(e,s);if(!(0,g.l)(e,r,R,o))return(0,x.CN)(y(),e,o),null;i&&(0,l.lw)(R,R,i.localMatrix),C(R,e,s,1);const a=new Float64Array(t.position.length),c=function(e,t,i,r,n){(0,v.a)(r,e,t);const s=new Float64Array(e.length);return(0,x.$5)(r,n,s,i)?s:((0,x.CN)(y(),n,i),null)}(t.position,R,e,a,o);if(!c)return null;const h=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,x.qs)(n,o,s),(0,x.si)(o,e,t,i,r,o)?o:((0,x.CN)(y(),r,t),null)}(c,e,a,o,t.normal,R);if(t.normal&&!h)return null;const d=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,x.KM)(n,o,s),(0,x.Mv)(o,e,t,i,r,o)?o:((0,x.CN)(y(),r,t),null)}(c,e,a,o,t.tangent,R);if(t.tangent&&!d)return null;if(n){const e=(0,u.ze)(L,n);(0,v.t)(c,c,e)}return{position:c,normal:h,tangent:d}}(e,e.vertexSpace,t.origin,i);case"georeferenced":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const a=S(t,s);if(!(0,g.l)(t,n,R,a))return(0,x.CN)(y(),t,a),null;const c=1/T(t,s,2);(0,l.hs)(R,R,[c,c,c]);const u=(0,l.B8)(O,R),{position:h,normal:d,tangent:p}=function(e,t,i){if(!t)return e;if(!i){const{position:i,normal:r,tangent:n}=e;return{position:(0,v.t)(new Float64Array(i.length),i,t),tangent:n,normal:r}}const r=w(e,i.localMatrix);return(0,v.t)(r.position,r.position,t),r}(e,r,i),f=new Float64Array(h.length),m=function(e,t,i,r,n){const s=(0,x.gr)(e,t,r,n);if(!s)return(0,x.CN)(y(),t,n),null;const o=new Float64Array(s.length);return(0,v.a)(o,s,i),o}(h,t,u,f,a);if(!m)return null;const _=(0,o.Ge)(M,u),b=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,x.X4)(e,t,i,r,n,a)?((0,v.b)(a,a,s),a):((0,x.CN)(y(),i,n),null)}(d,h,t,f,a,_,d!==e.normal?d:void 0);if(!b&&d)return null;const C=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,x.xA)(e,t,i,r,n,a)?((0,v.b)(a,a,s,4),a):((0,x.CN)(y(),i,n),null)}(p,h,t,f,a,_,p!==e.tangent?p:void 0);return!C&&p?null:{position:m,normal:b,tangent:C}}(e,e.vertexSpace,t.origin,i):function({vertexAttributes:e,transform:t,spatialReference:i},{origin:r},n,s){const o=T(i,s,3),a=r||!A(o)?(0,l.C)(R,t?.localMatrix??c.zK):null;a&&C(a,i,s,3);const{position:h,normal:d,tangent:p}=a?w(e,a):e,g=s?.allowBufferReuse,f=g?h:new Float64Array(h.length);let m=h;if(r&&(m=(0,v.t)(f,m,r)),n){const e=(0,u.ze)(L,n);m=(0,v.t)(f,m,e)}return{position:m!==e.position||g?m:m.slice(),normal:d!==e.normal||g?d:d?.slice(),tangent:p!==e.tangent||g?p:p?.slice()}}(e,e.vertexSpace,t.origin,i)}}function S(e,t){return t?.useEllipsoid&&(0,d.B3)(e)?p.Y0:(0,p.lO)(e)}function w(e,t){const i=new Float64Array(e.position.length);(0,v.a)(i,e.position,t);const r=e.normal?new Float32Array(e.normal.length):null,n=e.tangent?new Float32Array(e.tangent.length):null;return r&&e.normal&&(0,x.qs)(e.normal,r,t),n&&e.tangent&&(0,x.KM)(e.tangent,n,t),{position:i,normal:r,tangent:n}}function C(e,t,i,r){const n=T(t,i,r);A(n)||(0,l.hs)(e,e,[n,n,n])}function T(e,t,i){const r=!!(1&i),n=!!(2&i),s=t?.sourceUnit,o=t?.targetUnit;if(!s&&!o)return 1;let a=E(s,e);r||!s||A(a)||(y().warn("source unit conversion not supported"),a=1);let l=1/E(o,e);return n||!o||A(l)||(y().warn("target unit conversion not supported"),l=1),a*l}function A(e){return(0,n.Io)(e,1)}function E(e,t){if(null==e)return 1;const i=(0,s.KX)(t);return 1/(0,s.oU)(i,"meters",e)}const R=(0,c.vt)(),O=(0,c.vt)(),M=(0,a.vt)(),L=(0,h.vt)(),P=(0,c.vt)()},27615(e,t,i){i.d(t,{CK:()=>l,Hq:()=>a,MW:()=>c,TE:()=>u,yJ:()=>h});var r=i(35522),n=i(86738),s=i(95696),o=i(18251);function a(e){return null!=e.origin}function l(e){return a(e.vertexSpace)}function c(e,t){if(!a(e))return null;const[i,r,s]=e.origin;return new n.A({x:i,y:r,z:s,spatialReference:t})}function u(e,t){const{x:i,y:r,z:n,spatialReference:a}=e,l=[i,r,n??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(a))?new o.default({origin:l}):new s.A({origin:l})}function h(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,r.t2)(e.origin,t.origin))}},65801(e,t,i){i.d(t,{uM:()=>Wr});var r=i(17676),n=i(9762),s=i(4197),o=i(58083),a=i(9093),l=i(51850);i(48353),(0,a.vt)(),new class{constructor(){this.verticalDistanceToGround=0,this.sampledElevation=0,this.z=0}},(0,l.vt)();var c=i(44208),u=i(53966),h=i(62788),d=i(95488),p=i(83349),g=i(15585),f=i(95108),m=i(97146),v=i(34727),x=i(86211),y=i(35522),_=i(27921);const b=(0,_.vt)();function S(e,t,i){if(!t)return 2;const r=e.map(e=>{const r=P(e,t);return r<3?2:function(e,t,i){const r=function(e,t,i,r){const n=(e=>!Array.isArray(e[0]))(t)?(e,i)=>t[3*e+i]:(e,i)=>t[e][i],s=(0,x.GA)(r)/(0,x.G9)(r);return(0,_.lU)(e,(e,t)=>(0,y.hZ)(e,n(t,0)*s,n(t,1)*s,n(t,2)),i)}(b,e,t,i)?(0,_.Qj)(b):[0,0,1];return Math.abs(r[2])>Math.cos((0,v.kU)(80))?2:Math.abs(r[1])>Math.abs(r[0])?1:0}(e,r,i)}),n=r[0];return r.every(e=>e===n)?n:2}function w(e,t,i){if(!t)return!(0,f.$3)(e);if(e.length<3)return!1;switch(i){case 0:return!(0,f.$3)(e,1,2);case 1:return!(0,f.$3)(e,0,2);case 2:return!(0,f.$3)(e,0,1)}}const C=new d.I;function T(e,t,i){const r=M(e.positions,t),n=t.holeIndices.map(e=>e-t.index),s=n.length>0?n:null,o=(0,m.uW)((0,p.e)(r,s,3)),a=p.e.deviation(r,n,3,o),l=i?function(e){const t=new Array(e.pathLengths.length);let i=0;for(let r=0;r<e.pathLengths.length;r++){const n=e.pathLengths[r];t[r]={index:i,count:n},i+=n}return t}(t):void 0,c=null!=l?O(l,r):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,method:"earcut",polygon:t,positions:r,indices:o,outlineIndexBuffer:c.outlineIndexBuffer,outlineRingLengths:c.outlineRingLengths,vertexCount:t.count,deviation:a}}function A(e,t,i){if(!(0,g.O9)())return I("libtess-not-loaded");const r=M(e.positions,t),n=t.pathLengths,s=(0,g.O5)(r,n,3,i);return s.vertices.length%3!=0?I("positions-not-multiple-of-3"):{succeeded:!0,method:"libtess",polygon:t,positions:s.vertices,indices:s.indices,outlineIndexBuffer:s.outlineIndices,outlineRingLengths:s.outlineRingLengths,vertexCount:s.vertices.length/3}}function E(e,t,i,r,n){if(null==t)return{positions:i,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};const o=r??(0,m.my)(0),a=n??(0,m.my)(0),l=e.polygonVertexCount,c=t.filter(e=>e.index>=l);if(0===c.length)return{positions:i,outlineIndexBuffer:o,mergedOutlineRingLengths:a};const u=3*l,h=(0,s.l5)(e.positions,u,e.positions.length-u),d=(0,s.yH)(i,h),p=i.length/3,g=c.map(e=>({index:p+e.index-l,count:e.count})),{outlineIndexBuffer:f,outlineRingLengths:v}=O(g,d);return{positions:d,outlineIndexBuffer:(0,m.lC)(o,f,d.length/3),mergedOutlineRingLengths:(0,m.lC)(a,v,a.length+v.length)}}function R(e,t,i){for(let r=0;r<e.length;r+=3){const n=e[r+t];e[r+t]=e[r+i],e[r+i]=n}}function O(e,t){const i=(0,m.my)(e.length);let r=0;for(let n=0;n<e.length;n++){const s=e[n],o=s.count;if(o<=0){i[n]=0;continue}const a=3*s.index,l=3*(s.index+o-1),c=o>1&&t[a]===t[l]&&t[a+1]===t[l+1]&&t[a+2]===t[l+2]?o-1:o,u=c>0?c+1:0;i[n]=u,r+=u}const n=(0,m.my)(r,t.length/3);let s=0;for(let t=0;t<e.length;t++){const r=i[t];if(0===r)continue;const o=e[t].index,a=r-1;for(let e=0;e<a;e++)n[s++]=o+e;n[s++]=o}return{outlineIndexBuffer:n,outlineRingLengths:i}}function M(e,{index:t,count:i}){return(0,s.l5)(e,3*t,3*i)}function L(e,t,i,r,n,s){let o=s?e.length-1:0;const a=s?-1:1;i*=3;for(let s=0;s<r;++s){const r=e[o];t[i++]=r[0],t[i++]=r[1],t[i++]=n&&null!=r[2]?r[2]:0,o+=a}return i/3}function P(e,t){return function(e,t){const i=e.length;if(i<2)return!1;const r=e[0],n=e[i-1];return r[0]===n[0]&&r[1]===n[1]&&(!t||r[2]===n[2])}(e,t)?e.length-1:e.length}function I(e){return{succeeded:!1,message:e}}var D=i(5482),F=i(4576),N=i(65529),z=i(91869),H=i(97768),W=i(15142),V=i(36708),j=i(3483),U=i(91429),B=i(26857),$=i(78955),Z=i(19419);class k{constructor(e,t){this.vec3=e,this.id=t}}function G(e,t,i,r){return new k((0,l.fA)(e,t,i),r)}class q{constructor(){this._extent=(0,Z.vt)(),this.resolution=0,this.renderLocalOrigin=G(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new Y}get extent(){return this._extent}setExtent(e){(0,$.C)(this._extent,e)}setupGeometryViews(e){if(this._setupGeometryView(),!e)return;const t=.001*e.range;if(this._extent[0]-t<=e.min){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,Z.cY)(this._extent,e.range,0,t)}if(this._extent[2]+t>=e.max){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,Z.cY)(this._extent,-e.range,0,t)}}_setupGeometryView(){this.canvasGeometries.numViews=1,(0,Z.C)(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}}class Y{constructor(){this.extents=[(0,Z.vt)(),(0,Z.vt)(),(0,Z.vt)()],this.numViews=0}}class Q{constructor(e,t,i){this._fbos=e,this._format=t,this._name=i}get valid(){return null!=this._handle?.getTexture()}dispose(){this._handle=(0,H.Gz)(this._handle)}get texture(){return this._handle?.getTexture()}ensureFramebuffer(e,t){this._handle&&this._handle.fbo?.width===e&&this._handle.fbo?.height===t||(this._handle?.release(),this._handle=this._fbos.acquire(e,t,this._name,this._format))}bind(e){e.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.getTexture()?.descriptor?.hasMipmap&&this._handle?.getTexture()?.generateMipmap()}}var X=i(16943);class K{constructor(e,t,i,r,n=1,s=6){this.output=i,this.content=r,this.redrawOnRequest=n,this.fbo=new Q(e,s,t)}handleRenderRequest(e){return 1===e||e===this.redrawOnRequest}get valid(){return this.fbo.valid}}class J{constructor(e){const t=[new K(e,"overlay color",0,0),new K(e,"overlay IM color",0,1),new K(e,"overlay highlight",10,2,1,3),new K(e,"overlay water",4,3,0),new K(e,"overlay occluded",0,4)];(0,X.E)()&&t.push(new K(e,"overlay olid",11,5,1,5)),this.targets=t}getTexture(e){return this.targets[e]?.fbo.texture}dispose(e){if(0!==e)for(const e of this.targets)e.fbo.dispose();else this.targets[3].fbo.dispose()}computeValidity(){return this.targets.reduce((e,t,i)=>t.valid?e|=1<<i:e,0)}}var ee=i(91712),te=i(69622);class ie extends te.A{precompile(e){return!!this.acquireTechniques(e)}get usedMemory(){return 0}get renderOccludedFlags(){return 1}get testsTransparentRenderOrder(){return 0}get isDecoration(){return!1}get readyToRun(){return!1}get numGeometries(){return 0}get hasOccludees(){return!1}get emissions(){return 0}forEachGeometry(e){}}class re extends ie{}var ne=i(37585),se=i(2016),oe=i(78607),ae=i(13840),le=i(98958),ce=i(72091),ue=i(41976),he=i(90644);let de=class extends le.w{constructor(e,t){super(e,t,ue.wR),this.shader=new ae.r(ce.H,()=>i.e(785).then(i.bind(i,13166)))}initializePipeline(){return(0,he.Ey)({blending:he.T8,colorWrite:he.kn})}};de=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightApplyTechnique")],de);var pe=i(28476);let ge=class extends le.w{constructor(e,t){super(e,t,ue.wR),this.shader=new ae.r(pe.a,()=>i.e(6027).then(i.bind(i,76027)))}initializePipeline(){return(0,he.Ey)({colorWrite:he.kn})}};ge=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightBlurTechnique")],ge);var fe=i(34053);let me=class extends le.w{constructor(){super(...arguments),this.shader=new ae.r(fe.a,()=>i.e(9438).then(i.bind(i,29438)))}initializePipeline(){return(0,he.Ey)({colorWrite:he.kn})}};me=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightDownsampleTechnique")],me);var ve=i(68197);new ve.A("cyan"),new ve.A("black"),new ve.A("yellow");var xe=i(65786);class ye extends xe.Y{constructor(){super(...arguments),this.occludedFactor=.25,this.verticalCellCount=0,this.horizontalCellCount=0,this.highlightLevel=0,this.pixelRatio=1}}var _e=i(16824);let be=class extends le.w{constructor(e,t){super(e,t,ue.wR),this.shader=new ae.r(_e.H,()=>i.e(1011).then(i.bind(i,51011)))}initializePipeline(){return(0,he.Ey)({colorWrite:he.kn})}};be=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightToSingleTechnique")],be);var Se=i(79785);class we extends Se.Z{}var Ce=i(48852),Te=i(63907),Ae=i(21231),Ee=i(67171),Re=i(66289);let Oe=class extends oe.A{constructor(){super(...arguments),this.produces=se.OG.HIGHLIGHT_COLOR,this.consumes={required:[se.OG.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new fe.H,this._passParameters=new ye,this._highlightBlurDrawParameters=new pe.H,this._grid=new Me}initialize(){this.addHandles([(0,V.wB)(()=>this._updateOptionsTexture(),()=>{},V.Vh)])}destroy(){this._grid.coverage=(0,H.Gz)(this._grid.coverage),this._grid.vao=(0,H.WD)(this._grid.vao),this._passParameters.highlightOptionsTexture=(0,H.Gz)(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new Ee.R(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new Ae.A(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(function(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,n=4*i+64;++i;const{color:s}=r,o=r.haloColor??s;t[e+0]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=r.fillOpacity*s.a*255,t[n+0]=o.r,t[n+1]=o.g,t[n+2]=o.b,t[n+3]=r.haloOpacity*o.a*255}return t}(this.view.state.highlights)),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===se.OG.HIGHLIGHT_COLOR),{techniques:i,bindParameters:r,fboCache:n,_passParameters:s,renderingContext:o}=this;if(!r.decorations)return t;const a=i.getCompiled(me),l=i.getCompiled(be),c=i.getCompiled(ge),u=i.getCompiled(de);if(!(a&&u&&c&&l))return this.requestRender(1),t;const h=e.find(({name:e})=>"highlights"===e).getTexture();s.highlightTexture=h;const d=this._prepareAndDownSample(h),{width:p,height:g}=h.descriptor;s.highlightTexture=h;const{camera:f}=r,{fullWidth:m,fullHeight:v,pixelRatio:x,fullViewport:y}=f,_=Math.ceil(m/x),b=Math.ceil(v/x),{_highlightBlurDrawParameters:S}=this,w=this.view.stage.renderView.renderer,{highlights:C}=r;for(let e=0;e<C.length;++e){const{name:i}=C[e];if(!w.hasHighlight(i))continue;s.highlightLevel=e,o.setClearColor(0,0,0,0);const a=n.acquire(p,g,"single highlight",2);o.bindFramebuffer(a.fbo),o.setViewport(0,0,p,g),o.clear(16384),o.bindTechnique(l,r,s),this._renderGrid(d),S.blurInput=a.getTexture(),(0,ne.hZ)(S.blurSize,1/_,0);const h=n.acquire(_,b,"single highlight blur",2);o.unbindTexture(h.fbo?.colorTexture),o.bindFramebuffer(h.fbo),o.setViewport(0,0,_,b),o.clear(16384),o.bindTechnique(c,r,s,S),this._renderGrid(d),a.release(),(0,ne.hZ)(S.blurSize,0,1/b),s.highlightBlurTexture=h.getTexture(),o.bindFramebuffer(t.fbo),o.setDrawBuffers([Te.r6]),o.setViewport4fv(y),o.bindTechnique(u,r,s,S),this._renderGrid(d),h.release()}return s.coverageTexture=s.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(me),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:n}=i,s=this._passParameters;return s.horizontalCellCount=r,s.verticalCellCount=n,s.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(Te.WR.TRIANGLES,6,Te.pe.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/fe.g),t.verticalCellCount=Math.ceil(r/fe.g),t.vao)return;const n=this.renderingContext,s=Ce.g.createIndex(n,35044,Pe);t.vao=new we(n,new Re.R(n,ue.wR),s)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,n=t.descriptor,s=Math.ceil(n.width/fe.g),o=Math.ceil(n.height/fe.g);this._downsampleDrawParameters.input=t;const{highlights:a}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(s,o,"highlight coverage",a.length>Ie?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,s,o),i.screen.draw(),r}get test(){}};(0,D.Cg)([(0,U.MZ)()],Oe.prototype,"produces",void 0),(0,D.Cg)([(0,U.MZ)()],Oe.prototype,"consumes",void 0),Oe=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.effects.highlight.Highlight")],Oe);class Me{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}let Le=0;const Pe=new Uint8Array([0,1,2,2,1,3]),Ie=4;class De{constructor(e,t,i){this.material=e,this.techniques=t,this.textures=i}}var Fe=i(620);class Ne{constructor(e,t,i,r){this._textures=e,this._techniques=t,this.materialChanged=i,this.requestRender=r,this._id2glMaterialRef=new Map}dispose(){this._textures.destroy()}acquire(e,t,i){this._ownMaterial(e);const r=e.produces.get(t);if(!r?.(i))return null;let n=this._id2glMaterialRef.get(e.id);if(null==n){const t=e.createGLMaterial(new De(e,this._techniques,this._textures));n=new ze(t),this._id2glMaterialRef.set(e.id,n)}return n.ref(),n.glMaterial}release(e){const t=this._id2glMaterialRef.get(e.id);null!=t&&(t.unref(),t.referenced||((0,H.WD)(t.glMaterial),this._id2glMaterialRef.delete(e.id)))}_ownMaterial(e){e.repository&&e.repository!==this&&u.A.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),e.repository=this}}class ze{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,(0,Fe.vA)(this._refCnt>=0)}get referenced(){return this._refCnt>0}}var He=i(24326),We=i(91829),Ve=i(46610),je=i(16613),Ue=i(94008),Be=i(32728),$e=i(17478);function Ze(e,t){return null==e&&(e=[]),e.push(t),e}function ke(e,t){if(null==e)return null;const i=e.filter(e=>e!==t);return 0===i.length?null:i}i(28449),(0,l.vt)(),new Float32Array(6);class Ge{constructor(e={}){this.id=(0,He.c)(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=e.castShadow??!0,this.usesVerticalDistanceToGround=e.usesVerticalDistanceToGround??!1,this.graphicUid=e.graphicUid,this.layerViewUid=e.layerViewUid,e.isElevationSource&&(this.lastValidElevationBB=new qe),this._geometries=e.geometries?Array.from(e.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(e){(0,Fe.vA)(null==this._layer||null==e,"Object3D can only be added to a single Layer"),this._layer=e}addGeometry(e){e.visible=this._visible,this._geometries.push(e);for(const t of this._highlightIds)e.addHighlight(t);this._emit("geometryAdded",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(e){const t=this._geometries.splice(e,1)[0];if(t){for(const e of this._highlightIds)t.removeHighlight(e);this._emit("geometryRemoved",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(e,t,i=!1){this._emit("attributesChanged",{object:this,geometry:e,attribute:t,sync:i}),function(e){return"position"===e}(t)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(const e of this._geometries)e.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const e=new $e.p;for(const t of this._geometries)t.occludees=Ze(t.occludees,e);return this._emit("occlusionChanged",this),e}removeOcclude(e){for(const t of this._geometries)t.occludees=ke(t.occludees,e);this._emit("occlusionChanged",this)}highlight(e){const t=new $e.h(e);for(const e of this._geometries)e.addHighlight(t);return this._emit("highlightChanged",this),this._highlightIds.add(t),t}removeHighlight(e){this._highlightIds.delete(e);for(const t of this._geometries)t.removeHighlight(e);this._emit("highlightChanged",this)}removeStateID(e){0===e.channel?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,t){return(0,o.lw)(t,this.transformation,e.transformation)}getCombinedShaderTransformation(e,t=(0,a.vt)()){return(0,o.lw)(t,this.effectiveTransformation,e.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new Ye,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new Ye,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(e,t){const i=1===t;for(const t of this._geometries){const r=t.boundingInfo;r&&Qe(r,e,i?t.transformation:this.getCombinedShaderTransformation(t))}(0,y.Cc)(e.bounds.center,e.min,e.max,.5);for(const t of this._geometries){const r=t.boundingInfo;if(null==r)continue;const n=i?t.transformation:this.getCombinedShaderTransformation(t),s=(0,Be.hG)(n);(0,y.Z0)(et,r.center,n);const o=(0,y.Io)(et,e.bounds.center),a=r.radius*s;e.bounds.radius=Math.max(e.bounds.radius,o+a)}}_invalidateBoundingVolume(){const e=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&e&&this.layer.notifyObjectBBChanged(this,e)}_emit(e,t){this.layer?.events.emit(e,t)}get geometries(){return this._geometries}get transformation(){return this._transformation??a.zK}set transformation(e){this._transformation=(0,o.C)(this._transformation??(0,a.vt)(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?(0,o.C)(this._shaderTransformation??(0,a.vt)(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class qe{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return(0,l.fA)(this._data[0],this._data[1],this._data[2])}get max(){return(0,l.fA)(this._data[3],this._data[4],this._data[5])}minWith(e){const{_data:t}=this;t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2])}maxWith(e){const{_data:t}=this;t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}assignMinMax(e,t){for(let i=0;i<3;++i)this._data[0+i]=e[i],this._data[3+i]=t[i]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class Ye extends qe{constructor(){super(...arguments),this.bounds=new Ue.iy}}function Qe(e,t,i){const r=e.bbMin,n=e.bbMax;if((0,o.tZ)(i)){const e=(0,y.hZ)(Xe,i[12],i[13],i[14]);return(0,y.WQ)(Ke,r,e),(0,y.WQ)(Je,n,e),t.minWith(Ke),void t.maxWith(Je)}if((0,y.Z0)(Ke,r,i),(0,y.t2)(r,n))return t.minWith(Ke),void t.maxWith(Ke);(0,y.Z0)(Je,n,i),t.minWith(Ke),t.minWith(Je),t.maxWith(Ke),t.maxWith(Je);for(let e=0;e<3;++e)(0,y.C)(Ke,r),(0,y.C)(Je,n),Ke[e]=n[e],Je[e]=r[e],(0,y.Z0)(Ke,Ke,i),(0,y.Z0)(Je,Je,i),t.minWith(Ke),t.minWith(Je),t.maxWith(Ke),t.maxWith(Je)}const Xe=(0,l.vt)(),Ke=(0,l.vt)(),Je=(0,l.vt)(),et=(0,l.vt)();var tt=i(21818),it=i(71511);const rt=["layerObjectAdded","layerObjectRemoved","layerObjectsAdded","layerObjectsRemoved","transformationChanged","shaderTransformationChanged","visibilityChanged","occlusionChanged","highlightChanged","geometryAdded","geometryRemoved","attributesChanged"];var nt=i(78230);class st{constructor(e,t,i=""){this.stage=e,this.apiLayerViewUid=i,this.id=(0,He.c)(),this.events=new N.bk,this.visible=!0,this.sliceable=!1,this._objectsAdded=new Array,this._handles=new it.A,this._objects=new Map,this._pickable=!0,this.visible=t?.visible??!0,this._pickable=t?.pickable??!0,this.updatePolicy=t?.updatePolicy??0,e.addLayer(this);for(const t of rt)this._handles.add(this.events.on(t,i=>e.handleEvent(t,i)))}destroy(){this._handles.size&&(this._handles.destroy(),this.stage.removeLayer(this),this.invalidateSpatialQueryAccelerator())}get objects(){return this._objects}getObject(e){return(0,tt.z)(this._objects.get(e))}set pickable(e){this._pickable=e}get pickable(){return this._pickable&&this.visible}add(e){this._objects.set(e.id,e),e.layer=this,this.events.emit("layerObjectAdded",e),null!=this._octree&&this._objectsAdded.push(e)}remove(e){this._objects.delete(e.id)&&(this.events.emit("layerObjectRemoved",e),e.layer=null,null!=this._octree&&((0,F.Xy)(this._objectsAdded,e)||this._octree.remove([e])))}addMany(e){for(const t of e)this._objects.set(t.id,t),t.layer=this;this.events.emit("layerObjectsAdded",e),null!=this._octree&&this._objectsAdded.push(...e)}removeMany(e){const t=new Array;for(const i of e)this._objects.delete(i.id)&&t.push(i);if(0!==t.length&&(this.events.emit("layerObjectsRemoved",t),t.forEach(e=>e.layer=null),null!=this._octree)){for(let e=0;e<t.length;)(0,F.Xy)(this._objectsAdded,t[e])?(t[e]=t[t.length-1],t.length-=1):++e;this._octree.remove(t)}}commit(){this.stage.commitLayer(this)}sync(){1!==this.updatePolicy&&this.stage.syncLayer(this.id)}notifyObjectBBChanged(e,t){null==this._octree||this._objectsAdded.includes(e)||this._octree.update(e,t)}getSpatialQueryAccelerator(){return null==this._octree&&this._objects.size>50?(this._octree=new nt.x(e=>e.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.values())):null!=this._octree&&this._objectsAdded.length>0&&(this._octree.add(this._objectsAdded),this._objectsAdded.length=0),this._octree}invalidateSpatialQueryAccelerator(){this._octree=(0,H.pR)(this._octree),this._objectsAdded.length=0}get test(){}}var ot=i(90629),at=i(78659),lt=i(20498),ct=i(11964),ut=i(13030),ht=i(49255),dt=i(92130),pt=i(11725),gt=i(77194),ft=i(96095),mt=i(35622),vt=i(59907),xt=i(32565),yt=i(7298),_t=i(4431),bt=i(33524),St=i(56133),wt=i(33442);let Ct=class extends le.w{constructor(e,t){super(e,t,(0,_t.U)((0,yt.bP)(t))),this.shader=new ae.r(xt.R,()=>i.e(2059).then(i.bind(i,92059))),this.ignoreUnused=!0,this.primitiveType=t.wireframe?Te.WR.LINES:Te.WR.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return(0,he.Ey)({blending:(0,bt.Yf)(i,!1,e.emissionDimmingPass),depthTest:(0,bt.mt)(i),depthWrite:(0,bt.z5)(e),colorWrite:he.kn,stencilWrite:r?St.v0:null,stencilTest:r?t?St.Ax:St.cP:null,polygonOffset:(0,wt.Tk)(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=(0,he.Ey)({blending:he.T8,polygonOffset:(0,wt.Tk)(e),depthTest:St.sf,depthWrite:null,colorWrite:he.kn,stencilWrite:null,stencilTest:t?St.Q0:null}),this._occluderPipelineOpaque=(0,he.Ey)({blending:he.T8,polygonOffset:(0,wt.Tk)(e),depthTest:t?St.sf:St.m,depthWrite:null,colorWrite:he.kn,stencilWrite:t?St.r8:null,stencilTest:t?St.iB:null}),this._occluderPipelineMaskWrite=(0,he.Ey)({blending:null,polygonOffset:(0,wt.Tk)(e),depthTest:St.m,depthWrite:null,colorWrite:null,stencilWrite:t?St.v0:null,stencilTest:t?St.Ax:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t,i){if(i)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,t,i);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,t,i);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,t,i)}}};Ct=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],Ct);var Tt=i(51976),At=i(47724);class Et extends At.L{constructor(e){super(),this.spherical=e,this.capType=0,this.emissionSource=0,this.animation=2,this.polygonOffsetIndex=0,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.numJoinSubdivisions=1,this.roundJoins=!1,this.applyMarkerOffset=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.occluder=!1,this.wireframe=!1,this.hasScreenSizePerspective=!1,this.worldSizedImagePattern=!1,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}get hasAnimation(){return 0!==this.animation}}(0,D.Cg)([(0,Tt.W)({count:3})],Et.prototype,"capType",void 0),(0,D.Cg)([(0,Tt.W)({count:8})],Et.prototype,"emissionSource",void 0),(0,D.Cg)([(0,Tt.W)({count:4})],Et.prototype,"animation",void 0),(0,D.Cg)([(0,Tt.W)({count:16})],Et.prototype,"polygonOffsetIndex",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"writeDepth",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"draped",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"stippleEnabled",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"stippleOffColorEnabled",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"stipplePreferContinuous",void 0),(0,D.Cg)([(0,Tt.W)({count:8})],Et.prototype,"numJoinSubdivisions",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"roundJoins",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"applyMarkerOffset",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"hasVVSize",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"hasVVColor",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"hasVVOpacity",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"falloffEnabled",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"innerColorEnabled",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"hasOccludees",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"occluder",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"wireframe",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"hasScreenSizePerspective",void 0),(0,D.Cg)([(0,Tt.W)()],Et.prototype,"worldSizedImagePattern",void 0);var Rt=i(49788);class Ot extends pt.i{constructor(e,t){super(e,Lt),this.produces=new Map([[2,e=>(0,ht.Ex)(e)||(0,ht._o)(e)&&8===this.parameters.renderOccluded],[3,e=>(0,ht.eh)(e)],[10,e=>(0,ht.gr)(e)&&8===this.parameters.renderOccluded],[11,e=>(0,ht.gr)(e)&&8===this.parameters.renderOccluded],[4,e=>(0,ht._o)(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>(0,ht._o)(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>(0,ht.i3)(e)]]),this._configuration=new Et(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Ft(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&function(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=Rt.Q||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>Rt.Q}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectDraped({attributes:e,screenToWorldRatio:t},i,r,n,s){if(!i.options.selectionMode)return;const o=e.get("size");let a=this.parameters.width;if(this.parameters.vvSize){const t=e.get("sizeFeatureAttribute").data[0];Number.isNaN(t)?a*=this.parameters.vvSize.fallback[0]:a*=(0,v.qE)(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(a*=o.data[0]);const l=r[0],c=r[1],u=(a/2+4)*t;let h=Number.MAX_VALUE,d=0;const p=e.get("position").data,g=Dt(this.parameters,e)?p.length-2:p.length-5;for(let e=0;e<g;e+=3){const t=p[e],i=p[e+1],r=(e+3)%p.length,n=l-t,s=c-i,o=p[r]-t,a=p[r+1]-i,u=(0,v.qE)((o*n+a*s)/(o*o+a*a),0,1),g=o*u-n,f=a*u-s,m=g*g+f*f;m<h&&(h=m,d=e/3)}h<u*u&&n(s.distance,s.normal,d)}intersect(e,t,i,r,n,s){const{options:o,camera:a,rayBegin:l,rayEnd:c}=i;if(!o.selectionMode||!e.visible||!a)return;if(!(0,Fe.zH)(t))return void u.A.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const h=e.attributes,d=h.get("position").data;let p=this.parameters.width;if(this.parameters.vvSize){const e=h.get("sizeFeatureAttribute").data[0];Number.isNaN(e)||(p*=(0,v.qE)(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else h.has("size")&&(p*=h.get("size").data[0]);const g=$t;(0,ne.C)(g,i.point);const f=p*a.pixelRatio,m=4*a.pixelRatio,x=f/2+m;(0,y.hZ)(ti[0],g[0]-x,g[1]+x,0),(0,y.hZ)(ti[1],g[0]+x,g[1]+x,0),(0,y.hZ)(ti[2],g[0]+x,g[1]-x,0),(0,y.hZ)(ti[3],g[0]-x,g[1]-x,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(ti[e],ii[e]))return;(0,_.Cr)(a.eye,ii[0],ii[1],ri),(0,_.Cr)(a.eye,ii[1],ii[2],ni),(0,_.Cr)(a.eye,ii[2],ii[3],si),(0,_.Cr)(a.eye,ii[3],ii[0],oi);let b=Number.MAX_VALUE,S=0;const w=Dt(this.parameters,h)?d.length-2:d.length-5;for(let e=0;e<w;e+=3){zt[0]=d[e]+t[12],zt[1]=d[e+1]+t[13],zt[2]=d[e+2]+t[14];const i=(e+3)%d.length;if(Ht[0]=d[i]+t[12],Ht[1]=d[i+1]+t[13],Ht[2]=d[i+2]+t[14],(0,_.mN)(ri,zt)<0&&(0,_.mN)(ri,Ht)<0||(0,_.mN)(ni,zt)<0&&(0,_.mN)(ni,Ht)<0||(0,_.mN)(si,zt)<0&&(0,_.mN)(si,Ht)<0||(0,_.mN)(oi,zt)<0&&(0,_.mN)(oi,Ht)<0)continue;const r=a.projectToRenderScreen(zt,Zt),n=a.projectToRenderScreen(Ht,kt);if(null==r||null==n)continue;if(r[2]<0&&n[2]>0){(0,y.Re)(Ut,zt,Ht);const e=a.frustum,t=-(0,_.mN)(e[4],zt)/(0,y.Om)(Ut,(0,_.Qj)(e[4]));if((0,y.hs)(Ut,Ut,t),(0,y.WQ)(zt,zt,Ut),!a.projectToRenderScreen(zt,r))continue}else if(r[2]>0&&n[2]<0){(0,y.Re)(Ut,Ht,zt);const e=a.frustum,t=-(0,_.mN)(e[4],Ht)/(0,y.Om)(Ut,(0,_.Qj)(e[4]));if((0,y.hs)(Ut,Ut,t),(0,y.WQ)(Ht,Ht,Ut),!a.projectToRenderScreen(Ht,n))continue}else if(r[2]<0&&n[2]<0)continue;r[2]=0,n[2]=0;const s=(0,ct.Cr)(r,n,Yt),o=(0,ct.kb)(s,g);if(!(o>=b)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(s,zt,Ht,g,a,p,m);if(o>=e*e)continue}b=o,(0,y.C)(Gt,zt),(0,y.C)(qt,Ht),S=e/3}}if(b<x*x){let e=Number.MAX_VALUE;if((0,ct.ld)((0,ct.Cr)(Gt,qt,Yt),(0,ct.Cr)(l,c,Qt),Bt)){(0,y.Re)(Bt,Bt,l);const t=(0,y.Bw)(Bt);(0,y.hs)(Bt,Bt,1/t),e=t/(0,y.Io)(l,c)}s(e,Bt,S)}}createBufferWriter(){return new Pt((0,yt.bP)(this.parameters),(0,yt.qB)(this.parameters),this.parameters)}createGLMaterial(e){return new Mt(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:(0,at.y)(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,n,s,o){const a=(0,ct.G1)(e,r);(0,y.Cc)(Wt,t,i,a),(0,y.Z0)(Vt,Wt,n.viewMatrix);const l=(0,y.Bw)(Vt),c=this.computeCameraAbsCosAngle(Wt,n,this._configuration.spherical);return Nt.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Nt.apply(s)*n.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,i){return i?(0,y.S8)(Bt,e):(0,y.hZ)(Bt,0,0,1),(0,y.Re)(jt,e,t.eye),(0,y.S8)(jt,jt),Math.abs((0,y.Om)(Bt,jt))}}class Mt extends dt.A{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Ct,e)}}class Lt extends mt.S{constructor(){super(...arguments),this._width=0,this.color=We.Un,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=(0,at.Kp)(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=(0,at.Kp)(0),this.endTime=(0,at.Kp)(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return(0,ft.sL)(this.stipplePattern)&&null!=this.stippleTexture}}class Pt{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=Ft(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return Dt(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3}elementCount(e){const t=e.get("position").indices.length/2+1,i=this._isClosed(e);let r=i?2:4;return r+=((i?t:t-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),r+=2,this._parameters.wireframe&&(r=2+4*(r-2)),r}write(e,t,i,r,n,s){const{buffer:o,offset:a}=n,{layout:l,textureBufferLayout:c}=this,u=i.get("position"),h=u.indices,d=u.data.length/3,p=d,g=i.get("distanceToStart")?.data;h&&h.length!==2*(d-1)&&console.warn("RibbonLineMaterial does not support indices");const f=o.getField("textureElementIndex",ut.P);(0,Fe.vA)(null!=f,"Missing texture buffer index field"),(0,Fe.vA)(null!==s,"Expected texture buffer target"),(0,Fe.vA)(null!==c,"Expected valid textureBufferLayout");const{textureBufferRange:m,offset:v}=s;(0,Fe.vA)(null!=m,"Using a texture layout, but the texture range for this instance was not provided");const x=m.from;(0,Fe.vA)(m.numElements===p,"Expected number of elements in TextureBuffer to equal number of points");const{buffer:_}=s,b=_.getField("position",ut.xs);(0,Fe.vA)(null!==b,"Expected valid position field in texture buffer");const S=l.fields.has("sizeFeatureAttribute");let w=1,C=null;if(S){const e=i.get("sizeFeatureAttribute");1===e.data.length?w=e.data[0]:C=e.data}else w=i.get("size")?.data[0]??1;let T=[1,1,1,1],A=0,E=null;const R=l.fields.has("colorFeatureAttribute");if(R){const e=i.get("colorFeatureAttribute");1===e.data.length?A=e.data[0]:E=e.data}else T=i.get("color")?.data??T;const O=i.get("timeStamps")?.data,M=O&&l.fields.has("timeStamps"),L=l.fields.has("opacityFeatureAttribute");let P=0,I=null;if(L){const e=i.get("opacityFeatureAttribute");1===e.data.length?P=e.data[0]:I=e.data}const D=new Float32Array(o.buffer),F=(0,lt.Bg)(o.buffer),N=new Uint8Array(o.buffer),z=new Uint32Array(o.buffer),H=l.stride/4;let W=a*H;const V=W;let j=0;const U=g?(e,t,i)=>j=g[i]:(e,t,i)=>j+=(0,y.Io)(e,t),B=D.BYTES_PER_ELEMENT/F.BYTES_PER_ELEMENT,Z=4/B,k=(0,X.E)(),G=(e,t,i,n,s,o,a,l)=>{const c=a;z[W]=x+c,W++,b.setVec(v+c,t),(0,vt.Wu)(e,t,F,W*B),W+=Z,(0,vt.Wu)(i,t,F,W*B),W+=Z,D[W++]=l;let u=W*B;if(F[u++]=s,F[u++]=o,W=Math.ceil(u/B),R)D[W]=E?.[a]??A;else{const e=Math.min(4*a,T.length-4),t=4*W;N[t]=255*T[e],N[t+1]=255*T[e+1],N[t+2]=255*T[e+2],N[t+3]=255*T[e+3]}if(W++,D[W++]=C?.[a]??w,L&&(D[W++]=I?.[a]??P),k){let e=4*W;r?(N[e++]=r[0],N[e++]=r[1],N[e++]=r[2],N[e++]=r[3]):(N[e++]=0,N[e++]=0,N[e++]=0,N[e++]=0),W=Math.ceil(.25*e)}M&&(u=W*B,F[u++]=n[0],F[u++]=n[1],F[u++]=n[2],F[u++]=n[3],W=Math.ceil(u/B))};W+=H,(0,y.hZ)(Kt,u.data[0],u.data[1],u.data[2]),M&&(0,$.hZ)(ei,O[0],O[1],O[2],O[3]),e&&(0,y.Z0)(Kt,Kt,e);const q=this._isClosed(i);if(q){const t=u.data.length-3;(0,y.hZ)(Xt,u.data[t],u.data[t+1],u.data[t+2]),e&&(0,y.Z0)(Xt,Xt,e)}else(0,y.hZ)(Jt,u.data[3],u.data[4],u.data[5]),e&&(0,y.Z0)(Jt,Jt,e),G(Kt,Kt,Jt,ei,1,-4,0,0),G(Kt,Kt,Jt,ei,1,4,0,0),(0,y.C)(Xt,Kt),(0,y.C)(Kt,Jt),M&&(0,$.hZ)(ei,O[4],O[5],O[6],O[7]);const Y=q?0:1,Q=q?d:d-1;for(let t=Y;t<Q;t++){const i=(t+1)%d*3;(0,y.hZ)(Jt,u.data[i],u.data[i+1],u.data[i+2]),e&&(0,y.Z0)(Jt,Jt,e),U(Xt,Kt,t),G(Xt,Kt,Jt,ei,0,-1,t,j),G(Xt,Kt,Jt,ei,0,1,t,j);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const i=(e+1)/(r+1);G(Xt,Kt,Jt,ei,i,-1,t,j),G(Xt,Kt,Jt,ei,i,1,t,j)}if(G(Xt,Kt,Jt,ei,1,-2,t,j),G(Xt,Kt,Jt,ei,1,2,t,j),(0,y.C)(Xt,Kt),(0,y.C)(Kt,Jt),M){const e=(t+1)%d*4;(0,$.hZ)(ei,O[e],O[e+1],O[e+2],O[e+3])}}q?((0,y.hZ)(Jt,u.data[3],u.data[4],u.data[5]),e&&(0,y.Z0)(Jt,Jt,e),j=U(Xt,Kt,Q),G(Xt,Kt,Jt,ei,0,-1,Y,j),G(Xt,Kt,Jt,ei,0,1,Y,j)):(j=U(Xt,Kt,Q),G(Xt,Kt,Kt,ei,0,-5,Q,j),G(Xt,Kt,Kt,ei,0,5,Q,j)),It(D,V+H,D,V,H),W=It(D,W-H,D,W,H),this._parameters.wireframe&&this._addWireframeVertices(o,V,W,H)}_addWireframeVertices(e,t,i,r){const n=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),s=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=It(s,e,n,a,o);for(let e=0;e<=s.length-4*o;e+=2*o)l(e),l(e+2*o),l(e+1*o),l(e+2*o),l(e+1*o),l(e+3*o)}}function It(e,t,i,r,n){for(let s=0;s<n;s++)i[r++]=e[t++];return r}function Dt(e,t){return!!e.isClosed&&t.get("position").indices.length>2}function Ft(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return xt.r+i}}const Nt=new gt.PS,zt=(0,l.vt)(),Ht=(0,l.vt)(),Wt=(0,l.vt)(),Vt=(0,l.vt)(),jt=(0,l.vt)(),Ut=(0,l.vt)(),Bt=(0,l.vt)(),$t=(0,l.vt)(),Zt=(0,ot.r_)(),kt=(0,ot.r_)(),Gt=(0,l.vt)(),qt=(0,l.vt)(),Yt=(0,ct.vt)(),Qt=(0,ct.vt)(),Xt=(0,l.vt)(),Kt=(0,l.vt)(),Jt=(0,l.vt)(),ei=(0,We.vt)(),ti=[(0,ot.r_)(),(0,ot.r_)(),(0,ot.r_)(),(0,ot.r_)()],ii=[(0,l.vt)(),(0,l.vt)(),(0,l.vt)(),(0,l.vt)()],ri=(0,_.vt)(),ni=(0,_.vt)(),si=(0,_.vt)(),oi=(0,_.vt)();class ai{constructor(e){this._originSR=e,this._rootOriginId="root/"+(0,He.c)(),this._origins=new Map,this._objects=new Map,this._gridSize=5e5,this._originSR?.isGeographic&&(this._gridSize/=(0,x.GA)(this._originSR)),this._baselineDistance=.5*this._gridSize;const t=this._baselineDistance*ci;this._baselineObjectSize=t/ui}getOrigin(e){const t=this._origins.get(this._rootOriginId);if(null==t){const t=null;if(null!=t)return this._origins.set(this._rootOriginId,G(t[0],t[1],t[2],this._rootOriginId)),this.getOrigin(e);const i=G(e[0]+Math.random()-.5,e[1]+Math.random()-.5,e[2]+Math.random()-.5,this._rootOriginId);return this._origins.set(this._rootOriginId,i),i}const i=this._gridSize,r=Math.round(e[0]/i),n=Math.round(e[1]/i),s=Math.round(e[2]/i),o=`${r}/${n}/${s}`;let a=this._origins.get(o);const l=.5*i;if((0,y.Re)(li,e,t.vec3),li[0]=Math.abs(li[0]),li[1]=Math.abs(li[1]),li[2]=Math.abs(li[2]),li[0]<l&&li[1]<l&&li[2]<l){if(a){const t=Math.max(...li);if((0,y.Re)(li,e,a.vec3),li[0]=Math.abs(li[0]),li[1]=Math.abs(li[1]),li[2]=Math.abs(li[2]),Math.max(...li)<t)return a}return t}return a||(a=G(r*i,n*i,s*i,o),this._origins.set(o,a)),a}needsOriginUpdate(e,t,i){const r=(0,y.Io)(e.vec3,t),n=Math.max(1,i/this._baselineObjectSize);return r>this._baselineDistance*n}_drawOriginBox(e,t=(0,We.fA)(1,1,0,1)){const i=window.view,r=i.stage,s=t.toString();if(!this._objects.has(s)){this._material=new Ot({width:2,color:t},!1);const e=new st(r,{pickable:!1}),i=new Ge({castShadow:!1});e.add(i),this._objects.set(s,i)}const o=this._objects.get(s),a=[0,1,5,4,0,2,1,7,6,2,0,1,3,7,5,4,6,2,0],l=a.length,c=new Array(3*l),u=new Array,h=.5*this._gridSize;for(let t=0;t<l;t++)c[3*t]=e[0]+(1&a[t]?h:-h),c[3*t+1]=e[1]+(2&a[t]?h:-h),c[3*t+2]=e[2]+(4&a[t]?h:-h),t>0&&u.push(t-1,t);(0,n.projectBuffer)(c,this._originSR,0,c,i.renderSpatialReference,0,l);const d=new je.V(this._material,[["position",new Ve.n(c,u,3,!0)]],null,2);o.addGeometry(d)}get test(){}}const li=(0,l.vt)(),ci=2**-23,ui=.05;var hi,di=i(44794),pi=i(48163),gi=i(24770),fi=i(79258),mi=i(25482),vi=i(93223);let xi=hi=class extends mi.o{constructor(e){super(e),this.type="cloudy",this.cloudCover=.5,this.fogOpacity=0}clone(){return new hi({cloudCover:this.cloudCover})}};(0,D.Cg)([(0,vi.e)({cloudy:"cloudy"}),(0,U.MZ)({json:{write:{isRequired:!0}}})],xi.prototype,"type",void 0),(0,D.Cg)([(0,U.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],xi.prototype,"cloudCover",void 0),xi=hi=(0,D.Cg)([(0,U.$K)("esri.views.3d.environment.CloudyWeather")],xi);const yi=xi;var _i;let bi=class extends mi.o{static{_i=this}constructor(e){super(e),this.type="foggy",this.fogStrength=.5}clone(){return new _i({fogStrength:this.fogStrength})}get fogOpacity(){return(0,v.Cc)(_i.minFogOpacity,_i.maxFogOpacity,this.fogStrength**3)}static{this.minFogOpacity=3e-5}static{this.maxFogOpacity=.005}};(0,D.Cg)([(0,vi.e)({foggy:"foggy"}),(0,U.MZ)({json:{write:{isRequired:!0}}})],bi.prototype,"type",void 0),(0,D.Cg)([(0,U.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],bi.prototype,"fogStrength",void 0),bi=_i=(0,D.Cg)([(0,U.$K)("esri.views.3d.environment.FoggyWeather")],bi);const Si=bi;var wi;let Ci=class extends mi.o{static{wi=this}constructor(e){super(e),this.type="rainy",this.cloudCover=.5,this.precipitation=.5}clone(){return new wi({cloudCover:this.cloudCover,precipitation:this.precipitation})}get fogOpacity(){return(0,v.Cc)(wi.minFogOpacity,wi.maxFogOpacity,this.precipitation**3)}static{this.minFogOpacity=4e-6}static{this.maxFogOpacity=2e-4}};(0,D.Cg)([(0,vi.e)({rainy:"rainy"}),(0,U.MZ)({json:{write:{isRequired:!0}}})],Ci.prototype,"type",void 0),(0,D.Cg)([(0,U.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ci.prototype,"cloudCover",void 0),(0,D.Cg)([(0,U.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ci.prototype,"precipitation",void 0),Ci=wi=(0,D.Cg)([(0,U.$K)("esri.views.3d.environment.RainyWeather")],Ci);const Ti=Ci;var Ai;let Ei=Ai=class extends mi.o{constructor(e){super(e),this.type="snowy",this.cloudCover=.5,this.precipitation=.5,this.snowCover="disabled"}clone(){return new Ai({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}get fogOpacity(){return(0,v.Cc)(Ti.minFogOpacity,Ti.maxFogOpacity,this.precipitation**3)}};(0,D.Cg)([(0,vi.e)({snowy:"snowy"}),(0,U.MZ)({json:{write:{isRequired:!0}}})],Ei.prototype,"type",void 0),(0,D.Cg)([(0,U.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ei.prototype,"cloudCover",void 0),(0,D.Cg)([(0,U.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ei.prototype,"precipitation",void 0),(0,D.Cg)([(0,U.MZ)({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],Ei.prototype,"snowCover",void 0),Ei=Ai=(0,D.Cg)([(0,U.$K)("esri.views.3d.environment.SnowyWeather")],Ei);const Ri=Ei;var Oi;let Mi=Oi=class extends mi.o{constructor(e){super(e),this.type="sunny",this.cloudCover=.5,this.fogOpacity=0}clone(){return new Oi({cloudCover:this.cloudCover})}};(0,D.Cg)([(0,vi.e)({sunny:"sunny"}),(0,U.MZ)({json:{write:{isRequired:!0}}})],Mi.prototype,"type",void 0),(0,D.Cg)([(0,U.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Mi.prototype,"cloudCover",void 0),Mi=Oi=(0,D.Cg)([(0,U.$K)("esri.views.3d.environment.SunnyWeather")],Mi);const Li={key:"type",base:Mi,typeMap:{sunny:Mi,cloudy:yi,rainy:Ti,snowy:Ri,foggy:Si}};Object.keys(Li.typeMap);class Pi{constructor(){this.startTime=0,this._data=(0,di.v)(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new Ii,this.parallaxNew=new Ii,this._anchorPoint=(0,l.vt)(),this._fadeState=(0,di.v)(0),this._fadeFactor=(0,di.v)(1)}get data(){return this._data.value}set data(e){this._data.value=e}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(e,t,i){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=i?(0,v.qE)((t-this.startTime)/(zi*i),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(e,t),this._updateParallax(e)}_evaluateState(e,t){const i=e.relativeElevation,r=this._updateAnchorPoint(e);(Math.abs(i)>17e3||r>Wi)&&this.opacity>0?this._startFade(0,t):this.isFading||(Math.abs(i)>1e4||r>Hi*Wi?this.opacity>0&&this._startFade(4,t):function(e){return null!=e&&!e.readyToRun}(this.data)&&(0===this.opacity?this._startFade(1,t):2===this.data.state&&(2===this.fadeState?this._startFade(3,t):this._startFade(2,t))))}_updateParallax(e){const t=(0,y.m3)(e.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(t-fi.$O.radius*fi.$O.radius,0))/Math.sqrt(t),(0,gi.Cr)(Di,this.parallax.anchorPoint,Fi),(0,o.e$)(this.parallax.transform,a.zK,Fi[3],(0,gi.yo)(Fi)),(0,gi.Cr)(Di,this.parallaxNew.anchorPoint,Fi),(0,o.e$)(this.parallaxNew.transform,a.zK,Fi[3],(0,gi.yo)(Fi))}_updateAnchorPoint(e){return(0,y.S8)(this._anchorPoint,e.eye),(0,y.hs)(this._anchorPoint,this._anchorPoint,fi.$O.radius),0===this.fadeState&&2===this.data?.state?((0,y.C)(this.parallax.anchorPoint,this._anchorPoint),0):(0,y.Bw)((0,y.Re)(Ni,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(e,t){switch(this._fadeState.value=e,this.startTime=t,e){case 3:this.requestFade(),this._switchReadChannels(),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),(0,y.C)(this.parallax.anchorPoint,this._anchorPoint),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),(0,y.C)(this.parallax.anchorPoint,this._anchorPoint),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:(0,y.C)(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:this.fadeState}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class Ii{constructor(){this.anchorPoint=(0,l.vt)(),this.radiusCurvatureCorrection=0,this.transform=(0,a.vt)()}}const Di=(0,l.fA)(0,0,1),Fi=(0,gi.vt)(),Ni=(0,l.vt)(),zi=1.25,Hi=.5,Wi=2e5;class Vi{constructor(){this.lastFrameCamera=new ee.A,this.matrix=(0,a.vt)(),this.viewMatrix=(0,a.vt)()}}class ji{constructor(){this.enabled=!1,this.fadeFactor=1}}var Ui=i(57226);class Bi{constructor(e,t){this._rctx=e,this.shadowMap=t,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.emissions=0,this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=(0,di.v)(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=new ee.A,this._inverseViewport=(0,pi.vt)(),this._oldLighting=new Ui.TA,this._newLighting=new Ui.TA,this._fadedLighting=new Ui.TA,this._lighting=this._newLighting,this.screenSpaceReflections=new ji,this.reprojection=new Vi,this.highlights=new Array,this.highlightMixOrigin=(0,pi.vt)(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new Pi,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=(0,H.Gz)(this.depth),this.shadowMap?.dispose()}get output(){return this._output}set output(e){this._output!==e&&(this._output=e,this._rctx.resetDrawBuffers(e))}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return 1===this.emissions||3===this.emissions}get hasTransparentEmission(){return 2===this.emissions||3===this.emissions}get camera(){return this._camera}set camera(e){this._camera=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return 1===this.output&&this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,i,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=i,this._newLighting.set(e),this._oldLighting.updateLegacy(),1===r&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return(0,ht._o)(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name="geometry depth"),this._depth=e}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}class $i{constructor(e,t,i){this.rctx=e,this.techniques=i,this.renderOccludedMask=Zi,this.time=(0,at.l5)(0),this.bind=new Bi(e,t),this.bind.alignPixelEnabled=!0}destroy(){this.bind.destroy()}get output(){return this.bind.output}}const Zi=13;var ki=i(29242);let Gi=class extends ee.A{constructor(){super(...arguments),this._projectionMatrix=(0,a.vt)()}get projectionMatrix(){return this._projectionMatrix}};(0,D.Cg)([(0,U.MZ)()],Gi.prototype,"_projectionMatrix",void 0),(0,D.Cg)([(0,U.MZ)({readOnly:!0})],Gi.prototype,"projectionMatrix",null),Gi=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.lib.CascadeCamera")],Gi);var qi=i(78988);class Yi{constructor(){this.camera=new Gi,this.lightMat=(0,a.vt)()}}class Qi{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class Xi{constructor(e,t){this._fbos=e,this._viewingMode=t,this._enabled=!1,this._outputs=new Array,this._textureHeight=0,this._numCascades=1,this.settings=new Qi,this._projectionView=(0,a.vt)(),this._projectionViewInverse=(0,a.vt)(),this._modelViewLight=(0,a.vt)(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=(0,We.vt)(),this._cascades=[new Yi,new Yi,new Yi,new Yi],this._lastOrigin=null,this._maxTextureWidth=Math.min((0,c.A)("esri-mobile")?4096:16384,e.rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1}disposeOutputs(){this._handle=(0,H.Gz)(this._handle),this._outputs.forEach(e=>e?.release()),this._outputs.length=0}disposeOutput(e){this._outputs[e]=(0,H.Gz)(this._outputs[e])}set maxCascades(e){this.settings.maxNumCascadesHighQuality=(0,v.qE)(Math.floor(e),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(e){this._enabled=e,e||this.disposeOutputs()}get enabled(){return this._enabled}get ready(){return!!this.getOutput(5)||!!this.getOutput(7)}get renderTarget(){return this._handle}get cascades(){for(let e=0;e<this._numCascades;++e)ar[e]=this._cascades[e];return ar.length=this._numCascades,ar}start(e,t,i,r,n){(0,Fe.vA)(this.enabled);const{near:s,far:o}=function(e){let{near:t,far:i}=e;return t<2&&(t=2),i<2&&(i=2),t>=i&&(t=2,i=4),{near:t,far:i}}(i);this._computeCascadeDistances(s,o,r),this._textureHeight=this._computeTextureHeight(e,n,r),this._setupMatrices(e,t);const{viewMatrix:a,projectionMatrix:l}=e;for(let e=0;e<this._numCascades;++e)this._constructCascade(e,l,a,t);this._lastOrigin=null,this.clear()}getShadowMapMatrices(e){if(!this._lastOrigin||!(0,y.t2)(e,this._lastOrigin)){this._lastOrigin=this._lastOrigin||(0,l.vt)(),(0,y.C)(this._lastOrigin,e);for(let t=0;t<this._numCascades;++t){(0,o.Tl)(lr,this._cascades[t].lightMat,e);for(let e=0;e<16;++e)cr[16*t+e]=lr[e]}}return cr}finish(e){(0,Fe.vA)(this.enabled),this._outputs[e]?.release(),this._outputs[e]=this._handle,this._handle?.setName(6===e?"shadow map highlight":"shadow map excluding highlight"),this._handle=null}getOutput(e){return this.enabled?this._outputs[e]?.getTexture(Te.nI):null}clear(){this._ensureFbo(),this.bindFramebuffer(),this._fbos.rctx.clear(256)}_computeTextureHeight({pixelRatio:e,fullWidth:t,fullHeight:i},r,n){const s=Math.min(window.devicePixelRatio,r)/e,o=n?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return(0,qi.Mv)(Math.max(t,i)*s*o,this._maxTextureWidth/this._numCascades)}_ensureFbo(){this._handle?.fbo?.width===this._textureWidth&&this._handle?.fbo.height===this._textureHeight||(this._handle?.release(),this._handle=this._fbos.acquire(this._textureWidth,this._textureHeight,"shadow map",13),this._handle.getTexture(Te.nI)?.setShadowFiltering(!0))}bindFramebuffer(){this._fbos.rctx.bindFramebuffer(this._handle?.fbo)}_constructCascade(e,t,i,r){const n=this._cascades[e],s=-this._cascadeDistances[e],a=-this._cascadeDistances[e+1],l=(t[10]*s+t[14])/Math.abs(t[11]*s+t[15]),c=(t[10]*a+t[14])/Math.abs(t[11]*a+t[15]);(0,Fe.vA)(l<c);for(let e=0;e<8;++e){(0,$.hZ)(Ji,e%4==0||e%4==3?-1:1,e%4==0||e%4==1?-1:1,e<4?l:c,1);const t=er[e];(0,$.Z0)(t,Ji,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}(0,y.ze)(or,er[0]),n.camera.viewMatrix=(0,o.Tl)(Ki,this._modelViewLight,or);for(let e=0;e<8;++e)(0,y.Z0)(er[e],er[e],n.camera.viewMatrix);let u=er[0][2],h=er[0][2];for(let e=1;e<8;++e)u=Math.min(u,er[e][2]),h=Math.max(h,er[e][2]);u-=200,h+=200,n.camera.near=-h,n.camera.far=-u,function(e,t,i,r,n){const s=1/er[0][3],o=1/er[4][3];(0,Fe.vA)(s<o);let a=s+Math.sqrt(s*o);const l=Math.sin((0,v.XM)(e[2]*t[0]+e[6]*t[1]+e[10]*t[2]));a/=l,function(e,t,i,r,n,s,o,a){(0,ne.hZ)(ur,0,0);for(let t=0;t<4;++t)(0,ne.WQ)(ur,ur,e[t]);(0,ne.hs)(ur,ur,.25),(0,ne.hZ)(hr,0,0);for(let t=4;t<8;++t)(0,ne.WQ)(hr,hr,e[t]);(0,ne.hs)(hr,hr,.25),(0,ne.Cc)(dr[0],e[4],e[5],.5),(0,ne.Cc)(dr[1],e[5],e[6],.5),(0,ne.Cc)(dr[2],e[6],e[7],.5),(0,ne.Cc)(dr[3],e[7],e[4],.5);let l=0,c=(0,ne.hG)(dr[0],ur);for(let e=1;e<4;++e){const t=(0,ne.hG)(dr[e],ur);t<c&&(c=t,l=e)}(0,ne.Re)(pr,dr[l],e[l+4]);const u=pr[0];let h,d;pr[0]=-pr[1],pr[1]=u,(0,ne.Re)(gr,hr,ur),(0,ne.Om)(gr,pr)<0&&(0,ne.ze)(pr,pr),(0,ne.Cc)(pr,pr,gr,i),(0,ne.S8)(pr,pr),h=d=(0,ne.Om)((0,ne.Re)(fr,e[0],ur),pr);for(let t=1;t<8;++t){const i=(0,ne.Om)((0,ne.Re)(fr,e[t],ur),pr);i<h?h=i:i>d&&(d=i)}(0,ne.C)(r,ur),(0,ne.hs)(fr,pr,h-t),(0,ne.WQ)(r,r,fr);let p=-1,g=1,f=0,m=0;for(let t=0;t<8;++t){(0,ne.Re)(mr,e[t],r),(0,ne.S8)(mr,mr);const i=pr[0]*mr[1]-pr[1]*mr[0];i>0?i>p&&(p=i,f=t):i<g&&(g=i,m=t)}(0,Fe.MX)(p>0,"leftArea"),(0,Fe.MX)(g<0,"rightArea"),(0,ne.hs)(vr,pr,h),(0,ne.WQ)(vr,vr,ur),(0,ne.hs)(xr,pr,d),(0,ne.WQ)(xr,xr,ur),yr[0]=-pr[1],yr[1]=pr[0];const v=(0,Fe.L)(r,e[m],xr,(0,ne.WQ)(fr,xr,yr),1,n),x=(0,Fe.L)(r,e[f],xr,fr,1,s),y=(0,Fe.L)(r,e[f],vr,(0,ne.WQ)(fr,vr,yr),1,o),_=(0,Fe.L)(r,e[m],vr,fr,1,a);(0,Fe.MX)(v,"rayRay"),(0,Fe.MX)(x,"rayRay"),(0,Fe.MX)(y,"rayRay"),(0,Fe.MX)(_,"rayRay")}(er,a,l,tr,ir,rr,nr,sr),function(e,t,i,r,n){(0,ne.Re)(wr,i,r),(0,ne.hs)(wr,wr,.5),Cr[0]=wr[0],Cr[1]=wr[1],Cr[2]=0,Cr[3]=wr[1],Cr[4]=-wr[0],Cr[5]=0,Cr[6]=wr[0]*wr[0]+wr[1]*wr[1],Cr[7]=wr[0]*wr[1]-wr[1]*wr[0],Cr[8]=1,Cr[_r(0,2)]=-(0,ne.Om)(Sr(Cr,0),e),Cr[_r(1,2)]=-(0,ne.Om)(Sr(Cr,1),e);let s=(0,ne.Om)(Sr(Cr,0),i)+Cr[_r(0,2)],o=(0,ne.Om)(Sr(Cr,1),i)+Cr[_r(1,2)],a=(0,ne.Om)(Sr(Cr,0),r)+Cr[_r(0,2)],l=(0,ne.Om)(Sr(Cr,1),r)+Cr[_r(1,2)];s=-(s+a)/(o+l),Cr[_r(0,0)]+=Cr[_r(1,0)]*s,Cr[_r(0,1)]+=Cr[_r(1,1)]*s,Cr[_r(0,2)]+=Cr[_r(1,2)]*s,s=1/((0,ne.Om)(Sr(Cr,0),i)+Cr[_r(0,2)]),o=1/((0,ne.Om)(Sr(Cr,1),i)+Cr[_r(1,2)]),Cr[_r(0,0)]*=s,Cr[_r(0,1)]*=s,Cr[_r(0,2)]*=s,Cr[_r(1,0)]*=o,Cr[_r(1,1)]*=o,Cr[_r(1,2)]*=o,Cr[_r(2,0)]=Cr[_r(1,0)],Cr[_r(2,1)]=Cr[_r(1,1)],Cr[_r(2,2)]=Cr[_r(1,2)],Cr[_r(1,2)]+=1,s=(0,ne.Om)(Sr(Cr,1),t)+Cr[_r(1,2)],o=(0,ne.Om)(Sr(Cr,2),t)+Cr[_r(2,2)],a=(0,ne.Om)(Sr(Cr,1),i)+Cr[_r(1,2)],l=(0,ne.Om)(Sr(Cr,2),i)+Cr[_r(2,2)],s=-.5*(s/o+a/l),Cr[_r(1,0)]+=Cr[_r(2,0)]*s,Cr[_r(1,1)]+=Cr[_r(2,1)]*s,Cr[_r(1,2)]+=Cr[_r(2,2)]*s,s=(0,ne.Om)(Sr(Cr,1),t)+Cr[_r(1,2)],o=(0,ne.Om)(Sr(Cr,2),t)+Cr[_r(2,2)],a=-o/s,Cr[_r(1,0)]*=a,Cr[_r(1,1)]*=a,Cr[_r(1,2)]*=a,n[0]=Cr[0],n[1]=Cr[1],n[2]=0,n[3]=Cr[2],n[4]=Cr[3],n[5]=Cr[4],n[6]=0,n[7]=Cr[5],n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=Cr[6],n[13]=Cr[7],n[14]=0,n[15]=Cr[8]}(tr,ir,nr,sr,n.projectionMatrix),n.projectionMatrix[10]=2/(i-r),n.projectionMatrix[14]=-(i+r)/(i-r)}(i,r,u,h,n.camera),(0,o.lw)(n.lightMat,n.camera.projectionMatrix,n.camera.viewMatrix);const d=this._textureHeight;n.camera.viewport=[e*d,0,d,d]}_setupMatrices(e,t){(0,o.lw)(this._projectionView,e.projectionMatrix,e.viewMatrix),(0,o.B8)(this._projectionViewInverse,this._projectionView);const i=1===this._viewingMode?e.eye:(0,y.hZ)(or,0,0,1);(0,o.t5)(this._modelViewLight,[0,0,0],[-t[0],-t[1],-t[2]],i)}_computeCascadeDistances(e,t,i){const r=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor((0,Fe.kL)(t/e,4)),r);const n=(t-e)/this._numCascades,s=(t/e)**(1/this._numCascades);let o=e,a=e;for(let e=0;e<this._numCascades+1;++e)this._cascadeDistances[e]=(0,v.Cc)(o,a,this.settings.splitSchemeLambda),o*=s,a+=n}get _textureWidth(){return this._textureHeight*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return(0,$.hZ)(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}get test(){}}const Ki=(0,a.vt)(),Ji=(0,We.vt)(),er=[];for(let e=0;e<8;++e)er.push((0,We.vt)());const tr=(0,pi.vt)(),ir=(0,pi.vt)(),rr=(0,pi.vt)(),nr=(0,pi.vt)(),sr=(0,pi.vt)(),or=(0,l.vt)(),ar=[],lr=(0,a.vt)(),cr=a.zK.concat(a.zK,a.zK,a.zK),ur=(0,pi.vt)(),hr=(0,pi.vt)(),dr=[(0,pi.vt)(),(0,pi.vt)(),(0,pi.vt)(),(0,pi.vt)()],pr=(0,pi.vt)(),gr=(0,pi.vt)(),fr=(0,pi.vt)(),mr=(0,pi.vt)(),vr=(0,pi.vt)(),xr=(0,pi.vt)(),yr=(0,pi.vt)();function _r(e,t){return 3*t+e}const br=(0,pi.vt)();function Sr(e,t){return(0,ne.hZ)(br,e[t],e[t+3]),br}const wr=(0,pi.vt)(),Cr=(0,ki.vt)();var Tr=i(92942);let Ar=class extends le.w{constructor(){super(...arguments),this.shader=new ae.r(Tr.a,()=>i.e(959).then(i.bind(i,959)))}initializePipeline(e){return e.hasAlpha?(0,he.Ey)({blending:he.T8,colorWrite:he.kn}):(0,he.Ey)({colorWrite:he.kn})}};Ar=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.lib.TextureTechnique")],Ar);class Er extends Tt.K{constructor(){super(...arguments),this.hasAlpha=!1}}(0,D.Cg)([(0,Tt.W)()],Er.prototype,"hasAlpha",void 0);var Rr=i(75497),Or=i(80583);let Mr=class extends le.w{constructor(){super(...arguments),this.shader=new ae.r(Or.a,()=>i.e(4849).then(i.bind(i,64849))),this.ignoreUnused=!0}};Mr=(0,D.Cg)([(0,U.$K)("esri.views.3d.webgl-engine.shaders.OverlayCompositingTechnique")],Mr);var Lr=i(92359);let Pr=class extends re{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new Or.O,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new W.A,this._passParameters=new Tr.T,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new ee.A,this.events=new N.bk,this.longitudeCyclical=null,this.produces=new Map([[18,e=>10!==e||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:t,stage:i}=e.parent.view,r=i.renderer.fboCache,n=i.renderView.renderingContext,s=i.renderView.techniques;this._renderContext=new $i(n,new Xi(r,t.viewingMode),s)}initialize(){const e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([(0,V.wB)(()=>t.updating,()=>this.events.emit("content-changed"),V.pc),(0,V.wB)(()=>this._spatialReference,e=>this._localOriginFactory=new ai(e),V.pc),(0,V.on)(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),(0,V.wB)(()=>function(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:n,haloColor:s,haloOpacity:o}=i;t+=r.r+r.g+r.b+r.a+n,t+=s?s.r+s.g+s.b+s.a+o:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:n}=i;t+=e+r+n.r+n.g+n.b+n.a}return Le+++(t>=0?0:1)}(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,V.Vh),(0,V.wB)(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},V.Vh),e.resourceController.scheduler.registerTask(Lr.W6.OVERLAY_RENDERER,this)]);const i=this._camera;i.near=1,i.far=1e4,i.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=i,this._bindParameters.updateLighting(new Rr.$p((0,l.S)()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=(0,H.WD)(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const t=new Ne(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:t},this._techniques.precompile(Mr)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||(0,z.Bs)(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const t of this._renderers.values()){const i=t.getMaterialRenderer(e);if(i)return i}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),(0,F.Am)(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){const i=this._renderers.get(e);null!=i&&i.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles((0,V.wB)(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const t=this._renderers.get(e);null!=t&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&(0,j.bw)(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=(0,j.bw)(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=(0,j.bw)(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=(0,j.bw)(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t,i=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new J(this._stage.renderer.fboCache),this._overlays=[new q,new q]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t),this._bindParameters.overlayStretch=i}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=(0,z.Bs)(this._renderers,e=>e.hasOccluders)?Fr:1}_processDrapeSources(e,t){let i=!1;for(const[r,n]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&n.commitChanges()&&(i=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,i=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),i&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=(0,z.Bs)(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let t=!1;for(const i of this._renderers.values()){if(e.done)break;t=i.compact(e)||t}return t&&this.notifyChange("updating"),t}hasHighlight(e){return(0,z.Bs)(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!B.b.OVERLAY_DRAW_DEBUG_TEXTURE&&(0,z.mt)(this._renderers,e=>e.isEmpty)}get hasWater(){const e=(0,z.Bs)(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(B.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const t=this._overlays[0];for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;const i=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0);++this._techniques.precompiling;const r=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(i),r}_setOutput(e){const t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let t=!1;return this._renderers.forEach(i=>t=i.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const e of this._renderTargets.targets){if(1===e.content&&!this._needsColorWithoutRasterImage)continue;const{output:i}=e;this._setOutput(i),10===i&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);const r=this._renderContext.renderOccludedMask;4===e.content&&(this._renderContext.renderOccludedMask=Fr),this._sortedRenderers.forAll(({drapeSource:t,renderer:i})=>{1===e.content&&0===t.drapeSourceType||4===e.content&&i.hasOnlyOccluders||i.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const i=this.allSourcesOccluders;for(const e of this._renderTargets.targets){if((0!==e.content||!this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||1===e.content&&!this._needsColorWithoutRasterImage||4===e.content&&i)continue;const r=this._drawTarget(0,e),n=this._drawTarget(1,e);(r||n)&&e.fbo.generateMipMap()}}_drawTarget(e,t){const i=this._overlays[e],r=i.canvasGeometries;if(0===r.numViews)return!1;const n=this._view.state.contentPixelRatio;this._screenToWorldRatio=n*i.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:s,content:o}=t;if(this.isEmpty||4===s&&!this.hasWater||!i.hasSomeSizedView())return!1;const{_rctx:a,_camera:l,_renderContext:c,_bindParameters:u}=this;if(l.pixelRatio=i.pixelRatio*n,this._setOutput(s),u.screenToWorldRatio=this._screenToWorldRatio,u.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(c.renderOccludedMask=Fr),!this.renders(o))return c.renderOccludedMask=Zi,!1;const{resolution:h}=i,d=0===e,p=d?0:h;if(a.setViewport(p,0,h,h),this._bindTargetFBO(t),d&&(10===s?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384))),B.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(Ar,Nr);const t=this._techniques.get(Ar,Nr);for(let n=0;n<r.numViews;n++)this._setViewParameters(r.extents[n],i),this._ensureDebugPatternResources(i.resolution,Dr[e]),a.bindTechnique(t,u,this._passParameters),a.screen.draw()}if(10===s){const{fboCache:i}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),function(e,t,i,r,n,s,o=0){const{highlights:a}=n,l=a.length>1?t.acquire(i,r,"highlight mix",a.length>Ie?3:1):null,{gl:c}=e;if(l){const t=e.boundFramebuffer;e.bindFramebuffer(l.fbo),c.clearBufferuiv(c.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const u=l?.getTexture();n.highlightMixTexture=u,(0,ne.hZ)(n.highlightMixOrigin,o,0),a.forEach((t,a)=>{if(a>0){const t=Ae.A.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(u,t),e.setActiveTexture(t),c.copyTexSubImage2D(3553,0,0,0,o,0,i,r),e.bindTexture(null,t)}e.clear(256),n.highlightLevel=a,s()}),n.highlightLevel=null,n.highlightMixTexture=null,l?.release()}(a,i,r,r,u,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return a.bindFramebuffer(null),c.renderOccludedMask=Zi,!0}get allSourcesOccluders(){return(0,z.mt)(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){const i=this._overlays[e],r=i.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:n,renderer:s})=>{if(1===t.content&&0===n.drapeSourceType)return;const{fullOpacity:o}=n,a=null!=o&&o<1&&0===t.output&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],i),s.render(this._renderContext);if(a){this._bindTargetFBO(t),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const i=this._techniques.get(Mr);this._rctx.bindTechnique(i,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const t=this._resolution,i=2*t;e.fbo.ensureFramebuffer(i,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,t=2*e,i=this._stage.renderer.fboCache,r=i.acquire(t,e,"overlay tmp");return i.rctx.bindFramebuffer(r.fbo),i.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,t,i,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let n=0;for(const{renderer:s}of this._sortedRenderers)n=s.intersect?.(e,t,i,r,n)??n}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),t=e.length;this._renderers.forEach((i,r)=>{const n=e.indexOf(r.layer?.uid),s=n>=0,o=r.renderGroup??(s?0:1),a=r.drapeSourcePriorityOffset??0,l=t*o+(s?n:0)+a;this._sortedRenderers.push(new Ir(r,i,l))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){const i=this._camera;i.viewport=[0,0,t.resolution,t.resolution],(0,o.v3)(i.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],i.near,i.far),(0,o.kN)(i.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if((0,y.hZ)(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;const i=new Uint8Array(e*e*4);let r=0;for(let t=0;t<e;t++)for(let n=0;n<e;n++){const s=Math.floor(n/10),o=Math.floor(t/10);s<2||o<2||10*s>e-20||10*o>e-20?(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=255):(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=1&s&&1&o?1&n^1&t?0:255:1&s^1&o?0:128)}const n=new Ee.R(e);n.samplingMode=9728,this._passParameters.texture=new Ae.A(this._rctx,n,i)}get test(){}};(0,D.Cg)([(0,U.MZ)()],Pr.prototype,"hasHighlights",void 0),(0,D.Cg)([(0,U.MZ)()],Pr.prototype,"renderOccludedFlags",void 0),(0,D.Cg)([(0,U.MZ)()],Pr.prototype,"_sortedDrapeSourceRenderersDirty",void 0),(0,D.Cg)([(0,U.MZ)({constructOnly:!0})],Pr.prototype,"parent",void 0),(0,D.Cg)([(0,U.MZ)({readOnly:!0})],Pr.prototype,"_techniques",null),(0,D.Cg)([(0,U.MZ)({type:Boolean,readOnly:!0})],Pr.prototype,"updating",null),(0,D.Cg)([(0,U.MZ)()],Pr.prototype,"isEmpty",null),Pr=(0,D.Cg)([(0,U.$K)("esri.views.3d.terrain.OverlayRenderer")],Pr);class Ir{constructor(e,t,i){this.drapeSource=e,this.renderer=t,this.index=i}}const Dr=[[1,.5,.5],[.5,.5,1]],Fr=4,Nr=new Er;Nr.hasAlpha=!0;class zr{constructor(e,t,i,r){this.positions=e,this.polygonIndices=t,this.outline=i,this.projectionSuccess=r,this.count=e.length/3}get vertexCount(){return this.positions.length/3}get polygonIndexCount(){return this.polygonIndices.length}get outlineIndexCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=jr(e.outlineIndices[i]);return t}get outlineSegmentCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=jr(e.outlineIndices[i]);return t}}class Hr extends zr{}function Wr(e,t){const{projectIfNearlyVertical:i=!1,outlineOutput:n="none",method:o}=t??{},a="tessellated-indices"===n,l=S(e.rings,!!e.hasZ,e.spatialReference),c=function(e,t){const{hasZ:i,ccwRingsAsHoles:r,spatialReference:n}=t,o=t.axis??S(e,i,n),a=e.length,l=[],c=[],u=[],h=[],d=e.reduce((e,t)=>e+t.length,0);let p=0;const g=(0,s.jh)(3*d);let f=0;const m=r&&e[0]&&w(e[0],i,o);for(let t=a-1;t>=0;t--){const n=e[t],s=P(n,i);if(s<3){s>1&&h.push(n);continue}const a=!!r&&w(n,i,o);if(m?!a:a)l[p++]=n;else{let e=n.length;for(let t=0;t<p;++t)e+=l[t].length;const t={index:f,pathLengths:new Array(p+1),count:e,holeIndices:new Array(p)};t.pathLengths[0]=n.length,n.length>0&&u.push({index:f,count:n.length}),f=L(n,g,f,n.length,i,m);for(let e=0;e<p;++e){const r=l[e];t.holeIndices[e]=f,t.pathLengths[e+1]=r.length,r.length>0&&u.push({index:f,count:r.length}),f=L(r,g,f,r.length,i,m)}p=0,t.count>0&&c.push(t)}}const v=f;for(const e of h)u.push({index:f,count:e.length}),f=L(e,g,f,e.length,i,m);return{positions:3*f===g.length?g:(0,s.l5)(g,0,3*f),polygonVertexCount:v,polygons:c,outlines:u}}(e.rings,{hasZ:!!e.hasZ,ccwRingsAsHoles:!0,spatialReference:e.spatialReference,axis:l}),u=function(e,t){const i=function(e,t){const i={method:t?.method??"auto",projectionAxis:t?.projectionAxis??void 0,outlines:t?.outlines??void 0},{projectionAxis:r}=i,n=null!=r&&2!==r;n&&R(e.positions,r,2);const o=function(e,t){const i=Array();let r=0;for(const n of e.polygons){if("libtess"===t.method){const r=A(e,n,null!=t.outlines);if(!r.succeeded)return r;i.push(r);continue}const s=T(e,n,null!=t.outlines);if(r=Math.max(r,s.deviation),"auto"===t.method&&s.deviation>1e-5){const r=A(e,n,null!=t.outlines);if(!r.succeeded)return r;i.push(r)}else i.push(s)}return function(e,t,i,r,n){const o=null!=r;if(0===e.length){const e=(0,s.jh)(0),n=(0,m.my)(0),o=E(t,r,e,n,n),a={succeeded:!0,positions:o.positions,indices:n,outlineIndexBuffer:o.outlineIndexBuffer,outlineRingLengths:o.mergedOutlineRingLengths,vertexCount:o.positions.length/3};return"libtess"===i?{...a,method:"libtess"}:{...a,method:"earcut",deviation:0}}if(e.every(e=>"earcut"===e.method)){const i=Array();for(const t of e)for(let e=0;e<t.indices.length;e++)i.push(t.indices[e]+t.polygon.index);const{outlineIndexBuffer:s,outlineRingLengths:a}=o?O(r,t.positions):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,positions:t.positions,indices:(0,m.uW)(i),outlineIndexBuffer:s,outlineRingLengths:a,vertexCount:t.positions.length/3,method:"earcut",deviation:n}}if(1===e.length&&"libtess"===e[0].method){const i=e[0],n=E(t,r,i.positions,i.outlineIndexBuffer,i.outlineRingLengths);return{succeeded:!0,positions:n.positions,indices:i.indices,outlineIndexBuffer:n.outlineIndexBuffer,outlineRingLengths:n.mergedOutlineRingLengths,vertexCount:n.positions.length/3,method:"libtess"}}const a=e.reduce((e,t)=>e+t.vertexCount,0),l=e.reduce((e,t)=>e+t.indices.length,0),c=o?e.reduce((e,t)=>e+(t.outlineIndexBuffer?.length??0),0):0,u=o?e.reduce((e,t)=>e+(t.outlineRingLengths?.length??0),0):0,h=new Float64Array(3*a),d=new Uint32Array(l),p=o?new Uint32Array(c):void 0,g=o?new Uint32Array(u):void 0;let f=0,v=0,x=0,y=0;for(const t of e){h.set(t.positions,3*f);for(let e=0;e<t.indices.length;e++)d[v+e]=t.indices[e]+f;if(o&&null!=p&&null!=g){const e=t.outlineIndexBuffer,i=t.outlineRingLengths;if(null!=e&&null!=i){for(let t=0;t<e.length;t++)p[x+t]=e[t]+f;g.set(i,y),x+=e.length,y+=i.length}}f+=t.vertexCount,v+=t.indices.length}const _=E(t,r,h,p,g),b={succeeded:!0,positions:_.positions,indices:d,outlineIndexBuffer:_.outlineIndexBuffer,outlineRingLengths:_.mergedOutlineRingLengths,vertexCount:_.positions.length/3};return e.every(e=>"libtess"===e.method)?{...b,method:"libtess"}:{...b,method:"mixed",deviation:n}}(i,e,t.method,t.outlines,r)}(e,i);if(n){const t=o.succeeded?o.positions:null;null!=t&&t!==e.positions&&R(t,2,r),R(e.positions,2,r)}return o}(e,t);return i.succeeded?i:"libtess-not-loaded"===i.message?((0,h.gc)(C),async function(){try{await(0,g.l3)(),C.notify()}catch(e){throw e}}()):i}(c,{projectionAxis:i?l:void 0,outlines:a?c.outlines:void 0,method:o});if((0,r.$X)(u))return u;if(!u.succeeded)return null;let d={output:"none"};if("vertex-data"===n){const e=u.positions!==c.positions?c.positions:c.positions.slice();d={output:"vertex-data",outlines:Vr(c.outlines,e)}}else"tessellated-indices"===n&&(d=function(e){const{outlineIndexBuffer:t,outlineRingLengths:i}=e;if(null==t||null==i)return{output:"none"};const r=new Array(i.length);let n=0;for(let e=0;e<i.length;e++){const s=i[e],o=t.slice(n,n+s);r[e]=o,n+=s}return{output:"tessellated-indices",outlineIndices:r}}(u));return new Hr(u.positions,u.indices,d,!0)}function Vr(e,t,i=null){return e.filter(({count:e})=>e>1).map(({index:e,count:r})=>{const n=3*e,o=3*r;return null!=i?new Br(e,r,(0,s.l5)(t,n,o),(0,s.l5)(i,n,o)):new Ur(e,r,(0,s.l5)(t,n,o))})}function jr(e,t=0,i=e.length){return i>1&&e[t]===e[t+i-1]?i-1:i}class Ur{constructor(e,t,i){this.index=e,this.count=t,this.position=i}}class Br extends Ur{constructor(e,t,i,r){super(e,t,i),this.mapPositions=r}}},6733(e,t,i){i.d(t,{Q:()=>h});var r=i(37585),n=i(48163),s=i(31821),o=i(74333);class a extends o.n{constructor(e,t){super(e,"ivec2",1,(i,r,n)=>i.setUniform2iv(e,t(r,n)))}}var l=i(93588),c=i(9273),u=i(34053);function h(e){const{vertex:t}=e;t.uniforms.add(new c.R("coverageTexture",e=>e.coverageTexture),new a("highlightRenderCellCount",e=>(0,r.hZ)(d,e.horizontalCellCount,e.verticalCellCount)),new a("highlightTextureResolution",({highlightTexture:e})=>(0,r.hZ)(d,e.descriptor.width,e.descriptor.height)),new l.c("highlightLevel",e=>e.highlightLevel)).constants.add("cellSize","int",u.g),e.varyings.add("sUV","vec2"),e.varyings.add("vOutlinePossible","float"),t.code.add(s.H`const ivec2 cellVertices[4] = ivec2[4](ivec2(0,0), ivec2(1,0), ivec2(0,1), ivec2(1,1));`),t.main.add(s.H`int cellIndex = gl_InstanceID;
389
+ int cellX = cellIndex % highlightRenderCellCount[0];
390
+ int cellY = (cellIndex - cellX) / highlightRenderCellCount[0];
391
+ ivec2 cellPos = ivec2(cellX, cellY);
392
+ uvec2 covTexel = texelFetch(coverageTexture, cellPos, 0).rg;
393
+ int channelIndex = (highlightLevel >> 2) & 3;
394
+ uint channelValue = covTexel[channelIndex];
395
+ int highlightIndex = (highlightLevel & 3) << 1;
396
+ bool covered = ((channelValue >> highlightIndex) & 1u) == 1u;
397
+ if (!covered) {
398
+ gl_Position = vec4(0.0);
399
+ return;
400
+ }
401
+ vOutlinePossible = (((channelValue >> highlightIndex) & 2u) == 2u) ? 1.0 : 0.0;
402
+ ivec2 iPosInCell = cellVertices[gl_VertexID];
403
+ vec2 sPos = vec2(cellPos * cellSize + iPosInCell * (cellSize));
404
+ vec2 vPos = sPos / vec2(highlightTextureResolution);
405
+ sUV = vPos;
406
+ gl_Position = vec4(2.0 * vPos - vec2(1.0), 0.0, 1.0);`)}const d=(0,n.vt)()},84652(e,t,i){i.d(t,{s:()=>p});var r=i(58083),n=i(9093),s=i(43259),o=i(52587),a=i(77949),l=i(33079),c=i(20304),u=i(44887),h=i(31821),d=i(97102);function p(e,t){const{vertex:i,attributes:n}=e;i.uniforms.add(new c.m("intrinsicWidth",e=>e.width));const{hasScreenSizePerspective:p,spherical:f}=t;p?(e.include(o.Y6,t),(0,o.pM)(i),(0,a.yu)(i,t),i.uniforms.add(new d.S("inverseViewMatrix",(e,t)=>(0,r.B8)(g,(0,r.Tl)(g,t.camera.viewMatrix,e.origin)))),i.code.add(h.H`
407
+ float applyLineSizeScreenSizePerspective(float size, vec3 pos) {
408
+ vec3 worldPos = (inverseViewMatrix * vec4(pos, 1)).xyz;
409
+ vec3 groundUp = ${f?h.H`normalize(worldPos + localOrigin)`:h.H`vec3(0.0, 0.0, 1.0)`};
410
+ float absCosAngle = abs(dot(groundUp, normalize(worldPos - cameraPosition)));
411
+
412
+ return screenSizePerspectiveScaleFloat(size, absCosAngle, length(pos), screenSizePerspective);
413
+ }
414
+ `)):i.code.add(h.H`float applyLineSizeScreenSizePerspective(float size, vec3 pos) {
415
+ return size;
416
+ }`),t.hasVVSize?(n.add("sizeFeatureAttribute","float"),i.uniforms.add(new l.t("vvSizeMinSize",e=>e.vvSize.minSize),new l.t("vvSizeMaxSize",e=>e.vvSize.maxSize),new l.t("vvSizeOffset",e=>e.vvSize.offset),new l.t("vvSizeFactor",e=>e.vvSize.factor),new l.t("vvSizeFallback",e=>e.vvSize.fallback)),i.code.add(h.H`
417
+ float getSize(${(0,h.If)(p,"vec3 pos")}) {
418
+ float size = isnan(sizeFeatureAttribute)
419
+ ? vvSizeFallback.x
420
+ : intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x;
421
+
422
+ return ${(0,h.If)(p,"applyLineSizeScreenSizePerspective(size, pos)","size")};
423
+ }
424
+ `)):(n.add("size","float"),i.code.add(h.H`
425
+ float getSize(${(0,h.If)(p,"vec3 pos")}) {
426
+ float fullSize = intrinsicWidth * size;
427
+ return ${(0,h.If)(p,"applyLineSizeScreenSizePerspective(fullSize, pos)","fullSize")};
428
+ }
429
+ `)),t.hasVVOpacity?(n.add("opacityFeatureAttribute","float"),i.constants.add("vvOpacityNumber","int",8),i.uniforms.add(new u.x("vvOpacityValues",8,e=>e.vvOpacity.values),new u.x("vvOpacityOpacities",8,e=>e.vvOpacity.opacityValues),new c.m("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),i.code.add(h.H`
430
+ float interpolateOpacity(float value) {
431
+ if (value <= vvOpacityValues[0]) {
432
+ return vvOpacityOpacities[0];
433
+ }
434
+
435
+ for (int i = 1; i < vvOpacityNumber; ++i) {
436
+ if (vvOpacityValues[i] >= value) {
437
+ float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]);
438
+ return mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f);
439
+ }
440
+ }
441
+
442
+ return vvOpacityOpacities[vvOpacityNumber - 1];
443
+ }
444
+
445
+ vec4 applyOpacity(vec4 color) {
446
+ if (isnan(opacityFeatureAttribute)) {
447
+ // If there is a color vv then it will already have taken care of applying the fallback
448
+ return ${(0,h.If)(t.hasVVColor,"color","vec4(color.rgb, vvOpacityFallback)")};
449
+ }
450
+
451
+ return vec4(color.rgb, interpolateOpacity(opacityFeatureAttribute));
452
+ }
453
+ `)):i.code.add(h.H`vec4 applyOpacity(vec4 color) {
454
+ return color;
455
+ }`),t.hasVVColor?(e.include(s.A,t),n.add("colorFeatureAttribute","float"),i.code.add(h.H`vec4 getColor() {
456
+ vec4 color = interpolateVVColor(colorFeatureAttribute);
457
+ if (isnan(color.r)) {
458
+ return vec4(0);
459
+ }
460
+ return applyOpacity(color);
461
+ }`)):(n.add("color","vec4"),i.code.add(h.H`vec4 getColor() {
462
+ return applyOpacity(color);
463
+ }`))}const g=(0,n.vt)()},2923(e,t,i){i.d(t,{q:()=>m,h:()=>v});var r=i(27950),n=i(66269),s=i(77949),o=i(71988),a=i(33094),l=i(20304),c=i(31821),u=i(63761),h=i(96095);function d(e){if(null==e)return 1;const t=function(e){return e.pattern.map(t=>Math.round(t*e.pixelRatio))}(e);return Math.floor(t.reduce((e,t)=>e+t))}i(63907),i(21231),i(67171);var p=i(78955),g=i(91829);const f=(0,g.vt)();function m(e,t){if(!t.stippleEnabled)return void e.fragment.code.add(c.H`float getStippleAlpha(float lineWidth) { return 1.0; }
464
+ void discardByStippleAlpha(float stippleAlpha, float threshold) {}
465
+ vec4 blendStipple(vec4 color, float stippleAlpha) { return color; }`);const i=!(t.draped&&t.stipplePreferContinuous),{vertex:h,fragment:d}=e;t.draped||((0,s.yu)(h,t),h.uniforms.add(new a.U("worldToScreenPerDistanceRatio",({camera:e})=>1/e.perScreenPixelRatio)).code.add(c.H`float computeWorldToScreenRatio(vec3 segmentCenter) {
466
+ float segmentDistanceToCamera = length(segmentCenter - cameraPosition);
467
+ return worldToScreenPerDistanceRatio / segmentDistanceToCamera;
468
+ }`)),e.varyings.add("vStippleDistance","float"),e.varyings.add("vStippleDistanceLimits","vec2"),e.varyings.add("vStipplePatternStretch","float"),h.code.add(c.H`
469
+ float discretizeWorldToScreenRatio(float worldToScreenRatio) {
470
+ float step = ${c.H.float(x)};
471
+
472
+ float discreteWorldToScreenRatio = log(worldToScreenRatio);
473
+ discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step;
474
+ discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio);
475
+ return discreteWorldToScreenRatio;
476
+ }
477
+ `),(0,s.Nz)(h),h.code.add(c.H`
478
+ vec2 computeStippleDistanceLimits(float startPseudoScreen, float segmentLengthPseudoScreen, float segmentLengthScreen, float patternLength) {
479
+
480
+ // First check if the segment is long enough to support fully screen space patterns.
481
+ // Force sparse mode for segments that are very large in screen space even if it is not allowed,
482
+ // to avoid imprecision from calculating with large floats.
483
+ if (segmentLengthPseudoScreen >= ${i?"patternLength":"1e4"}) {
484
+ // Round the screen length to get an integer number of pattern repetitions (minimum 1).
485
+ float repetitions = segmentLengthScreen / (patternLength * pixelRatio);
486
+ float flooredRepetitions = max(1.0, floor(repetitions + 0.5));
487
+ float segmentLengthScreenRounded = flooredRepetitions * patternLength;
488
+
489
+ float stretch = repetitions / flooredRepetitions;
490
+
491
+ // We need to impose a lower bound on the stretch factor to prevent the dots from merging together when there is only 1 repetition.
492
+ // 0.75 is the lowest possible stretch value for flooredRepetitions > 1, so it makes sense as lower bound.
493
+ vStipplePatternStretch = max(0.75, stretch);
494
+
495
+ return vec2(0.0, segmentLengthScreenRounded);
496
+ }
497
+ return vec2(startPseudoScreen, startPseudoScreen + segmentLengthPseudoScreen);
498
+ }
499
+ `),d.uniforms.add(new u.N("stipplePatternTexture",e=>e.stippleTexture),new l.m("stipplePatternPixelSizeInv",e=>1/v(e))),t.stippleOffColorEnabled&&d.uniforms.add(new o.E("stippleOffColor",e=>{return null==(t=e.stippleOffColor)?g.uY:4===t.length?t:(0,p.hZ)(f,t[0],t[1],t[2],1);var t})),e.include(n.m),t.worldSizedImagePattern?(e.varyings.add("vStippleV","float"),e.fragment.include(r.N),d.code.add(c.H`vec4 getStippleColor(out bool isClamped) {
500
+ vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w;
501
+ isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;
502
+ float u = vStippleDistance * stipplePatternPixelSizeInv;
503
+ float v = vStippleV == -1.0 ? 0.5 : vStippleV;
504
+ return texture(stipplePatternTexture, vec2(u, v));
505
+ }
506
+ vec4 getStippleColor() {
507
+ bool ignored;
508
+ return getStippleColor(ignored);
509
+ }
510
+ float getStippleSDF() {
511
+ vec4 color = getStippleColor();
512
+ return color.a == 0.0 ? -0.5 : 0.5;
513
+ }
514
+ float getStippleAlpha(float lineWidth) {
515
+ return getStippleColor().a;
516
+ }
517
+ vec4 blendStipple(vec4 color, float stippleAlpha) {
518
+ vec4 stippleColor = getStippleColor();
519
+ int mixMode = 1;
520
+ vec3 col = mixExternalColor(color.rgb, vec3(1.0), stippleColor.rgb, mixMode);
521
+ float opacity = mixExternalOpacity(color.a, 1.0, stippleColor.a, mixMode);
522
+ return vec4(col, opacity);
523
+ }`)):d.code.add(c.H`
524
+ float getStippleSDF(out bool isClamped) {
525
+ float stippleDistanceClamped = noPerspectiveRead(clamp(vStippleDistance, vStippleDistanceLimits.x, vStippleDistanceLimits.y));
526
+ float lineSizeInv = noPerspectiveRead(vLineSizeInv);
527
+
528
+ vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w;
529
+ isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;
530
+
531
+ float u = stippleDistanceClamped * stipplePatternPixelSizeInv * lineSizeInv;
532
+ u = fract(u);
533
+
534
+ float sdf = texture(stipplePatternTexture, vec2(u, 0.5)).r;
535
+
536
+ return (sdf - 0.5) * vStipplePatternStretch + 0.5;
537
+ }
538
+
539
+ float getStippleSDF() {
540
+ bool ignored;
541
+ return getStippleSDF(ignored);
542
+ }
543
+
544
+ float getStippleAlpha(float lineWidth) {
545
+ bool isClamped;
546
+ float stippleSDF = getStippleSDF(isClamped);
547
+ float antiAliasedResult = clamp(stippleSDF * lineWidth + 0.5, 0.0, 1.0);
548
+ return isClamped ? floor(antiAliasedResult + 0.5) : antiAliasedResult;
549
+ }
550
+
551
+ vec4 blendStipple(vec4 color, float stippleAlpha) {
552
+ return ${t.stippleOffColorEnabled?"mix(color, stippleOffColor, stippleAlpha)":"vec4(color.rgb, color.a * stippleAlpha)"};
553
+ }
554
+ `),d.code.add(c.H`
555
+ void discardByStippleAlpha(float stippleAlpha, float threshold) {
556
+ ${(0,c.If)(!t.stippleOffColorEnabled,"if (stippleAlpha < threshold) { discard; }")}
557
+ }
558
+ `)}function v(e){const t=e.stipplePattern;return(0,h.sL)(t)?t.length:t?d(t)/t.pixelRatio:1}const x=.4},28974(e,t,i){i.d(t,{r:()=>a});var r=i(91829);i(18845),i(63907);(0,r.CN)(.25,.25,.75,.75),i(21231),i(67171);var n=i(77949),s=i(33094),o=i(31821);function a(e,t){const i=e.vertex,r=t.hasScreenSizePerspective;(0,n.Nz)(i),null==i.uniforms.get("markerScale")&&i.constants.add("markerScale","float",1),i.constants.add("markerSizePerLineWidth","float",10).code.add(o.H`
559
+ float getLineWidth(${(0,o.If)(r,"vec3 pos")}) {
560
+ return max(getSize(${(0,o.If)(r,"pos")}), 1.0) * pixelRatio;
561
+ }
562
+
563
+ float getScreenMarkerSize(float lineWidth) {
564
+ return markerScale * markerSizePerLineWidth * lineWidth;
565
+ }
566
+ `),2===t.space&&(i.constants.add("maxSegmentLengthFraction","float",.45),i.uniforms.add(new s.U("perRenderPixelRatio",e=>e.camera.perRenderPixelRatio)),i.code.add(o.H`
567
+ bool areWorldMarkersHidden(vec3 pos, vec3 other) {
568
+ vec3 midPoint = mix(pos, other, 0.5);
569
+ float distanceToCamera = length(midPoint);
570
+ float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
571
+ float worldMarkerSize = getScreenMarkerSize(getLineWidth(${(0,o.If)(r,"pos")})) * screenToWorldRatio;
572
+ float segmentLen = length(pos - other);
573
+ return worldMarkerSize > maxSegmentLengthFraction * segmentLen;
574
+ }
575
+
576
+ float getWorldMarkerSize(vec3 pos) {
577
+ float distanceToCamera = length(pos);
578
+ float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
579
+ return getScreenMarkerSize(getLineWidth(${(0,o.If)(r,"pos")})) * screenToWorldRatio;
580
+ }
581
+ `))}},82094(e,t,i){i.d(t,{Z:()=>r});const r=i(31821).H`vec4(0.0, 0.0, 2.0, 1.0)`},66269(e,t,i){function r(e){e.vertex.code.add("#define noPerspectiveWrite(x, w) (x * w)")}function n(e){e.fragment.code.add("#define noPerspectiveRead(x) (x * gl_FragCoord.w)")}i.d(t,{F:()=>r,m:()=>n})},9273(e,t,i){i.d(t,{R:()=>n});var r=i(74333);class n extends r.n{constructor(e,t){super(e,"usampler2D",1,(i,r,n)=>i.bindTexture(e,t(r,n)))}}},78230(e,t,i){i.d(t,{x:()=>h});var r=i(93687),n=i(15142),s=i(35522),o=i(51850),a=i(82919),l=i(71351),c=i(94008),u=i(620);class h{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,t){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new d,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}destroy(){this._degenerateObjects.clear(),d.clearPool(),R[0]=null,I.prune(),H.prune()}add(e){const t=Array.from(e);this._grow(t);const i=d.acquire();for(const e of t)++this._objectCount,this._isDegenerate(e)?this._degenerateObjects.add(e):(i.init(this._root),this._add(e,i));d.release(i)}remove(e,t=null){this._objectCount-=e.length;const i=d.acquire();for(const r of e){const e=t??this.objectToBoundingSphere(r);C(e.radius)?(i.init(this._root),f(r,e,i)):this._degenerateObjects.delete(r)}d.release(i),this._shrink()}update(e,t){if(!C(t.radius)&&this._isDegenerate(e))return;const i=function(e){return R[0]=e,R}(e);this.remove(i,t),this.add(i)}forEachAlongRay(e,t,i){const r=(0,l.LV)(e,t);p(this._root,e=>{if(!function(e,t){return _(t.bounds.center,2*-t.halfSize,L),_(t.bounds.center,2*t.halfSize,P),(0,u.O_)(e.origin,e.direction,L,P)}(r,e))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObject(r,e)&&i(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObject(r,e)&&i(e)}),!0})}forEachAlongRayWithVerticalOffset(e,t,i,r){const n=(0,l.LV)(e,t);p(this._root,e=>{if(!function(e,t,i){return _(t.bounds.center,2*-t.halfSize,L),_(t.bounds.center,2*t.halfSize,P),i.applyToMinMax(L,P),(0,u.O_)(e.origin,e.direction,L,P)}(n,e,r))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObjectWithOffset(n,e,r)&&i(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObjectWithOffset(n,e,r)&&i(e)}),!0})}forEach(e){p(this._root,t=>{const i=t.node;return i.terminals.forAll(e),null!==i.residents&&i.residents.forAll(e),!0}),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,i,r=()=>!0,n=1/0){let o=1/0,l=1/0,c=null;const u=S(e,t),h=s=>{if(--n,!r(s))return;const u=this.objectToBoundingSphere(s);if(!(0,a.m7)(i,u))return;const h=w(e,t,u.center),d=h-u.radius,p=h+u.radius;d<o&&(o=d,l=p,c=s)};return g(this._root,r=>{if(n<=0||!(0,a.m7)(i,r.bounds))return!1;if((0,s.hs)(M,u,r.halfSize),(0,s.WQ)(M,M,r.bounds.center),w(e,t,M)>l)return!1;const o=r.node;return o.terminals.forAll(e=>h(e)),null!==o.residents&&o.residents.forAll(e=>h(e)),!0},e,t),c}forEachInDepthRange(e,t,i,r,n,o,l){let c=-1/0,u=1/0;const h={setRange:e=>{1===i?(c=Math.max(c,e.near),u=Math.min(u,e.far)):(c=Math.max(c,-e.far),u=Math.min(u,-e.near))}};h.setRange(r);const d=w(t,i,e),p=S(t,i),f=S(t,-i),m=e=>{if(!l(e))return;const r=this.objectToBoundingSphere(e),s=w(t,i,r.center)-d,p=s-r.radius,g=s+r.radius;p>u||g<c||!(0,a.m7)(o,r)||n(e,h)};g(this._root,e=>{if(!(0,a.m7)(o,e.bounds))return!1;if((0,s.hs)(M,p,e.halfSize),(0,s.WQ)(M,M,e.bounds.center),w(t,i,M)-d>u)return!1;if((0,s.hs)(M,f,e.halfSize),(0,s.WQ)(M,M,e.bounds.center),w(t,i,M)-d<c)return!1;const r=e.node;return r.terminals.forAll(e=>m(e)),null!==r.residents&&r.residents.forAll(e=>m(e)),!0},t,i)}forEachNode(e){p(this._root,t=>e(t.node,t.bounds,t.halfSize,t.depth))}forEachNeighbor(e,t){const i=t.radius,r=t.center,n=t=>{const n=this.objectToBoundingSphere(t),o=n.radius,a=i+o;return!((0,s.hG)(n.center,r)-a*a<=0)||e(t)};let o=!0;const a=e=>{o&&(o=n(e))};p(this._root,e=>{const t=e.bounds.radius,n=i+t;if((0,s.hG)(e.bounds.center,r)-n*n>0)return!1;const l=e.node;return l.terminals.forAll(a),o&&null!==l.residents&&l.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsObject(e,t){const i=this.objectToBoundingSphere(t);return!(i.radius>0)||i.intersectRay(e)}_intersectsObjectWithOffset(e,t,i){const r=this.objectToBoundingSphere(t);return!(r.radius>0)||i.applyToBoundingSphere(r).intersectRay(e)}_add(e,t){t.advanceTo(this.objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let i=0;i<t.length;i++){const r=d.acquire().init(e);this._add(t.at(i),r),d.release(r)}}_grow(e){if(b(e,e=>this.objectToBoundingSphere(e),D),C(D.radius)&&!this._fitsInsideTree(D))if(v(this._root.node))this._root.bounds.copyFrom(D),this._root.halfSize=1.25*this._root.bounds.radius,this._root.updateBoundsRadiusFromHalfSize();else{const e=this._rootBoundsForRootAsSubNode(D);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(D,e):this._growRootAsSubNode(e),d.release(e)}}_rebuildTree(e,t){F.center=t.bounds.center,F.radius=t.halfSize,b([e,F],e=>e,N);const i=d.acquire().init(this._root);this._root.initFrom(null,N,N.radius),this._root.increaseHalfSize(1.25),p(i,e=>(this.add(e.node.terminals.data),null!==e.node.residents&&this.add(e.node.residents.data),!0)),d.release(i)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let i=0;return p(this._root,e=>(i=Math.max(i,e.depth),i+t<=this._maximumDepth)),i+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e.radius,i=e.center;let r=-1/0;const n=this._root.bounds.center,s=this._root.halfSize;for(let e=0;e<3;e++){const o=n[e]-s-(i[e]-t),a=i[e]+t-(n[e]+s),l=Math.max(0,Math.ceil(o/(2*s))),c=Math.max(0,Math.ceil(a/(2*s)))+1,u=2**Math.ceil(Math.log(l+c)*Math.LOG2E);r=Math.max(r,u),z[e].min=l,z[e].max=c}for(let e=0;e<3;e++){let t=z[e].min,i=z[e].max;const o=(r-(t+i))/2;t+=Math.ceil(o),i+=Math.floor(o);const a=n[e]-s-t*s*2;O.center[e]=a+(i+t)*s}const o=r*s;return O.radius=o*E,d.acquire().initFrom(null,O,o,0)}_growRootAsSubNode(e){const t=this._root.node;D.center=this._root.bounds.center,D.radius=this._root.halfSize,this._root.init(e),e.advanceTo(D,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let i=0,r=0;for(;r<t.length&&null==e;)i=r++,e=t[i];for(;r<t.length;)if(t[r++])return-1;return i}_isDegenerate(e){return!C(this.objectToBoundingSphere(e).radius)}_fitsInsideTree(e){const t=this._root.bounds,i=this._root.halfSize;return e.radius<=i&&e.center[0]>=t.center[0]-i&&e.center[0]<=t.center[0]+i&&e.center[1]>=t.center[1]-i&&e.center[1]<=t.center[1]+i&&e.center[2]>=t.center[2]-i&&e.center[2]<=t.center[2]+i}_nodeToJSON(e){const t=e.children.map(e=>e?this._nodeToJSON(e):null),i=e.residents?.map(e=>this.objectToBoundingSphere(e)),r=e.terminals?.map(e=>this.objectToBoundingSphere(e));return{children:t,residents:i,terminals:r}}}class d{constructor(){this.bounds=new c.iy,this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,t,i,r=this.depth){return this.node=null!=e?e:d.createEmptyNode(),t&&this.bounds.copyFrom(t),this.halfSize=i,this.depth=r,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds.radius=this.halfSize*E}advance(e){let t=this.node.children[e];t||(t=d.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const i=T[e];return this.bounds.center[0]+=i[0]*this.halfSize,this.bounds.center[1]+=i[1]*this.halfSize,this.bounds.center[2]+=i[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,t,i=!1){for(;;){if(this.isTerminalFor(e))return t?.(this,-1),!0;if(this.isLeaf()){if(!i)return t?.(this,-1),!1;this.node.residents=null}const r=this._childIndex(e);t?.(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e.radius>this.halfSize/2}_childIndex(e){const t=this.bounds.center;return(t[0]<e.center[0]?1:0)+(t[1]<e.center[1]?2:0)+(t[2]<e.center[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new n.A({shrink:!0}),residents:new n.A({shrink:!0})}}static{this._pool=new r.A(()=>new d)}static acquire(){return d._pool.acquire()}static release(e){d._pool.release(e)}static clearPool(){d._pool.prune()}}function p(e,t){let i=d.acquire().init(e);const r=[i];for(;0!==r.length;){if(i=r.pop(),t(i)&&!i.isLeaf())for(let e=0;e<i.node.children.length;e++)i.node.children[e]&&r.push(d.acquire().init(i).advance(e));d.release(i)}}function g(e,t,i,r=1){let n=d.acquire().init(e);const s=[n];for(function(e,t,i){if(!H.length)for(let e=0;e<8;++e)H.push({index:0,distance:0});for(let i=0;i<8;++i){const r=T[i];H.data[i].index=i,H.data[i].distance=w(e,t,r)}H.sort((e,t)=>e.distance-t.distance);for(let e=0;e<8;++e)i[e]=H.data[e].index}(i,r,W);0!==s.length;){if(n=s.pop(),t(n)&&!n.isLeaf())for(let e=7;e>=0;--e){const t=W[e];n.node.children[t]&&s.push(d.acquire().init(n).advance(t))}d.release(n)}}function f(e,t,i){I.clear();const r=i.advanceTo(t,(e,t)=>{I.push(e.node),I.push(t)})?i.node.terminals:i.node.residents;if(r.removeUnordered(e),0===r.length)for(let e=I.length-2;e>=0&&m(I.data[e],I.data[e+1]);e-=2);}function m(e,t){return t>=0&&(e.children[t]=null),!!v(e)&&(null===e.residents&&(e.residents=new n.A({shrink:!0})),!0)}function v(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}function x(e,t){e[0]=Math.min(e[0],t.center[0]-t.radius),e[1]=Math.min(e[1],t.center[1]-t.radius),e[2]=Math.min(e[2],t.center[2]-t.radius)}function y(e,t){e[0]=Math.max(e[0],t.center[0]+t.radius),e[1]=Math.max(e[1],t.center[1]+t.radius),e[2]=Math.max(e[2],t.center[2]+t.radius)}function _(e,t,i){i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t}function b(e,t,i){L[0]=1/0,L[1]=1/0,L[2]=1/0,P[0]=-1/0,P[1]=-1/0,P[2]=-1/0;for(const i of e){const e=t(i);C(e.radius)&&(x(L,e),y(P,e))}(0,s.Cc)(i.center,L,P,.5),i.radius=Math.max(P[0]-L[0],P[1]-L[1],P[2]-L[2])/2}function S(e,t){let i,r=1/0;for(let n=0;n<8;++n){const s=w(e,t,A[n]);s<r&&(r=s,i=A[n])}return i}function w(e,t,i){return t*(e[0]*i[0]+e[1]*i[1]+e[2]*i[2])}function C(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}const T=[(0,o.fA)(-1,-1,-1),(0,o.fA)(1,-1,-1),(0,o.fA)(-1,1,-1),(0,o.fA)(1,1,-1),(0,o.fA)(-1,-1,1),(0,o.fA)(1,-1,1),(0,o.fA)(-1,1,1),(0,o.fA)(1,1,1)],A=[(0,o.fA)(-1,-1,-1),(0,o.fA)(-1,-1,1),(0,o.fA)(-1,1,-1),(0,o.fA)(-1,1,1),(0,o.fA)(1,-1,-1),(0,o.fA)(1,-1,1),(0,o.fA)(1,1,-1),(0,o.fA)(1,1,1)],E=Math.sqrt(3),R=[null],O=new c.iy,M=(0,o.vt)(),L=(0,o.vt)(),P=(0,o.vt)(),I=new n.A,D=new c.iy,F=new c.iy,N=new c.iy,z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],H=new n.A,W=[0,0,0,0,0,0,0,0]},52728(e,t,i){i.d(t,{m:()=>m});var r=i(63907);class n{constructor(e){this.internalFormat=e,this.channelByteStride=4,this.dataType=r.ld.UNSIGNED_INT,this.elementArrayConstructor=Uint32Array,this.pixelFormat=o[e],this.channels=s[this.pixelFormat],this.byteStride=this.channelByteStride*this.channels}}const s={36244:1,33320:2,36249:4},o={[r.H0.R32UI]:36244,[r.H0.RG32UI]:33320,[r.H0.RGBA32UI]:36249},a=[new n(r.H0.RGBA32UI),new n(r.H0.RG32UI),new n(r.H0.R32UI)];function l(e){let t=1/0,i=null;for(const r of a){const n=r.byteStride,s=(n-e%n)%n;s<t&&(t=s,i=r)}return i??a[2]}var c=i(20498),u=i(13030),h=i(90239);class d{constructor(e,t,i){this.elementCount=e,this.elementType=t,this.bufferViewConstructor=i,this.byteSize=function(e){return(0,h.GJ)(e.ElementType)*e.ElementCount}(i)}}const p={u8:new d(1,"uint",u.SL),vec4u8:new d(4,"uint",u.XP),unorm8:new d(1,"float",u.dy),vec4unorm8:new d(4,"float",u.td),snorm16:new d(1,"float",u.Qy),vec2snorm16:new d(2,"float",u.ES),f16:new d(1,"float",c.SX?u.XW:u.Y$),vec4f16:new d(4,"float",c.SX?u.jz:u.Eq),f32:new d(1,"float",u.Y$),vec2f32:new d(2,"float",u.gH),vec3f32:new d(3,"float",u.xs),vec4f32:new d(4,"float",u.Eq),mat3f32:new d(9,"float",u.jZ)};class g{constructor(e,t,i,r){this._declaration=e,this._byteOffset=t,this._creationInfo=r,this._startTexel=Math.floor(t/i);const n=r.byteSize;this._numTexels=Math.ceil((t+n)/i)-this._startTexel,this._texelByteStride=i}get name(){return this._declaration.name}get fieldType(){return this._declaration.type}get byteOffset(){return this._byteOffset}get startTexel(){return this._startTexel}get numTexels(){return this._numTexels}get texelByteStride(){return this._texelByteStride}get elementType(){return this._creationInfo.elementType}get elementCount(){return this._creationInfo.elementCount}get byteSize(){return this._creationInfo.byteSize}get bufferViewConstructor(){return this._creationInfo.bufferViewConstructor}}class f{constructor(e,t,i,r=0){this.layout=e,this.byteOffset=r,this._bufferViews=new Map,this.buffer="number"==typeof t?new ArrayBuffer(t*e.byteStride):t,this.texelElementBuffer=new i(this.buffer,r);const n=this._bufferViews;for(const[e,t]of this.layout.fields)n.set(e,new t.bufferViewConstructor(this.buffer,r+t.byteOffset,this.layout.byteStride))}get stride(){return this.layout.byteStride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const i=this._bufferViews.get(e);return null!=i&&i.elementCount===t.ElementCount&&i.elementType===t.ElementType?i:null}get usedMemory(){return this.byteLength}}class m{constructor(e){this._fields=new Map;let t=0;const i=[];for(let r=0;r<e.length;++r){const n=e[r],{type:s}=n,o=p[s];i.push({declaration:n,byteOffset:t,creationInfo:o}),t+=o.byteSize}this.texelFormatInfo=l(t);const{texelByteStride:r}=this;t=Math.ceil(t/r)*r;const n=t,s=this._fields;for(const{declaration:e,byteOffset:t,creationInfo:n}of i)s.set(e.name,new g(e,t,r,n));this.byteStride=n,this.texelStride=Math.ceil(n/r)}get texelByteStride(){return this.texelFormatInfo.byteStride}get texelElementArrayConstructor(){return this.texelFormatInfo.elementArrayConstructor}get stride(){return this.byteStride}get fields(){return this._fields}createBuffer(e){return new f(this,e,this.texelElementArrayConstructor)}createView(e,t){return new f(this,e,this.texelElementArrayConstructor,t)}}},96095(e,t,i){i.d(t,{sL:()=>r}),i(13069);function r(e){return null!=e&&"image"in e}},54073(e,t,i){i.d(t,{Q:()=>h});var r=i(37585),n=i(48163),s=i(78659);const o=(0,s.Kp)(1),a=(0,s.Kp)(1);var l=i(47286),c=i(20304),u=i(31821);function h(e,t){const{hasAnimation:i,animation:n}=t;if(!i)return;const{attributes:s,varyings:h,vertex:p,fragment:g}=e;s.add("timeStamps","vec4"),h.add("vTimeStamp","float"),h.add("vFirstTime","float"),h.add("vLastTime","float"),h.add("vTransitionType","float"),p.main.add(u.H`vTimeStamp = timeStamps.x;
582
+ vFirstTime = timeStamps.y;
583
+ vLastTime = timeStamps.z;
584
+ vTransitionType = timeStamps.w;`),3===n&&g.constants.add("decayRate","float",2.3),g.code.add(u.H`
585
+ float getTrailOpacity(float x) {
586
+ if (x < 0.0) {
587
+ return 0.0;
588
+ }
589
+
590
+ ${function(e){switch(e){case 2:return"return x >= 0.0 && x <= 1.0 ? 1.0 : 0.0;";case 3:return"float cutOff = exp(-decayRate);\n return (exp(-decayRate * x) - cutOff) / (1.0 - cutOff);";default:return"return 1.0;"}}(n)}
591
+ }`),g.uniforms.add(new c.m("timeElapsed",e=>e.timeElapsed),new c.m("trailLength",e=>e.trailLength),new c.m("speed",e=>e.animationSpeed),new l.G("startEndTime",e=>(0,r.hZ)(d,e.startTime,e.endTime))),g.constants.add("fadeInTime","float",a),g.constants.add("fadeOutTime","float",o),g.constants.add("incomingTransition","int",0),g.constants.add("outgoingTransition","int",2),g.code.add(u.H`float fadeIn(float x) {
592
+ return smoothstep(0.0, fadeInTime, x);
593
+ }
594
+ float fadeOut(float x) {
595
+ return isinf(fadeOutTime) ? 1.0 : smoothstep(fadeOutTime, 0.0, x);
596
+ }
597
+ void updateAlphaIf(inout float alpha, bool condition, float newAlpha) {
598
+ alpha = condition ? min(alpha, newAlpha) : alpha;
599
+ }
600
+ vec4 animate(vec4 color) {
601
+ float startTime = startEndTime[0];
602
+ float endTime = startEndTime[1];
603
+ float totalTime = vLastTime - vFirstTime;
604
+ float actualFadeOutTime = min(fadeOutTime * speed, trailLength);
605
+ float longStreamlineThreshold = (fadeInTime + 1.0) * speed + actualFadeOutTime;
606
+ bool longStreamline = totalTime > longStreamlineThreshold;
607
+ float totalTimeWithFadeOut = longStreamline && actualFadeOutTime != trailLength ? totalTime : totalTime + actualFadeOutTime;
608
+ float fadeOutStartTime = longStreamline ? totalTime - actualFadeOutTime : totalTime;
609
+ float originTime = -vFirstTime;
610
+ float actualEndTime = int(vTransitionType) == outgoingTransition ? min(endTime, startTime + vLastTime / speed) : endTime;
611
+ vec4 animatedColor = color;
612
+ if (speed == 0.0) {
613
+ float alpha = getTrailOpacity((totalTimeWithFadeOut - (vTimeStamp - vFirstTime)) / trailLength);
614
+ updateAlphaIf(alpha, !isinf(actualEndTime), fadeOut(timeElapsed - actualEndTime));
615
+ updateAlphaIf(alpha, true, fadeIn(timeElapsed - startTime));
616
+ animatedColor.a *= alpha;
617
+ return animatedColor;
618
+ }
619
+ float relativeStartTime = mod(startTime, totalTimeWithFadeOut);
620
+ float shiftedTimeElapsed = timeElapsed - relativeStartTime + originTime;
621
+ float headRelativeToFirst = mod(shiftedTimeElapsed * speed, totalTimeWithFadeOut);
622
+ float vRelativeToHead = headRelativeToFirst - originTime - vTimeStamp;
623
+ float vAbsoluteTime = timeElapsed - vRelativeToHead / speed;
624
+ if (startTime > timeElapsed) {
625
+ return vec4(0.0);
626
+ }
627
+ float alpha = getTrailOpacity(vRelativeToHead / trailLength);
628
+ updateAlphaIf(alpha, true, fadeIn(timeElapsed - startTime));
629
+ updateAlphaIf(alpha, !isinf(actualEndTime), fadeOut(timeElapsed - actualEndTime));
630
+ updateAlphaIf(alpha, int(vTransitionType) != incomingTransition, step(startTime, vAbsoluteTime));
631
+ updateAlphaIf(alpha, headRelativeToFirst > fadeOutStartTime, fadeOut((headRelativeToFirst - fadeOutStartTime) / speed));
632
+ alpha *= fadeIn(vTimeStamp - vFirstTime);
633
+ animatedColor.a *= alpha;
634
+ return animatedColor;
635
+ }`)}const d=(0,n.vt)()},7298(e,t,i){i.d(t,{bP:()=>s,hl:()=>o,qB:()=>a});var r=i(1843),n=i(16943);function s(e){const t=(0,r.BP)().u32("textureElementIndex",{integer:!0}).vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),(0,n.E)()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}const o=new(i(52728).m)([{type:"vec3f32",name:"position"}]);function a(e){return o}},11435(e,t,i){i.d(t,{W:()=>H});var r=i(24326),n=i(5482),s=i(34275),o=i(20498),a=i(33094),l=i(31821),c=i(51976);function u(e){switch(e.elementType){case"float":switch(e.elementCount){case 1:return l.H`float`;case 2:return l.H`vec2`;case 3:return l.H`vec3`;case 4:return l.H`vec4`;case 9:return l.H`mat3`;default:e.elementCount}break;case"int":switch(e.elementCount){case 1:return l.H`int`;case 2:return l.H`ivec2`;case 3:return l.H`ivec3`;case 4:return l.H`ivec4`;case 9:throw new Error("Invalid element count 9 for type int");default:e.elementCount}break;case"uint":switch(e.elementCount){case 1:return l.H`uint`;case 2:return l.H`uvec2`;case 3:return l.H`uvec3`;case 4:return l.H`uvec4`;case 9:throw new Error("Invalid element count 9 for type uint");default:e.elementCount}break;default:e.elementType}throw new Error("unsupported field")}const h=new a.U("constNaN",()=>NaN,{supportsNaN:!0});class d extends c.K{constructor(e){super(),this.supportNaN=e}}function p(e,t){const i=t?.supportNaN;i&&(e.uniforms.add(h),e.code.add(l.H`bool bitsEncodeFloat16NaN(highp uint bits) {
636
+ const highp uint nanExponent = 0x00007c00u;
637
+ highp uint exponent = bits & nanExponent;
638
+ highp uint mantissa = bits & 0x000003ffu;
639
+ return exponent == nanExponent && mantissa != 0u;
640
+ }`)),e.code.add(l.H`
641
+ mediump float unpackHalf1x16(highp uint bits) {
642
+ ${(0,l.If)(i,l.H`
643
+ if (bitsEncodeFloat16NaN(bits)) {
644
+ return constNaN;
645
+ }`)}
646
+ return unpackHalf2x16(bits).x;
647
+ }`),e.code.add(l.H`
648
+ mediump vec2 unpackHalf2x16NaNSupport(highp uint bits) {
649
+ vec2 result = unpackHalf2x16(bits);
650
+ ${(0,l.If)(i,l.H`
651
+ if (bitsEncodeFloat16NaN(bits)) {
652
+ result.x = constNaN;
653
+ }
654
+ if (bitsEncodeFloat16NaN(bits >> ${l.H.uint(C[2])})) {
655
+ result.y = constNaN;
656
+ }
657
+ `)}
658
+ return result;
659
+ }`)}function g(e,t){const i=t?.supportNaN;i&&(e.uniforms.add(h),e.code.add(l.H`bool bitsEncodeFloat32NaN(highp uint bits) {
660
+ const highp uint nanExponent = 0x7f800000u;
661
+ highp uint exponent = bits & nanExponent;
662
+ highp uint mantissa = bits & 0x007fffffu;
663
+ return exponent == nanExponent && mantissa != 0u;
664
+ }`)),e.code.add(l.H`
665
+ highp float unpackFloat1x32(highp uint bits) {
666
+ ${(0,l.If)(i,l.H`
667
+ if (bitsEncodeFloat32NaN(bits)) {
668
+ return constNaN;
669
+ }`)}
670
+ return uintBitsToFloat(bits);
671
+ }`)}function f(e){e.code.add(l.H`mediump int unpackInt1x16(highp uint bits) {
672
+ highp uint signExtendedBits = (bits & 0x8000u) != 0u ? (bits | 0xffff0000u) : bits;
673
+ return int(signExtendedBits);
674
+ }`)}function m(e,t){const{fieldType:i}=e;return`${(0,S[i])(function(e,t){const{byteOffset:i,byteSize:r}=e,n=t.channelByteStride,s=t.byteStride,o=Math.ceil(r/w),a=A[t.channels],c=new Array;for(let e=0;e<o;++e){const t=e*w,o=i+t,u=r-t,h=Math.min(u,w);let d=0;const p=new Array;for(;d<h;){const e=o+d,t=Math.floor(e/s),i=e%s,r=Math.floor(i/n),c=i%n,u=n-c,g=h-d,f=Math.min(u,g),m=l.H`texel${l.H.int(t)}${a[r]}`,v=4===f?"":l.H` & ${l.H.hexuint(T[f])}`,x=0===c?"":l.H` >> ${l.H.uint(C[c])}`,y=l.H`((${m}${x})${v})`,_=0===d?"":l.H` << ${l.H.uint(C[d])}`,b=l.H`(${y})${_}`;p.push(b),d+=f}c.push(l.H`(${p.join(" | ")})`)}return c}(e,t))}`}function v(e,t){const i=[];for(const t of e){const e=l.H`unpackFloat1x32(${t})`;i.push(e)}return i.join(t)}(0,n.Cg)([(0,c.W)()],d.prototype,"supportNaN",void 0);const x=e=>l.H`${e[0]}`,y=e=>{const t=e[0],i=l.H`uvec4(${l.H.uint(C[0])}, ${l.H.uint(C[1])}, ${l.H.uint(C[2])}, ${l.H.uint(C[3])})`,r=l.H`uvec4(${l.H.hexuint(T[1])})`;return l.H`((uvec4(${t}) >> ${i}) & ${r})`},_=e=>l.H`unpackFloat1x32(${e[0]})`,b=e=>l.H`vec4(${v(e,", ")})`,S={u8:x,unorm8:e=>l.H`(float(${x(e)})/${l.H.float(s.DW)})`,vec4unorm8:e=>l.H`(vec4(${y(e)})/${l.H.float(s.DW)})`,snorm16:e=>l.H`unpackSnorm2x16(${e[0]}).x`,vec2snorm16:e=>l.H`unpackSnorm2x16(${e[0]})`,f16:o.SX?e=>l.H`unpackHalf1x16(${e[0]})`:_,vec4f16:o.SX?e=>l.H`vec4(unpackHalf2x16NaNSupport(${e[0]}), unpackHalf2x16NaNSupport(${e[1]}))`:b,f32:_,vec4u8:y,vec2f32:e=>l.H`vec2(${v(e,", ")})`,vec3f32:e=>l.H`vec3(${v(e,", ")})`,vec4f32:b,mat3f32:e=>l.H`mat3(${v(e,",\n")})`},w=4,C=[0,8,16,24],T=[0,255,65535,16777215,4294967295],A={1:[l.H``],2:[l.H`.x`,l.H`.y`],4:[l.H`.x`,l.H`.y`,l.H`.z`,l.H`.w`]};var E=i(620),R=i(14113);const O=new d(!0),M=new d(!1);class L{constructor(e,t){this._shader=e,this._namespace=t,this._used=new Map}getItemSuffix(e){return 0===e?"":`${e<0?"Minus":"Plus"}${Math.abs(e)}`}getItemDataName(e=0){return`${this._namespace}ItemData${this.getItemSuffix(e)}`}getStructName(e=0){return`${this._namespace}TextureBackedBufferItemData${this.getItemSuffix(e)}`}getFetchName(e=0){return`${this._namespace}fetchTextureBackedBufferItemData${this.getItemSuffix(e)}`}getStrideName(){return`${this._namespace}tbbStride`}getTextureAttribute(e,t=0){const i=this._used,r=this.getItemDataName(t);let n=i.get(t);return null==n&&(n=new Set,i.set(t,n)),n.add(e),l.H`${r}.${e}`}generateVertexCode(e){const{_shader:t,_used:i}=this,r=new R.Cy(t.vertex);for(const t of i.keys())this._generateFetchFunction(t,r,e);return r.generateSource()}generateVertexMainCode(e){const{_shader:t,_used:i}=this,r=new R.Cy(t.vertex);for(const t of i.keys())this._generateFetchFunctionCall(t,r,e);return r.generateSource()}_generateFetchFunctionCall(e,t,i){const{itemIndexExpression:r}=i,n=this._used.get(e);if(null==n||0===n.size)return;const s=this.getItemDataName(e),o=this.getFetchName(e);t.add(l.H`${s} = ${o}(${r});`)}_getIndexOffset(e=0){return 0===e?l.H``:l.H`${e<0?"-":"+"}${l.H.uint(Math.abs(e))}`}_generateFetchFunction(e,t,i){const{bufferUniform:r,layout:n}=i,{texelFormatInfo:s}=n,o=this._used.get(e);if(null==o||0===o.size)return;const a=this.getStrideName(),c=this.getStructName(e),h=this.getItemDataName(e),d=this.getFetchName(e),p=this._getIndexOffset(e),g=new Array;for(const e of n.fields.values())o.has(e.name)&&g.push(e);if(0===g.length)return;const f=[];for(let e=0;e<n.texelStride;++e)f.push(!1);for(const e of g)for(let t=0;t<e.numTexels;++t)f[e.startTexel+t]=!0;t.add(l.H`
675
+ struct ${c} {`);for(const e of g)t.add(l.H`\t${u(e)} ${e.name};`);t.add(l.H`};`),t.add(l.H`\n${c} ${d}( highp uint baseIndex ) {
676
+ ${c} itemData;
677
+ highp uint index = (baseIndex${p}) * ${a};
678
+ highp uint rowWidth = uint(textureSize(${r.name}, 0).x);
679
+ int coordX = int(index % rowWidth);
680
+ int coordY = int(index / rowWidth);\n`);const v=P[s.channels],x=I[s.channels];for(let e=0;e<f.length;++e)!1!==f[e]&&t.add(l.H`highp ${v} texel${l.H.int(e)} = texelFetch(${r.name}, ivec2(coordX + ${l.H.int(e)}, coordY), 0)${x};`);for(const e of g)t.add(l.H`itemData.${e.name} = ${m(e,s)};`);t.add(l.H`return itemData;\n}`),t.add(l.H`${c} ${h};`)}}const P={1:l.H`uint`,2:l.H`uvec2`,4:l.H`uvec4`},I={1:l.H`.x`,2:l.H`.xy`,4:""};var D=i(74333);class F extends D.n{constructor(e,t){super(e,"usampler2D",2,(i,r,n)=>i.bindTexture(e,t(r,n)))}}var N=i(7298);const z=new class{constructor(e){this._parameters=e,this.moduleId=(0,r.c)(),this.namespace=`_tbb_${this.moduleId}_`}createBuilder(e,t){let i=null;const r=e=>{i=this._buildTextureBackedBufferShaderCode(e)};return t?e.include(r,t):e.include(r),(0,E.vA)(null!=i,"Valid builder expected."),i}_buildTextureBackedBufferShaderCode(e){const{namespace:t,_parameters:i}=this,{bufferUniform:r,layout:n}=i,s=i.enableNaNSupport?O:M,{vertex:o}=e,a=new L(e,t);o.include(g,s),o.include(p,s),o.include(f);const l=a.getStrideName(),c=a.getStructName(),u=a.getFetchName(),h=a.getItemDataName();for(const e of[l,c,u,h])(0,E.vA)(e.length<1024,"Identifiers do not have a valid length");return o.constants.add(l,"uint",n.texelStride),o.uniforms.add(r),o.code.add(()=>a.generateVertexCode(i)),o.main.add(()=>a.generateVertexMainCode(i)),a}}({layout:N.hl,itemIndexExpression:"textureElementIndex",bufferUniform:new F("componentTextureBuffer",e=>e.textureBuffer)});function H(e){return z}},92359(e,t,i){i.d(t,{nu:()=>h,W6:()=>c}),i(4576),i(71511),i(44208),i(53966);var r=i(17676),n=(i(36708),i(44794),i(78659)),s=i(5482),o=i(69622),a=i(91429);let l=class extends o.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,s.Cg)([(0,a.MZ)()],l.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,s.Cg)([(0,a.MZ)()],l.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),l=(0,s.Cg)([(0,a.$K)("esri.views.support.debugFlags")],l),new l,i(49186),Symbol("Yield");const c={RESOURCE_CONTROLLER_IMMEDIATE:"immediate",RESOURCE_CONTROLLER:"schedule",SLIDE:"slide",STREAM_DATA_LOADER:"stream loader",ELEVATION_QUERY:"elevation query",TERRAIN_SURFACE:"terrain",SURFACE_GEOMETRY_UPDATES:"surface geometry updates",LOD_RENDERER:"LoD renderer",GRAPHICS_CORE:"Graphics3D",I3S:"I3S",LYR3D:"Lyr3D",TILES3D:"3DTiles",POINT_CLOUD_LAYER:"point cloud",FEATURE_TILE_FETCHER:"feature fetcher",STREAM_CONTROLLER:"stream controller",OCCLUSION_QUERY:"occlusion query",OVERLAY:"overlay",OVERLAY_RENDERER:"overlay renderer",STAGE:"stage",GRAPHICS_DECONFLICTOR:"graphics deconflictor",FILTER_VISIBILITY:"graphics filter visibility",SCALE_VISIBILITY:"graphics scale visibility",FRUSTUM_VISIBILITY:"graphics frustum visibility",POINT_OF_INTEREST_FREQUENT:"POI frequent",POINT_OF_INTEREST_INFREQUENT:"POI infrequent",LABELER:"labeler",FEATURE_QUERY_ENGINE:"feature query",FEATURE_TILE_TREE:"feature tile tree",FEATURE_TILE_TREE_ACTIVE:"fast feature tile tree",ELEVATION_ALIGNMENT:"elevation alignment",ELEVATION_ALIGNMENT_SCENE:"elevation alignment scene",TEXT_TEXTURE_ATLAS:"text texture atlas",TEXTURE_UNLOAD:"texture unload",LINE_OF_SIGHT_TOOL:"line of sight tool",LINE_OF_SIGHT_TOOL_INTERACTIVE:"interactive line of sight tool",VOLUME_MEASUREMENT:"volume measurement",ELEVATION_PROFILE:"elevation profile",SNAPPING:"snapping",SHADOW_ACCUMULATOR:"shadow accumulator",CLOUDS_GENERATOR:"clouds generator",FLOW_GENERATOR:"flow generator",GAUSSIAN_SPLAT_SORTING:"gaussian splat sorting",GAUSSIAN_SPLAT_TEXTURE_ATLAS:"gaussian splat texture atlas",MAPVIEW_FETCH_QUEUE:"mapview fetch queue",MAPVIEW_LAYERVIEW_UPDATE:"mapview layerview update",MAPVIEW_VECTOR_TILE_PARSING_QUEUE:"mapview vector tile parsing queue",NONE:0,TEST_PRIO:1};new Map([[c.RESOURCE_CONTROLLER_IMMEDIATE,0],[c.RESOURCE_CONTROLLER,4],[c.SLIDE,0],[c.STREAM_DATA_LOADER,0],[c.ELEVATION_QUERY,0],[c.TERRAIN_SURFACE,1],[c.SURFACE_GEOMETRY_UPDATES,1],[c.LOD_RENDERER,2],[c.GRAPHICS_CORE,2],[c.I3S,2],[c.LYR3D,2],[c.TILES3D,3],[c.POINT_CLOUD_LAYER,2],[c.FEATURE_TILE_FETCHER,2],[c.STREAM_CONTROLLER,2],[c.CLOUDS_GENERATOR,2],[c.OCCLUSION_QUERY,2],[c.OVERLAY,4],[c.OVERLAY_RENDERER,4],[c.STAGE,4],[c.GRAPHICS_DECONFLICTOR,4],[c.FILTER_VISIBILITY,4],[c.SCALE_VISIBILITY,4],[c.FRUSTUM_VISIBILITY,4],[c.POINT_OF_INTEREST_FREQUENT,6],[c.POINT_OF_INTEREST_INFREQUENT,30],[c.LABELER,8],[c.FEATURE_QUERY_ENGINE,8],[c.FEATURE_TILE_TREE,16],[c.FEATURE_TILE_TREE_ACTIVE,0],[c.ELEVATION_ALIGNMENT,12],[c.ELEVATION_ALIGNMENT_SCENE,14],[c.TEXT_TEXTURE_ATLAS,12],[c.TEXTURE_UNLOAD,12],[c.LINE_OF_SIGHT_TOOL,16],[c.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[c.VOLUME_MEASUREMENT,4],[c.SNAPPING,0],[c.SHADOW_ACCUMULATOR,30],[c.FLOW_GENERATOR,12],[c.GAUSSIAN_SPLAT_SORTING,2],[c.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[c.MAPVIEW_FETCH_QUEUE,0],[c.MAPVIEW_LAYERVIEW_UPDATE,2],[c.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,0]]),(0,n.l5)(6.5),(0,n.l5)(1),(0,n.l5)(30),(0,n.l5)(1e3/30),(0,n.l5)(100);const u=new class{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}};u.enabled=!1;const h=new class{remove(){}processQueue(){}schedule(e,t,i){try{if((0,r.G4)(t)){const e=(0,r.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,r.z7)(e(u))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}async scheduleGenerator(e,t,i){if((0,r.G4)(t)){const e=(0,r.NK)();if(i)return i(e);throw e}const n=e(u);for(;;){const e=n.next(u),s=(0,r.$X)(e)?await e:e;if((0,r.G4)(t)){const e=(0,r.NK)();if(i){const t=i(e),s=n.return(null);return(0,r.$X)(s)&&await(0,r.QZ)(s),t}const t=n.throw(e);throw(0,r.$X)(t)&&await(0,r.QZ)(t),e}if(s.done)return s.value}}}}}]);