@arcgis/core 5.1.0-next.84 → 5.1.0-next.86

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 (367) hide show
  1. package/assets/components/assets/icon/gpsReceiver16.json +1 -0
  2. package/assets/components/assets/icon/gpsReceiver24.json +1 -0
  3. package/assets/components/assets/icon/gpsReceiver32.json +1 -0
  4. package/assets/components/assets/icon/totalStation16.json +1 -0
  5. package/assets/components/assets/icon/totalStation24.json +1 -0
  6. package/assets/components/assets/icon/totalStation32.json +1 -0
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{e89dc473f46a5584d2ef.js → 004af103a94d21cb4889.js} +3 -3
  9. package/assets/esri/core/workers/chunks/{67abbe81c16de26f61d8.js → 1bad4331a43169f3cc34.js} +1 -1
  10. package/assets/esri/core/workers/chunks/27f67a3828b78d4c1413.js +1 -0
  11. package/assets/esri/core/workers/chunks/2c916b93d8a6e6b9c0d7.js +1 -0
  12. package/assets/esri/core/workers/chunks/{db86a1119e4e58ecfbda.js → 2f8b173d1dac73ba0d9e.js} +1 -1
  13. package/assets/esri/core/workers/chunks/49e8144effc299dfcd66.js +1 -0
  14. package/assets/esri/core/workers/chunks/5166f204fd078dced5db.js +1 -0
  15. package/assets/esri/core/workers/chunks/{45c83eb7c2a06166e3b0.js → 56717ff315c6ec874142.js} +1 -1
  16. package/assets/esri/core/workers/chunks/577cbc131b21c351fae5.js +2 -0
  17. package/assets/esri/core/workers/chunks/{72691fe14024e35f85d0.js → 618106f5fbdf88ef2278.js} +1 -1
  18. package/assets/esri/core/workers/chunks/61fada8942b65fa0b5e1.js +1 -0
  19. package/assets/esri/core/workers/chunks/{05c5f68e117fc58ae801.js → 701b823763e941b71f4f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{1e2c0c6d724f7639d4c1.js → 713ab619060bd5087479.js} +13 -13
  21. package/assets/esri/core/workers/chunks/{a9b5ce00323cd5574bf7.js → 7160e3e7340beb7fdb42.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{0219edb509e01270d42d.js → 99c6bd2125f4eb6796fe.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{ff713926985a284f5d81.js → a844547bf33a8527ee9f.js} +2 -2
  24. package/assets/esri/core/workers/chunks/aa6808146c76b2d49b64.js +1 -0
  25. package/assets/esri/core/workers/chunks/{9cac70164d8528c283af.js → add000f51c778114c028.js} +1 -1
  26. package/assets/esri/core/workers/chunks/b23e677c33db6f9bac8a.js +1 -0
  27. package/assets/esri/core/workers/chunks/{dfe1139124fda0d6c059.js → b575292013bceef9b015.js} +1 -1
  28. package/assets/esri/core/workers/chunks/bae8f2a5dfe0cfbc0688.js +1 -0
  29. package/assets/esri/core/workers/chunks/bb5f909a2f26fc6a21b0.js +2 -0
  30. package/assets/esri/core/workers/chunks/{28a45bd26eb5c9b3ec7c.js → ce66c551b7083913eee5.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{22bdea4ca52970c29504.js → d0aee7c80c5c7e23d216.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{f4220b6eab0865318033.js → d8de7fe49dba9ed589df.js} +1 -1
  33. package/assets/esri/core/workers/chunks/ded2f19a1685db2137f4.js +2 -0
  34. package/assets/esri/core/workers/chunks/{f77d23ee60c876b01e4b.js → e9a42f0262fc44a79d4b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/edbdee69440dbfc05644.js +1 -0
  36. package/assets/esri/core/workers/chunks/ee057c85cdf6beb5b012.js +2 -0
  37. package/assets/esri/core/workers/chunks/f9fe3c9867b0bdb2aec6.js +596 -0
  38. package/assets/esri/core/workers/chunks/ff57a071156d8a7e47be.js +1 -0
  39. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  40. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  41. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +6 -0
  42. package/assets/esri/themes/dark/main.css +1 -1
  43. package/assets/esri/themes/light/main.css +1 -1
  44. package/assets/esri/themes/light/view.css +1 -1
  45. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
  46. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
  47. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  48. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  49. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  50. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  51. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  52. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  53. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  54. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  55. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  56. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  57. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  58. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  59. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  60. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  61. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  62. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  63. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  64. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  65. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  66. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  67. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  68. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  69. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  70. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  71. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  72. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  73. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  74. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  75. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  76. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  77. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  78. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  79. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  80. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  81. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  82. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  83. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  84. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  85. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  86. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  87. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  88. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  89. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  90. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  91. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  92. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  93. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  94. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  95. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  96. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  97. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  98. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  99. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  100. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  101. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  102. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  103. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  104. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  118. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  119. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  120. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  121. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  122. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  123. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  124. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  125. package/chunks/EdgeShader.glsl.js +13 -9
  126. package/chunks/Fog.glsl.js +1 -1
  127. package/chunks/GlowBlur.glsl.js +9 -13
  128. package/chunks/GlowComposition.glsl.js +10 -10
  129. package/chunks/ShadowCastVisualize.glsl.js +10 -10
  130. package/config.js +1 -1
  131. package/core/arrayUtils.js +1 -1
  132. package/core/has.js +1 -1
  133. package/core/screenUtils.js +1 -1
  134. package/form/types.d.ts +1 -1
  135. package/geohash/GeohashCell.js +1 -1
  136. package/geohash/GeohashTree.js +1 -1
  137. package/interfaces.d.ts +14 -14
  138. package/kernel.js +1 -1
  139. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  140. package/layers/ParquetLayer.d.ts +10 -10
  141. package/layers/ParquetLayer.js +1 -1
  142. package/layers/StreamLayer.js +1 -1
  143. package/layers/graphics/sources/connections/FabricKustoConnection.js +2 -0
  144. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  145. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  146. package/layers/graphics/sources/connections/createConnection.js +1 -1
  147. package/layers/graphics/sources/connections/websocketUils.js +2 -0
  148. package/layers/scene/ModelFileInfo.js +1 -1
  149. package/layers/scene/modelQuerySupport.js +1 -1
  150. package/layers/support/ClientSideConnection.js +1 -1
  151. package/layers/support/FabricKustoSource.js +2 -0
  152. package/layers/support/{ParquetGeometryEncodingLocation.d.ts → GeometryEncodingLocation.d.ts} +9 -9
  153. package/layers/support/{ParquetGeometryEncodingLocation.js → GeometryEncodingLocation.js} +1 -1
  154. package/layers/support/{ParquetGeometryEncodingWkb.d.ts → GeometryEncodingWkb.d.ts} +8 -9
  155. package/layers/support/GeometryEncodingWkb.js +2 -0
  156. package/layers/support/kustoUtils.js +2 -0
  157. package/layers/support/parquetEncodingUtils.js +1 -1
  158. package/layers/support/parquetUtils.js +1 -1
  159. package/layers/support/types.d.ts +3 -3
  160. package/package.json +2 -2
  161. package/popup/Features.d.ts +10 -0
  162. package/popup/Features.js +1 -1
  163. package/rest/knowledgeGraph/GraphQueryStreamingResult.d.ts +4 -1
  164. package/support/revision.js +1 -1
  165. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  166. package/views/2d/FrameTask.js +1 -1
  167. package/views/2d/LabelManager.js +1 -1
  168. package/views/2d/ViewState.js +1 -1
  169. package/views/2d/engine/DisplayObject.js +1 -1
  170. package/views/2d/engine/Stage.js +1 -1
  171. package/views/2d/engine/flow/FlowContainer.js +1 -1
  172. package/views/2d/engine/flow/FlowView2D.js +1 -1
  173. package/views/2d/engine/flow/styles/AFlowResources.js +1 -1
  174. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  175. package/views/2d/engine/flow/styles/Particles.js +1 -1
  176. package/views/2d/engine/flow/styles/Stack.js +1 -1
  177. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  178. package/views/2d/engine/transitions/FadeTransition.js +1 -1
  179. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  180. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  181. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  182. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  183. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  184. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  185. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  186. package/views/2d/engine/webgl/ResizableUint32Array.js +2 -0
  187. package/views/2d/engine/webgl/TileCpuState.js +2 -0
  188. package/views/2d/engine/webgl/TileGpuState.js +2 -0
  189. package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +2 -0
  190. package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +2 -0
  191. package/views/2d/engine/webgl/cpuMapped/GpuMeshState.js +2 -0
  192. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  193. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugContainer.js +1 -1
  194. package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
  195. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
  196. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  197. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  198. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  199. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  200. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  201. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  202. package/views/2d/layers/KMLLayerView2D.js +1 -1
  203. package/views/2d/layers/LayerView2D.js +1 -1
  204. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  205. package/views/2d/layers/MediaLayerView2D.js +1 -1
  206. package/views/2d/layers/RouteLayerView2D.js +1 -1
  207. package/views/2d/layers/TileLayerView2D.js +1 -1
  208. package/views/2d/layers/features/FeatureContainer.js +1 -1
  209. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  210. package/views/2d/layers/features/FeatureTilePresentStrategy.js +2 -0
  211. package/views/2d/layers/features/Processor.js +1 -1
  212. package/views/2d/layers/features/RenderState.js +1 -1
  213. package/views/2d/layers/features/aggregation/AAggregateSpatialIndex.js +1 -1
  214. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  215. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  216. package/views/2d/layers/features/aggregation/GridIndexCell.js +2 -0
  217. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  218. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  219. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  220. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  221. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  222. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  223. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  224. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  225. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  226. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  227. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  228. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  229. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  230. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  231. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  232. package/views/2d/layers/features/sources/FeatureSourceMessage.js +1 -1
  233. package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
  234. package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
  235. package/views/2d/layers/features/support/Hashed.js +2 -0
  236. package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
  237. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  238. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  239. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  240. package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
  241. package/views/2d/support/hitTestUtils.js +1 -1
  242. package/views/2d/tiling/FeatureTileSubscriptionManager.js +1 -1
  243. package/views/2d/tiling/TileCombinedCoverage.js +2 -0
  244. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  245. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +2 -0
  246. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  247. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  248. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  249. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +2 -0
  250. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  251. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  252. package/views/3d/analysis/Viewshed/ViewshedTool2.js +2 -0
  253. package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +2 -0
  254. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  255. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  256. package/views/3d/environment/CloudyWeather.js +1 -1
  257. package/views/3d/environment/FoggyWeather.js +1 -1
  258. package/views/3d/environment/RainyWeather.js +1 -1
  259. package/views/3d/environment/SnowyWeather.js +1 -1
  260. package/views/3d/environment/SunnyWeather.js +1 -1
  261. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  262. package/views/3d/layers/graphics/StreamController.js +1 -1
  263. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  264. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  265. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  266. package/views/3d/webgl/ManagedColorAttachment.js +1 -1
  267. package/views/3d/webgl/ManagedDepthAttachment.js +1 -1
  268. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  269. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  270. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  271. package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
  272. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  273. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +11 -11
  274. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  275. package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
  276. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  277. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  278. package/views/3d/webgl-engine/effects/glow/Glow.js +2 -0
  279. package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
  280. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  281. package/views/3d/webgl-engine/effects/raymarching/{RayDistanceFalloff.glsl.js → DistanceFalloff.glsl.js} +2 -2
  282. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  283. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  284. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  285. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  286. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  287. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  288. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  289. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  290. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  291. package/views/3d/webgl-engine/lib/StencilUtils.js +1 -1
  292. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  293. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  294. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  295. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  296. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  297. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  298. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  299. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  300. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  301. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  302. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  303. package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
  304. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  305. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  306. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  307. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  308. package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -7
  309. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  310. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
  311. package/views/VideoView.js +1 -1
  312. package/views/View2D.js +1 -1
  313. package/views/draw/support/GraphicMover.js +1 -1
  314. package/views/support/rasterHitTestUtils.js +1 -1
  315. package/views/support/waitForResources.js +1 -1
  316. package/views/video/VideoOperationalDataView.js +1 -1
  317. package/views/webgl/FramebufferObject.js +1 -1
  318. package/views/webgl/RenderingContext.js +1 -1
  319. package/views/webgl/Texture.js +1 -1
  320. package/views/webgl/textureUtils.js +1 -1
  321. package/widgets/BatchAttributeForm/css.js +1 -1
  322. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.d.ts +61 -0
  323. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +2 -0
  324. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  325. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  326. package/widgets/BatchAttributeForm/inputs/types.d.ts +9 -4
  327. package/widgets/BatchAttributeForm/templates/UtilityNetworkAssociationsElementTemplate.js +2 -0
  328. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  329. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  330. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  331. package/widgets/BatchAttributeForm.js +1 -1
  332. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  333. package/widgets/FeatureTable/Grid/Column.d.ts +17 -2
  334. package/widgets/FeatureTable/Grid/Column.js +1 -1
  335. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  336. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  337. package/widgets/FeatureTable/Grid/GroupColumn.d.ts +7 -1
  338. package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
  339. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +9 -1
  340. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  341. package/widgets/FeatureTable/support/types.d.ts +8 -0
  342. package/widgets/FeatureTable.js +1 -1
  343. package/assets/esri/core/workers/chunks/2171aaa147aa4d9fc5b5.js +0 -1
  344. package/assets/esri/core/workers/chunks/38f1a86b8dd9ee684ee5.js +0 -596
  345. package/assets/esri/core/workers/chunks/54d07eadf113f0e4e506.js +0 -1
  346. package/assets/esri/core/workers/chunks/5818f1f526577068d6ca.js +0 -2
  347. package/assets/esri/core/workers/chunks/5ec66e39e53c11e75179.js +0 -2
  348. package/assets/esri/core/workers/chunks/5f6fd20a7f4e80eafa25.js +0 -1
  349. package/assets/esri/core/workers/chunks/6d2abdb48e17b2b56599.js +0 -1
  350. package/assets/esri/core/workers/chunks/7cdd0492b2191df95102.js +0 -2
  351. package/assets/esri/core/workers/chunks/7e530e635325dba07864.js +0 -1
  352. package/assets/esri/core/workers/chunks/8f4cd30ce23e41c1a42c.js +0 -1
  353. package/assets/esri/core/workers/chunks/936f2b1332ece14d7c28.js +0 -2
  354. package/assets/esri/core/workers/chunks/983f6c8727fd9484718e.js +0 -1
  355. package/assets/esri/core/workers/chunks/bd8cb64b6e08839398f3.js +0 -1
  356. package/assets/esri/core/workers/chunks/cbf1a03f54bd8d2a2b47.js +0 -1
  357. package/layers/support/ParquetGeometryEncodingWkb.js +0 -2
  358. package/views/2d/engine/webgl/PooledUint32Array.js +0 -2
  359. package/views/2d/engine/webgl/cpuMapped/Buffer.js +0 -2
  360. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +0 -2
  361. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +0 -2
  362. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DistanceFalloff.glsl.js +0 -4
  363. /package/assets/esri/core/workers/chunks/{5ec66e39e53c11e75179.js.LICENSE.txt → 577cbc131b21c351fae5.js.LICENSE.txt} +0 -0
  364. /package/assets/esri/core/workers/chunks/{ff713926985a284f5d81.js.LICENSE.txt → a844547bf33a8527ee9f.js.LICENSE.txt} +0 -0
  365. /package/assets/esri/core/workers/chunks/{5818f1f526577068d6ca.js.LICENSE.txt → bb5f909a2f26fc6a21b0.js.LICENSE.txt} +0 -0
  366. /package/assets/esri/core/workers/chunks/{7cdd0492b2191df95102.js.LICENSE.txt → ded2f19a1685db2137f4.js.LICENSE.txt} +0 -0
  367. /package/assets/esri/core/workers/chunks/{936f2b1332ece14d7c28.js.LICENSE.txt → ee057c85cdf6beb5b012.js.LICENSE.txt} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5408],{50867(t,e,i){i.d(e,{a:()=>s,b:()=>l,l:()=>h,n:()=>a,t:()=>o});var r=i(40876),n=(i(44208),i(72727));function s(t,e,i){o(t.typedBuffer,e.typedBuffer,i,t.typedBufferStride,e.typedBufferStride)}function o(t,e,i,r=4,s=r){const o=(0,n.k)(t.length,r,4),a=(0,n.k)(e.length,s,4),c=Math.min(o,a),h=i[0],l=i[1],u=i[2],d=i[3],p=i[4],f=i[5],m=i[6],g=i[7],_=i[8];let v=0,y=0;for(let i=0;i<c;i++){const i=e[v],n=e[v+1],o=e[v+2],a=e[v+3];t[y]=h*i+d*n+m*o,t[y+1]=l*i+p*n+g*o,t[y+2]=u*i+f*n+_*o,t[y+3]=a,v+=s,y+=r}}function a(t,e){const i=Math.min(t.count,e.count),r=t.typedBuffer,n=t.typedBufferStride,s=e.typedBuffer,o=e.typedBufferStride;for(let t=0;t<i;t++){const e=t*n,i=t*o,a=s[i],c=s[i+1],h=s[i+2],l=a*a+c*c+h*h;if(l>0){const t=1/Math.sqrt(l);r[e]=t*a,r[e+1]=t*c,r[e+2]=t*h}}}function c(t,e,i,r=4){const n=Math.min(t.length/r,e.count),s=e.typedBuffer,o=e.typedBufferStride;let a=0,c=0;for(let e=0;e<n;e++)t[c]=i*s[a],t[c+1]=i*s[a+1],t[c+2]=i*s[a+2],t[c+3]=i*s[a+3],a+=o,c+=r}function h(t,e,i,r){l(t.typedBuffer,e,i,r,t.typedBufferStride)}function l(t,e,i,n,s=4){const o=Math.min(t.length/s,e.count),a=e.typedBuffer,c=e.typedBufferStride;let h=0,l=0;const u=1/r.Tf;for(let e=0;e<o;e++)t[l]=n*(i*a[h])**u,t[l+1]=n*(i*a[h+1])**u,t[l+2]=n*(i*a[h+2])**u,t[l+3]=n*i*a[h+3],h+=c,l+=s}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:l,linearToSRGBView:h,normalize:a,scale:c,scaleView:function(t,e,i){c(t.typedBuffer,e,i,t.typedBufferStride)},transformMat3:o,transformMat3View:s,transformMat4:function(t,e,i,r=4,s=r){const o=(0,n.k)(t.length,r,4),a=(0,n.k)(e.length,s,4),c=Math.min(o,a),h=i[0],l=i[1],u=i[2],d=i[3],p=i[4],f=i[5],m=i[6],g=i[7],_=i[8],v=i[9],y=i[10],x=i[11],b=i[12],w=i[13],T=i[14],A=i[15];let M=0,S=0;for(let i=0;i<c;i++){const i=e[M],n=e[M+1],o=e[M+2],a=e[M+3];t[S]=h*i+p*n+_*o+b*a,t[S+1]=l*i+f*n+v*o+w*a,t[S+2]=u*i+m*n+y*o+T*a,t[S+3]=d*i+g*n+x*o+A*a,M+=s,S+=r}},transformMat4View:function(t,e,i){const r=t.typedBuffer,s=t.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride,c=(0,n.k)(r.length,s,4),h=(0,n.k)(o.length,a,4),l=Math.min(c,h),u=i[0],d=i[1],p=i[2],f=i[3],m=i[4],g=i[5],_=i[6],v=i[7],y=i[8],x=i[9],b=i[10],w=i[11],T=i[12],A=i[13],M=i[14],S=i[15];for(let t=0;t<l;t++){const e=t*s,i=t*a,n=o[i],c=o[i+1],h=o[i+2],l=o[i+3];r[e]=u*n+m*c+y*h+T*l,r[e+1]=d*n+g*c+x*h+A*l,r[e+2]=p*n+_*c+b*h+M*l,r[e+3]=f*n+v*c+w*h+S*l}}},Symbol.toStringTag,{value:"Module"}))},4341(t,e,i){i.d(e,{I:()=>n});var r=i(26390);class n{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,r.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*s);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,s));t++)this._items.push(this._allocator())}}const s=1024},97146(t,e,i){i.d(e,{Dg:()=>s,my:()=>o,tM:()=>l,uW:()=>n});var r=i(34275);function n(t){return s(t,!0)}function s(t,e){if(Array.isArray(t)){if(t.length<r.y9)return t}else if(t.length<r.y9)return Array.from(t);let i=!0,n=!0;return t.some((t,e)=>(i=i&&0===t,n=n&&t===e,!i&&!n)),i?function(t){if(1===t)return c;if(t<r.y9)return new Array(t).fill(0);if(t>d.length){const e=Math.max(2*d.length,t);d=new Uint8Array(e)}return new Uint8Array(d.buffer,0,t)}(t.length):n?l(t.length):(0,r.iu)(t)&&t.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?t:function(t,e){for(const i of t){if(i>=65536)return(0,r.iu)(t)?t:new Uint32Array(t);i>=256&&(e=!1)}return e?new Uint8Array(t):new Uint16Array(t)}(t,!e)}function o(t){return t<=r.y9?new Array(t):t<=65536?new Uint16Array(t):new Uint32Array(t)}let a=u(131072);const c=[0],h=(()=>{const t=new Uint16Array(65536);for(let e=0;e<t.length;++e)t[e]=e;return t})();function l(t){return 1===t?c:t<r.y9?Array.from(new Uint16Array(h.buffer,0,t)):t<h.length?new Uint16Array(h.buffer,0,t):(t>a.length&&(a=u(Math.max(2*a.length,t))),new Uint32Array(a.buffer,0,t))}function u(t){const e=new Uint32Array(t);for(let t=0;t<e.length;t++)e[t]=t;return e}let d=new Uint8Array(65536)},82919(t,e,i){i.d(e,{DV:()=>_,C:()=>m,vt:()=>p,Qy:()=>f,ui:()=>g,ST:()=>x,bU:()=>b,pw:()=>y,m7:()=>v,c8:()=>T});var r=i(4341),n=i(58083),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);function l(t){return t?{ray:(0,h.vt)(t.ray),c0:t.c0,c1:t.c1}:{ray:(0,h.vt)(),c0:0,c1:Number.MAX_VALUE}}new r.I(()=>l());var u=i(27921),d=i(32114);function p(t){return t?[(0,u.vt)(t[0]),(0,u.vt)(t[1]),(0,u.vt)(t[2]),(0,u.vt)(t[3]),(0,u.vt)(t[4]),(0,u.vt)(t[5])]:[(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)()]}function f(){return[(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)()]}function m(t,e){for(let i=0;i<A;i++)(0,u.C)(t[i],e[i]);return t}function g(t,e,i,r=E){const o=(0,n.lw)(d.Rc.get(),e,t);(0,n.B8)(o,o);for(let t=0;t<M;++t){const e=(0,a.Z0)(d.Km.get(),S[t],o);(0,s.hZ)(r[t],e[0]/e[3],e[1]/e[3],e[2]/e[3])}_(i,r)}function _(t,e){(0,u.Cr)(e[4],e[0],e[3],t[0]),(0,u.Cr)(e[1],e[5],e[6],t[1]),(0,u.Cr)(e[4],e[5],e[1],t[2]),(0,u.Cr)(e[3],e[2],e[6],t[3]),(0,u.Cr)(e[0],e[1],e[2],t[4]),(0,u.Cr)(e[5],e[4],e[7],t[5])}function v(t,e){for(let i=0;i<A;i++){const r=t[i];if(r[0]*e.center[0]+r[1]*e.center[1]+r[2]*e.center[2]+r[3]>=e.radius)return!1}return!0}function y(t,e){return w(t,function(t,e=l()){return(0,h.C)(t,e.ray),e.c0=0,e.c1=Number.MAX_VALUE,e}(e,C.get()))}function x(t,e,i){return w(t,function(t,e,i=l()){const r=(0,s.Bw)(t.vector);return(0,h.fA)(t.origin,e,i.ray),i.c0=0,i.c1=r,i}(e,i,C.get()))}function b(t,e){for(let i=0;i<A;i++)if((0,u.mN)(t[i],e)>0)return!1;return!0}function w(t,e){for(let i=0;i<A;i++)if(!(0,u.$Q)(t[i],e))return!1;return!0}const T={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},A=6,M=8,S=[(0,c.fA)(-1,-1,-1,1),(0,c.fA)(1,-1,-1,1),(0,c.fA)(1,1,-1,1),(0,c.fA)(-1,1,-1,1),(0,c.fA)(-1,-1,1,1),(0,c.fA)(1,-1,1,1),(0,c.fA)(1,1,1,1),(0,c.fA)(-1,1,1,1)],C=new r.I(l),E=f()},11964(t,e,i){i.d(e,{Cr:()=>l,G1:()=>p,LV:()=>h,_I:()=>d,kb:()=>u,ld:()=>f,vt:()=>c});var r=i(34727),n=i(4341),s=i(35522),o=i(51850),a=i(32114);function c(t){return t?{origin:(0,o.o8)(t.origin),vector:(0,o.o8)(t.vector)}:{origin:(0,o.vt)(),vector:(0,o.vt)()}}function h(t,e){const i=g.get();return i.origin=t,i.vector=e,i}function l(t,e,i=c()){return(0,s.C)(i.origin,t),(0,s.Re)(i.vector,e,t),i}function u(t,e){const i=(0,s.Re)(a.rq.get(),e,t.origin),n=(0,s.Om)(t.vector,i),o=(0,s.Om)(t.vector,t.vector),c=(0,r.qE)(n/o,0,1),h=(0,s.Re)(a.rq.get(),(0,s.hs)(a.rq.get(),t.vector,c),i);return(0,s.Om)(h,h)}function d(t,e,i){return function(t,e,i,n,o){const{vector:c,origin:h}=t,l=(0,s.Re)(a.rq.get(),e,h),u=(0,s.Om)(c,l)/(0,s.m3)(c);return(0,s.hs)(o,c,(0,r.qE)(u,0,1)),(0,s.WQ)(o,o,t.origin)}(t,e,0,0,i)}function p(t,e){const{vector:i,origin:n}=t,o=(0,s.Re)(a.rq.get(),e,n),c=(0,s.Om)(i,o)/(0,s.m3)(i);return(0,r.qE)(c,0,1)}function f(t,e,i){return!!function(t,e,i,n){const o=1e-6,c=t.origin,h=(0,s.WQ)(a.rq.get(),c,t.vector),l=e.origin,u=(0,s.WQ)(a.rq.get(),l,e.vector),d=a.rq.get(),p=a.rq.get();if(d[0]=c[0]-l[0],d[1]=c[1]-l[1],d[2]=c[2]-l[2],p[0]=u[0]-l[0],p[1]=u[1]-l[1],p[2]=u[2]-l[2],Math.abs(p[0])<o&&Math.abs(p[1])<o&&Math.abs(p[2])<o)return!1;const f=a.rq.get();if(f[0]=h[0]-c[0],f[1]=h[1]-c[1],f[2]=h[2]-c[2],Math.abs(f[0])<o&&Math.abs(f[1])<o&&Math.abs(f[2])<o)return!1;const m=d[0]*p[0]+d[1]*p[1]+d[2]*p[2],g=p[0]*f[0]+p[1]*f[1]+p[2]*f[2],_=d[0]*f[0]+d[1]*f[1]+d[2]*f[2],v=p[0]*p[0]+p[1]*p[1]+p[2]*p[2],y=(f[0]*f[0]+f[1]*f[1]+f[2]*f[2])*v-g*g;if(Math.abs(y)<o)return!1;let x=(m*g-_*v)/y,b=(m+g*x)/v;i&&(x=(0,r.qE)(x,0,1),b=(0,r.qE)(b,0,1));const w=a.rq.get(),T=a.rq.get();return w[0]=c[0]+x*f[0],w[1]=c[1]+x*f[1],w[2]=c[2]+x*f[2],T[0]=l[0]+b*p[0],T[1]=l[1]+b*p[1],T[2]=l[2]+b*p[2],n.tA=x,n.tB=b,n.pA=w,n.pB=T,n.distance2=(0,s.hG)(w,T),!0}(t,e,!0,m)&&((0,s.C)(i,m.pA),!0)}const m={tA:0,tB:0,pA:(0,o.vt)(),pB:(0,o.vt)(),distance2:0},g=new n.I(()=>c())},71351(t,e,i){i.d(e,{C:()=>l,Cr:()=>u,LV:()=>h,fA:()=>d,oC:()=>p,vt:()=>a}),i(4576);var r=i(4341),n=(i(77690),i(29242)),s=i(35522),o=i(51850);function a(t){return t?c((0,o.o8)(t.origin),(0,o.o8)(t.direction)):c((0,o.vt)(),(0,o.vt)())}function c(t,e){return{origin:t,direction:e}}function h(t,e){const i=f.get();return i.origin=t,i.direction=e,i}function l(t,e=a()){return d(t.origin,t.direction,e)}function u(t,e,i=a()){return(0,s.C)(i.origin,t),(0,s.Re)(i.direction,e,t),i}function d(t,e,i=a()){return(0,s.C)(i.origin,t),(0,s.C)(i.direction,e),i}function p(t,e,i){const r=(0,s.Om)(t.direction,(0,s.Re)(i,e,t.origin));return(0,s.WQ)(i,t.origin,(0,s.hs)(i,t.direction,r)),i}i(32114);const f=new r.I(()=>a());(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,n.vt)()},94008(t,e,i){i.d(e,{iy:()=>p}),i(44208),i(53966);var r=i(34727),n=i(34304),s=i(58083),o=i(35522),a=i(51850),c=i(91829),h=i(34275);var l=i(71351),u=i(44280),d=i(32114);class p{constructor(t=0,e=0,i=0,r=0){this.radius=r,"number"==typeof t?this._center=(0,a.fA)(t,e,i):function(t){return e=t,(0,h.vZ)(e)&&e.length>=3||function(t){return((0,h.aI)(t)||Array.isArray(t))&&t.length>=3}(t);var e}(t)||function(t){return(e=t)instanceof Float32Array&&e.length>=4||function(t){return Array.isArray(t)&&t.length>=4}(t);var e}(t)?(this._center=(0,a.ci)(t),this.radius=4===t.length?t[3]:e):(this._center=(0,a.o8)(t.center),this.radius=t.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(t){(0,o.C)(this.center,t)}exactEquals(t){return(0,o.aI)(this._center,t.center)&&this.radius===t.radius}copyFrom(t){return t!==this&&((0,o.C)(this._center,t.center),this.radius=t.radius),this}clone(){return new p(this.center,this.radius)}toVec4(){return(0,c.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return(0,o.hG)(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,f))return!1;let{t0:i,t1:r}=f;if((i<0||r<i&&r>0)&&(i=r),i<0)return!1;if(e){const{origin:r,direction:n}=t;e[0]=r[0]+n[0]*i,e[1]=r[1]+n[1]*i,e[2]=r[2]+n[2]*i}return!0}intersectLine(t,e){const i=(0,l.Cr)(t,e);if(!this._intersect(i,f))return[];const{origin:r,direction:s}=i,{t0:c,t1:h}=f,u=t=>{const e=(0,a.vt)();return(0,o.Ln)(e,r,s,t),this.projectPoint(e,e)};return Math.abs(c-h)<(0,n.FD)()?[u(c)]:[u(c),u(h)]}_intersect(t,e){const{origin:i,direction:r}=t,n=m;n[0]=i[0]-this.center[0],n[1]=i[1]-this.center[1],n[2]=i[2]-this.center[2];const s=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(0===s)return!1;const o=2*(r[0]*n[0]+r[1]*n[1]+r[2]*n[2]),a=o*o-4*s*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-this.radius**2);if(a<0)return!1;const c=Math.sqrt(a);return e.t0=(-o-c)/(2*s),e.t1=(-o+c)/(2*s),!0}projectPoint(t,e){const i=(0,o.Re)(d.rq.get(),t,this.center),r=(0,o.hs)(d.rq.get(),i,this.radius/(0,o.Bw)(i));return(0,o.WQ)(e,r,this.center)}closestPointOnSilhouette(t,e){const i=d.rq.get(),r=d.Rc.get();(0,o.$A)(i,t.origin,t.direction),(0,o.$A)(e,i,t.origin),(0,o.hs)(e,e,1/(0,o.Bw)(e)*this.radius);const n=this._angleToSilhouette(t.origin),a=(0,u.g7)(t.origin,e);return(0,s.$0)(r,a+n,i),(0,o.Z0)(e,e,r),e}frustumCoverage(t,e,i){const r=this.radius,n=r*r,s=t+.5*Math.PI,o=e*e+n-2*Math.cos(s)*e*r,a=Math.sqrt(o),c=o-n;if(c<=0)return.5;const h=Math.sqrt(c),l=Math.acos(h/a)-Math.asin(r/(a/Math.sin(s)));return Math.min(1,(l+.5*i)/i)}_angleToSilhouette(t){const e=(0,o.Re)(d.rq.get(),t,this.center),i=(0,o.Bw)(e),n=this.radius,s=n+Math.abs(n-i);return(0,r.XM)(n/s)}union(t){const e=(0,o.Io)(this._center,t.center),i=this.radius,r=t.radius;return e+r<i?this:e+i<r?(this.copyFrom(t),this):((0,o.Cc)(this._center,this._center,t.center,(e+r-i)/(2*e)),this.radius=(e+i+r)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(t){const{center:e,radius:i}=this,r=t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3];return r<0?Math.min(r+i,0):Math.max(r-i,0)}}new p;const f={t0:0,t1:0},m=(0,a.vt)();(0,a.vt)(),(0,a.vt)()},31217(t,e,i){i.d(e,{D:()=>n});var r=i(11254);async function n(t,e){return(await(0,r.A)(t,{responseType:"image",...e})).data}},26857(t,e,i){i.d(e,{b:()=>a});var r=i(5482),n=i(69622),s=i(91429);let o=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,r.Cg)([(0,s.MZ)()],o.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"LABELS_SHOW_BORDER",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"TEXT_SHOW_BASELINE",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"TEXT_SHOW_BORDER",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"SHOW_POI",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"LINE_WIREFRAMES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),o=(0,r.Cg)([(0,s.$K)("esri.views.3d.support.debugFlags")],o);const a=new o},29236(t,e,i){i.d(e,{y:()=>n});var r=i(31821);function n(t){const{fragment:e}=t;e.code.add(r.H`uint readChannelBits(uint channel, int highlightLevel) {
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5408],{50867(t,e,i){i.d(e,{a:()=>s,b:()=>l,l:()=>h,n:()=>a,t:()=>o});var r=i(40876),n=(i(44208),i(72727));function s(t,e,i){o(t.typedBuffer,e.typedBuffer,i,t.typedBufferStride,e.typedBufferStride)}function o(t,e,i,r=4,s=r){const o=(0,n.k)(t.length,r,4),a=(0,n.k)(e.length,s,4),c=Math.min(o,a),h=i[0],l=i[1],u=i[2],d=i[3],p=i[4],f=i[5],m=i[6],g=i[7],_=i[8];let v=0,y=0;for(let i=0;i<c;i++){const i=e[v],n=e[v+1],o=e[v+2],a=e[v+3];t[y]=h*i+d*n+m*o,t[y+1]=l*i+p*n+g*o,t[y+2]=u*i+f*n+_*o,t[y+3]=a,v+=s,y+=r}}function a(t,e){const i=Math.min(t.count,e.count),r=t.typedBuffer,n=t.typedBufferStride,s=e.typedBuffer,o=e.typedBufferStride;for(let t=0;t<i;t++){const e=t*n,i=t*o,a=s[i],c=s[i+1],h=s[i+2],l=a*a+c*c+h*h;if(l>0){const t=1/Math.sqrt(l);r[e]=t*a,r[e+1]=t*c,r[e+2]=t*h}}}function c(t,e,i,r=4){const n=Math.min(t.length/r,e.count),s=e.typedBuffer,o=e.typedBufferStride;let a=0,c=0;for(let e=0;e<n;e++)t[c]=i*s[a],t[c+1]=i*s[a+1],t[c+2]=i*s[a+2],t[c+3]=i*s[a+3],a+=o,c+=r}function h(t,e,i,r){l(t.typedBuffer,e,i,r,t.typedBufferStride)}function l(t,e,i,n,s=4){const o=Math.min(t.length/s,e.count),a=e.typedBuffer,c=e.typedBufferStride;let h=0,l=0;const u=1/r.Tf;for(let e=0;e<o;e++)t[l]=n*(i*a[h])**u,t[l+1]=n*(i*a[h+1])**u,t[l+2]=n*(i*a[h+2])**u,t[l+3]=n*i*a[h+3],h+=c,l+=s}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:l,linearToSRGBView:h,normalize:a,scale:c,scaleView:function(t,e,i){c(t.typedBuffer,e,i,t.typedBufferStride)},transformMat3:o,transformMat3View:s,transformMat4:function(t,e,i,r=4,s=r){const o=(0,n.k)(t.length,r,4),a=(0,n.k)(e.length,s,4),c=Math.min(o,a),h=i[0],l=i[1],u=i[2],d=i[3],p=i[4],f=i[5],m=i[6],g=i[7],_=i[8],v=i[9],y=i[10],x=i[11],b=i[12],w=i[13],T=i[14],A=i[15];let M=0,C=0;for(let i=0;i<c;i++){const i=e[M],n=e[M+1],o=e[M+2],a=e[M+3];t[C]=h*i+p*n+_*o+b*a,t[C+1]=l*i+f*n+v*o+w*a,t[C+2]=u*i+m*n+y*o+T*a,t[C+3]=d*i+g*n+x*o+A*a,M+=s,C+=r}},transformMat4View:function(t,e,i){const r=t.typedBuffer,s=t.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride,c=(0,n.k)(r.length,s,4),h=(0,n.k)(o.length,a,4),l=Math.min(c,h),u=i[0],d=i[1],p=i[2],f=i[3],m=i[4],g=i[5],_=i[6],v=i[7],y=i[8],x=i[9],b=i[10],w=i[11],T=i[12],A=i[13],M=i[14],C=i[15];for(let t=0;t<l;t++){const e=t*s,i=t*a,n=o[i],c=o[i+1],h=o[i+2],l=o[i+3];r[e]=u*n+m*c+y*h+T*l,r[e+1]=d*n+g*c+x*h+A*l,r[e+2]=p*n+_*c+b*h+M*l,r[e+3]=f*n+v*c+w*h+C*l}}},Symbol.toStringTag,{value:"Module"}))},4341(t,e,i){i.d(e,{I:()=>n});var r=i(26390);class n{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,r.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*s);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,s));t++)this._items.push(this._allocator())}}const s=1024},97146(t,e,i){i.d(e,{Dg:()=>s,my:()=>o,tM:()=>l,uW:()=>n});var r=i(34275);function n(t){return s(t,!0)}function s(t,e){if(Array.isArray(t)){if(t.length<r.y9)return t}else if(t.length<r.y9)return Array.from(t);let i=!0,n=!0;return t.some((t,e)=>(i=i&&0===t,n=n&&t===e,!i&&!n)),i?function(t){if(1===t)return c;if(t<r.y9)return new Array(t).fill(0);if(t>d.length){const e=Math.max(2*d.length,t);d=new Uint8Array(e)}return new Uint8Array(d.buffer,0,t)}(t.length):n?l(t.length):(0,r.iu)(t)&&t.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?t:function(t,e){for(const i of t){if(i>=65536)return(0,r.iu)(t)?t:new Uint32Array(t);i>=256&&(e=!1)}return e?new Uint8Array(t):new Uint16Array(t)}(t,!e)}function o(t){return t<=r.y9?new Array(t):t<=65536?new Uint16Array(t):new Uint32Array(t)}let a=u(131072);const c=[0],h=(()=>{const t=new Uint16Array(65536);for(let e=0;e<t.length;++e)t[e]=e;return t})();function l(t){return 1===t?c:t<r.y9?Array.from(new Uint16Array(h.buffer,0,t)):t<h.length?new Uint16Array(h.buffer,0,t):(t>a.length&&(a=u(Math.max(2*a.length,t))),new Uint32Array(a.buffer,0,t))}function u(t){const e=new Uint32Array(t);for(let t=0;t<e.length;t++)e[t]=t;return e}let d=new Uint8Array(65536)},82919(t,e,i){i.d(e,{DV:()=>_,C:()=>m,vt:()=>p,Qy:()=>f,ui:()=>g,ST:()=>x,bU:()=>b,pw:()=>y,m7:()=>v,c8:()=>T});var r=i(4341),n=i(58083),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);function l(t){return t?{ray:(0,h.vt)(t.ray),c0:t.c0,c1:t.c1}:{ray:(0,h.vt)(),c0:0,c1:Number.MAX_VALUE}}new r.I(()=>l());var u=i(27921),d=i(32114);function p(t){return t?[(0,u.vt)(t[0]),(0,u.vt)(t[1]),(0,u.vt)(t[2]),(0,u.vt)(t[3]),(0,u.vt)(t[4]),(0,u.vt)(t[5])]:[(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)()]}function f(){return[(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)()]}function m(t,e){for(let i=0;i<A;i++)(0,u.C)(t[i],e[i]);return t}function g(t,e,i,r=E){const o=(0,n.lw)(d.Rc.get(),e,t);(0,n.B8)(o,o);for(let t=0;t<M;++t){const e=(0,a.Z0)(d.Km.get(),C[t],o);(0,s.hZ)(r[t],e[0]/e[3],e[1]/e[3],e[2]/e[3])}_(i,r)}function _(t,e){(0,u.Cr)(e[4],e[0],e[3],t[0]),(0,u.Cr)(e[1],e[5],e[6],t[1]),(0,u.Cr)(e[4],e[5],e[1],t[2]),(0,u.Cr)(e[3],e[2],e[6],t[3]),(0,u.Cr)(e[0],e[1],e[2],t[4]),(0,u.Cr)(e[5],e[4],e[7],t[5])}function v(t,e){for(let i=0;i<A;i++){const r=t[i];if(r[0]*e.center[0]+r[1]*e.center[1]+r[2]*e.center[2]+r[3]>=e.radius)return!1}return!0}function y(t,e){return w(t,function(t,e=l()){return(0,h.C)(t,e.ray),e.c0=0,e.c1=Number.MAX_VALUE,e}(e,S.get()))}function x(t,e,i){return w(t,function(t,e,i=l()){const r=(0,s.Bw)(t.vector);return(0,h.fA)(t.origin,e,i.ray),i.c0=0,i.c1=r,i}(e,i,S.get()))}function b(t,e){for(let i=0;i<A;i++)if((0,u.mN)(t[i],e)>0)return!1;return!0}function w(t,e){for(let i=0;i<A;i++)if(!(0,u.$Q)(t[i],e))return!1;return!0}const T={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},A=6,M=8,C=[(0,c.fA)(-1,-1,-1,1),(0,c.fA)(1,-1,-1,1),(0,c.fA)(1,1,-1,1),(0,c.fA)(-1,1,-1,1),(0,c.fA)(-1,-1,1,1),(0,c.fA)(1,-1,1,1),(0,c.fA)(1,1,1,1),(0,c.fA)(-1,1,1,1)],S=new r.I(l),E=f()},11964(t,e,i){i.d(e,{Cr:()=>l,G1:()=>p,LV:()=>h,_I:()=>d,kb:()=>u,ld:()=>f,vt:()=>c});var r=i(34727),n=i(4341),s=i(35522),o=i(51850),a=i(32114);function c(t){return t?{origin:(0,o.o8)(t.origin),vector:(0,o.o8)(t.vector)}:{origin:(0,o.vt)(),vector:(0,o.vt)()}}function h(t,e){const i=g.get();return i.origin=t,i.vector=e,i}function l(t,e,i=c()){return(0,s.C)(i.origin,t),(0,s.Re)(i.vector,e,t),i}function u(t,e){const i=(0,s.Re)(a.rq.get(),e,t.origin),n=(0,s.Om)(t.vector,i),o=(0,s.Om)(t.vector,t.vector),c=(0,r.qE)(n/o,0,1),h=(0,s.Re)(a.rq.get(),(0,s.hs)(a.rq.get(),t.vector,c),i);return(0,s.Om)(h,h)}function d(t,e,i){return function(t,e,i,n,o){const{vector:c,origin:h}=t,l=(0,s.Re)(a.rq.get(),e,h),u=(0,s.Om)(c,l)/(0,s.m3)(c);return(0,s.hs)(o,c,(0,r.qE)(u,0,1)),(0,s.WQ)(o,o,t.origin)}(t,e,0,0,i)}function p(t,e){const{vector:i,origin:n}=t,o=(0,s.Re)(a.rq.get(),e,n),c=(0,s.Om)(i,o)/(0,s.m3)(i);return(0,r.qE)(c,0,1)}function f(t,e,i){return!!function(t,e,i,n){const o=1e-6,c=t.origin,h=(0,s.WQ)(a.rq.get(),c,t.vector),l=e.origin,u=(0,s.WQ)(a.rq.get(),l,e.vector),d=a.rq.get(),p=a.rq.get();if(d[0]=c[0]-l[0],d[1]=c[1]-l[1],d[2]=c[2]-l[2],p[0]=u[0]-l[0],p[1]=u[1]-l[1],p[2]=u[2]-l[2],Math.abs(p[0])<o&&Math.abs(p[1])<o&&Math.abs(p[2])<o)return!1;const f=a.rq.get();if(f[0]=h[0]-c[0],f[1]=h[1]-c[1],f[2]=h[2]-c[2],Math.abs(f[0])<o&&Math.abs(f[1])<o&&Math.abs(f[2])<o)return!1;const m=d[0]*p[0]+d[1]*p[1]+d[2]*p[2],g=p[0]*f[0]+p[1]*f[1]+p[2]*f[2],_=d[0]*f[0]+d[1]*f[1]+d[2]*f[2],v=p[0]*p[0]+p[1]*p[1]+p[2]*p[2],y=(f[0]*f[0]+f[1]*f[1]+f[2]*f[2])*v-g*g;if(Math.abs(y)<o)return!1;let x=(m*g-_*v)/y,b=(m+g*x)/v;i&&(x=(0,r.qE)(x,0,1),b=(0,r.qE)(b,0,1));const w=a.rq.get(),T=a.rq.get();return w[0]=c[0]+x*f[0],w[1]=c[1]+x*f[1],w[2]=c[2]+x*f[2],T[0]=l[0]+b*p[0],T[1]=l[1]+b*p[1],T[2]=l[2]+b*p[2],n.tA=x,n.tB=b,n.pA=w,n.pB=T,n.distance2=(0,s.hG)(w,T),!0}(t,e,!0,m)&&((0,s.C)(i,m.pA),!0)}const m={tA:0,tB:0,pA:(0,o.vt)(),pB:(0,o.vt)(),distance2:0},g=new n.I(()=>c())},71351(t,e,i){i.d(e,{C:()=>l,Cr:()=>u,LV:()=>h,fA:()=>d,oC:()=>p,vt:()=>a}),i(4576);var r=i(4341),n=(i(77690),i(29242)),s=i(35522),o=i(51850);function a(t){return t?c((0,o.o8)(t.origin),(0,o.o8)(t.direction)):c((0,o.vt)(),(0,o.vt)())}function c(t,e){return{origin:t,direction:e}}function h(t,e){const i=f.get();return i.origin=t,i.direction=e,i}function l(t,e=a()){return d(t.origin,t.direction,e)}function u(t,e,i=a()){return(0,s.C)(i.origin,t),(0,s.Re)(i.direction,e,t),i}function d(t,e,i=a()){return(0,s.C)(i.origin,t),(0,s.C)(i.direction,e),i}function p(t,e,i){const r=(0,s.Om)(t.direction,(0,s.Re)(i,e,t.origin));return(0,s.WQ)(i,t.origin,(0,s.hs)(i,t.direction,r)),i}i(32114);const f=new r.I(()=>a());(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,n.vt)()},94008(t,e,i){i.d(e,{iy:()=>p}),i(44208),i(53966);var r=i(34727),n=i(34304),s=i(58083),o=i(35522),a=i(51850),c=i(91829),h=i(34275);var l=i(71351),u=i(44280),d=i(32114);class p{constructor(t=0,e=0,i=0,r=0){this.radius=r,"number"==typeof t?this._center=(0,a.fA)(t,e,i):function(t){return e=t,(0,h.vZ)(e)&&e.length>=3||function(t){return((0,h.aI)(t)||Array.isArray(t))&&t.length>=3}(t);var e}(t)||function(t){return(e=t)instanceof Float32Array&&e.length>=4||function(t){return Array.isArray(t)&&t.length>=4}(t);var e}(t)?(this._center=(0,a.ci)(t),this.radius=4===t.length?t[3]:e):(this._center=(0,a.o8)(t.center),this.radius=t.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(t){(0,o.C)(this.center,t)}exactEquals(t){return(0,o.aI)(this._center,t.center)&&this.radius===t.radius}copyFrom(t){return t!==this&&((0,o.C)(this._center,t.center),this.radius=t.radius),this}clone(){return new p(this.center,this.radius)}toVec4(){return(0,c.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return(0,o.hG)(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,f))return!1;let{t0:i,t1:r}=f;if((i<0||r<i&&r>0)&&(i=r),i<0)return!1;if(e){const{origin:r,direction:n}=t;e[0]=r[0]+n[0]*i,e[1]=r[1]+n[1]*i,e[2]=r[2]+n[2]*i}return!0}intersectLine(t,e){const i=(0,l.Cr)(t,e);if(!this._intersect(i,f))return[];const{origin:r,direction:s}=i,{t0:c,t1:h}=f,u=t=>{const e=(0,a.vt)();return(0,o.Ln)(e,r,s,t),this.projectPoint(e,e)};return Math.abs(c-h)<(0,n.FD)()?[u(c)]:[u(c),u(h)]}_intersect(t,e){const{origin:i,direction:r}=t,n=m;n[0]=i[0]-this.center[0],n[1]=i[1]-this.center[1],n[2]=i[2]-this.center[2];const s=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(0===s)return!1;const o=2*(r[0]*n[0]+r[1]*n[1]+r[2]*n[2]),a=o*o-4*s*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-this.radius**2);if(a<0)return!1;const c=Math.sqrt(a);return e.t0=(-o-c)/(2*s),e.t1=(-o+c)/(2*s),!0}projectPoint(t,e){const i=(0,o.Re)(d.rq.get(),t,this.center),r=(0,o.hs)(d.rq.get(),i,this.radius/(0,o.Bw)(i));return(0,o.WQ)(e,r,this.center)}closestPointOnSilhouette(t,e){const i=d.rq.get(),r=d.Rc.get();(0,o.$A)(i,t.origin,t.direction),(0,o.$A)(e,i,t.origin),(0,o.hs)(e,e,1/(0,o.Bw)(e)*this.radius);const n=this._angleToSilhouette(t.origin),a=(0,u.g7)(t.origin,e);return(0,s.$0)(r,a+n,i),(0,o.Z0)(e,e,r),e}frustumCoverage(t,e,i){const r=this.radius,n=r*r,s=t+.5*Math.PI,o=e*e+n-2*Math.cos(s)*e*r,a=Math.sqrt(o),c=o-n;if(c<=0)return.5;const h=Math.sqrt(c),l=Math.acos(h/a)-Math.asin(r/(a/Math.sin(s)));return Math.min(1,(l+.5*i)/i)}_angleToSilhouette(t){const e=(0,o.Re)(d.rq.get(),t,this.center),i=(0,o.Bw)(e),n=this.radius,s=n+Math.abs(n-i);return(0,r.XM)(n/s)}union(t){const e=(0,o.Io)(this._center,t.center),i=this.radius,r=t.radius;return e+r<i?this:e+i<r?(this.copyFrom(t),this):((0,o.Cc)(this._center,this._center,t.center,(e+r-i)/(2*e)),this.radius=(e+i+r)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(t){const{center:e,radius:i}=this,r=t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3];return r<0?Math.min(r+i,0):Math.max(r-i,0)}}new p;const f={t0:0,t1:0},m=(0,a.vt)();(0,a.vt)(),(0,a.vt)()},31217(t,e,i){i.d(e,{D:()=>n});var r=i(11254);async function n(t,e){return(await(0,r.A)(t,{responseType:"image",...e})).data}},26857(t,e,i){i.d(e,{b:()=>a});var r=i(5482),n=i(69622),s=i(91429);let o=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,r.Cg)([(0,s.MZ)()],o.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"LABELS_SHOW_BORDER",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"TEXT_SHOW_BASELINE",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"TEXT_SHOW_BORDER",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"SHOW_POI",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"LINE_WIREFRAMES",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),o=(0,r.Cg)([(0,s.$K)("esri.views.3d.support.debugFlags")],o);const a=new o},29236(t,e,i){i.d(e,{y:()=>n});var r=i(31821);function n(t){const{fragment:e}=t;e.code.add(r.H`uint readChannelBits(uint channel, int highlightLevel) {
2
2
  int llc = (highlightLevel & 3) << 1;
3
3
  return (channel >> llc) & 3u;
4
4
  }
@@ -246,7 +246,7 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
246
246
  return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
247
247
  }`),t.vertex.code.add(o.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
248
248
  return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
249
- }`)}function c(t){t.uniforms.add(new s.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new s.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,n.vt)()},77949(t,e,i){i.d(e,{NB:()=>p,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,s.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function p(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(f,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,s.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(f,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const f=(0,n.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,n)=>r.setUniform2fv(t,e(n),i))}}},68259(t,e,i){i.d(e,{t:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,n,s,o)=>r.setUniform2fv(t,e(n,s,o),i))}}},47286(t,e,i){i.d(e,{G:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,n,s)=>r.setUniform2fv(t,e(n,s),i))}}},23205(t,e,i){i.d(e,{d:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,n)=>r.setUniform3fv(t,e(n),i))}}},14314(t,e,i){i.d(e,{I:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,n)=>r.setUniform4fv(t,e(n),i))}}},71988(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,n,s)=>r.setUniform4fv(t,e(n,s),i))}}},33094(t,e,i){i.d(e,{U:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"float",0,(r,n)=>r.setUniform1f(t,e(n),i))}}},44887(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,n,s)=>e.setUniform1fv(t,i(n,s),r),e)}}},35818(t,e,i){i.d(e,{W:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",1,(i,r,n)=>i.setUniform1i(t,e(r,n)))}}},35644(t,e,i){i.d(e,{k:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,n,s)=>r.setUniformMatrix3fv(t,e(n,s),i))}}},58029(t,e,i){i.d(e,{F:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,n)=>r.setUniformMatrix4fv(t,e(n),i))}}},97102(t,e,i){i.d(e,{S:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,n,s)=>r.setUniformMatrix4fv(t,e(n,s),i))}}},12791(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>f});var r=i(5482),n=i(69622),s=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||s.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const n=r.unit;this.setUniform1i(t,n),this._context.bindTexture(e,n,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),p=i(85079);let f=class extends n.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,p.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void s.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};f=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},51976(t,e,i){i.d(e,{K:()=>a,W:()=>c});var r=i(49186),n=i(4576);class s{constructor(t){this._bits=[...t]}equals(t){return(0,n.aI)(this._bits,t.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var o=i(65786);class a extends o.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new s(this._parameterBits),this._key}decode(t=this.key){const e=this._parameterBits;this._parameterBits=[...t.bits];const i=this._parameterNames.map(t=>` ${t}: ${this[t]}`).join("\n");return this._parameterBits=e,i}}function c(t={}){return(e,i)=>{e.hasOwnProperty("_parameterNames")||Object.defineProperty(e,"_parameterNames",{value:e._parameterNames?.slice()??[],configurable:!0,writable:!0}),e.hasOwnProperty("_parameterBits")||Object.defineProperty(e,"_parameterBits",{value:e._parameterBits?.slice()??[0],configurable:!0,writable:!0}),e._parameterNames.push(i);const n=t.count||2,s=Math.ceil(Math.log2(n)),o=e._parameterBits;let a=0;for(;o[a]+s>16;)a++,a>=o.length&&o.push(0);const c=o[a],h=(1<<s)-1<<c;o[a]+=s,t.count?Object.defineProperty(e,i,{get(){return(this._parameterBits[a]&h)>>c},set(e){const n=this._parameterBits[a];if((n&h)>>c!==e){if(this._key=null,this._parameterBits[a]=n&~h|+e<<c&h,"number"!=typeof e)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must be a number, got ${typeof e}`);if(null==t.count)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must provide a count option`)}}}):Object.defineProperty(e,i,{get(){return!!((this._parameterBits[a]&h)>>c)},set(t){const e=this._parameterBits[a];if(!!((e&h)>>c)!==t&&(this._key=null,this._parameterBits[a]=e&~h|+t<<c,"boolean"!=typeof t))throw new r.A("internal:invalid-shader-configurationx",`Configuration value for ${i} must be boolean, got ${typeof t}`)}})}}},16943(t,e,i){i.d(e,{E:()=>n});var r=i(44208);function n(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){i.d(e,{lK:()=>a,wR:()=>o});var r=i(63907),n=i(85079),s=i(74038);const o=[],a=(new s._("position",3,r.pe.FLOAT,0,12),[new s._("position",2,r.pe.FLOAT,0,8)]);(0,n.Xk)(a),new s._("position",2,r.pe.FLOAT,0,12),new s._("uv0",2,r.pe.HALF_FLOAT,8,12),new s._("position",2,r.pe.FLOAT,0,16),new s._("uv0",2,r.pe.FLOAT,8,16)},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},63500(t,e,i){i.d(e,{V:()=>E});var r=i(9093),n=i(35522),s=i(97146),o=i(46610),a=i(34275),c=i(20498);function h(t){if(t.length<a.y9)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,a.LW)(t)?(0,c.pX)().from(t):(0,a.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return Float32Array.from(t);default:return Float64Array.from(t)}}var l=i(15142),u=i(51850),d=i(620);class p{get center(){return(0,u.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,u.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,u.fA)(this._data[7],this._data[8],this._data[9])}constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=i,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,d.vA)(t.length>=1),(0,d.vA)(3===i.size||4===i.size);const{data:r,size:s,indices:o}=i;(0,d.vA)(o.length%this._numIndexPerPrimitive===0),(0,d.vA)(o.length>=t.length*this._numIndexPerPrimitive);const a=t.length;let c=s*o[this._numIndexPerPrimitive*t[0]];f.clear(),f.push(c);const h=(0,u.fA)(r[c],r[c+1],r[c+2]),l=(0,u.o8)(h);for(let e=0;e<a;++e){const i=this._numIndexPerPrimitive*t[e];for(let t=0;t<this._numIndexPerPrimitive;++t){c=s*o[i+t],f.push(c);let e=r[c];h[0]=Math.min(e,h[0]),l[0]=Math.max(e,l[0]),e=r[c+1],h[1]=Math.min(e,h[1]),l[1]=Math.max(e,l[1]),e=r[c+2],h[2]=Math.min(e,h[2]),l[2]=Math.max(e,l[2])}}for(let t=0;t<3;++t)this._data[4+t]=h[t],this._data[7+t]=l[t];const p=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-h[0],l[1]-h[1]),l[2]-h[2]),g=m*m;for(let t=0;t<f.length;++t){c=f.at(t);const e=r[c]-p[0],i=r[c+1]-p[1],n=r[c+2]-p[2],s=e*e+i*i+n*n;if(s<=g)continue;const o=Math.sqrt(s),a=.5*(o-m);m+=a,g=m*m;const h=a/o;p[0]+=e*h,p[1]+=i*h,p[2]+=n*h}this._data[3]=m;for(let t=0;t<3;++t)this._data[0+t]=p[t];f.clear()}getChildren(){if(this._children||(0,n.hG)(this.bbMin,this.bbMax)<=1)return this._children;const t=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5),e=this.primitiveIndices.length,i=new Uint8Array(e),r=new Array(8);for(let t=0;t<8;++t)r[t]=0;const{data:s,size:o,indices:a}=this.position;for(let n=0;n<e;++n){let e=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[n];let h=o*a[c],l=s[h],u=s[h+1],d=s[h+2];for(let t=1;t<this._numIndexPerPrimitive;++t){h=o*a[c+t];const e=s[h],i=s[h+1],r=s[h+2];e<l&&(l=e),i<u&&(u=i),r<d&&(d=r)}l<t[0]&&(e|=1),u<t[1]&&(e|=2),d<t[2]&&(e|=4),i[n]=e,++r[e]}let c=0;for(let t=0;t<8;++t)r[t]>0&&++c;if(c<2)return;const h=new Array(8);for(let t=0;t<8;++t)h[t]=r[t]>0?new Uint32Array(r[t]):void 0;for(let t=0;t<8;++t)r[t]=0;for(let t=0;t<e;++t){const e=i[t];h[e][r[e]++]=this.primitiveIndices[t]}this._children=new Array;for(let t=0;t<8;++t)void 0!==h[t]&&this._children.push(new p(h[t],this._numIndexPerPrimitive,this.position));return this._children}static prune(){f.prune()}}const f=new l.A({deallocator:null});var m=i(24326);class g{constructor(t){this.id=(0,m.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,s.Dg)(i.indices)})}get attributes(){return this._attributes}}var _=i(4341),v=i(11964);function y(t,e,i){return(0,n.Re)(x,e,t),(0,n.Re)(b,i,t),.5*(0,n.Bw)((0,n.$A)(x,x,b))}i(32114),new _.I(v.vt),new _.I(()=>{return t?{p0:(0,u.o8)(t.p0),p1:(0,u.o8)(t.p1),p2:(0,u.o8)(t.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var t});const x=(0,u.vt)(),b=(0,u.vt)(),w=(0,u.vt)(),T=(0,u.vt)(),A=(0,u.vt)(),M=(0,u.vt)();var S=i(17478),C=i(94656);class E extends g{constructor(t,e,i=null,r=0,n=null,s=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=n,this.edgeIndicesLength=s,this.baseGeometry=o,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,d.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const c=this.positionAttribute;null!=c&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=c.indices.length)}instantiate(t={}){const e=new E(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:h(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const i=this._attributes.get(t);i?this._attributes.set(t,{...i,exclusive:!0,data:e}):(0,C.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);this._vertexPositionIndicesCache=i}else this._vertexPositionIndicesCache=e?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!(0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&(0,n.Z0)(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0),(0,n.hZ)(M,0,0,0);let o=0,a=0;for(let e=0;e<i.length-2;e+=3){const c=i[e]*r,h=i[e+1]*r,l=i[e+2]*r;(0,n.hZ)(w,s[c],s[c+1],s[c+2]),(0,n.hZ)(T,s[h],s[h+1],s[h+2]),(0,n.hZ)(A,s[l],s[l+1],s[l+2]);const u=y(w,T,A);u?((0,n.WQ)(w,w,T),(0,n.WQ)(w,w,A),(0,n.hs)(w,w,1/3*u),(0,n.WQ)(t,t,w),o+=u):((0,n.WQ)(M,M,w),(0,n.WQ)(M,M,T),(0,n.WQ)(M,M,A),a+=3)}return!(0===a&&0===o||(0!==o?((0,n.hs)(t,t,1/o),0):0===a||((0,n.hs)(t,M,1/a),0)))}(t,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(t){const e=this.positionAttribute,i=this.primitivePositionIndices;return function(t,e,i,r=e?.indices){if(!e||!r)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(M,0,0,0);let s=0,o=0;const{size:a,data:c}=e,h=r.length-1,l=h+(i?2:0);for(let e=0;e<l;e+=2){const i=e<h?e+1:0,l=r[e<h?e:h]*a,u=r[i]*a;w[0]=c[l],w[1]=c[l+1],w[2]=c[l+2],T[0]=c[u],T[1]=c[u+1],T[2]=c[u+2],(0,n.hs)(w,(0,n.WQ)(w,w,T),.5);const d=(0,n.xg)(w,T);d>0?((0,n.WQ)(t,t,(0,n.hs)(w,w,d)),s+=d):0===s&&((0,n.WQ)(M,M,w),o++)}return 0!==s?((0,n.hs)(t,t,1/s),!0):0!==o&&((0,n.hs)(t,M,1/o),!0)}(t,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}(this.material.parameters,e),i)}_computeAttachmentOriginPoints(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0);let o=-1,a=0;for(let e=0;e<i.length;e++){const n=i[e]*r;o!==n&&(t[0]+=s[n],t[1]+=s[n+1],t[2]+=s[n+2],a++),o=n}return a>1&&(0,n.hs)(t,t,1/a),a>0}(t,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.primitivePositionIndices;if(!t||!e||0===e.length)return null;const i=e===t.indices?t:new o.n(t.data,e,t.size,!1,t.stride),r=0===this.type?3:1;(0,d.vA)(e.length%r===0,"Indexing error: "+e.length+" not divisible by "+r);const n=(0,s.tM)(e.length/r);return new p(n,r,i)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||R}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new S.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const R=new Set},49718(t,e,i){i(51850),i(6867).i},6867(t,e,i){i.d(e,{i:()=>l});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,s.hs)(d,this.ray.direction,this.distance),(0,s.Bw)(d))}withinDistance(t){return!!u(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!u(this)&&((0,s.hs)(d,this.ray.direction,this.distance),(0,s.WQ)(t,this.ray.origin,d),!0)}getTransformedNormal(t){return(0,s.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,s.C)(t,p),(0,s.S8)(t,t)}constructor(t){this.intersector=4,this.normal=(0,o.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this.intersector=t,this.distance=i,(0,s.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??n.zK),this.target=e,this.drapedLayerOrder=h,this.renderPriority=l}copy(t){(0,h.C)(t.ray,this._ray),this.intersector=t.intersector,this.distance=t.distance,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.renderPriority=t.renderPriority,(0,s.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function u(t){return null!=t?.distance}const d=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>L});var r=i(49186),n=i(65529),s=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),p=i(2741);let f;var m=i(63907),g=i(76284),_=i(42293);let v=null,y=null;async function x(){return null==y&&(f??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),y=f,v=await y),y}function b(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=A(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=M(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,n){const s=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function A(t){return t.getNumImages()>=1&&!t.isUASTC()}function M(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function S(t,e,i,r,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(o(t,l))),a(t,l,p[t]);return e.internalFormat=u,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=n,e.height=s,new g.A(t,e,{type:"compressed",levels:p})}var C=i(53966);const E=()=>C.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),O=R("DXT3"),D=R("DXT5");function P(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let n,s;switch(r){case I:n=8,s=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case D:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let p=t.byteOffset+i[1]+4;const f=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*n,u=new Uint8Array(t.buffer,p,d),f.push(u),p+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:s,width:h,height:l}}var F=i(78988),B=i(620),N=i(67171);class L{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new n.bk,this._parameters={...H,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new N.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?b(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?U(t):e,n=e.pixelFormat??6408,s=(0,_.wH)(n);return(e.mipmap?4/3:1)*i*r*s||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=P(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=r;return e.samplingMode=n.levels.length>1?9987:9729,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new g.A(t,e,n)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.KTX2File(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const n=S(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.BasisFile(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const n=S(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,B.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((n,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,s.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,F.vM)(i,t.parameters));const r=U(i);this._parameters.width=r.width,this._parameters.height=r.height;const n=this._createDescriptor(t);return n.width=r.width,n.height=r.height,n.compress=this._parameters.compressionOptions,this._texture=new g.A(t,n,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function U(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const H={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),n=i(49255),s=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,s.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,s.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,n._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value,this._configuration.emissionDimmingPass=t.transparentWithoutDepthEmissionDimmingPass&&(0,n._o)(t.output)}}o.Y},17478(t,e,i){i.d(e,{h:()=>s,p:()=>o});var r=i(24326);class n{constructor(){this.uid=(0,r.c)()}}class s extends n{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends n{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>o,mt:()=>c,z5:()=>a});var r=i(49255),n=i(90644);const s=(0,n.p3)(1,0,1,771);function o(t,e=!1,i=!1){if(i)return n.uR;switch(t){case 0:return e?n.RC:n.T8;case 1:return s;default:return null}}function a(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?n.Uy:null;case 1:return null}}function c(t,e=513){return{func:(0,r.Sp)(t)?515:e}}},56133(t,e,i){i.d(e,{I$:()=>l,a9:()=>h,m:()=>n,mK:()=>u,qh:()=>c,r8:()=>a,sf:()=>s,v0:()=>o});var r=i(90644);const n={func:513},s={func:519},o={mask:255},a={mask:0},c=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),h=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681}),l=(0,r.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),u=(0,r.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680})},77194(t,e,i){i.d(e,{PS:()=>n}),i(44208);var r=i(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:n}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),n,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>n,vM:()=>s});var r=i(49186);function n(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function s(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const s=Math.max(t,e),o=t*e;if(s<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/s);return[n(Math.round(t*a),r),n(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const n=document.createElement("canvas");return n.width=e,n.height=i,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),n=i(51850),s=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,n.vt)(),this._tmpSphere=new s.iy}applyToVertex(t,e,i){const n=this.objectTransform.transform,s=(0,r.hZ)(h,t,e,i),o=(0,r.Z0)(s,s,n),a=this.offset/(0,r.Bw)(o);(0,r.Ln)(o,o,o,a);const c=this.objectTransform.inverse;return(0,r.Z0)(this.tmpVertex,o,c),this.tmpVertex}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const n=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,n)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),n=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,n),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=new s.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i){const n=(0,r.hZ)(h,t,e,i),s=(0,r.hZ)(l,t,e,i+this.componentLocalOriginLength),o=this._totalOffset/(0,r.Bw)(s);return(0,r.Ln)(this._tmpVertex,n,s,o),this._tmpVertex}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],n=t[2]+e,s=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(n),u=Math.abs(s),d=Math.abs(o),p=Math.abs(a),f=.5*(1+Math.sign(i*s))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(n*a))*Math.min(l,p),_=Math.max(c,u),v=Math.max(h,d),y=Math.max(l,p),x=Math.sqrt(f*f+m*m+g*g),b=Math.sign(c+i),w=Math.sign(h+r),T=Math.sign(l+n),A=Math.sign(u+s),M=Math.sign(d+o),S=Math.sign(p+a),C=this._totalOffset;if(x<C)return t[0]-=(1-b)*C,t[1]-=(1-w)*C,t[2]-=(1-T)*C,t[3]+=A*C,t[4]+=M*C,t[5]+=S*C,t;const E=C/Math.sqrt(_*_+v*v+y*y),R=C/x,I=R-E,O=-I;return t[0]+=i*(b*O+R),t[1]+=r*(w*O+R),t[2]+=n*(T*O+R),t[3]+=s*(A*I+E),t[4]+=o*(M*I+E),t[5]+=a*(S*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),n=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,n),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,n.vt)()}applyToVertex(t,e,i){const n=(0,r.hZ)(h,t,e,i),s=(0,r.WQ)(l,n,this.localOrigin),o=this.offset/(0,r.Bw)(s);return(0,r.Ln)(this.tmpVertex,n,s,o),this.tmpVertex}applyToAabb(t){const e=u,i=d,r=p;for(let n=0;n<3;++n)e[n]=t[0+n]+this.localOrigin[n],i[n]=t[3+n]+this.localOrigin[n],r[n]=e[n];const n=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=n[e],t[e+3]=n[e];const s=e=>{const i=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let n=0;n<3;++n)r[n]=t&1<<n?i[n]:e[n];s(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let n=0;n<3;++n)r[n]=o&1<<n?0:t&1<<n?e[n]:i[n];s(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,n.vt)(),l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),p=(0,n.vt)()},75497(t,e,i){i.d(e,{$p:()=>s,Qx:()=>o,e_:()=>a});var r=i(51850),n=i(37957);class s{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}}class a{constructor(){this.r=n.P.create(),this.g=n.P.create(),this.b=n.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{TA:()=>x,uH:()=>y});var r=i(34727),n=i(35522),s=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,n.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],n=t[2],s=e||h.P.create();s[0]=l,s[1]=.4886025119*i,s[2]=.4886025119*n,s[3]=.4886025119*r,s[4]=1.09254843059*i*r,s[5]=1.09254843059*r*n,s[6]=.31539156525*(3*n*n-1),s[7]=1.09254843059*i*n,s[8]=.54627421529*(i*i-r*r)}(m,p),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(p,g),a(p,t.intensity[0],f),c(e.r,f),a(p,t.intensity[1],f),c(e.g,f),a(p,t.intensity[2],f),c(e.b,f)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const p=h.P.create(),f=h.P.create(),m=(0,s.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,s.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,s.vt)(),this.ambient=new _,this.diffuse=new _}}const y=.4;class x{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,s.vt)(),(0,s.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,n.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,n.C)(e.direction,t[0].direction),(0,n.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,n.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,n.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,n.C)(b,this._legacy.diffuse.color),(0,n.hs)(b,b,y*this.globalFactor),(0,n.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,b)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,n.C)(this._mainLight.direction,t.mainLight.direction),(0,n.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,n.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,n.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let n=0;n<e.sh.r.length;n++)this._sphericalHarmonics.r[n]=(0,r.Cc)(t.sh.r[n],e.sh.r[n],i),this._sphericalHarmonics.g[n]=(0,r.Cc)(t.sh.g[n],e.sh.g[n],i),this._sphericalHarmonics.b[n]=(0,r.Cc)(t.sh.b[n],e.sh.b[n],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const b=(0,s.vt)()},33442(t,e,i){i.d(e,{Tk:()=>_,b6:()=>p,sG:()=>u});var r=i(35522),n=i(51850),s=i(49255);const o=d(-1),a=d(1),c=o,h=new Array;h[0]=null,h[1]=a,h[2]=o,h[3]=d(-2),h[4]=d(-3);const l=h.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(c,t));function u({output:t,enableOITOffset:e,polygonOffset:i}){return(0,s.Sp)(t)&&e?l[i]:h[i]}function d(t){return{factor:1*t,units:2*t}}function p(t,e,i,n){const s=u(e);if(!s)return t;const o=m*s.units,a=(0,r.S8)(g,(0,r.jb)(g,n,i));return(e,i,n)=>{const c=(i?1-Math.abs((0,r.Om)(a,i)):0)*s.factor*f+o;return t(e+c,i,n)}}h[1]=a;const f=5e-5,m=5e-6,g=(0,n.vt)();function _(t){const e=u(t)??{factor:0,units:0};return{factor:e.factor+o.factor*t.polygonOffsetIndex,units:e.units+o.units*t.polygonOffsetIndex}}},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),n=i(51976),s=i(68317);class o extends s.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,n.W)()],o.prototype,"hasHighlightMixTexture",void 0),(0,r.Cg)([(0,n.W)()],o.prototype,"emissionDimmingPass",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,n.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"enableOITOffset",void 0)},35622(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),n=(i(35522),i(51850)),s=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends s.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,n.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,Um:()=>h,kE:()=>o});var r=i(4576),n=i(34727),s=i(77194);function o(t,e,i,r,s,o){let a=i.screenLength*t.pixelRatio;null!=s&&(l.update(r,e,s,o),a=l.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,n.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const n=e[r];void 0!==n&&(Array.isArray(n)?Array.isArray(t[r])&&a(n,t[r])||(t[r]=n.slice(),i=!0):t[r]!==n&&(i=!0,t[r]=n))}return i}const h={multiply:1,ignore:2,replace:3,tint:4},l=new s.PS},59907(t,e,i){i.d(e,{Wu:()=>u,vJ:()=>f});var r=i(35522),n=i(51850),s=i(58083),o=i(13030),a=i(620);function c(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length;i*=o;for(let t=0;t<a;++t){const e=2*n[t];s[i]=r[e],s[i+1]=r[e+1],i+=o}}function h(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=3*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}else for(let t=0;t<c;++t){const e=3*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}}function l(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=4*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}else for(let t=0;t<c;++t){const e=4*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}}function u(t,e,i,n){(0,r.Re)(d,t,e);const s=Math.max(Math.sqrt((0,r.Bw)(d)),1e-4);(0,r.hs)(d,d,1/s),i[n++]=d[0],i[n++]=d[1],i[n++]=d[2],i[n++]=s}const d=(0,n.vt)();function p(t,e,i,r,n=1){const s=e.typedBuffer,o=e.typedBufferStride;if(r*=o,1===n)for(let e=0;e<i;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o;else for(let e=0;e<i;++e)for(let e=0;e<n;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o}function f(t,e,i,r,n,s,a){let c={numItems:0,numVerticesPerItem:0};for(const h of i.fields.keys()){const i=t.get(h),l=i?.indices;if(i&&l)"position"===h&&(c={numItems:1,numVerticesPerItem:l.length}),m(h,i,r,n,s,a);else if("olidColor"===h&&null!=e){const i=t.get("position")?.indices;if(i){const t=i.length;p(e,s.getField(h,o.XP),t,a)}}}return c}function m(t,e,i,r,n,u){switch(t){case"position":{(0,a.vA)(3===e.size);const r=n.getField(t,o.xs);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void h(t,i,r,n);const{data:o,indices:a}=t,c=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=e[0],p=e[1],f=e[2],m=e[4],g=e[5],_=e[6],v=e[8],y=e[9],x=e[10],b=e[12],w=e[13],T=e[14];r*=l;let A=0,M=0,S=0;const C=(0,s.tZ)(e)?t=>{A=o[t]+b,M=o[t+1]+w,S=o[t+2]+T}:t=>{const e=o[t],i=o[t+1],r=o[t+2];A=d*e+m*i+v*r+b,M=p*e+g*i+y*r+w,S=f*e+_*i+x*r+T};if(1===n)for(let t=0;t<u;++t)C(3*a[t]),c[r]=A,c[r+1]=M,c[r+2]=S,r+=l;else for(let t=0;t<u;++t){C(3*a[t]);for(let t=0;t<n;++t)c[r]=A,c[r+1]=M,c[r+2]=S,r+=l}}(e,i,r,u);break}case"normal":{(0,a.vA)(3===e.size);const i=n.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void h(t,i,r,n);const{data:o,indices:a}=t,c=e,l=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],y=c[8],x=c[9],b=c[10],w=!(0,s.ut)(c),T=1e-6,A=1-T;r*=u;let M=0,S=0,C=0;const E=(0,s.tZ)(c)?t=>{M=o[t],S=o[t+1],C=o[t+2]}:t=>{const e=o[t],i=o[t+1],r=o[t+2];M=p*e+g*i+y*r,S=f*e+_*i+x*r,C=m*e+v*i+b*r};if(1===n)if(w)for(let t=0;t<d;++t){E(3*a[t]);const e=M*M+S*S+C*C;if(e<A&&e>T){const t=1/Math.sqrt(e);l[r]=M*t,l[r+1]=S*t,l[r+2]=C*t}else l[r]=M,l[r+1]=S,l[r+2]=C;r+=u}else for(let t=0;t<d;++t)E(3*a[t]),l[r]=M,l[r+1]=S,l[r+2]=C,r+=u;else for(let t=0;t<d;++t){if(E(3*a[t]),w){const t=M*M+S*S+C*C;if(t<A&&t>T){const e=1/Math.sqrt(t);M*=e,S*=e,C*=e}}for(let t=0;t<n;++t)l[r]=M,l[r+1]=S,l[r+2]=C,r+=u}}(e,r,i,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===e.size);const i=n.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uv0":{(0,a.vA)(2===e.size);const i=n.getField(t,o.ZD)??n.getField(t,o.gH);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uvi":{(0,a.vA)(2===e.size);const i=n.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"color":case"symbolColor":{const i=n.getField(t,o.XP);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(3===e.size||4===e.size),function(t,e,i,r,n=1){const{data:s,indices:o}=t,a=i.typedBuffer,c=i.typedBufferStride,h=o.length;if(r*=c,e===s.length&&4===e){a[r]=s[0],a[r+1]=s[1],a[r+2]=s[2],a[r+3]=s[3];const t=new Uint32Array(i.typedBuffer.buffer,i.start),e=c/4,o=t[r/=4];r+=e;const l=h*n;for(let i=1;i<l;++i)t[r]=o,r+=e;return}if(1!==n)if(4!==e)for(let t=0;t<h;++t){const e=3*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}else for(let t=0;t<h;++t){const e=4*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}else{if(4===e){for(let t=0;t<h;++t){const e=4*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}return}for(let t=0;t<h;++t){const e=3*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}}}(e,e.size,i,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const i=n.getField(t,o.Y$)??n.getField(t,o.Y$);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(1===e.size),function(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length,c=r[0];i*=o;for(let t=0;t<a;++t)s[i]=c,i+=o}(e,i,u);break}case"tangent":{(0,a.vA)(4===e.size);const r=n.getField(t,o.Eq);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void l(t,i,r,n);const{data:o,indices:a}=t,c=e,h=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],y=c[8],x=c[9],b=c[10],w=!(0,s.ut)(c),T=1e-6,A=1-T;if(r*=u,1===n)for(let t=0;t<d;++t){const e=4*a[t],i=o[e],n=o[e+1],s=o[e+2],c=o[e+3];let l=p*i+g*n+y*s,d=f*i+_*n+x*s,M=m*i+v*n+b*s;if(w){const t=l*l+d*d+M*M;if(t<A&&t>T){const e=1/Math.sqrt(t);l*=e,d*=e,M*=e}}h[r]=l,h[r+1]=d,h[r+2]=M,h[r+3]=c,r+=u}else for(let t=0;t<d;++t){const e=4*a[t],i=o[e],s=o[e+1],c=o[e+2],l=o[e+3];let d=p*i+g*s+y*c,M=f*i+_*s+x*c,S=m*i+v*s+b*c;if(w){const t=d*d+M*M+S*S;if(t<A&&t>T){const e=1/Math.sqrt(t);d*=e,M*=e,S*=e}}for(let t=0;t<n;++t)h[r]=d,h[r+1]=M,h[r+2]=S,h[r+3]=l,r+=u}}(e,i,r,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===e.size);const i=n.getField(t,o.jz)??n.getField(t,o.Eq);(0,a.vA)(!!i,`No buffer view for ${t}`),l(e,i,u);break}case"profileAuxData":{(0,a.vA)(3===e.size);const i=n.getField(t,o.EC)??n.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),h(e,i,u);break}}}},26292(t,e,i){i.d(e,{D:()=>d});var r=i(49255),n=i(22911),s=i(3871),o=i(63365);function a(t){t.code.add("\n vec3 emissionDimming(vec3 srcColor, float srcAlpha) {\n srcColor = clamp(srcColor, vec3(0.0), srcColor);\n return mix(vec3(1.0), srcColor, srcAlpha);\n }\n ")}var c=i(31821),h=i(26934);function l(t,e){e.useFloatBlend?t.code.add(c.H`float ditherNoise(vec4 color) { return 0.0; }`):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}var u=i(66211);function d(t,e){t.include(s.Q,e),t.include(n.NL,e);const{fragment:i,outputs:d}=t;i.include(o.a);const{output:p,hasEmission:f,discardInvisibleFragments:m,oitPremultipliedAlpha:g,snowCover:_,useFloatBlend:v,emissionDimmingPass:y}=e,x=11===p,b=(0,r.Sp)(p),w=(0,r.Rb)(p),T=(0,r._o)(p)&&!b;let A=0;(T||b)&&d.add("fragColor","vec4",A++),f&&d.add("fragEmission","vec4",A++),b&&d.add("fragAlpha","float",A++),i.include(h.Q),i.include(u.H,e),i.include(l,e),y&&i.include(a),i.code.add(c.H`
249
+ }`)}function c(t){t.uniforms.add(new s.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new s.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,n.vt)()},77949(t,e,i){i.d(e,{NB:()=>p,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,s.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function p(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(f,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,s.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(f,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const f=(0,n.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,n)=>r.setUniform2fv(t,e(n),i))}}},68259(t,e,i){i.d(e,{t:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,n,s,o)=>r.setUniform2fv(t,e(n,s,o),i))}}},47286(t,e,i){i.d(e,{G:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,n,s)=>r.setUniform2fv(t,e(n,s),i))}}},23205(t,e,i){i.d(e,{d:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,n)=>r.setUniform3fv(t,e(n),i))}}},14314(t,e,i){i.d(e,{I:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,n)=>r.setUniform4fv(t,e(n),i))}}},71988(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,n,s)=>r.setUniform4fv(t,e(n,s),i))}}},33094(t,e,i){i.d(e,{U:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"float",0,(r,n)=>r.setUniform1f(t,e(n),i))}}},44887(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,n,s)=>e.setUniform1fv(t,i(n,s),r),e)}}},35818(t,e,i){i.d(e,{W:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",1,(i,r,n)=>i.setUniform1i(t,e(r,n)))}}},35644(t,e,i){i.d(e,{k:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,n,s)=>r.setUniformMatrix3fv(t,e(n,s),i))}}},58029(t,e,i){i.d(e,{F:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,n)=>r.setUniformMatrix4fv(t,e(n),i))}}},97102(t,e,i){i.d(e,{S:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,n,s)=>r.setUniformMatrix4fv(t,e(n,s),i))}}},12791(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>f});var r=i(5482),n=i(69622),s=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||s.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const n=r.unit;this.setUniform1i(t,n),this._context.bindTexture(e,n,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),p=i(85079);let f=class extends n.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,p.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void s.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};f=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},51976(t,e,i){i.d(e,{K:()=>a,W:()=>c});var r=i(49186),n=i(4576);class s{constructor(t){this._bits=[...t]}equals(t){return(0,n.aI)(this._bits,t.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var o=i(65786);class a extends o.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new s(this._parameterBits),this._key}decode(t=this.key){const e=this._parameterBits;this._parameterBits=[...t.bits];const i=this._parameterNames.map(t=>` ${t}: ${this[t]}`).join("\n");return this._parameterBits=e,i}}function c(t={}){return(e,i)=>{e.hasOwnProperty("_parameterNames")||Object.defineProperty(e,"_parameterNames",{value:e._parameterNames?.slice()??[],configurable:!0,writable:!0}),e.hasOwnProperty("_parameterBits")||Object.defineProperty(e,"_parameterBits",{value:e._parameterBits?.slice()??[0],configurable:!0,writable:!0}),e._parameterNames.push(i);const n=t.count||2,s=Math.ceil(Math.log2(n)),o=e._parameterBits;let a=0;for(;o[a]+s>16;)a++,a>=o.length&&o.push(0);const c=o[a],h=(1<<s)-1<<c;o[a]+=s,t.count?Object.defineProperty(e,i,{get(){return(this._parameterBits[a]&h)>>c},set(e){const n=this._parameterBits[a];if((n&h)>>c!==e){if(this._key=null,this._parameterBits[a]=n&~h|+e<<c&h,"number"!=typeof e)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must be a number, got ${typeof e}`);if(null==t.count)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must provide a count option`)}}}):Object.defineProperty(e,i,{get(){return!!((this._parameterBits[a]&h)>>c)},set(t){const e=this._parameterBits[a];if(!!((e&h)>>c)!==t&&(this._key=null,this._parameterBits[a]=e&~h|+t<<c,"boolean"!=typeof t))throw new r.A("internal:invalid-shader-configurationx",`Configuration value for ${i} must be boolean, got ${typeof t}`)}})}}},16943(t,e,i){i.d(e,{E:()=>n});var r=i(44208);function n(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){i.d(e,{lK:()=>a,wR:()=>o});var r=i(63907),n=i(85079),s=i(74038);const o=[],a=(new s._("position",3,r.pe.FLOAT,0,12),[new s._("position",2,r.pe.FLOAT,0,8)]);(0,n.Xk)(a),new s._("position",2,r.pe.FLOAT,0,12),new s._("uv0",2,r.pe.HALF_FLOAT,8,12),new s._("position",2,r.pe.FLOAT,0,16),new s._("uv0",2,r.pe.FLOAT,8,16)},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},63500(t,e,i){i.d(e,{V:()=>E});var r=i(9093),n=i(35522),s=i(97146),o=i(46610),a=i(34275),c=i(20498);function h(t){if(t.length<a.y9)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,a.LW)(t)?(0,c.pX)().from(t):(0,a.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return Float32Array.from(t);default:return Float64Array.from(t)}}var l=i(15142),u=i(51850),d=i(620);class p{get center(){return(0,u.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,u.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,u.fA)(this._data[7],this._data[8],this._data[9])}constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=i,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,d.vA)(t.length>=1),(0,d.vA)(3===i.size||4===i.size);const{data:r,size:s,indices:o}=i;(0,d.vA)(o.length%this._numIndexPerPrimitive===0),(0,d.vA)(o.length>=t.length*this._numIndexPerPrimitive);const a=t.length;let c=s*o[this._numIndexPerPrimitive*t[0]];f.clear(),f.push(c);const h=(0,u.fA)(r[c],r[c+1],r[c+2]),l=(0,u.o8)(h);for(let e=0;e<a;++e){const i=this._numIndexPerPrimitive*t[e];for(let t=0;t<this._numIndexPerPrimitive;++t){c=s*o[i+t],f.push(c);let e=r[c];h[0]=Math.min(e,h[0]),l[0]=Math.max(e,l[0]),e=r[c+1],h[1]=Math.min(e,h[1]),l[1]=Math.max(e,l[1]),e=r[c+2],h[2]=Math.min(e,h[2]),l[2]=Math.max(e,l[2])}}for(let t=0;t<3;++t)this._data[4+t]=h[t],this._data[7+t]=l[t];const p=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-h[0],l[1]-h[1]),l[2]-h[2]),g=m*m;for(let t=0;t<f.length;++t){c=f.at(t);const e=r[c]-p[0],i=r[c+1]-p[1],n=r[c+2]-p[2],s=e*e+i*i+n*n;if(s<=g)continue;const o=Math.sqrt(s),a=.5*(o-m);m+=a,g=m*m;const h=a/o;p[0]+=e*h,p[1]+=i*h,p[2]+=n*h}this._data[3]=m;for(let t=0;t<3;++t)this._data[0+t]=p[t];f.clear()}getChildren(){if(this._children||(0,n.hG)(this.bbMin,this.bbMax)<=1)return this._children;const t=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5),e=this.primitiveIndices.length,i=new Uint8Array(e),r=new Array(8);for(let t=0;t<8;++t)r[t]=0;const{data:s,size:o,indices:a}=this.position;for(let n=0;n<e;++n){let e=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[n];let h=o*a[c],l=s[h],u=s[h+1],d=s[h+2];for(let t=1;t<this._numIndexPerPrimitive;++t){h=o*a[c+t];const e=s[h],i=s[h+1],r=s[h+2];e<l&&(l=e),i<u&&(u=i),r<d&&(d=r)}l<t[0]&&(e|=1),u<t[1]&&(e|=2),d<t[2]&&(e|=4),i[n]=e,++r[e]}let c=0;for(let t=0;t<8;++t)r[t]>0&&++c;if(c<2)return;const h=new Array(8);for(let t=0;t<8;++t)h[t]=r[t]>0?new Uint32Array(r[t]):void 0;for(let t=0;t<8;++t)r[t]=0;for(let t=0;t<e;++t){const e=i[t];h[e][r[e]++]=this.primitiveIndices[t]}this._children=new Array;for(let t=0;t<8;++t)void 0!==h[t]&&this._children.push(new p(h[t],this._numIndexPerPrimitive,this.position));return this._children}static prune(){f.prune()}}const f=new l.A({deallocator:null});var m=i(24326);class g{constructor(t){this.id=(0,m.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,s.Dg)(i.indices)})}get attributes(){return this._attributes}}var _=i(4341),v=i(11964);function y(t,e,i){return(0,n.Re)(x,e,t),(0,n.Re)(b,i,t),.5*(0,n.Bw)((0,n.$A)(x,x,b))}i(32114),new _.I(v.vt),new _.I(()=>{return t?{p0:(0,u.o8)(t.p0),p1:(0,u.o8)(t.p1),p2:(0,u.o8)(t.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var t});const x=(0,u.vt)(),b=(0,u.vt)(),w=(0,u.vt)(),T=(0,u.vt)(),A=(0,u.vt)(),M=(0,u.vt)();var C=i(17478),S=i(94656);class E extends g{constructor(t,e,i=null,r=0,n=null,s=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=n,this.edgeIndicesLength=s,this.baseGeometry=o,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,d.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const c=this.positionAttribute;null!=c&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=c.indices.length)}instantiate(t={}){const e=new E(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:h(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const i=this._attributes.get(t);i?this._attributes.set(t,{...i,exclusive:!0,data:e}):(0,S.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);this._vertexPositionIndicesCache=i}else this._vertexPositionIndicesCache=e?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!(0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&(0,n.Z0)(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0),(0,n.hZ)(M,0,0,0);let o=0,a=0;for(let e=0;e<i.length-2;e+=3){const c=i[e]*r,h=i[e+1]*r,l=i[e+2]*r;(0,n.hZ)(w,s[c],s[c+1],s[c+2]),(0,n.hZ)(T,s[h],s[h+1],s[h+2]),(0,n.hZ)(A,s[l],s[l+1],s[l+2]);const u=y(w,T,A);u?((0,n.WQ)(w,w,T),(0,n.WQ)(w,w,A),(0,n.hs)(w,w,1/3*u),(0,n.WQ)(t,t,w),o+=u):((0,n.WQ)(M,M,w),(0,n.WQ)(M,M,T),(0,n.WQ)(M,M,A),a+=3)}return!(0===a&&0===o||(0!==o?((0,n.hs)(t,t,1/o),0):0===a||((0,n.hs)(t,M,1/a),0)))}(t,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(t){const e=this.positionAttribute,i=this.primitivePositionIndices;return function(t,e,i,r=e?.indices){if(!e||!r)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(M,0,0,0);let s=0,o=0;const{size:a,data:c}=e,h=r.length-1,l=h+(i?2:0);for(let e=0;e<l;e+=2){const i=e<h?e+1:0,l=r[e<h?e:h]*a,u=r[i]*a;w[0]=c[l],w[1]=c[l+1],w[2]=c[l+2],T[0]=c[u],T[1]=c[u+1],T[2]=c[u+2],(0,n.hs)(w,(0,n.WQ)(w,w,T),.5);const d=(0,n.xg)(w,T);d>0?((0,n.WQ)(t,t,(0,n.hs)(w,w,d)),s+=d):0===s&&((0,n.WQ)(M,M,w),o++)}return 0!==s?((0,n.hs)(t,t,1/s),!0):0!==o&&((0,n.hs)(t,M,1/o),!0)}(t,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}(this.material.parameters,e),i)}_computeAttachmentOriginPoints(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0);let o=-1,a=0;for(let e=0;e<i.length;e++){const n=i[e]*r;o!==n&&(t[0]+=s[n],t[1]+=s[n+1],t[2]+=s[n+2],a++),o=n}return a>1&&(0,n.hs)(t,t,1/a),a>0}(t,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.primitivePositionIndices;if(!t||!e||0===e.length)return null;const i=e===t.indices?t:new o.n(t.data,e,t.size,!1,t.stride),r=0===this.type?3:1;(0,d.vA)(e.length%r===0,"Indexing error: "+e.length+" not divisible by "+r);const n=(0,s.tM)(e.length/r);return new p(n,r,i)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||R}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new C.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const R=new Set},49718(t,e,i){i(51850),i(6867).i},6867(t,e,i){i.d(e,{i:()=>l});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,s.hs)(d,this.ray.direction,this.distance),(0,s.Bw)(d))}withinDistance(t){return!!u(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!u(this)&&((0,s.hs)(d,this.ray.direction,this.distance),(0,s.WQ)(t,this.ray.origin,d),!0)}getTransformedNormal(t){return(0,s.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,s.C)(t,p),(0,s.S8)(t,t)}constructor(t){this.intersector=4,this.normal=(0,o.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this.intersector=t,this.distance=i,(0,s.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??n.zK),this.target=e,this.drapedLayerOrder=h,this.renderPriority=l}copy(t){(0,h.C)(t.ray,this._ray),this.intersector=t.intersector,this.distance=t.distance,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.renderPriority=t.renderPriority,(0,s.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function u(t){return null!=t?.distance}const d=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>U});var r=i(49186),n=i(65529),s=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),p=i(2741);let f;var m=i(63907),g=i(21231),_=i(42293);let v=null,y=null;async function x(){return null==y&&(f??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),y=f,v=await y),y}function b(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=A(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=M(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,n){const s=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function A(t){return t.getNumImages()>=1&&!t.isUASTC()}function M(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function C(t,e,i,r,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(o(t,l))),a(t,l,p[t]);return e.internalFormat=u,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=n,e.height=s,new g.A(t,e,{type:"compressed",levels:p})}var S=i(53966);const E=()=>S.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),O=R("DXT3"),D=R("DXT5");function F(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let n,s;switch(r){case I:n=8,s=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case D:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let p=t.byteOffset+i[1]+4;const f=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*n,u=new Uint8Array(t.buffer,p,d),f.push(u),p+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:s,width:h,height:l}}var P=i(78988),N=i(620),B=i(67171),L=i(12541);class U{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new n.bk,this._parameters={...z,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new B.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e.isImmutable=!0===this._parameters.immutable&&function(t){return null!=t&&((0,L.tl)(t)||(0,L.tr)(t)||(0,L.CR)(t)||(0,L.QJ)(t))}(this._parameters.internalFormat),e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?b(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,n=e.pixelFormat??6408,s=(0,_.wH)(n);return(e.mipmap?4/3:1)*i*r*s||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=F(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=r;return e.samplingMode=n.levels.length>1?9987:9729,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new g.A(t,e,n)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.KTX2File(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const n=C(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.BasisFile(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const n=C(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((n,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,s.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,P.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const n=this._createDescriptor(t);return n.width=r.width,n.height=r.height,n.compress=this._parameters.compressionOptions,this._texture=new g.A(t,n,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const z={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),n=i(49255),s=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,s.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,s.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,n._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value,this._configuration.emissionDimmingPass=t.transparentWithoutDepthEmissionDimmingPass&&(0,n._o)(t.output)}}o.Y},17478(t,e,i){i.d(e,{h:()=>s,p:()=>o});var r=i(24326);class n{constructor(){this.uid=(0,r.c)()}}class s extends n{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends n{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>o,mt:()=>c,z5:()=>a});var r=i(49255),n=i(90644);const s=(0,n.p3)(1,0,1,771);function o(t,e=!1,i=!1){if(i)return n.uR;switch(t){case 0:return e?n.RC:n.T8;case 1:return s;default:return null}}function a(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?n.Uy:null;case 1:return null}}function c(t,e=513){return{func:(0,r.Sp)(t)?515:e}}},56133(t,e,i){i.d(e,{Ax:()=>h,Q0:()=>u,cP:()=>c,iB:()=>l,m:()=>n,r8:()=>a,sf:()=>s,v0:()=>o});var r=i(90644);const n={func:513},s={func:519},o={mask:255},a={mask:0},c=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),h=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681}),l=(0,r.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),u=(0,r.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680})},77194(t,e,i){i.d(e,{PS:()=>n}),i(44208);var r=i(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:n}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),n,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>n,vM:()=>s});var r=i(49186);function n(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function s(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const s=Math.max(t,e),o=t*e;if(s<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/s);return[n(Math.round(t*a),r),n(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const n=document.createElement("canvas");return n.width=e,n.height=i,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),n=i(51850),s=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,n.vt)(),this._tmpSphere=new s.iy}applyToVertex(t,e,i){const n=this.objectTransform.transform,s=(0,r.hZ)(h,t,e,i),o=(0,r.Z0)(s,s,n),a=this.offset/(0,r.Bw)(o);(0,r.Ln)(o,o,o,a);const c=this.objectTransform.inverse;return(0,r.Z0)(this.tmpVertex,o,c),this.tmpVertex}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const n=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,n)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),n=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,n),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=new s.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i){const n=(0,r.hZ)(h,t,e,i),s=(0,r.hZ)(l,t,e,i+this.componentLocalOriginLength),o=this._totalOffset/(0,r.Bw)(s);return(0,r.Ln)(this._tmpVertex,n,s,o),this._tmpVertex}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],n=t[2]+e,s=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(n),u=Math.abs(s),d=Math.abs(o),p=Math.abs(a),f=.5*(1+Math.sign(i*s))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(n*a))*Math.min(l,p),_=Math.sqrt(f*f+m*m+g*g),v=Math.sign(c+i),y=Math.sign(h+r),x=Math.sign(l+n),b=Math.sign(u+s),w=Math.sign(d+o),T=Math.sign(p+a),A=this._totalOffset;if(_<A)return t[0]-=(1-v)*A,t[1]-=(1-y)*A,t[2]-=(1-x)*A,t[3]+=b*A,t[4]+=w*A,t[5]+=T*A,t;const M=Math.max(c,u),C=Math.max(h,d),S=Math.max(l,p),E=A/Math.sqrt(M*M+C*C+S*S),R=A/_,I=R-E,O=-I;return t[0]+=i*(v*O+R),t[1]+=r*(y*O+R),t[2]+=n*(x*O+R),t[3]+=s*(b*I+E),t[4]+=o*(w*I+E),t[5]+=a*(T*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),n=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,n),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,n.vt)()}applyToVertex(t,e,i){const n=(0,r.hZ)(h,t,e,i),s=(0,r.WQ)(l,n,this.localOrigin),o=this.offset/(0,r.Bw)(s);return(0,r.Ln)(this.tmpVertex,n,s,o),this.tmpVertex}applyToAabb(t){const e=u,i=d,r=p;for(let n=0;n<3;++n)e[n]=t[0+n]+this.localOrigin[n],i[n]=t[3+n]+this.localOrigin[n],r[n]=e[n];const n=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=n[e],t[e+3]=n[e];const s=e=>{const i=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let n=0;n<3;++n)r[n]=t&1<<n?i[n]:e[n];s(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let n=0;n<3;++n)r[n]=o&1<<n?0:t&1<<n?e[n]:i[n];s(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,n.vt)(),l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),p=(0,n.vt)()},75497(t,e,i){i.d(e,{$p:()=>s,Qx:()=>o,e_:()=>a});var r=i(51850),n=i(37957);class s{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}}class a{constructor(){this.r=n.P.create(),this.g=n.P.create(),this.b=n.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{TA:()=>x,uH:()=>y});var r=i(34727),n=i(35522),s=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,n.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],n=t[2],s=e||h.P.create();s[0]=l,s[1]=.4886025119*i,s[2]=.4886025119*n,s[3]=.4886025119*r,s[4]=1.09254843059*i*r,s[5]=1.09254843059*r*n,s[6]=.31539156525*(3*n*n-1),s[7]=1.09254843059*i*n,s[8]=.54627421529*(i*i-r*r)}(m,p),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(p,g),a(p,t.intensity[0],f),c(e.r,f),a(p,t.intensity[1],f),c(e.g,f),a(p,t.intensity[2],f),c(e.b,f)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const p=h.P.create(),f=h.P.create(),m=(0,s.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,s.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,s.vt)(),this.ambient=new _,this.diffuse=new _}}const y=.4;class x{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,s.vt)(),(0,s.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,n.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,n.C)(e.direction,t[0].direction),(0,n.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,n.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,n.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,n.C)(b,this._legacy.diffuse.color),(0,n.hs)(b,b,y*this.globalFactor),(0,n.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,b)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,n.C)(this._mainLight.direction,t.mainLight.direction),(0,n.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,n.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,n.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let n=0;n<e.sh.r.length;n++)this._sphericalHarmonics.r[n]=(0,r.Cc)(t.sh.r[n],e.sh.r[n],i),this._sphericalHarmonics.g[n]=(0,r.Cc)(t.sh.g[n],e.sh.g[n],i),this._sphericalHarmonics.b[n]=(0,r.Cc)(t.sh.b[n],e.sh.b[n],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const b=(0,s.vt)()},33442(t,e,i){i.d(e,{Tk:()=>_,b6:()=>p,sG:()=>u});var r=i(35522),n=i(51850),s=i(49255);const o=d(-1),a=d(1),c=o,h=new Array;h[0]=null,h[1]=a,h[2]=o,h[3]=d(-2),h[4]=d(-3);const l=h.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(c,t));function u({output:t,enableOITOffset:e,polygonOffset:i}){return(0,s.Sp)(t)&&e?l[i]:h[i]}function d(t){return{factor:1*t,units:2*t}}function p(t,e,i,n){const s=u(e);if(!s)return t;const o=m*s.units,a=(0,r.S8)(g,(0,r.jb)(g,n,i));return(e,i,n)=>{const c=(i?1-Math.abs((0,r.Om)(a,i)):0)*s.factor*f+o;return t(e+c,i,n)}}h[1]=a;const f=5e-5,m=5e-6,g=(0,n.vt)();function _(t){const e=u(t)??{factor:0,units:0};return{factor:e.factor+o.factor*t.polygonOffsetIndex,units:e.units+o.units*t.polygonOffsetIndex}}},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),n=i(51976),s=i(68317);class o extends s.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,n.W)()],o.prototype,"hasHighlightMixTexture",void 0),(0,r.Cg)([(0,n.W)()],o.prototype,"emissionDimmingPass",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,n.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"enableOITOffset",void 0)},35622(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),n=(i(35522),i(51850)),s=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends s.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,n.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,Um:()=>h,kE:()=>o});var r=i(4576),n=i(34727),s=i(77194);function o(t,e,i,r,s,o){let a=i.screenLength*t.pixelRatio;null!=s&&(l.update(r,e,s,o),a=l.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,n.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const n=e[r];void 0!==n&&(Array.isArray(n)?Array.isArray(t[r])&&a(n,t[r])||(t[r]=n.slice(),i=!0):t[r]!==n&&(i=!0,t[r]=n))}return i}const h={multiply:1,ignore:2,replace:3,tint:4},l=new s.PS},59907(t,e,i){i.d(e,{Wu:()=>u,vJ:()=>f});var r=i(35522),n=i(51850),s=i(58083),o=i(13030),a=i(620);function c(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length;i*=o;for(let t=0;t<a;++t){const e=2*n[t];s[i]=r[e],s[i+1]=r[e+1],i+=o}}function h(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=3*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}else for(let t=0;t<c;++t){const e=3*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}}function l(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=4*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}else for(let t=0;t<c;++t){const e=4*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}}function u(t,e,i,n){(0,r.Re)(d,t,e);const s=Math.max(Math.sqrt((0,r.Bw)(d)),1e-4);(0,r.hs)(d,d,1/s),i[n++]=d[0],i[n++]=d[1],i[n++]=d[2],i[n++]=s}const d=(0,n.vt)();function p(t,e,i,r,n=1){const s=e.typedBuffer,o=e.typedBufferStride;if(r*=o,1===n)for(let e=0;e<i;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o;else for(let e=0;e<i;++e)for(let e=0;e<n;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o}function f(t,e,i,r,n,s,a){let c={numItems:0,numVerticesPerItem:0};for(const h of i.fields.keys()){const i=t.get(h),l=i?.indices;if(i&&l)"position"===h&&(c={numItems:1,numVerticesPerItem:l.length}),m(h,i,r,n,s,a);else if("olidColor"===h&&null!=e){const i=t.get("position")?.indices;if(i){const t=i.length;p(e,s.getField(h,o.XP),t,a)}}}return c}function m(t,e,i,r,n,u){switch(t){case"position":{(0,a.vA)(3===e.size);const r=n.getField(t,o.xs);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void h(t,i,r,n);const{data:o,indices:a}=t,c=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=e[0],p=e[1],f=e[2],m=e[4],g=e[5],_=e[6],v=e[8],y=e[9],x=e[10],b=e[12],w=e[13],T=e[14];r*=l;let A=0,M=0,C=0;const S=(0,s.tZ)(e)?t=>{A=o[t]+b,M=o[t+1]+w,C=o[t+2]+T}:t=>{const e=o[t],i=o[t+1],r=o[t+2];A=d*e+m*i+v*r+b,M=p*e+g*i+y*r+w,C=f*e+_*i+x*r+T};if(1===n)for(let t=0;t<u;++t)S(3*a[t]),c[r]=A,c[r+1]=M,c[r+2]=C,r+=l;else for(let t=0;t<u;++t){S(3*a[t]);for(let t=0;t<n;++t)c[r]=A,c[r+1]=M,c[r+2]=C,r+=l}}(e,i,r,u);break}case"normal":{(0,a.vA)(3===e.size);const i=n.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void h(t,i,r,n);const{data:o,indices:a}=t,c=e,l=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],y=c[8],x=c[9],b=c[10],w=!(0,s.ut)(c),T=1e-6,A=1-T;r*=u;let M=0,C=0,S=0;const E=(0,s.tZ)(c)?t=>{M=o[t],C=o[t+1],S=o[t+2]}:t=>{const e=o[t],i=o[t+1],r=o[t+2];M=p*e+g*i+y*r,C=f*e+_*i+x*r,S=m*e+v*i+b*r};if(1===n)if(w)for(let t=0;t<d;++t){E(3*a[t]);const e=M*M+C*C+S*S;if(e<A&&e>T){const t=1/Math.sqrt(e);l[r]=M*t,l[r+1]=C*t,l[r+2]=S*t}else l[r]=M,l[r+1]=C,l[r+2]=S;r+=u}else for(let t=0;t<d;++t)E(3*a[t]),l[r]=M,l[r+1]=C,l[r+2]=S,r+=u;else for(let t=0;t<d;++t){if(E(3*a[t]),w){const t=M*M+C*C+S*S;if(t<A&&t>T){const e=1/Math.sqrt(t);M*=e,C*=e,S*=e}}for(let t=0;t<n;++t)l[r]=M,l[r+1]=C,l[r+2]=S,r+=u}}(e,r,i,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===e.size);const i=n.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uv0":{(0,a.vA)(2===e.size);const i=n.getField(t,o.ZD)??n.getField(t,o.gH);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uvi":{(0,a.vA)(2===e.size);const i=n.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"color":case"symbolColor":{const i=n.getField(t,o.XP);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(3===e.size||4===e.size),function(t,e,i,r,n=1){const{data:s,indices:o}=t,a=i.typedBuffer,c=i.typedBufferStride,h=o.length;if(r*=c,e===s.length&&4===e){a[r]=s[0],a[r+1]=s[1],a[r+2]=s[2],a[r+3]=s[3];const t=new Uint32Array(i.typedBuffer.buffer,i.start),e=c/4,o=t[r/=4];r+=e;const l=h*n;for(let i=1;i<l;++i)t[r]=o,r+=e;return}if(1!==n)if(4!==e)for(let t=0;t<h;++t){const e=3*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}else for(let t=0;t<h;++t){const e=4*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}else{if(4===e){for(let t=0;t<h;++t){const e=4*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}return}for(let t=0;t<h;++t){const e=3*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}}}(e,e.size,i,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const i=n.getField(t,o.Y$)??n.getField(t,o.Y$);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(1===e.size),function(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length,c=r[0];i*=o;for(let t=0;t<a;++t)s[i]=c,i+=o}(e,i,u);break}case"tangent":{(0,a.vA)(4===e.size);const r=n.getField(t,o.Eq);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,n=1){if(!e)return void l(t,i,r,n);const{data:o,indices:a}=t,c=e,h=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],y=c[8],x=c[9],b=c[10],w=!(0,s.ut)(c),T=1e-6,A=1-T;if(r*=u,1===n)for(let t=0;t<d;++t){const e=4*a[t],i=o[e],n=o[e+1],s=o[e+2],c=o[e+3];let l=p*i+g*n+y*s,d=f*i+_*n+x*s,M=m*i+v*n+b*s;if(w){const t=l*l+d*d+M*M;if(t<A&&t>T){const e=1/Math.sqrt(t);l*=e,d*=e,M*=e}}h[r]=l,h[r+1]=d,h[r+2]=M,h[r+3]=c,r+=u}else for(let t=0;t<d;++t){const e=4*a[t],i=o[e],s=o[e+1],c=o[e+2],l=o[e+3];let d=p*i+g*s+y*c,M=f*i+_*s+x*c,C=m*i+v*s+b*c;if(w){const t=d*d+M*M+C*C;if(t<A&&t>T){const e=1/Math.sqrt(t);d*=e,M*=e,C*=e}}for(let t=0;t<n;++t)h[r]=d,h[r+1]=M,h[r+2]=C,h[r+3]=l,r+=u}}(e,i,r,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===e.size);const i=n.getField(t,o.jz)??n.getField(t,o.Eq);(0,a.vA)(!!i,`No buffer view for ${t}`),l(e,i,u);break}case"profileAuxData":{(0,a.vA)(3===e.size);const i=n.getField(t,o.EC)??n.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),h(e,i,u);break}}}},26292(t,e,i){i.d(e,{D:()=>d});var r=i(49255),n=i(22911),s=i(3871),o=i(63365);function a(t){t.code.add("\n vec3 emissionDimming(vec3 srcColor, float srcAlpha) {\n srcColor = clamp(srcColor, vec3(0.0), srcColor);\n return mix(vec3(1.0), srcColor, srcAlpha);\n }\n ")}var c=i(31821),h=i(26934);function l(t,e){e.useFloatBlend?t.code.add(c.H`float ditherNoise(vec4 color) { return 0.0; }`):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}var u=i(66211);function d(t,e){t.include(s.Q,e),t.include(n.NL,e);const{fragment:i,outputs:d}=t;i.include(o.a);const{output:p,hasEmission:f,discardInvisibleFragments:m,oitPremultipliedAlpha:g,snowCover:_,useFloatBlend:v,emissionDimmingPass:y}=e,x=11===p,b=(0,r.Sp)(p),w=(0,r.Rb)(p),T=(0,r._o)(p)&&!b;let A=0;(T||b)&&d.add("fragColor","vec4",A++),f&&d.add("fragEmission","vec4",A++),b&&d.add("fragAlpha","float",A++),i.include(h.Q),i.include(u.H,e),i.include(l,e),y&&i.include(a),i.code.add(c.H`
250
250
  void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,c.If)(_,", float snow")}) {
251
251
  ${(0,c.If)(x,"finalColor.a = 1.0;")}
252
252
  ${(0,c.If)(m,"if (finalColor.a < alphaCutoff) { discard; }")}
@@ -259,4 +259,4 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
259
259
  calculateOcclusionAndOutputHighlight();
260
260
  ${(0,c.If)(x,"outputObjectAndLayerIdColor();")}
261
261
  }
