@arcgis/core 5.0.0-next.36 → 5.0.0-next.38

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 (270) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/analysis/ShadowCast/types.d.ts +2 -0
  3. package/applications/Components/analysisUtils.d.ts +1 -0
  4. package/applications/Components/analysisUtils.js +1 -1
  5. package/applications/Components/testUtils.d.ts +4 -0
  6. package/applications/Components/testUtils.js +5 -0
  7. package/arcade/arcadeAsyncRuntime.js +1 -1
  8. package/arcade/arcadeCompiler.js +1 -1
  9. package/arcade/featureSetUtils.js +1 -1
  10. package/arcade/featureset/actions/Adapted.js +1 -1
  11. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  12. package/arcade/featureset/actions/GroupBy.js +1 -1
  13. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  14. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  15. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  16. package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
  17. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  18. package/arcade/featureset/support/FeatureSet.js +1 -1
  19. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  20. package/assets/esri/core/workers/RemoteClient.js +1 -1
  21. package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
  22. package/assets/esri/core/workers/chunks/{51355866a0dcf41cfded.js → 0a5427127634738aa239.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
  25. package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
  26. package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
  27. package/assets/esri/core/workers/chunks/2795e491f803654413d2.js +1 -0
  28. package/assets/esri/core/workers/chunks/2f9129003f77bfeab2f9.js +1 -0
  29. package/assets/esri/core/workers/chunks/{1817cf11e85afca947d3.js → 328106e181e5957ceaa5.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/50ffb22c48fadd36c748.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f1ac1c8b1331ec79e898.js → 59ce992d3a5e7c32b9fb.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{8a946cbc816f373c136b.js → 5e30acfda04f7fc2b676.js} +1 -1
  34. package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
  35. package/assets/esri/core/workers/chunks/{3f03165487c1c2340fff.js → 690a40d2eef52bfc149f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{b451dc416eebd0931ef8.js → 7ab237d19b84d89ff483.js} +7 -7
  38. package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{bfb9cbe59d36d18f9157.js → cda5c95fd49b8901f7d4.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{c9e7cc5d853908ab5b2f.js → ce99abfdcd71ff9e4e36.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{52c8687b473c9953c2f2.js → d9958654c6438f28237b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{eb6218634a492667506a.js → e501d68a1464805c4b4e.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{d8623f5f13a084e439c2.js → e9bc3c6482ba778c9349.js} +37 -37
  47. package/assets/esri/core/workers/chunks/{7420fa18ba12014b22ea.js → ee67c8a7c1f8b482cd99.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
  49. package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
  50. package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
  51. package/chunks/CloudsComposition.glsl.js +1 -1
  52. package/chunks/ComponentShader.glsl.js +2 -2
  53. package/chunks/DefaultMaterial.glsl.js +1 -1
  54. package/chunks/GaussianSplat.glsl.js +2 -2
  55. package/chunks/Laserlines.glsl.js +1 -1
  56. package/chunks/Path.glsl.js +1 -1
  57. package/chunks/RealisticTree.glsl.js +1 -1
  58. package/chunks/Terrain.glsl.js +34 -36
  59. package/chunks/WaterSurface.glsl.js +1 -1
  60. package/chunks/boundedPlane.js +1 -1
  61. package/chunks/cameraUtilsSpherical.js +1 -1
  62. package/chunks/vec32.js +1 -1
  63. package/config.js +1 -1
  64. package/core/has.js +1 -1
  65. package/core/iteratorUtils.js +1 -1
  66. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  67. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  68. package/geometry/support/buffer/BufferView.js +1 -1
  69. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  70. package/geometry/support/lineSegment.js +1 -1
  71. package/geometry/support/meshUtils/merge.js +1 -1
  72. package/geometry/support/sphere.js +1 -1
  73. package/interfaces.d.ts +59 -5
  74. package/kernel.js +1 -1
  75. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  76. package/layers/VoxelWasmPerSceneView.js +1 -1
  77. package/layers/knowledgeGraph/layerUtils.js +1 -1
  78. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  79. package/layers/support/csvUtils.js +1 -1
  80. package/layers/video/VideoController.js +1 -1
  81. package/layers/voxel/VoxelVolume.js +1 -1
  82. package/package.json +5 -5
  83. package/support/revision.js +1 -1
  84. package/support/tests/meshUtils.js +5 -0
  85. package/support/tests/serviceMockDependencies.js +5 -0
  86. package/support/tests/setupServiceMocksMesh.js +5 -0
  87. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  88. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  89. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  90. package/views/3d/FocusAreasView.js +1 -1
  91. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  92. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  93. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  94. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  95. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  96. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  97. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  98. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  99. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  100. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  101. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  102. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  103. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  104. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  105. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  106. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  107. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  108. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  109. package/views/3d/camera/constraintUtils/distance.js +1 -1
  110. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  111. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  112. package/views/3d/environment/CloudsParameters.js +1 -1
  113. package/views/3d/environment/EnvironmentManager.js +1 -1
  114. package/views/3d/environment/MarsAtmosphere.js +1 -1
  115. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  116. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  117. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  118. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  119. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  120. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  121. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  122. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  123. package/views/3d/layers/FlowSubView3D.js +1 -1
  124. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  125. package/views/3d/layers/I3SMeshView3D.js +1 -1
  126. package/views/3d/layers/ImagerySubView3D.js +1 -1
  127. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  128. package/views/3d/layers/PointCloudWorker.js +1 -1
  129. package/views/3d/layers/RouteLayerView3D.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  133. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  134. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  135. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  136. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  137. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  138. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  139. package/views/3d/state/Frustum.js +1 -1
  140. package/views/3d/state/ViewStateManager.js +1 -1
  141. package/views/3d/state/controllers/FovController.js +1 -1
  142. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  143. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  144. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  145. package/views/3d/support/cameraUtils.js +1 -1
  146. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  147. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  148. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  149. package/views/3d/support/intersectionUtils.js +1 -1
  150. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  151. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  152. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  153. package/views/3d/support/viewpointUtils.js +1 -1
  154. package/views/3d/terrain/OverlayManager.js +1 -1
  155. package/views/3d/terrain/OverlayRenderer.js +1 -1
  156. package/views/3d/terrain/PatchRenderData.js +1 -1
  157. package/views/3d/terrain/SphericalPatch.js +1 -1
  158. package/views/3d/terrain/TerrainRenderer.js +1 -1
  159. package/views/3d/terrain/TerrainSurface.js +1 -1
  160. package/views/3d/terrain/Tile.js +1 -1
  161. package/views/3d/terrain/TileCompositor.js +1 -1
  162. package/views/3d/webgl/RenderCamera.js +1 -1
  163. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  164. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  165. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  166. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  167. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
  168. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +4 -4
  169. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
  170. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
  171. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
  172. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
  173. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
  174. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  175. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
  176. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
  177. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
  178. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +8 -8
  179. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  180. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  181. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  182. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  183. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  184. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  185. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  186. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  187. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  188. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  189. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  190. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  191. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  192. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  193. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  194. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +5 -0
  195. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
  196. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  197. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayoutField.js +5 -0
  198. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +5 -0
  199. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  200. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  201. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  202. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  203. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  204. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  205. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  207. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  208. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  209. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  210. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  211. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  212. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  218. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  220. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  221. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  222. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  223. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  224. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  225. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  226. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  227. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  228. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
  229. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  230. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  231. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  232. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  233. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  234. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  235. package/views/BreakpointsOwner.js +1 -1
  236. package/views/GroundView.js +1 -1
  237. package/views/SceneView.js +1 -1
  238. package/views/ToolViewManager.js +1 -1
  239. package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
  240. package/views/interactive/GraphicManipulator.js +1 -1
  241. package/views/interactive/InteractiveToolBase.js +1 -1
  242. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  243. package/views/interactive/coordinateHelper.js +1 -1
  244. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  245. package/views/interactive/sketch/constraints.js +1 -1
  246. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  247. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  248. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  249. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  250. package/views/layers/LayerView.js +1 -1
  251. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  252. package/views/support/LayerViewManager.js +1 -1
  253. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  254. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  255. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  256. package/views/support/geometry3dUtils.js +1 -1
  257. package/webmap/utils.js +1 -1
  258. package/widgets/Sketch/SketchViewModel.js +1 -1
  259. package/widgets/Slider.js +1 -1
  260. package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
  261. package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
  262. package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
  263. package/assets/esri/core/workers/chunks/24a3c6f0154787968724.js +0 -1
  264. package/assets/esri/core/workers/chunks/5000a37fba27464d10ca.js +0 -1
  265. package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +0 -1
  266. package/assets/esri/core/workers/chunks/b075d3714fab0591d67c.js +0 -1
  267. package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
  268. package/assets/esri/core/workers/chunks/e0a74250d22fa1d7dc18.js +0 -1
  269. package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
  270. package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +0 -26
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4633],{2451:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(31635),o=r(51976);class n extends o.K{constructor(){super(...arguments),this.output=0,this.hasEmission=!1}}(0,i.Cg)([(0,o.W)({count:10})],n.prototype,"output",void 0),(0,i.Cg)([(0,o.W)()],n.prototype,"hasEmission",void 0);class a extends n{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class s extends a{constructor(){super(...arguments),this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0}}(0,i.Cg)([(0,o.W)({count:3})],s.prototype,"oitPass",void 0),(0,i.Cg)([(0,o.W)()],s.prototype,"hasSlicePlane",void 0),(0,i.Cg)([(0,o.W)()],s.prototype,"hasHighlightMixTexture",void 0)},2495:(e,t,r)=>{r.d(t,{$U:()=>Se,fs:()=>Ae,ty:()=>Ie});var i=r(38954),o=r(51850),n=r(49255),a=r(25634),s=r(11725),l=r(70328),c=r(620);class d{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const u=(0,l.vt)(),h=(0,o.vt)();function m(e,t,r,o,n,a,s){if(null==e)return;const c=function(e,t){return(0,i.h)(t,1/e[0],1/e[1],1/e[2])}(r,h);if((0,l.Ne)(u,e.bbMin),(0,l.vI)(u,e.bbMax),null!=n&&n.applyToAabb(u),function(e,t,r,i){return function(e,t,r,i){const o=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let a=Math.min(o,n),s=Math.max(o,n);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(u,t,c,o)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>M){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,o,n,a,s);return}}!function(e,t,r,i,o,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],v=t[1],g=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*o[r];let c=n[i],w=n[i+1],b=n[i+2];const y=a*o[r+1];let M=n[y],C=n[y+1],S=n[y+2];const E=a*o[r+2];let A=n[E],I=n[E+1],R=n[E+2];null!=l&&([c,w,b]=l.applyToVertex(c,w,b,e),[M,C,S]=l.applyToVertex(M,C,S,e),[A,I,R]=l.applyToVertex(A,I,R,e));const F=M-c,O=C-w,P=S-b,D=A-c,H=I-w,N=R-b,z=v*N-H*g,L=g*D-N*f,B=f*H-D*v,V=F*z+O*L+P*B;if(Math.abs(V)<=T)continue;const G=u-c,U=h-w,j=m-b,W=G*z+U*L+j*B;if(V>0){if(W<0||W>V)continue}else if(W>0||W<V)continue;const k=U*P-O*j,$=j*F-P*G,Z=G*O-F*U,q=f*k+v*$+g*Z;if(V>0){if(q<0||W+q>V)continue}else if(q>0||W+q<V)continue;const Y=(D*k+H*$+N*Z)/V;Y>=0&&d(Y,t,_?x(F,O,P,D,H,N,p):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,n,a,s)}}const p=(0,o.vt)();function f(e,t,r,i,o,n,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=n*t,v=o[f],g=o[f+1],_=o[f+2],w=n*r,b=n*i,y=o[w]-v,M=o[w+1]-g,C=o[w+2]-_,S=o[b]-v,E=o[b+1]-g,A=o[b+2]-_,I=h*A-E*m,R=m*S-A*u,F=u*E-S*h,O=y*I+M*R+C*F;if(Math.abs(O)<=T)continue;const P=l-v,D=c-g,H=d-_,N=P*I+D*R+H*F;if(O>0){if(N<0||N>O)continue}else if(N>0||N<O)continue;const z=D*C-M*H,L=H*y-C*P,B=P*M-y*D,V=u*z+h*L+m*B;if(O>0){if(V<0||N+V>O)continue}else if(V>0||N+V<O)continue;const G=(S*z+E*L+A*B)/O;G>=0&&s(G,e,a?x(y,M,C,S,E,A,p):null)}}const v=(0,o.vt)(),g=(0,o.vt)(),_=(0,o.vt)();function x(e,t,r,o,n,a,s){return(0,i.h)(b,e,t,r),(0,i.h)(y,o,n,a),(0,i.f)(s,b,y),(0,i.n)(s,s),s}function w(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(y,e[2],e[0]),(0,i.f)(p,b,y),(0,i.n)(p,p),p}const b=(0,o.vt)(),y=(0,o.vt)(),M=1e3,T=1e-7,C=(0,o.vt)(),S=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()];var E=r(16396),A=r(13030),I=r(59907);class R{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,o,n){return(0,I.vJ)(r,i,this.layout,e,t,o,n)}intersect(e,t,r,o,n,a,s){const l=this.layout.createView(e).getField("position",A.xs);if(null==l)return;const c=(0,i.a)(F,a,n),d=l.count/3,u=o.options.normalRequired;f(n,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const F=(0,o.vt)();var O=r(43616),P=r(31635),D=r(91429),H=r(91829),N=r(4431),z=r(1843),L=r(72824),B=r(13840),V=r(42958),G=r(16943),U=r(33524);const j={mask:255},W={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},k={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var $=r(4576),Z=r(44208);r(53966),r(34275),r(94656),r(63907),(0,Z.A)("esri-tests-disable-gpu-memory-measurements");var q=r(69622),Y=r(65529),X=r(77690),K=r(29242),J=r(58083),Q=r(9093),ee=r(32728);class te{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",A.Eq),this.color=e.getField("instanceColor",A.XP),this.olidColor=e.getField("instanceOlidColor",A.XP),this.state=e.getField("state",A.SL),this.lodLevel=e.getField("lodLevel",A.SL)}}let re=class extends q.A{constructor(e,t){super(e),this.events=new Y.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return oe(ie.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ce,this._buffer=this._layout.createBuffer(this._capacity),this._view=new te(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=ne,o=ae;t.localTransform.getMat(e,se),t.globalTransform.getMat(e,le);const n=(0,J.lw)(le,le,se);(0,i.h)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,X.z0)(o,n),t.model.setMat(e,o);const a=(0,ee.wp)(ne,n);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,X.B8)(o,o),(0,X.mg)(o,o),t.modelNormal.setMat(e,o),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,ae),r.modelOrigin.getVec(e,ne),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=ne[0],t[13]=ne[1],t[14]=ne[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ne,this,e),t*=Math.max(ne[0],ne[1],ne[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ne,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ne[0],ne[1],ne[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ce,Math.floor(this._capacity*$.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new te(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,P.Cg)([(0,D.MZ)({constructOnly:!0})],re.prototype,"shaderTransformation",void 0),(0,P.Cg)([(0,D.MZ)()],re.prototype,"_size",void 0),(0,P.Cg)([(0,D.MZ)({readOnly:!0})],re.prototype,"size",null),re=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],re);const ie=(0,z.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function oe(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,G.E)()&&e.vec4u8("instanceOlidColor"),e}const ne=(0,o.vt)(),ae=(0,K.vt)(),se=(0,Q.vt)(),le=(0,Q.vt)(),ce=64,de=(0,z.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var ue=r(74810),he=r(28491),me=r(90644),pe=r(85079),fe=r(49788);class ve extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ue.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=o.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,o.CN)(.2,.2,.2),this.diffuse=(0,o.CN)(.8,.8,.8),this.externalColor=(0,H.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,o.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=fe.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;let ge=class extends V.w{constructor(e,t){const i=[(0,N.U)(we(t))];t.instanced&&t.instancedDoublePrecision&&i.push((0,N.U)(function(e){return oe(de.clone(),e)}(t))),super(e,t,(0,pe._u)(i)),this.shader=new B.r(he.D,()=>r.e(5141).then(r.bind(r,5141)))}_makePipeline(e,t){const{oitPass:r,output:i,hasEmission:o,transparent:a,cullFace:s,customDepthTest:l,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,n._o)(i)&&a?(0,U.Yf)(r):null,culling:xe(e)?(0,me.Xt)(s):null,depthTest:(0,U.mt)(r,_e(l)),depthWrite:(0,U.z5)(e),drawBuffers:(0,V.L)(i,(0,U.Sv)(r,o)),colorWrite:me.kn,stencilWrite:c?j:null,stencilTest:c?t?k:W:null,polygonOffset:(0,U.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function _e(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function xe(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function we(e){const t=(0,z.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,G.E)()&&t.vec4u8("olidColor"),t}ge=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],ge);var be=r(51976),ye=r(2451);class Me extends ye.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,P.Cg)([(0,be.W)({count:4})],Me.prototype,"alphaDiscardMode",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"doubleSidedMode",void 0),(0,P.Cg)([(0,be.W)({count:7})],Me.prototype,"pbrMode",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"cullFace",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"normalType",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"customDepthTest",void 0),(0,P.Cg)([(0,be.W)({count:8})],Me.prototype,"emissionSource",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVertexColors",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasSymbolColors",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVerticalOffset",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasColorTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasMetallicRoughnessTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOcclusionTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasNormalTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasScreenSizePerspective",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVertexTangents",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOccludees",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instanced",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedDoublePrecision",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasModelTransformation",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"offsetBackfaces",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVVSize",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVVColor",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"receiveShadows",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"receiveAmbientOcclusion",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"textureAlphaPremultiplied",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedFeatureAttribute",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedColor",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"writeDepth",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"transparent",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"enableOffset",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"terrainDepthTest",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"cullAboveTerrain",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"snowCover",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasColorTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasEmissionTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasNormalTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOcclusionTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Te=r(57323);let Ce=class extends ge{constructor(){super(...arguments),this.shader=new B.r(Te.R,()=>r.e(2314).then(r.bind(r,39933)))}};Ce=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Ce);class Se extends s.i{constructor(e,t){super(e,Ae),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&!this.transparent],[4,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&this.transparent&&this.parameters.writeDepth],[8,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=we(this.parameters),this._configuration=new Me(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=fe.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.m)(this.parameters.emissiveBaseColor,o.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:o,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!o&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=o?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!o&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=o?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,n._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,o,n,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.h)(He,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(Pe,He);break;case 2:a=(0,i.d)(Pe,Oe)}let s=0;const l=(0,i.e)(Ne,He,e.eye),c=(0,i.b)(l),d=(0,i.j)(l,l,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.g)(a,d)),s+=(0,O.kE)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective,null),(0,i.j)(a,a,s),(0,i.t)(De,a,r.transform.inverseRotation),o=(0,i.e)(Re,o,De),n=(0,i.e)(Fe,n,De)}!function(e,t,r,o,n,a){if(!e.visible)return;const s=(0,i.a)(C,o,r),l=(e,t,r)=>a(e,r,t),{tolerance:u}=t,h=new d(u,!1,t.options.normalRequired);if(e.boundingInfo)(0,c.vA)(0===e.type),m(e.boundingInfo,r,s,u,n,h,l);else{const t=e.positionAttribute,o=t.indices;!function(e,t,r,o,n,a,s,l,c,d){const u=t,h=S,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),x=m>=p?m>=f?0:2:p>=f?1:2,b=x,y=u[b]<0?2:1,M=(x+y)%3,T=(x+(3-y))%3,C=u[M]/u[b],E=u[T]/u[b],A=1/u[b],I=v,R=g,F=_,{normalRequired:O}=c;for(let t=r;t<o;++t){const r=3*t,o=s*n[r];(0,i.h)(h[0],a[o+0],a[o+1],a[o+2]);const c=s*n[r+1];(0,i.h)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*n[r+2];(0,i.h)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(I,h[0],e),(0,i.a)(R,h[1],e),(0,i.a)(F,h[2],e);const m=I[M]-C*I[b],p=I[T]-E*I[b],f=R[M]-C*R[b],v=R[T]-E*R[b],g=F[M]-C*F[b],_=F[T]-E*F[b],x=g*v-_*f,y=m*_-p*g,S=f*p-v*m;if((x<0||y<0||S<0)&&(x>0||y>0||S>0))continue;const P=x+y+S;if(0===P)continue;const D=x*(A*I[b])+y*(A*R[b])+S*(A*F[b]);if(D*Math.sign(P)<0)continue;const H=D/P;H>=0&&d(H,t,O?w(h):null)}}(r,s,0,o.length/3,o,t.data,t.stride,n,h,l)}}(e,r,o,n,(0,E.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Ee(e)}createBufferWriter(){return new R(this._layout)}get transparent(){return Ie(this.parameters)}}class Ee extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.h)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Ce:ge,e)}}class Ae extends ve{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ie(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:o,texture:n,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||o<1||(null!=n||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Re=(0,o.vt)(),Fe=(0,o.vt)(),Oe=(0,o.fA)(0,0,1),Pe=(0,o.vt)(),De=(0,o.vt)(),He=(0,o.vt)(),Ne=(0,o.vt)()},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,n.j)(h,this.ray.direction,this.distance),(0,n.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,n.j)(h,this.ray.direction,this.distance),(0,n.i)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,n.d)(m,this.normal),m[3]=0,(0,s.t)(m,m,this.transformation),(0,n.d)(e,m),(0,n.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,o.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,n.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??o.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,n.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),m=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(33094),o=r(31821);function n(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(o.H`float getSnow(vec3 normal, vec3 groundNormal) {
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4633],{2451:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(31635),o=r(51976);class n extends o.K{constructor(){super(...arguments),this.output=0,this.hasEmission=!1}}(0,i.Cg)([(0,o.W)({count:10})],n.prototype,"output",void 0),(0,i.Cg)([(0,o.W)()],n.prototype,"hasEmission",void 0);class a extends n{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class s extends a{constructor(){super(...arguments),this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,i.Cg)([(0,o.W)({count:3})],s.prototype,"oitPass",void 0),(0,i.Cg)([(0,o.W)()],s.prototype,"hasSlicePlane",void 0),(0,i.Cg)([(0,o.W)()],s.prototype,"hasHighlightMixTexture",void 0)},2495:(e,t,r)=>{r.d(t,{$U:()=>Se,fs:()=>Ae,ty:()=>Ie});var i=r(38954),o=r(51850),n=r(49255),a=r(25634),s=r(11725),l=r(70328),c=r(620);class d{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const u=(0,l.vt)(),h=(0,o.vt)();function m(e,t,r,o,n,a,s){if(null==e)return;const c=function(e,t){return(0,i.h)(t,1/e[0],1/e[1],1/e[2])}(r,h);if((0,l.Ne)(u,e.bbMin),(0,l.vI)(u,e.bbMax),null!=n&&n.applyToAabb(u),function(e,t,r,i){return function(e,t,r,i){const o=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let a=Math.min(o,n),s=Math.max(o,n);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(u,t,c,o)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>M){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,o,n,a,s);return}}!function(e,t,r,i,o,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],v=t[1],g=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*o[r];let c=n[i],w=n[i+1],b=n[i+2];const y=a*o[r+1];let M=n[y],C=n[y+1],S=n[y+2];const E=a*o[r+2];let A=n[E],I=n[E+1],R=n[E+2];null!=l&&([c,w,b]=l.applyToVertex(c,w,b,e),[M,C,S]=l.applyToVertex(M,C,S,e),[A,I,R]=l.applyToVertex(A,I,R,e));const F=M-c,O=C-w,P=S-b,D=A-c,H=I-w,N=R-b,z=v*N-H*g,L=g*D-N*f,B=f*H-D*v,V=F*z+O*L+P*B;if(Math.abs(V)<=T)continue;const G=u-c,U=h-w,j=m-b,W=G*z+U*L+j*B;if(V>0){if(W<0||W>V)continue}else if(W>0||W<V)continue;const k=U*P-O*j,$=j*F-P*G,Z=G*O-F*U,q=f*k+v*$+g*Z;if(V>0){if(q<0||W+q>V)continue}else if(q>0||W+q<V)continue;const Y=(D*k+H*$+N*Z)/V;Y>=0&&d(Y,t,_?x(F,O,P,D,H,N,p):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,n,a,s)}}const p=(0,o.vt)();function f(e,t,r,i,o,n,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=n*t,v=o[f],g=o[f+1],_=o[f+2],w=n*r,b=n*i,y=o[w]-v,M=o[w+1]-g,C=o[w+2]-_,S=o[b]-v,E=o[b+1]-g,A=o[b+2]-_,I=h*A-E*m,R=m*S-A*u,F=u*E-S*h,O=y*I+M*R+C*F;if(Math.abs(O)<=T)continue;const P=l-v,D=c-g,H=d-_,N=P*I+D*R+H*F;if(O>0){if(N<0||N>O)continue}else if(N>0||N<O)continue;const z=D*C-M*H,L=H*y-C*P,B=P*M-y*D,V=u*z+h*L+m*B;if(O>0){if(V<0||N+V>O)continue}else if(V>0||N+V<O)continue;const G=(S*z+E*L+A*B)/O;G>=0&&s(G,e,a?x(y,M,C,S,E,A,p):null)}}const v=(0,o.vt)(),g=(0,o.vt)(),_=(0,o.vt)();function x(e,t,r,o,n,a,s){return(0,i.h)(b,e,t,r),(0,i.h)(y,o,n,a),(0,i.f)(s,b,y),(0,i.n)(s,s),s}function w(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(y,e[2],e[0]),(0,i.f)(p,b,y),(0,i.n)(p,p),p}const b=(0,o.vt)(),y=(0,o.vt)(),M=1e3,T=1e-7,C=(0,o.vt)(),S=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()];var E=r(16396),A=r(13030),I=r(59907);class R{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,o,n){return(0,I.vJ)(r,i,this.layout,e,t,o,n)}intersect(e,t,r,o,n,a,s){const l=this.layout.createView(e).getField("position",A.xs);if(null==l)return;const c=(0,i.a)(F,a,n),d=l.count/3,u=o.options.normalRequired;f(n,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const F=(0,o.vt)();var O=r(43616),P=r(31635),D=r(91429),H=r(91829),N=r(4431),z=r(1843),L=r(72824),B=r(13840),V=r(42958),G=r(16943),U=r(33524);const j={mask:255},W={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},k={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var $=r(4576),Z=r(44208);r(53966),r(34275),r(94656),r(63907),(0,Z.A)("esri-tests-disable-gpu-memory-measurements");var q=r(69622),Y=r(65529),X=r(77690),K=r(29242),J=r(58083),Q=r(9093),ee=r(32728);class te{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",A.Eq),this.color=e.getField("instanceColor",A.XP),this.olidColor=e.getField("instanceOlidColor",A.XP),this.state=e.getField("state",A.SL),this.lodLevel=e.getField("lodLevel",A.SL)}}let re=class extends q.A{constructor(e,t){super(e),this.events=new Y.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return oe(ie.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ce,this._buffer=this._layout.createBuffer(this._capacity),this._view=new te(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=ne,o=ae;t.localTransform.getMat(e,se),t.globalTransform.getMat(e,le);const n=(0,J.lw)(le,le,se);(0,i.h)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,X.z0)(o,n),t.model.setMat(e,o);const a=(0,ee.wp)(ne,n);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,X.B8)(o,o),(0,X.mg)(o,o),t.modelNormal.setMat(e,o),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,ae),r.modelOrigin.getVec(e,ne),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=ne[0],t[13]=ne[1],t[14]=ne[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ne,this,e),t*=Math.max(ne[0],ne[1],ne[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ne,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ne[0],ne[1],ne[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ce,Math.floor(this._capacity*$.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new te(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,P.Cg)([(0,D.MZ)({constructOnly:!0})],re.prototype,"shaderTransformation",void 0),(0,P.Cg)([(0,D.MZ)()],re.prototype,"_size",void 0),(0,P.Cg)([(0,D.MZ)({readOnly:!0})],re.prototype,"size",null),re=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],re);const ie=(0,z.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function oe(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,G.E)()&&e.vec4u8("instanceOlidColor"),e}const ne=(0,o.vt)(),ae=(0,K.vt)(),se=(0,Q.vt)(),le=(0,Q.vt)(),ce=64,de=(0,z.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var ue=r(74810),he=r(28491),me=r(90644),pe=r(85079),fe=r(49788);class ve extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ue.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=o.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,o.CN)(.2,.2,.2),this.diffuse=(0,o.CN)(.8,.8,.8),this.externalColor=(0,H.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,o.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=fe.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;let ge=class extends V.w{constructor(e,t){const i=[(0,N.U)(we(t))];t.instanced&&t.instancedDoublePrecision&&i.push((0,N.U)(function(e){return oe(de.clone(),e)}(t))),super(e,t,(0,pe._u)(i)),this.shader=new B.r(he.D,()=>r.e(5141).then(r.bind(r,5141)))}_makePipeline(e,t){const{oitPass:r,output:i,hasEmission:o,transparent:a,cullFace:s,customDepthTest:l,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,n._o)(i)&&a?(0,U.Yf)(r):null,culling:xe(e)?(0,me.Xt)(s):null,depthTest:(0,U.mt)(r,_e(l)),depthWrite:(0,U.z5)(e),drawBuffers:(0,V.L)(i,(0,U.Sv)(r,o)),colorWrite:me.kn,stencilWrite:c?j:null,stencilTest:c?t?k:W:null,polygonOffset:(0,U.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function _e(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function xe(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function we(e){const t=(0,z.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,G.E)()&&t.vec4u8("olidColor"),t}ge=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],ge);var be=r(51976),ye=r(2451);class Me extends ye.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,P.Cg)([(0,be.W)({count:4})],Me.prototype,"alphaDiscardMode",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"doubleSidedMode",void 0),(0,P.Cg)([(0,be.W)({count:7})],Me.prototype,"pbrMode",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"cullFace",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"normalType",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"customDepthTest",void 0),(0,P.Cg)([(0,be.W)({count:8})],Me.prototype,"emissionSource",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVertexColors",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasSymbolColors",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVerticalOffset",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasColorTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasMetallicRoughnessTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOcclusionTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasNormalTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasScreenSizePerspective",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVertexTangents",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOccludees",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instanced",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedDoublePrecision",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasModelTransformation",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"offsetBackfaces",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVVSize",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVVColor",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"receiveShadows",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"receiveAmbientOcclusion",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"textureAlphaPremultiplied",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedFeatureAttribute",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedColor",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"writeDepth",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"transparent",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"enableOffset",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"terrainDepthTest",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"cullAboveTerrain",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"snowCover",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasColorTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasEmissionTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasNormalTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOcclusionTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Te=r(57323);let Ce=class extends ge{constructor(){super(...arguments),this.shader=new B.r(Te.R,()=>r.e(2314).then(r.bind(r,39933)))}};Ce=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Ce);class Se extends s.i{constructor(e,t){super(e,Ae),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&!this.transparent],[4,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=we(this.parameters),this._configuration=new Me(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=fe.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.m)(this.parameters.emissiveBaseColor,o.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:o,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!o&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=o?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!o&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=o?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,n._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,o,n,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.h)(He,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(Pe,He);break;case 2:a=(0,i.d)(Pe,Oe)}let s=0;const l=(0,i.e)(Ne,He,e.eye),c=(0,i.b)(l),d=(0,i.j)(l,l,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.g)(a,d)),s+=(0,O.kE)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective,null),(0,i.j)(a,a,s),(0,i.t)(De,a,r.transform.inverseRotation),o=(0,i.e)(Re,o,De),n=(0,i.e)(Fe,n,De)}!function(e,t,r,o,n,a){if(!e.visible)return;const s=(0,i.a)(C,o,r),l=(e,t,r)=>a(e,r,t),{tolerance:u}=t,h=new d(u,!1,t.options.normalRequired);if(e.boundingInfo)(0,c.vA)(0===e.type),m(e.boundingInfo,r,s,u,n,h,l);else{const t=e.positionAttribute,o=t.indices;!function(e,t,r,o,n,a,s,l,c,d){const u=t,h=S,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),x=m>=p?m>=f?0:2:p>=f?1:2,b=x,y=u[b]<0?2:1,M=(x+y)%3,T=(x+(3-y))%3,C=u[M]/u[b],E=u[T]/u[b],A=1/u[b],I=v,R=g,F=_,{normalRequired:O}=c;for(let t=r;t<o;++t){const r=3*t,o=s*n[r];(0,i.h)(h[0],a[o+0],a[o+1],a[o+2]);const c=s*n[r+1];(0,i.h)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*n[r+2];(0,i.h)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(I,h[0],e),(0,i.a)(R,h[1],e),(0,i.a)(F,h[2],e);const m=I[M]-C*I[b],p=I[T]-E*I[b],f=R[M]-C*R[b],v=R[T]-E*R[b],g=F[M]-C*F[b],_=F[T]-E*F[b],x=g*v-_*f,y=m*_-p*g,S=f*p-v*m;if((x<0||y<0||S<0)&&(x>0||y>0||S>0))continue;const P=x+y+S;if(0===P)continue;const D=x*(A*I[b])+y*(A*R[b])+S*(A*F[b]);if(D*Math.sign(P)<0)continue;const H=D/P;H>=0&&d(H,t,O?w(h):null)}}(r,s,0,o.length/3,o,t.data,t.stride,n,h,l)}}(e,r,o,n,(0,E.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Ee(e)}createBufferWriter(){return new R(this._layout)}get transparent(){return Ie(this.parameters)}}class Ee extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.h)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Ce:ge,e)}}class Ae extends ve{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ie(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:o,texture:n,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||o<1||(null!=n||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Re=(0,o.vt)(),Fe=(0,o.vt)(),Oe=(0,o.fA)(0,0,1),Pe=(0,o.vt)(),De=(0,o.vt)(),He=(0,o.vt)(),Ne=(0,o.vt)()},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,n.j)(h,this.ray.direction,this.distance),(0,n.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,n.j)(h,this.ray.direction,this.distance),(0,n.i)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,n.d)(m,this.normal),m[3]=0,(0,s.t)(m,m,this.transformation),(0,n.d)(e,m),(0,n.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,o.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,n.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??o.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,n.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),m=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(33094),o=r(31821);function n(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(o.H`float getSnow(vec3 normal, vec3 groundNormal) {
2
2
  return smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
3
3
  }
4
4
  float getRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal) {
@@ -8,7 +8,7 @@ smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
8
8
  return snow * snowCover;
9
9
  }`),e.code.add(o.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
10
10
  return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
11
- }`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),o=r(49255),n=r(2451),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,o._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},12791:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const n=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${n.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):n().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>mt});var i=r(31821),o=r(12791),n=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,n.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){const o=e.clone();o.x=(0,g.GB)(e.x||0),o.y=(0,g.GB)(e.y||0),o.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,n.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,n.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,n.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,n.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,n.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(69622)),R=r(53966),F=r(90629),O=r(58083),P=r(48163),D=r(87317),H=r(91829),N=r(82919),z=r(71351),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var G;let U=G=class extends I.A{constructor(e){super(e),this._ray=(0,z.vt)(),this._viewport=(0,H.fA)(0,0,1,1),this._padding=(0,H.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,P.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,N.vt)(),this._fullViewport=(0,H.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,O.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,D.s)((0,H.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,D.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,D.s)((0,H.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,D.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,D.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,D.f)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,O.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,O.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.D)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,O.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,O.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,s=a+n,l=-r/2+this.row*o,c=l+o,d=(0,O.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,O.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,D.f)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,D.f)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,O.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,N.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,O.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,D.f)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new G).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,D.a)(this._viewport,e.viewport)&&(0,D.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,D.g)(e.screenPadding,this.screenPadding)>=t||(0,D.g)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.w)(k),o=(0,M.w)($),n=5e-4;return r*r>=(1-1e-10)*i*o&&(0,M.v)(e.eye,this.eye)<Math.max(i,o)*n*n}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,D.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,D.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,D.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,o=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),n=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=n):(t[0]=o,t[1]=n,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,O.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,O.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,D.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const o=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(o-r/2,0),s=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-o-r/2,0),u=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:o,fovY:n}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,o,n)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.E)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):R.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,N.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,O.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewport",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_padding",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_fov",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_nearFar",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewDirty",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewMatrix",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_pixelRatio",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"pixelRatio",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_rows",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"rows",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_columns",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"columns",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"eye",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"center",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_center",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"up",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_up",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewForward",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewUp",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewRight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"nearFar",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"near",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"far",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"screenViewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"screenPadding",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"x",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"y",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"width",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"height",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fullWidth",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fullHeight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"_aspect",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"padding",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"projectionMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"inverseProjectionMatrix",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fov",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fovX",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fovY",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewInverseTransposeMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"_projectionMatrixInternal",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"relativeElevation",void 0),U=G=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],U);const j=(0,H.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,F.r_)();class q{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new q(0,0)}static{this.Infinite=new q}}r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),new WeakMap;var Y=r(5443),X=r(39829),K=r(95108);function J(e,t,r,i){const o=function(e,t){const r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,n=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===o?0:1;if(t[r]>i&&a[r]>i)return 1===o?1:0;const s=(a[n]-t[n])/(a[r]-t[r]),l=t[n]+s*(i-t[r]);return e[r]=i,e[n]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(o(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,P.o8)(ee));break;case 2:Q(e,(0,P.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const ee=(0,P.vt)();var te=r(11964),re=r(27921);const ie=(0,T.vt)(),oe=(0,T.vt)();function ne(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function ae(e,t,r,i,o){let n=(0,M.n)(ie,e),s=(0,M.g)(n,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(n,t),l&&(0,M.j)(n,n,-1)):n=null);let c=0;if(n){(0,M.j)(oe,i,(0,M.g)(i,n)),(0,M.e)(n,n,oe);const e=(0,M.g)(n,o)/((0,M.b)(n)*(0,M.b)(o));(0,M.f)(oe,n,o),c=((0,M.g)(oe,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function se(e,t,r,i){(0,M.e)(le,r,t),(0,re.T7)(i,(0,te.LV)(t,le),e)||e===r||(0,M.d)(e,r)}const le=(0,T.vt)(),ce=(0,T.fA)(0,1,0),de=(0,T.fA)(0,0,1),ue=(0,y.vt)(),he=(0,T.vt)(),me=(0,T.vt)();function pe(e,t,r,i=ne()){const{direction:o,up:n}=i;return(0,O.N9)(ue,-(0,a.kU)(t)),(0,O.eL)(ue,ue,(0,a.kU)(r)),(0,M.p)(o,de,ue),(0,M.j)(o,o,-1),(0,M.p)(n,ce,ue),i}function fe(e,t,r,i,o){const n=t.lines[11].direction,a=(o-r.getAltitude(i))/n[2];(0,M.c)(e,i,n,a)}const ve=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o=pe(0,r,i),n=(0,T.vt)();return(0,M.j)(n,o.direction,-t),(0,M.i)(n,n,e),{up:o.up,eye:n,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),n=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,z.LV)(t.origin,t.direction),o,ve)||fe(ve,r,i,t.endpoint,o),se(ve,a,ve,l),s.push((0,P.fA)(ve[0],ve[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(ve,e[0],e[1],0),t.fromRenderCoords(ve,ve,r),[ve[0],ve[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,K.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return J(r,e,t,0),J(i,r,t,1),J(r,i,t,2),J(i,r,t,3),i}(s,i.extent),i,n)},toExtent:function(e,t,r,i,o){const n=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,he,n),(0,S.g)(t,me,n),he[0]-=r/2,me[0]+=r/2,he[1]-=i/2,me[1]+=i/2,(0,E.F)(he,n,he,a),(0,E.F)(me,n,me,a),o?(o.xmin=he[0],o.ymin=he[1],o.xmax=me[0],o.ymax=me[1],o.spatialReference=a):o=new Y.A(he[0],he[1],me[0],me[1],a),o}},Symbol.toStringTag,{value:"Module"}));var ge=r(34304),_e=r(17136),xe=r(94008),we=r(28735);class be{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,N.vt)(),this._points=(0,N.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,N.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,N.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,N.m7)(this.frustum,e)}intersectsRay(e){return(0,N.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,N.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,N.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ye(this.lines[t],e[t],e[r]),ye(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ye(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=N.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ye(e,t,r){e.origin=t,e.endpoint=r,(0,M.E)(e.direction,t,r)}r(86211);const Me=(0,T.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Te=(0,T.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,T.fA)(parseFloat(Number(Me[0]+Te[0]).toFixed(6)),parseFloat(Number(Me[1]+Te[1]).toFixed(6)),parseFloat(Number(Me[2]+Te[2]).toFixed(6)));(0,T.vt)(),(0,T.vt)(),new xe.iy,(0,z.vt)();var Ce=r(32728);const Se=(0,T.fA)(0,0,1),Ee=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Ae=(0,y.vt)(),Ie=(0,T.vt)(),Re=(0,T.vt)();function Fe(e,t,r,i=ne()){(0,M.f)(Ie,e,Se),0===(0,M.g)(Ie,Ie)&&(0,M.f)(Ie,e,Ee),(0,O.$0)(Ae,-(0,a.kU)(t),e),(0,O.e$)(Ae,Ae,-(0,a.kU)(r),Ie);const{up:o,direction:n}=i;return(0,M.f)(o,Ie,e),(0,M.n)(o,o),(0,M.p)(o,o,Ae),(0,M.n)(n,e),(0,M.q)(n,n),(0,M.p)(n,n,Ae),i}function Oe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Pe(e,t){const r=Fe(t,e.heading,e.tilt);return e.up=r.up,e}function De(e,t){const r=[],i=[],o=(0,ge.FD)();for(let n=0;n<e.length;n++){const a=e[n],s=n===e.length-1?e[0]:e[n+1],l=(0,te.Cr)(a,s,Ue),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,n,s]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),d=(0,M.c)((0,T.vt)(),Ve,l,e*o),u=(0,M.c)((0,T.vt)(),Ve,l,e*-o);n.push(a),n.push(d),s.push(u)}}}const n=[];return r.length&&n.push(r),i.length&&n.push(i),n}const He={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Ne=(0,T.fA)(1,0,0),ze=(0,T.fA)(0,1,0),Le=(0,T.vt)(),Be=(0,T.vt)(),Ve=(0,T.vt)(),Ge=new xe.iy,Ue=(0,te.vt)(),je=(0,H.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const o=Ie,n=Re;return(0,M.n)(o,e),(0,M.f)(Re,o,Se),0===(0,M.g)(Re,Re)&&(0,M.f)(Re,o,Ee),(0,M.f)(n,Re,o),ae(t,r,i,o,n)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o={eye:(0,T.vt)(),up:null,tilt:i,heading:r},n=Ie;n[0]=e[0],n[1]=e[2],n[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(n);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-n[1]*n[1]);if(b<0)return(0,M.j)(o.eye,n,f/p),o.tilt=0,Pe(o,e);const y=Math.sqrt(b),C=n[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=s):(0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e);o.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*o.eye[1],F=o.eye[1]*o.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+A-2*R*P*x+O*w;return Math.abs(D)<1e-8?((0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e)):(o.eye[0]=(O*(f*n[0]-v*n[0])-I*P*(n[0]*o.eye[1]*u+n[2]*d))/D,o.eye[2]=(O*(f*n[2]-v*n[2])-I*P*(n[2]*o.eye[1]*u-n[0]*d))/D,(0,M.j)(o.eye,o.eye,f),Oe(o.eye),Pe(o,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),o=(0,M.b)(t);return(0,a.YN)(r/(o/Math.sin(i)))+i},headingTiltToDirectionUp:Fe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),n=(0,a.YN)(r/(o/Math.sin(e)));return(0,a.KJ)(e-n)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new be(r);i.near=2,o.update(i);const n=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.D)(c,t)/(l+n),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=He,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return Ge.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(Ge,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=o.planes[5],b=[],y=(0,re.O_)(T.uY,Ne,(0,re.vt)()),C=(0,re.O_)(T.uY,ze,(0,re.vt)());(0,D.c)(je,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=o.lines[e],l=o.lines[3===e?0:e+1];for(let o=0;o<_;o++){const d=o/_,u=0===o?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Be,s.origin,l.origin,u),m=(0,Ce.nu)(s.direction,l.direction,u,Le);r.intersectManifoldClosestSilhouette((0,z.LV)(h,m),n,Ve),se(Ve,c,Ve,w),b.push((0,T.o8)(Ve)),0!==b.length&&S((0,M.v)(b.at(-1),Ve));const p=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(C,Ve)?2:0);je[p]=1}}b.length>2&&(0,M.v)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ge.FD)();return e.map(e=>{const o=[];let n=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(o.push([null,Ve[1]]),o.push([null,Ve[1]]),n=!0):o.push([Ve[0],Ve[1]]);if(n)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],i=o.at(0===e?-1:e-1);t[0]=i[0],e++;const n=o.at(e===o.length-1?0:e+1);r[0]=n[0]}return o.push(o[0]),(0,K.$3)(o)||o.reverse(),o})}((0,D.d)(je)>1?function(e,t){const r=[];for(const i of e)r.push(...De(i,t));return r}(De(b,y),C):[b],r,s);return new X.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,o){let n,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,o=(0,a.kU)(e),n=Math.sin(i/2),s=Math.cos(o),l=2*(0,a.YN)(Math.sqrt(n*n/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;n=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=_e.Y_.monotonic(n,s),s-n>180){const e=(s-n-180)/2;n+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return o?(o.xmin=n,o.ymin=l,o.xmax=s,o.ymax=c,o.spatialReference=w):o=new Y.A(n,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,we.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const We="ssao";(0,T.vt)(),r(44208);var ke=r(49186),$e=r(10107),Ze=r(64108);let qe=class extends I.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new ke.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"view",void 0),(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"consumes",void 0),(0,n.Cg)([(0,$e.MZ)()],qe.prototype,"produces",void 0),(0,n.Cg)([(0,$e.MZ)({readOnly:!0})],qe.prototype,"techniques",null),qe=(0,n.Cg)([(0,Ze.$)("esri.views.3d.webgl.RenderNode")],qe);var Ye=r(13840),Xe=r(42958),Ke=r(95774),Je=r(90644);let Qe=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(Ke.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};Qe=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],Qe);var et=r(65786);class tt extends et.Y{constructor(){super(...arguments),this.projScale=1}}class rt extends tt{constructor(){super(...arguments),this.intensity=1}}class it extends et.Y{}class ot extends it{constructor(){super(...arguments),this.blurSize=(0,P.vt)()}}var nt=r(15581);let at=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(nt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};at=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],at);var st=r(63907),lt=r(76284),ct=r(67171);const dt=2;let ut=class extends qe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=We,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new rt,this._drawParameters=new ot}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ct.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new lt.g(this.renderingContext,t,e),this.techniques.precompile(at),this.techniques.precompile(Qe),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(st.nI);if(!r||!i)return;const o=this.techniques.get(at),n=this.techniques.get(Qe);if(!o.compiled||!n.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ht/(0,nt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/dt),b=Math.round(_/dt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,dt/_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,We,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,dt/g,0),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,n.Cg)([(0,d.MZ)()],ut.prototype,"consumes",void 0),(0,n.Cg)([(0,d.MZ)()],ut.prototype,"produces",void 0),(0,n.Cg)([(0,d.MZ)({constructOnly:!0})],ut.prototype,"isEnabled",void 0),ut=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ut);const ht=.5;function mt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new o.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/dt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
11
+ }`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),o=r(49255),n=r(2451),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,o._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},12791:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const n=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${n.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):n().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>mt});var i=r(31821),o=r(12791),n=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,n.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){const o=e.clone();o.x=(0,g.GB)(e.x||0),o.y=(0,g.GB)(e.y||0),o.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,n.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,n.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,n.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,n.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,n.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(69622)),R=r(53966),F=r(90629),O=r(58083),P=r(48163),D=r(87317),H=r(91829),N=r(82919),z=r(71351),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var G;let U=G=class extends I.A{constructor(e){super(e),this._ray=(0,z.vt)(),this._viewport=(0,H.fA)(0,0,1,1),this._padding=(0,H.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,P.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,N.vt)(),this._fullViewport=(0,H.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,O.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,D.s)((0,H.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,D.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,D.s)((0,H.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,D.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,D.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,D.f)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,O.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,O.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.C)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,O.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,O.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,s=a+n,l=-r/2+this.row*o,c=l+o,d=(0,O.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,O.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,D.f)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,D.f)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,O.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,N.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,O.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,D.f)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new G).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,D.a)(this._viewport,e.viewport)&&(0,D.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,D.g)(e.screenPadding,this.screenPadding)>=t||(0,D.g)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.w)(k),o=(0,M.w)($),n=5e-4;return r*r>=(1-1e-10)*i*o&&(0,M.v)(e.eye,this.eye)<Math.max(i,o)*n*n}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,D.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,D.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,D.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,o=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),n=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=n):(t[0]=o,t[1]=n,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,O.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,O.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,D.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const o=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(o-r/2,0),s=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-o-r/2,0),u=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:o,fovY:n}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,o,n)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.D)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):R.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,N.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,O.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewport",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_padding",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_fov",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_nearFar",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewDirty",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewMatrix",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_pixelRatio",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"pixelRatio",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_rows",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"rows",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_columns",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"columns",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"eye",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"center",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_center",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"up",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_up",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewForward",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewUp",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewRight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"nearFar",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"near",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"far",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"screenViewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"screenPadding",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"x",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"y",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"width",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"height",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fullWidth",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fullHeight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"_aspect",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"padding",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"projectionMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"inverseProjectionMatrix",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fov",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fovX",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fovY",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewInverseTransposeMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"_projectionMatrixInternal",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"relativeElevation",void 0),U=G=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],U);const j=(0,H.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,F.r_)();class q{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new q(0,0)}static{this.Infinite=new q}}r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),new WeakMap;var Y=r(5443),X=r(39829),K=r(95108);function J(e,t,r,i){const o=function(e,t){const r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,n=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===o?0:1;if(t[r]>i&&a[r]>i)return 1===o?1:0;const s=(a[n]-t[n])/(a[r]-t[r]),l=t[n]+s*(i-t[r]);return e[r]=i,e[n]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(o(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,P.o8)(ee));break;case 2:Q(e,(0,P.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const ee=(0,P.vt)();var te=r(11964),re=r(27921);const ie=(0,T.vt)(),oe=(0,T.vt)();function ne(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function ae(e,t,r,i,o){let n=(0,M.n)(ie,e),s=(0,M.g)(n,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(n,t),l&&(0,M.j)(n,n,-1)):n=null);let c=0;if(n){(0,M.j)(oe,i,(0,M.g)(i,n)),(0,M.e)(n,n,oe);const e=(0,M.g)(n,o)/((0,M.b)(n)*(0,M.b)(o));(0,M.f)(oe,n,o),c=((0,M.g)(oe,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function se(e,t,r,i){(0,M.e)(le,r,t),(0,re.T7)(i,(0,te.LV)(t,le),e)||e===r||(0,M.d)(e,r)}const le=(0,T.vt)(),ce=(0,T.fA)(0,1,0),de=(0,T.fA)(0,0,1),ue=(0,y.vt)(),he=(0,T.vt)(),me=(0,T.vt)();function pe(e,t,r,i=ne()){const{direction:o,up:n}=i;return(0,O.N9)(ue,-(0,a.kU)(t)),(0,O.eL)(ue,ue,(0,a.kU)(r)),(0,M.p)(o,de,ue),(0,M.j)(o,o,-1),(0,M.p)(n,ce,ue),i}function fe(e,t,r,i,o){const n=t.lines[11].direction,a=(o-r.getAltitude(i))/n[2];(0,M.c)(e,i,n,a)}const ve=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o=pe(0,r,i),n=(0,T.vt)();return(0,M.j)(n,o.direction,-t),(0,M.i)(n,n,e),{up:o.up,eye:n,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),n=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,z.LV)(t.origin,t.direction),o,ve)||fe(ve,r,i,t.endpoint,o),se(ve,a,ve,l),s.push((0,P.fA)(ve[0],ve[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(ve,e[0],e[1],0),t.fromRenderCoords(ve,ve,r),[ve[0],ve[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,K.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return J(r,e,t,0),J(i,r,t,1),J(r,i,t,2),J(i,r,t,3),i}(s,i.extent),i,n)},toExtent:function(e,t,r,i,o){const n=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,he,n),(0,S.g)(t,me,n),he[0]-=r/2,me[0]+=r/2,he[1]-=i/2,me[1]+=i/2,(0,E.F)(he,n,he,a),(0,E.F)(me,n,me,a),o?(o.xmin=he[0],o.ymin=he[1],o.xmax=me[0],o.ymax=me[1],o.spatialReference=a):o=new Y.A(he[0],he[1],me[0],me[1],a),o}},Symbol.toStringTag,{value:"Module"}));var ge=r(34304),_e=r(17136),xe=r(94008),we=r(28735);class be{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,N.vt)(),this._points=(0,N.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,N.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,N.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,N.m7)(this.frustum,e)}intersectsRay(e){return(0,N.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,N.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,N.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ye(this.lines[t],e[t],e[r]),ye(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ye(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=N.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ye(e,t,r){e.origin=t,e.endpoint=r,(0,M.D)(e.direction,t,r)}r(86211);const Me=(0,T.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Te=(0,T.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,T.fA)(parseFloat(Number(Me[0]+Te[0]).toFixed(6)),parseFloat(Number(Me[1]+Te[1]).toFixed(6)),parseFloat(Number(Me[2]+Te[2]).toFixed(6)));(0,T.vt)(),(0,T.vt)(),new xe.iy,(0,z.vt)();var Ce=r(32728);const Se=(0,T.fA)(0,0,1),Ee=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Ae=(0,y.vt)(),Ie=(0,T.vt)(),Re=(0,T.vt)();function Fe(e,t,r,i=ne()){(0,M.f)(Ie,e,Se),0===(0,M.g)(Ie,Ie)&&(0,M.f)(Ie,e,Ee),(0,O.$0)(Ae,-(0,a.kU)(t),e),(0,O.e$)(Ae,Ae,-(0,a.kU)(r),Ie);const{up:o,direction:n}=i;return(0,M.f)(o,Ie,e),(0,M.n)(o,o),(0,M.p)(o,o,Ae),(0,M.n)(n,e),(0,M.q)(n,n),(0,M.p)(n,n,Ae),i}function Oe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Pe(e,t){const r=Fe(t,e.heading,e.tilt);return e.up=r.up,e}function De(e,t){const r=[],i=[],o=(0,ge.FD)();for(let n=0;n<e.length;n++){const a=e[n],s=n===e.length-1?e[0]:e[n+1],l=(0,te.Cr)(a,s,Ue),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,n,s]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),d=(0,M.c)((0,T.vt)(),Ve,l,e*o),u=(0,M.c)((0,T.vt)(),Ve,l,e*-o);n.push(a),n.push(d),s.push(u)}}}const n=[];return r.length&&n.push(r),i.length&&n.push(i),n}const He={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Ne=(0,T.fA)(1,0,0),ze=(0,T.fA)(0,1,0),Le=(0,T.vt)(),Be=(0,T.vt)(),Ve=(0,T.vt)(),Ge=new xe.iy,Ue=(0,te.vt)(),je=(0,H.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const o=Ie,n=Re;return(0,M.n)(o,e),(0,M.f)(Re,o,Se),0===(0,M.g)(Re,Re)&&(0,M.f)(Re,o,Ee),(0,M.f)(n,Re,o),ae(t,r,i,o,n)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o={eye:(0,T.vt)(),up:null,tilt:i,heading:r},n=Ie;n[0]=e[0],n[1]=e[2],n[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(n);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-n[1]*n[1]);if(b<0)return(0,M.j)(o.eye,n,f/p),o.tilt=0,Pe(o,e);const y=Math.sqrt(b),C=n[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=s):(0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e);o.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*o.eye[1],F=o.eye[1]*o.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+A-2*R*P*x+O*w;return Math.abs(D)<1e-8?((0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e)):(o.eye[0]=(O*(f*n[0]-v*n[0])-I*P*(n[0]*o.eye[1]*u+n[2]*d))/D,o.eye[2]=(O*(f*n[2]-v*n[2])-I*P*(n[2]*o.eye[1]*u-n[0]*d))/D,(0,M.j)(o.eye,o.eye,f),Oe(o.eye),Pe(o,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),o=(0,M.b)(t);return(0,a.YN)(r/(o/Math.sin(i)))+i},headingTiltToDirectionUp:Fe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),n=(0,a.YN)(r/(o/Math.sin(e)));return(0,a.KJ)(e-n)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new be(r);i.near=2,o.update(i);const n=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.C)(c,t)/(l+n),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=He,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return Ge.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(Ge,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=o.planes[5],b=[],y=(0,re.O_)(T.uY,Ne,(0,re.vt)()),C=(0,re.O_)(T.uY,ze,(0,re.vt)());(0,D.c)(je,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=o.lines[e],l=o.lines[3===e?0:e+1];for(let o=0;o<_;o++){const d=o/_,u=0===o?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Be,s.origin,l.origin,u),m=(0,Ce.nu)(s.direction,l.direction,u,Le);r.intersectManifoldClosestSilhouette((0,z.LV)(h,m),n,Ve),se(Ve,c,Ve,w),b.push((0,T.o8)(Ve)),0!==b.length&&S((0,M.v)(b.at(-1),Ve));const p=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(C,Ve)?2:0);je[p]=1}}b.length>2&&(0,M.v)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ge.FD)();return e.map(e=>{const o=[];let n=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(o.push([null,Ve[1]]),o.push([null,Ve[1]]),n=!0):o.push([Ve[0],Ve[1]]);if(n)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],i=o.at(0===e?-1:e-1);t[0]=i[0],e++;const n=o.at(e===o.length-1?0:e+1);r[0]=n[0]}return o.push(o[0]),(0,K.$3)(o)||o.reverse(),o})}((0,D.d)(je)>1?function(e,t){const r=[];for(const i of e)r.push(...De(i,t));return r}(De(b,y),C):[b],r,s);return new X.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,o){let n,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,o=(0,a.kU)(e),n=Math.sin(i/2),s=Math.cos(o),l=2*(0,a.YN)(Math.sqrt(n*n/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;n=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=_e.Y_.monotonic(n,s),s-n>180){const e=(s-n-180)/2;n+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return o?(o.xmin=n,o.ymin=l,o.xmax=s,o.ymax=c,o.spatialReference=w):o=new Y.A(n,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,we.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const We="ssao";(0,T.vt)(),r(44208);var ke=r(49186),$e=r(10107),Ze=r(64108);let qe=class extends I.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new ke.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"view",void 0),(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"consumes",void 0),(0,n.Cg)([(0,$e.MZ)()],qe.prototype,"produces",void 0),(0,n.Cg)([(0,$e.MZ)({readOnly:!0})],qe.prototype,"techniques",null),qe=(0,n.Cg)([(0,Ze.$)("esri.views.3d.webgl.RenderNode")],qe);var Ye=r(13840),Xe=r(42958),Ke=r(95774),Je=r(90644);let Qe=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(Ke.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};Qe=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],Qe);var et=r(65786);class tt extends et.Y{constructor(){super(...arguments),this.projScale=1}}class rt extends tt{constructor(){super(...arguments),this.intensity=1}}class it extends et.Y{}class ot extends it{constructor(){super(...arguments),this.blurSize=(0,P.vt)()}}var nt=r(15581);let at=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(nt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};at=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],at);var st=r(63907),lt=r(76284),ct=r(67171);const dt=2;let ut=class extends qe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=We,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new rt,this._drawParameters=new ot}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ct.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new lt.g(this.renderingContext,t,e),this.techniques.precompile(at),this.techniques.precompile(Qe),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(st.nI);if(!r||!i)return;const o=this.techniques.get(at),n=this.techniques.get(Qe);if(!o.compiled||!n.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ht/(0,nt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/dt),b=Math.round(_/dt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,dt/_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,We,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,dt/g,0),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,n.Cg)([(0,d.MZ)()],ut.prototype,"consumes",void 0),(0,n.Cg)([(0,d.MZ)()],ut.prototype,"produces",void 0),(0,n.Cg)([(0,d.MZ)({constructOnly:!0})],ut.prototype,"isEnabled",void 0),ut=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ut);const ht=.5;function mt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new o.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/dt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
12
12
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
13
13
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
14
14
  }
@@ -227,7 +227,7 @@ return dpDummy * hiD + loD;
227
227
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
228
228
  }
229
229
  forwardLinearDepthToReadShadowMap();
230
- `),t.include(x.kA,e),U.include(_.n,e),t.include(A.S,e),U.include(n.HQ,e),t.include(L.D,e),(0,R.yu)(U,e),U.uniforms.add(G.uniforms.get("localOrigin"),new F.t("ambient",e=>e.ambient),new F.t("diffuse",e=>e.diffuse),new P.m("opacity",e=>e.opacity),new P.m("layerOpacity",e=>e.layerOpacity)),ee&&U.uniforms.add(new H.N("tex",e=>e.texture)),t.include(M._,e),U.include(y.c,e),U.include(I.N),t.include(b.r,e),U.include(N.b,e),(0,x.a8)(U),(0,x.eU)(U),(0,w.O4)(U),U.main.add(D.H`
230
+ `),U.include(x.kA,e),U.include(_.n,e),t.include(A.S,e),U.include(n.HQ,e),t.include(L.D,e),(0,R.yu)(U,e),U.uniforms.add(G.uniforms.get("localOrigin"),new F.t("ambient",e=>e.ambient),new F.t("diffuse",e=>e.diffuse),new P.m("opacity",e=>e.opacity),new P.m("layerOpacity",e=>e.layerOpacity)),ee&&U.uniforms.add(new H.N("tex",e=>e.texture)),t.include(M._,e),U.include(y.c,e),U.include(I.N),t.include(b.r,e),U.include(N.b,e),(0,x.a8)(U),(0,x.eU)(U),(0,w.O4)(U),U.main.add(D.H`
231
231
  discardBySlice(vpos);
232
232
  discardByTerrainDepth();
233
233
  ${ee?D.H`
@@ -516,18 +516,17 @@ return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.ma
516
516
  return MaskedColor(color, isnan(color));
517
517
  }`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>l,Um:()=>c,kE:()=>a});var i=r(4576),o=r(34727),n=r(77194);function a(e,t,r,i,n,a){let s=r.screenLength*e.pixelRatio;null!=n&&(d.update(i,t,n,a),s=d.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const s=(0,i.VO)();function l(e,t){let r=!1;for(const i in t){const o=t[i];void 0!==o&&(Array.isArray(o)?Array.isArray(e[i])&&s(o,e[i])||(e[i]=o.slice(),r=!0):e[i]!==o&&(r=!0,e[i]=o))}return r}const c={multiply:1,ignore:2,replace:3,tint:4},d=new n.PS},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,n]=t.split("."),a=/^\s*\d+\s*$/;if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),l=parseInt(n,10);return new e(s,l,r)}}},46686:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(31821);function o(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
518
518
  void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
519
- `)}},46859:(e,t,r)=>{r.d(t,{h:()=>B}),r(44208);var i=r(49186),o=r(65529),n=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(31217),h=r(95117),m=r(2741);let p;var f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function w(){return null==x&&(p??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,m.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=p,_=await x),x}function b(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function y(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,o){const n=(0,g.MW)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=o,t.height=n,new v.g(e,t,{type:"compressed",levels:m})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function I(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const R=I("DXT1"),F=I("DXT3"),O=I("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case R:o=8,n=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case F:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:n,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function H(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const o=Math.max(e,t),n=e*t;if(o<=i&&n<=r)return[e,t];const a=Math.min(Math.sqrt(r/n),i/o);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:N(e,r,i)}function N(e,t,r){if(e instanceof ImageData)return N(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}var z=r(620),L=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new o.bk,this._parameters={...G,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new L.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?b(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?V(e):t,o=t.pixelFormat??6408,n=(0,g.wH)(o);return(t.mipmap?4/3:1)*r*i*n||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new v.g(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,s.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?9987:9729,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new v.g(e,t,o)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const o=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const o=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,z.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new v.g(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.y)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((o,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,n.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),o(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=H(r,e.parameters));const i=V(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.width=i.width,o.height=i.height,o.compress=this._parameters.compressionOptions,this._texture=new v.g(e,o,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,n.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function V(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const G={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},47286:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,o,n)=>i.setUniform2fv(e,t(o,n),r))}}},49255:(e,t,r)=>{function i(e){return 3===e||4===e||5===e||6===e||7===e}function o(e){return function(e){return a(e)||s(e)}(e)||2===e}function n(e){return 0===e}function a(e){return n(e)||function(e){return 8===e||9===e}(e)}function s(e){return 1===e}function l(e){return s(e)||i(e)}r.d(t,{Bf:()=>i,Dz:()=>l,_o:()=>n,dX:()=>a,iq:()=>o})},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51255:(e,t,r)=>{r.d(t,{D:()=>c});var i=r(49255),o=r(63201),n=r(42593),a=r(63365),s=r(31821),l=r(49788);function c(e,t){e.include(n.Q,t),e.include(o.NL,t),e.fragment.include(a.a);const{output:r,oitPass:c,hasEmission:d,discardInvisibleFragments:u,snowCover:h}=t,m=9===r,p=(0,i._o)(r)&&1===c,f=(0,i._o)(r)&&1!==c;let v=0;(f||p)&&e.outputs.add("fragColor","vec4",v++),d&&e.outputs.add("fragEmission","vec4",v++),p&&e.outputs.add("fragAlpha","float",v++),e.fragment.code.add(s.H`
520
- void outputColorHighlightOLID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveSymbolColor ${(0,s.If)(h,", float snow")}) {
521
- ${(0,s.If)(m,"finalColor.a = 1.0;")}
519
+ `)}},46859:(e,t,r)=>{r.d(t,{h:()=>B}),r(44208);var i=r(49186),o=r(65529),n=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(31217),h=r(95117),m=r(2741);let p;var f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function w(){return null==x&&(p??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,m.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=p,_=await x),x}function b(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function y(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,o){const n=(0,g.MW)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=o,t.height=n,new v.g(e,t,{type:"compressed",levels:m})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function I(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const R=I("DXT1"),F=I("DXT3"),O=I("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case R:o=8,n=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case F:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:n,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function H(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const o=Math.max(e,t),n=e*t;if(o<=i&&n<=r)return[e,t];const a=Math.min(Math.sqrt(r/n),i/o);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:N(e,r,i)}function N(e,t,r){if(e instanceof ImageData)return N(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}var z=r(620),L=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new o.bk,this._parameters={...G,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new L.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?b(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?V(e):t,o=t.pixelFormat??6408,n=(0,g.wH)(o);return(t.mipmap?4/3:1)*r*i*n||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new v.g(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,s.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?9987:9729,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new v.g(e,t,o)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const o=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const o=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,z.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new v.g(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.y)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((o,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,n.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),o(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=H(r,e.parameters));const i=V(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.width=i.width,o.height=i.height,o.compress=this._parameters.compressionOptions,this._texture=new v.g(e,o,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,n.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function V(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const G={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},47286:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,o,n)=>i.setUniform2fv(e,t(o,n),r))}}},49255:(e,t,r)=>{function i(e){return 3===e||4===e||5===e||6===e||7===e}function o(e){return function(e){return a(e)||s(e)}(e)||2===e}function n(e){return 0===e}function a(e){return n(e)||function(e){return 8===e||9===e}(e)}function s(e){return 1===e}function l(e){return s(e)||i(e)}r.d(t,{Bf:()=>i,Dz:()=>l,_o:()=>n,dX:()=>a,iq:()=>o})},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51255:(e,t,r)=>{r.d(t,{D:()=>c});var i=r(49255),o=r(63201),n=r(42593),a=r(63365),s=r(31821),l=r(49788);function c(e,t){e.include(n.Q,t),e.include(o.NL,t),e.fragment.include(a.a);const{output:r,oitPass:c,hasEmission:d,discardInvisibleFragments:u,oitPremultipliedAlpha:h,snowCover:m}=t,p=9===r,f=(0,i._o)(r)&&1===c,v=(0,i._o)(r)&&1!==c;let g=0;(v||f)&&e.outputs.add("fragColor","vec4",g++),d&&e.outputs.add("fragEmission","vec4",g++),f&&e.outputs.add("fragAlpha","float",g++),e.fragment.code.add(s.H`
520
+ void outputColorHighlightOLID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveSymbolColor ${(0,s.If)(m,", float snow")}) {
521
+ ${(0,s.If)(p,"finalColor.a = 1.0;")}
522
522
  ${(0,s.If)(u,`if (finalColor.a < ${s.H.float(l.Q)}) { discard; }`)}
523
-
524
523
  finalColor = applySlice(finalColor, vWorldPosition);
525
- ${(0,s.If)(p,s.H`fragColor = premultiplyAlpha(finalColor);
526
- fragAlpha = finalColor.a;`)}
527
- ${(0,s.If)(f,"fragColor = finalColor;")}
528
- ${(0,s.If)(d,`fragEmission = ${(0,s.If)(h,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}`)}
524
+
525
+ ${(0,s.If)(f,`${(0,s.If)(h,"fragColor = vec4(finalColor.rgb, sqrt(finalColor.a));","fragColor = premultiplyAlpha(finalColor);")}\n fragAlpha = finalColor.a;`)}
526
+ ${(0,s.If)(v,"fragColor = finalColor;")}
527
+ ${(0,s.If)(d,`fragEmission = ${(0,s.If)(m,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}`)}
529
528
  calculateOcclusionAndOutputHighlight();
530
- ${(0,s.If)(m,"outputObjectAndLayerIdColor();")}
529
+ ${(0,s.If)(p,"outputObjectAndLayerIdColor();")}
531
530
  }
532
531
  `)}},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>c,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),o=r(31821),n=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new n.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(o.H`void forwardColorUV(){
533
532
  colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
@@ -601,7 +600,7 @@ vuvRegion = uvRegion;
601
600
  forwardLinearDepthToReadShadowMap();
602
601
  gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
603
602
  ${(0,R.If)(G,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
604
- `);const{hasColorTexture:$,hasColorTextureTransform:Z}=e;return t.include(g.kA,e),L.include(v.n,e),t.include(T.S,e),L.include(n.HQ,e),t.include(D.D,e),(0,S.yu)(L,e),(0,_.Gc)(L),(0,g.a8)(L),(0,g.eU)(L),L.uniforms.add(z.uniforms.get("localOrigin"),z.uniforms.get("view"),new E.t("ambient",e=>e.ambient),new E.t("diffuse",e=>e.diffuse),new I.m("opacity",e=>e.opacity),new I.m("layerOpacity",e=>e.layerOpacity)),$&&L.uniforms.add(new F.N("tex",e=>e.texture)),t.include(w._,e),L.include(x.c,e),L.include(C.N),L.include(O.b,e),(0,_.O4)(L),L.main.add(R.H`
603
+ `);const{hasColorTexture:$,hasColorTextureTransform:Z}=e;return L.include(g.kA,e),L.include(v.n,e),t.include(T.S,e),L.include(n.HQ,e),t.include(D.D,e),(0,S.yu)(L,e),(0,_.Gc)(L),(0,g.a8)(L),(0,g.eU)(L),L.uniforms.add(z.uniforms.get("localOrigin"),z.uniforms.get("view"),new E.t("ambient",e=>e.ambient),new E.t("diffuse",e=>e.diffuse),new I.m("opacity",e=>e.opacity),new I.m("layerOpacity",e=>e.layerOpacity)),$&&L.uniforms.add(new F.N("tex",e=>e.texture)),t.include(w._,e),L.include(x.c,e),L.include(C.N),L.include(O.b,e),(0,_.O4)(L),L.main.add(R.H`
605
604
  discardBySlice(vpos);
606
605
  discardByTerrainDepth();
607
606
  vec4 texColor = ${$?`texture(tex, ${Z?"colorUV":"vuv0"})`:" vec4(1.0)"};
@@ -746,7 +745,7 @@ return color;
746
745
  }`)}const w=(0,s.vt)()},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>m});var i=r(21818),o=r(29242),n=r(91829),a=r(96336),s=r(33752),l=r(31821),c=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case 0:case 1:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new c.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new d.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)).code.add(l.H`void forwardNormal() {
747
746
  vNormalWorld = transformNormalGlobalFromModel * normalModel();
748
747
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
749
- }`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,o.vt)(),this.toMapSpace=(0,n.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>l,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.m)(s,o.uY))&&null==l&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),l=(0,o.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),o=r(44208),n=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>n.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:o}=e;if(o&&(p(o)||f(o))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:o}=e;o&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function v(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!v(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let o=Math.max(t,r);return 32879===e&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const y=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>n.A.getLogger("esri/views/webgl/Texture");class T{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!v(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!v(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,o,n,a,s=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=w(l);const{context:c,pixelFormat:d,dataType:u,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+o>l.width||r+n>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;s&&(o&&n||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,s)),g(a)?f.texSubImage2D(h,e,t,r,o,n,d,u,a):v(a)?f.compressedTexSubImage2D(h,e,t,r,o,n,l.internalFormat,a.levels[e]):f.texSubImage2D(h,e,t,r,o,n,d,u,a),s&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,T.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||M().warn("Attempting to set 3D texture data on a non-3D texture");const f=d.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||t+n>c.width||r+a>c.height||o+s>c.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=d;if(v(l))l=l.levels[e],g.compressedTexSubImage3D(p,e,t,r,o,n,a,s,c.internalFormat,l);else{const i=l;g.texSubImage3D(p,e,t,r,o,n,a,s,u,h,i)}d.bindTexture(f,T.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,T.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,o=r.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),r.context.instanceCounter.increment(d.vt.Texture,this)),m(r);const n=r.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const a=t??r.target,l=_(a);if(g(e))this._setDataFromTexImageSource(e,a);else{const{width:t,height:n,depth:u}=r;if(null==t||null==n)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==u)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=w(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,r.internalFormat,r.hasMipmap,t,n,u),v(e)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,a)}else this._texImage(a,0,r.internalFormat,t,n,u,e),(0,c.Y2)(o),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),r.context.bindTexture(n,T.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const o=_(t),{width:n,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,s),this._texImage(t,0,i.internalFormat,n,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,l=x(r,o,n,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)},c)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,o,n,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,o,n,a)}else s.texStorage2D(e,l,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,n,a,u,h,r)}else l.texSubImage2D(e,t,0,0,o,n,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,n,a,0,u,h,d)}else l.texImage2D(e,t,r,o,n,0,u,h,d)}}_compressedTexImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,n,a,0,s)}else l.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:o,preMultiplyAlpha:n,hasMipmap:a}=this._descriptor,s=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:u}=i.capabilities;if(!T.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!d&&!u)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,s?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:a,hasETC:!!d,hasS3TC:!!u},s=await T.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),s.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=s.internalFormat,this._setData(s.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{s?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==o||l&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||l&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),l&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",.2),h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
748
+ }`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,o.vt)(),this.toMapSpace=(0,n.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>l,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.m)(s,o.uY))&&null==l&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),l=(0,o.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),o=r(44208),n=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>n.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:o}=e;if(o&&(p(o)||f(o))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:o}=e;o&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function v(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!v(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let o=Math.max(t,r);return 32879===e&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const y=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>n.A.getLogger("esri/views/webgl/Texture");class T{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!v(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!v(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,o,n,a,s=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=w(l);const{context:c,pixelFormat:d,dataType:u,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+o>l.width||r+n>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;s&&(o&&n||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,s)),g(a)?f.texSubImage2D(h,e,t,r,o,n,d,u,a):v(a)?f.compressedTexSubImage2D(h,e,t,r,o,n,l.internalFormat,a.levels[e]):f.texSubImage2D(h,e,t,r,o,n,d,u,a),s&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,T.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||M().warn("Attempting to set 3D texture data on a non-3D texture");const f=d.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||t+n>c.width||r+a>c.height||o+s>c.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=d;if(v(l))l=l.levels[e],g.compressedTexSubImage3D(p,e,t,r,o,n,a,s,c.internalFormat,l);else{const i=l;g.texSubImage3D(p,e,t,r,o,n,a,s,u,h,i)}d.bindTexture(f,T.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,T.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,o=r.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),r.context.instanceCounter.increment(d.vt.Texture,this)),m(r);const n=r.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const a=t??r.target,l=_(a);if(g(e))this._setDataFromTexImageSource(e,a);else{const{width:t,height:n,depth:u}=r;if(null==t||null==n)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==u)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=w(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,r.internalFormat,r.hasMipmap,t,n,u),v(e)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,a)}else this._texImage(a,0,r.internalFormat,t,n,u,e),(0,c.Y2)(o),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),r.context.bindTexture(n,T.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const o=_(t),{width:n,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,s),this._texImage(t,0,i.internalFormat,n,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,l=x(r,o,n,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)},c)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,o,n,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,o,n,a)}else s.texStorage2D(e,l,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,n,a,u,h,r)}else l.texSubImage2D(e,t,0,0,o,n,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,n,a,0,u,h,d)}else l.texImage2D(e,t,r,o,n,0,u,h,d)}}_compressedTexImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,n,a,0,s)}else l.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:o,preMultiplyAlpha:n,hasMipmap:a}=this._descriptor,s=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:u}=i.capabilities;if(!T.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!d&&!u)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,s?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:a,hasETC:!!d,hasS3TC:!!u},s=await T.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),s.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=s.internalFormat,this._setData(s.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{s?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==o||l&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||l&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),l&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",.2),h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (rejectBySlice(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
750
749
  vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}function d(e,t){h(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const u=l.H`struct SliceFactors {
751
750
  float front;
752
751
  float side0;
@@ -780,11 +779,8 @@ return factors.front < 0.0
780
779
  bool sliceEnabled() {
781
780
  return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
782
781
  }
783
- bool sliceByPlane(vec3 pos) {
784
- return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
785
- }
786
782
  bool rejectBySlice(vec3 pos) {
787
- return sliceByPlane(pos);
783
+ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
788
784
  }`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function m(e,t,r){return e.instancedDoublePrecision?(0,n.h)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function p(e,t){return null!=e?(0,n.e)(x,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.Tl)(b,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function v(e,t,r){if(null==r.slicePlane)return a.uY;const i=m(e,t,r),o=p(i,r.slicePlane),s=f(e,i,r);return null!=s?(0,n.p)(x,o,s):o}function g(e,t,r,i){if(null==i||null==r.slicePlane)return a.uY;const o=m(e,t,r),s=p(o,r.slicePlane),l=f(e,o,r);return null!=l?((0,n.i)(w,i,s),(0,n.p)(x,s,l),(0,n.p)(w,w,l),(0,n.e)(w,w,x)):i}const _=(0,a.vt)(),x=(0,a.vt)(),w=(0,a.vt)(),b=(0,o.vt)()},76597:(e,t,r)=>{r.d(t,{d:()=>n});var i=r(33120),o=r(31821);function n(e){(0,i.i$)(e),e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
789
785
  vec4 eye = view * vec4(pos, 1.0);
790
786
  depth = calculateLinearDepth(nearFar,eye.z);
@@ -820,10 +816,10 @@ rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.co
820
816
  }`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>l,VC:()=>c}),r(44208);var i=r(34727),o=(r(77690),r(29242),r(58083),r(9093)),n=r(38954),a=r(51850),s=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));class l extends s.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function c(e,t,r){if(!t.vvSize)return(0,n.h)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,n.d)(e,t.vvSize.fallback);for(let o=0;o<3;++o){const n=t.vvSize.offset[o]+r[0]*t.vvSize.factor[o];e[o]=(0,i.qE)(n,t.vvSize.minSize[o],t.vvSize.maxSize[o])}return e}(0,o.vt)(),(0,a.vt)(),(0,o.vt)()},78754:(e,t,r)=>{r.d(t,{F:()=>n});var i=r(24326),o=r(97146);class n{constructor(e){this.id=(0,i.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,o.Dg)(r.indices)})}get attributes(){return this._attributes}}},82048:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(31821);function o(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
821
817
  gl_Position = vec4(position, 0.0, 1.0);
822
818
  ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
823
- `)}},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),o=r(38954),n=r(97146),a=r(57917),s=r(29920),l=r(78754),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.e)(m,t,e),(0,o.e)(p,r,e),.5*(0,o.b)((0,o.f)(m,m,p))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const m=(0,c.vt)(),p=(0,c.vt)(),f=(0,c.vt)(),v=(0,c.vt)(),g=(0,c.vt)(),_=(0,c.vt)();var x=r(24326);class w{constructor(){this.uid=(0,x.c)()}}class b extends w{constructor(e){super(),this.highlightName=e,this.channel=0}}var y=r(620),M=r(94656);class T extends l.F{constructor(e,t,r=null,i=0,o=null,n=-1,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=o,this.edgeIndicesLength=n,this.baseGeometry=a,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null;const s=this.positionAttribute;null!=s&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=s.indices.length)}instantiate(e={}){const t=new T(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.p)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0),(0,o.h)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,d=n[e+2]*r;(0,o.h)(f,i[l],i[l+1],i[l+2]),(0,o.h)(v,i[c],i[c+1],i[c+2]),(0,o.h)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,o.i)(f,f,v),(0,o.i)(f,f,g),(0,o.j)(f,f,1/3*u),(0,o.i)(t,t,f),a+=u):((0,o.i)(_,_,f),(0,o.i)(_,_,v),(0,o.i)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.j)(t,t,1/a),0):0===s||((0,o.j)(t,_,1/s),0)))}(this.positionAttribute,e)}_computeAttachmentOriginLines(e){const t=this.positionAttribute;return function(e,t,r){if(!e)return!1;(0,o.h)(r,0,0,0),(0,o.h)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,o.j)(f,(0,o.i)(f,f,v),.5);const h=(0,o.H)(f,v);h>0?((0,o.i)(r,r,(0,o.j)(f,f,h)),i+=h):0===i&&((0,o.i)(_,_,f),n++)}return 0!==i?((0,o.j)(r,r,1/i),!0):0!==n&&((0,o.j)(r,_,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.j)(t,t,1/s),s>0}(this.positionAttribute,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.positionAttribute;if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,y.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,n.tM)(e.indices.length/t);return new s.j(r,t,e)}get transformation(){return this._transformation??i.zK}set transformation(e){this._transformation=e&&e!==i.zK?(0,i.o8)(e):null}get highlights(){return this._highlights||C}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const C=new Set},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),o=(r(44208),r(38954)),n=r(51850),a=r(87317),s=r(91829),l=r(23205),c=r(14314),d=r(31821);function u(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,o.h)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
819
+ `)}},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),o=r(38954),n=r(97146),a=r(57917),s=r(29920),l=r(78754),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.e)(m,t,e),(0,o.e)(p,r,e),.5*(0,o.b)((0,o.f)(m,m,p))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const m=(0,c.vt)(),p=(0,c.vt)(),f=(0,c.vt)(),v=(0,c.vt)(),g=(0,c.vt)(),_=(0,c.vt)();var x=r(24326);class w{constructor(){this.uid=(0,x.c)()}}class b extends w{constructor(e){super(),this.highlightName=e,this.channel=0}}var y=r(620),M=r(94656);class T extends l.F{constructor(e,t,r=null,i=0,o=null,n=-1,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=o,this.edgeIndicesLength=n,this.baseGeometry=a,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null;const s=this.positionAttribute;null!=s&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=s.indices.length)}instantiate(e={}){const t=new T(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.p)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0),(0,o.h)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,d=n[e+2]*r;(0,o.h)(f,i[l],i[l+1],i[l+2]),(0,o.h)(v,i[c],i[c+1],i[c+2]),(0,o.h)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,o.i)(f,f,v),(0,o.i)(f,f,g),(0,o.j)(f,f,1/3*u),(0,o.i)(t,t,f),a+=u):((0,o.i)(_,_,f),(0,o.i)(_,_,v),(0,o.i)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.j)(t,t,1/a),0):0===s||((0,o.j)(t,_,1/s),0)))}(this.positionAttribute,e)}_computeAttachmentOriginLines(e){const t=this.positionAttribute;return function(e,t,r){if(!e)return!1;(0,o.h)(r,0,0,0),(0,o.h)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,o.j)(f,(0,o.i)(f,f,v),.5);const h=(0,o.G)(f,v);h>0?((0,o.i)(r,r,(0,o.j)(f,f,h)),i+=h):0===i&&((0,o.i)(_,_,f),n++)}return 0!==i?((0,o.j)(r,r,1/i),!0):0!==n&&((0,o.j)(r,_,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.j)(t,t,1/s),s>0}(this.positionAttribute,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.positionAttribute;if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,y.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,n.tM)(e.indices.length/t);return new s.j(r,t,e)}get transformation(){return this._transformation??i.zK}set transformation(e){this._transformation=e&&e!==i.zK?(0,i.o8)(e):null}get highlights(){return this._highlights||C}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const C=new Set},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),o=(r(44208),r(38954)),n=r(51850),a=r(87317),s=r(91829),l=r(23205),c=r(14314),d=r(31821);function u(e,t){const r=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===r?(e.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,o.h)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),e.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
824
820
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
825
821
  return ambientLight * (1.0 - ambientOcclusion);
826
- }`)):1===i?(r.uniforms.add(new c.I("lightingAmbientSH_R",({lighting:e})=>(0,a.c)(m,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new c.I("lightingAmbientSH_G",({lighting:e})=>(0,a.c)(m,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new c.I("lightingAmbientSH_B",({lighting:e})=>(0,a.c)(m,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
822
+ }`)):1===r?(e.uniforms.add(new c.I("lightingAmbientSH_R",({lighting:e})=>(0,a.c)(m,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new c.I("lightingAmbientSH_G",({lighting:e})=>(0,a.c)(m,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new c.I("lightingAmbientSH_B",({lighting:e})=>(0,a.c)(m,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),e.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
827
823
  vec4 sh0 = vec4(
828
824
  0.282095,
829
825
  0.488603 * normal.x,
@@ -836,7 +832,7 @@ dot(lightingAmbientSH_G, sh0),
836
832
  dot(lightingAmbientSH_B, sh0)
837
833
  );
838
834
  return ambientLight * (1.0 - ambientOcclusion);
839
- }`)):2===i&&(r.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,o.h)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0])),new c.I("lightingAmbientSH_R1",({lighting:e})=>(0,a.c)(m,e.sh.r[1],e.sh.r[2],e.sh.r[3],e.sh.r[4])),new c.I("lightingAmbientSH_G1",({lighting:e})=>(0,a.c)(m,e.sh.g[1],e.sh.g[2],e.sh.g[3],e.sh.g[4])),new c.I("lightingAmbientSH_B1",({lighting:e})=>(0,a.c)(m,e.sh.b[1],e.sh.b[2],e.sh.b[3],e.sh.b[4])),new c.I("lightingAmbientSH_R2",({lighting:e})=>(0,a.c)(m,e.sh.r[5],e.sh.r[6],e.sh.r[7],e.sh.r[8])),new c.I("lightingAmbientSH_G2",({lighting:e})=>(0,a.c)(m,e.sh.g[5],e.sh.g[6],e.sh.g[7],e.sh.g[8])),new c.I("lightingAmbientSH_B2",({lighting:e})=>(0,a.c)(m,e.sh.b[5],e.sh.b[6],e.sh.b[7],e.sh.b[8]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
835
+ }`)):2===r&&(e.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,o.h)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0])),new c.I("lightingAmbientSH_R1",({lighting:e})=>(0,a.c)(m,e.sh.r[1],e.sh.r[2],e.sh.r[3],e.sh.r[4])),new c.I("lightingAmbientSH_G1",({lighting:e})=>(0,a.c)(m,e.sh.g[1],e.sh.g[2],e.sh.g[3],e.sh.g[4])),new c.I("lightingAmbientSH_B1",({lighting:e})=>(0,a.c)(m,e.sh.b[1],e.sh.b[2],e.sh.b[3],e.sh.b[4])),new c.I("lightingAmbientSH_R2",({lighting:e})=>(0,a.c)(m,e.sh.r[5],e.sh.r[6],e.sh.r[7],e.sh.r[8])),new c.I("lightingAmbientSH_G2",({lighting:e})=>(0,a.c)(m,e.sh.g[5],e.sh.g[6],e.sh.g[7],e.sh.g[8])),new c.I("lightingAmbientSH_B2",({lighting:e})=>(0,a.c)(m,e.sh.b[5],e.sh.b[6],e.sh.b[7],e.sh.b[8]))),e.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
840
836
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
841
837
  vec4 sh1 = vec4(
842
838
  0.488603 * normal.x,
@@ -861,7 +857,7 @@ dot(lightingAmbientSH_G2, sh2),
861
857
  dot(lightingAmbientSH_B2, sh2)
862
858
  );
863
859
  return ambientLight * (1.0 - ambientOcclusion);
864
- }`),1!==t.pbrMode&&2!==t.pbrMode||r.code.add(d.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
860
+ }`),1!==t.pbrMode&&2!==t.pbrMode||e.code.add(d.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
865
861
  vec3 calculateAmbientRadiance(float ambientOcclusion)
866
862
  {
867
863
  vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
@@ -873,19 +869,23 @@ vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
873
869
  return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
874
870
  }`)}function y(e){e.code.add(d.H`vec3 tonemapACES(vec3 x) {
875
871
  return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
876
- }`)}function M(e){e.constants.add("ambientBoostFactor","float",w)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const r=e.fragment,{pbrMode:o,spherical:n,hasColorTexture:a}=t;r.include(p.n,t),0!==o&&r.include(v.c,t),e.include(u,t),r.include(g.p),r.include(y,t);const s=!(2===o&&!a);switch(s&&r.include(b),r.code.add(d.H`
872
+ }`)}function M(e){e.constants.add("ambientBoostFactor","float",w)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const{pbrMode:r,spherical:o,hasColorTexture:n}=t;e.include(p.n,t),0!==r&&e.include(v.c,t),e.include(u,t),e.include(g.p),e.include(y,t);const a=!(2===r&&!n);switch(a&&e.include(b),e.code.add(d.H`
877
873
  const float GAMMA_SRGB = ${d.H.float(i.Tf)};
878
874
  const float INV_GAMMA_SRGB = 0.4761904;
879
- ${(0,d.If)(0!==o,"const float GROUND_REFLECTANCE = 0.2;")}
880
- `),M(r),T(r),(0,f.Gc)(r),r.code.add(d.H`
875
+ ${(0,d.If)(0!==r,"const float GROUND_REFLECTANCE = 0.2;")}
876
+ `),M(e),T(e),(0,f.Gc)(e),e.code.add(d.H`
877
+ float additionalDirectedAmbientLight(float lightAlignment) {
878
+ return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
879
+ }
880
+
881
881
  float additionalDirectedAmbientLight(vec3 vPosWorld) {
882
- float vndl = dot(${n?d.H`normalize(vPosWorld)`:d.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
883
- return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
882
+ float lightAlignment = dot(${o?d.H`normalize(vPosWorld)`:d.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
883
+ return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
884
884
  }
885
- `),(0,f.O4)(r),r.code.add(d.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
885
+ `),(0,f.O4)(e),e.code.add(d.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
886
886
  float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
887
887
  return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
888
- }`),o){case 0:case 4:case 3:e.include(f.Vt),r.code.add(d.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {
888
+ }`),r){case 0:case 4:case 3:e.include(f.Vt),e.code.add(d.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {
889
889
  vec3 mainLighting = applyShading(normalWorld, shadow);
890
890
  vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
891
891
  vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
@@ -893,7 +893,7 @@ vec3 totalLight = mainLighting + ambientLighting + additionalLight;
893
893
  totalLight = min(totalLight, vec3(PI));
894
894
  vec3 outColor = vec3((albedoLinear / PI) * totalLight);
895
895
  return pow(outColor, vec3(INV_GAMMA_SRGB));
896
- }`);break;case 1:case 2:r.code.add(d.H`const float fillLightIntensity = 0.25;
896
+ }`);break;case 1:case 2:e.code.add(d.H`const float fillLightIntensity = 0.25;
897
897
  const float horizonLightDiffusion = 0.4;
898
898
  const float additionalAmbientIrradianceFactor = 0.02;
899
899
  vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
@@ -908,9 +908,9 @@ inputs.RdotNG = clamp(dot(reflectedView, groundNormal), -1.0, 1.0);
908
908
  inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
909
909
  inputs.ssao = ssao;
910
910
  inputs.metalness = mrr[0];
911
- inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(d.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
911
+ inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),e.code.add(d.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
912
912
  inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
913
- inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new _.o("hasFillLights",e=>e.enableFillLights)):r.constants.add("hasFillLights","bool",!1),r.code.add(d.H`vec3 ambientDir = vec3(5.0 * groundNormal[1] - groundNormal[0] * groundNormal[2], - 5.0 * groundNormal[0] - groundNormal[2] * groundNormal[1], groundNormal[1] * groundNormal[1] + groundNormal[0] * groundNormal[0]);
913
+ inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?e.uniforms.add(new _.o("hasFillLights",e=>e.enableFillLights)):e.constants.add("hasFillLights","bool",!1),e.code.add(d.H`vec3 ambientDir = vec3(5.0 * groundNormal[1] - groundNormal[0] * groundNormal[2], - 5.0 * groundNormal[0] - groundNormal[2] * groundNormal[1], groundNormal[1] * groundNormal[1] + groundNormal[0] * groundNormal[0]);
914
914
  ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
915
915
  inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
916
916
  float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
@@ -918,7 +918,7 @@ vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity;
918
918
  vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
919
919
  vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
920
920
  inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
921
- inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new x.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new x.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(d.H`vec3 horizonRingDir = inputs.RdotNG * groundNormal - reflectedView;
921
+ inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),e.uniforms.add(new x.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new x.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(d.H`vec3 horizonRingDir = inputs.RdotNG * groundNormal - reflectedView;
922
922
  vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
923
923
  inputs.NdotH_Horizon = dot(normal, horizonRingH);
924
924
  float NdotH = clamp(dot(normal, h), 0.0, 1.0);
@@ -928,14 +928,14 @@ vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbi
928
928
  float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
929
929
  inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
930
930
  inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
931
- inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),r.code.add(d.H`
931
+ inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),e.code.add(d.H`
932
932
  vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
933
933
  vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
934
934
  vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent;
935
- ${s?d.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:d.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
935
+ ${a?d.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:d.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
936
936
  return outColor;
937
937
  }
938
- `);break;case 5:case 6:(0,f.Gc)(r),(0,f.O4)(r),r.code.add(d.H`const float roughnessTerrain = 0.5;
938
+ `);break;case 5:case 6:(0,f.Gc)(e),(0,f.O4)(e),e.code.add(d.H`const float roughnessTerrain = 0.5;
939
939
  const float specularityTerrain = 0.5;
940
940
  const vec3 fresnelReflectionTerrain = vec3(0.04);
941
941
  vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
@@ -1002,7 +1002,7 @@ return normal;
1002
1002
  float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
1003
1003
  float linearDepth = linearizeDepth(depth);
1004
1004
  ${t?"return viewPosDepth < linearDepth && depth < 1.0;":`if(viewPosDepth ${a?">":"<="} linearDepth) discard;`}
1005
- }`)}},98353:(e,t,r)=>{r.d(t,{h:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,o,n)=>i.setUniformMatrix3fv(e,t(o,n),r))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>n,O4:()=>a,Vt:()=>s});var i=r(23205),o=r(31821);function n(e){e.uniforms.add(new i.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function s(e){n(e.fragment),a(e.fragment),e.fragment.code.add(o.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
1005
+ }`)}},98353:(e,t,r)=>{r.d(t,{h:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,o,n)=>i.setUniformMatrix3fv(e,t(o,n),r))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>n,O4:()=>a,Vt:()=>s});var i=r(23205),o=r(31821);function n(e){e.uniforms.add(new i.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function s(e){n(e),a(e),e.code.add(o.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
1006
1006
  float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
1007
1007
  return mainLightIntensity * ((1.0 - shadow) * dotVal);
1008
1008
  }`)}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),o=r(31821);function n(e){e.fragment.code.add(o.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {