@arcgis/core 4.25.0-next.20220718 → 4.25.0-next.20220721

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 (284) hide show
  1. package/Camera.js +1 -1
  2. package/analysis/DimensioningAnalysis.js +1 -1
  3. package/analysis/LineOfSightAnalysis.js +1 -1
  4. package/analysis/SliceAnalysis.js +1 -1
  5. package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
  6. package/arcade/functions/featuresetgeom.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/1751de504354d98ac3fd.js +1 -0
  9. package/assets/esri/core/workers/chunks/1f4f1896880bfa6801c5.js +1 -0
  10. package/assets/esri/core/workers/chunks/290cd411d0d18b1d0efd.js +1 -0
  11. package/assets/esri/core/workers/chunks/{ab3bd5fecdb97f2d690e.js → 3b5be512567d9c1c6fe6.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c3236a7058e64ea3b939.js → 3c9da9b88777700879aa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f96e8724ae3458f5e262.js → 4a7aa1b9de61eb013647.js} +1 -1
  14. package/assets/esri/core/workers/chunks/4cb64ccb5fba126f9a66.js +1 -0
  15. package/assets/esri/core/workers/chunks/{68f19e58aae01791944e.js → 579ba109718bc2554008.js} +1 -1
  16. package/assets/esri/core/workers/chunks/59845b02b07a8ed7ce81.js +1 -0
  17. package/assets/esri/core/workers/chunks/{c705f907ce60a646d9aa.js → 652d36523efbe5c9ebb2.js} +1 -1
  18. package/assets/esri/core/workers/chunks/888d8e4471c9a2cd5009.js +1 -0
  19. package/assets/esri/core/workers/chunks/9493a8e5d6001b6bf275.js +1 -0
  20. package/assets/esri/core/workers/chunks/9d824cdfbcdf3cb3246f.js +1 -0
  21. package/assets/esri/core/workers/chunks/bf348f6f52701fa6016e.js +987 -0
  22. package/assets/esri/core/workers/chunks/d02881954c0cc0d39dfb.js +1 -0
  23. package/assets/esri/core/workers/chunks/{1ecbf642debc2207b762.js → da54483123f377e9b3e1.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{61b71b8e028eda10ccab.js → e4ad2cf5d6bded02e392.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3bfab05ae07ac18a75fe.js → f298a70f3b6f27675d53.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d499cce61c1c5c367380.js → f40290cfad3fe6fb4ef9.js} +1 -1
  27. package/assets/esri/layers/support/rasterFormats/lerc-wasm.wasm +0 -0
  28. package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -1
  29. package/assets/esri/themes/dark/main.css +1 -1
  30. package/assets/esri/themes/light/main.css +1 -1
  31. package/assets/esri/themes/light/view.css +1 -1
  32. package/chunks/ComponentShader.glsl.js +39 -33
  33. package/chunks/Laserlines.glsl.js +4 -4
  34. package/chunks/Precipitation.glsl.js +2 -2
  35. package/chunks/RibbonLine.glsl.js +46 -44
  36. package/chunks/Stars.glsl.js +2 -2
  37. package/chunks/Terrain.glsl.js +25 -17
  38. package/chunks/boundedPlane.js +1 -1
  39. package/chunks/lerc-wasm.js +1 -1
  40. package/chunks/mat2d.js +1 -1
  41. package/chunks/quatf32.js +1 -1
  42. package/core/BidiEngine.js +1 -1
  43. package/core/accessorSupport/watch.js +1 -1
  44. package/core/libs/gl-matrix-2/factories/quatf32.js +1 -1
  45. package/core/libs/gl-matrix-2/math/mat2d.js +1 -1
  46. package/core/perspectiveUtils.js +1 -1
  47. package/core/promiseUtils.js +1 -1
  48. package/core/reactiveUtils.js +1 -1
  49. package/core/unitUtils.js +1 -1
  50. package/geometry/projection.js +1 -1
  51. package/geometry/projectionEllipsoid.js +1 -1
  52. package/geometry/support/MeshTexture.js +1 -1
  53. package/geometry/support/axisAngleDegrees.js +1 -1
  54. package/geometry/support/coordinateSystem.js +1 -1
  55. package/geometry/support/geodesicUtils.js +1 -1
  56. package/geometry/support/meshUtils/exporters/gltf/index.js +1 -1
  57. package/geometry/support/meshUtils/loadExternal.js +1 -1
  58. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  59. package/geometry/support/scaleUtils.js +1 -1
  60. package/geometry/support/spatialReferenceUtils.js +1 -1
  61. package/identity/IdentityManagerBase.js +1 -1
  62. package/identity/IdentityModal.js +1 -1
  63. package/interfaces.d.ts +3 -33
  64. package/layers/FeatureLayer.js +1 -1
  65. package/layers/effects/parser.js +1 -1
  66. package/layers/graphics/hydratedFeatures.js +1 -1
  67. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  68. package/layers/mixins/ArcGISImageService.js +1 -1
  69. package/layers/ogc/wfsUtils.js +1 -1
  70. package/layers/support/ContingentValue.js +1 -1
  71. package/layers/support/ElevationQuery.js +1 -1
  72. package/layers/support/PixelBlock.js +1 -1
  73. package/layers/support/kmlUtils.js +1 -1
  74. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  75. package/layers/support/rasterDatasets/EphemeralBlockCache.js +1 -1
  76. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  77. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  78. package/layers/support/rasterFormats/ImageCanvasDecoder.js +1 -1
  79. package/layers/support/rasterFormats/JpgPlus.js +1 -1
  80. package/layers/support/rasterFormats/Lerc.js +1 -1
  81. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  82. package/layers/support/rasterFormats/Raw.js +1 -1
  83. package/layers/support/rasterFormats/TiffTags.js +1 -1
  84. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  85. package/layers/support/vectorTileLayerLoader.js +1 -1
  86. package/layers/support/wmtsUtils.js +1 -1
  87. package/package.json +1 -1
  88. package/renderers/RasterShadedReliefRenderer.js +1 -1
  89. package/renderers/RasterStretchRenderer.js +1 -1
  90. package/renderers/UniqueValueRenderer.js +1 -1
  91. package/renderers/support/AuthoringInfo.js +1 -1
  92. package/renderers/support/RasterSymbolizer.js +1 -1
  93. package/rest/query/operations/query.js +1 -1
  94. package/rest/query/operations/queryTopFeatures.js +1 -1
  95. package/rest/support/DirectionsFeatureSet.js +1 -1
  96. package/rest/support/ImageHistogramParameters.js +1 -1
  97. package/rest/support/ImageSampleParameters.js +1 -1
  98. package/smartMapping/labels/clusters.js +1 -1
  99. package/smartMapping/renderers/relationship.js +1 -1
  100. package/smartMapping/support/adapters/support/utils.js +1 -1
  101. package/support/basemapUtils.js +1 -1
  102. package/support/revision.js +1 -1
  103. package/symbols/LabelSymbol3D.js +1 -1
  104. package/symbols/PointSymbol3D.js +1 -1
  105. package/symbols/cim/CIMCursor.js +1 -1
  106. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  107. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  108. package/symbols/support/previewSymbol3D.js +1 -1
  109. package/symbols/support/webStyleSymbolUtils.js +1 -1
  110. package/views/2d/ViewState.js +1 -1
  111. package/views/2d/engine/vectorTiles/Feature.js +1 -1
  112. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  113. package/views/2d/engine/webgl/SDFConverter.js +1 -1
  114. package/views/2d/engine/webgl/TurboLine.js +1 -1
  115. package/views/2d/engine/webgl/brushes/BrushClip.js +1 -1
  116. package/views/2d/engine/webgl/brushes/BrushOverlay.js +1 -1
  117. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
  118. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
  119. package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
  120. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  121. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  122. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  123. package/views/2d/engine/webgl/mesh/heuristics.js +1 -1
  124. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  125. package/views/2d/engine/webgl/mesh/templates/WGLDynamicLineTemplate.js +1 -1
  126. package/views/2d/engine/webgl/mesh/templates/WGLDynamicMarkerTemplate.js +1 -1
  127. package/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js +1 -1
  128. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  129. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  130. package/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js +1 -1
  131. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  132. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  133. package/views/2d/input/MapViewInputManager.js +1 -1
  134. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  135. package/views/2d/viewpointUtils.js +1 -1
  136. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  137. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  138. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  139. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  140. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  141. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  142. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  143. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  144. package/views/3d/camera/constraintUtils/distance.js +1 -1
  145. package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
  146. package/views/3d/environment/CloudsComposition.js +1 -1
  147. package/views/3d/environment/FogTechnique.js +1 -1
  148. package/views/3d/glTF/internal/Resource.js +1 -1
  149. package/views/3d/input/SceneInputManager.js +1 -1
  150. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  151. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  152. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  153. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  154. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  155. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
  156. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  157. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  158. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  160. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  161. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  162. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  163. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  164. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  165. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  167. package/views/3d/layers/graphics/lineUtils.js +1 -1
  168. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  169. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  170. package/views/3d/layers/i3s/IDBCache.js +1 -1
  171. package/views/3d/layers/i3s/IDBMockCache.js +1 -1
  172. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  173. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  174. package/views/3d/state/ViewState.js +1 -1
  175. package/views/3d/support/cameraUtils.js +1 -1
  176. package/views/3d/support/orientedBoundingBox.js +1 -1
  177. package/views/3d/support/viewpointUtils.js +1 -1
  178. package/views/3d/terrain/Overlay.js +1 -1
  179. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  180. package/views/3d/terrain/OverlayRenderer.js +1 -1
  181. package/views/3d/terrain/TerrainRenderer.js +1 -1
  182. package/views/3d/terrain/TerrainSurface.js +1 -1
  183. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  184. package/views/3d/terrain/interfaces.js +1 -1
  185. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  186. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  187. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  188. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  189. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  190. package/views/3d/webgl-engine/collections/Component/RenderGeometry.js +1 -1
  191. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  192. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  193. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  194. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
  195. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  196. package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +9 -0
  197. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +18 -17
  198. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  199. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  200. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  201. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +5 -0
  202. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  203. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  204. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  205. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  206. package/views/3d/webgl-engine/lib/TextureTechniqueConfiguration.js +1 -1
  207. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  208. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  209. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  210. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  211. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  212. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/PathMaterial.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/internal/bufferWriterUtils.js +1 -1
  218. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  219. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  220. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  221. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  222. package/views/3d/webgl-engine/shaders/LaserlinePathTechniqueConfiguration.js +1 -1
  223. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  224. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  225. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  226. package/views/DOMContainer.js +1 -1
  227. package/views/MapView.js +1 -1
  228. package/views/SceneView.js +1 -1
  229. package/views/View.js +1 -1
  230. package/views/analysis/analysisViewUtils.js +1 -1
  231. package/views/animation/pointToPoint/apex/planning.js +1 -1
  232. package/views/draw/PolygonDrawAction.js +1 -1
  233. package/views/draw/PolylineDrawAction.js +1 -1
  234. package/views/draw/support/createUtils.js +1 -1
  235. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  236. package/views/input/InputManager.js +1 -1
  237. package/views/input/handlers/LatestPointer.js +1 -1
  238. package/views/input/handlers/MultiTouch.js +5 -0
  239. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  240. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  241. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
  242. package/views/interactive/tooltip/Tooltip.js +1 -1
  243. package/views/interactive/tooltip/support/measurements.js +1 -1
  244. package/views/layers/GroupLayerView.js +1 -1
  245. package/views/navigation/FilteredFiniteDifference.js +1 -1
  246. package/views/navigation/MomentumEstimator.js +1 -1
  247. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  248. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  249. package/views/navigation/RotationMomentumEstimator.js +1 -1
  250. package/views/support/GroundViewElevationSampler.js +1 -1
  251. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  252. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  253. package/views/support/screenshotUtils.js +1 -1
  254. package/views/webgl/BufferObject.js +1 -1
  255. package/views/webgl/FramebufferObject.js +1 -1
  256. package/views/webgl/Texture.js +1 -1
  257. package/views/webgl/capabilities/Capabilities.js +1 -1
  258. package/views/webgl/capabilities.js +1 -1
  259. package/views/webgl/renderState.js +1 -1
  260. package/webscene/spec-certification/api.js +1 -1
  261. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  262. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  263. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  264. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  265. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  266. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  267. package/widgets/Expand.js +1 -1
  268. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  269. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  270. package/widgets/Popup/PopupViewModel.js +1 -1
  271. package/widgets/Popup/actionUtils.js +1 -1
  272. package/widgets/ScaleRangeSlider.js +1 -1
  273. package/widgets/Slider/SliderViewModel.js +1 -1
  274. package/widgets/Widget.js +1 -1
  275. package/assets/esri/core/workers/chunks/04ea469cb081e181ca82.js +0 -1
  276. package/assets/esri/core/workers/chunks/16c2626ca47132700519.js +0 -1
  277. package/assets/esri/core/workers/chunks/1e4e5d147263e98536bc.js +0 -1
  278. package/assets/esri/core/workers/chunks/35083def3c658d1ae9ff.js +0 -1
  279. package/assets/esri/core/workers/chunks/40032d2bf404a46b8f80.js +0 -1
  280. package/assets/esri/core/workers/chunks/613e82a3e13442685ac4.js +0 -1
  281. package/assets/esri/core/workers/chunks/64b4f1dbf61439cde801.js +0 -1
  282. package/assets/esri/core/workers/chunks/abd68b7ba3be4696611c.js +0 -1
  283. package/assets/esri/core/workers/chunks/b8a062c0c9c626acf61e.js +0 -982
  284. package/assets/esri/core/workers/chunks/e08686088be0aaca1a99.js +0 -1
@@ -0,0 +1,987 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[276],{32078:(e,t,r)=>{r.d(t,{D:()=>W,b:()=>V});var i=r(70586),o=r(13598),n=r(1391),a=r(62707),s=r(55039),l=r(51546),c=r(77171),d=r(47624),u=r(64267),h=r(37099),f=r(76056),m=r(135),p=r(11317),g=r(15719),_=r(92555),v=r(89136),x=r(15817),T=r(66242),b=r(14482),A=r(83603),E=r(19419),S=r(26322),M=r(85504),w=r(22539),C=r(82550),R=r(96310),y=r(85787),O=r(90692),N=r(93669),P=r(172),I=r(71250),L=r(21437),D=r(74709),F=r(8319),B=r(33680),H=r(98069),U=r(93144),z=r(35065),G=r(9749);function V(e){const t=new B.kG,r=t.vertex.code,V=t.fragment.code;return(0,N.S)(t,e),t.include(h.f),t.varyings.add("vpos","vec3"),t.include(C.k,e),t.include(d.f,e),t.include(_.L,e),e.output!==s.H.Color&&e.output!==s.H.Alpha||((0,N.h)(t.vertex,e),t.include(u.O,e),t.include(c.w,e),e.normalType===u.h.Attribute&&e.offsetBackfaces&&t.include(a.w),t.include(x.Q,e),t.include(g.Bb,e),e.instancedColor&&t.attributes.add(z.T.INSTANCECOLOR,"vec4"),t.varyings.add("localvpos","vec3"),t.include(m.D,e),t.include(n.q,e),t.include(f.R,e),t.include(p.c,e),t.vertex.uniforms.add(new I.N("externalColor",(e=>e.externalColor))),t.varyings.add("vcolorExt","vec4"),e.hasMultipassTerrain&&t.varyings.add("depth","float"),e.hasModelTransformation&&t.vertex.uniforms.add(new F.g("model",(e=>(0,i.pC)(e.modelTransformation)?e.modelTransformation:o.I))),r.add(D.H`
2
+ void main(void) {
3
+ forwardNormalizedVertexColor();
4
+ vcolorExt = externalColor;
5
+ ${e.instancedColor?"vcolorExt *= instanceColor;":""}
6
+ vcolorExt *= vvColor();
7
+ vcolorExt *= getSymbolColor();
8
+ forwardColorMixMode();
9
+
10
+ if (vcolorExt.a < ${D.H.float(R.b)}) {
11
+ gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
12
+ } else {
13
+ vpos = calculateVPos();
14
+ localvpos = vpos - view[3].xyz;
15
+ vpos = subtractOrigin(vpos);
16
+ ${e.normalType===u.h.Attribute?D.H`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
17
+ vpos = addVerticalOffset(vpos, localOrigin);
18
+ ${e.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""}
19
+ gl_Position = transformPosition(proj, view, ${e.hasModelTransformation?"model,":""} vpos);
20
+ ${e.normalType===u.h.Attribute&&e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
21
+ }
22
+
23
+ ${e.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""}
24
+ forwardLinearDepth();
25
+ forwardTextureCoordinates();
26
+ }
27
+ `)),e.output===s.H.Alpha&&(t.include(l.f5,e),t.include(y.z,e),t.include(A.l,e),t.fragment.uniforms.add([new L.p("opacity",(e=>e.opacity)),new L.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&t.fragment.uniforms.add(new H.A("tex",(e=>e.texture))),t.fragment.include(O.y),V.add(D.H`
28
+ void main() {
29
+ discardBySlice(vpos);
30
+ ${e.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
31
+ ${e.hasColorTexture?D.H`
32
+ vec4 texColor = texture2D(tex, vuv0);
33
+ ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
34
+ discardOrAdjustAlpha(texColor);`:D.H`vec4 texColor = vec4(1.0);`}
35
+ ${e.hasVertexColors?D.H`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:D.H`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
36
+ gl_FragColor = vec4(opacity_);
37
+ }
38
+ `)),e.output===s.H.Color&&(t.include(l.f5,e),t.include(b.X,e),t.include(T.K,e),t.include(y.z,e),t.include(e.instancedDoublePrecision?w.hb:w.XE,e),t.include(A.l,e),(0,N.h)(t.fragment,e),t.fragment.uniforms.add([t.vertex.uniforms.get("localOrigin"),new P.J("ambient",(e=>e.ambient)),new P.J("diffuse",(e=>e.diffuse)),new L.p("opacity",(e=>e.opacity)),new L.p("layerOpacity",(e=>e.layerOpacity)),new L.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)),new P.J("lightingMainIntensity",((e,t)=>t.lighting.mainLight.intensity))]),t.fragment.constants.add("ambientBoostFactor","float",G.V),e.hasColorTexture&&t.fragment.uniforms.add(new H.A("tex",(e=>e.texture))),t.include(M.jV,e),t.include(S.T,e),t.fragment.include(O.y),t.include(E.k,e),V.add(D.H`
39
+ void main() {
40
+ discardBySlice(vpos);
41
+ ${e.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
42
+ ${e.hasColorTexture?D.H`
43
+ vec4 texColor = texture2D(tex, vuv0);
44
+ ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
45
+ discardOrAdjustAlpha(texColor);`:D.H`vec4 texColor = vec4(1.0);`}
46
+ shadingParams.viewDirection = normalize(vpos - cameraPosition);
47
+ ${e.normalType===u.h.ScreenDerivative?D.H`
48
+ vec3 normal = screenDerivativeNormal(localvpos);`:D.H`
49
+ shadingParams.normalView = vNormalWorld;
50
+ vec3 normal = shadingNormal(shadingParams);`}
51
+ ${e.pbrMode===M.f7.Normal?"applyPBRFactors();":""}
52
+ float ssao = evaluateAmbientOcclusionInverse();
53
+ ssao *= getBakedOcclusion();
54
+
55
+ float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
56
+ ${e.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":e.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"}
57
+ vec3 matColor = max(ambient, diffuse);
58
+ ${e.hasVertexColors?D.H`
59
+ vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
60
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:D.H`
61
+ vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
62
+ float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
63
+ ${e.hasNormalTexture?D.H`
64
+ mat3 tangentSpace = ${e.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"}
65
+ vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`:D.H`vec3 shadingNormal = normal;`}
66
+ vec3 normalGround = ${e.spherical?D.H`normalize(vpos + localOrigin);`:D.H`vec3(0.0, 0.0, 1.0);`}
67
+
68
+ ${e.snowCover?D.H`
69
+ float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
70
+ albedo = mix(albedo, vec3(1), snow);
71
+ shadingNormal = mix(shadingNormal, normal, snow);
72
+ ssao = mix(ssao, 1.0, snow);`:""}
73
+
74
+ vec3 additionalLight = ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
75
+
76
+ ${e.pbrMode===M.f7.Normal||e.pbrMode===M.f7.Schematic?D.H`
77
+ float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * lightingMainIntensity[2];
78
+ ${e.snowCover?D.H`
79
+ mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
80
+ emission = mix(emission, vec3(0.0), snow);`:""}
81
+
82
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
83
+ gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
84
+ ${e.transparencyPassType===U.A.Color?D.H`gl_FragColor = premultiplyAlpha(gl_FragColor);`:""}
85
+ }
86
+ `)),t.include(v.s,e),t}const W=Object.freeze(Object.defineProperty({__proto__:null,build:V},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>B,b:()=>F});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(64267),d=r(37099),u=r(76056),h=r(135),f=r(11317),m=r(92555),p=r(89136),g=r(66242),_=r(14482),v=r(83603),x=r(26322),T=r(85504),b=r(22539),A=r(82550),E=r(96310),S=r(85787),M=r(90692),w=r(93669),C=r(172),R=r(71250),y=r(21437),O=r(74709),N=r(33680),P=r(98069),I=r(93144),L=r(35065),D=r(9749);function F(e){const t=new N.kG,r=t.vertex.code,F=t.fragment.code;return(0,w.S)(t,e),t.include(d.f),t.varyings.add("vpos","vec3"),t.include(A.k,e),t.include(l.f,e),t.include(m.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,w.h)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(L.T.INSTANCECOLOR,"vec4"),t.varyings.add("vNormalWorld","vec3"),t.varyings.add("localvpos","vec3"),e.hasMultipassTerrain&&t.varyings.add("depth","float"),t.include(h.D,e),t.include(i.q,e),t.include(u.R,e),t.include(f.c,e),t.vertex.uniforms.add(new R.N("externalColor",(e=>e.externalColor))),t.varyings.add("vcolorExt","vec4"),r.add(O.H`
87
+ void main(void) {
88
+ forwardNormalizedVertexColor();
89
+ vcolorExt = externalColor;
90
+ ${e.instancedColor?"vcolorExt *= instanceColor;":""}
91
+ vcolorExt *= vvColor();
92
+ vcolorExt *= getSymbolColor();
93
+ forwardColorMixMode();
94
+
95
+ if (vcolorExt.a < ${O.H.float(E.b)}) {
96
+ gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
97
+ } else {
98
+ vpos = calculateVPos();
99
+ localvpos = vpos - view[3].xyz;
100
+ vpos = subtractOrigin(vpos);
101
+ vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
102
+ vpos = addVerticalOffset(vpos, localOrigin);
103
+ gl_Position = transformPosition(proj, view, vpos);
104
+ ${e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
105
+ }
106
+ ${e.hasMultipassTerrain?O.H`depth = (view * vec4(vpos, 1.0)).z;`:""}
107
+ forwardLinearDepth();
108
+ forwardTextureCoordinates();
109
+ }
110
+ `)),e.output===n.H.Alpha&&(t.include(a.f5,e),t.include(S.z,e),t.include(v.l,e),t.fragment.uniforms.add([new y.p("opacity",(e=>e.opacity)),new y.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&t.fragment.uniforms.add(new P.A("tex",(e=>e.texture))),t.fragment.include(M.y),F.add(O.H`
111
+ void main() {
112
+ discardBySlice(vpos);
113
+ ${e.hasMultipassTerrain?O.H`terrainDepthTest(gl_FragCoord, depth);`:""}
114
+ ${e.hasColorTexture?O.H`
115
+ vec4 texColor = texture2D(tex, vuv0);
116
+ ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
117
+ discardOrAdjustAlpha(texColor);`:O.H`vec4 texColor = vec4(1.0);`}
118
+ ${e.hasVertexColors?O.H`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:O.H`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
119
+
120
+ gl_FragColor = vec4(opacity_);
121
+ }
122
+ `)),e.output===n.H.Color&&(t.include(a.f5,e),t.include(_.X,e),t.include(g.K,e),t.include(S.z,e),t.include(e.instancedDoublePrecision?b.hb:b.XE,e),t.include(v.l,e),(0,w.h)(t.fragment,e),t.fragment.uniforms.add([t.vertex.uniforms.get("localOrigin"),t.vertex.uniforms.get("view"),new C.J("ambient",(e=>e.ambient)),new C.J("diffuse",(e=>e.diffuse)),new y.p("opacity",(e=>e.opacity)),new y.p("layerOpacity",(e=>e.layerOpacity)),new y.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)),new C.J("lightingMainIntensity",((e,t)=>t.lighting.mainLight.intensity))]),t.fragment.constants.add("ambientBoostFactor","float",D.V),e.hasColorTexture&&t.fragment.uniforms.add(new P.A("tex",(e=>e.texture))),t.include(T.jV,e),t.include(x.T,e),t.fragment.include(M.y),t.extensions.add("GL_OES_standard_derivatives"),F.add(O.H`
123
+ void main() {
124
+ discardBySlice(vpos);
125
+ ${e.hasMultipassTerrain?O.H`terrainDepthTest(gl_FragCoord, depth);`:""}
126
+ ${e.hasColorTexture?O.H`
127
+ vec4 texColor = texture2D(tex, vuv0);
128
+ ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
129
+ discardOrAdjustAlpha(texColor);`:O.H`vec4 texColor = vec4(1.0);`}
130
+ vec3 viewDirection = normalize(vpos - cameraPosition);
131
+ ${e.pbrMode===T.f7.Normal?"applyPBRFactors();":""}
132
+ float ssao = evaluateAmbientOcclusionInverse();
133
+ ssao *= getBakedOcclusion();
134
+
135
+ float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
136
+ vec3 additionalLight = ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
137
+ ${e.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":e.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"}
138
+ vec3 matColor = max(ambient, diffuse);
139
+ ${e.hasVertexColors?O.H`
140
+ vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
141
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:O.H`
142
+ vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
143
+ float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
144
+ ${e.snowCover?O.H`albedo = mix(albedo, vec3(1), 0.9);`:O.H``}
145
+ ${O.H`
146
+ vec3 shadingNormal = normalize(vNormalWorld);
147
+ albedo *= 1.2;
148
+ vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
149
+ float alignmentLightView = clamp(dot(viewForward, -lightingMainDirection), 0.0, 1.0);
150
+ float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
151
+ float treeRadialFalloff = vColor.r;
152
+ float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
153
+ additionalLight += backLightFactor * lightingMainIntensity;`}
154
+ ${e.pbrMode===T.f7.Normal||e.pbrMode===T.f7.Schematic?e.spherical?O.H`vec3 normalGround = normalize(vpos + localOrigin);`:O.H`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:O.H``}
155
+ ${e.pbrMode===T.f7.Normal||e.pbrMode===T.f7.Schematic?O.H`
156
+ float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * lightingMainIntensity[2];
157
+ ${e.snowCover?O.H`
158
+ mrr = vec3(0.0, 1.0, 0.04);
159
+ emission = vec3(0.0);`:""}
160
+
161
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:O.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
162
+ gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
163
+ ${e.transparencyPassType===I.A.Color?O.H`gl_FragColor = premultiplyAlpha(gl_FragColor);`:O.H``}
164
+ }
165
+ `)),t.include(p.s,e),t}const B=Object.freeze(Object.defineProperty({__proto__:null,build:F},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{b:()=>s,f:()=>o,i:()=>c,t:()=>n});var i=r(46851);function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function n(e,t){if(e===t){const r=t[1],i=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=r[0],f=r[1],m=r[2],p=r[3],g=r[4],_=r[5],v=r[6],x=r[7],T=r[8];return e[0]=h*i+f*a+m*c,e[1]=h*o+f*s+m*d,e[2]=h*n+f*l+m*u,e[3]=p*i+g*a+_*c,e[4]=p*o+g*s+_*d,e[5]=p*n+g*l+_*u,e[6]=v*i+x*a+T*c,e[7]=v*o+x*s+T*d,e[8]=v*n+x*l+T*u,e}function s(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],u=t[9],h=t[10],f=t[11],m=t[12],p=t[13],g=t[14],_=t[15],v=r*s-i*a,x=r*l-o*a,T=r*c-n*a,b=i*l-o*s,A=i*c-n*s,E=o*c-n*l,S=d*p-u*m,M=d*g-h*m,w=d*_-f*m,C=u*g-h*p,R=u*_-f*p,y=h*_-f*g;let O=v*y-x*R+T*C+b*w-A*M+E*S;return O?(O=1/O,e[0]=(s*y-l*R+c*C)*O,e[1]=(l*w-a*y-c*M)*O,e[2]=(a*R-s*w+c*S)*O,e[3]=(o*R-i*y-n*C)*O,e[4]=(r*y-o*w+n*M)*O,e[5]=(i*w-r*R-n*S)*O,e[6]=(p*E-g*A+_*b)*O,e[7]=(g*T-m*E-_*x)*O,e[8]=(m*A-p*T+_*v)*O,e):null}function l(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function c(e){const t=(0,i.g)(),r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(o*o+s*s+d*d))<=t&&Math.abs(1-(n*n+l*l+u*u))<=t}const d=a,u=l;Object.freeze(Object.defineProperty({__proto__:null,fromMat4:o,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},set:function(e,t,r,i,o,n,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=o,e[4]=n,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:n,invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],u=d*a-s*c,h=-d*n+s*l,f=c*n-a*l;let m=r*u+i*h+o*f;return m?(m=1/m,e[0]=u*m,e[1]=(-d*i+o*c)*m,e[2]=(s*i-o*a)*m,e[3]=h*m,e[4]=(d*r-o*l)*m,e[5]=(-s*r+o*n)*m,e[6]=f*m,e[7]=(-c*r+i*l)*m,e[8]=(a*r-i*n)*m,e):null},adjoint:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8];return e[0]=a*d-s*c,e[1]=o*c-i*d,e[2]=i*s-o*a,e[3]=s*l-n*d,e[4]=r*d-o*l,e[5]=o*n-r*s,e[6]=n*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*n,e},determinant:function(e){const t=e[0],r=e[1],i=e[2],o=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*n-a*l)+r*(-c*o+a*s)+i*(l*o-n*s)},multiply:a,translate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=r[0],f=r[1];return e[0]=i,e[1]=o,e[2]=n,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+f*a+c,e[7]=h*o+f*s+d,e[8]=h*n+f*l+u,e},rotate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=Math.sin(r),f=Math.cos(r);return e[0]=f*i+h*a,e[1]=f*o+h*s,e[2]=f*n+h*l,e[3]=f*a-h*i,e[4]=f*s-h*o,e[5]=f*l-h*n,e[6]=c,e[7]=d,e[8]=u,e},scale:function(e,t,r){const i=r[0],o=r[1],n=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],o=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromQuat:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r+r,s=i+i,l=o+o,c=r*a,d=i*a,u=i*s,h=o*a,f=o*s,m=o*l,p=n*a,g=n*s,_=n*l;return e[0]=1-u-m,e[3]=d-_,e[6]=h+g,e[1]=d+_,e[4]=1-c-m,e[7]=f-p,e[2]=h-g,e[5]=f+p,e[8]=1-c-u,e},normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[4],a=t[5],s=t[6],l=t[8],c=t[9],d=t[10],u=d*a-s*c,h=-d*n+s*l,f=c*n-a*l,m=r*u+i*h+o*f;if(!m)return null;const p=1/m;return e[0]=u*p,e[1]=(-d*i+o*c)*p,e[2]=(s*i-o*a)*p,e[3]=h*p,e[4]=(d*r-o*l)*p,e[5]=(-s*r+o*n)*p,e[6]=f*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*n)*p,e},normalFromMat4:s,projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},subtract:l,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},equals:function(e,t){const r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=t[0],f=t[1],m=t[2],p=t[3],g=t[4],_=t[5],v=t[6],x=t[7],T=t[8],b=(0,i.g)();return Math.abs(r-h)<=b*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-f)<=b*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(n-m)<=b*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(a-p)<=b*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-g)<=b*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-_)<=b*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(c-v)<=b*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(d-x)<=b*Math.max(1,Math.abs(d),Math.abs(x))&&Math.abs(u-T)<=b*Math.max(1,Math.abs(u),Math.abs(T))},isOrthoNormal:c,mul:d,sub:u},Symbol.toStringTag,{value:"Module"}))},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function o(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>o,c:()=>i}),Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},fromValues:function(e,t,r,i,o,n,a,s,l){return[e,t,r,i,o,n,a,s,l]},createView:o},Symbol.toStringTag,{value:"Module"}))},13598:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}function n(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>a,a:()=>n,b:()=>o,c:()=>i});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:o,fromValues:function(e,t,r,i,o,n,a,s,l,c,d,u,h,f,m,p){return[e,t,r,i,o,n,a,s,l,c,d,u,h,f,m,p]},createView:n,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{c:()=>f,g:()=>d,j:()=>R,k:()=>p,m:()=>u,s:()=>c});var i=r(46521),o=r(94961),n=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function d(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>(0,a.g)()?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function u(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=r[0],l=r[1],c=r[2],d=r[3];return e[0]=i*d+a*s+o*c-n*l,e[1]=o*d+a*l+n*s-i*c,e[2]=n*d+a*c+i*l-o*s,e[3]=a*d-i*s-o*l-n*c,e}function h(e,t,r,i){const o=t[0],n=t[1],s=t[2],l=t[3];let c,d,u,h,f,m=r[0],p=r[1],g=r[2],_=r[3];return d=o*m+n*p+s*g+l*_,d<0&&(d=-d,m=-m,p=-p,g=-g,_=-_),1-d>(0,a.g)()?(c=Math.acos(d),u=Math.sin(c),h=Math.sin((1-i)*c)/u,f=Math.sin(i*c)/u):(h=1-i,f=i),e[0]=h*o+f*m,e[1]=h*n+f*p,e[2]=h*s+f*g,e[3]=h*l+f*_,e}function f(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function m(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const o=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*o+n]-t[3*n+o])*i,e[o]=(t[3*o+r]+t[3*r+o])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function p(e,t,r,i){const o=.5*Math.PI/180;t*=o,r*=o,i*=o;const n=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),d=Math.cos(i);return e[0]=n*l*d-a*s*c,e[1]=a*s*d+n*l*c,e[2]=a*l*c-n*s*d,e[3]=a*l*d+n*s*c,e}const g=l.c,_=l.s,v=l.a,x=u,T=l.b,b=l.d,A=l.l,E=l.e,S=E,M=l.f,w=M,C=l.n,R=l.g,y=l.h,O=(0,n.c)(),N=(0,n.f)(1,0,0),P=(0,n.f)(0,1,0),I=(0,o.a)(),L=(0,o.a)(),D=(0,i.c)();Object.freeze(Object.defineProperty({__proto__:null,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},setAxisAngle:c,getAxisAngle:d,multiply:u,rotateX:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=o*l+n*s,e[2]=n*l-o*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*s,e[1]=o*l+a*s,e[2]=n*l+i*s,e[3]=a*l-o*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=o*l-i*s,e[2]=n*l+a*s,e[3]=a*l-n*s,e},calculateW:function(e,t){const r=t[0],i=t[1],o=t[2];return e[0]=r,e[1]=i,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-o*o)),e},slerp:h,random:function(e){const t=a.R,r=t(),i=t(),o=t(),n=Math.sqrt(1-r),s=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=s*Math.sin(2*Math.PI*o),e[3]=s*Math.cos(2*Math.PI*o),e},invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r*r+i*i+o*o+n*n,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-o*s,e[3]=n*s,e},conjugate:f,fromMat3:m,fromEuler:p,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},copy:g,set:_,add:v,mul:x,scale:T,dot:b,lerp:A,length:E,len:S,squaredLength:M,sqrLen:w,normalize:C,exactEquals:R,equals:y,rotationTo:function(e,t,r){const i=(0,s.e)(t,r);return i<-.999999?((0,s.f)(O,N,t),(0,s.u)(O)<1e-6&&(0,s.f)(O,P,t),(0,s.n)(O,O),c(e,O,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.f)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+i,C(e,e))},sqlerp:function(e,t,r,i,o,n){return h(I,t,o,n),h(L,r,i,n),h(e,I,L,2*n*(1-n)),e},setAxes:function(e,t,r,i){const o=D;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=i[0],o[4]=i[1],o[7]=i[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],C(e,m(e,o))}},Symbol.toStringTag,{value:"Module"}))},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function o(e){return[e[0],e[1],e[2],e[3]]}function n(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>a,a:()=>i,b:()=>o,c:()=>n});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:o,fromValues:function(e,t,r,i){return[e,t,r,i]},createView:n,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},29268:(e,t,r)=>{r.d(t,{a:()=>v,c:()=>g,g:()=>x,h:()=>_,j:()=>A,m:()=>y}),r(80442);var i,o,n=r(92604),a=r(22021),s=r(70586),l=r(52138),c=r(17896),d=r(65617),u=r(98766),h=r(88669);(o=i||(i={}))[o.X=0]="X",o[o.Y=1]="Y",o[o.Z=2]="Z";var f=r(78341),m=r(61277),p=r(12981);function g(){return(0,h.c)()}function _(e,t=g()){return(0,u.c)(t,e)}function v(e){return e[3]}function x(e){return e}function T(e,t,r){if((0,s.Wi)(t))return!1;const{origin:i,direction:o}=t,n=b;n[0]=i[0]-e[0],n[1]=i[1]-e[1],n[2]=i[2]-e[2];const a=o[0]*o[0]+o[1]*o[1]+o[2]*o[2],l=2*(o[0]*n[0]+o[1]*n[1]+o[2]*n[2]),c=l*l-4*a*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-e[3]*e[3]);if(c<0)return!1;const d=Math.sqrt(c);let u=(-l-d)/(2*a);const h=(-l+d)/(2*a);return(u<0||h<u&&h>0)&&(u=h),!(u<0||(r&&(r[0]=i[0]+o[0]*u,r[1]=i[1]+o[1]*u,r[2]=i[2]+o[2]*u),0))}const b=(0,d.c)();function A(e,t){return T(e,t,null)}function E(e,t,r){const i=p.WM.get(),o=p.MP.get();(0,c.f)(i,t.origin,t.direction);const n=v(e);(0,c.f)(r,i,t.origin),(0,c.g)(r,r,1/(0,c.l)(r)*n);const a=M(e,t.origin),s=(0,m.EU)(t.origin,r);return(0,l.d)(o,s+a,i),(0,c.m)(r,r,o),r}function S(e,t,r){const i=(0,c.b)(p.WM.get(),t,e),o=(0,c.g)(p.WM.get(),i,e[3]/(0,c.l)(i));return(0,c.a)(r,o,e)}function M(e,t){const r=(0,c.b)(p.WM.get(),t,e),i=(0,c.l)(r),o=v(e),n=o+Math.abs(o-i);return(0,a.ZF)(o/n)}const w=(0,d.c)();function C(e,t,r,o){const n=(0,c.b)(w,t,e);switch(r){case i.X:{const e=(0,a.jE)(n,w)[2];return(0,c.s)(o,-Math.sin(e),Math.cos(e),0)}case i.Y:{const e=(0,a.jE)(n,w),t=e[1],r=e[2],i=Math.sin(t);return(0,c.s)(o,-i*Math.cos(r),-i*Math.sin(r),Math.cos(t))}case i.Z:return(0,c.n)(o,n);default:return}}function R(e,t){const r=(0,c.b)(O,t,e);return(0,c.l)(r)-e[3]}function y(e,t){const r=(0,c.d)(e,t),i=v(e);return r<=i*i}const O=(0,d.c)(),N=g();Object.freeze(Object.defineProperty({__proto__:null,create:g,copy:_,fromCenterAndRadius:function(e,t){return(0,h.f)(e[0],e[1],e[2],t)},wrap:function(e){return e},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},getRadius:v,getCenter:x,fromValues:function(e,t,r,i){return(0,h.f)(e,t,r,i)},elevate:function(e,t,r){return e!==r&&(0,c.c)(r,e),r[3]=e[3]+t,r},setExtent:function(e,t,r){return n.Z.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),e===r?r:_(e,r)},intersectRay:T,intersectsRay:A,intersectRayClosestSilhouette:function(e,t,r){if(T(e,t,r))return r;const i=E(e,t,p.WM.get());return(0,c.a)(r,t.origin,(0,c.g)(p.WM.get(),t.direction,(0,c.i)(t.origin,i)/(0,c.l)(t.direction))),r},closestPointOnSilhouette:E,closestPoint:function(e,t,r){return T(e,t,r)?r:((0,f.JI)(t,e,r),S(e,r,r))},projectPoint:S,distanceToSilhouette:function(e,t){const r=(0,c.b)(p.WM.get(),t,e),i=(0,c.p)(r),o=e[3]*e[3];return Math.sqrt(Math.abs(i-o))},angleToSilhouette:M,axisAt:C,altitudeAt:R,setAltitudeAt:function(e,t,r,o){const n=R(e,t),a=C(e,t,i.Z,O),s=(0,c.g)(O,a,r-n);return(0,c.a)(o,t,s)},containsPoint:y,tmpSphere:N},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>n,b:()=>l,n:()=>s,s:()=>a,t:()=>o});var i=r(72220);function o(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const o=e.count,n=r[0],a=r[1],s=r[2],l=r[4],c=r[5],d=r[6],u=r[8],h=r[9],f=r[10],m=r[12],p=r[13],g=r[14],_=e.typedBuffer,v=e.typedBufferStride,x=t.typedBuffer,T=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*v,r=e*T,i=x[r],o=x[r+1],b=x[r+2];_[t]=n*i+l*o+u*b+m,_[t+1]=a*i+c*o+h*b+p,_[t+2]=s*i+d*o+f*b+g}}function n(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const o=e.count,n=r[0],a=r[1],s=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],m=e.typedBuffer,p=e.typedBufferStride,g=t.typedBuffer,_=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*p,r=e*_,i=g[r],o=g[r+1],v=g[r+2];m[t]=n*i+l*o+u*v,m[t+1]=a*i+c*o+h*v,m[t+2]=s*i+d*o+f*v}}function a(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*n,i=e*s;o[t]=r*a[i],o[t+1]=r*a[i+1],o[t+2]=r*a[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,o=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*o,r=e*a,s=n[r],l=n[r+1],c=n[r+2],d=s*s+l*l+c*c;if(d>0){const e=1/Math.sqrt(d);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*n,i=e*s;o[t]=a[i]>>r,o[t+1]=a[i+1]>>r,o[t+2]=a[i+2]>>r}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:o,transformMat3:n,scale:a,normalize:s,shiftRight:l},Symbol.toStringTag,{value:"Module"}))},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,o=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<s;++e)i[l]=n[c],i[l+1]=n[c+1],i[l+2]=n[c+2],l+=o,c+=a}function o(e,t,r,i,o){const n=e.typedBuffer,a=e.typedBufferStride,s=o?.count??e.count;let l=(o?.dstIndex??0)*a;for(let e=0;e<s;++e)n[l]=t,n[l+1]=r,n[l+2]=i,l+=a}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,fill:o},Symbol.toStringTag,{value:"Module"}))},72119:(e,t,r)=>{function i(){return new Float32Array(3)}function o(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function n(){return i()}function a(){return o(1,1,1)}function s(){return o(1,0,0)}function l(){return o(0,1,0)}function c(){return o(0,0,1)}r.d(t,{c:()=>i,f:()=>o});const d=n(),u=a(),h=s(),f=l(),m=c();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:o,createView:function(e,t){return new Float32Array(e,t,3)},zeros:n,ones:a,unitX:s,unitY:l,unitZ:c,ZEROS:d,ONES:u,UNIT_X:h,UNIT_Y:f,UNIT_Z:m},Symbol.toStringTag,{value:"Module"}))},88669:(e,t,r)=>{function i(){return[0,0,0,0]}function o(e,t,r,i){return[e,t,r,i]}function n(e,t){return new Float64Array(e,t,4)}function a(){return o(1,1,1,1)}function s(){return o(1,0,0,0)}function l(){return o(0,1,0,0)}function c(){return o(0,0,1,0)}function d(){return o(0,0,0,1)}r.d(t,{a:()=>n,c:()=>i,f:()=>o});const u=a(),h=s(),f=l(),m=c(),p=d();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3]]},fromValues:o,fromArray:function(e){const t=[0,0,0,0],r=Math.min(4,e.length);for(let i=0;i<r;++i)t[i]=e[i];return t},createView:n,zeros:function(){return[0,0,0,0]},ones:a,unitX:s,unitY:l,unitZ:c,unitW:d,ZEROS:[0,0,0,0],ONES:u,UNIT_X:h,UNIT_Y:f,UNIT_Z:m,UNIT_W:p},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},78341:(e,t,r)=>{r.d(t,{JI:()=>c,Ue:()=>a,re:()=>l}),r(67676);var i=r(22807),o=r(17896),n=r(65617);function a(e){return e?s((0,n.a)(e.origin),(0,n.a)(e.direction)):s((0,n.c)(),(0,n.c)())}function s(e,t){return{origin:e,direction:t}}function l(e,t){const r=d.get();return r.origin=e,r.direction=t,r}function c(e,t,r){const i=(0,o.e)(e.direction,(0,o.b)(r,t,e.origin));return(0,o.a)(r,e.origin,(0,o.g)(r,e.direction,i)),r}r(12981);const d=new i.x((()=>a()))},61277:(e,t,r)=>{r.d(t,{EU:()=>a});var i=r(22021),o=r(17896),n=r(65617);function a(e,t){const r=(0,o.e)(e,t)/((0,o.l)(e)*(0,o.l)(t));return-(0,i.ZF)(r)}(0,n.c)(),(0,n.c)()},70276:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>Wr,gltfToEngineResources:()=>qr,parseUrl:()=>kr});var i=r(32243),o=r(70586),n=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),d=r(65617),u=r(60437),h=r(56481),f=r(20773),m=r(11077),p=r(8323),g=r(40270),_=r(88246),v=r(91911),x=r(3172),T=r(66643),b=r(20102),A=r(92604),E=r(95330),S=r(23670);async function M(e,t){const{data:r}=await(0,x.default)(e,{responseType:"image",...t});return r}var w=r(47026),C=r(44553),R=r(11726);class y{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,d.c)(),this._children=void 0,(0,R.hu)(e.length>=1),(0,R.hu)(r.length%this._numIndexPerPrimitive==0),(0,R.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,R.hu)(3===i.size||4===i.size);const{data:o,size:n}=i,a=e.length;let s=n*r[this._numIndexPerPrimitive*e[0]];O.clear(),O.push(s),this.bbMin=(0,d.f)(o[s],o[s+1],o[s+2]),this.bbMax=(0,d.a)(this.bbMin);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*r[i+e],O.push(s);let t=o[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=o[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=o[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.h)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<O.length;++e){s=O.getItemAt(e);const t=o[s]-this.center[0],r=o[s+1]-this.center[1],i=o[s+2]-this.center[2],n=t*t+r*r+i*i;if(n<=l)continue;const a=Math.sqrt(n),c=.5*(a-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const d=c/a;this.center[0]+=t*d,this.center[1]+=r*d,this.center[2]+=i*d}O.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.d)(this.bbMin,this.bbMax)>1){const e=(0,c.h)((0,d.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:o,size:n}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=n*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=n*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new y(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){O.prune()}}const O=new C.Z({deallocator:null});var N=r(17662),P=r(4726),I=r(17753),L=r(35065);class D extends N.c{constructor(e,t=[],r=w.MX.Triangle,i=null,o=-1){super(),this._primitiveType=r,this.objectAndLayerIdColor=i,this.edgeIndicesLength=o,this.type=P.U.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,I.p)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,r]of t)r&&(this._indices.set(e,F(r)),e===L.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}cloneShallow(){const e=new D([],void 0,this._primitiveType,this.objectAndLayerIdColor,void 0),{_vertexAttributes:t,_indices:r}=e;return this._vertexAttributes.forEach(((e,r)=>{t.set(r,e)})),this._indices.forEach(((e,t)=>{r.set(t,e)})),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,o.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===w.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(L.T.POSITION),r=this.vertexAttributes.get(L.T.POSITION);return(0,I.cM)(r,t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(L.T.POSITION),r=this.vertexAttributes.get(L.T.POSITION);return(0,I.NO)(r,t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(L.T.POSITION);if(!e||0===e.length)return null;const t=this.primitiveType===w.MX.Triangle?3:1;(0,R.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,I.p)(e.length/t),i=this.vertexAttributes.get(L.T.POSITION);return i?new y(r,t,e,i):null}}function F(e){if(e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return e;for(const t of e)if(t>=65536)return e;return new Uint16Array(e)}var B=r(74085),H=r(32448),U=r(22021),z=r(1533),G=r(17452),V=r(85958),W=r(88669),k=r(74709);function q(e,t=!0){e.attributes.add(L.T.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.code.add(k.H`
166
+ void main(void) {
167
+ gl_Position = vec4(position, 0.0, 1.0);
168
+ ${t?k.H`uv = position * 0.5 + vec2(0.5);`:""}
169
+ }
170
+ `)}var $=r(71250),X=r(33680),j=r(98069);class J extends k.K{constructor(){super(...arguments),this.color=(0,W.f)(1,1,1,1)}}Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:J,build:function(){const e=new X.kG;return e.include(q),e.fragment.uniforms.add([new j.A("tex",(e=>e.texture)),new $.N("uColor",(e=>e.color))]),e.fragment.code.add(k.H`void main() {
171
+ vec4 texColor = texture2D(tex, uv);
172
+ gl_FragColor = texColor * uColor;
173
+ }`),e}},Symbol.toStringTag,{value:"Module"}));var Y=r(99880);let Z;var K;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}(K||(K={}));var Q=r(35371),ee=r(75656),te=r(80442);function re(e,t,r,i,o=0){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=o*e.stride;if(e.count<=4)n.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),n.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)n.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)n.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function ie(e,t,r,i){const o=e.gl,n=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)o.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(Q.w0.ARRAY_BUFFER)}function oe(e){switch(e){case Q.VI.ALPHA:case Q.VI.LUMINANCE:case Q.VI.RED:case Q.VI.RED_INTEGER:case Q.lP.R8:case Q.lP.R8I:case Q.lP.R8UI:case Q.lP.R8_SNORM:case Q.Tg.STENCIL_INDEX8:return 1;case Q.VI.LUMINANCE_ALPHA:case Q.VI.RG:case Q.VI.RG_INTEGER:case Q.lP.RGBA4:case Q.lP.R16F:case Q.lP.R16I:case Q.lP.R16UI:case Q.lP.RG8:case Q.lP.RG8I:case Q.lP.RG8UI:case Q.lP.RG8_SNORM:case Q.lP.RGB565:case Q.lP.RGB5_A1:case Q.Tg.DEPTH_COMPONENT16:return 2;case Q.VI.DEPTH_COMPONENT:case Q.VI.RGB:case Q.VI.RGB_INTEGER:case Q.lP.RGB8:case Q.lP.RGB8I:case Q.lP.RGB8UI:case Q.lP.RGB8_SNORM:case Q.lP.SRGB8:case Q.Tg.DEPTH_COMPONENT24:return 3;case Q.VI.DEPTH_STENCIL:case Q.VI.RGBA:case Q.VI.RGBA_INTEGER:case Q.lP.RGBA8:case Q.lP.R32F:case Q.lP.R11F_G11F_B10F:case Q.lP.RG16F:case Q.lP.R32I:case Q.lP.R32UI:case Q.lP.RG16I:case Q.lP.RG16UI:case Q.lP.RGBA8I:case Q.lP.RGBA8UI:case Q.lP.RGBA8_SNORM:case Q.lP.SRGB8_ALPHA8:case Q.lP.RGB9_E5:case Q.lP.RGB10_A2UI:case Q.lP.RGB10_A2:case Q.Tg.DEPTH_STENCIL:case Q.Tg.DEPTH_COMPONENT32F:case Q.Tg.DEPTH24_STENCIL8:return 4;case Q.Tg.DEPTH32F_STENCIL8:return 5;case Q.lP.RGB16F:case Q.lP.RGB16I:case Q.lP.RGB16UI:return 6;case Q.lP.RG32F:case Q.lP.RG32I:case Q.lP.RG32UI:case Q.lP.RGBA16F:case Q.lP.RGBA16I:case Q.lP.RGBA16UI:return 8;case Q.lP.RGB32F:case Q.lP.RGB32I:case Q.lP.RGB32UI:return 12;case Q.lP.RGBA32F:case Q.lP.RGBA32I:case Q.lP.RGBA32UI:return 16;case Q.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case Q.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case Q.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case Q.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case Q.q_.COMPRESSED_R11_EAC:case Q.q_.COMPRESSED_SIGNED_R11_EAC:case Q.q_.COMPRESSED_RGB8_ETC2:case Q.q_.COMPRESSED_SRGB8_ETC2:case Q.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case Q.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case Q.q_.COMPRESSED_RG11_EAC:case Q.q_.COMPRESSED_SIGNED_RG11_EAC:case Q.q_.COMPRESSED_RGBA8_ETC2_EAC:case Q.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function ne(e){if((0,o.Wi)(e))return 0;if("descriptor"in e)return e.glName?ne(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return oe(t)*i*r}let ae=null,se=null;async function le(){return(0,o.Wi)(se)&&(se=function(){if((0,o.Wi)(Z)){const e=e=>(0,Y.V)(`esri/libs/basisu/${e}`);Z=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return Z}(),ae=await se),se}function ce(e,t,r,i,o){const n=oe(t?Q.q_.COMPRESSED_RGBA8_ETC2_EAC:Q.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function de(e){return e.getNumImages()>=1&&!e.isUASTC()}function ue(e){return e.getFaces()>=1&&e.isETC1S()}function he(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[K.ETC2_RGBA,Q.q_.COMPRESSED_RGBA8_ETC2_EAC]:[K.ETC1_RGB,Q.q_.COMPRESSED_RGB8_ETC2]:c?i?[K.BC3_RGBA,Q.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[K.BC1_RGB,Q.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[K.RGBA32,Q.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,d))),s(e,d,f[e]);const m=f.length>1,p=m?Q.cw.LINEAR_MIPMAP_LINEAR:Q.cw.LINEAR,g={...t,samplingMode:p,hasMipmap:m,internalFormat:u,width:o,height:n};return new ee.x(e,g,{type:"compressed",levels:f})}const fe=A.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function me(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const pe=me("DXT1"),ge=me("DXT3"),_e=me("DXT5");var ve=r(83475),xe=r(21968);new xe.G(L.T.POSITION,3,Q.g.FLOAT,0,12),new xe.G(L.T.POSITION,3,Q.g.FLOAT,0,20),new xe.G(L.T.UV0,2,Q.g.FLOAT,12,20),new xe.G(L.T.POSITION,3,Q.g.FLOAT,0,32),new xe.G(L.T.NORMAL,3,Q.g.FLOAT,12,32),new xe.G(L.T.UV0,2,Q.g.FLOAT,24,32),new xe.G(L.T.POSITION,3,Q.g.FLOAT,0,16),new xe.G(L.T.COLOR,4,Q.g.UNSIGNED_BYTE,12,16);const Te=[new xe.G(L.T.POSITION,2,Q.g.FLOAT,0,8)],be=[new xe.G(L.T.POSITION,2,Q.g.FLOAT,0,16),new xe.G(L.T.UV0,2,Q.g.FLOAT,8,16)],Ae=A.Z.getLogger("esri.views.webgl.VertexArrayObject");class Ee extends class{constructor(e,t,r,i,o=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=o,this._glName=null,this._initialized=!1,e.instanceCounter.increment(Q._g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,o.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){const e=this._context?.capabilities?.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):Ae.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e].dispose(),delete this._buffers[e];this._indexBuffer=(0,o.O3)(this._indexBuffer)}this._context.instanceCounter.decrement(Q._g.VertexArrayObject,this),this._context=null}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&Ae.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||Ae.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||Ae.error("Vertex buffer is uninitialized!");const o=t[r];o||Ae.error("Vertex element descriptor is empty!"),re(this._context,this._locations,i,o)}(0,o.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||Ae.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||Ae.error("Vertex buffer is uninitialized!");const o=t[r];ie(this._context,this._locations,i,o)}(0,o.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}{}var Se=r(67676),Me=r(49300),we=r(54738);const Ce=A.Z.getLogger("esri.views.webgl.BufferObject");class Re{constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(Q._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,Me.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new Re(e,Q.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new Re(e,Q.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==we.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new Re(e,Q.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=Q.l1.STREAM_READ,r){if(e.type!==we.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new Re(e,Q.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=Q.l1.STREAM_DRAW,r){if(e.type!==we.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new Re(e,Q.w0.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===Q.w0.ELEMENT_ARRAY_BUFFER?this._indexType===Q.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===Q.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===Q.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(Q._g.BufferObject,this),this._context=null):this._glName&&Ce.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&Ce.error("Buffer size needs to be positive!"),this.bufferType===Q.w0.ELEMENT_ARRAY_BUFFER&&(0,o.pC)(t))switch(this._indexType=t,t){case Q.g.UNSIGNED_SHORT:e*=2;break;case Q.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===Q.w0.ELEMENT_ARRAY_BUFFER&&((0,z.Uc)(e)&&(t/=2,this._indexType=Q.g.UNSIGNED_SHORT),(0,z.ZY)(e)&&(t/=4,this._indexType=Q.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;(0,o.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,Me.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&Ce.error("offset is out of range!");let o=t,n=r,a=i,s=e.byteLength;this.bufferType===Q.w0.ELEMENT_ARRAY_BUFFER&&((0,z.Uc)(e)?(s/=2,o*=2,n*=2,a*=2):(0,z.ZY)(e)&&(s/=4,o*=4,n*=4,a*=4)),void 0===i&&(i=s-1),r>=i&&Ce.error("end must be bigger than start!"),t+r-i>this._size&&Ce.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,d=ArrayBuffer.isView(e)?e.buffer:e,u=0===n&&a===e.byteLength?d:d.slice(n,a);c.bufferSubData(this.bufferType,o,u),(0,Me.zu)(c),this._isVAOAware&&this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&Ce.error("offset is out of range!"),r>=i&&Ce.error("end must be bigger than start!"),t+r-i>this._size&&Ce.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===we.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,Me.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==we.zO.WEBGL2)return void Ce.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void Ce.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,Se.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void Ce.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteSize&&Ce.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,Q.w0.COPY_READ_BUFFER),n.getBufferSubData(Q.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(Q.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===we.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):Ce.error("Get buffer subdata is supported in WebGL2 only!")}}class ye{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment(Q._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==we.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(Q._g.Renderbuffer,this),this._context=null)}}class Oe{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(Q._g.FramebufferObject,this),(0,o.pC)(r)){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=Q.VY.COLOR_ATTACHMENT0+e;let o;Ie(t)?(Ne(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new ee.x(this._context,o))),Le(o,this._desc)):(Pe(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new ye(this._context,o))),De(o,this._desc)),this._validateColorAttachmentPoint(i)}}if((0,o.pC)(i)){let e,t;if(Ie(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),Ne(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new ee.x(this._context,t)),Le(t,this._desc);else{Pe(i)?(t=i.descriptor,e=i):(t=i,e=new ye(this._context,t));const r=this._desc.depthStencilTarget??Q.OU.DEPTH_STENCIL_RENDER_BUFFER;r===Q.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===Q.OU.DEPTH_RENDER_BUFFER||r===Q.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),this._desc.depthStencilTarget=r,De(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(Q._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(Q.VY.COLOR_ATTACHMENT0);return e&&Ne(e)?e:null}get colorAttachment(){return this._colorAttachments.get(Q.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width??0}get height(){return this._desc.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+ne(r)),0)+ne(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&Ne(t)?t:null}attachColorTexture(e,t=Q.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),Le(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=Q.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(Ne(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=Q.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);Ne(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if((0,o.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==Q.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==Q.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),Le(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==Q.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=Q.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,Q.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,Q.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,o.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==Q.Tg.DEPTH_STENCIL&&t.internalFormat!==Q.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),De(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===Q.Tg.DEPTH_STENCIL?Q.OU.DEPTH_STENCIL_RENDER_BUFFER:Q.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===Q.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(Q.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===Q.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(Q.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=a.descriptor;a.descriptor.target!==Q.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||null==l?.width||null==l?.height||e+r>s.width||t+i>s.height||o+r>l.width||n+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,d=c.bindTexture(a,ee.x.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(ee.x.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(Q.No.TEXTURE_2D,0,o,n,e,t,r,i),c.bindTexture(d,ee.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==we.zO.WEBGL2)return(0,Me.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=Re.createPixelPack(this._context,Q.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(Q.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=Q.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=this._context,i=t.createFramebuffer(),o=this._desc,n=o.colorTarget??Q.Lm.RENDER_BUFFER,a=o.width??1,s=o.height??1;if(t.bindFramebuffer(e,i),0===this._colorAttachments.size)if(n===Q.Lm.TEXTURE||n===Q.Lm.CUBEMAP)this._colorAttachments.set(Q.VY.COLOR_ATTACHMENT0,function(e,t,r){return new ee.x(e,{target:r,pixelFormat:Q.VI.RGBA,dataType:Q.Br.UNSIGNED_BYTE,samplingMode:Q.cw.NEAREST,wrapMode:Q.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(r,o,this.descriptor.colorTarget===Q.Lm.CUBEMAP?Q.No.TEXTURE_CUBE_MAP:Q.No.TEXTURE_2D));else{const e=new ye(r,{internalFormat:Q.lP.RGBA4,width:a,height:s});this._colorAttachments.set(Q.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((r,i)=>{r&&(Ne(r)?this._framebufferTexture2D(r.glName,i,Fe(r),e):t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,r.glName))}));const l=o.depthStencilTarget??Q.OU.NONE;switch(l){case Q.OU.DEPTH_RENDER_BUFFER:case Q.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new ye(r,{internalFormat:o.depthStencilTarget===Q.OU.DEPTH_RENDER_BUFFER?Q.Tg.DEPTH_COMPONENT16:Q.Tg.DEPTH_STENCIL,width:a,height:s}));const i=l===Q.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,this._depthAttachment.glName);break}case Q.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new ye(r,{internalFormat:Q.Tg.STENCIL_INDEX8,width:a,height:s})),t.framebufferRenderbuffer(e,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,this._stencilAttachment.glName);break;case Q.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:Q.No.TEXTURE_2D,pixelFormat:Q.VI.DEPTH_STENCIL,dataType:Q.Br.UNSIGNED_INT_24_8,samplingMode:Q.cw.NEAREST,wrapMode:Q.e8.CLAMP_TO_EDGE,width:a,height:s};this._depthStencilTexture=new ee.x(r,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,Fe(this._depthStencilTexture),e)}(0,Me.CG)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,t=Q.VY.COLOR_ATTACHMENT0,r=Q.No.TEXTURE_2D,i=Q.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_detachColorAttachment(e){(0,Me.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return Ne(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(Q.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===Q.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(Q.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(Q.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===Oe._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Oe._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Oe._MAX_COLOR_ATTACHMENTS=1}const t=e-Q.VY.COLOR_ATTACHMENT0;t+1>Oe._MAX_COLOR_ATTACHMENTS&&A.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Oe._MAX_COLOR_ATTACHMENTS} color attachments`)}}function Ne(e){return null!=e&&"type"in e&&"texture"===e.type}function Pe(e){return null!=e&&"type"in e&&"renderbuffer"===e.type}function Ie(e){return Ne(e)||null!=e&&"pixelFormat"in e}function Le(e,t){e.target!==Q.No.TEXTURE_2D&&e.target!==Q.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function De(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function Fe(e){return e.descriptor.target===Q.No.TEXTURE_CUBE_MAP?Q.No.TEXTURE_CUBE_MAP_POSITIVE_X:Q.No.TEXTURE_2D}Oe._MAX_COLOR_ATTACHMENTS=-1;var Be,He,Ue=r(46314);class ze extends N.c{constructor(e,t){super(),this._data=e,this.type=P.U.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new H.Z,this._passParameters=new J,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:Q.e8.REPEAT,t:Q.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||w.CE.STRETCH,this.estimatedTexMemRequired=ze._estimateTexMemRequired(this._data,this.params),this._startPreload()}_startPreload(){const e=this._data;(0,o.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,G.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,G.HK)(e.src)||(0,G.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,o.Wi)(e))return 0;if((0,z.eP)(e)||(0,z.lq)(e))return t.encoding===ze.KTX2_ENCODING?function(e,t){if((0,o.Wi)(ae))return e.byteLength;const r=new ae.KTX2File(new Uint8Array(e)),i=ue(r)?ce(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===ze.BASIS_ENCODING?function(e,t){if((0,o.Wi)(ae))return e.byteLength;const r=new ae.BasisFile(new Uint8Array(e)),i=de(r)?ce(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ze._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this._data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:Q.No.TEXTURE_2D,pixelFormat:Q.VI.RGBA,dataType:Q.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?Q.cw.LINEAR_MIPMAP_LINEAR:Q.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e,t){if((0,o.pC)(this._glTexture))return this._glTexture;if((0,o.pC)(this._loadingPromise))return this._loadingPromise;const r=this._data;return(0,o.Wi)(r)?(this._glTexture=new ee.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===ze.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,r)):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===ze.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,r)):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===ze.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,r)):(0,z.lq)(r)?this._loadFromPixelData(e,r):(0,z.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this._data instanceof HTMLVideoElement)||(0,o.Wi)(this._glTexture))return r;if(this._data.readyState<Be.HAVE_CURRENT_DATA||r===this._data.currentTime)return r;if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:o}=this._powerOfTwoStretchInfo;o.setData(this._data),this._drawStretchedTexture(e,t,r,i,o,this._glTexture)}else{const{videoWidth:e,videoHeight:t}=this._data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this._data):this._glTexture.setData(this._data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.params.updateCallback&&this.params.updateCallback(),this._data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:o,width:n,height:a}=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return fe.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return fe.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case pe:o=8,n=Q.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ge:o=16,n=Q.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case _e:o=16,n=Q.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return fe.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];0==(3&s)&&0==(3&l)||(fe.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])),1===a||(0,U.wt)(s)&&(0,U.wt)(l)||(fe.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:n,width:c,height:d}}(r,t.hasMipmap);return t.samplingMode=i.levels.length>1?Q.cw.LINEAR_MIPMAP_LINEAR:Q.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=o,t.width=n,t.height=a,new ee.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(ae)&&(ae=await le());const i=new ae.KTX2File(new Uint8Array(r));if(!ue(i))return null;i.startTranscoding();const n=he(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(ae)&&(ae=await le());const i=new ae.BasisFile(new Uint8Array(r));if(!de(i))return null;i.startTranscoding();const n=he(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,R.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?Q.VI.LUMINANCE:3===this.params.components?Q.VI.RGB:Q.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new ee.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const o=await M(r,{signal:i});return(0,E.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const o=await(0,V.fY)(r,r.src,!1,i);return(0,E.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Be.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((n,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,o.hw)(d)},l=()=>{r.readyState>=Be.HAVE_CURRENT_DATA&&(s(),n(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new b.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const d=(0,E.fu)(i,(()=>c((0,E.zE)())))}))))}_loadFromImage(e,t,r){const i=ze._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this.params.components?Q.VI.RGB:Q.VI.RGBA,!this._requiresPowerOfTwo(e,o)||(0,U.wt)(i.width)&&(0,U.wt)(i.height)?(o.width=i.width,o.height=i.height,this._glTexture=new ee.x(e,o,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,o,r),this._glTexture)}_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)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=Q.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,Ue.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,o){const{width:n,height:a}=r,s=(0,U.Sf)(n),l=(0,U.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case w.CE.PAD:i.textureCoordinateScaleFactor=[n/s,a/l],c=new ee.x(e,i),c.updateData(0,0,0,n,a,t);break;case w.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,o());break;default:(0,B.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const o=new ee.x(e,r),n=new Oe(e,{colorTarget:Q.Lm.TEXTURE,depthStencilTarget:Q.OU.NONE},o),a=new ee.x(e,{target:Q.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:Q.Br.UNSIGNED_BYTE,wrapMode:Q.e8.CLAMP_TO_EDGE,samplingMode:Q.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=Te,r=ve.i,i=-1,o=1){let n=null;return n=t===be?new Float32Array([i,i,0,0,o,i,1,0,i,o,0,1,o,o,1,1]):new Float32Array([i,i,o,i,i,o,o,o]),new Ee(e,r,{geometry:t},{geometry:Re.createVertex(e,Q.l1.STATIC_DRAW,n)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,n,s,a,o),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:n}:(s.dispose(!0),a.dispose(),n.detachColorTexture(),n.dispose()),e.bindFramebuffer(l),o}_drawStretchedTexture(e,t,r,i,o,n){this._passParameters.texture=o,e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,n.descriptor.width,n.descriptor.height),e.bindTechnique(t,this._passParameters,null),e.bindVAO(i),e.drawArrays(Q.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height),this._passParameters.texture=null}unload(){if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,o.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,o.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}ze.DDS_ENCODING="image/vnd-ms.dds",ze.KTX2_ENCODING="image/ktx2",ze.BASIS_ENCODING="image/x.basis",(He=Be||(Be={}))[He.HAVE_NOTHING=0]="HAVE_NOTHING",He[He.HAVE_METADATA=1]="HAVE_METADATA",He[He.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",He[He.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",He[He.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var Ge=r(64822),Ve=r(65576),We=r(55039),ke=r(64267),qe=r(19419),$e=r(85504),Xe=r(60537),je=r(82791),Je=r(93144);function Ye(e,t,r=Q.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}const Ze={face:Q.LR.BACK,mode:Q.Wf.CCW},Ke={face:Q.LR.FRONT,mode:Q.Wf.CCW},Qe=e=>e===w.Vr.Back?Ze:e===w.Vr.Front?Ke:null,et={zNear:0,zFar:1},tt={r:!0,g:!0,b:!0,a:!0};function rt(e){return ht.intern(e)}function it(e){return mt.intern(e)}function ot(e){return gt.intern(e)}function nt(e){return vt.intern(e)}function at(e){return Tt.intern(e)}function st(e){return At.intern(e)}function lt(e){return St.intern(e)}function ct(e){return wt.intern(e)}class dt{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function ut(e){return"["+e.join(",")+"]"}const ht=new dt(ft,(e=>({__tag:"Blending",...e})));function ft(e){return e?ut([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const mt=new dt(pt,(e=>({__tag:"Culling",...e})));function pt(e){return e?ut([e.face,e.mode]):null}const gt=new dt(_t,(e=>({__tag:"PolygonOffset",...e})));function _t(e){return e?ut([e.factor,e.units]):null}const vt=new dt(xt,(e=>({__tag:"DepthTest",...e})));function xt(e){return e?ut([e.func]):null}const Tt=new dt(bt,(e=>({__tag:"StencilTest",...e})));function bt(e){return e?ut([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const At=new dt(Et,(e=>({__tag:"DepthWrite",...e})));function Et(e){return e?ut([e.zNear,e.zFar]):null}const St=new dt(Mt,(e=>({__tag:"ColorWrite",...e})));function Mt(e){return e?ut([e.r,e.g,e.b,e.a]):null}const wt=new dt(Ct,(e=>({__tag:"StencilWrite",...e})));function Ct(e){return e?ut([e.mask]):null}const Rt=new dt((function(e){return e?ut([ft(e.blending),pt(e.culling),_t(e.polygonOffset),xt(e.depthTest),bt(e.stencilTest),Et(e.depthWrite),Mt(e.colorWrite),Ct(e.stencilWrite)]):null}),(e=>({blending:rt(e.blending),culling:it(e.culling),polygonOffset:ot(e.polygonOffset),depthTest:nt(e.depthTest),stencilTest:at(e.stencilTest),depthWrite:st(e.depthWrite),colorWrite:lt(e.colorWrite),stencilWrite:ct(e.stencilWrite)}))),yt=function(e,t,r,i,o=Q.db.ADD,n=Q.db.ADD,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:n,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}(Q.zi.SRC_ALPHA,Q.zi.ONE,Q.zi.ONE_MINUS_SRC_ALPHA,Q.zi.ONE_MINUS_SRC_ALPHA),Ot=Ye(Q.zi.ONE,Q.zi.ONE),Nt=Ye(Q.zi.ZERO,Q.zi.ONE_MINUS_SRC_ALPHA);function Pt(e){return e===Je.A.FrontFace?null:e===Je.A.Alpha?Nt:Ot}const It={factor:-1,units:-2};function Lt(e,t=Q.wb.LESS){return e===Je.A.NONE||e===Je.A.FrontFace?t:Q.wb.LEQUAL}var Dt,Ft;(Ft=Dt||(Dt={}))[Ft.INTEGRATED_MESH=0]="INTEGRATED_MESH",Ft[Ft.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",Ft[Ft.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",Ft[Ft.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",Ft[Ft.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",Ft[Ft.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",Ft[Ft.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",Ft[Ft.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",Ft[Ft.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",Ft[Ft.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",Ft[Ft.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",Ft[Ft.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",Ft[Ft.LASERLINES=12]="LASERLINES",Ft[Ft.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",Ft[Ft.HUD_MATERIAL=14]="HUD_MATERIAL",Ft[Ft.LABEL_MATERIAL=15]="LABEL_MATERIAL",Ft[Ft.LINE_CALLOUTS=16]="LINE_CALLOUTS",Ft[Ft.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",Ft[Ft.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",Ft[Ft.DRAPED_WATER=19]="DRAPED_WATER",Ft[Ft.VOXEL=20]="VOXEL",Ft[Ft.MAX_SLOTS=21]="MAX_SLOTS";var Bt=r(51305),Ht=r(94961),Ut=r(72119),zt=r(29268);const Gt=(0,d.c)(),Vt=(0,d.c)(),Wt=(0,d.c)(),kt=new class{constructor(e=0){this.offset=e,this.sphere=(0,zt.c)(),this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],n=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+n*n+a*a);o+=o*s,n+=n*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*n+l[8]*a+l[12],this.tmpVertex[1]=l[1]*o+l[5]*n+l[9]*a+l[13],this.tmpVertex[2]=l[2]*o+l[6]*n+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,d.c)(),this._mbs=(0,zt.c)(),this._obb={center:(0,d.c)(),halfSize:(0,Ut.c)(),quaternion:null},this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,n=r+this.componentLocalOriginLength,a=this._totalOffset/Math.sqrt(i*i+o*o+n*n);return this._tmpVertex[0]=e+i*a,this._tmpVertex[1]=t+o*a,this._tmpVertex[2]=r+n*a,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],n=e[4],a=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*n<0?0:Math.min(Math.abs(r),Math.abs(n)),c=i*a<0?0:Math.min(Math.abs(i),Math.abs(a)),d=Math.sqrt(s*s+l*l+c*c);if(d<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=n>0?this._totalOffset:0,e[5]+=a>0?this._totalOffset:0,e;const u=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(n)),f=Math.max(Math.abs(i),Math.abs(a)),m=Math.sqrt(u*u+h*h+f*f),p=this._totalOffset/m,g=this._totalOffset/d;return e[0]+=t*(t>0?p:g),e[1]+=r*(r>0?p:g),e[2]+=i*(i>0?p:g),e[3]+=o*(o<0?p:g),e[4]+=n*(n<0?p:g),e[5]+=a*(a<0?p:g),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,c.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,c.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,Bt.c)(qt,e.quaternion),(0,c.q)(this._obb.halfSize,this._obb.halfSize,qt),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],n=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)Gt[t]=e[0+t]+this.localOrigin[t],Vt[t]=e[3+t]+this.localOrigin[t],Wt[t]=Gt[t];const t=this.applyToVertex(Gt[0],Gt[1],Gt[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t+0]=Math.min(e[t+0],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)Wt[t]=0==(e&1<<t)?Gt[t]:Vt[t];r(Wt)}let i=0;for(let e=0;e<3;++e)Gt[e]*Vt[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)i[t]?Wt[t]=0:Wt[t]=0!=(e&1<<t)?Gt[t]:Vt[t];r(Wt)}for(let t=0;t<3;++t)e[t+0]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const qt=(0,Ht.a)();function $t(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Xt(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function jt(e,t,r,i,o,n=1){if(!r)return void Xt(e,t,i,o,n);const a=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],d=r[1],u=r[2],h=r[4],f=r[5],m=r[6],p=r[8],g=r[9],_=r[10],v=r[12],x=r[13],T=r[14];if(o*=s,1===n)for(let r=0;r<l;++r){const i=3*e[r],n=t[i],l=t[i+1],b=t[i+2];a[o]=c*n+h*l+p*b+v,a[o+1]=d*n+f*l+g*b+x,a[o+2]=u*n+m*l+_*b+T,o+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+p*A+v,S=d*l+f*b+g*A+x,M=u*l+m*b+_*A+T;for(let e=0;e<n;++e)a[o]=E,a[o+1]=S,a[o+2]=M,o+=s}}function Jt(e,t,r,i,o,n=1){if(!r)return void Xt(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],g=a[6],_=a[8],v=a[9],x=a[10],T=!(0,s.y)(a),b=1e-6,A=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=3*e[r],n=t[i],a=t[i+1],s=t[i+2];let d=u*n+m*a+_*s,E=h*n+p*a+v*s,S=f*n+g*a+x*s;if(T){const e=d*d+E*E+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,E*=t,S*=t}}l[o+0]=d,l[o+1]=E,l[o+2]=S,o+=c}else for(let r=0;r<d;++r){const i=3*e[r],a=t[i],s=t[i+1],d=t[i+2];let E=u*a+m*s+_*d,S=h*a+p*s+v*d,M=f*a+g*s+x*d;if(T){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<n;++e)l[o+0]=E,l[o+1]=S,l[o+2]=M,o+=c}}function Yt(e,t,r,i,o,n=1){if(!r)return void function(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],g=a[6],_=a[8],v=a[9],x=a[10],T=!(0,s.y)(a),b=1e-6,A=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let E=u*n+m*a+_*s,S=h*n+p*a+v*s,M=f*n+g*a+x*s;if(T){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}l[o+0]=E,l[o+1]=S,l[o+2]=M,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],E=t[i+3];let S=u*a+m*s+_*d,M=h*a+p*s+v*d,w=f*a+g*s+x*d;if(T){const e=S*S+M*M+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,M*=t,w*=t}}for(let e=0;e<n;++e)l[o+0]=S,l[o+1]=M,l[o+2]=w,l[o+3]=E,o+=c}}function Zt(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,1===n){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}function Kt(e,t,r,i){const o=t.typedBuffer,n=t.typedBufferStride;i*=n;for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=n}var Qt=r(37782),er=r(135),tr=r(15719),rr=r(96310),ir=r(89243);class or{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}var nr=r(67498);class ar{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new C.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(nr.P.Pass,this),this.bindDraw=t.generateBind(nr.P.Draw,this),this._fragmentUniforms=(0,Me.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get isCompiled(){return this._glProgram.isCompiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if((0,o.Wi)(t)||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),(0,o.pC)(this._fragmentUniforms)&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}Q.wb.LESS,Q.wb.ALWAYS;const sr={mask:255},lr={function:{func:Q.wb.ALWAYS,ref:w.hU.OutlineVisualElementMask,mask:w.hU.OutlineVisualElementMask},operation:{fail:Q.xS.KEEP,zFail:Q.xS.KEEP,zPass:Q.xS.ZERO}},cr={function:{func:Q.wb.ALWAYS,ref:w.hU.OutlineVisualElementMask,mask:w.hU.OutlineVisualElementMask},operation:{fail:Q.xS.KEEP,zFail:Q.xS.KEEP,zPass:Q.xS.REPLACE}};Q.wb.EQUAL,w.hU.OutlineVisualElementMask,w.hU.OutlineVisualElementMask,Q.xS.KEEP,Q.xS.KEEP,Q.xS.KEEP,Q.wb.NOTEQUAL,w.hU.OutlineVisualElementMask,w.hU.OutlineVisualElementMask,Q.xS.KEEP,Q.xS.KEEP,Q.xS.KEEP;var dr=r(32078);class ur extends tr.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=w.Vr.Back,this.emissiveFactor=(0,d.f)(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.f)(.2,.2,.2),this.diffuse=(0,d.f)(.8,.8,.8),this.externalColor=(0,W.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=(0,a.c)(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=w.Gv.Less,this.textureAlphaMode=w.JJ.Blend,this.textureAlphaCutoff=rr.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=je.yD.Occlude}}class hr extends class{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,o.O3)(this._program),this._pipeline=this._configuration=null}reload(e){(0,o.O3)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.isCompiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return Q.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}{initializeConfiguration(e,t){t.spherical=e.viewingMode===Ge.JY.Global,t.doublePrecisionRequiresObfuscation=(0,ir.I)(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetalnessAndRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?er.N.Default:er.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,hr.shader)}_initializeProgram(e,t){return new ar(e.rctx,t.get().build(this.configuration),ve.i)}_convertDepthTestFunction(e){return e===w.Gv.Lequal?Q.wb.LEQUAL:Q.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===Je.A.NONE,o=e===Je.A.FrontFace;return function(e){return Rt.intern(e)}({blending:r.output!==We.H.Color&&r.output!==We.H.Alpha||!r.transparent?null:i?yt:Pt(e),culling:fr(r)&&Qe(r.cullFace),depthTest:{func:Lt(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:i||o?r.writeDepth&&et:null,colorWrite:tt,stencilWrite:r.hasOccludees?sr:null,stencilTest:r.hasOccludees?t?cr:lr:null,polygonOffset:i||o?null:(n=r.enableOffset,n?It:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function fr(e){return e.cullFace!==w.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}hr.shader=new or(dr.D,(()=>r.e(9291).then(r.bind(r,79291))));var mr=r(43697),pr=r(51354);class gr extends pr.m{}(0,mr._)([(0,pr.o)({constValue:!0})],gr.prototype,"hasSliceHighlight",void 0),(0,mr._)([(0,pr.o)({constValue:!1})],gr.prototype,"hasSliceInVertexProgram",void 0),(0,mr._)([(0,pr.o)({constValue:!1})],gr.prototype,"instancedDoublePrecision",void 0),(0,mr._)([(0,pr.o)({constValue:!1})],gr.prototype,"isGround",void 0),(0,mr._)([(0,pr.o)({constValue:!1})],gr.prototype,"hasModelTransformation",void 0),(0,mr._)([(0,pr.o)({constValue:nr.P.Pass})],gr.prototype,"pbrTextureBindType",void 0);class _r extends gr{constructor(){super(...arguments),this.output=We.H.Color,this.alphaDiscardMode=w.JJ.Opaque,this.doubleSidedMode=qe.q.None,this.pbrMode=$e.f7.Disabled,this.cullFace=w.Vr.None,this.transparencyPassType=Je.A.NONE,this.normalType=ke.h.Attribute,this.textureCoordinateType=er.N.None,this.customDepthTest=w.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1}}(0,mr._)([(0,pr.o)({count:We.H.COUNT})],_r.prototype,"output",void 0),(0,mr._)([(0,pr.o)({count:w.JJ.COUNT})],_r.prototype,"alphaDiscardMode",void 0),(0,mr._)([(0,pr.o)({count:qe.q.COUNT})],_r.prototype,"doubleSidedMode",void 0),(0,mr._)([(0,pr.o)({count:$e.f7.COUNT})],_r.prototype,"pbrMode",void 0),(0,mr._)([(0,pr.o)({count:w.Vr.COUNT})],_r.prototype,"cullFace",void 0),(0,mr._)([(0,pr.o)({count:Je.A.COUNT})],_r.prototype,"transparencyPassType",void 0),(0,mr._)([(0,pr.o)({count:ke.h.COUNT})],_r.prototype,"normalType",void 0),(0,mr._)([(0,pr.o)({count:er.N.COUNT})],_r.prototype,"textureCoordinateType",void 0),(0,mr._)([(0,pr.o)({count:w.Gv.COUNT})],_r.prototype,"customDepthTest",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"spherical",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasVertexColors",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasSymbolColors",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasVerticalOffset",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasSlicePlane",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasSliceHighlight",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasColorTexture",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasMetalnessAndRoughnessTexture",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasEmissionTexture",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasOcclusionTexture",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasNormalTexture",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasScreenSizePerspective",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasVertexTangents",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasOccludees",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasMultipassTerrain",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"hasModelTransformation",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"offsetBackfaces",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"vvSize",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"vvColor",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"receiveShadows",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"receiveAmbientOcclusion",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"textureAlphaPremultiplied",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"instanced",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"instancedColor",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"objectAndLayerIdColorInstanced",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"instancedDoublePrecision",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"writeDepth",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"transparent",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"enableOffset",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"cullAboveGround",void 0),(0,mr._)([(0,pr.o)()],_r.prototype,"snowCover",void 0),(0,mr._)([(0,pr.o)({constValue:!0})],_r.prototype,"hasVvInstancing",void 0),(0,mr._)([(0,pr.o)({constValue:!1})],_r.prototype,"useCustomDTRExponentForWater",void 0),(0,mr._)([(0,pr.o)({constValue:!1})],_r.prototype,"supportsTextureAtlas",void 0),(0,mr._)([(0,pr.o)({constValue:!0})],_r.prototype,"useFillLights",void 0);var vr=r(41846);class xr extends hr{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetalnessAndRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=ke.h.Attribute,t.doubleSidedMode=qe.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,xr.shader)}}xr.shader=new or(vr.R,(()=>r.e(8096).then(r.bind(r,38096))));class Tr extends je.F5{constructor(e){super(e,Ar),this.supportsEdges=!0,this._configuration=new _r,this._vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,Ve.U$)().vec3f(L.T.POSITION).vec3f(L.T.NORMAL);return e.hasVertexTangents&&r.vec4f(L.T.TANGENT),t&&r.vec2f(L.T.UV0),e.hasVertexColors&&r.vec4u8(L.T.COLOR),e.hasSymbolColors&&r.vec4u8(L.T.SYMBOLCOLOR),(0,te.Z)("enable-feature:objectAndLayerId-rendering")&&r.vec4u8(L.T.OBJECTANDLAYERIDCOLOR),r}(this.parameters),this._instanceBufferLayout=e.instanced?function(e){let t=(0,Ve.U$)();return t=e.instancedDoublePrecision?t.vec3f(L.T.MODELORIGINHI).vec3f(L.T.MODELORIGINLO).mat3f(L.T.MODEL).mat3f(L.T.MODELNORMAL):t.mat4f(L.T.MODEL).mat4f(L.T.MODELNORMAL),(0,o.pC)(e.instanced)&&e.instanced.includes("color")&&(t=t.vec4f(L.T.INSTANCECOLOR)),(0,o.pC)(e.instanced)&&e.instanced.includes("featureAttribute")&&(t=t.vec4f(L.T.INSTANCEFEATUREATTRIBUTE)),(0,o.pC)(e.instanced)&&e.instanced.includes("objectAndLayerIdColor")&&(t=t.vec4u8(L.T.OBJECTANDLAYERIDCOLOR_INSTANCED)),t}(this.parameters):null}isVisibleForOutput(e){return e!==We.H.Shadow&&e!==We.H.ShadowExludeHighlight&&e!==We.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{instanced:t,hasVertexColors:r,hasSymbolColors:i,vvColorEnabled:n}=e,a=(0,o.pC)(t)&&t.includes("color"),s="replace"===e.colorMixMode,l=e.opacity>0,c=e.externalColor&&e.externalColor[3]>0;return r&&(a||n||i)?!!s||l:r?s?c:l:a||n||i?!!s||l:s?c:l}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=!!this.parameters.instanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.hasVerticalOffset=(0,o.pC)(this.parameters.verticalOffset),this._configuration.hasScreenSizePerspective=(0,o.pC)(this.parameters.screenSizePerspective),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType="screenDerivative"===this.parameters.normals?ke.h.ScreenDerivative:ke.h.Attribute,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,(0,o.pC)(this.parameters.customDepthTest)&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?w.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=(0,o.pC)(this.parameters.modelTransformation),e!==We.H.Color&&e!==We.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=qe.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?qe.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?qe.q.WindingOrder:qe.q.None,this._configuration.instancedColor=(0,o.pC)(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.ready&&this.parameters.receiveSSAO,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?$e.f7.Schematic:$e.f7.Normal:$e.f7.Disabled,this._configuration.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t)),this._configuration}hasSnowCover(e){return(0,o.pC)(e.weather)&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,n,a,s){if((0,o.pC)(this.parameters.verticalOffset)){const e=i.camera;(0,c.s)(yr,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case Ge.JY.Global:t=(0,c.n)(Cr,yr);break;case Ge.JY.Local:t=(0,c.c)(Cr,wr)}let o=0;const s=(0,c.b)(Or,yr,e.eye),l=(0,c.l)(s),d=(0,c.g)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.e)(t,d)),o+=(0,Qt.Hx)(e,l,this.parameters.verticalOffset,u,this.parameters.screenSizePerspective),(0,c.g)(t,t,o),(0,c.t)(Rr,t,i.transform.inverseRotation),n=(0,c.b)(Sr,n,Rr),a=(0,c.b)(Mr,a,Rr)}var l;(0,Qt.Bw)(e,t,i,n,a,(l=i.verticalOffset,(0,o.pC)(l)?(kt.offset=l,kt):null),s)}requiresSlot(e,t){return(t===We.H.Color||t===We.H.Alpha||t===We.H.Depth||t===We.H.Normal||t===We.H.Shadow||t===We.H.ShadowHighlight||t===We.H.ShadowExludeHighlight||t===We.H.Highlight||t===We.H.ObjectAndLayerIdColor)&&(e===(this.parameters.transparent?this.parameters.writeDepth?Dt.TRANSPARENT_MATERIAL:Dt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Dt.OPAQUE_MATERIAL)||e===Dt.DRAPED_MATERIAL||t===We.H.ObjectAndLayerIdColor&&this.parameters.writeObjectAndLayerId)}createGLMaterial(e){return new br(e)}createBufferWriter(){return new Er(this._vertexBufferLayout,this._instanceBufferLayout)}}class br extends Xe.F{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?xr:hr,e)}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==We.H.Color&&this._output!==We.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}const Ar=new class extends ur{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.writeObjectAndLayerId=!1,this.hasVertexTangents=!1}};class Er{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(L.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,n,a){for(const s of t.fieldNames){const t=e.vertexAttributes.get(s),l=e.indices.get(s);if(t&&l)switch(s){case L.T.POSITION:{(0,R.hu)(3===t.size);const e=n.getField(s,h.ct);e&&jt(l,t.data,r,e,a);break}case L.T.NORMAL:{(0,R.hu)(3===t.size);const e=n.getField(s,h.ct);e&&Jt(l,t.data,i,e,a);break}case L.T.UV0:{(0,R.hu)(2===t.size);const e=n.getField(s,h.Eu);e&&$t(l,t.data,e,a);break}case L.T.COLOR:{(0,R.hu)(3===t.size||4===t.size);const e=n.getField(s,h.mc);e&&Zt(l,t.data,t.size,e,a);break}case L.T.SYMBOLCOLOR:{(0,R.hu)(3===t.size||4===t.size);const e=n.getField(s,h.mc);e&&Zt(l,t.data,t.size,e,a);break}case L.T.TANGENT:{(0,R.hu)(4===t.size);const e=n.getField(s,h.ek);e&&Yt(l,t.data,i,e,a);break}}else if(s===L.T.OBJECTANDLAYERIDCOLOR&&(0,o.pC)(e.objectAndLayerIdColor)&&4===e.objectAndLayerIdColor.length&&e.indices.get(L.T.POSITION)){const t=e.indices.get(L.T.POSITION).length,r=n.getField(s,h.mc);Kt(e.objectAndLayerIdColor,r,t,a)}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const Sr=(0,d.c)(),Mr=(0,d.c)(),wr=(0,d.f)(0,0,1),Cr=(0,d.c)(),Rr=(0,d.c)(),yr=(0,d.c)(),Or=(0,d.c)(),Nr=A.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Pr(e){throw new b.Z("",`Request for object resource failed: ${e}`)}function Ir(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Nr.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Nr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Nr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Nr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Nr.warn("Indexed geometries must specify faces"),i=!1;break}default:Nr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Nr.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Nr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Lr(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,o.pC)(r)&&((0,u.pp)(t,r.getBBMin()),(0,u.pp)(t,r.getBBMax()))})),t}async function Dr(e,t){const r=[];for(const i in e){const n=e[i],a=n.images[0].data;if(!a){Nr.warn("Externally referenced texture data is not yet supported");continue}const s=n.encoding+";base64,"+a,l="/textureDefinitions/"+i,c="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",d={noUnpackFlip:!0,wrap:{s:Q.e8.REPEAT,t:Q.e8.REPEAT},preMultiplyAlpha:Fr(c)!==w.JJ.Opaque},u=(0,o.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(u.then((e=>({refId:l,image:e,params:d,alphaChannelUsage:c}))))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}function Fr(e){switch(e){case"mask":return w.JJ.Mask;case"maskAndTransparency":return w.JJ.MaskBlend;case"none":return w.JJ.Opaque;default:return w.JJ.Blend}}function Br(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Hr=new S.G(1,2,"wosr");var Ur=r(57758),zr=r(10816),Gr=r(75488),Vr=r(56067);async function Wr(e,t){const r=kr((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,o.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,T.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,E.r9)(i.error),Pr(i.error.details.url)}(e,r,t);const i=await(0,T.q6)((0,x.default)(e,(0,o.Wg)(t)));if(!0===i.ok)return i.value.data;(0,E.r9)(i.error),Pr(i.error)}(e,t);return{resource:r,textures:await Dr(r.textureDefinitions,t)}}(r.url,t)),i=function(e,t){const r=[],i=[],n=[],a=[],s=e.resource,l=S.G.parse(s.version||"1.0","wosr");Hr.validate(l);const c=s.model.name,u=s.model.geometries,h=s.materialDefinitions,f=e.textures;let m=0;const p=new Map;for(let e=0;e<u.length;e++){const s=u[e];if(!Ir(s))continue;const l=Br(s),c=s.params.vertexAttributes,g=[];for(const e in c){const t=c[e],r=t.values;g.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const _=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)_.push([t,new Uint32Array(e[t].values)])}const v=f&&f[l.texture];if(v&&!p.has(l.texture)){const{image:e,params:t}=v,r=new ze(e,t);a.push(r),p.set(l.texture,r)}const x=p.get(l.texture),T=x?x.id:void 0;let b=n[l.material]?n[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,a=v?Fr(v.alphaChannelUsage):void 0,s={ambient:(0,d.d)(e.diffuse),diffuse:(0,d.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:a,textureAlphaCutoff:.33,textureId:T,initTextureTransparent:!0,doubleSided:!0,cullFace:w.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};(0,o.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new Tr(s),n[l.material]||(n[l.material]={}),n[l.material][l.texture]=b}i.push(b);const A=new D(g,_);m+=_.position?_.position.length:0,r.push(A)}return{name:c,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:Lr(r),numberOfVertices:m,lodThreshold:null}}(e,t);return{lods:[i],referenceBoundingBox:i.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,_.z)(new g.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,o.U2)(n.model.meta,"ESRI_proxyEllipsoid");n.meta.isEsriSymbolResource&&(0,o.pC)(a)&&n.meta.uri.includes("/RealisticTrees/")&&function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const n of i.parts){const i=n.attributes.normal;if((0,o.Wi)(i))return;const a=n.attributes.position,u=a.count,f=(0,d.c)(),m=(0,d.c)(),g=(0,d.c)(),_=(0,p.gS)(h.mc,u),v=(0,p.gS)(h.ct,u),x=(0,s.a)((0,l.c)(),n.transform);for(let o=0;o<u;o++){a.getVec(o,m),i.getVec(o,f),(0,c.m)(m,m,n.transform),(0,c.b)(g,m,t.center),(0,c.H)(g,g,t.radius);const s=g[2],l=(0,c.l)(g),d=Math.min(.45+.55*l*l,1);(0,c.H)(g,g,t.radius),(0,c.m)(g,g,x),(0,c.n)(g,g),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(g,g,f,s>-1?.2:Math.min(-4*s-3.8,1)),v.setVec(o,g),_.set(o,0,255*d),_.set(o,1,255*d),_.set(o,2,255*d),_.set(o,3,255)}n.attributes.normal=v,n.attributes.color=_}}}(n,a);const u=n.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:!!n.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:!!n.customMeta.esriTreeRendering};if(null!=r.specifiedLodIndex){const e=qr(n,u,f,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=qr(n,u,f,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1,remove:n.remove}}const m=qr(n,u,f);return{lods:m,referenceBoundingBox:m[0].boundingBox,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1,remove:n.remove}}function kr(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function qr(e,t,r,i){const s=e.model,l=(0,a.c)(),c=new Array,d=new Map,g=new Map;return s.lods.forEach(((e,a)=>{if(void 0!==i&&a!==i)return;const _={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,o.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,u.cS)()};c.push(_),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=s.materials.get(e.material),c=(0,o.pC)(e.attributes.texCoord0),x=(0,o.pC)(e.attributes.normal),T=function(e){switch(e){case"BLEND":return w.JJ.Blend;case"MASK":return w.JJ.Mask;case"OPAQUE":case null:case void 0:return w.JJ.Opaque}}(a.alphaMode);if(!d.has(i)){if(c){if((0,o.pC)(a.textureColor)&&!g.has(a.textureColor)){const e=s.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:T!==w.JJ.Opaque};g.set(a.textureColor,new ze(e.data,t))}if((0,o.pC)(a.textureNormal)&&!g.has(a.textureNormal)){const e=s.textures.get(a.textureNormal);g.set(a.textureNormal,new ze(e.data,e.parameters))}if((0,o.pC)(a.textureOcclusion)&&!g.has(a.textureOcclusion)){const e=s.textures.get(a.textureOcclusion);g.set(a.textureOcclusion,new ze(e.data,e.parameters))}if((0,o.pC)(a.textureEmissive)&&!g.has(a.textureEmissive)){const e=s.textures.get(a.textureEmissive);g.set(a.textureEmissive,new ze(e.data,e.parameters))}if((0,o.pC)(a.textureMetallicRoughness)&&!g.has(a.textureMetallicRoughness)){const e=s.textures.get(a.textureMetallicRoughness);g.set(a.textureMetallicRoughness,new ze(e.data,e.parameters))}}const n=a.color[0]**(1/Ur.K),l=a.color[1]**(1/Ur.K),u=a.color[2]**(1/Ur.K),h=a.emissiveFactor[0]**(1/Ur.K),f=a.emissiveFactor[1]**(1/Ur.K),m=a.emissiveFactor[2]**(1/Ur.K),p=(0,o.pC)(a.textureColor)&&c?g.get(a.textureColor):null;d.set(i,new Tr({...t,transparent:T===w.JJ.Blend,customDepthTest:w.Gv.Lequal,textureAlphaMode:T,textureAlphaCutoff:a.alphaCutoff,diffuse:[n,l,u],ambient:[n,l,u],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?w.Vr.None:w.Vr.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:x?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:(0,o.pC)(p)?p.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:(0,o.pC)(a.textureNormal)&&c?g.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:(0,o.pC)(p)&&!!p.params.preMultiplyAlpha,occlusionTextureId:(0,o.pC)(a.textureOcclusion)&&c?g.get(a.textureOcclusion).id:void 0,emissiveTextureId:(0,o.pC)(a.textureEmissive)&&c?g.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,o.pC)(a.textureMetallicRoughness)&&c?g.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,m],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...r}))}const b=function(e,t){switch(t){case Q.MX.TRIANGLES:return(0,v.nh)(e);case Q.MX.TRIANGLE_STRIP:return(0,v.DA)(e);case Q.MX.TRIANGLE_FAN:return(0,v.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),A=e.attributes.position.count,E=(0,p.gS)(h.ct,A);(0,f.t)(E,e.attributes.position,e.transform);const S=[[L.T.POSITION,{data:E.typedBuffer,size:E.elementCount,exclusive:!0}]],M=[[L.T.POSITION,b]];if((0,o.pC)(e.attributes.normal)){const t=(0,p.gS)(h.ct,A);(0,n.b)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([L.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([L.T.NORMAL,b])}if((0,o.pC)(e.attributes.tangent)){const t=(0,p.gS)(h.ek,A);(0,n.b)(l,e.transform),(0,m.t)(t,e.attributes.tangent,l),S.push([L.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([L.T.TANGENT,b])}if((0,o.pC)(e.attributes.texCoord0)){const t=(0,p.gS)(h.Eu,A);(0,zr.n)(t,e.attributes.texCoord0),S.push([L.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([L.T.UV0,b])}if((0,o.pC)(e.attributes.color)){const t=(0,p.gS)(h.mc,A);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,m.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,Gr.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,m.s)(t,e.attributes.color,1/256);else{(0,Gr.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,Vr.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([L.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([L.T.COLOR,b])}const C=new D(S,M);_.stageResources.geometries.push(C),_.stageResources.materials.push(d.get(i)),c&&((0,o.pC)(a.textureColor)&&_.stageResources.textures.push(g.get(a.textureColor)),(0,o.pC)(a.textureNormal)&&_.stageResources.textures.push(g.get(a.textureNormal)),(0,o.pC)(a.textureOcclusion)&&_.stageResources.textures.push(g.get(a.textureOcclusion)),(0,o.pC)(a.textureEmissive)&&_.stageResources.textures.push(g.get(a.textureEmissive)),(0,o.pC)(a.textureMetallicRoughness)&&_.stageResources.textures.push(g.get(a.textureMetallicRoughness))),_.numberOfVertices+=A;const R=C.boundingInfo;(0,o.pC)(R)&&((0,u.pp)(_.boundingBox,R.getBBMin()),(0,u.pp)(_.boundingBox,R.getBBMax()))}))})),c}},6206:(e,t,r)=>{var i,o;r.d(t,{a9:()=>i}),r(22021),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),o=r(79583);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const o=this.stride;if(o%4==0){const n=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(n)}else{const n=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(n)}}}class a{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,o.n1)(t.ElementType),n=this.stride;this.fields.set(e,{size:i,constructor:t,offset:n,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new a;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new a}},1391:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e,t){switch(t.output){case i.H.Color:if(t.receiveShadows)return e.varyings.add("linearDepth","float"),void e.vertex.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExludeHighlight:return e.include(o.up,t),e.varyings.add("linearDepth","float"),e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar))),void e.vertex.code.add(a.H`void forwardLinearDepth() {
174
+ linearDepth = (-vPosition_view.z - nearFar[0]) / (nearFar[1] - nearFar[0]);
175
+ }`)}e.vertex.code.add(a.H`void forwardLinearDepth() {}`)}},62707:(e,t,r)=>{r.d(t,{w:()=>o});var i=r(74709);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
176
+ vec3 camToVert = posWorld - camPosWorld;
177
+ bool isBackface = dot(camToVert, normalWorld) > 0.0;
178
+ if (isBackface) {
179
+ posClip.z += 0.0000003 * posClip.w;
180
+ }
181
+ return posClip;
182
+ }`)}},55039:(e,t,r)=>{var i;r.d(t,{H:()=>i}),function(e){e[e.Color=0]="Color",e[e.Depth=1]="Depth",e[e.Normal=2]="Normal",e[e.Shadow=3]="Shadow",e[e.ShadowHighlight=4]="ShadowHighlight",e[e.ShadowExludeHighlight=5]="ShadowExludeHighlight",e[e.Highlight=6]="Highlight",e[e.Alpha=7]="Alpha",e[e.ObjectAndLayerIdColor=8]="ObjectAndLayerIdColor",e[e.COUNT=9]="COUNT"}(i||(i={}))},51546:(e,t,r)=>{r.d(t,{f5:()=>d});var i=r(70586),o=r(52138),n=r(13598),a=r(17896),s=r(65617),l=r(70582),c=(r(172),r(74709));function d(e,t){!function(e,t,r){if(!t.hasSlicePlane){const r=c.H`#define rejectBySlice(_pos_) false
183
+ #define discardBySlice(_pos_) {}
184
+ #define highlightSlice(_color_, _pos_) (_color_)`;return t.hasSliceInVertexProgram&&e.vertex.code.add(r),void e.fragment.code.add(r)}e.extensions.add("GL_OES_standard_derivatives"),t.hasSliceInVertexProgram&&e.vertex.uniforms.add(r),e.fragment.uniforms.add(r);const i=c.H`struct SliceFactors {
185
+ float front;
186
+ float side0;
187
+ float side1;
188
+ float side2;
189
+ float side3;
190
+ };
191
+ SliceFactors calculateSliceFactors(vec3 pos) {
192
+ vec3 rel = pos - slicePlaneOrigin;
193
+ vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
194
+ float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
195
+ float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
196
+ float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
197
+ float basis1Dot = dot(slicePlaneBasis1, rel);
198
+ float basis2Dot = dot(slicePlaneBasis2, rel);
199
+ return SliceFactors(
200
+ dot(slicePlaneNormal, pos) + slicePlaneW,
201
+ -basis1Dot - basis1Len2,
202
+ basis1Dot - basis1Len2,
203
+ -basis2Dot - basis2Len2,
204
+ basis2Dot - basis2Len2
205
+ );
206
+ }
207
+ bool sliceByFactors(SliceFactors factors) {
208
+ return factors.front < 0.0
209
+ && factors.side0 < 0.0
210
+ && factors.side1 < 0.0
211
+ && factors.side2 < 0.0
212
+ && factors.side3 < 0.0;
213
+ }
214
+ bool sliceEnabled() {
215
+ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
216
+ }
217
+ bool sliceByPlane(vec3 pos) {
218
+ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
219
+ }
220
+ #define rejectBySlice(_pos_) sliceByPlane(_pos_)
221
+ #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,o=c.H`vec4 applySliceHighlight(vec4 color, vec3 pos) {
222
+ SliceFactors factors = calculateSliceFactors(pos);
223
+ const float HIGHLIGHT_WIDTH = 1.0;
224
+ const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
225
+ factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
226
+ factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
227
+ factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
228
+ factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
229
+ factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
230
+ if (sliceByFactors(factors)) {
231
+ return color;
232
+ }
233
+ float highlightFactor = (1.0 - step(0.5, factors.front))
234
+ * (1.0 - step(0.5, factors.side0))
235
+ * (1.0 - step(0.5, factors.side1))
236
+ * (1.0 - step(0.5, factors.side2))
237
+ * (1.0 - step(0.5, factors.side3));
238
+ return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
239
+ }`,n=t.hasSliceHighlight?c.H`
240
+ ${o}
241
+ #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
242
+ `:c.H`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.code.add(i),e.fragment.code.add(i),e.fragment.code.add(n)}(e,t,[new l.B("slicePlaneOrigin",((e,r)=>function(e,t,r){if((0,i.Wi)(r.slicePlane))return s.Z;const o=u(e,t,r),n=h(o,r.slicePlane),l=f(e,o,r);return(0,i.pC)(l)?(0,a.m)(g,n,l):n}(t,e,r))),new l.B("slicePlaneBasis1",((e,r)=>m(t,e,r,(0,i.Wg)(r.slicePlane)?.basis1))),new l.B("slicePlaneBasis2",((e,r)=>m(t,e,r,(0,i.Wg)(r.slicePlane)?.basis2)))])}function u(e,t,r){return e.instancedDoublePrecision?(0,a.s)(p,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function h(e,t){return(0,i.pC)(e)?(0,a.b)(g,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?(0,i.pC)(t)?(0,o.h)(v,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function m(e,t,r,o){if((0,i.Wi)(o)||(0,i.Wi)(r.slicePlane))return s.Z;const n=u(e,t,r),l=h(n,r.slicePlane),c=f(e,n,r);return(0,i.pC)(c)?((0,a.a)(_,o,l),(0,a.m)(g,l,c),(0,a.m)(_,_,c),(0,a.b)(_,_,g)):o}const p=(0,s.c)(),g=(0,s.c)(),_=(0,s.c)(),v=(0,n.c)()},77171:(e,t,r)=>{r.d(t,{w:()=>o});var i=r(74709);function o(e,t){if(t.hasModelTransformation)return e.vertex.code.add(i.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {
243
+ vec4 eye = view * (model * vec4(pos, 1.0));
244
+ depth = (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;
245
+ return proj * eye;
246
+ }`),void e.vertex.code.add(i.H`vec4 transformPosition(mat4 proj, mat4 view, mat4 model, vec3 pos) {
247
+ return proj * (view * (model * vec4(pos, 1.0)));
248
+ }`);e.vertex.code.add(i.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
249
+ vec4 eye = view * vec4(pos, 1.0);
250
+ depth = (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;
251
+ return proj * eye;
252
+ }`),e.vertex.code.add(i.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
253
+ return proj * (view * vec4(pos, 1.0));
254
+ }`)}},47624:(e,t,r)=>{r.d(t,{f:()=>p});var i=r(43697),o=r(17896),n=r(65617),a=r(55039),s=r(89243),l=r(70582),c=r(74709),d=r(8319),u=r(51354),h=r(35065),f=r(9820);class m extends u.m{constructor(){super(...arguments),this.instancedDoublePrecision=!1}}function p(e,t){t.instanced&&t.instancedDoublePrecision&&(e.attributes.add(h.T.MODELORIGINHI,"vec3"),e.attributes.add(h.T.MODELORIGINLO,"vec3"),e.attributes.add(h.T.MODEL,"mat3"),e.attributes.add(h.T.MODELNORMAL,"mat3"));const r=e.vertex;t.instancedDoublePrecision&&(r.include(s.$,t),r.uniforms.add(new l.B("viewOriginHi",((e,t)=>(0,f.U8)((0,o.s)(g,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),g)))),r.uniforms.add(new l.B("viewOriginLo",((e,t)=>(0,f.GB)((0,o.s)(g,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),g))))),r.code.add(c.H`
255
+ vec3 calculateVPos() {
256
+ ${t.instancedDoublePrecision?"return model * localPosition().xyz;":"return localPosition().xyz;"}
257
+ }
258
+ `),r.code.add(c.H`
259
+ vec3 subtractOrigin(vec3 _pos) {
260
+ ${t.instancedDoublePrecision?c.H`
261
+ vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);
262
+ return _pos - originDelta;`:"return vpos;"}
263
+ }
264
+ `),r.code.add(c.H`
265
+ vec3 dpNormal(vec4 _normal) {
266
+ ${t.instancedDoublePrecision?"return normalize(modelNormal * _normal.xyz);":"return normalize(_normal.xyz);"}
267
+ }
268
+ `),t.output===a.H.Normal&&(r.uniforms.add(new d.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix))),r.code.add(c.H`
269
+ vec3 dpNormalView(vec4 _normal) {
270
+ ${t.instancedDoublePrecision?"return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);":"return normalize((viewNormal * _normal).xyz);"}
271
+ }
272
+ `)),t.hasVertexTangents&&r.code.add(c.H`
273
+ vec4 dpTransformVertexTangent(vec4 _tangent) {
274
+ ${t.instancedDoublePrecision?"return vec4(modelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
275
+
276
+ }
277
+ `)}(0,i._)([(0,u.o)()],m.prototype,"instancedDoublePrecision",void 0);const g=(0,n.c)()},64267:(e,t,r)=>{r.d(t,{O:()=>l,h:()=>n});var i=r(74709);function o(e){const t=i.H`vec3 decodeNormal(vec2 f) {
278
+ float z = 1.0 - abs(f.x) - abs(f.y);
279
+ return vec3(f + sign(f) * min(z, 0.0), z);
280
+ }`;e.fragment.code.add(t),e.vertex.code.add(t)}var n,a,s=r(35065);function l(e,t){t.normalType===n.Attribute&&(e.attributes.add(s.T.NORMAL,"vec3"),e.vertex.code.add(i.H`vec3 normalModel() {
281
+ return normal;
282
+ }`)),t.normalType===n.CompressedAttribute&&(e.include(o),e.attributes.add(s.T.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(i.H`vec3 normalModel() {
283
+ return decodeNormal(normalCompressed);
284
+ }`)),t.normalType===n.ScreenDerivative&&(e.extensions.add("GL_OES_standard_derivatives"),e.fragment.code.add(i.H`vec3 screenDerivativeNormal(vec3 positionView) {
285
+ return normalize(cross(dFdx(positionView), dFdy(positionView)));
286
+ }`))}(a=n||(n={}))[a.Attribute=0]="Attribute",a[a.CompressedAttribute=1]="CompressedAttribute",a[a.Ground=2]="Ground",a[a.ScreenDerivative=3]="ScreenDerivative",a[a.COUNT=4]="COUNT"},37099:(e,t,r)=>{r.d(t,{f:()=>n});var i=r(74709),o=r(35065);function n(e){e.attributes.add(o.T.POSITION,"vec3"),e.vertex.code.add(i.H`vec3 positionModel() { return position; }`)}},76056:(e,t,r)=>{r.d(t,{R:()=>c});var i=r(6206),o=r(74709);function n(e){e.vertex.code.add(o.H`
287
+ vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
288
+ float symbolAlpha = 0.0;
289
+
290
+ const float maxTint = 85.0;
291
+ const float maxReplace = 170.0;
292
+ const float scaleAlpha = 3.0;
293
+
294
+ if (symbolColor.a > maxReplace) {
295
+ colorMixMode = ${o.H.int(i.a9.Multiply)};
296
+ symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
297
+ } else if (symbolColor.a > maxTint) {
298
+ colorMixMode = ${o.H.int(i.a9.Replace)};
299
+ symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
300
+ } else if (symbolColor.a > 0.0) {
301
+ colorMixMode = ${o.H.int(i.a9.Tint)};
302
+ symbolAlpha = scaleAlpha * symbolColor.a;
303
+ } else {
304
+ colorMixMode = ${o.H.int(i.a9.Multiply)};
305
+ symbolAlpha = 0.0;
306
+ }
307
+
308
+ return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
309
+ }
310
+ `)}var a=r(15736),s=r(35065),l=r(37782);function c(e,t){t.hasSymbolColors?(e.include(n),e.attributes.add(s.T.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(o.H`int symbolColorMixMode;
311
+ vec4 getSymbolColor() {
312
+ return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
313
+ }
314
+ void forwardColorMixMode() {
315
+ colorMixMode = float(symbolColorMixMode) + 0.5;
316
+ }`)):(e.fragment.uniforms.add(new a._("colorMixMode",(e=>l.FZ[e.colorMixMode]))),e.vertex.code.add(o.H`vec4 getSymbolColor() { return vec4(1.0); }
317
+ void forwardColorMixMode() {}`))}},135:(e,t,r)=>{r.d(t,{D:()=>l,N:()=>i});var i,o,n=r(74085),a=r(74709),s=r(35065);function l(e,t){switch(t.textureCoordinateType){case i.Default:return e.attributes.add(s.T.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() {
318
+ vuv0 = uv0;
319
+ }`);case i.Atlas:return e.attributes.add(s.T.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(s.T.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() {
320
+ vuv0 = uv0;
321
+ vuvRegion = uvRegion;
322
+ }`);default:(0,n.Bg)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(o=i||(i={}))[o.None=0]="None",o[o.Default=1]="Default",o[o.Atlas=2]="Atlas",o[o.COUNT=3]="COUNT"},11317:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(74709),o=r(35065);function n(e,t){t.hasVertexColors?(e.attributes.add(o.T.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
323
+ void forwardNormalizedVertexColor() {}`)}},15719:(e,t,r)=>{r.d(t,{Bb:()=>c,d4:()=>d});var i=r(46521),o=(r(88669),r(64267)),n=r(2095),a=r(74709),s=r(52114),l=r(19850);function c(e,t){t.normalType===o.h.Attribute||t.normalType===o.h.CompressedAttribute?(e.include(o.O,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add([new s.j("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new l.c("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))]),e.vertex.code.add(a.H`void forwardNormal() {
324
+ vNormalWorld = transformNormalGlobalFromModel * normalModel();
325
+ vNormalView = transformNormalViewFromGlobal * vNormalWorld;
326
+ }`)):t.normalType===o.h.Ground?(e.include(n.up,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(a.H`
327
+ void forwardNormal() {
328
+ vNormalWorld = ${t.spherical?a.H`normalize(vPositionWorldCameraRelative);`:a.H`vec3(0.0, 0.0, 1.0);`}
329
+ }
330
+ `)):e.vertex.code.add(a.H`void forwardNormal() {}`)}class d extends n.su{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.c)()}}},2095:(e,t,r)=>{r.d(t,{su:()=>p,up:()=>m});var i=r(46521),o=r(13598),n=(r(72119),r(65617)),a=r(37099),s=r(89243),l=r(70582),c=r(172),d=r(74709),u=r(52114),h=r(19850),f=r(8319);function m(e,t){e.include(a.f);const r=e.vertex;r.include(s.$,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add([new c.J("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.c("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new f.g("transformProjFromView",(e=>e.transformProjFromView)),new u.j("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new l.B("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new l.B("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))]),r.code.add(d.H`vec3 positionWorldCameraRelative() {
331
+ vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
332
+ vec3 transform_CameraRelativeFromModel = dpAdd(
333
+ transformWorldFromModelTL,
334
+ transformWorldFromModelTH,
335
+ -transformWorldFromViewTL,
336
+ -transformWorldFromViewTH
337
+ );
338
+ return transform_CameraRelativeFromModel + rotatedModelPosition;
339
+ }`),r.code.add(d.H`
340
+ void forwardPosition(float fOffset) {
341
+ vPositionWorldCameraRelative = positionWorldCameraRelative();
342
+ if (fOffset != 0.0) {
343
+ vPositionWorldCameraRelative += fOffset * ${t.spherical?d.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:d.H`vec3(0.0, 0.0, 1.0)`};
344
+ }
345
+
346
+ vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
347
+ gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
348
+ }
349
+ `),e.fragment.uniforms.add(new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL))),r.code.add(d.H`vec3 positionWorld() {
350
+ return transformWorldFromViewTL + vPositionWorldCameraRelative;
351
+ }`),e.fragment.code.add(d.H`vec3 positionWorld() {
352
+ return transformWorldFromViewTL + vPositionWorldCameraRelative;
353
+ }`)}class p extends d.K{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.c)(),this.transformWorldFromViewTL=(0,n.c)(),this.transformViewFromCameraRelativeRS=(0,i.c)(),this.transformProjFromView=(0,o.c)()}}},91982:(e,t,r)=>{r.d(t,{i:()=>s});var i=r(74085),o=r(135),n=r(74709);function a(e){e.extensions.add("GL_EXT_shader_texture_lod"),e.extensions.add("GL_OES_standard_derivatives"),e.fragment.code.add(n.H`#ifndef GL_EXT_shader_texture_lod
354
+ float calcMipMapLevel(const vec2 ddx, const vec2 ddy) {
355
+ float deltaMaxSqr = max(dot(ddx, ddx), dot(ddy, ddy));
356
+ return max(0.0, 0.5 * log2(deltaMaxSqr));
357
+ }
358
+ #endif
359
+ vec4 textureAtlasLookup(sampler2D texture, vec2 textureSize, vec2 textureCoordinates, vec4 atlasRegion) {
360
+ vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
361
+ vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
362
+ float maxdUV = 0.125;
363
+ vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
364
+ vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
365
+ #ifdef GL_EXT_shader_texture_lod
366
+ return texture2DGradEXT(texture, uvAtlas, dUVdx, dUVdy);
367
+ #else
368
+ vec2 dUVdxAuto = dFdx(uvAtlas);
369
+ vec2 dUVdyAuto = dFdy(uvAtlas);
370
+ float mipMapLevel = calcMipMapLevel(dUVdx * textureSize, dUVdy * textureSize);
371
+ float autoMipMapLevel = calcMipMapLevel(dUVdxAuto * textureSize, dUVdyAuto * textureSize);
372
+ return texture2D(texture, uvAtlas, mipMapLevel - autoMipMapLevel);
373
+ #endif
374
+ }`)}function s(e,t){switch(e.include(o.D,t),e.fragment.code.add(n.H`
375
+ struct TextureLookupParameter {
376
+ vec2 uv;
377
+ ${t.supportsTextureAtlas?"vec2 size;":""}
378
+ } vtc;
379
+ `),t.textureCoordinateType){case o.N.Default:return void e.fragment.code.add(n.H`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
380
+ return texture2D(texture, params.uv);
381
+ }`);case o.N.Atlas:return e.include(a),void e.fragment.code.add(n.H`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
382
+ return textureAtlasLookup(texture, params.size, params.uv, vuvRegion);
383
+ }`);default:(0,i.Bg)(t.textureCoordinateType);case o.N.None:case o.N.COUNT:return}}},92555:(e,t,r)=>{r.d(t,{L:()=>d});var i=r(98766),o=r(88669),n=r(71250),a=r(74709);function s(e){e.vertex.code.add(a.H`float screenSizePerspectiveMinSize(float size, vec4 factor) {
384
+ float nonZeroSize = 1.0 - step(size, 0.0);
385
+ return (
386
+ factor.z * (
387
+ 1.0 +
388
+ nonZeroSize *
389
+ 2.0 * factor.w / (
390
+ size + (1.0 - nonZeroSize)
391
+ )
392
+ )
393
+ );
394
+ }`),e.vertex.code.add(a.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
395
+ return absCosAngle * absCosAngle * absCosAngle;
396
+ }`),e.vertex.code.add(a.H`vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {
397
+ return vec4(
398
+ min(params.x / (distanceToCamera - params.y), 1.0),
399
+ screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
400
+ params.z,
401
+ params.w
402
+ );
403
+ }`),e.vertex.code.add(a.H`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {
404
+ return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));
405
+ }`),e.vertex.code.add(a.H`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {
406
+ return applyScreenSizePerspectiveScaleFactorFloat(
407
+ size,
408
+ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
409
+ );
410
+ }`),e.vertex.code.add(a.H`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {
411
+ return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / max(1e-5, size.y), 1.0), size, factor.y);
412
+ }`),e.vertex.code.add(a.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {
413
+ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
414
+ }`)}const l=(0,o.c)();var c=r(93669);function d(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new n.N("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:o,screenLength:n}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.s)(u,n*s,a,r,o)})))}(r),t.hasScreenSizePerspective&&(e.include(s),function(e){e.uniforms.add(new n.N("screenSizePerspectiveAlignment",(e=>function(e){return(0,i.s)(l,e.parameters.divisor,e.parameters.offset,e.parameters.minPixelSize,e.paddingPixelsOverride)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective))))}(r),(0,c.h)(e.vertex,t)),r.code.add(a.H`
415
+ vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
416
+ float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
417
+ ${t.spherical?a.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:a.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
418
+ ${t.hasScreenSizePerspective?a.H`
419
+ float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
420
+ float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:a.H`
421
+ float verticalOffsetScreenHeight = verticalOffset.x;`}
422
+ // Screen sized offset in world space, used for example for line callouts
423
+ float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
424
+ return worldNormal * worldOffset;
425
+ }
426
+
427
+ vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
428
+ return worldPos + calculateVerticalOffset(worldPos, localOrigin);
429
+ }
430
+ `)):r.code.add(a.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,o.c)()},89136:(e,t,r)=>{r.d(t,{s:()=>w});var i=r(70586),o=r(13598),n=r(55039),a=r(51546),s=r(77171),l=r(64267),c=r(74709),d=r(35065);function u(e,t){const r=t.output===n.H.ObjectAndLayerIdColor,i=t.objectAndLayerIdColorInstanced;r&&(e.varyings.add("objectAndLayerIdColorVarying","vec4"),i?e.attributes.add(d.T.OBJECTANDLAYERIDCOLOR_INSTANCED,"vec4"):e.attributes.add(d.T.OBJECTANDLAYERIDCOLOR,"vec4")),e.vertex.code.add(c.H`
431
+ void forwardObjectAndLayerIdColor() {
432
+ ${r?i?c.H`objectAndLayerIdColorVarying = objectAndLayerIdColor_instanced * 0.003921568627451;`:c.H`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:c.H``} }`),e.fragment.code.add(c.H`
433
+ void outputObjectAndLayerIdColor() {
434
+ ${r?c.H`gl_FragColor = objectAndLayerIdColorVarying;`:c.H``} }`)}var h=r(135),f=r(15719),m=r(20285);function p(e,t){switch(e.fragment.include(m.n),t.output){case n.H.Shadow:case n.H.ShadowHighlight:case n.H.ShadowExludeHighlight:e.extensions.add("GL_OES_standard_derivatives"),e.fragment.code.add(c.H`float _calculateFragDepth(const in float depth) {
435
+ const float SLOPE_SCALE = 2.0;
436
+ const float BIAS = 2.0 * .000015259;
437
+ float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
438
+ float result = depth + SLOPE_SCALE * m + BIAS;
439
+ return clamp(result, .0, .999999);
440
+ }
441
+ void outputDepth(float _linearDepth) {
442
+ gl_FragColor = float2rgba(_calculateFragDepth(_linearDepth));
443
+ }`);break;case n.H.Depth:e.fragment.code.add(c.H`void outputDepth(float _linearDepth) {
444
+ gl_FragColor = float2rgba(_linearDepth);
445
+ }`)}}r(97323);var g=r(88669),_=r(19693),v=r(98069);const x=(0,g.f)(1,1,0,1),T=(0,g.f)(1,0,1,1);function b(e){e.fragment.uniforms.add(new v.A("depthTex",((e,t)=>t.highlightDepthTexture))),e.fragment.uniforms.add(new _.A("highlightViewportPixelSz",((e,t)=>t.inverseViewport))),e.fragment.constants.add("occludedHighlightFlag","vec4",x).add("unoccludedHighlightFlag","vec4",T),e.fragment.code.add(c.H`void outputHighlight() {
446
+ vec4 fragCoord = gl_FragCoord;
447
+ float sceneDepth = texture2D(depthTex, fragCoord.xy * highlightViewportPixelSz.xy).r;
448
+ if (fragCoord.z > sceneDepth + 5e-7) {
449
+ gl_FragColor = occludedHighlightFlag;
450
+ }
451
+ else {
452
+ gl_FragColor = unoccludedHighlightFlag;
453
+ }
454
+ }`)}var A=r(82550),E=r(85787),S=r(93669),M=r(8319);function w(e,t){const r=e.vertex.code,d=e.fragment.code,m=t.hasModelTransformation;switch(m&&e.vertex.uniforms.add(new M.g("model",(e=>(0,i.pC)(e.modelTransformation)?e.modelTransformation:o.I))),t.output){case n.H.Depth:case n.H.Shadow:case n.H.ShadowHighlight:case n.H.ShadowExludeHighlight:case n.H.ObjectAndLayerIdColor:(0,S.S)(e,t),e.include(s.w,t),e.include(h.D,t),e.include(A.k,t),e.include(p,t),e.include(a.f5,t),e.include(u,t),e.vertex.uniforms.add(new _.A("nearFar",((e,t)=>t.camera.nearFar))),e.varyings.add("depth","float"),t.hasColorTexture&&e.fragment.uniforms.add(new v.A("tex",(e=>e.texture))),r.add(c.H`
455
+ void main(void) {
456
+ vpos = calculateVPos();
457
+ vpos = subtractOrigin(vpos);
458
+ vpos = addVerticalOffset(vpos, localOrigin);
459
+ gl_Position = transformPositionWithDepth(proj, view, ${m?"model,":""} vpos, nearFar, depth);
460
+ forwardTextureCoordinates();
461
+ forwardObjectAndLayerIdColor();
462
+ }
463
+ `),e.include(E.z,t),d.add(c.H`
464
+ void main(void) {
465
+ discardBySlice(vpos);
466
+ ${t.hasColorTexture?c.H`
467
+ vec4 texColor = texture2D(tex, vuv0);
468
+ discardOrAdjustAlpha(texColor);`:""}
469
+ ${t.output===n.H.ObjectAndLayerIdColor?c.H`outputObjectAndLayerIdColor();`:c.H`outputDepth(depth);`}
470
+ }
471
+ `);break;case n.H.Normal:(0,S.S)(e,t),e.include(s.w,t),e.include(l.O,t),e.include(f.Bb,t),e.include(h.D,t),e.include(A.k,t),t.hasColorTexture&&e.fragment.uniforms.add(new v.A("tex",(e=>e.texture))),e.varyings.add("vPositionView","vec3"),r.add(c.H`
472
+ void main(void) {
473
+ vpos = calculateVPos();
474
+ vpos = subtractOrigin(vpos);
475
+ ${t.normalType===l.h.Attribute?c.H`
476
+ vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:""}
477
+ vpos = addVerticalOffset(vpos, localOrigin);
478
+ gl_Position = transformPosition(proj, view, ${m?"model,":""} vpos);
479
+ forwardTextureCoordinates();
480
+ }
481
+ `),e.include(a.f5,t),e.include(E.z,t),d.add(c.H`
482
+ void main() {
483
+ discardBySlice(vpos);
484
+ ${t.hasColorTexture?c.H`
485
+ vec4 texColor = texture2D(tex, vuv0);
486
+ discardOrAdjustAlpha(texColor);`:""}
487
+
488
+ ${t.normalType===l.h.ScreenDerivative?c.H`
489
+ vec3 normal = screenDerivativeNormal(vPositionView);`:c.H`
490
+ vec3 normal = normalize(vNormalWorld);
491
+ if (gl_FrontFacing == false) normal = -normal;`}
492
+ gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
493
+ }
494
+ `);break;case n.H.Highlight:(0,S.S)(e,t),e.include(s.w,t),e.include(h.D,t),e.include(A.k,t),t.hasColorTexture&&e.fragment.uniforms.add(new v.A("tex",(e=>e.texture))),r.add(c.H`
495
+ void main(void) {
496
+ vpos = calculateVPos();
497
+ vpos = subtractOrigin(vpos);
498
+ vpos = addVerticalOffset(vpos, localOrigin);
499
+ gl_Position = transformPosition(proj, view, ${m?"model,":""} vpos);
500
+ forwardTextureCoordinates();
501
+ }
502
+ `),e.include(a.f5,t),e.include(E.z,t),e.include(b),d.add(c.H`
503
+ void main() {
504
+ discardBySlice(vpos);
505
+ ${t.hasColorTexture?c.H`
506
+ vec4 texColor = texture2D(tex, vuv0);
507
+ discardOrAdjustAlpha(texColor);`:""}
508
+ outputHighlight();
509
+ }
510
+ `)}}},15817:(e,t,r)=>{r.d(t,{Q:()=>h});var i=r(135),o=r(91982),n=r(19419),a=r(74709),s=r(46826),l=r(98069),c=r(4511),d=r(67498),u=r(35065);function h(e,t){const r=e.fragment;if(t.hasVertexTangents?(e.attributes.add(u.T.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===n.q.WindingOrder?r.code.add(a.H`mat3 computeTangentSpace(vec3 normal) {
511
+ float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
512
+ vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
513
+ vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
514
+ return mat3(tangent, bitangent, normal);
515
+ }`):r.code.add(a.H`mat3 computeTangentSpace(vec3 normal) {
516
+ float tangentHeadedness = vTangent.w;
517
+ vec3 tangent = normalize(vTangent.xyz);
518
+ vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
519
+ return mat3(tangent, bitangent, normal);
520
+ }`)):(e.extensions.add("GL_OES_standard_derivatives"),r.code.add(a.H`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
521
+ vec3 Q1 = dFdx(pos);
522
+ vec3 Q2 = dFdy(pos);
523
+ vec2 stx = dFdx(st);
524
+ vec2 sty = dFdy(st);
525
+ float det = stx.t * sty.s - sty.t * stx.s;
526
+ vec3 T = stx.t * Q2 - sty.t * Q1;
527
+ T = T - normal * dot(normal, T);
528
+ T *= inversesqrt(max(dot(T,T), 1.e-10));
529
+ vec3 B = sign(det) * cross(normal, T);
530
+ return mat3(T, B, normal);
531
+ }`)),t.textureCoordinateType!==i.N.None){e.include(o.i,t);const i=t.supportsTextureAtlas?c.D.Size:c.D.None;r.uniforms.add(t.pbrTextureBindType===d.P.Pass?(0,l.J)("normalTexture",(e=>e.textureNormal),i):(0,s.F)("normalTexture",(e=>e.textureNormal),i)),r.code.add(a.H`
532
+ vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
533
+ vtc.uv = uv;
534
+ ${t.supportsTextureAtlas?"vtc.size = normalTextureSize;":""}
535
+ vec3 rawNormal = textureLookup(normalTexture, vtc).rgb * 2.0 - 1.0;
536
+ return tangentSpace * rawNormal;
537
+ }
538
+ `)}}},66242:(e,t,r)=>{r.d(t,{K:()=>l});var i=r(98766),o=r(88669),n=r(71250),a=r(74709),s=r(98069);function l(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add([new s.A("ssaoTex",((e,t)=>t.ssaoHelper.colorTexture)),new n.N("viewportPixelSz",((e,t)=>(0,i.s)(c,t.camera.fullViewport[0],t.camera.fullViewport[1],1/t.ssaoHelper.width,1/t.ssaoHelper.height)))]),r.code.add(a.H`float evaluateAmbientOcclusion() {
539
+ return 1.0 - texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;
540
+ }
541
+ float evaluateAmbientOcclusionInverse() {
542
+ return texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;
543
+ }`)):r.code.add(a.H`float evaluateAmbientOcclusion() { return 0.0; }
544
+ float evaluateAmbientOcclusionInverse() { return 1.0; }`)}const c=(0,o.c)()},14482:(e,t,r)=>{r.d(t,{X:()=>E});var i=r(17896),o=r(65617),n=r(98766),a=r(88669),s=r(85504),l=r(172),c=r(71250),d=r(74709);function u(e,t){const r=e.fragment,o=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===o?(r.uniforms.add(new l.J("lightingAmbientSH0",((e,t)=>(0,i.s)(h,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
545
+ vec3 ambientLight = 0.282095 * lightingAmbientSH0;
546
+ return ambientLight * (1.0 - ambientOcclusion);
547
+ }`)):1===o?(r.uniforms.add([new c.N("lightingAmbientSH_R",((e,t)=>(0,n.s)(f,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new c.N("lightingAmbientSH_G",((e,t)=>(0,n.s)(f,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new c.N("lightingAmbientSH_B",((e,t)=>(0,n.s)(f,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))]),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
548
+ vec4 sh0 = vec4(
549
+ 0.282095,
550
+ 0.488603 * normal.x,
551
+ 0.488603 * normal.z,
552
+ 0.488603 * normal.y
553
+ );
554
+ vec3 ambientLight = vec3(
555
+ dot(lightingAmbientSH_R, sh0),
556
+ dot(lightingAmbientSH_G, sh0),
557
+ dot(lightingAmbientSH_B, sh0)
558
+ );
559
+ return ambientLight * (1.0 - ambientOcclusion);
560
+ }`)):2===o&&(r.uniforms.add([new l.J("lightingAmbientSH0",((e,t)=>(0,i.s)(h,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0]))),new c.N("lightingAmbientSH_R1",((e,t)=>(0,n.s)(f,t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3],t.lighting.sh.r[4]))),new c.N("lightingAmbientSH_G1",((e,t)=>(0,n.s)(f,t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3],t.lighting.sh.g[4]))),new c.N("lightingAmbientSH_B1",((e,t)=>(0,n.s)(f,t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3],t.lighting.sh.b[4]))),new c.N("lightingAmbientSH_R2",((e,t)=>(0,n.s)(f,t.lighting.sh.r[5],t.lighting.sh.r[6],t.lighting.sh.r[7],t.lighting.sh.r[8]))),new c.N("lightingAmbientSH_G2",((e,t)=>(0,n.s)(f,t.lighting.sh.g[5],t.lighting.sh.g[6],t.lighting.sh.g[7],t.lighting.sh.g[8]))),new c.N("lightingAmbientSH_B2",((e,t)=>(0,n.s)(f,t.lighting.sh.b[5],t.lighting.sh.b[6],t.lighting.sh.b[7],t.lighting.sh.b[8])))]),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
561
+ vec3 ambientLight = 0.282095 * lightingAmbientSH0;
562
+ vec4 sh1 = vec4(
563
+ 0.488603 * normal.x,
564
+ 0.488603 * normal.z,
565
+ 0.488603 * normal.y,
566
+ 1.092548 * normal.x * normal.y
567
+ );
568
+ vec4 sh2 = vec4(
569
+ 1.092548 * normal.y * normal.z,
570
+ 0.315392 * (3.0 * normal.z * normal.z - 1.0),
571
+ 1.092548 * normal.x * normal.z,
572
+ 0.546274 * (normal.x * normal.x - normal.y * normal.y)
573
+ );
574
+ ambientLight += vec3(
575
+ dot(lightingAmbientSH_R1, sh1),
576
+ dot(lightingAmbientSH_G1, sh1),
577
+ dot(lightingAmbientSH_B1, sh1)
578
+ );
579
+ ambientLight += vec3(
580
+ dot(lightingAmbientSH_R2, sh2),
581
+ dot(lightingAmbientSH_G2, sh2),
582
+ dot(lightingAmbientSH_B2, sh2)
583
+ );
584
+ return ambientLight * (1.0 - ambientOcclusion);
585
+ }`),t.pbrMode!==s.f7.Normal&&t.pbrMode!==s.f7.Schematic||r.code.add(d.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
586
+ vec3 calculateAmbientRadiance(float ambientOcclusion)
587
+ {
588
+ vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
589
+ return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
590
+ }`))}const h=(0,o.c)(),f=(0,a.c)();var m=r(66242),p=r(21437);function g(e,t){const r=e.fragment;t.isGround?r.uniforms.add(new p.p("lightingFixedFactor",((e,t)=>(1-t.lighting.groundLightingFactor)*(1-t.lighting.globalFactor)))):r.constants.add("lightingFixedFactor","float",0),r.uniforms.add([new l.J("lightingMainDirection",((e,t)=>t.lighting.lightingMainDirection)),new l.J("lightingMainIntensity",((e,t)=>t.lighting.mainLight.intensity))]),r.code.add(d.H`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
591
+ float dotVal = clamp(dot(normal_global, lightingMainDirection), 0.0, 1.0);
592
+ dotVal = mix(dotVal, 1.0, lightingFixedFactor);
593
+ return lightingMainIntensity * ((1.0 - shadowing) * dotVal);
594
+ }`)}var _=r(26322),v=r(27754),x=r(79884),T=r(67498);class b extends x.x{constructor(e,t){super(e,"bool",T.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var A=r(9749);function E(e,t){const r=e.fragment;e.include(m.K,t),t.pbrMode!==s.f7.Disabled&&e.include(_.T,t),e.include(u,t),r.constants.add("ambientBoostFactor","float",A.V),e.include(v.e),r.code.add(d.H`
595
+ const float GAMMA_SRGB = 2.1;
596
+ const float INV_GAMMA_SRGB = 0.4761904;
597
+ ${t.pbrMode===s.f7.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
598
+ `),r.uniforms.add(new l.J("lightingMainDirection",((e,t)=>t.lighting.lightingMainDirection))),r.code.add(d.H`
599
+ float additionalDirectedAmbientLight(vec3 vPosWorld) {
600
+ float vndl = dot(${t.spherical?d.H`normalize(vPosWorld)`:d.H`vec3(0.0, 0.0, 1.0)`}, lightingMainDirection);
601
+ return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
602
+ }
603
+ `),r.uniforms.add([new p.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)),new l.J("lightingMainIntensity",((e,t)=>t.lighting.mainLight.intensity))]),r.code.add(d.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
604
+ float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
605
+ return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * lightingMainIntensity;
606
+ }`),t.pbrMode===s.f7.Disabled||t.pbrMode===s.f7.WaterOnIntegratedMesh?(e.include(g,t),r.code.add(d.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
607
+ {
608
+ vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
609
+ vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
610
+ vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
611
+ vec3 totalLight = mainLighting + ambientLighting + additionalLight;
612
+ totalLight = min(totalLight, vec3(PI));
613
+ vec3 outColor = vec3((albedoLinear / PI) * totalLight);
614
+ return pow(outColor, vec3(INV_GAMMA_SRGB));
615
+ }`)):t.pbrMode!==s.f7.Normal&&t.pbrMode!==s.f7.Schematic||(r.code.add(d.H`const float fillLightIntensity = 0.25;
616
+ const float horizonLightDiffusion = 0.4;
617
+ const float additionalAmbientIrradianceFactor = 0.02;
618
+ vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
619
+ {
620
+ vec3 viewDirection = -viewDir;
621
+ vec3 mainLightDirection = lightingMainDirection;
622
+ vec3 h = normalize(viewDirection + mainLightDirection);
623
+ PBRShadingInfo inputs;
624
+ inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
625
+ inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
626
+ inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
627
+ inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
628
+ inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
629
+ vec3 reflectedView = normalize(reflect(viewDirection, normal));
630
+ inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
631
+ inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
632
+ inputs.ssao = ssao;
633
+ inputs.metalness = mrr[0];
634
+ 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;
635
+ inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
636
+ inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new b("hasFillLights",((e,t)=>t.enableFillLights))):r.constants.add("hasFillLights","bool",!1),r.code.add(d.H`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
637
+ ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
638
+ inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
639
+ vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * lightingMainIntensity;
640
+ vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * lightingMainIntensity * fillLightIntensity;
641
+ vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
642
+ inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
643
+ inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add([new p.p("lightingSpecularStrength",((e,t)=>t.lighting.mainLight.specularStrength)),new p.p("lightingEnvironmentStrength",((e,t)=>t.lighting.mainLight.environmentStrength))]),r.code.add(d.H`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
644
+ vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
645
+ inputs.NdotH_Horizon = dot(normal, horizonRingH);
646
+ vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * lightingMainIntensity * (1.0 - shadow);
647
+ vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * lightingMainIntensity * fillLightIntensity;
648
+ vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
649
+ inputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent;
650
+ inputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent;
651
+ inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(d.H`
652
+ vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
653
+ vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
654
+ vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
655
+ vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
656
+ ${t.pbrMode===s.f7.Schematic?d.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:d.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}
657
+ return outColor;
658
+ }
659
+ `))}},83603:(e,t,r)=>{r.d(t,{l:()=>l});var i=r(20285),o=r(74709);function n(e){e.include(i.n),e.code.add(o.H`float linearDepthFromFloat(float depth, vec2 nearFar) {
660
+ return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);
661
+ }
662
+ float linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {
663
+ return linearDepthFromFloat(rgba2float(texture2D(depthTex, uv)), nearFar);
664
+ }`)}var a=r(19693),s=r(98069);function l(e,t){t.hasMultipassTerrain&&(e.fragment.include(n),e.fragment.uniforms.add(new s.A("terrainDepthTexture",((e,t)=>t.multipassTerrain.linearDepthTexture))),e.fragment.uniforms.add(new a.A("nearFar",((e,t)=>t.camera.nearFar))),e.fragment.uniforms.add(new a.A("inverseViewport",((e,t)=>t.inverseViewport))),e.fragment.code.add(o.H`
665
+ void terrainDepthTest(vec4 fragCoord, float fragmentDepth){
666
+ float terrainDepth = linearDepthFromTexture(terrainDepthTexture, fragCoord.xy * inverseViewport, nearFar);
667
+ if(fragmentDepth ${t.cullAboveGround?">":"<="} terrainDepth){
668
+ discard;
669
+ }
670
+ }
671
+ `))}},19419:(e,t,r)=>{r.d(t,{k:()=>s,q:()=>i});var i,o,n=r(74085),a=r(74709);function s(e,t){const r=e.fragment;switch(r.code.add(a.H`struct ShadingNormalParameters {
672
+ vec3 normalView;
673
+ vec3 viewDirection;
674
+ } shadingParams;`),t.doubleSidedMode){case i.None:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
675
+ return normalize(params.normalView);
676
+ }`);break;case i.View:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
677
+ return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
678
+ }`);break;case i.WindingOrder:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
679
+ return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
680
+ }`);break;default:(0,n.Bg)(t.doubleSidedMode);case i.COUNT:}}(o=i||(i={}))[o.None=0]="None",o[o.View=1]="View",o[o.WindingOrder=2]="WindingOrder",o[o.COUNT=3]="COUNT"},26322:(e,t,r)=>{r.d(t,{T:()=>s});var i=r(74709);function o(e){const t=e.fragment.code;t.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
681
+ {
682
+ return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
683
+ }`),t.add(i.H`float integratedRadiance(float cosTheta2, float roughness)
684
+ {
685
+ return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
686
+ }`),t.add(i.H`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
687
+ {
688
+ float cosTheta2 = 1.0 - RdotNG * RdotNG;
689
+ float intRadTheta = integratedRadiance(cosTheta2, roughness);
690
+ float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
691
+ float sky = 2.0 - ground;
692
+ return (ground * ambientGround + sky * ambientSky) * 0.5;
693
+ }`)}var n=r(85504),a=r(27754);function s(e,t){const r=e.fragment.code;e.include(a.e),t.pbrMode===n.f7.Water||t.pbrMode===n.f7.WaterOnIntegratedMesh?(r.add(i.H`
694
+ struct PBRShadingWater
695
+ {
696
+ float NdotL; // cos angle between normal and light direction
697
+ float NdotV; // cos angle between normal and view direction
698
+ float NdotH; // cos angle between normal and half vector
699
+ float VdotH; // cos angle between view direction and half vector
700
+ float LdotH; // cos angle between light direction and half vector
701
+ float VdotN; // cos angle between view direction and normal vector
702
+ };
703
+
704
+ float dtrExponent = ${t.useCustomDTRExponentForWater?"2.2":"2.0"};
705
+ `),r.add(i.H`vec3 fresnelReflection(float angle, vec3 f0, float f90) {
706
+ return f0 + (f90 - f0) * pow(1.0 - angle, 5.0);
707
+ }`),r.add(i.H`float normalDistributionWater(float NdotH, float roughness)
708
+ {
709
+ float r2 = roughness * roughness;
710
+ float NdotH2 = NdotH * NdotH;
711
+ float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI;
712
+ return r2 / denom;
713
+ }`),r.add(i.H`float geometricOcclusionKelemen(float LoH)
714
+ {
715
+ return 0.25 / (LoH * LoH);
716
+ }`),r.add(i.H`vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max)
717
+ {
718
+ vec3 F = fresnelReflection(props.VdotH, F0, F0Max);
719
+ float dSun = normalDistributionWater(props.NdotH, roughness);
720
+ float V = geometricOcclusionKelemen(props.LdotH);
721
+ float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH);
722
+ float strengthSunHaze = 1.2;
723
+ float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze;
724
+ return ((dSun + dSunHaze) * V) * F;
725
+ }
726
+ vec3 tonemapACES(const vec3 x) {
727
+ return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
728
+ }`)):t.pbrMode!==n.f7.Normal&&t.pbrMode!==n.f7.Schematic||(e.include(o),r.add(i.H`struct PBRShadingInfo
729
+ {
730
+ float NdotL;
731
+ float NdotV;
732
+ float NdotH;
733
+ float VdotH;
734
+ float LdotH;
735
+ float NdotNG;
736
+ float RdotNG;
737
+ float NdotAmbDir;
738
+ float NdotH_Horizon;
739
+ vec3 skyRadianceToSurface;
740
+ vec3 groundRadianceToSurface;
741
+ vec3 skyIrradianceToSurface;
742
+ vec3 groundIrradianceToSurface;
743
+ float averageAmbientRadiance;
744
+ float ssao;
745
+ vec3 albedoLinear;
746
+ vec3 f0;
747
+ vec3 f90;
748
+ vec3 diffuseColor;
749
+ float metalness;
750
+ float roughness;
751
+ };`),r.add(i.H`float normalDistribution(float NdotH, float roughness)
752
+ {
753
+ float a = NdotH * roughness;
754
+ float b = roughness / (1.0 - NdotH * NdotH + a * a);
755
+ return b * b * INV_PI;
756
+ }`),r.add(i.H`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
757
+ const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
758
+ const vec2 c2 = vec2(-1.04, 1.04);
759
+ vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
760
+ vec4 r = roughness * c0 + c1;
761
+ float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
762
+ return c2 * a004 + r.zw;
763
+ }`),r.add(i.H`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
764
+ vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
765
+ vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
766
+ vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
767
+ vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
768
+ vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
769
+ vec3 specularComponent = specularColor * indirectSpecular;
770
+ return (diffuseComponent + specularComponent);
771
+ }`),r.add(i.H`float gamutMapChanel(float x, vec2 p){
772
+ return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
773
+ }`),r.add(i.H`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
774
+ vec3 outColor;
775
+ vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
776
+ outColor.x = gamutMapChanel(inColor.x, p) ;
777
+ outColor.y = gamutMapChanel(inColor.y, p) ;
778
+ outColor.z = gamutMapChanel(inColor.z, p) ;
779
+ return outColor;
780
+ }`))}},85504:(e,t,r)=>{r.d(t,{f7:()=>i,jV:()=>m});var i,o,n=r(72119),a=r(91982),s=r(70582),l=r(172),c=r(74709),d=r(46826),u=r(98069),h=r(4511),f=r(67498);function m(e,t){const r=e.fragment,o=t.hasMetalnessAndRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture;if(t.pbrMode===i.Normal&&o&&e.include(a.i,t),t.pbrMode!==i.Schematic)if(t.pbrMode!==i.Disabled){if(t.pbrMode===i.Normal){r.code.add(c.H`vec3 mrr;
781
+ vec3 emission;
782
+ float occlusion;`);const e=t.supportsTextureAtlas?h.D.Size:h.D.None,i=t.pbrTextureBindType;t.hasMetalnessAndRoughnessTexture&&(r.uniforms.add(i===f.P.Pass?(0,u.J)("texMetallicRoughness",(e=>e.textureMetallicRoughness),e):(0,d.F)("texMetallicRoughness",(e=>e.textureMetallicRoughness),e)),r.code.add(c.H`void applyMetallnessAndRoughness(TextureLookupParameter params) {
783
+ vec3 metallicRoughness = textureLookup(texMetallicRoughness, params).rgb;
784
+ mrr[0] *= metallicRoughness.b;
785
+ mrr[1] *= metallicRoughness.g;
786
+ }`)),t.hasEmissionTexture&&(r.uniforms.add(i===f.P.Pass?(0,u.J)("texEmission",(e=>e.textureEmissive),e):(0,d.F)("texEmission",(e=>e.textureEmissive),e)),r.code.add(c.H`void applyEmission(TextureLookupParameter params) {
787
+ emission *= textureLookup(texEmission, params).rgb;
788
+ }`)),t.hasOcclusionTexture?(r.uniforms.add(i===f.P.Pass?(0,u.J)("texOcclusion",(e=>e.textureOcclusion),e):(0,d.F)("texOcclusion",(e=>e.textureOcclusion),e)),r.code.add(c.H`void applyOcclusion(TextureLookupParameter params) {
789
+ occlusion *= textureLookup(texOcclusion, params).r;
790
+ }
791
+ float getBakedOcclusion() {
792
+ return occlusion;
793
+ }`)):r.code.add(c.H`float getBakedOcclusion() { return 1.0; }`),r.uniforms.add(i===f.P.Pass?[new l.J("emissionFactor",(e=>e.emissiveFactor)),new l.J("mrrFactors",(e=>e.mrrFactors))]:[new s.B("emissionFactor",(e=>e.emissiveFactor)),new s.B("mrrFactors",(e=>e.mrrFactors))]),r.code.add(c.H`
794
+ void applyPBRFactors() {
795
+ mrr = mrrFactors;
796
+ emission = emissionFactor;
797
+ occlusion = 1.0;
798
+ ${o?"vtc.uv = vuv0;":""}
799
+ ${t.hasMetalnessAndRoughnessTexture?t.supportsTextureAtlas?"vtc.size = texMetallicRoughnessSize; applyMetallnessAndRoughness(vtc);":"applyMetallnessAndRoughness(vtc);":""}
800
+ ${t.hasEmissionTexture?t.supportsTextureAtlas?"vtc.size = texEmissionSize; applyEmission(vtc);":"applyEmission(vtc);":""}
801
+ ${t.hasOcclusionTexture?t.supportsTextureAtlas?"vtc.size = texOcclusionSize; applyOcclusion(vtc);":"applyOcclusion(vtc);":""}
802
+ }
803
+ `)}}else r.code.add(c.H`float getBakedOcclusion() { return 1.0; }`);else r.code.add(c.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
804
+ vec3 emission = vec3(0.0);
805
+ float occlusion = 1.0;
806
+ void applyPBRFactors() {}
807
+ float getBakedOcclusion() { return 1.0; }`)}r(60537),(0,n.f)(0,.6,.2),(o=i||(i={}))[o.Disabled=0]="Disabled",o[o.Normal=1]="Normal",o[o.Schematic=2]="Schematic",o[o.Water=3]="Water",o[o.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",o[o.COUNT=5]="COUNT"},27754:(e,t,r)=>{r.d(t,{e:()=>o});var i=r(74709);function o(e){e.vertex.code.add(i.H`const float PI = 3.141592653589793;`),e.fragment.code.add(i.H`const float PI = 3.141592653589793;
808
+ const float LIGHT_NORMALIZATION = 1.0 / PI;
809
+ const float INV_PI = 0.3183098861837907;
810
+ const float HALF_PI = 1.570796326794897;`)}},22539:(e,t,r)=>{r.d(t,{XE:()=>m,hb:()=>f}),r(65617);var i=r(20285),o=r(71250),n=r(21437),a=r(15736),s=r(74709),l=r(79884),c=r(67498);class d extends l.x{constructor(e,t,r){super(e,"mat4",c.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))),r)}}class u extends l.x{constructor(e,t,r){super(e,"mat4",c.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))),r)}}var h=r(98069);function f(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new u("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),p(e))}function m(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new d("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),p(e))}function p(e){const t=e.fragment;t.include(i.n),t.uniforms.add([new h.A("shadowMapTex",((e,t)=>t.shadowMap.depthTexture)),new a._("numCascades",((e,t)=>t.shadowMap.numCascades)),new o.N("cascadeDistances",((e,t)=>t.shadowMap.cascadeDistances)),new n.p("depthHalfPixelSz",((e,t)=>.5/t.shadowMap.textureSize))]),t.code.add(s.H`int chooseCascade(float depth, out mat4 mat) {
811
+ vec4 distance = cascadeDistances;
812
+ int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
813
+ mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
814
+ return i;
815
+ }
816
+ vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
817
+ vec4 lv = mat * vec4(_vpos, 1.0);
818
+ lv.xy /= lv.w;
819
+ return 0.5 * lv.xyz + vec3(0.5);
820
+ }
821
+ vec2 cascadeCoordinates(int i, vec3 lvpos) {
822
+ return vec2(float(i - 2 * (i / 2)) * 0.5, float(i / 2) * 0.5) + 0.5 * lvpos.xy;
823
+ }
824
+ float readShadowMapDepth(vec2 uv, sampler2D _depthTex) {
825
+ return rgba2float(texture2D(_depthTex, uv));
826
+ }
827
+ float posIsInShadow(vec2 uv, vec3 lvpos, sampler2D _depthTex) {
828
+ return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
829
+ }
830
+ float filterShadow(vec2 uv, vec3 lvpos, float halfPixelSize, sampler2D _depthTex) {
831
+ float texSize = 0.5 / halfPixelSize;
832
+ vec2 st = fract((vec2(halfPixelSize) + uv) * texSize);
833
+ float s00 = posIsInShadow(uv + vec2(-halfPixelSize, -halfPixelSize), lvpos, _depthTex);
834
+ float s10 = posIsInShadow(uv + vec2(halfPixelSize, -halfPixelSize), lvpos, _depthTex);
835
+ float s11 = posIsInShadow(uv + vec2(halfPixelSize, halfPixelSize), lvpos, _depthTex);
836
+ float s01 = posIsInShadow(uv + vec2(-halfPixelSize, halfPixelSize), lvpos, _depthTex);
837
+ return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
838
+ }
839
+ float readShadowMap(const in vec3 _vpos, float _linearDepth) {
840
+ mat4 mat;
841
+ int i = chooseCascade(_linearDepth, mat);
842
+ if (i >= numCascades) { return 0.0; }
843
+ vec3 lvpos = lightSpacePosition(_vpos, mat);
844
+ if (lvpos.z >= 1.0) { return 0.0; }
845
+ if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
846
+ vec2 uv = cascadeCoordinates(i, lvpos);
847
+ return filterShadow(uv, lvpos, depthHalfPixelSz, shadowMapTex);
848
+ }`)}},82550:(e,t,r)=>{r.d(t,{k:()=>u});var i=r(172),o=r(79884),n=r(67498);class a extends o.x{constructor(e,t,r){super(e,"vec4",n.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))),r)}}class s extends o.x{constructor(e,t,r){super(e,"float",n.P.Pass,((r,i,o)=>r.setUniform1fv(e,t(i,o))),r)}}var l=r(74709),c=r(19850),d=r(35065);function u(e,t){t.hasVvInstancing&&(t.vvSize||t.vvColor)&&e.attributes.add(d.T.INSTANCEFEATUREATTRIBUTE,"vec4");const r=e.vertex;t.vvSize?(r.uniforms.add(new i.J("vvSizeMinSize",(e=>e.vvSizeMinSize))),r.uniforms.add(new i.J("vvSizeMaxSize",(e=>e.vvSizeMaxSize))),r.uniforms.add(new i.J("vvSizeOffset",(e=>e.vvSizeOffset))),r.uniforms.add(new i.J("vvSizeFactor",(e=>e.vvSizeFactor))),r.uniforms.add(new c.c("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new i.J("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(l.H`vec3 vvScale(vec4 _featureAttribute) {
849
+ return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
850
+ }
851
+ vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
852
+ return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
853
+ }`),r.code.add(l.H`
854
+ const float eps = 1.192092896e-07;
855
+ vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
856
+ vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
857
+ return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
858
+ }
859
+
860
+ ${t.hasVvInstancing?l.H`
861
+ vec4 vvLocalNormal(vec3 _normal) {
862
+ return vvTransformNormal(_normal, instanceFeatureAttribute);
863
+ }
864
+
865
+ vec4 localPosition() {
866
+ return vvTransformPosition(position, instanceFeatureAttribute);
867
+ }`:""}
868
+ `)):r.code.add(l.H`vec4 localPosition() { return vec4(position, 1.0); }
869
+ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",8),t.hasVvInstancing&&r.uniforms.add([new s("vvColorValues",(e=>e.vvColorValues),8),new a("vvColorColors",(e=>e.vvColorColors),8)]),r.code.add(l.H`
870
+ vec4 vvGetColor(vec4 featureAttribute, float values[vvColorNumber], vec4 colors[vvColorNumber]) {
871
+ float value = featureAttribute.y;
872
+ if (value <= values[0]) {
873
+ return colors[0];
874
+ }
875
+
876
+ for (int i = 1; i < vvColorNumber; ++i) {
877
+ if (values[i] >= value) {
878
+ float f = (value - values[i-1]) / (values[i] - values[i-1]);
879
+ return mix(colors[i-1], colors[i], f);
880
+ }
881
+ }
882
+ return colors[vvColorNumber - 1];
883
+ }
884
+
885
+ ${t.hasVvInstancing?l.H`
886
+ vec4 vvColor() {
887
+ return vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);
888
+ }`:""}
889
+ `)):r.code.add(l.H`vec4 vvColor() { return vec4(1.0); }`)}r(46521),r(65617),r(82791)},96310:(e,t,r)=>{r.d(t,{F:()=>i,b:()=>o});const i=.1,o=.001},85787:(e,t,r)=>{r.d(t,{z:()=>l});var i=r(96310),o=r(74709);function n(e){e.fragment.code.add(o.H`
890
+ #define discardOrAdjustAlpha(color) { if (color.a < ${o.H.float(i.b)}) { discard; } }
891
+ `)}r(79884),r(67498);var a=r(21437),s=r(47026);function l(e,t){!function(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode!==s.JJ.Mask&&t.alphaDiscardMode!==s.JJ.MaskBlend||i.uniforms.add(r),t.alphaDiscardMode){case s.JJ.Blend:return e.include(n);case s.JJ.Opaque:i.code.add(o.H`void discardOrAdjustAlpha(inout vec4 color) {
892
+ color.a = 1.0;
893
+ }`);break;case s.JJ.Mask:i.code.add(o.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case s.JJ.MaskBlend:e.fragment.code.add(o.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}(e,t,new a.p("textureAlphaCutoff",(e=>e.textureAlphaCutoff)))}},89243:(e,t,r)=>{r.d(t,{$:()=>n,I:()=>a});var i=r(80442),o=r(74709);function n({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(o.H`vec3 dpPlusFrc(vec3 a, vec3 b) {
894
+ return mix(a, a + b, vec3(notEqual(b, vec3(0))));
895
+ }
896
+ vec3 dpMinusFrc(vec3 a, vec3 b) {
897
+ return mix(vec3(0), a - b, vec3(notEqual(a, b)));
898
+ }
899
+ vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
900
+ vec3 t1 = dpPlusFrc(hiA, hiB);
901
+ vec3 e = dpMinusFrc(t1, hiA);
902
+ vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
903
+ return t1 + t2;
904
+ }`):e.add(o.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
905
+ vec3 t1 = hiA + hiB;
906
+ vec3 e = t1 - hiA;
907
+ vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
908
+ return t1 + t2;
909
+ }`)}function a(e){return!!(0,i.Z)("force-double-precision-obfuscation")||e.driverTest.doublePrecisionRequiresObfuscation}},90692:(e,t,r)=>{r.d(t,{y:()=>a});var i=r(6206),o=r(74709);function n(e){e.code.add(o.H`vec4 premultiplyAlpha(vec4 v) {
910
+ return vec4(v.rgb * v.a, v.a);
911
+ }
912
+ vec3 rgb2hsv(vec3 c) {
913
+ vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
914
+ vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
915
+ vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
916
+ float d = q.x - min(q.w, q.y);
917
+ float e = 1.0e-10;
918
+ return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
919
+ }
920
+ vec3 hsv2rgb(vec3 c) {
921
+ vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
922
+ vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
923
+ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
924
+ }
925
+ float rgb2v(vec3 c) {
926
+ return max(c.x, max(c.y, c.z));
927
+ }`)}function a(e){e.include(n),e.code.add(o.H`
928
+ vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
929
+ // workaround for artifacts in OSX using Intel Iris Pro
930
+ // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
931
+ vec3 internalMixed = internalColor * textureColor;
932
+ vec3 allMixed = internalMixed * externalColor;
933
+
934
+ if (mode == ${o.H.int(i.a9.Multiply)}) {
935
+ return allMixed;
936
+ }
937
+ if (mode == ${o.H.int(i.a9.Ignore)}) {
938
+ return internalMixed;
939
+ }
940
+ if (mode == ${o.H.int(i.a9.Replace)}) {
941
+ return externalColor;
942
+ }
943
+
944
+ // tint (or something invalid)
945
+ float vIn = rgb2v(internalMixed);
946
+ vec3 hsvTint = rgb2hsv(externalColor);
947
+ vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
948
+ return hsv2rgb(hsvOut);
949
+ }
950
+
951
+ float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
952
+ // workaround for artifacts in OSX using Intel Iris Pro
953
+ // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
954
+ float internalMixed = internalOpacity * textureOpacity;
955
+ float allMixed = internalMixed * externalOpacity;
956
+
957
+ if (mode == ${o.H.int(i.a9.Ignore)}) {
958
+ return internalMixed;
959
+ }
960
+ if (mode == ${o.H.int(i.a9.Replace)}) {
961
+ return externalOpacity;
962
+ }
963
+
964
+ // multiply or tint (or something invalid)
965
+ return allMixed;
966
+ }
967
+ `)}},20285:(e,t,r)=>{r.d(t,{n:()=>o});var i=r(74709);function o(e){e.code.add(i.H`const float MAX_RGBA_FLOAT =
968
+ 255.0 / 256.0 +
969
+ 255.0 / 256.0 / 256.0 +
970
+ 255.0 / 256.0 / 256.0 / 256.0 +
971
+ 255.0 / 256.0 / 256.0 / 256.0 / 256.0;
972
+ const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);
973
+ vec4 float2rgba(const float value) {
974
+ float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);
975
+ vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);
976
+ const float toU8AsFloat = 1.0 / 255.0;
977
+ return fixedPointU8 * toU8AsFloat;
978
+ }
979
+ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
980
+ 255.0 / (256.0),
981
+ 255.0 / (256.0 * 256.0),
982
+ 255.0 / (256.0 * 256.0 * 256.0),
983
+ 255.0 / (256.0 * 256.0 * 256.0 * 256.0)
984
+ );
985
+ float rgba2float(vec4 rgba) {
986
+ return dot(rgba, RGBA_2_FLOAT_FACTORS);
987
+ }`)}},93669:(e,t,r)=>{r.d(t,{h:()=>f,S:()=>m});var i=r(52138),o=r(10937),n=r(17896),a=r(65617),s=r(70582),l=r(172),c=r(79884),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,n.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function m(e,t){if(e.vertex.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix))),!t.instancedDoublePrecision)return void e.vertex.uniforms.add([new u("view",((e,t)=>(0,i.h)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin))]);const r=e=>(0,n.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.vertex.uniforms.add([new h.g("view",((e,t)=>(0,i.h)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t)))])}const p=(0,o.c)(),g=(0,a.c)()},19693:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),o=r(92604),n=r(70586);const a=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){a.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new f,this.extensions=new m,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(o.constants.generateSource());return`\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${a.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,n.pC)(i)&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,n.pC)(i)&&r.set(t.name,i)}));const i=Array.from(r.values()),o=i.length;return(e,r,n)=>{for(let a=0;a<o;++a)i[a](t,e,r,n)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if((0,n.Wi)(e))a.error(`Trying to add null Uniform from ${(new Error).stack}.`);else{if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}}generateSource(){return Array.from(this._entries.values()).map((e=>(0,n.pC)(e.arraySize)?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new d,this.constants=new p}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=>`attribute ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(){return this._entries.map((e=>`varying ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}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 g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",_="precision highp float;\nprecision highp sampler2D;"},46826:(e,t,r)=>{r.d(t,{F:()=>u});var i=r(70586),o=r(4307),n=r(97323),a=r(79884),s=r(67498);class l extends a.x{constructor(e,t){super(e,"vec2",s.P.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}var c=r(4511);class d extends a.x{constructor(e,t){super(e,"sampler2D",s.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}function u(e,t,r=c.D.None){const a=[new d(e,t)];if(r&c.D.Size){const r=e+"Size";a.push(new l(r,((e,r)=>{const a=t(e,r);return(0,i.pC)(a)?(0,o.s)(h,a.descriptor.width,a.descriptor.height):n.Z})))}if(r&c.D.InvSize){const r=e+"InvSize";a.push(new l(r,((e,r)=>{const a=t(e,r);return(0,i.pC)(a)?(0,o.s)(h,1/a.descriptor.width,1/a.descriptor.height):n.Z})))}return a}const h=(0,n.a)()},98069:(e,t,r)=>{r.d(t,{A:()=>d,J:()=>u});var i=r(70586),o=r(4307),n=r(97323),a=r(19693),s=r(4511),l=r(79884),c=r(67498);class d extends l.x{constructor(e,t){super(e,"sampler2D",c.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}function u(e,t,r=s.D.None){const l=[new d(e,t)];if(r&s.D.Size){const r=e+"Size";l.push(new a.A(r,((e,r)=>{const a=t(e,r);return(0,i.pC)(a)?(0,o.s)(h,a.descriptor.width,a.descriptor.height):n.Z})))}if(r&s.D.InvSize){const r=e+"InvSize";l.push(new a.A(r,((e,r)=>{const a=t(e,r);return(0,i.pC)(a)?(0,o.s)(h,1/a.descriptor.width,1/a.descriptor.height):n.Z})))}return l}const h=(0,n.a)()},4511:(e,t,r)=>{var i;r.d(t,{D:()=>i}),function(e){e[e.None=0]="None",e[e.Size=1]="Size",e[e.InvSize=2]="InvSize"}(i||(i={}))},79884:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(70586),o=r(67498);class n{constructor(e,t,r,n,a=null){this.name=e,this.type=t,this.arraySize=a,this.bind={[o.P.Pass]:null,[o.P.Draw]:null},(0,i.pC)(r)&&(0,i.pC)(n)&&(this.bind[r]=n)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});class i{}function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}!function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(o||(o={}))},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},51354:(e,t,r)=>{r.d(t,{m:()=>i,o:()=>o});class i{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function o(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits??[0];let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<n)-1<<l;a[s]+=n,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Geometry=2]="Geometry",e[e.Material=3]="Material",e[e.Texture=4]="Texture",e[e.COUNT=5]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.OBJECTANDLAYERIDCOLOR,6],[i.T.OBJECTANDLAYERIDCOLOR_INSTANCED,6],[i.T.INSTANCECOLOR,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>s});var i=r(70586),o=r(95330),n=r(74709),a=r(47026);class s extends class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(r,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new l((0,i.pC)(this._texture)?this._texture.glTexture:null,(0,i.pC)(this._textureNormal)?this._textureNormal.glTexture:null,(0,i.pC)(this._textureEmissive)?this._textureEmissive.glTexture:null,(0,i.pC)(this._textureOcclusion)?this._textureOcclusion.glTexture:null,(0,i.pC)(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){((0,i.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if((0,i.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class l extends n.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,n=r(70586),a=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(37782);class d extends a.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,n.pC)(this.repository)&&this.repository.materialChanged(this)}}(o=i||(i={}))[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},11726:(e,t,r)=>{r.d(t,{hu:()=>o,yK:()=>n}),r(97323),r(98766),(0,r(88669).c)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function o(e,t){if(!e)throw t=t||"assert",console.log(new Error(t).stack),new i(t)}function n(e,t,r,i){let o,n=(r[0]-e[0])/t[0],a=(i[0]-e[0])/t[0];n>a&&(o=n,n=a,a=o);let s=(r[1]-e[1])/t[1],l=(i[1]-e[1])/t[1];if(s>l&&(o=s,s=l,l=o),n>l||s>a)return!1;s>n&&(n=s),l<a&&(a=l);let c=(r[2]-e[2])/t[2],d=(i[2]-e[2])/t[2];return c>d&&(o=c,c=d,d=o),!(n>d||c>a||(d<a&&(a=d),a<0))}},35065:(e,t,r)=>{var i;r.d(t,{T:()=>i}),function(e){e.POSITION="position",e.NORMAL="normal",e.UV0="uv0",e.AUXPOS1="auxpos1",e.AUXPOS2="auxpos2",e.MAPPOS="mapPos",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.TANGENT="tangent",e.OFFSET="offset",e.SUBDIVISIONFACTOR="subdivisionFactor",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.NORMALCOMPRESSED="normalCompressed",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.FEATUREVALUE="featureValue",e.MODELORIGINHI="modelOriginHi",e.MODELORIGINLO="modelOriginLo",e.MODEL="model",e.MODELNORMAL="modelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMALA="normalA",e.NORMALB="normalB",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.U8PADDING="u8padding",e.U16PADDING="u16padding",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.EXTRUDE="extrude",e.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",e.OBJECTANDLAYERIDCOLOR_INSTANCED="objectAndLayerIdColor_instanced"}(i||(i={}))},47026:(e,t,r)=>{var i,o,n,a,s,l,c,d,u,h,f,m;r.d(t,{CE:()=>u,Gv:()=>o,JJ:()=>f,MX:()=>d,Rw:()=>a,Vr:()=>i,hU:()=>s}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.ASYNC=0]="ASYNC",e[e.SYNC=1]="SYNC"}(l||(l={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(c||(c={})),function(e){e[e.Triangle=0]="Triangle",e[e.Point=1]="Point",e[e.Line=2]="Line"}(d||(d={})),function(e){e[e.STRETCH=1]="STRETCH",e[e.PAD=2]="PAD"}(u||(u={})),function(e){e[e.CHANGED=0]="CHANGED",e[e.UNCHANGED=1]="UNCHANGED"}(h||(h={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(m||(m={}))},9749:(e,t,r)=>{r.d(t,{V:()=>o}),r(17896);var i=r(65617);r(22021),(0,i.c)();const o=.4;(0,i.c)()},37782:(e,t,r)=>{r.d(t,{FZ:()=>R,Uf:()=>M,Bw:()=>g,LO:()=>w,Hx:()=>S});var i=r(67676),o=r(22021),n=r(70586),a=r(17896),s=r(65617),l=r(60437),c=r(47026);function d(e,t){return Math.max((0,o.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const u={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var h=r(11726),f=r(35065),m=(r(52138),r(13598));r(9820),new Float64Array(3),new Float32Array(6),(0,m.c)();const p=(0,l.Ue)();function g(e,t,r,i,o,a,s){if(!function(e){return!!(0,n.pC)(e)&&!e.visible}(t))if(e.boundingInfo){(0,h.hu)(e.primitiveType===c.MX.Triangle);const t=r.tolerance;v(e.boundingInfo,i,o,t,a,s)}else{const t=e.indices.get(f.T.POSITION),r=e.vertexAttributes.get(f.T.POSITION);T(i,o,0,t.length/3,t,r,void 0,a,s)}}const _=(0,s.c)();function v(e,t,r,i,o,s){if((0,n.Wi)(e))return;const c=function(e,t,r){return(0,a.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,_);if((0,l.op)(p,e.getBBMin()),(0,l.Tn)(p,e.getBBMax()),(0,n.pC)(o)&&o.applyToAabb(p),function(e,t,r,i){return function(e,t,r,i,o){const n=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(p,t,c,i)){const{primitiveIndices:n,indices:a,position:l}=e,c=n?n.length:a.length/3;if(c>y){const n=e.getChildren();if(void 0!==n){for(let e=0;e<8;++e)void 0!==n[e]&&v(n[e],t,r,i,o,s);return}}T(t,r,0,c,a,l,n,o,s)}}const x=(0,s.c)();function T(e,t,r,i,o,a,s,l,c){if(s)return function(e,t,r,i,o,a,s,l,c){const d=a.data,u=a.stride||a.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,_=t[2]-m;for(let e=r;e<i;++e){const t=s[e];let r=3*t,i=u*o[r++],a=d[i++],v=d[i++],T=d[i];i=u*o[r++];let b=d[i++],A=d[i++],S=d[i];i=u*o[r];let M=d[i++],w=d[i++],C=d[i];(0,n.pC)(l)&&([a,v,T]=l.applyToVertex(a,v,T,e),[b,A,S]=l.applyToVertex(b,A,S,e),[M,w,C]=l.applyToVertex(M,w,C,e));const R=b-a,y=A-v,O=S-T,N=M-a,P=w-v,I=C-T,L=g*I-P*_,D=_*N-I*p,F=p*P-N*g,B=R*L+y*D+O*F;if(Math.abs(B)<=Number.EPSILON)continue;const H=h-a,U=f-v,z=m-T,G=H*L+U*D+z*F;if(B>0){if(G<0||G>B)continue}else if(G>0||G<B)continue;const V=U*O-y*z,W=z*R-O*H,k=H*y-R*U,q=p*V+g*W+_*k;if(B>0){if(q<0||G+q>B)continue}else if(q>0||G+q<B)continue;const $=(N*V+P*W+I*k)/B;$>=0&&c($,E(R,y,O,N,P,I,x),t,!1)}}(e,t,r,i,o,a,s,l,c);const d=a.data,u=a.stride||a.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,_=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=u*o[t++],i=d[r++],a=d[r++],s=d[r];r=u*o[t++];let v=d[r++],T=d[r++],b=d[r];r=u*o[t++];let A=d[r++],S=d[r++],M=d[r];(0,n.pC)(l)&&([i,a,s]=l.applyToVertex(i,a,s,e),[v,T,b]=l.applyToVertex(v,T,b,e),[A,S,M]=l.applyToVertex(A,S,M,e));const w=v-i,C=T-a,R=b-s,y=A-i,O=S-a,N=M-s,P=g*N-O*_,I=_*y-N*p,L=p*O-y*g,D=w*P+C*I+R*L;if(Math.abs(D)<=Number.EPSILON)continue;const F=h-i,B=f-a,H=m-s,U=F*P+B*I+H*L;if(D>0){if(U<0||U>D)continue}else if(U>0||U<D)continue;const z=B*R-C*H,G=H*w-R*F,V=F*C-w*B,W=p*z+g*G+_*V;if(D>0){if(W<0||U+W>D)continue}else if(W>0||U+W<D)continue;const k=(y*z+O*G+N*V)/D;k>=0&&c(k,E(w,C,R,y,O,N,x),e,!1)}}const b=(0,s.c)(),A=(0,s.c)();function E(e,t,r,i,o,n,s){return(0,a.s)(b,e,t,r),(0,a.s)(A,i,o,n),(0,a.f)(s,b,A),(0,a.n)(s,s),s}function S(e,t,r,i,a){let s=(r.screenLength||0)*e.pixelRatio;(0,n.pC)(a)&&(s=function(e,t,r,i){return d(e,function(e,t,r){const i=r.parameters,o=r.paddingPixelsOverride;return u.scale=Math.min(i.divisor/(t-i.offset),1),u.factor=function(e){return Math.abs(e*e*e)}(e),u.minPixelSize=i.minPixelSize,u.paddingPixels=o,u}(t,r,i))}(s,i,t,a));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(l*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function M(e,t){const r=t?M(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=C(i)),null==i&&t in r||(r[t]=i)}return r}function w(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?null===e[o]?(e[o]=n.slice(),r=!0):(0,i.Vx)(e[o],n)&&(r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}function C(e){const t=[];return e.forEach((e=>t.push(e))),t}const R={multiply:1,ignore:2,replace:3,tint:4},y=1e3},64822:(e,t,r)=>{var i;r.d(t,{JY:()=>i}),function(e){e[e.Global=1]="Global",e[e.Local=2]="Local"}(i||(i={}))},75656:(e,t,r)=>{r.d(t,{x:()=>c}),r(80442);var i=r(22021),o=r(70586),n=r(49300),a=r(54738),s=r(35371),l=r(46314);class c{constructor(e,t,r=null){if(this._context=e,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(s._g.Texture,this),this._descriptor={target:s.No.TEXTURE_2D,samplingMode:s.cw.LINEAR,wrapMode:s.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1,...t},e.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),h(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor;t??(t=i.target);const a=h(t);null===e&&(i.width=i.width||4,i.height=i.height||4,a&&(i.depth=i.depth??1));const m=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),c._validateTexture(this._context,i),this._configurePixelStorage();const p=i.pixelFormat;let g=i.internalFormat?i.internalFormat:this._deriveInternalFormat(p,i.dataType);if(u(e)){let o=e.width,s=e.height;const l=1;e instanceof HTMLVideoElement&&(o=e.videoWidth,s=e.videoHeight),i.width&&i.height,a&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,g,i.hasMipmap,o,s,l),this._texImage(t,0,g,o,s,l,e),(0,n.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=o),void 0===i.height&&(i.height=s),a&&void 0===i.depth&&(i.depth=l)}else{const{width:c,height:u,depth:h}=i;if(null!=c&&null!=u||console.error("Width and height must be specified!"),a&&null==h&&console.error("Depth must be specified!"),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,g,i.hasMipmap,c,u,h),r.DEPTH24_STENCIL8&&g===r.DEPTH_STENCIL&&(g=r.DEPTH24_STENCIL8),d(e)){const o=e.levels,n=f(t,c,u,h),a=Math.min(n-1,o.length-1);(0,l.Z)(r)?r.texParameteri(i.target,r.TEXTURE_MAX_LEVEL,a):i.hasMipmap=i.hasMipmap&&n===o.length;const d=g;if(!function(e){return e in s.q_}(d))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,r,i,n)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(t,e,d,r,i,n,a)}),a)}else(0,o.pC)(e)?(this._texImage(t,0,g,c,u,h,e),(0,n.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,i,o,a)=>{this._texImage(t,e,g,i,o,a,null),(0,n.zu)(r)}))}c._applySamplingMode(r,this._descriptor),c._applyWrapMode(r,this._descriptor),c._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,n.zu)(r),this._context.bindTexture(m,c.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,o,n){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const a=this._context.gl,s=this._descriptor,{pixelFormat:l,internalFormat:h,dataType:f,isImmutable:m,target:p}=s;if(m&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);(t<0||r<0||i>s.width||o>s.height||t+i>s.width||r+o>s.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),u(n)?a.texSubImage2D(p,e,t,r,l,f,n):d(n)?a.compressedTexSubImage2D(p,e,t,r,i,o,h,n.levels[e]):a.texSubImage2D(p,e,t,r,i,o,l,f,n),this._context.bindTexture(g,c.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,o,n,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const u=this._context.gl;if(!(0,l.Z)(u))throw new Error("3D textures are not supported in WebGL1");const f=this._descriptor,{pixelFormat:m,dataType:p,isImmutable:g,target:_,internalFormat:v}=f;if(g&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");h(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const x=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||o>f.width||n>f.height||a>f.depth||t+o>f.width||r+n>f.height||i+a>f.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),d(s))s=s.levels[e],u.compressedTexSubImage3D(_,e,t,r,i,o,n,a,v,s);else{const l=s;u.texSubImage3D(_,e,t,r,i,o,n,a,m,p,l)}this._context.bindTexture(x,c.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,c._validateTexture(this._context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,c.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,c._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(c._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(c._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===a.zO.WEBGL1)return e;switch(t){case s.Br.FLOAT:switch(e){case s.VI.RGBA:return s.lP.RGBA32F;case s.VI.RGB:return s.lP.RGB32F;default:throw new Error("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(e){case s.VI.RGBA:return s.lP.RGBA8;case s.VI.RGB:return s.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._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)}_texStorage(e,t,r,i,o,n){const a=this._context.gl;if(!(0,l.Z)(a))throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in s.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?f(e,i,o,n):1;h(e)?a.texStorage3D(e,c,t,i,o,n):a.texStorage2D(e,c,t,i,o),this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,n,s,l){const c=this._context.gl;let d=null;const f=this._context.type===a.zO.WEBGL2,m=h(e),{isImmutable:p,pixelFormat:g,dataType:_}=this._descriptor;if(f&&(d=c),f||!u(l))if(p){if((0,o.pC)(l)){const r=l;m?d.texSubImage3D(e,t,0,0,0,i,n,s,g,_,r):c.texSubImage2D(e,t,0,0,i,n,g,_,r)}}else{const a=(0,o.Wg)(l);m?d.texImage3D(e,t,r,i,n,s,0,g,_,a):c.texImage2D(e,t,r,i,n,0,g,_,a)}else c.texImage2D(e,0,r,g,_,l)}_compressedTexImage(e,t,r,i,n,s,l){const c=this._context.gl;let d=null;const u=h(e),f=this._descriptor.isImmutable;if(u){if(this._context.type!==a.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");d=c}f?(0,o.pC)(l)&&(u?d.compressedTexSubImage3D(e,t,0,0,0,i,n,s,r,l):c.compressedTexSubImage2D(e,t,0,0,i,n,r,l)):u?d.compressedTexImage3D(e,t,r,i,n,s,0,l):c.compressedTexImage2D(e,t,r,i,n,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:o,hasMipmap:n,target:a}=this._descriptor;const l=a===s.No.TEXTURE_3D;for(let a=0;e(a,r,i,o),n&&(1!==r||1!==i||l&&1!==o)&&!(a>=t);++a)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(t.width<0||t.height<0||t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=(0,l.Z)(e.gl),o=(0,i.wt)(t.width)&&(0,i.wt)(t.height);r||!t.isImmutable&&!h(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||o||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}function d(e){return(0,o.pC)(e)&&"type"in e&&"compressed"===e.type}function u(e){return(0,o.pC)(e)&&!d(e)&&!function(e){return(0,o.pC)(e)&&"byteLength"in e}(e)}function h(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let o=Math.max(t,r);return e===s.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}c.TEXTURE_UNIT_FOR_UPDATES=0},21968:(e,t,r)=>{r.d(t,{G:()=>i});class i{constructor(e,t,r,i,o,n=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=o,this.normalized=n,this.divisor=a}}},46314:(e,t,r)=>{function i(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}r.d(t,{Z:()=>i})},49300:(e,t,r)=>{r.d(t,{CG:()=>l,hZ:()=>s,zu:()=>c});var i=r(20102),o=r(80442);const n=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return a}function l(){return a}function c(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:o}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>s,zO:()=>i});var i,o,n=r(80442);function a(e){const t=(0,n.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":return(0,n.Z)("mac")&&(0,n.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1];case"3d":return[i.WEBGL2,i.WEBGL1]}}function s(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let n=null;for(const t of o){try{n=e.getContext(t,r)}catch(e){}if(n)break}return n}(o=i||(i={}))[o.WEBGL1=1]="WEBGL1",o[o.WEBGL2=2]="WEBGL2"},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],t[i]=n[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],n[1]=e[i]-n[0],t[i]=n[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const n=new Float32Array(2)}}]);