262
- `)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q)}},2016(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>Rt});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let m=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,s.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),y=i(16930),x=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(71351));i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),M=i(48163),S=i(5443),C=i(39829),E=i(95108),R=i(37585);function I(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(D,e[0],e[0])&&O(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(D,e[i],r)){case 1:O(t,r);break;case 3:O(t,(0,M.o8)(D));break;case 2:O(t,(0,M.o8)(D)),O(t,r)}}}}function O(t,e){0!==t.length&&(0,R.aI)(t.at(-1),e)||t.push(e)}const D=(0,M.vt)();var P=i(11964),F=i(27921);const B=(0,v.vt)(),N=(0,v.vt)();function L(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function U(t,e,i,r,n){let s=(0,_.S8)(B,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(N,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,N);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(N,s,n),c=((0,_.Om)(N,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function H(t,e,i,r){(0,_.Re)(z,i,e),(0,F.T7)(r,(0,P.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),V=(0,v.fA)(0,1,0),k=(0,v.fA)(0,0,1),G=(0,g.vt)(),W=(0,v.vt)(),$=(0,v.vt)();function Z(t,e,i,r=L()){const{direction:n,up:s}=r;return(0,A.N9)(G,-(0,l.kU)(e)),(0,A.eL)(G,G,(0,l.kU)(i)),(0,_.Z0)(n,k,G),(0,_.hs)(n,n,-1),(0,_.Z0)(s,V,G),r}function j(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const q=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return U(e,i,r,k,V)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=Z(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:Z,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,T.LV)(e.origin,e.direction),n,q)||j(q,i,r,e.endpoint,n),H(q,o,q,c),a.push((0,M.fA)(q[0],q[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(q,t[0],t[1],0),e.fromRenderCoords(q,q,i),[q[0],q[1]]));return r.length<=2?new C.A({spatialReference:i}):(r.push(r[0].slice()),(0,E.$3)(r)||r.reverse(),new C.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return I(i,t,e,0),I(r,i,e,1),I(i,r,e,2),I(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,x.g)(e,W,s),(0,x.g)(e,$,s),W[0]-=i/2,$[0]+=i/2,W[1]-=r/2,$[1]+=r/2,(0,b.F)(W,s,W,o),(0,b.F)($,s,$,o),n?(n.xmin=W[0],n.ymin=W[1],n.xmax=$[0],n.ymax=$[1],n.spatialReference=o):n=new S.A(W[0],W[1],$[0],$[1],o),n}},Symbol.toStringTag,{value:"Module"}));var X=i(78955),Y=i(91829),Q=i(34304),K=i(17136),J=i(94008),tt=i(28735),et=i(82919);class it{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,et.vt)(),this._points=(0,et.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new J.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,et.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,et.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,et.m7)(this.frustum,t)}intersectsRay(t){return(0,et.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,et.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,et.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=et.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new J.iy,(0,T.vt)(),new S.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,g.vt)(),ft=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=L()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:n,direction:s}=r;return(0,_.$A)(n,ft,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,pt),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function yt(t,e){const i=[],r=[],n=(0,Q.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,P.Cr)(o,a,Ct),h=(0,F.vE)(e,c.origin,c.vector,0,Mt);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,F.Qj)(e),l=(0,_.Ln)((0,v.vt)(),Mt,c,t*n),u=(0,_.Ln)((0,v.vt)(),Mt,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const xt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},bt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),At=(0,v.vt)(),Mt=(0,v.vt)(),St=new J.iy,Ct=(0,P.vt)(),Et=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=ft,s=mt;return(0,_.S8)(n,t),(0,_.$A)(mt,n,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,n,dt),(0,_.$A)(s,mt,n),U(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=ft;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(s);let m;if(Math.abs(c)<1e-8)m=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=p*o,y=o*o*(d*d),x=u*u*y,b=m-g,w=b*b,T=x*(x+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,m/f),n.tilt=0,vt(n,t);const A=Math.sqrt(T),M=s[1]*b,S=x+w;let C;if(C=u>0?-A+M:A+M,Math.abs(S)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=C/S;const E=h*h*y,R=d*o,I=u*R*n.eye[1],O=n.eye[1]*n.eye[1],D=1-O,P=Math.sqrt(D),F=x*O+E-2*I*P*b+D*w;return Math.abs(F)<1e-8?((0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(D*(m*s[0]-g*s[0])-R*P*(s[0]*n.eye[1]*u+s[2]*h))/F,n.eye[2]=(D*(m*s[2]-g*s[2])-R*P*(s[2]*n.eye[1]*u-s[0]*h))/F,(0,_.hs)(n.eye,n.eye,m),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+s),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:m}=xt,g=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return St.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(St,e)}(t),y=(0,l.qE)((u-d)/(p-d),0,1),x=Math.round((0,l.Cc)(f,m,y)),b=r.aboveGround,w=n.planes[5],A=[],M=(0,F.O_)(v.uY,bt,(0,F.vt)()),S=(0,F.O_)(v.uY,wt,(0,F.vt)());(0,X.hZ)(Et,0,0,0,0);const R=t=>{};for(let t=0;t<4;t++){const e=1===t&&!b||3===t&&b?1-g:0,r=1===t&&b||3===t&&!b?g:1,o=n.lines[t],a=n.lines[3===t?0:t+1];for(let n=0;n<x;n++){const h=n/x,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(At,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,T.LV)(d,p),s,Mt),H(Mt,c,Mt,w),A.push((0,v.o8)(Mt)),0!==A.length&&R((0,_.lo)(A.at(-1),Mt));const f=((0,F.Tj)(M,Mt)?1:0)|((0,F.Tj)(S,Mt)?2:0);Et[f]=1}}A.length>2&&(0,_.lo)(A[0],A.at(-1));const I=function(t,e,i){const r=2*(0,Q.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,Mt,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,Mt[1]]),n.push([null,Mt[1]]),s=!0):n.push([Mt[0],Mt[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,E.$3)(n)||n.reverse(),n})}((0,X.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...yt(r,e));return i}(yt(A,M),S):[A],i,o);return new C.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=p-f,o=p+f;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function x(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=x(a),h=x(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=K.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:y.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new S.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,tt.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"};Array.from(Object.values(Ot)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),y=i(44280);function x(t,e,i){t.worldUpAtPosition(e,b),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,b)/r)}const b=(0,f.vt)(),w=(0,f.vt)();var T;let A=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.aI)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(E,t.eye,t.center),(0,p.jb)(R,this.eye,this.center);const i=(0,p.Om)(E,R),r=(0,p.uE)(E),n=(0,p.uE)(R),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,p.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,y.gr)(this.viewForward,(0,p.Re)(E,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==S&&(0,p.C)(S,t),S[3]=1,(0,m.Z0)(S,S,this.projectionMatrix);const i=Math.abs(S[3]);(0,p.hs)(S,S,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*S[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*S[1]),e[2]=.5*(S[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;S[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],S[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],S[2]=(2*t[2]-1)*t[3],S[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(S,S,this.inverseProjectionMatrix),e[0]=S[0],e[1]=S[1],e[2]=S[2])}projectToScreen(t,e){return this.projectToRenderScreen(t,I),this.renderToScreen(I,e),e}projectToRenderScreen(t,e){if(S[0]=t[0],S[1]=t[1],S[2]=t[2],S[3]=1,(0,m.Z0)(S,S,this.viewProjectionMatrix),0===S[3])return null;const i=S;(0,p.hs)(i,i,1/Math.abs(S[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,I),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return S[0]=2*(t[0]-i[0])/i[2]-1,S[1]=2*(t[1]-i[1])/i[3]-1,S[2]=2*t[2]-1,S[3]=1,(0,m.Z0)(S,S,C),0===S[3]?null:(e[0]=S[0]/S[3],e[1]=S[1]/S[3],e[2]=S[2]/S[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-x(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,p.Re)(E,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(E,this.center))>.9999*(0,p.Bw)(E)*t||((0,p.$A)(R,E,this.center),(0,p.$A)(R,R,E),(0,p.S8)(R,R),(0,p.t2)(this._up,R)||((0,p.C)(this._up,R),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(E,this.eye,this.center),Math.abs(E[2])<=.9999&&((0,p.hs)(E,E,E[2]),(0,p.hZ)(E,-E[0],-E[1],1-E[2]),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"relativeElevation",void 0),A=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],A);const M=A,S=(0,g.vt)(),C=(0,l.vt)(),E=(0,f.vt)(),R=(0,f.vt)(),I=(0,a.r_)()},48375(t,e,i){i.d(e,{A:()=>P});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(2016),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(76284),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class y{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class x{constructor(t,e,i){if(this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===A(t)||null!=t&&"samples"in t}(e)?new y(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new y(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._initialized){const e=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,0,i):this._framebufferTexture2D(r.glName,e,t,36160,0))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,C(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,C(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebufferObject(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o){const{gl:a}=this._context,c=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(M(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._initialized&&(M(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const i=e.createFramebuffer();if(e.bindFramebuffer(t,i),this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=S(e);35866===r?this._framebufferTextureLayer(e.glName,i,t,0,0):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=C(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,S(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160,n=0){this._context.gl.framebufferTexture2D(r,e,i,t,n)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0,n=0){this._context.gl.framebufferTextureLayer(i,e,t,r,n)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,C(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),M(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){M(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===x._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;x._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>x._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${x._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===A(t)}function w(t){return 2===A(t)}function T(t){return 0===A(t)}function A(t){return null!=t&&"type"in t?t.type:null}function M(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function S(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function C(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let D=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D);const P=D},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}}},48852(t,e,i){i.d(e,{g:()=>u});var r=i(4576),n=i(44208),s=i(53966),o=i(34275),a=i(94656),c=i(63907);const h=()=>s.A.getLogger("esri.views.webgl.BufferObject"),l=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class u{static createIndex(t,e,i){return new u(t,34963,e,i)}static createUniform(t,e,i){return new u(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new u(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new u(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new u(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(c.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case c.pe.UNSIGNED_INT:return this._sizeBytes/4;case c.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case c.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return l?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c.vt.BufferObject,this),this._context=null):this._glName&&h().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case c.pe.UNSIGNED_SHORT:t*=2;break;case c.pe.UNSIGNED_INT:t*=4;case c.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,o.mg)(t)?this._indexType=c.pe.UNSIGNED_BYTE:(0,o.jq)(t)?this._indexType=c.pe.UNSIGNED_SHORT:(0,o.XJ)(t)&&(this._indexType=c.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,a.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,a.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&h().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){await this._context.clientWaitAsync(),this.getSubData(t,e,i,r)}}},65786(t,e,i){i.d(e,{Y:()=>r});const r=class{};new r},14113(t,e,i){i.d(e,{N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,e,n)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){return this._entries}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},76284(t,e,i){i.d(e,{A:()=>A});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171);const d=()=>s.A.getLogger("esri/views/webgl/textureUtils");function p(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&d().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(f(n)||m(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&d().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&d().error("Depth textures cannot sample mipmaps"):(9728!==r&&d().error("Depth textures without filtering must use NEAREST filtering"),i&&d().error("Depth textures without filtering cannot use compare function"))}}function f(t){return(0,a.a4)(l.SB,t)}function m(t){return(0,a.a4)(l.iE,t)}function g(t){return null!=t&&"type"in t&&"compressed"===t.type}function _(t){return null!=t&&!g(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function v(t){return 32879===t||35866===t}function y(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function x(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case l.ld.FLOAT:switch(t.pixelFormat){case 6408:return l.H0.RGBA32F;case 6407:return l.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case l.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return l.H0.RGBA8;case 6407:return l.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?l.iE.DEPTH24_STENCIL8:6402===e?l.SB.DEPTH_COMPONENT24:e,t.internalFormat}class b extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new b(t,e)}}const w=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),T=()=>s.A.getLogger("esri/views/webgl/Texture");class A{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=b.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return w?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!g(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!g(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=x(c);const{context:h,pixelFormat:l,dataType:u,target:d,isImmutable:p}=c;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=h.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:m}=h;a&&(n&&s||T().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),m.pixelStorei(m.UNPACK_SKIP_ROWS,a)),_(o)?m.texSubImage2D(d,t,e,i,n,s,l,u,o):g(o)?m.compressedTexSubImage2D(d,t,e,i,n,s,c.internalFormat,o.levels[t]):m.texSubImage2D(d,t,e,i,n,s,l,u,o),a&&m.pixelStorei(m.UNPACK_SKIP_ROWS,0),h.bindTexture(f,A.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=x(h);const{context:l,pixelFormat:u,dataType:d,isImmutable:p,target:f}=h;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");v(f)||T().warn("Attempting to set 3D texture data on a non-3D texture");const m=l.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=l;if(g(c))c=c.levels[t],_.compressedTexSubImage3D(f,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;_.texSubImage3D(f,t,e,i,n,s,o,a,u,d,r)}l.bindTexture(m,A.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,p(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,A.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,p(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,p(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),p(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),p(i);const s=i.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,c=v(o);if(_(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:u}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(c&&null==u)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=x(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,u),g(t)){if(!function(t){return null!=t&&(0,a.a4)(l.CQ,t)}(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,u,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,A.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=x(r);const n=v(e),{width:s,height:o,depth:a}=function(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=y(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!function(t){return l.XN.includes(t)}(e)&&!f(e)&&!m(e))throw new r.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=i?y(t,n,s,o):1;if(v(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=v(t),{isImmutable:l,pixelFormat:u,dataType:d}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,d,i)}else c.texSubImage2D(t,e,0,0,n,s,u,d,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,d,l)}else c.texImage2D(t,e,i,n,s,0,u,d,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=v(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o}=this._descriptor,a=this._descriptor.compress?.compressionTracker,h=this._descriptor.compress?.compressionCallback,{compressedTextureETC:l,compressedTextureS3TC:u}=r.capabilities;if(!A.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!l&&!u)return;this.abortCompression();const d=new AbortController;let p;this._compressionAbortController=d,a?.increment();let f=!1,m=!1;try{t instanceof ImageBitmap?p=t:t instanceof Uint8Array?(p=t.buffer,f=this.descriptor.flipped):(p=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(d),m=!0);const r={data:p,width:e,height:i,needsFlip:f,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:o,hasETC:!!l,hasS3TC:!!u},a=await A.compressionWorkerHandle.invoke(r,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),h?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||T().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m&&p instanceof ImageBitmap&&p.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"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))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),n=i(53966),s=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>T,RC:()=>o,T8:()=>a,Uy:()=>p,Xt:()=>u,iD:()=>s,kn:()=>f,nk:()=>d,p3:()=>n,uR:()=>c}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,1),h={face:1029,mode:2305},l={face:1028,mode:2305},u=t=>2===t?h:1===t?l:null;function d(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}const p={zNear:0,zFar:1},f={r:!0,g:!0,b:!0,a:!0};function m(t){return S.intern(t)}function g(t){return E.intern(t)}function _(t){return I.intern(t)}function v(t){return D.intern(t)}function y(t){return F.intern(t)}function x(t){return N.intern(t)}function b(t){return U.intern(t)}function w(t){return z.intern(t)}function T(t){return k.intern(t)}class A{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function M(t){return"["+t.join(",")+"]"}const S=new A(C,t=>({__tag:"Blending",...t}));function C(t){return t?M([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const E=new A(R,t=>({__tag:"Culling",...t}));function R(t){return t?M([t.face,t.mode]):null}const I=new A(O,t=>({__tag:"PolygonOffset",...t}));function O(t){return t?M([t.factor,t.units]):null}const D=new A(P,t=>({__tag:"DepthTest",...t}));function P(t){return t?M([t.func]):null}const F=new A(B,t=>({__tag:"StencilTest",...t}));function B(t){return t?M([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const N=new A(L,t=>({__tag:"DepthWrite",...t}));function L(t){return t?M([t.zNear,t.zFar]):null}const U=new A(H,t=>({__tag:"ColorWrite",...t}));function H(t){return t?M([t.r,t.g,t.b,t.a]):null}const z=new A(V,t=>({__tag:"StencilWrite",...t}));function V(t){return t?M([t.mask]):null}const k=new A(function(t){return t?M([C(t.blending),R(t.culling),O(t.polygonOffset),P(t.depthTest),B(t.stencilTest),L(t.depthWrite),H(t.colorWrite),V(t.stencilWrite)]):null},t=>({blending:m(t.blending),culling:g(t.culling),polygonOffset:_(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:y(t.stencilTest),depthWrite:x(t.depthWrite),colorWrite:b(t.colorWrite),stencilWrite:w(t.stencilWrite)}))},49788(t,e,i){i.d(e,{Q:()=>r});const r=1/255.5}}]);
262
+ `)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q)}},2016(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>Rt});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let m=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,s.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),y=i(16930),x=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(71351));i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),M=i(48163),C=i(5443),S=i(39829),E=i(95108),R=i(37585);function I(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(D,e[0],e[0])&&O(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(D,e[i],r)){case 1:O(t,r);break;case 3:O(t,(0,M.o8)(D));break;case 2:O(t,(0,M.o8)(D)),O(t,r)}}}}function O(t,e){0!==t.length&&(0,R.aI)(t.at(-1),e)||t.push(e)}const D=(0,M.vt)();var F=i(11964),P=i(27921);const N=(0,v.vt)(),B=(0,v.vt)();function L(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function U(t,e,i,r,n){let s=(0,_.S8)(N,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(B,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,B);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(B,s,n),c=((0,_.Om)(B,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function H(t,e,i,r){(0,_.Re)(z,i,e),(0,P.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),V=(0,v.fA)(0,1,0),k=(0,v.fA)(0,0,1),G=(0,g.vt)(),W=(0,v.vt)(),$=(0,v.vt)();function Z(t,e,i,r=L()){const{direction:n,up:s}=r;return(0,A.N9)(G,-(0,l.kU)(e)),(0,A.eL)(G,G,(0,l.kU)(i)),(0,_.Z0)(n,k,G),(0,_.hs)(n,n,-1),(0,_.Z0)(s,V,G),r}function j(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const q=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return U(e,i,r,k,V)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=Z(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:Z,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,T.LV)(e.origin,e.direction),n,q)||j(q,i,r,e.endpoint,n),H(q,o,q,c),a.push((0,M.fA)(q[0],q[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(q,t[0],t[1],0),e.fromRenderCoords(q,q,i),[q[0],q[1]]));return r.length<=2?new S.A({spatialReference:i}):(r.push(r[0].slice()),(0,E.$3)(r)||r.reverse(),new S.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return I(i,t,e,0),I(r,i,e,1),I(i,r,e,2),I(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,x.g)(e,W,s),(0,x.g)(e,$,s),W[0]-=i/2,$[0]+=i/2,W[1]-=r/2,$[1]+=r/2,(0,b.F)(W,s,W,o),(0,b.F)($,s,$,o),n?(n.xmin=W[0],n.ymin=W[1],n.xmax=$[0],n.ymax=$[1],n.spatialReference=o):n=new C.A(W[0],W[1],$[0],$[1],o),n}},Symbol.toStringTag,{value:"Module"}));var X=i(78955),Q=i(91829),Y=i(34304),K=i(17136),J=i(94008),tt=i(28735),et=i(82919);class it{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,et.vt)(),this._points=(0,et.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new J.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,et.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,et.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,et.m7)(this.frustum,t)}intersectsRay(t){return(0,et.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,et.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,et.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=et.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new J.iy,(0,T.vt)(),new C.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,g.vt)(),ft=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=L()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:n,direction:s}=r;return(0,_.$A)(n,ft,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,pt),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function yt(t,e){const i=[],r=[],n=(0,Y.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,St),h=(0,P.vE)(e,c.origin,c.vector,0,Mt);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,P.Qj)(e),l=(0,_.Ln)((0,v.vt)(),Mt,c,t*n),u=(0,_.Ln)((0,v.vt)(),Mt,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const xt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},bt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),At=(0,v.vt)(),Mt=(0,v.vt)(),Ct=new J.iy,St=(0,F.vt)(),Et=(0,Q.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=ft,s=mt;return(0,_.S8)(n,t),(0,_.$A)(mt,n,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,n,dt),(0,_.$A)(s,mt,n),U(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=ft;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(s);let m;if(Math.abs(c)<1e-8)m=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=p*o,y=o*o*(d*d),x=u*u*y,b=m-g,w=b*b,T=x*(x+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,m/f),n.tilt=0,vt(n,t);const A=Math.sqrt(T),M=s[1]*b,C=x+w;let S;if(S=u>0?-A+M:A+M,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=S/C;const E=h*h*y,R=d*o,I=u*R*n.eye[1],O=n.eye[1]*n.eye[1],D=1-O,F=Math.sqrt(D),P=x*O+E-2*I*F*b+D*w;return Math.abs(P)<1e-8?((0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(D*(m*s[0]-g*s[0])-R*F*(s[0]*n.eye[1]*u+s[2]*h))/P,n.eye[2]=(D*(m*s[2]-g*s[2])-R*F*(s[2]*n.eye[1]*u-s[0]*h))/P,(0,_.hs)(n.eye,n.eye,m),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+s),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:m}=xt,g=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return Ct.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(Ct,e)}(t),y=(0,l.qE)((u-d)/(p-d),0,1),x=Math.round((0,l.Cc)(f,m,y)),b=r.aboveGround,w=n.planes[5],A=[],M=(0,P.O_)(v.uY,bt,(0,P.vt)()),C=(0,P.O_)(v.uY,wt,(0,P.vt)());(0,X.hZ)(Et,0,0,0,0);const R=t=>{};for(let t=0;t<4;t++){const e=1===t&&!b||3===t&&b?1-g:0,r=1===t&&b||3===t&&!b?g:1,o=n.lines[t],a=n.lines[3===t?0:t+1];for(let n=0;n<x;n++){const h=n/x,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(At,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,T.LV)(d,p),s,Mt),H(Mt,c,Mt,w),A.push((0,v.o8)(Mt)),0!==A.length&&R((0,_.lo)(A.at(-1),Mt));const f=((0,P.Tj)(M,Mt)?1:0)|((0,P.Tj)(C,Mt)?2:0);Et[f]=1}}A.length>2&&(0,_.lo)(A[0],A.at(-1));const I=function(t,e,i){const r=2*(0,Y.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,Mt,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,Mt[1]]),n.push([null,Mt[1]]),s=!0):n.push([Mt[0],Mt[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,E.$3)(n)||n.reverse(),n})}((0,X.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...yt(r,e));return i}(yt(A,M),C):[A],i,o);return new S.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=p-f,o=p+f;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function x(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=x(a),h=x(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=K.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:y.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new C.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,tt.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"};Array.from(Object.values(Ot)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),y=i(44280);function x(t,e,i){t.worldUpAtPosition(e,b),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,b)/r)}const b=(0,f.vt)(),w=(0,f.vt)();var T;let A=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.aI)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(E,t.eye,t.center),(0,p.jb)(R,this.eye,this.center);const i=(0,p.Om)(E,R),r=(0,p.uE)(E),n=(0,p.uE)(R),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,p.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,y.gr)(this.viewForward,(0,p.Re)(E,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==C&&(0,p.C)(C,t),C[3]=1,(0,m.Z0)(C,C,this.projectionMatrix);const i=Math.abs(C[3]);(0,p.hs)(C,C,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*C[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*C[1]),e[2]=.5*(C[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;C[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],C[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],C[2]=(2*t[2]-1)*t[3],C[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(C,C,this.inverseProjectionMatrix),e[0]=C[0],e[1]=C[1],e[2]=C[2])}projectToScreen(t,e){return this.projectToRenderScreen(t,I),this.renderToScreen(I,e),e}projectToRenderScreen(t,e){if(C[0]=t[0],C[1]=t[1],C[2]=t[2],C[3]=1,(0,m.Z0)(C,C,this.viewProjectionMatrix),0===C[3])return null;const i=C;(0,p.hs)(i,i,1/Math.abs(C[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,I),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(S,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(S,S))return null;const i=this.fullViewport;return C[0]=2*(t[0]-i[0])/i[2]-1,C[1]=2*(t[1]-i[1])/i[3]-1,C[2]=2*t[2]-1,C[3]=1,(0,m.Z0)(C,C,S),0===C[3]?null:(e[0]=C[0]/C[3],e[1]=C[1]/C[3],e[2]=C[2]/C[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-x(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,p.Re)(E,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(E,this.center))>.9999*(0,p.Bw)(E)*t||((0,p.$A)(R,E,this.center),(0,p.$A)(R,R,E),(0,p.S8)(R,R),(0,p.t2)(this._up,R)||((0,p.C)(this._up,R),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(E,this.eye,this.center),Math.abs(E[2])<=.9999&&((0,p.hs)(E,E,E[2]),(0,p.hZ)(E,-E[0],-E[1],1-E[2]),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"relativeElevation",void 0),A=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],A);const M=A,C=(0,g.vt)(),S=(0,l.vt)(),E=(0,f.vt)(),R=(0,f.vt)(),I=(0,a.r_)()},48375(t,e,i){i.d(e,{A:()=>F});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(2016),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(21231),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class y{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class x{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===A(t)||null!=t&&"samples"in t}(e)?new y(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new y(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebufferObject(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebufferObject(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,S(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,S(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebufferObject(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o){const{gl:a}=this._context,c=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(M(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(M(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=C(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=S(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,C(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,S(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),M(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){M(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===x._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;x._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>x._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${x._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===A(t)}function w(t){return 2===A(t)}function T(t){return 0===A(t)}function A(t){return null!=t&&"type"in t?t.type:null}function M(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function C(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function S(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let D=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D);const F=D},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}}},48852(t,e,i){i.d(e,{g:()=>u});var r=i(4576),n=i(44208),s=i(53966),o=i(34275),a=i(94656),c=i(63907);const h=()=>s.A.getLogger("esri.views.webgl.BufferObject"),l=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class u{static createIndex(t,e,i){return new u(t,34963,e,i)}static createUniform(t,e,i){return new u(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new u(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new u(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new u(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(c.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case c.pe.UNSIGNED_INT:return this._sizeBytes/4;case c.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case c.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return l?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c.vt.BufferObject,this),this._context=null):this._glName&&h().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case c.pe.UNSIGNED_SHORT:t*=2;break;case c.pe.UNSIGNED_INT:t*=4;case c.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,o.mg)(t)?this._indexType=c.pe.UNSIGNED_BYTE:(0,o.jq)(t)?this._indexType=c.pe.UNSIGNED_SHORT:(0,o.XJ)(t)&&(this._indexType=c.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,a.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,a.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&h().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){await this._context.clientWaitAsync(),this.getSubData(t,e,i,r)}}},65786(t,e,i){i.d(e,{Y:()=>r});const r=class{};new r},14113(t,e,i){i.d(e,{N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,e,n)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){return this._entries}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>g});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class p extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new p(t,e)}}const f=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),m=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=p.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return f?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:p,isImmutable:f}=c;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(p,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(p,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(p,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:p,isImmutable:f,target:_}=h;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||m().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:y}=l;if((0,d.Qp)(c))c=c.levels[t],y.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;y.texSubImage3D(_,t,e,i,n,s,o,a,u,p,r)}l.bindTexture(v,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:p}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,p,i)}else c.texSubImage2D(t,e,0,0,n,s,u,p,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,p,l)}else c.texImage2D(t,e,i,n,s,0,u,p,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o}=this._descriptor,a=this._descriptor.compress?.compressionTracker,h=this._descriptor.compress?.compressionCallback,{compressedTextureETC:l,compressedTextureS3TC:u}=r.capabilities;if(!g.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!l&&!u)return;this.abortCompression();const d=new AbortController;let p;this._compressionAbortController=d,a?.increment();let f=!1,_=!1;try{t instanceof ImageBitmap?p=t:t instanceof Uint8Array?(p=t.buffer,f=this.descriptor.flipped):(p=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(d),_=!0);const r={data:p,width:e,height:i,needsFlip:f,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:o,hasETC:!!l,hasS3TC:!!u},a=await g.compressionWorkerHandle.invoke(r,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),h?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||m().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_&&p instanceof ImageBitmap&&p.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"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))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),n=i(53966),s=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>T,RC:()=>o,T8:()=>a,Uy:()=>p,Xt:()=>u,iD:()=>s,kn:()=>f,nk:()=>d,p3:()=>n,uR:()=>c}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,1),h={face:1029,mode:2305},l={face:1028,mode:2305},u=t=>2===t?h:1===t?l:null;function d(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}const p={zNear:0,zFar:1},f={r:!0,g:!0,b:!0,a:!0};function m(t){return C.intern(t)}function g(t){return E.intern(t)}function _(t){return I.intern(t)}function v(t){return D.intern(t)}function y(t){return P.intern(t)}function x(t){return B.intern(t)}function b(t){return U.intern(t)}function w(t){return z.intern(t)}function T(t){return k.intern(t)}class A{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function M(t){return"["+t.join(",")+"]"}const C=new A(S,t=>({__tag:"Blending",...t}));function S(t){return t?M([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const E=new A(R,t=>({__tag:"Culling",...t}));function R(t){return t?M([t.face,t.mode]):null}const I=new A(O,t=>({__tag:"PolygonOffset",...t}));function O(t){return t?M([t.factor,t.units]):null}const D=new A(F,t=>({__tag:"DepthTest",...t}));function F(t){return t?M([t.func]):null}const P=new A(N,t=>({__tag:"StencilTest",...t}));function N(t){return t?M([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const B=new A(L,t=>({__tag:"DepthWrite",...t}));function L(t){return t?M([t.zNear,t.zFar]):null}const U=new A(H,t=>({__tag:"ColorWrite",...t}));function H(t){return t?M([t.r,t.g,t.b,t.a]):null}const z=new A(V,t=>({__tag:"StencilWrite",...t}));function V(t){return t?M([t.mask]):null}const k=new A(function(t){return t?M([S(t.blending),R(t.culling),O(t.polygonOffset),F(t.depthTest),N(t.stencilTest),L(t.depthWrite),H(t.colorWrite),V(t.stencilWrite)]):null},t=>({blending:m(t.blending),culling:g(t.culling),polygonOffset:_(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:y(t.stencilTest),depthWrite:x(t.depthWrite),colorWrite:b(t.colorWrite),stencilWrite:w(t.stencilWrite)}))},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>g,Kv:()=>f,QE:()=>c,QJ:()=>u,Qp:()=>p,mq:()=>_,re:()=>m,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function p(t){return null!=t&&"type"in t&&"compressed"===t.type}function f(t){return null!=t&&!p(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function m(t){return 32879===t||35866===t}function g(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){i.d(e,{Q:()=>r});const r=1/255.5}}]);