@arcgis/core 4.28.0-next.20231002 → 4.28.0-rc.0

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 (257) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/02120d192eafd7612475.js +1 -0
  3. package/assets/esri/core/workers/chunks/{4d967e98d229f18d61f5.js → 09e8babe75407c2e64c4.js} +1 -1
  4. package/assets/esri/core/workers/chunks/0beebbb0c6dad0e742d7.js +1 -0
  5. package/assets/esri/core/workers/chunks/0d8ca51043c7784aed96.js +1 -0
  6. package/assets/esri/core/workers/chunks/112e89da628bdea5355c.js +1 -0
  7. package/assets/esri/core/workers/chunks/{5e9edd06e624f385fa4b.js → 121a9e148509f2fe2210.js} +1 -1
  8. package/assets/esri/core/workers/chunks/1856d16d738f44f58084.js +1 -0
  9. package/assets/esri/core/workers/chunks/{0526d623d0b4c12929bd.js → 18ab9cc85a1a7988fdfd.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{7c960a2694c4c3123acf.js → 1a36703ebe934749646e.js} +1 -1
  11. package/assets/esri/core/workers/chunks/24a0cf405195421c0d06.js +1 -0
  12. package/assets/esri/core/workers/chunks/24ff267cf253feac22de.js +1 -0
  13. package/assets/esri/core/workers/chunks/{3c8613596659801fd6ab.js → 29cab345819ec02ed60a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{169a61c6e128b8a16021.js → 2c560a075d9ef2069ed1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2f8e71dac98135bbc3e6.js +1 -0
  16. package/assets/esri/core/workers/chunks/341fb51b2165522963b3.js +1 -0
  17. package/assets/esri/core/workers/chunks/{ad8e0f82cb1feafa9e2f.js → 36ab90fb34b9716a9983.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2688213bbff536da7917.js → 3ea0b872436fce84b927.js} +1 -1
  19. package/assets/esri/core/workers/chunks/40633064c290dc2af9ea.js +1 -0
  20. package/assets/esri/core/workers/chunks/42ec4c80b0c2944cd65c.js +1 -0
  21. package/assets/esri/core/workers/chunks/44b870cb53ba68b17c32.js +1 -0
  22. package/assets/esri/core/workers/chunks/{8a7fa4e8b0d14da7c9eb.js → 4cc680fe4c9c39d2f853.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{6730c9f0890191a95fdb.js → 4d81aa50d90f5701a343.js} +1 -1
  24. package/assets/esri/core/workers/chunks/4e0bf30da4281070e453.js +1 -0
  25. package/assets/esri/core/workers/chunks/4e6bf1efe3b0b474cbb4.js +1 -0
  26. package/assets/esri/core/workers/chunks/52cef7cd3aaaa4f45c94.js +1 -0
  27. package/assets/esri/core/workers/chunks/{4e04242e707c0eb3aa4a.js → 5a3ccc0a19ac8fa9e524.js} +1 -1
  28. package/assets/esri/core/workers/chunks/5e907ec0ee1565b5fbbc.js +1 -0
  29. package/assets/esri/core/workers/chunks/66ba749ab0a631bbfdec.js +1 -0
  30. package/assets/esri/core/workers/chunks/6b14d89d689a21014aec.js +1 -0
  31. package/assets/esri/core/workers/chunks/6b1856303d1562f05100.js +1 -0
  32. package/assets/esri/core/workers/chunks/{576269fd1f9049876aa1.js → 6b7b5544ed1f9a84623f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/710a6268de62003af825.js +1 -0
  34. package/assets/esri/core/workers/chunks/77923afde29ae1ff10ca.js +1 -0
  35. package/assets/esri/core/workers/chunks/784ffd52315a4d55d683.js +1 -0
  36. package/assets/esri/core/workers/chunks/7cf7f2b991a7cbdad2ce.js +1 -0
  37. package/assets/esri/core/workers/chunks/{70dffbf49b0633b1a5f1.js → 8f3680fee85a05839489.js} +1 -1
  38. package/assets/esri/core/workers/chunks/97aecf210938015cc7a3.js +1 -0
  39. package/assets/esri/core/workers/chunks/{c7ebd5d431fb996bfcee.js → 9f8207c82a17508a87a8.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{557305b91f77569ce664.js → a01ffe03b1465c21b9e6.js} +1 -1
  41. package/assets/esri/core/workers/chunks/a298c9031962951e55a9.js +1 -0
  42. package/assets/esri/core/workers/chunks/{329669a9beda89b028dd.js → a5a7bbdd8298016535bc.js} +1 -1
  43. package/assets/esri/core/workers/chunks/a877a4826cd6a46ec99b.js +1 -0
  44. package/assets/esri/core/workers/chunks/ad38e456a7cee940a165.js +1 -0
  45. package/assets/esri/core/workers/chunks/adfbc168be8c49b51e1b.js +1 -0
  46. package/assets/esri/core/workers/chunks/b0526633a93ef69ec47b.js +1 -0
  47. package/assets/esri/core/workers/chunks/b99bc08a01e9250b0a31.js +1 -0
  48. package/assets/esri/core/workers/chunks/{36c4b4c3eca57417da2c.js → c260ad3434bb00ba64a7.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{39922ce232338de076ae.js → c459c8d8630eb4b955b1.js} +1 -1
  50. package/assets/esri/core/workers/chunks/c92e75b79aff7b505b31.js +1 -0
  51. package/assets/esri/core/workers/chunks/ca85e88dad30b5f2956b.js +1 -0
  52. package/assets/esri/core/workers/chunks/{8e56d40691b6bf75d7cc.js → ce409944221a784ddb61.js} +1 -1
  53. package/assets/esri/core/workers/chunks/d13f75f233cf313e5a1d.js +1 -0
  54. package/assets/esri/core/workers/chunks/d60d5f006375f7fcc88c.js +1 -0
  55. package/assets/esri/core/workers/chunks/{77958089748dc31757cf.js → d6ded127949160103f69.js} +1 -1
  56. package/assets/esri/core/workers/chunks/d8c696da42f8f8919b83.js +1 -0
  57. package/assets/esri/core/workers/chunks/{304c81f6297ecba3a324.js → d95eed98316e59f8f35d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/df7267892b6e0493e1d7.js +1 -0
  59. package/assets/esri/core/workers/chunks/{52dca349e1a45555954d.js → e52d5a48e83d8df36f92.js} +1 -1
  60. package/assets/esri/core/workers/chunks/e8688b6cc3b3c1010b43.js +1 -0
  61. package/assets/esri/core/workers/chunks/e8c7cc974420c0b92d0e.js +1 -0
  62. package/assets/esri/core/workers/chunks/{b7ef554b1213307499fc.js → e93442c6d92229f3a4b0.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{ef5772ca1848d6d01b88.js → eda86faa708cfe4c9f9a.js} +1 -1
  64. package/assets/esri/core/workers/chunks/f2718e260f594537f7fd.js +1 -0
  65. package/assets/esri/core/workers/chunks/f6b7036114b1d754fdd9.js +1 -0
  66. package/assets/esri/core/workers/chunks/{c4631241dc777ca77aaa.js → f6c0680c535c5a3c73ee.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{a0ea1d3e22d52b8a59a8.js → fa6103e3d4e857b0035b.js} +9 -9
  68. package/assets/esri/core/workers/chunks/fac3e57784d7f37053af.js +1 -0
  69. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  70. package/assets/esri/t9n/common.json +1 -1
  71. package/assets/esri/t9n/common_ar.json +1 -1
  72. package/assets/esri/t9n/common_bg.json +1 -1
  73. package/assets/esri/t9n/common_bs.json +1 -1
  74. package/assets/esri/t9n/common_ca.json +1 -1
  75. package/assets/esri/t9n/common_cs.json +1 -1
  76. package/assets/esri/t9n/common_da.json +1 -1
  77. package/assets/esri/t9n/common_de.json +1 -1
  78. package/assets/esri/t9n/common_el.json +1 -1
  79. package/assets/esri/t9n/common_en.json +1 -1
  80. package/assets/esri/t9n/common_es.json +1 -1
  81. package/assets/esri/t9n/common_et.json +1 -1
  82. package/assets/esri/t9n/common_fi.json +1 -1
  83. package/assets/esri/t9n/common_fr.json +1 -1
  84. package/assets/esri/t9n/common_he.json +1 -1
  85. package/assets/esri/t9n/common_hr.json +1 -1
  86. package/assets/esri/t9n/common_hu.json +1 -1
  87. package/assets/esri/t9n/common_id.json +1 -1
  88. package/assets/esri/t9n/common_it.json +1 -1
  89. package/assets/esri/t9n/common_ja.json +1 -1
  90. package/assets/esri/t9n/common_ko.json +1 -1
  91. package/assets/esri/t9n/common_lt.json +1 -1
  92. package/assets/esri/t9n/common_lv.json +1 -1
  93. package/assets/esri/t9n/common_nb.json +1 -1
  94. package/assets/esri/t9n/common_nl.json +1 -1
  95. package/assets/esri/t9n/common_pl.json +1 -1
  96. package/assets/esri/t9n/common_pt-BR.json +1 -1
  97. package/assets/esri/t9n/common_pt-PT.json +1 -1
  98. package/assets/esri/t9n/common_ro.json +1 -1
  99. package/assets/esri/t9n/common_ru.json +1 -1
  100. package/assets/esri/t9n/common_sk.json +1 -1
  101. package/assets/esri/t9n/common_sl.json +1 -1
  102. package/assets/esri/t9n/common_sr.json +1 -1
  103. package/assets/esri/t9n/common_sv.json +1 -1
  104. package/assets/esri/t9n/common_th.json +1 -1
  105. package/assets/esri/t9n/common_tr.json +1 -1
  106. package/assets/esri/t9n/common_uk.json +1 -1
  107. package/assets/esri/t9n/common_vi.json +1 -1
  108. package/assets/esri/t9n/common_zh-CN.json +1 -1
  109. package/assets/esri/t9n/common_zh-HK.json +1 -1
  110. package/assets/esri/t9n/common_zh-TW.json +1 -1
  111. package/assets/esri/themes/base/widgets/_DirectionalPad.scss +2 -1
  112. package/assets/esri/themes/base/widgets/_FeatureForm.scss +0 -1
  113. package/assets/esri/themes/dark/main.css +1 -1
  114. package/assets/esri/themes/light/main.css +1 -1
  115. package/assets/esri/themes/light/view.css +1 -1
  116. package/chunks/pe-wasm.js +1 -1
  117. package/config.js +1 -1
  118. package/core/pbf.js +1 -1
  119. package/geometry/support/WKIDUnitConversion.js +1 -1
  120. package/geometry/support/plane.js +1 -1
  121. package/interfaces.d.ts +37 -39
  122. package/kernel.js +1 -1
  123. package/layers/GroupLayer.js +1 -1
  124. package/layers/SceneLayer.js +1 -1
  125. package/layers/graphics/data/QueryEngine.js +1 -1
  126. package/layers/graphics/data/QueryEngineResult.js +1 -1
  127. package/layers/graphics/editingSupport.js +1 -1
  128. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  129. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  130. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  131. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  132. package/layers/mixins/OperationalLayer.js +1 -1
  133. package/layers/save/featureLayerUtils.js +1 -1
  134. package/layers/save/groupLayerUtils.js +5 -0
  135. package/layers/save/utils.js +1 -1
  136. package/layers/support/LayerLoadContext.js +5 -0
  137. package/layers/support/featureLayerUtils.js +1 -1
  138. package/layers/support/labelFormatUtils.js +1 -1
  139. package/layers/support/layersCreator.js +1 -1
  140. package/layers/support/versionUtils.js +1 -1
  141. package/networks/UtilityNetwork.js +1 -1
  142. package/package.json +1 -1
  143. package/portal/schemas/definitions.js +1 -1
  144. package/portal/support/jsonContext.js +1 -1
  145. package/portal/support/layersLoader.js +1 -1
  146. package/portal/support/loadUtils.js +5 -0
  147. package/portal/support/portalItemUtils.js +1 -1
  148. package/portal/support/portalLayers.js +1 -1
  149. package/renderers/support/RasterSymbolizer.js +1 -1
  150. package/rest/print.js +1 -1
  151. package/support/basemapUtils.js +1 -1
  152. package/support/revision.js +1 -1
  153. package/symbols/PolygonSymbol3D.js +1 -1
  154. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  155. package/views/2d/engine/imagery/colorizer/shadedrelief.js +1 -1
  156. package/views/2d/engine/imagery/colorizer/stretch.js +1 -1
  157. package/views/2d/input/handlers/KeyPan.js +1 -1
  158. package/views/2d/input/handlers/KeyRotate.js +1 -1
  159. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  160. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  161. package/views/2d/layers/features/support/FeatureSetReaderPBFIndirect.js +1 -1
  162. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  163. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  164. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  165. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  167. package/views/3d/layers/i3s/featureEditing.js +1 -1
  168. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  169. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  170. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  171. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  172. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  173. package/views/DOMContainer.js +1 -1
  174. package/views/draw/DrawGraphicTool.js +1 -1
  175. package/views/draw/DrawOperation.js +1 -1
  176. package/views/draw/support/Box.js +1 -1
  177. package/views/draw/support/Reshape.js +1 -1
  178. package/views/input/VisibilityChange.js +5 -0
  179. package/views/interactive/sketch/constraints.js +1 -1
  180. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  181. package/views/interactive/snapping/FeatureSnappingSourceInfo.js +5 -0
  182. package/views/interactive/snapping/SnappingContext.js +1 -1
  183. package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
  184. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  185. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  186. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorkerHandle.js +1 -1
  187. package/views/interactive/snapping/snappingUtils.js +1 -1
  188. package/webdoc/support/saveUtils.js +1 -1
  189. package/webdoc/webdocSaveUtils.js +1 -1
  190. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  191. package/widgets/DirectionalPad/constants.js +1 -1
  192. package/widgets/DirectionalPad.js +1 -1
  193. package/widgets/Editor/Upload.js +1 -1
  194. package/widgets/Editor/workflowUtils.js +1 -1
  195. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  196. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  197. package/widgets/FeatureForm/FieldInput.js +1 -1
  198. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  199. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  200. package/widgets/FeatureForm.js +1 -1
  201. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  202. package/widgets/FeatureTable/FieldColumn.js +1 -1
  203. package/widgets/FeatureTable/Grid/Column.js +1 -1
  204. package/widgets/FeatureTable.js +1 -1
  205. package/widgets/ScaleRangeSlider.js +1 -1
  206. package/widgets/support/DatePicker.js +1 -1
  207. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  208. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  209. package/widgets/support/Selector2D.js +1 -1
  210. package/widgets/support/TimePicker.js +1 -1
  211. package/widgets/support/dateUtils.js +1 -1
  212. package/assets/esri/core/workers/chunks/027f8b57565c65fbccda.js +0 -1
  213. package/assets/esri/core/workers/chunks/048265fb5953350e3e33.js +0 -1
  214. package/assets/esri/core/workers/chunks/0b9cf14f8aafb76c578b.js +0 -1
  215. package/assets/esri/core/workers/chunks/0ebf58c927bfc4c9d4fe.js +0 -1
  216. package/assets/esri/core/workers/chunks/10fd951bd296b2beeeba.js +0 -1
  217. package/assets/esri/core/workers/chunks/1224475f3eefdfd59c76.js +0 -1
  218. package/assets/esri/core/workers/chunks/162b0220e24e9ba72655.js +0 -1
  219. package/assets/esri/core/workers/chunks/1e611cad53b745ee146f.js +0 -1
  220. package/assets/esri/core/workers/chunks/24b1bf1a5d80f43a6c9a.js +0 -1
  221. package/assets/esri/core/workers/chunks/29ed31fd4f9d5cf53686.js +0 -1
  222. package/assets/esri/core/workers/chunks/2b6d1c8e4ed759767827.js +0 -1
  223. package/assets/esri/core/workers/chunks/34b44b0fab88f838885c.js +0 -1
  224. package/assets/esri/core/workers/chunks/364f55294a1d7bf163d7.js +0 -1
  225. package/assets/esri/core/workers/chunks/3714ab435dd5ccf9e694.js +0 -1
  226. package/assets/esri/core/workers/chunks/3788009a5ece453011f3.js +0 -1
  227. package/assets/esri/core/workers/chunks/3aafe8160b3bfbaa6935.js +0 -1
  228. package/assets/esri/core/workers/chunks/41c002e4c42c581cda8d.js +0 -1
  229. package/assets/esri/core/workers/chunks/47be4c75dd6372b96fe4.js +0 -1
  230. package/assets/esri/core/workers/chunks/4e8d1e6051f6654a5e83.js +0 -1
  231. package/assets/esri/core/workers/chunks/53746e9976758630159b.js +0 -1
  232. package/assets/esri/core/workers/chunks/5449fdd69e12e5cbd12a.js +0 -1
  233. package/assets/esri/core/workers/chunks/57ce4ece0147afb0d43c.js +0 -1
  234. package/assets/esri/core/workers/chunks/5e83d21400a5dec05c81.js +0 -1
  235. package/assets/esri/core/workers/chunks/6047f4487dcd37cca98e.js +0 -1
  236. package/assets/esri/core/workers/chunks/6967d2b3721678b38774.js +0 -1
  237. package/assets/esri/core/workers/chunks/6ac5ca7de651e3d672a1.js +0 -1
  238. package/assets/esri/core/workers/chunks/6b7ee9164149428edb9e.js +0 -1
  239. package/assets/esri/core/workers/chunks/6c495077cc79e1898927.js +0 -1
  240. package/assets/esri/core/workers/chunks/6d43648d5326e01b4474.js +0 -1
  241. package/assets/esri/core/workers/chunks/74fb07de0f990d45af89.js +0 -1
  242. package/assets/esri/core/workers/chunks/8e9a52062ce059153a89.js +0 -1
  243. package/assets/esri/core/workers/chunks/919a57d372419785cd5e.js +0 -1
  244. package/assets/esri/core/workers/chunks/939f0a1a7d605e389e45.js +0 -1
  245. package/assets/esri/core/workers/chunks/9932f23ba6589df14a3d.js +0 -1
  246. package/assets/esri/core/workers/chunks/a25a38c9f338e0beffef.js +0 -1
  247. package/assets/esri/core/workers/chunks/a97581e584336b46ede7.js +0 -1
  248. package/assets/esri/core/workers/chunks/b1cb932cfadc4dc3f1e4.js +0 -1
  249. package/assets/esri/core/workers/chunks/be3fb6113b0b27b94537.js +0 -1
  250. package/assets/esri/core/workers/chunks/c37119f5692e19aa1ce2.js +0 -1
  251. package/assets/esri/core/workers/chunks/c685f16435d9861bbbd0.js +0 -1
  252. package/assets/esri/core/workers/chunks/d5dfc03673aec8aa57e2.js +0 -1
  253. package/assets/esri/core/workers/chunks/e6416a2684866d677b3e.js +0 -1
  254. package/assets/esri/core/workers/chunks/eb01f4cdb9b918cc61e7.js +0 -1
  255. package/assets/esri/core/workers/chunks/eb4aed4fdb44495a4fe6.js +0 -1
  256. package/assets/esri/core/workers/chunks/ec8258c9dc1491e97fc8.js +0 -1
  257. package/assets/esri/core/workers/chunks/eeac53da496de4cd4182.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[670],{32078:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(15719),p=r(92555),g=r(89136),v=r(15817),_=r(77813),T=r(89753),x=r(5802),E=r(42001),b=r(19419),A=r(26322),S=r(85504),R=r(22539),M=r(57806),w=r(92302),y=r(96310),C=r(85787),O=r(90692),I=r(93669),P=r(172),N=r(71250),L=r(21437),D=r(74709),F=r(33680),H=r(98069),B=r(93144),G=r(35065);function U(e){const t=new F.kG,{vertex:r,fragment:U,varyings:z}=t;if((0,I.Sv)(r,e),t.include(u.f),z.add("vpos","vec3"),t.include(w.k,e),t.include(l.fQ,e),t.include(p.L,e),e.hasColorTextureTransform&&t.include(M.av),e.output===n.H.Color||e.output===n.H.Alpha){e.hasNormalTextureTransform&&t.include(M.NI),e.hasEmissionTextureTransform&&t.include(M.R5),e.hasOcclusionTextureTransform&&t.include(M.jF),e.hasMetallicRoughnessTextureTransform&&t.include(M.DT),(0,I.hY)(r,e),t.include(c.O,e),t.include(s.w,e);const n=e.normalType===c.r.Attribute||e.normalType===c.r.Compressed;n&&e.offsetBackfaces&&t.include(o.w),t.include(v.Q,e),t.include(f.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new N.N("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),e.multipassEnabled&&z.add("depth","float"),r.code.add(D.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[670],{32078:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(15719),p=r(92555),g=r(89136),v=r(15817),_=r(77813),T=r(89753),x=r(5802),E=r(42001),b=r(19419),A=r(26322),S=r(85504),R=r(22539),w=r(57806),M=r(92302),y=r(96310),C=r(85787),O=r(90692),I=r(93669),P=r(172),N=r(71250),L=r(21437),D=r(74709),F=r(33680),H=r(98069),B=r(93144),G=r(35065);function U(e){const t=new F.kG,{vertex:r,fragment:U,varyings:z}=t;if((0,I.Sv)(r,e),t.include(u.f),z.add("vpos","vec3"),t.include(M.k,e),t.include(l.fQ,e),t.include(p.L,e),e.hasColorTextureTransform&&t.include(w.av),e.output===n.H.Color||e.output===n.H.Alpha){e.hasNormalTextureTransform&&t.include(w.NI),e.hasEmissionTextureTransform&&t.include(w.R5),e.hasOcclusionTextureTransform&&t.include(w.jF),e.hasMetallicRoughnessTextureTransform&&t.include(w.DT),(0,I.hY)(r,e),t.include(c.O,e),t.include(s.w,e);const n=e.normalType===c.r.Attribute||e.normalType===c.r.Compressed;n&&e.offsetBackfaces&&t.include(o.w),t.include(v.Q,e),t.include(f.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new N.N("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),e.multipassEnabled&&z.add("depth","float"),r.code.add(D.H`
2
2
  void main(void) {
3
3
  forwardNormalizedVertexColor();
4
4
  vcolorExt = externalColor;
@@ -91,7 +91,7 @@
91
91
  fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
92
92
  ${e.transparencyPassType===B.A.Color?D.H`fragColor = premultiplyAlpha(fragColor);`:""}
93
93
  }
94
- `)}return t.include(g.s,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>F});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(92555),p=r(89136),g=r(77813),v=r(89753),_=r(5802),T=r(42001),x=r(26322),E=r(85504),b=r(22539),A=r(92302),S=r(96310),R=r(85787),M=r(90692),w=r(93669),y=r(172),C=r(71250),O=r(21437),I=r(74709),P=r(33680),N=r(98069),L=r(93144),D=r(35065);function F(e){const t=new P.kG,{vertex:r,fragment:F,varyings:H}=t;return(0,w.Sv)(r,e),t.include(u.f),H.add("vpos","vec3"),t.include(A.k,e),t.include(l.fQ,e),t.include(f.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,w.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(D.T.INSTANCECOLOR,"vec4"),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3"),e.multipassEnabled&&H.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new C.N("externalColor",(e=>e.externalColor))),H.add("vcolorExt","vec4"),r.code.add(I.H`
94
+ `)}return t.include(g.s,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>F});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(92555),p=r(89136),g=r(77813),v=r(89753),_=r(5802),T=r(42001),x=r(26322),E=r(85504),b=r(22539),A=r(92302),S=r(96310),R=r(85787),w=r(90692),M=r(93669),y=r(172),C=r(71250),O=r(21437),I=r(74709),P=r(33680),N=r(98069),L=r(93144),D=r(35065);function F(e){const t=new P.kG,{vertex:r,fragment:F,varyings:H}=t;return(0,M.Sv)(r,e),t.include(u.f),H.add("vpos","vec3"),t.include(A.k,e),t.include(l.fQ,e),t.include(f.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,M.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(D.T.INSTANCECOLOR,"vec4"),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3"),e.multipassEnabled&&H.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new C.N("externalColor",(e=>e.externalColor))),H.add("vcolorExt","vec4"),r.code.add(I.H`
95
95
  void main(void) {
96
96
  forwardNormalizedVertexColor();
97
97
  vcolorExt = externalColor;
@@ -115,7 +115,7 @@
115
115
  forwardLinearDepth();
116
116
  forwardTextureCoordinates();
117
117
  }
118
- `)),e.output===n.H.Alpha&&(t.include(a.f5,e),t.include(R.z,e),t.include(T.l,e),F.uniforms.add(new O.p("opacity",(e=>e.opacity)),new O.p("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&F.uniforms.add(new N.A("tex",(e=>e.texture))),F.include(M.y),F.code.add(I.H`
118
+ `)),e.output===n.H.Alpha&&(t.include(a.f5,e),t.include(R.z,e),t.include(T.l,e),F.uniforms.add(new O.p("opacity",(e=>e.opacity)),new O.p("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&F.uniforms.add(new N.A("tex",(e=>e.texture))),F.include(w.y),F.code.add(I.H`
119
119
  void main() {
120
120
  discardBySlice(vpos);
121
121
  ${e.multipassEnabled?I.H`terrainDepthTest(depth);`:""}
@@ -127,7 +127,7 @@
127
127
 
128
128
  fragColor = vec4(opacity_);
129
129
  }
130
- `)),e.output===n.H.Color&&(t.include(a.f5,e),t.include(v.XP,e),t.include(g.K,e),t.include(R.z,e),t.include(e.instancedDoublePrecision?b.hb:b.XE,e),t.include(T.l,e),(0,w.hY)(t.fragment,e),(0,_.Pe)(F),(0,v.PN)(F),(0,v.sC)(F),F.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new y.J("ambient",(e=>e.ambient)),new y.J("diffuse",(e=>e.diffuse)),new O.p("opacity",(e=>e.opacity)),new O.p("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&F.uniforms.add(new N.A("tex",(e=>e.texture))),t.include(E.jV,e),t.include(x.T,e),F.include(M.y),(0,_.F1)(F),F.code.add(I.H`
130
+ `)),e.output===n.H.Color&&(t.include(a.f5,e),t.include(v.XP,e),t.include(g.K,e),t.include(R.z,e),t.include(e.instancedDoublePrecision?b.hb:b.XE,e),t.include(T.l,e),(0,M.hY)(t.fragment,e),(0,_.Pe)(F),(0,v.PN)(F),(0,v.sC)(F),F.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new y.J("ambient",(e=>e.ambient)),new y.J("diffuse",(e=>e.diffuse)),new O.p("opacity",(e=>e.opacity)),new O.p("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&F.uniforms.add(new N.A("tex",(e=>e.texture))),t.include(E.jV,e),t.include(x.T,e),F.include(w.y),(0,_.F1)(F),F.code.add(I.H`
131
131
  void main() {
132
132
  discardBySlice(vpos);
133
133
  ${e.multipassEnabled?I.H`terrainDepthTest(depth);`:""}
@@ -282,7 +282,7 @@ return fallOffFunction(vv, vn, 0.1);
282
282
 
283
283
  fragBlur = b / w_total;
284
284
  }
285
- `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{a:()=>l,d:()=>s,f:()=>o,i:()=>h,m:()=>c,n:()=>u,s:()=>n,t:()=>a});var i=r(46851);function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function n(e,t,r,i,o,n,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=o,e[4]=n,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e}function a(e,t){if(e===t){const r=t[1],i=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function s(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*n+s*l,m=c*n-a*l;let f=r*d+i*h+o*m;return f?(f=1/f,e[0]=d*f,e[1]=(-u*i+o*c)*f,e[2]=(s*i-o*a)*f,e[3]=h*f,e[4]=(u*r-o*l)*f,e[5]=(-s*r+o*n)*f,e[6]=m*f,e[7]=(-c*r+i*l)*f,e[8]=(a*r-i*n)*f,e):null}function l(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=o*c-i*u,e[2]=i*s-o*a,e[3]=s*l-n*u,e[4]=r*u-o*l,e[5]=o*n-r*s,e[6]=n*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*n,e}function c(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],m=r[1],f=r[2],p=r[3],g=r[4],v=r[5],_=r[6],T=r[7],x=r[8];return e[0]=h*i+m*a+f*c,e[1]=h*o+m*s+f*u,e[2]=h*n+m*l+f*d,e[3]=p*i+g*a+v*c,e[4]=p*o+g*s+v*u,e[5]=p*n+g*l+v*d,e[6]=_*i+T*a+x*c,e[7]=_*o+T*s+x*u,e[8]=_*n+T*l+x*d,e}function u(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],m=t[11],f=t[12],p=t[13],g=t[14],v=t[15],_=r*s-i*a,T=r*l-o*a,x=r*c-n*a,E=i*l-o*s,b=i*c-n*s,A=o*c-n*l,S=u*p-d*f,R=u*g-h*f,M=u*v-m*f,w=d*g-h*p,y=d*v-m*p,C=h*v-m*g;let O=_*C-T*y+x*w+E*M-b*R+A*S;return O?(O=1/O,e[0]=(s*C-l*y+c*w)*O,e[1]=(l*M-a*C-c*R)*O,e[2]=(a*y-s*M+c*S)*O,e[3]=(o*y-i*C-n*w)*O,e[4]=(r*C-o*M+n*R)*O,e[5]=(i*M-r*y-n*S)*O,e[6]=(p*A-g*b+v*E)*O,e[7]=(g*x-f*A-v*T)*O,e[8]=(f*b-p*x+v*_)*O,e):null}function d(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function h(e){const t=(0,i.g)(),r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(o*o+s*s+u*u))<=t&&Math.abs(1-(n*n+l*l+d*d))<=t}const m=c,f=d;Object.freeze(Object.defineProperty({__proto__:null,add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},adjoint:l,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},determinant:function(e){const t=e[0],r=e[1],i=e[2],o=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*n-a*l)+r*(-c*o+a*s)+i*(l*o-n*s)},equals:function(e,t){const r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=t[0],m=t[1],f=t[2],p=t[3],g=t[4],v=t[5],_=t[6],T=t[7],x=t[8],E=(0,i.g)();return Math.abs(r-h)<=E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-m)<=E*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(n-f)<=E*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=E*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-g)<=E*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=E*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(c-_)<=E*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-T)<=E*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(d-x)<=E*Math.max(1,Math.abs(d),Math.abs(x))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromMat4:o,fromQuat:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r+r,s=i+i,l=o+o,c=r*a,u=i*a,d=i*s,h=o*a,m=o*s,f=o*l,p=n*a,g=n*s,v=n*l;return e[0]=1-d-f,e[3]=u-v,e[6]=h+g,e[1]=u+v,e[4]=1-c-f,e[7]=m-p,e[2]=h-g,e[5]=m+p,e[8]=1-c-d,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},invert:s,isOrthoNormal:h,mul:m,multiply:c,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},normalFromMat4:u,normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10],d=u*a-s*c,h=-u*n+s*l,m=c*n-a*l,f=r*d+i*h+o*m;if(!f)return null;const p=1/f;return e[0]=d*p,e[1]=(-u*i+o*c)*p,e[2]=(s*i-o*a)*p,e[3]=h*p,e[4]=(u*r-o*l)*p,e[5]=(-s*r+o*n)*p,e[6]=m*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*n)*p,e},projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},rotate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(r),m=Math.cos(r);return e[0]=m*i+h*a,e[1]=m*o+h*s,e[2]=m*n+h*l,e[3]=m*a-h*i,e[4]=m*s-h*o,e[5]=m*l-h*n,e[6]=c,e[7]=u,e[8]=d,e},scale:function(e,t,r){const i=r[0],o=r[1],n=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],o=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e},set:n,str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},sub:f,subtract:d,translate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],m=r[1];return e[0]=i,e[1]=o,e[2]=n,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+m*a+c,e[7]=h*o+m*s+u,e[8]=h*n+m*l+d,e},transpose:a},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return 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],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{a:()=>m,c:()=>g,g:()=>u,j:()=>y,k:()=>p,m:()=>d,s:()=>c});var i=r(46521),o=r(94961),n=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function u(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>(0,a.g)()?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function d(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+a*s+o*c-n*l,e[1]=o*u+a*l+n*s-i*c,e[2]=n*u+a*c+i*l-o*s,e[3]=a*u-i*s-o*l-n*c,e}function h(e,t,r,i){const o=t[0],n=t[1],s=t[2],l=t[3];let c,u,d,h,m,f=r[0],p=r[1],g=r[2],v=r[3];return u=o*f+n*p+s*g+l*v,u<0&&(u=-u,f=-f,p=-p,g=-g,v=-v),1-u>(0,a.g)()?(c=Math.acos(u),d=Math.sin(c),h=Math.sin((1-i)*c)/d,m=Math.sin(i*c)/d):(h=1-i,m=i),e[0]=h*o+m*f,e[1]=h*n+m*p,e[2]=h*s+m*g,e[3]=h*l+m*v,e}function m(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function f(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const o=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*o+n]-t[3*n+o])*i,e[o]=(t[3*o+r]+t[3*r+o])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function p(e,t,r,i){const o=.5*Math.PI/180;t*=o,r*=o,i*=o;const n=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=n*l*u-a*s*c,e[1]=a*s*u+n*l*c,e[2]=a*l*c-n*s*u,e[3]=a*l*u+n*s*c,e}const g=l.c,v=l.s,_=l.a,T=d,x=l.b,E=l.d,b=l.l,A=l.f,S=A,R=l.g,M=R,w=l.n,y=l.h,C=l.e,O=(0,n.c)(),I=(0,n.f)(1,0,0),P=(0,n.f)(0,1,0),N=(0,o.a)(),L=(0,o.a)(),D=(0,i.a)();Object.freeze(Object.defineProperty({__proto__:null,add:_,calculateW:function(e,t){const r=t[0],i=t[1],o=t[2];return e[0]=r,e[1]=i,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-o*o)),e},conjugate:m,copy:g,dot:E,equals:C,exactEquals:y,fromEuler:p,fromMat3:f,getAxisAngle:u,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r*r+i*i+o*o+n*n,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-o*s,e[3]=n*s,e},len:S,length:A,lerp:b,mul:T,multiply:d,normalize:w,random:function(e){const t=a.R,r=t(),i=t(),o=t(),n=Math.sqrt(1-r),s=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=s*Math.sin(2*Math.PI*o),e[3]=s*Math.cos(2*Math.PI*o),e},rotateX:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=o*l+n*s,e[2]=n*l-o*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*s,e[1]=o*l+a*s,e[2]=n*l+i*s,e[3]=a*l-o*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=o*l-i*s,e[2]=n*l+a*s,e[3]=a*l-n*s,e},rotationTo:function(e,t,r){const i=(0,s.j)(t,r);return i<-.999999?((0,s.b)(O,I,t),(0,s.k)(O)<1e-6&&(0,s.b)(O,P,t),(0,s.n)(O,O),c(e,O,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.b)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+i,w(e,e))},scale:x,set:v,setAxes:function(e,t,r,i){const o=D;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=i[0],o[4]=i[1],o[7]=i[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],w(e,f(e,o))},setAxisAngle:c,slerp:h,sqlerp:function(e,t,r,i,o,n){return h(N,t,o,n),h(L,r,i,n),h(e,N,L,2*n*(1-n)),e},sqrLen:M,squaredLength:R,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>u,Z:()=>c,c:()=>i,f:()=>o});const c=n(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>u,e:()=>l,n:()=>d,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[4],d=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+u*i+m*a+g,e[x+1]=l*r+d*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+u*i+m*a,e[v+1]=l*r+d*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function u(e,t){d(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:d,normalizeView:u,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>u,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.g)(e.origin),vector:(0,a.g)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.f)(r.vector,t,e),r}function u(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,u=(0,n.f)(s.WM.get(),t,c),d=(0,n.j)(l,u)/(0,n.m)(l);return(0,n.i)(a,l,(0,i.uZ)(d,0,1)),(0,n.g)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},670:(e,t,r)=>{r.d(t,{fetch:()=>kt});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),u=r(60437),d=r(1533);function h(e,t=!1){return e<=d.c8?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),E=r(91911),b=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class M{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class w{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new M,this.numberOfVertices=0}}var y=r(3172),C=r(66643),O=r(43090),I=r(20102),P=r(92604);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670),F=r(24882);async function H(e,t){const{data:r}=await(0,y.Z)(e,{responseType:"image",...t});return r}var B=r(51417),G=r(47026),U=r(22631),z=r(80442),V=r(32448),W=r(70586),j=r(17452),q=r(85958),k=r(99880);let X;var $,Y;(Y=$||($={}))[Y.ETC1_RGB=0]="ETC1_RGB",Y[Y.ETC2_RGBA=1]="ETC2_RGBA",Y[Y.BC1_RGB=2]="BC1_RGB",Y[Y.BC3_RGBA=3]="BC3_RGBA",Y[Y.BC4_R=4]="BC4_R",Y[Y.BC5_RG=5]="BC5_RG",Y[Y.BC7_M6_RGB=6]="BC7_M6_RGB",Y[Y.BC7_M5_RGBA=7]="BC7_M5_RGBA",Y[Y.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Y[Y.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Y[Y.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Y[Y.ATC_RGB=11]="ATC_RGB",Y[Y.ATC_RGBA=12]="ATC_RGBA",Y[Y.FXT1_RGB=17]="FXT1_RGB",Y[Y.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Y[Y.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Y[Y.ETC2_EAC_R11=20]="ETC2_EAC_R11",Y[Y.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Y[Y.RGBA32=13]="RGBA32",Y[Y.RGB565=14]="RGB565",Y[Y.BGR565=15]="BGR565",Y[Y.RGBA4444=16]="RGBA4444";var J=r(35371),Z=r(57088),K=r(45762);let Q=null,ee=null;async function te(){return null==ee&&(ee=function(){if(null==X){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);X=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return X}(),Q=await ee),ee}function re(e,t,r,i,o){const n=(0,K.RG)(t?J.q_.COMPRESSED_RGBA8_ETC2_EAC:J.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[$.ETC2_RGBA,J.q_.COMPRESSED_RGBA8_ETC2_EAC]:[$.ETC1_RGB,J.q_.COMPRESSED_RGB8_ETC2]:c?i?[$.BC3_RGBA,J.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[$.BC1_RGB,J.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[$.RGBA32,J.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.width=o,t.height=n,new Z.x(e,t,{type:"compressed",levels:m})}var ae=r(17662),se=r(4726);const le=P.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ue=ce("DXT1"),de=ce("DXT3"),he=ce("DXT5");function me(e){if(e instanceof ImageData)return me(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.Z("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e));let t=e.width*e.height;if(t>=4096){let r=e.width,i=e.height;do{r=Math.ceil(r/2),i=Math.ceil(i/2),t=r*i}while(t>1048576);const o=document.createElement("canvas");return o.width=r,o.height=i,o.getContext("2d").drawImage(e,0,0,r,i),o}return e}var fe,pe,ge=r(11726),ve=r(47859);class _e extends ae.c{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=se.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new V.Z,this._parameters={...xe,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,j.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,j.HK)(e.src)||(0,j.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new ve.X;return t.wrapMode=this._parameters.wrap??J.e8.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,d.eP)(e)||(0,d.lq)(e))return t.encoding===G.Ti.KTX2_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===G.Ti.BASIS_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Te(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new Z.x(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.DDS_ENCODING?this._loadFromDDSData(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.BASIS_ENCODING?this._loadFromBasis(e,t):(0,d.lq)(t)?this._loadFromPixelData(e,t):(0,d.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<fe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return le.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return le.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case ue:o=8,n=J.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case de:o=16,n=J.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case he:o=16,n=J.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return le.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(le.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,d=new Uint8Array(e,m,h),f.push(d),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new Z.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ge.hu)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?J.VI.LUMINANCE:3===this._parameters.components?J.VI.RGB:J.VI.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new Z.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await H(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,q.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=fe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,W.hw)(l)},a=()=>{t.readyState>=fe.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new I.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){let r=t;this._parameters.downsampleUncompressed&&(r instanceof ImageData||r instanceof HTMLImageElement||r instanceof HTMLCanvasElement)&&(r=me(r));const i=Te(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?J.VI.RGB:J.VI.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new Z.x(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,W.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Te(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(pe=fe||(fe={}))[pe.HAVE_NOTHING=0]="HAVE_NOTHING",pe[pe.HAVE_METADATA=1]="HAVE_METADATA",pe[pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",pe[pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",pe[pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const xe={wrap:{s:J.e8.REPEAT,t:J.e8.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ee=r(35065),be=r(64822),Ae=r(65576),Se=r(55039),Re=r(60624),Me=r(19419),we=r(85504),ye=r(60537),Ce=r(82791),Oe=r(93144),Ie=r(27097);const Pe=(0,Ie.wK)(J.zi.SRC_ALPHA,J.zi.ONE,J.zi.ONE_MINUS_SRC_ALPHA,J.zi.ONE_MINUS_SRC_ALPHA),Ne=(0,Ie.if)(J.zi.ONE,J.zi.ONE),Le=(0,Ie.if)(J.zi.ZERO,J.zi.ONE_MINUS_SRC_ALPHA);function De(e){return e===Oe.A.FrontFace?null:e===Oe.A.Alpha?Le:Ne}const Fe={factor:-1,units:-2};function He(e,t=J.wb.LESS){return e===Oe.A.NONE||e===Oe.A.FrontFace?t:J.wb.LEQUAL}var Be=r(97995),Ge=r(8310),Ue=r(87951);const ze=new class{constructor(e=0){this.offset=e,this.sphere=(0,Ge.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(Ve,e,t,r),n=(0,l.e)(o,o,i),a=this.offset/(0,l.l)(n);(0,l.q)(n,n,n,a);const s=this.objectTransform.inverse;return(0,l.e)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.q)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.q)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,l.l)(e),r=this.offset/t;return(0,l.q)(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,Ge.c)(),this._obb=(0,Ue.Ue)(),this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(Ve,e,t,r),o=(0,l.s)(We,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,l.l)(o);return(0,l.q)(this._tmpVertex,i,o,n),this._tmpVertex}applyToAabb(e){const t=(0,l.s)(Ve,e[0],e[1],e[2]+this.componentLocalOriginLength),r=(0,l.s)(We,e[3],e[4],e[5]+this.componentLocalOriginLength),i=(0,l.z)(je,t),o=(0,l.z)(qe,r),n=(0,l.w)(ke,t),a=(0,l.w)(Xe,r),s=(0,l.x)($e,n,a);s[0]=i[0]*o[0]<0?0:s[0],s[1]=i[1]*o[1]<0?0:s[1],s[2]=i[2]*o[2]<0?0:s[2];const c=(0,l.l)(s);if(c<this._totalOffset)return e[0]-=t[0]<0?this._totalOffset:0,e[1]-=t[1]<0?this._totalOffset:0,e[2]-=t[2]<0?this._totalOffset:0,e[3]+=r[0]>0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const u=(0,l.D)($e,n,a),d=(0,l.l)(u),h=this._totalOffset/d,m=this._totalOffset/c;return e[0]+=t[0]*(t[0]>0?h:m),e[1]+=t[1]*(t[1]>0?h:m),e[2]+=t[2]*(t[2]>0?h:m),e[3]+=r[0]*(r[0]<0?h:m),e[4]+=r[1]*(r[1]<0?h:m),e[5]+=r[2]*(r[2]<0?h:m),e}applyToMbs(e){const t=(0,l.l)(e),r=this._totalOffset/t;return(0,l.q)(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){return(0,Ue.gI)(e,this._totalOffset,this._totalOffset,be.JY.Global,this._obb),this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=(0,l.s)(Ve,e,t,r),o=(0,l.g)(We,i,this.localOrigin),n=this.offset/(0,l.l)(o);return(0,l.q)(this.tmpVertex,i,o,n),this.tmpVertex}applyToAabb(e){const t=je,r=qe,i=ke;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0==(a&e)){for(let o=0;o<3;++o)i[o]=0!=(a&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ve=(0,c.c)(),We=(0,c.c)(),je=(0,c.c)(),qe=(0,c.c)(),ke=(0,c.c)(),Xe=(0,c.c)(),$e=(0,c.c)();function Ye(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length;r*=a;for(let e=0;e<s;++e){const t=2*o[e];n[r]=i[t],n[r+1]=i[t+1],r+=a}}function Je(e,t,r,i){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}}function Ze(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}}function Ke(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function Qe(e,t,r,i,o,n){switch(e){case Ee.T.POSITION:{(0,ge.hu)(3===t.size);const i=o.getField(e,m.ct);(0,ge.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void Je(e,r,i,o);const{data:n,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,u=s.length,d=t[0],h=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],_=t[9],T=t[10],x=t[12],E=t[13],b=t[14];i*=c;let A=0,S=0,R=0;const M=(0,a.y)(t)?e=>{A=n[e]+x,S=n[e+1]+E,R=n[e+2]+b}:e=>{const t=n[e],r=n[e+1],i=n[e+2];A=d*t+f*r+v*i+x,S=h*t+p*r+_*i+E,R=m*t+g*r+T*i+b};if(1===o)for(let e=0;e<u;++e)M(3*s[e]),l[i]=A,l[i+1]=S,l[i+2]=R,i+=c;else for(let e=0;e<u;++e){M(3*s[e]);for(let e=0;e<o;++e)l[i]=A,l[i+1]=S,l[i+2]=R,i+=c}}(t,r,i,n);break}case Ee.T.NORMAL:{(0,ge.hu)(3===t.size);const r=o.getField(e,m.ct);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Je(e,r,i,o);const{data:n,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],T=l[9],x=l[10],E=!(0,a.z)(l),b=1e-6,A=1-b;i*=u;let S=0,R=0,M=0;const w=(0,a.y)(l)?e=>{S=n[e],R=n[e+1],M=n[e+2]}:e=>{const t=n[e],r=n[e+1],i=n[e+2];S=h*t+p*r+_*i,R=m*t+g*r+T*i,M=f*t+v*r+x*i};if(1===o)if(E)for(let e=0;e<d;++e){w(3*s[e]);const t=S*S+R*R+M*M;if(t<A&&t>b){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=R*e,c[i+2]=M*e}else c[i]=S,c[i+1]=R,c[i+2]=M;i+=u}else for(let e=0;e<d;++e)w(3*s[e]),c[i]=S,c[i+1]=R,c[i+2]=M,i+=u;else for(let e=0;e<d;++e){if(w(3*s[e]),E){const e=S*S+R*R+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,M*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=M,i+=u}}(t,i,r,n);break}case Ee.T.NORMALCOMPRESSED:{(0,ge.hu)(2===t.size);const r=o.getField(e,m.or);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ye(t,r,n);break}case Ee.T.UV0:{(0,ge.hu)(2===t.size);const r=o.getField(e,m.Eu);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ye(t,r,n);break}case Ee.T.COLOR:case Ee.T.SYMBOLCOLOR:{const r=o.getField(e,m.mc);(0,ge.hu)(!!r,`No buffer view for ${e}`),(0,ge.hu)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t!==n.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}}else{s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2],s[i+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const u=c*o;for(let r=1;r<u;++r)e[i]=a,i+=t}}(t,t.size,r,n);break}case Ee.T.COLORFEATUREATTRIBUTE:{const r=o.getField(e,m.ly);(0,ge.hu)(!!r,`No buffer view for ${e}`),(0,ge.hu)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length,l=i[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,n);break}case Ee.T.TANGENT:{(0,ge.hu)(4===t.size);const r=o.getField(e,m.ek);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Ze(e,r,i,o);const{data:n,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],T=l[9],x=l[10],E=!(0,a.z)(l),b=1e-6,A=1-b;if(i*=u,1===o)for(let e=0;e<d;++e){const t=4*s[e],r=n[t],o=n[t+1],a=n[t+2],l=n[t+3];let d=h*r+p*o+_*a,S=m*r+g*o+T*a,R=f*r+v*o+x*a;if(E){const e=d*d+S*S+R*R;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,S*=t,R*=t}}c[i]=d,c[i+1]=S,c[i+2]=R,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*s[e],r=n[t],a=n[t+1],l=n[t+2],d=n[t+3];let S=h*r+p*a+_*l,R=m*r+g*a+T*l,M=f*r+v*a+x*l;if(E){const e=S*S+R*R+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,M*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=M,c[i+3]=d,i+=u}}(t,i,r,n);break}case Ee.T.PROFILERIGHT:case Ee.T.PROFILEUP:case Ee.T.PROFILEVERTEXANDNORMAL:case Ee.T.FEATUREVALUE:{(0,ge.hu)(4===t.size);const r=o.getField(e,m.ek);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ze(t,r,n)}}}class et{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ee.T.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)Qe(a,t,r,i,o,n);else if(a===Ee.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ee.T.POSITION)?.indices;if(t){const r=t.length,i=o.getField(a,m.mc);Ke(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var tt=r(57790),rt=r(88669),it=r(135),ot=r(15719),nt=r(96310),at=r(78869),st=r(14589),lt=r(83475),ct=r(59377);J.wb.LESS,J.wb.ALWAYS;const ut={mask:255},dt={function:{func:J.wb.ALWAYS,ref:G.hU.OutlineVisualElementMask,mask:G.hU.OutlineVisualElementMask},operation:{fail:J.xS.KEEP,zFail:J.xS.KEEP,zPass:J.xS.ZERO}},ht={function:{func:J.wb.ALWAYS,ref:G.hU.OutlineVisualElementMask,mask:G.hU.OutlineVisualElementMask},operation:{fail:J.xS.KEEP,zFail:J.xS.KEEP,zPass:J.xS.REPLACE}};J.wb.EQUAL,G.hU.OutlineVisualElementMask,G.hU.OutlineVisualElementMask,J.xS.KEEP,J.xS.KEEP,J.xS.KEEP,J.wb.NOTEQUAL,G.hU.OutlineVisualElementMask,G.hU.OutlineVisualElementMask,J.xS.KEEP,J.xS.KEEP,J.xS.KEEP;const mt=[1,1,.5],ft=[0,.6,.2],pt=[0,1,.2];var gt=r(32078);class vt extends ot.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.e)(mt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=G.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Re.r.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,rt.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=G.Gv.Less,this.textureAlphaMode=G.JJ.Blend,this.textureAlphaCutoff=nt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ce.yD.Occlude,this.isDecoration=!1}}class _t extends st.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===be.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?it.N.Default:it.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,_t.shader)}_initializeProgram(e,t){return new ct.$(e.rctx,t.get().build(this.configuration),lt.i)}_convertDepthTestFunction(e){return e===G.Gv.Lequal?J.wb.LEQUAL:J.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===Oe.A.NONE,o=e===Oe.A.FrontFace;return(0,Ie.sm)({blending:r.output!==Se.H.Color&&r.output!==Se.H.Alpha||!r.transparent?null:i?Pe:De(e),culling:Tt(r)?(0,Ie.zp)(r.cullFace):null,depthTest:{func:He(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ie.LZ:null,colorWrite:Ie.BK,stencilWrite:r.hasOccludees?ut:null,stencilTest:r.hasOccludees?t?ht:dt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Fe:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Tt(e){return e.cullFace!==G.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}_t.shader=new at.J(gt.D,(()=>r.e(9291).then(r.bind(r,79291))));var xt=r(43697),Et=r(51354),bt=r(47624),At=r(67498);class St extends bt.PO{}(0,xt._)([(0,Et.o)({constValue:!0})],St.prototype,"hasSliceHighlight",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],St.prototype,"hasSliceInVertexProgram",void 0),(0,xt._)([(0,Et.o)({constValue:At.P.Pass})],St.prototype,"pbrTextureBindType",void 0);class Rt extends St{constructor(){super(...arguments),this.output=Se.H.Color,this.alphaDiscardMode=G.JJ.Opaque,this.doubleSidedMode=Me.q.None,this.pbrMode=we.f7.Disabled,this.cullFace=G.Vr.None,this.transparencyPassType=Oe.A.NONE,this.normalType=Re.r.Attribute,this.textureCoordinateType=it.N.None,this.customDepthTest=G.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,xt._)([(0,Et.o)({count:Se.H.COUNT})],Rt.prototype,"output",void 0),(0,xt._)([(0,Et.o)({count:G.JJ.COUNT})],Rt.prototype,"alphaDiscardMode",void 0),(0,xt._)([(0,Et.o)({count:Me.q.COUNT})],Rt.prototype,"doubleSidedMode",void 0),(0,xt._)([(0,Et.o)({count:we.f7.COUNT})],Rt.prototype,"pbrMode",void 0),(0,xt._)([(0,Et.o)({count:G.Vr.COUNT})],Rt.prototype,"cullFace",void 0),(0,xt._)([(0,Et.o)({count:Oe.A.COUNT})],Rt.prototype,"transparencyPassType",void 0),(0,xt._)([(0,Et.o)({count:Re.r.COUNT})],Rt.prototype,"normalType",void 0),(0,xt._)([(0,Et.o)({count:it.N.COUNT})],Rt.prototype,"textureCoordinateType",void 0),(0,xt._)([(0,Et.o)({count:G.Gv.COUNT})],Rt.prototype,"customDepthTest",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"spherical",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVertexColors",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSymbolColors",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVerticalOffset",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSlicePlane",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSliceHighlight",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasColorTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasMetallicRoughnessTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasEmissionTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOcclusionTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasNormalTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasScreenSizePerspective",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVertexTangents",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOccludees",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"multipassEnabled",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasModelTransformation",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"offsetBackfaces",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"vvSize",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"vvColor",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"receiveShadows",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"receiveAmbientOcclusion",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"textureAlphaPremultiplied",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instanced",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instancedColor",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instancedDoublePrecision",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"writeDepth",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"transparent",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"enableOffset",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"cullAboveGround",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"snowCover",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasColorTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasEmissionTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasNormalTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOcclusionTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"occlusionPass",void 0),(0,xt._)([(0,Et.o)({constValue:!0})],Rt.prototype,"hasVvInstancing",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"useCustomDTRExponentForWater",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"supportsTextureAtlas",void 0),(0,xt._)([(0,Et.o)({constValue:!0})],Rt.prototype,"useFillLights",void 0);var Mt=r(41846);class wt extends _t{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Re.r.Attribute,t.doubleSidedMode=Me.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,wt.shader)}}wt.shader=new at.J(Mt.R,(()=>r.e(8096).then(r.bind(r,38096))));class yt extends Ce.F5{constructor(e){super(e,Ot),this.supportsEdges=!0,this._configuration=new Rt,this._vertexBufferLayout=function(e){const t=(0,Ae.U$)().vec3f(Ee.T.POSITION);return e.normalType===Re.r.Compressed?t.vec2i16(Ee.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ee.T.NORMAL),e.hasVertexTangents&&t.vec4f(Ee.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ee.T.UV0),e.hasVertexColors&&t.vec4u8(Ee.T.COLOR),e.hasSymbolColors&&t.vec4u8(Ee.T.SYMBOLCOLOR),(0,z.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ee.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Se.H.Shadow&&e!==Se.H.ShadowExcludeHighlight&&e!==Se.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?G.Vr.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Se.H.Color&&e!==Se.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Me.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Me.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Me.q.WindingOrder:Me.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?we.f7.Schematic:we.f7.Normal:we.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Ft,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case be.JY.Global:n=(0,l.n)(Lt,Ft);break;case be.JY.Local:n=(0,l.c)(Lt,Nt)}let a=0;const s=(0,l.f)(Ht,Ft,e.eye),c=(0,l.l)(s),u=(0,l.i)(s,s,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,l.j)(n,u)),a+=(0,tt.Hx)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,l.i)(n,n,a),(0,l.t)(Dt,n,r.transform.inverseRotation),i=(0,l.f)(It,i,Dt),o=(0,l.f)(Pt,o,Dt)}var a;(0,tt.Bw)(e,r,i,o,null!=(a=r.verticalOffset)?(ze.offset=a,ze):null,n)}produces(e,t){return!(t!==Se.H.Color&&t!==Se.H.Alpha&&t!==Se.H.Depth&&t!==Se.H.Normal&&t!==Se.H.Shadow&&t!==Se.H.ShadowHighlight&&t!==Se.H.ShadowExcludeHighlight&&t!==Se.H.Highlight&&t!==Se.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Be.r.TRANSPARENT_MATERIAL:Be.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Be.r.OPAQUE_MATERIAL)&&e!==Be.r.DRAPED_MATERIAL)}createGLMaterial(e){return new Ct(e)}createBufferWriter(){return new et(this._vertexBufferLayout)}}class Ct extends ye.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Se.H.Color&&this._output!==Se.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?wt:_t,e)}}const Ot=new class extends vt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},It=(0,c.c)(),Pt=(0,c.c)(),Nt=(0,c.f)(0,0,1),Lt=(0,c.c)(),Dt=(0,c.c)(),Ft=(0,c.c)(),Ht=(0,c.c)(),Bt=P.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Gt(e){throw new I.Z("",`Request for object resource failed: ${e}`)}function Ut(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Bt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Bt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Bt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Bt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Bt.warn("Indexed geometries must specify faces"),i=!1;break}default:Bt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Bt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Bt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function zt(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function Vt(e){switch(e){case"mask":return G.JJ.Mask;case"maskAndTransparency":return G.JJ.MaskBlend;case"none":return G.JJ.Opaque;default:return G.JJ.Blend}}function Wt(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const jt=new D.G(1,2,"wosr");var qt=r(57758);async function kt(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,C.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Gt(i.error.details.url)}(e,r,t);const i=await(0,C.q6)((0,y.Z)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Gt(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Bt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:J.e8.REPEAT,t:J.e8.REPEAT},preMultiplyAlpha:Vt(l)!==G.JJ.Opaque},u=null!=t&&t.disableTextures?Promise.resolve(null):H(a,t);r.push(u.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,O.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");jt.validate(s);const l=a.model.name,u=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<u.length;e++){const a=u[e];if(!Ut(a))continue;const s=Wt(a),l=a.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=l[Ee.T.POSITION],_=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,F.KF)(_);p.push([e,new B.a(r,i,t.valuesPerElement,!0)])}const T=s.texture,x=h&&h[T];if(x&&!f.has(T)){const{image:e,parameters:t}=x,r=new _e(e,t);i.push(r),f.set(T,r)}const E=f.get(T),b=E?E.id:void 0,A=s.material;let S=n.get(A,T);if(null==S){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=x&&x.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=x?Vt(x.alphaChannelUsage):void 0,a={ambient:(0,c.e)(e.diffuse),diffuse:(0,c.e)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:b,initTextureTransparent:!0,doubleSided:!0,cullFace:G.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:x?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),S=new yt(a),n.set(A,T,S)}o.push(S);const R=new U.Z(S,p);m+=p.find((e=>e[0]===Ee.T.POSITION))?.[1]?.indices.length??0,r.push(R)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:zt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),d=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=d&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,u=n.count,d=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*u),g=new Float64Array(3*u),v=(0,a.i)((0,s.a)(),o.transform);let _=0,T=0;for(let a=0;a<u;a++){n.getVec(a,h),i.getVec(a,d),(0,l.e)(h,h,o.transform),(0,l.f)(f,h,t.center),(0,l.B)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),u=Math.min(.45+.55*c*c,1);(0,l.B)(f,f,t.radius),null!==v&&(0,l.e)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.p)(f,f,d,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*u,p[T+1]=255*u,p[T+2]=255*u,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,d));const S=!!t.usePBR,M=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...pt]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...mt]},I={...t.materialParameters,treeRendering:A},{engineResources:P,referenceBoundingBox:z}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,d=new Map,T=n.lods.length,x=(0,u.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const M=new w(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new yt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),d=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==u)return null;const m=function(e){switch(e){case"BLEND":return G.JJ.Blend;case"MASK":return G.JJ.Mask;case"OPAQUE":case null:case void 0:return G.JJ.Opaque}}(u.alphaMode);if(!n.has(s)){if(d){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new _e((0,b.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.$A)(e)&&r,encoding:(0,b.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==G.JJ.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/qt.j),f=u.color[1]**(1/qt.j),p=u.color[2]**(1/qt.j),g=u.emissiveFactor[0]**(1/qt.j),v=u.emissiveFactor[1]**(1/qt.j),_=u.emissiveFactor[2]**(1/qt.j),T=null!=u.textureColor&&d?a.get(u.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.h)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion});n.set(s,new yt({...i,transparent:m===G.JJ.Blend,customDepthTest:G.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?G.Vr.None:G.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?Re.r.Attribute:Re.r.ScreenDerivative,castShadows:!0,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&d?a.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&d?a.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&d?a.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&d?a.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...ft]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:R(u.colorTextureTransform),normalTextureTransformMatrix:R(u.normalTextureTransform),occlusionTextureTransformMatrix:R(u.occlusionTextureTransform),emissiveTextureTransformMatrix:R(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(u.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),d){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(n,e,M,t,r,s,d),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[Ee.T.POSITION,new B.a(n,i,3,!0)]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.n)(Xt,e.transform),(0,f.a)(t,n,Xt,3,a),l.push([Ee.T.NORMAL,new B.a(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.n)(Xt,e.transform),(0,p.t)(t,n,Xt,4,a),l.push([Ee.T.TANGENT,new B.a(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([Ee.T.UV0,new B.a(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([Ee.T.COLOR,new B.a(t,i,4,!0)])}return{geometry:new U.Z(t,l),vertexCount:r}}(e,null!=i?i:new yt({})),w=a.boundingInfo;null!=w&&0===A&&((0,u.pp)(x,w.bbMin),(0,u.pp)(x,w.bbMax)),null!=i&&(M.stageResources.geometries.push(a),M.numberOfVertices+=T)})),S||a.push(M)})),{engineResources:a,referenceBoundingBox:x}}(n,M,I,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:P,referenceBoundingBox:z,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const Xt=(0,n.a)()},6206:(e,t,r)=>{var i,o;r.d(t,{a9:()=>i}),r(22021),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},87951:(e,t,r)=>{r.d(t,{Ue:()=>u,gI:()=>d}),r(21787);var i=r(46521),o=r(51305),n=r(94961),a=r(17896),s=r(65617),l=(r(98766),r(88669)),c=(r(60437),r(62073),r(64822));function u(e=[0,0,0],t=[-1,-1,-1],r=(0,n.a)()){return{center:(0,s.g)(e),halfSize:(0,s.g)(t),quaternion:(0,n.b)(r)}}function d(e,t,r,i,n){if((0,o.c)(n.quaternion,e.quaternion),i===c.JY.Global){(0,o.a)(p,e.quaternion),(0,a.v)(h,e.center,p),(0,a.w)(m,h),(0,a.x)(f,m,e.halfSize),(0,a.u)(f,m,f);const i=(0,a.l)(f);(0,a.g)(f,m,e.halfSize);const s=(0,a.l)(f);if(i<r)(0,a.c)(n.center,e.center),(0,a.s)(h,r,r,r),(0,a.g)(n.halfSize,e.halfSize,h);else{const o=s>0?1+t/s:1,l=i>0?1+r/i:1,c=(l+o)/2,u=(l-o)/2;(0,a.i)(n.halfSize,m,u),(0,a.q)(n.halfSize,n.halfSize,e.halfSize,c),(0,a.i)(n.center,m,c),(0,a.q)(n.center,n.center,e.halfSize,u),(0,a.z)(h,h),(0,a.A)(n.center,n.center,h),(0,a.v)(n.center,n.center,n.quaternion)}}else{const i=(0,a.s)(h,0,0,1);(0,a.q)(n.center,e.center,i,(r+t)/2),(0,o.a)(p,e.quaternion),(0,a.v)(i,i,p),(0,a.w)(i,i),(0,a.q)(n.halfSize,e.halfSize,i,(r-t)/2)}return n}(0,n.a)(),(0,s.c)(),(0,s.c)(),(0,l.c)(),(0,i.a)(),(()=>{const e=new Int8Array(162);let t=0;const r=r=>{for(let i=0;i<r.length;i++)e[t+i]=r[i];t+=6};r([6,2,3,1,5,4]),r([0,2,3,1,5,4]),r([0,2,3,7,5,4]),r([0,1,3,2,6,4]),r([0,1,3,2,0,0]),r([0,1,5,7,3,2]),r([0,1,3,7,6,4]),r([0,1,3,7,6,2]),r([0,1,5,7,6,2]),r([0,1,5,4,6,2]),r([0,1,5,4,0,0]),r([0,1,3,7,5,4]),r([0,2,6,4,0,0]),r([0,0,0,0,0,0]),r([1,3,7,5,0,0]),r([2,3,7,6,4,0]),r([2,3,7,6,0,0]),r([2,3,1,5,7,6]),r([0,1,5,7,6,2]),r([0,1,5,7,6,4]),r([0,1,3,7,6,4]),r([4,5,7,6,2,0]),r([4,5,7,6,0,0]),r([4,5,1,3,7,6]),r([0,2,3,7,5,4]),r([6,2,3,7,5,4]),r([6,2,3,1,5,4])})();const h=(0,s.c)(),m=(0,s.c)(),f=(0,s.c)(),p=(0,n.a)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>u});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
285
+ `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{a:()=>l,d:()=>s,f:()=>o,i:()=>h,m:()=>c,n:()=>u,s:()=>n,t:()=>a});var i=r(46851);function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function n(e,t,r,i,o,n,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=o,e[4]=n,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e}function a(e,t){if(e===t){const r=t[1],i=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function s(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*n+s*l,m=c*n-a*l;let f=r*d+i*h+o*m;return f?(f=1/f,e[0]=d*f,e[1]=(-u*i+o*c)*f,e[2]=(s*i-o*a)*f,e[3]=h*f,e[4]=(u*r-o*l)*f,e[5]=(-s*r+o*n)*f,e[6]=m*f,e[7]=(-c*r+i*l)*f,e[8]=(a*r-i*n)*f,e):null}function l(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=o*c-i*u,e[2]=i*s-o*a,e[3]=s*l-n*u,e[4]=r*u-o*l,e[5]=o*n-r*s,e[6]=n*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*n,e}function c(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],m=r[1],f=r[2],p=r[3],g=r[4],v=r[5],_=r[6],T=r[7],x=r[8];return e[0]=h*i+m*a+f*c,e[1]=h*o+m*s+f*u,e[2]=h*n+m*l+f*d,e[3]=p*i+g*a+v*c,e[4]=p*o+g*s+v*u,e[5]=p*n+g*l+v*d,e[6]=_*i+T*a+x*c,e[7]=_*o+T*s+x*u,e[8]=_*n+T*l+x*d,e}function u(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],m=t[11],f=t[12],p=t[13],g=t[14],v=t[15],_=r*s-i*a,T=r*l-o*a,x=r*c-n*a,E=i*l-o*s,b=i*c-n*s,A=o*c-n*l,S=u*p-d*f,R=u*g-h*f,w=u*v-m*f,M=d*g-h*p,y=d*v-m*p,C=h*v-m*g;let O=_*C-T*y+x*M+E*w-b*R+A*S;return O?(O=1/O,e[0]=(s*C-l*y+c*M)*O,e[1]=(l*w-a*C-c*R)*O,e[2]=(a*y-s*w+c*S)*O,e[3]=(o*y-i*C-n*M)*O,e[4]=(r*C-o*w+n*R)*O,e[5]=(i*w-r*y-n*S)*O,e[6]=(p*A-g*b+v*E)*O,e[7]=(g*x-f*A-v*T)*O,e[8]=(f*b-p*x+v*_)*O,e):null}function d(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function h(e){const t=(0,i.g)(),r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(o*o+s*s+u*u))<=t&&Math.abs(1-(n*n+l*l+d*d))<=t}const m=c,f=d;Object.freeze(Object.defineProperty({__proto__:null,add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},adjoint:l,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},determinant:function(e){const t=e[0],r=e[1],i=e[2],o=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*n-a*l)+r*(-c*o+a*s)+i*(l*o-n*s)},equals:function(e,t){const r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=t[0],m=t[1],f=t[2],p=t[3],g=t[4],v=t[5],_=t[6],T=t[7],x=t[8],E=(0,i.g)();return Math.abs(r-h)<=E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-m)<=E*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(n-f)<=E*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=E*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-g)<=E*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=E*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(c-_)<=E*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-T)<=E*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(d-x)<=E*Math.max(1,Math.abs(d),Math.abs(x))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromMat4:o,fromQuat:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r+r,s=i+i,l=o+o,c=r*a,u=i*a,d=i*s,h=o*a,m=o*s,f=o*l,p=n*a,g=n*s,v=n*l;return e[0]=1-d-f,e[3]=u-v,e[6]=h+g,e[1]=u+v,e[4]=1-c-f,e[7]=m-p,e[2]=h-g,e[5]=m+p,e[8]=1-c-d,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},invert:s,isOrthoNormal:h,mul:m,multiply:c,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},normalFromMat4:u,normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10],d=u*a-s*c,h=-u*n+s*l,m=c*n-a*l,f=r*d+i*h+o*m;if(!f)return null;const p=1/f;return e[0]=d*p,e[1]=(-u*i+o*c)*p,e[2]=(s*i-o*a)*p,e[3]=h*p,e[4]=(u*r-o*l)*p,e[5]=(-s*r+o*n)*p,e[6]=m*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*n)*p,e},projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},rotate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(r),m=Math.cos(r);return e[0]=m*i+h*a,e[1]=m*o+h*s,e[2]=m*n+h*l,e[3]=m*a-h*i,e[4]=m*s-h*o,e[5]=m*l-h*n,e[6]=c,e[7]=u,e[8]=d,e},scale:function(e,t,r){const i=r[0],o=r[1],n=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],o=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e},set:n,str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},sub:f,subtract:d,translate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],m=r[1];return e[0]=i,e[1]=o,e[2]=n,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+m*a+c,e[7]=h*o+m*s+u,e[8]=h*n+m*l+d,e},transpose:a},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return 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],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{a:()=>m,c:()=>g,g:()=>u,j:()=>y,k:()=>p,m:()=>d,s:()=>c});var i=r(46521),o=r(94961),n=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function u(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>(0,a.g)()?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function d(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+a*s+o*c-n*l,e[1]=o*u+a*l+n*s-i*c,e[2]=n*u+a*c+i*l-o*s,e[3]=a*u-i*s-o*l-n*c,e}function h(e,t,r,i){const o=t[0],n=t[1],s=t[2],l=t[3];let c,u,d,h,m,f=r[0],p=r[1],g=r[2],v=r[3];return u=o*f+n*p+s*g+l*v,u<0&&(u=-u,f=-f,p=-p,g=-g,v=-v),1-u>(0,a.g)()?(c=Math.acos(u),d=Math.sin(c),h=Math.sin((1-i)*c)/d,m=Math.sin(i*c)/d):(h=1-i,m=i),e[0]=h*o+m*f,e[1]=h*n+m*p,e[2]=h*s+m*g,e[3]=h*l+m*v,e}function m(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function f(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const o=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*o+n]-t[3*n+o])*i,e[o]=(t[3*o+r]+t[3*r+o])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function p(e,t,r,i){const o=.5*Math.PI/180;t*=o,r*=o,i*=o;const n=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=n*l*u-a*s*c,e[1]=a*s*u+n*l*c,e[2]=a*l*c-n*s*u,e[3]=a*l*u+n*s*c,e}const g=l.c,v=l.s,_=l.a,T=d,x=l.b,E=l.d,b=l.l,A=l.f,S=A,R=l.g,w=R,M=l.n,y=l.h,C=l.e,O=(0,n.c)(),I=(0,n.f)(1,0,0),P=(0,n.f)(0,1,0),N=(0,o.a)(),L=(0,o.a)(),D=(0,i.a)();Object.freeze(Object.defineProperty({__proto__:null,add:_,calculateW:function(e,t){const r=t[0],i=t[1],o=t[2];return e[0]=r,e[1]=i,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-o*o)),e},conjugate:m,copy:g,dot:E,equals:C,exactEquals:y,fromEuler:p,fromMat3:f,getAxisAngle:u,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r*r+i*i+o*o+n*n,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-o*s,e[3]=n*s,e},len:S,length:A,lerp:b,mul:T,multiply:d,normalize:M,random:function(e){const t=a.R,r=t(),i=t(),o=t(),n=Math.sqrt(1-r),s=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=s*Math.sin(2*Math.PI*o),e[3]=s*Math.cos(2*Math.PI*o),e},rotateX:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=o*l+n*s,e[2]=n*l-o*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*s,e[1]=o*l+a*s,e[2]=n*l+i*s,e[3]=a*l-o*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=o*l-i*s,e[2]=n*l+a*s,e[3]=a*l-n*s,e},rotationTo:function(e,t,r){const i=(0,s.j)(t,r);return i<-.999999?((0,s.b)(O,I,t),(0,s.k)(O)<1e-6&&(0,s.b)(O,P,t),(0,s.n)(O,O),c(e,O,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.b)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+i,M(e,e))},scale:x,set:v,setAxes:function(e,t,r,i){const o=D;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=i[0],o[4]=i[1],o[7]=i[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],M(e,f(e,o))},setAxisAngle:c,slerp:h,sqlerp:function(e,t,r,i,o,n){return h(N,t,o,n),h(L,r,i,n),h(e,N,L,2*n*(1-n)),e},sqrLen:w,squaredLength:R,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>u,Z:()=>c,c:()=>i,f:()=>o});const c=n(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>u,e:()=>l,n:()=>d,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[4],d=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+u*i+m*a+g,e[x+1]=l*r+d*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+u*i+m*a,e[v+1]=l*r+d*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function u(e,t){d(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:d,normalizeView:u,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>u,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.g)(e.origin),vector:(0,a.g)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.f)(r.vector,t,e),r}function u(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,u=(0,n.f)(s.WM.get(),t,c),d=(0,n.j)(l,u)/(0,n.m)(l);return(0,n.i)(a,l,(0,i.uZ)(d,0,1)),(0,n.g)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},670:(e,t,r)=>{r.d(t,{fetch:()=>kt});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),u=r(60437),d=r(1533);function h(e,t=!1){return e<=d.c8?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),E=r(91911),b=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class M{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var y=r(3172),C=r(66643),O=r(43090),I=r(20102),P=r(92604);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670),F=r(24882);async function H(e,t){const{data:r}=await(0,y.Z)(e,{responseType:"image",...t});return r}var B=r(51417),G=r(47026),U=r(22631),z=r(80442),V=r(32448),W=r(70586),j=r(17452),q=r(85958),k=r(99880);let X;var $,Y;(Y=$||($={}))[Y.ETC1_RGB=0]="ETC1_RGB",Y[Y.ETC2_RGBA=1]="ETC2_RGBA",Y[Y.BC1_RGB=2]="BC1_RGB",Y[Y.BC3_RGBA=3]="BC3_RGBA",Y[Y.BC4_R=4]="BC4_R",Y[Y.BC5_RG=5]="BC5_RG",Y[Y.BC7_M6_RGB=6]="BC7_M6_RGB",Y[Y.BC7_M5_RGBA=7]="BC7_M5_RGBA",Y[Y.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Y[Y.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Y[Y.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Y[Y.ATC_RGB=11]="ATC_RGB",Y[Y.ATC_RGBA=12]="ATC_RGBA",Y[Y.FXT1_RGB=17]="FXT1_RGB",Y[Y.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Y[Y.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Y[Y.ETC2_EAC_R11=20]="ETC2_EAC_R11",Y[Y.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Y[Y.RGBA32=13]="RGBA32",Y[Y.RGB565=14]="RGB565",Y[Y.BGR565=15]="BGR565",Y[Y.RGBA4444=16]="RGBA4444";var J=r(35371),Z=r(57088),K=r(45762);let Q=null,ee=null;async function te(){return null==ee&&(ee=function(){if(null==X){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);X=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return X}(),Q=await ee),ee}function re(e,t,r,i,o){const n=(0,K.RG)(t?J.q_.COMPRESSED_RGBA8_ETC2_EAC:J.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[$.ETC2_RGBA,J.q_.COMPRESSED_RGBA8_ETC2_EAC]:[$.ETC1_RGB,J.q_.COMPRESSED_RGB8_ETC2]:c?i?[$.BC3_RGBA,J.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[$.BC1_RGB,J.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[$.RGBA32,J.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.width=o,t.height=n,new Z.x(e,t,{type:"compressed",levels:m})}var ae=r(17662),se=r(4726);const le=P.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ue=ce("DXT1"),de=ce("DXT3"),he=ce("DXT5");function me(e){if(e instanceof ImageData)return me(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.Z("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e));let t=e.width*e.height;if(t>=4096){let r=e.width,i=e.height;do{r=Math.ceil(r/2),i=Math.ceil(i/2),t=r*i}while(t>1048576);const o=document.createElement("canvas");return o.width=r,o.height=i,o.getContext("2d").drawImage(e,0,0,r,i),o}return e}var fe,pe,ge=r(11726),ve=r(47859);class _e extends ae.c{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=se.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new V.Z,this._parameters={...xe,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,j.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,j.HK)(e.src)||(0,j.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new ve.X;return t.wrapMode=this._parameters.wrap??J.e8.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,d.eP)(e)||(0,d.lq)(e))return t.encoding===G.Ti.KTX2_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===G.Ti.BASIS_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Te(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new Z.x(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.DDS_ENCODING?this._loadFromDDSData(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.BASIS_ENCODING?this._loadFromBasis(e,t):(0,d.lq)(t)?this._loadFromPixelData(e,t):(0,d.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<fe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return le.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return le.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case ue:o=8,n=J.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case de:o=16,n=J.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case he:o=16,n=J.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return le.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(le.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,d=new Uint8Array(e,m,h),f.push(d),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new Z.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ge.hu)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?J.VI.LUMINANCE:3===this._parameters.components?J.VI.RGB:J.VI.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new Z.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await H(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,q.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=fe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,W.hw)(l)},a=()=>{t.readyState>=fe.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new I.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){let r=t;this._parameters.downsampleUncompressed&&(r instanceof ImageData||r instanceof HTMLImageElement||r instanceof HTMLCanvasElement)&&(r=me(r));const i=Te(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?J.VI.RGB:J.VI.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new Z.x(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,W.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Te(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(pe=fe||(fe={}))[pe.HAVE_NOTHING=0]="HAVE_NOTHING",pe[pe.HAVE_METADATA=1]="HAVE_METADATA",pe[pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",pe[pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",pe[pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const xe={wrap:{s:J.e8.REPEAT,t:J.e8.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ee=r(35065),be=r(64822),Ae=r(65576),Se=r(55039),Re=r(60624),we=r(19419),Me=r(85504),ye=r(60537),Ce=r(82791),Oe=r(93144),Ie=r(27097);const Pe=(0,Ie.wK)(J.zi.SRC_ALPHA,J.zi.ONE,J.zi.ONE_MINUS_SRC_ALPHA,J.zi.ONE_MINUS_SRC_ALPHA),Ne=(0,Ie.if)(J.zi.ONE,J.zi.ONE),Le=(0,Ie.if)(J.zi.ZERO,J.zi.ONE_MINUS_SRC_ALPHA);function De(e){return e===Oe.A.FrontFace?null:e===Oe.A.Alpha?Le:Ne}const Fe={factor:-1,units:-2};function He(e,t=J.wb.LESS){return e===Oe.A.NONE||e===Oe.A.FrontFace?t:J.wb.LEQUAL}var Be=r(97995),Ge=r(8310),Ue=r(87951);const ze=new class{constructor(e=0){this.offset=e,this.sphere=(0,Ge.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(Ve,e,t,r),n=(0,l.e)(o,o,i),a=this.offset/(0,l.l)(n);(0,l.q)(n,n,n,a);const s=this.objectTransform.inverse;return(0,l.e)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.q)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.q)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,l.l)(e),r=this.offset/t;return(0,l.q)(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,Ge.c)(),this._obb=(0,Ue.Ue)(),this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(Ve,e,t,r),o=(0,l.s)(We,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,l.l)(o);return(0,l.q)(this._tmpVertex,i,o,n),this._tmpVertex}applyToAabb(e){const t=(0,l.s)(Ve,e[0],e[1],e[2]+this.componentLocalOriginLength),r=(0,l.s)(We,e[3],e[4],e[5]+this.componentLocalOriginLength),i=(0,l.z)(je,t),o=(0,l.z)(qe,r),n=(0,l.w)(ke,t),a=(0,l.w)(Xe,r),s=(0,l.x)($e,n,a);s[0]=i[0]*o[0]<0?0:s[0],s[1]=i[1]*o[1]<0?0:s[1],s[2]=i[2]*o[2]<0?0:s[2];const c=(0,l.l)(s);if(c<this._totalOffset)return e[0]-=t[0]<0?this._totalOffset:0,e[1]-=t[1]<0?this._totalOffset:0,e[2]-=t[2]<0?this._totalOffset:0,e[3]+=r[0]>0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const u=(0,l.D)($e,n,a),d=(0,l.l)(u),h=this._totalOffset/d,m=this._totalOffset/c;return e[0]+=t[0]*(t[0]>0?h:m),e[1]+=t[1]*(t[1]>0?h:m),e[2]+=t[2]*(t[2]>0?h:m),e[3]+=r[0]*(r[0]<0?h:m),e[4]+=r[1]*(r[1]<0?h:m),e[5]+=r[2]*(r[2]<0?h:m),e}applyToMbs(e){const t=(0,l.l)(e),r=this._totalOffset/t;return(0,l.q)(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){return(0,Ue.gI)(e,this._totalOffset,this._totalOffset,be.JY.Global,this._obb),this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=(0,l.s)(Ve,e,t,r),o=(0,l.g)(We,i,this.localOrigin),n=this.offset/(0,l.l)(o);return(0,l.q)(this.tmpVertex,i,o,n),this.tmpVertex}applyToAabb(e){const t=je,r=qe,i=ke;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0==(a&e)){for(let o=0;o<3;++o)i[o]=0!=(a&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ve=(0,c.c)(),We=(0,c.c)(),je=(0,c.c)(),qe=(0,c.c)(),ke=(0,c.c)(),Xe=(0,c.c)(),$e=(0,c.c)();function Ye(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length;r*=a;for(let e=0;e<s;++e){const t=2*o[e];n[r]=i[t],n[r+1]=i[t+1],r+=a}}function Je(e,t,r,i){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}}function Ze(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}}function Ke(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function Qe(e,t,r,i,o,n){switch(e){case Ee.T.POSITION:{(0,ge.hu)(3===t.size);const i=o.getField(e,m.ct);(0,ge.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void Je(e,r,i,o);const{data:n,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,u=s.length,d=t[0],h=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],_=t[9],T=t[10],x=t[12],E=t[13],b=t[14];i*=c;let A=0,S=0,R=0;const w=(0,a.y)(t)?e=>{A=n[e]+x,S=n[e+1]+E,R=n[e+2]+b}:e=>{const t=n[e],r=n[e+1],i=n[e+2];A=d*t+f*r+v*i+x,S=h*t+p*r+_*i+E,R=m*t+g*r+T*i+b};if(1===o)for(let e=0;e<u;++e)w(3*s[e]),l[i]=A,l[i+1]=S,l[i+2]=R,i+=c;else for(let e=0;e<u;++e){w(3*s[e]);for(let e=0;e<o;++e)l[i]=A,l[i+1]=S,l[i+2]=R,i+=c}}(t,r,i,n);break}case Ee.T.NORMAL:{(0,ge.hu)(3===t.size);const r=o.getField(e,m.ct);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Je(e,r,i,o);const{data:n,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],T=l[9],x=l[10],E=!(0,a.z)(l),b=1e-6,A=1-b;i*=u;let S=0,R=0,w=0;const M=(0,a.y)(l)?e=>{S=n[e],R=n[e+1],w=n[e+2]}:e=>{const t=n[e],r=n[e+1],i=n[e+2];S=h*t+p*r+_*i,R=m*t+g*r+T*i,w=f*t+v*r+x*i};if(1===o)if(E)for(let e=0;e<d;++e){M(3*s[e]);const t=S*S+R*R+w*w;if(t<A&&t>b){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=R*e,c[i+2]=w*e}else c[i]=S,c[i+1]=R,c[i+2]=w;i+=u}else for(let e=0;e<d;++e)M(3*s[e]),c[i]=S,c[i+1]=R,c[i+2]=w,i+=u;else for(let e=0;e<d;++e){if(M(3*s[e]),E){const e=S*S+R*R+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=w,i+=u}}(t,i,r,n);break}case Ee.T.NORMALCOMPRESSED:{(0,ge.hu)(2===t.size);const r=o.getField(e,m.or);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ye(t,r,n);break}case Ee.T.UV0:{(0,ge.hu)(2===t.size);const r=o.getField(e,m.Eu);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ye(t,r,n);break}case Ee.T.COLOR:case Ee.T.SYMBOLCOLOR:{const r=o.getField(e,m.mc);(0,ge.hu)(!!r,`No buffer view for ${e}`),(0,ge.hu)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t!==n.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}}else{s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2],s[i+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const u=c*o;for(let r=1;r<u;++r)e[i]=a,i+=t}}(t,t.size,r,n);break}case Ee.T.COLORFEATUREATTRIBUTE:{const r=o.getField(e,m.ly);(0,ge.hu)(!!r,`No buffer view for ${e}`),(0,ge.hu)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length,l=i[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,n);break}case Ee.T.TANGENT:{(0,ge.hu)(4===t.size);const r=o.getField(e,m.ek);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Ze(e,r,i,o);const{data:n,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],T=l[9],x=l[10],E=!(0,a.z)(l),b=1e-6,A=1-b;if(i*=u,1===o)for(let e=0;e<d;++e){const t=4*s[e],r=n[t],o=n[t+1],a=n[t+2],l=n[t+3];let d=h*r+p*o+_*a,S=m*r+g*o+T*a,R=f*r+v*o+x*a;if(E){const e=d*d+S*S+R*R;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,S*=t,R*=t}}c[i]=d,c[i+1]=S,c[i+2]=R,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*s[e],r=n[t],a=n[t+1],l=n[t+2],d=n[t+3];let S=h*r+p*a+_*l,R=m*r+g*a+T*l,w=f*r+v*a+x*l;if(E){const e=S*S+R*R+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=w,c[i+3]=d,i+=u}}(t,i,r,n);break}case Ee.T.PROFILERIGHT:case Ee.T.PROFILEUP:case Ee.T.PROFILEVERTEXANDNORMAL:case Ee.T.FEATUREVALUE:{(0,ge.hu)(4===t.size);const r=o.getField(e,m.ek);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ze(t,r,n)}}}class et{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ee.T.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)Qe(a,t,r,i,o,n);else if(a===Ee.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ee.T.POSITION)?.indices;if(t){const r=t.length,i=o.getField(a,m.mc);Ke(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var tt=r(57790),rt=r(88669),it=r(135),ot=r(15719),nt=r(96310),at=r(78869),st=r(14589),lt=r(83475),ct=r(59377);J.wb.LESS,J.wb.ALWAYS;const ut={mask:255},dt={function:{func:J.wb.ALWAYS,ref:G.hU.OutlineVisualElementMask,mask:G.hU.OutlineVisualElementMask},operation:{fail:J.xS.KEEP,zFail:J.xS.KEEP,zPass:J.xS.ZERO}},ht={function:{func:J.wb.ALWAYS,ref:G.hU.OutlineVisualElementMask,mask:G.hU.OutlineVisualElementMask},operation:{fail:J.xS.KEEP,zFail:J.xS.KEEP,zPass:J.xS.REPLACE}};J.wb.EQUAL,G.hU.OutlineVisualElementMask,G.hU.OutlineVisualElementMask,J.xS.KEEP,J.xS.KEEP,J.xS.KEEP,J.wb.NOTEQUAL,G.hU.OutlineVisualElementMask,G.hU.OutlineVisualElementMask,J.xS.KEEP,J.xS.KEEP,J.xS.KEEP;const mt=[1,1,.5],ft=[0,.6,.2],pt=[0,1,.2];var gt=r(32078);class vt extends ot.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.e)(mt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=G.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Re.r.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,rt.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=G.Gv.Less,this.textureAlphaMode=G.JJ.Blend,this.textureAlphaCutoff=nt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ce.yD.Occlude,this.isDecoration=!1}}class _t extends st.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===be.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?it.N.Default:it.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,_t.shader)}_initializeProgram(e,t){return new ct.$(e.rctx,t.get().build(this.configuration),lt.i)}_convertDepthTestFunction(e){return e===G.Gv.Lequal?J.wb.LEQUAL:J.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===Oe.A.NONE,o=e===Oe.A.FrontFace;return(0,Ie.sm)({blending:r.output!==Se.H.Color&&r.output!==Se.H.Alpha||!r.transparent?null:i?Pe:De(e),culling:Tt(r)?(0,Ie.zp)(r.cullFace):null,depthTest:{func:He(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ie.LZ:null,colorWrite:Ie.BK,stencilWrite:r.hasOccludees?ut:null,stencilTest:r.hasOccludees?t?ht:dt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Fe:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Tt(e){return e.cullFace!==G.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}_t.shader=new at.J(gt.D,(()=>r.e(9291).then(r.bind(r,79291))));var xt=r(43697),Et=r(51354),bt=r(47624),At=r(67498);class St extends bt.PO{}(0,xt._)([(0,Et.o)({constValue:!0})],St.prototype,"hasSliceHighlight",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],St.prototype,"hasSliceInVertexProgram",void 0),(0,xt._)([(0,Et.o)({constValue:At.P.Pass})],St.prototype,"pbrTextureBindType",void 0);class Rt extends St{constructor(){super(...arguments),this.output=Se.H.Color,this.alphaDiscardMode=G.JJ.Opaque,this.doubleSidedMode=we.q.None,this.pbrMode=Me.f7.Disabled,this.cullFace=G.Vr.None,this.transparencyPassType=Oe.A.NONE,this.normalType=Re.r.Attribute,this.textureCoordinateType=it.N.None,this.customDepthTest=G.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,xt._)([(0,Et.o)({count:Se.H.COUNT})],Rt.prototype,"output",void 0),(0,xt._)([(0,Et.o)({count:G.JJ.COUNT})],Rt.prototype,"alphaDiscardMode",void 0),(0,xt._)([(0,Et.o)({count:we.q.COUNT})],Rt.prototype,"doubleSidedMode",void 0),(0,xt._)([(0,Et.o)({count:Me.f7.COUNT})],Rt.prototype,"pbrMode",void 0),(0,xt._)([(0,Et.o)({count:G.Vr.COUNT})],Rt.prototype,"cullFace",void 0),(0,xt._)([(0,Et.o)({count:Oe.A.COUNT})],Rt.prototype,"transparencyPassType",void 0),(0,xt._)([(0,Et.o)({count:Re.r.COUNT})],Rt.prototype,"normalType",void 0),(0,xt._)([(0,Et.o)({count:it.N.COUNT})],Rt.prototype,"textureCoordinateType",void 0),(0,xt._)([(0,Et.o)({count:G.Gv.COUNT})],Rt.prototype,"customDepthTest",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"spherical",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVertexColors",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSymbolColors",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVerticalOffset",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSlicePlane",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSliceHighlight",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasColorTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasMetallicRoughnessTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasEmissionTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOcclusionTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasNormalTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasScreenSizePerspective",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVertexTangents",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOccludees",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"multipassEnabled",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasModelTransformation",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"offsetBackfaces",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"vvSize",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"vvColor",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"receiveShadows",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"receiveAmbientOcclusion",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"textureAlphaPremultiplied",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instanced",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instancedColor",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instancedDoublePrecision",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"writeDepth",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"transparent",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"enableOffset",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"cullAboveGround",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"snowCover",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasColorTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasEmissionTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasNormalTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOcclusionTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"occlusionPass",void 0),(0,xt._)([(0,Et.o)({constValue:!0})],Rt.prototype,"hasVvInstancing",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"useCustomDTRExponentForWater",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"supportsTextureAtlas",void 0),(0,xt._)([(0,Et.o)({constValue:!0})],Rt.prototype,"useFillLights",void 0);var wt=r(41846);class Mt extends _t{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Re.r.Attribute,t.doubleSidedMode=we.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Mt.shader)}}Mt.shader=new at.J(wt.R,(()=>r.e(8096).then(r.bind(r,38096))));class yt extends Ce.F5{constructor(e){super(e,Ot),this.supportsEdges=!0,this._configuration=new Rt,this._vertexBufferLayout=function(e){const t=(0,Ae.U$)().vec3f(Ee.T.POSITION);return e.normalType===Re.r.Compressed?t.vec2i16(Ee.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ee.T.NORMAL),e.hasVertexTangents&&t.vec4f(Ee.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ee.T.UV0),e.hasVertexColors&&t.vec4u8(Ee.T.COLOR),e.hasSymbolColors&&t.vec4u8(Ee.T.SYMBOLCOLOR),(0,z.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ee.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Se.H.Shadow&&e!==Se.H.ShadowExcludeHighlight&&e!==Se.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?G.Vr.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Se.H.Color&&e!==Se.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=we.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?we.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?we.q.WindingOrder:we.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Me.f7.Schematic:Me.f7.Normal:Me.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Ft,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case be.JY.Global:n=(0,l.n)(Lt,Ft);break;case be.JY.Local:n=(0,l.c)(Lt,Nt)}let a=0;const s=(0,l.f)(Ht,Ft,e.eye),c=(0,l.l)(s),u=(0,l.i)(s,s,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,l.j)(n,u)),a+=(0,tt.Hx)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,l.i)(n,n,a),(0,l.t)(Dt,n,r.transform.inverseRotation),i=(0,l.f)(It,i,Dt),o=(0,l.f)(Pt,o,Dt)}var a;(0,tt.Bw)(e,r,i,o,null!=(a=r.verticalOffset)?(ze.offset=a,ze):null,n)}produces(e,t){return!(t!==Se.H.Color&&t!==Se.H.Alpha&&t!==Se.H.Depth&&t!==Se.H.Normal&&t!==Se.H.Shadow&&t!==Se.H.ShadowHighlight&&t!==Se.H.ShadowExcludeHighlight&&t!==Se.H.Highlight&&t!==Se.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Be.r.TRANSPARENT_MATERIAL:Be.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Be.r.OPAQUE_MATERIAL)&&e!==Be.r.DRAPED_MATERIAL)}createGLMaterial(e){return new Ct(e)}createBufferWriter(){return new et(this._vertexBufferLayout)}}class Ct extends ye.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Se.H.Color&&this._output!==Se.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Mt:_t,e)}}const Ot=new class extends vt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},It=(0,c.c)(),Pt=(0,c.c)(),Nt=(0,c.f)(0,0,1),Lt=(0,c.c)(),Dt=(0,c.c)(),Ft=(0,c.c)(),Ht=(0,c.c)(),Bt=P.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Gt(e){throw new I.Z("",`Request for object resource failed: ${e}`)}function Ut(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Bt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Bt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Bt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Bt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Bt.warn("Indexed geometries must specify faces"),i=!1;break}default:Bt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Bt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Bt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function zt(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function Vt(e){switch(e){case"mask":return G.JJ.Mask;case"maskAndTransparency":return G.JJ.MaskBlend;case"none":return G.JJ.Opaque;default:return G.JJ.Blend}}function Wt(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const jt=new D.G(1,2,"wosr");var qt=r(57758);async function kt(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,C.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Gt(i.error.details.url)}(e,r,t);const i=await(0,C.q6)((0,y.Z)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Gt(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Bt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:J.e8.REPEAT,t:J.e8.REPEAT},preMultiplyAlpha:Vt(l)!==G.JJ.Opaque},u=null!=t&&t.disableTextures?Promise.resolve(null):H(a,t);r.push(u.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,O.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");jt.validate(s);const l=a.model.name,u=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<u.length;e++){const a=u[e];if(!Ut(a))continue;const s=Wt(a),l=a.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=l[Ee.T.POSITION],_=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,F.KF)(_);p.push([e,new B.a(r,i,t.valuesPerElement,!0)])}const T=s.texture,x=h&&h[T];if(x&&!f.has(T)){const{image:e,parameters:t}=x,r=new _e(e,t);i.push(r),f.set(T,r)}const E=f.get(T),b=E?E.id:void 0,A=s.material;let S=n.get(A,T);if(null==S){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=x&&x.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=x?Vt(x.alphaChannelUsage):void 0,a={ambient:(0,c.e)(e.diffuse),diffuse:(0,c.e)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:b,initTextureTransparent:!0,doubleSided:!0,cullFace:G.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:x?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),S=new yt(a),n.set(A,T,S)}o.push(S);const R=new U.Z(S,p);m+=p.find((e=>e[0]===Ee.T.POSITION))?.[1]?.indices.length??0,r.push(R)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:zt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),d=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=d&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,u=n.count,d=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*u),g=new Float64Array(3*u),v=(0,a.i)((0,s.a)(),o.transform);let _=0,T=0;for(let a=0;a<u;a++){n.getVec(a,h),i.getVec(a,d),(0,l.e)(h,h,o.transform),(0,l.f)(f,h,t.center),(0,l.B)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),u=Math.min(.45+.55*c*c,1);(0,l.B)(f,f,t.radius),null!==v&&(0,l.e)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.p)(f,f,d,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*u,p[T+1]=255*u,p[T+2]=255*u,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,d));const S=!!t.usePBR,w=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...pt]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...mt]},I={...t.materialParameters,treeRendering:A},{engineResources:P,referenceBoundingBox:z}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,d=new Map,T=n.lods.length,x=(0,u.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const w=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new yt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),d=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==u)return null;const m=function(e){switch(e){case"BLEND":return G.JJ.Blend;case"MASK":return G.JJ.Mask;case"OPAQUE":case null:case void 0:return G.JJ.Opaque}}(u.alphaMode);if(!n.has(s)){if(d){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new _e((0,b.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.$A)(e)&&r,encoding:(0,b.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==G.JJ.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/qt.j),f=u.color[1]**(1/qt.j),p=u.color[2]**(1/qt.j),g=u.emissiveFactor[0]**(1/qt.j),v=u.emissiveFactor[1]**(1/qt.j),_=u.emissiveFactor[2]**(1/qt.j),T=null!=u.textureColor&&d?a.get(u.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.h)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion});n.set(s,new yt({...i,transparent:m===G.JJ.Blend,customDepthTest:G.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?G.Vr.None:G.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?Re.r.Attribute:Re.r.ScreenDerivative,castShadows:!0,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&d?a.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&d?a.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&d?a.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&d?a.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...ft]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:R(u.colorTextureTransform),normalTextureTransformMatrix:R(u.normalTextureTransform),occlusionTextureTransformMatrix:R(u.occlusionTextureTransform),emissiveTextureTransformMatrix:R(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(u.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),d){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(n,e,w,t,r,s,d),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[Ee.T.POSITION,new B.a(n,i,3,!0)]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.n)(Xt,e.transform),(0,f.a)(t,n,Xt,3,a),l.push([Ee.T.NORMAL,new B.a(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.n)(Xt,e.transform),(0,p.t)(t,n,Xt,4,a),l.push([Ee.T.TANGENT,new B.a(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([Ee.T.UV0,new B.a(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([Ee.T.COLOR,new B.a(t,i,4,!0)])}return{geometry:new U.Z(t,l),vertexCount:r}}(e,null!=i?i:new yt({})),M=a.boundingInfo;null!=M&&0===A&&((0,u.pp)(x,M.bbMin),(0,u.pp)(x,M.bbMax)),null!=i&&(w.stageResources.geometries.push(a),w.numberOfVertices+=T)})),S||a.push(w)})),{engineResources:a,referenceBoundingBox:x}}(n,w,I,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:P,referenceBoundingBox:z,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const Xt=(0,n.a)()},6206:(e,t,r)=>{var i,o;r.d(t,{a9:()=>i}),r(22021),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},87951:(e,t,r)=>{r.d(t,{Ue:()=>u,gI:()=>d}),r(21787);var i=r(46521),o=r(51305),n=r(94961),a=r(17896),s=r(65617),l=(r(98766),r(88669)),c=(r(60437),r(62073),r(64822));function u(e=[0,0,0],t=[-1,-1,-1],r=(0,n.a)()){return{center:(0,s.g)(e),halfSize:(0,s.g)(t),quaternion:(0,n.b)(r)}}function d(e,t,r,i,n){if((0,o.c)(n.quaternion,e.quaternion),i===c.JY.Global){(0,o.a)(p,e.quaternion),(0,a.v)(h,e.center,p),(0,a.w)(m,h),(0,a.x)(f,m,e.halfSize),(0,a.u)(f,m,f);const i=(0,a.l)(f);(0,a.g)(f,m,e.halfSize);const s=(0,a.l)(f);if(i<r)(0,a.c)(n.center,e.center),(0,a.s)(h,r,r,r),(0,a.g)(n.halfSize,e.halfSize,h);else{const o=s>0?1+t/s:1,l=i>0?1+r/i:1,c=(l+o)/2,u=(l-o)/2;(0,a.i)(n.halfSize,m,u),(0,a.q)(n.halfSize,n.halfSize,e.halfSize,c),(0,a.i)(n.center,m,c),(0,a.q)(n.center,n.center,e.halfSize,u),(0,a.z)(h,h),(0,a.A)(n.center,n.center,h),(0,a.v)(n.center,n.center,n.quaternion)}}else{const i=(0,a.s)(h,0,0,1);(0,a.q)(n.center,e.center,i,(r+t)/2),(0,o.a)(p,e.quaternion),(0,a.v)(i,i,p),(0,a.w)(i,i),(0,a.q)(n.halfSize,e.halfSize,i,(r-t)/2)}return n}(0,n.a)(),(0,s.c)(),(0,s.c)(),(0,l.c)(),(0,i.a)(),(()=>{const e=new Int8Array(162);let t=0;const r=r=>{for(let i=0;i<r.length;i++)e[t+i]=r[i];t+=6};r([6,2,3,1,5,4]),r([0,2,3,1,5,4]),r([0,2,3,7,5,4]),r([0,1,3,2,6,4]),r([0,1,3,2,0,0]),r([0,1,5,7,3,2]),r([0,1,3,7,6,4]),r([0,1,3,7,6,2]),r([0,1,5,7,6,2]),r([0,1,5,4,6,2]),r([0,1,5,4,0,0]),r([0,1,3,7,5,4]),r([0,2,6,4,0,0]),r([0,0,0,0,0,0]),r([1,3,7,5,0,0]),r([2,3,7,6,4,0]),r([2,3,7,6,0,0]),r([2,3,1,5,7,6]),r([0,1,5,7,6,2]),r([0,1,5,7,6,4]),r([0,1,3,7,6,4]),r([4,5,7,6,2,0]),r([4,5,7,6,0,0]),r([4,5,1,3,7,6]),r([0,2,3,7,5,4]),r([6,2,3,7,5,4]),r([6,2,3,1,5,4])})();const h=(0,s.c)(),m=(0,s.c)(),f=(0,s.c)(),p=(0,n.a)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>u});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
286
286
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
287
287
  }`)}function u(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
288
288
  linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
@@ -620,14 +620,14 @@ return mat3(T, B, normal);
620
620
  }`),t.textureCoordinateType!==i.N.None&&(e.include(o.i,t),r.uniforms.add(t.pbrTextureBindType===c.P.Pass?new l.A("normalTexture",(e=>e.textureNormal)):new s.R("normalTexture",(e=>e.textureNormal))),r.code.add(a.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
621
621
  vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;
622
622
  return tangentSpace * rawNormal;
623
- }`))}},77813:(e,t,r)=>{r.d(t,{K:()=>he});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),u=(r(75215),r(67676)),d=(r(80442),r(52011)),h=r(4307);r(69801);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,u.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class M{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=w(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return w(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=w(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&w(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};y(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(y(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,C(t),e))),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,C(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),y(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){y(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===M._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;M._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else M._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>M._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${M._MAX_COLOR_ATTACHMENTS} color attachments`)}}function w(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function y(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}M._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH24_BUFFER=1]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=2]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(92036),V=r(55039);const W={required:[]},j=(V.H.Depth,V.H.CompositeColor,V.H.Highlight,{required:[V.H.Depth,V.H.Normal]});class q extends z.Z{consumes(){return W}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class k extends q{}var X=r(78869),$=r(14589),Y=r(83475),J=r(59377),Z=r(59915),K=r(27097);class Q extends $.A{initializeProgram(e){return new J.$(e.rctx,Q.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}Q.shader=new X.J(Z.S,(()=>r.e(8092).then(r.bind(r,88092))));var ee=r(97323);class te extends i.K{constructor(){super(...arguments),this.projScale=1}}class re extends te{constructor(){super(...arguments),this.intensity=1}}class ie extends i.K{}class oe extends ie{constructor(){super(...arguments),this.blurSize=(0,ee.a)()}}var ne,ae=r(25377);class se extends $.A{initializeProgram(e){return new J.$(e.rctx,se.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}se.shader=new X.J(ae.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ne||(ne={}));var le=r(97995);const ce=2;let ue=class extends k{constructor(e){super(e),this._context=null,this._passParameters=new re,this._drawParameters=new oe,this.produces=new Map([[le.r.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?j:W}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ne.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(se)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Q)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}renderNode(e,t,r){const i=e.bindParameters,o=i.linearDepth?.colorTexture,n=r?.normal?.colorTexture;if(null==this._enableTime||null==this._context||null==o||!n)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=i.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=n,this._passParameters.depthTexture=o,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*de/(0,ae.g)(s)**6*c;const u=s.fullViewport[2],d=s.fullViewport[3],f=u/ce,p=d/ce,g=this._context.fbos,v=g.acquire(O.RED,u,d);a.bindFramebuffer(v.fbo),a.setViewport(0,0,u,d),a.bindTechnique(this._ssaoTechnique,this._passParameters,i).bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,i);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,ce/d),_.bindDraw(this._drawParameters,i,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,u,d),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,ce/u,0),_.bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],ue.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],ue.prototype,"_context",void 0),ue=(0,n._)([(0,d.j)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ue);const de=.5;function he(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/ce),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
623
+ }`))}},77813:(e,t,r)=>{r.d(t,{K:()=>he});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),u=(r(75215),r(67676)),d=(r(80442),r(52011)),h=r(4307);r(69801);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,u.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=M(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return M(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=M(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&M(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};y(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(y(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,C(t),e))),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,C(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),y(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){y(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function M(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function y(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",e[e.DEPTH24_BUFFER=2]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=3]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH_STENCIL_BUFFER,new b(m.Tg.DEPTH24_STENCIL8,4),G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(92036),V=r(55039);const W={required:[]},j=(V.H.Depth,V.H.CompositeColor,V.H.Highlight,{required:[V.H.Depth,V.H.Normal]});class q extends z.Z{consumes(){return W}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class k extends q{}var X=r(78869),$=r(14589),Y=r(83475),J=r(59377),Z=r(59915),K=r(27097);class Q extends $.A{initializeProgram(e){return new J.$(e.rctx,Q.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}Q.shader=new X.J(Z.S,(()=>r.e(8092).then(r.bind(r,88092))));var ee=r(97323);class te extends i.K{constructor(){super(...arguments),this.projScale=1}}class re extends te{constructor(){super(...arguments),this.intensity=1}}class ie extends i.K{}class oe extends ie{constructor(){super(...arguments),this.blurSize=(0,ee.a)()}}var ne,ae=r(25377);class se extends $.A{initializeProgram(e){return new J.$(e.rctx,se.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}se.shader=new X.J(ae.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ne||(ne={}));var le=r(97995);const ce=2;let ue=class extends k{constructor(e){super(e),this._context=null,this._passParameters=new re,this._drawParameters=new oe,this.produces=new Map([[le.r.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?j:W}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ne.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(se)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Q)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}renderNode(e,t,r){const i=e.bindParameters,o=i.linearDepth?.colorTexture,n=r?.normal?.colorTexture;if(null==this._enableTime||null==this._context||null==o||!n)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=i.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=n,this._passParameters.depthTexture=o,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*de/(0,ae.g)(s)**6*c;const u=s.fullViewport[2],d=s.fullViewport[3],f=u/ce,p=d/ce,g=this._context.fbos,v=g.acquire(O.RED,u,d);a.bindFramebuffer(v.fbo),a.setViewport(0,0,u,d),a.bindTechnique(this._ssaoTechnique,this._passParameters,i).bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,i);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,ce/d),_.bindDraw(this._drawParameters,i,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,u,d),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,ce/u,0),_.bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],ue.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],ue.prototype,"_context",void 0),ue=(0,n._)([(0,d.j)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ue);const de=.5;function he(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/ce),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
624
624
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
625
625
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
626
626
  }
627
627
  float evaluateAmbientOcclusion() {
628
628
  return 1.0 - evaluateAmbientOcclusionInverse();
629
629
  }`)):r.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
630
- float evaluateAmbientOcclusion() { return 0.0; }`)}},89753:(e,t,r)=>{r.d(t,{XP:()=>M,PN:()=>S,sC:()=>R});var i=r(74085),o=r(17896),n=r(65617),a=r(98766),s=r(88669),l=r(85504),c=r(172),u=r(71250),d=r(74709);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
630
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},89753:(e,t,r)=>{r.d(t,{XP:()=>w,PN:()=>S,sC:()=>R});var i=r(74085),o=r(17896),n=r(65617),a=r(98766),s=r(88669),l=r(85504),c=r(172),u=r(71250),d=r(74709);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
631
631
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
632
632
  return ambientLight * (1.0 - ambientOcclusion);
633
633
  }`)):1===i?(r.uniforms.add(new u.N("lightingAmbientSH_R",((e,t)=>(0,a.s)(f,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new u.N("lightingAmbientSH_G",((e,t)=>(0,a.s)(f,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new u.N("lightingAmbientSH_B",((e,t)=>(0,a.s)(f,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
@@ -673,7 +673,7 @@ vec3 calculateAmbientRadiance(float ambientOcclusion)
673
673
  {
674
674
  vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
675
675
  return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
676
- }`))}const m=(0,n.c)(),f=(0,s.c)();var p=r(77813),g=r(5802),v=r(26322),_=r(27754),T=r(79884),x=r(67498);class E extends T.x{constructor(e,t){super(e,"bool",x.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var b=r(21437);r(22021),(0,n.c)();const A=.4;function S(e){e.constants.add("ambientBoostFactor","float",A)}function R(e){e.uniforms.add(new b.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function M(e,t){const r=e.fragment;switch(e.include(p.K,t),t.pbrMode!==l.f7.Disabled&&e.include(v.T,t),e.include(h,t),e.include(_.e),r.code.add(d.H`
676
+ }`))}const m=(0,n.c)(),f=(0,s.c)();var p=r(77813),g=r(5802),v=r(26322),_=r(27754),T=r(79884),x=r(67498);class E extends T.x{constructor(e,t){super(e,"bool",x.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var b=r(21437);r(22021),(0,n.c)();const A=.4;function S(e){e.constants.add("ambientBoostFactor","float",A)}function R(e){e.uniforms.add(new b.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function w(e,t){const r=e.fragment;switch(e.include(p.K,t),t.pbrMode!==l.f7.Disabled&&e.include(v.T,t),e.include(h,t),e.include(_.e),r.code.add(d.H`
677
677
  const float GAMMA_SRGB = 2.1;
678
678
  const float INV_GAMMA_SRGB = 0.4761904;
679
679
  ${t.pbrMode===l.f7.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
@@ -1095,4 +1095,4 @@ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
1095
1095
  );
1096
1096
  float rgba2float(vec4 rgba) {
1097
1097
  return dot(rgba, RGBA_2_FLOAT_FACTORS);
1098
- }`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>m,Sv:()=>f,_8:()=>v});var i=r(52138),o=r(13598),n=r(17896),a=r(65617),s=r(70582),l=r(172),c=(r(21437),r(79884)),u=r(67498);class d extends c.x{constructor(e,t){super(e,"mat4",u.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,n.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new d("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin)));const r=e=>(0,n.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t))))}const p=(0,o.a)(),g=(0,a.c)();function v(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>c});var i=r(20102),o=r(92604),n=r(67498),a=r(11726);const s=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class l{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){s.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class c extends l{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new f,this.extensions=new p,this.constants=new v,this.outputs=new g}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s="vertex"===e?T:_,l=this.constants.generateSource().concat(o.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${c.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,t,o,n)}}}class u{constructor(){this._entries=new Map}add(...e){for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else s.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class h extends l{constructor(){super(...arguments),this.uniforms=new u,this.code=new d,this.constants=new v}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}p.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],p.ALLOWLIST_VERTEX=[];class g{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?(0,a.hu)(i.name===e&&i.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:g.DEFAULT_NAME,type:g.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}g.DEFAULT_TYPE="vec4",g.DEFAULT_NAME="fragColor";class v{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>v._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",T="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},o)switch(r){case i.P.Pass:this.bind[i.P.Pass]=o;break;case i.P.Draw:this.bind[i.P.Draw]=o}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var n;(n=o||(o={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(70586),o=r(35371);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipeline(e,t,r){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>n});var i=r(74709);class o extends i.K{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function n(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits??[0];let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<n)-1<<l;a[s]+=n,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},51417:(e,t,r)=>{r.d(t,{U:()=>i,a:()=>o});class i{constructor(e,t,r=t){this.data=e,this.size=t,this.stride=r}}class o extends i{constructor(e,t,r,i=!1,o=r){super(e,r,o),this.indices=t,this.exclusive=i}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.NORMALCOMPRESSED,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEOBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEMODEL,8],[i.T.INSTANCEMODELNORMAL,12],[i.T.INSTANCEMODELORIGINHI,11],[i.T.INSTANCEMODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),n=r(74709),a=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRepository,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},22631:(e,t,r)=>{r.d(t,{Z:()=>y});var i=r(13598),o=r(17896),n=r(24882),a=r(1533);function s(e){if(e.length<a.c8)return Array.from(e);if((0,a.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,a.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var l=r(47026),c=r(44553),u=r(65617),d=r(11726);class h{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,d.hu)(e.length>=1),(0,d.hu)(3===r.size||4===r.size);const{data:i,size:n,indices:a}=r;(0,d.hu)(a.length%this._numIndexPerPrimitive==0),(0,d.hu)(a.length>=e.length*this._numIndexPerPrimitive);const s=e.length;let l=n*a[this._numIndexPerPrimitive*e[0]];m.clear(),m.push(l);const c=(0,u.f)(i[l],i[l+1],i[l+2]),h=(0,u.g)(c);for(let t=0;t<s;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){l=n*a[r+e],m.push(l);let t=i[l];c[0]=Math.min(t,c[0]),h[0]=Math.max(t,h[0]),t=i[l+1],c[1]=Math.min(t,c[1]),h[1]=Math.max(t,h[1]),t=i[l+2],c[2]=Math.min(t,c[2]),h[2]=Math.max(t,h[2])}}this.bbMin=c,this.bbMax=h;const f=(0,o.p)((0,u.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(h[0]-c[0],h[1]-c[1]),h[2]-c[2]);let p=this.radius*this.radius;for(let e=0;e<m.length;++e){l=m.at(e);const t=i[l]-f[0],r=i[l+1]-f[1],o=i[l+2]-f[2],n=t*t+r*r+o*o;if(n<=p)continue;const a=Math.sqrt(n),s=.5*(a-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const c=s/a;f[0]+=t*c,f[1]+=r*c,f[2]+=o*c}this.center=f,m.clear()}getChildren(){if(this._children||(0,o.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.p)((0,u.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:a,indices:s}=this.position;for(let o=0;o<t;++o){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[o];let c=a*s[l],u=n[c],d=n[c+1],h=n[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=a*s[l+e];const t=n[c],r=n[c+1],i=n[c+2];t<u&&(u=t),r<d&&(d=r),i<h&&(h=i)}u<e[0]&&(t|=1),d<e[1]&&(t|=2),h<e[2]&&(t|=4),r[o]=t,++i[t]}let l=0;for(let e=0;e<8;++e)i[e]>0&&++l;if(l<2)return;const c=new Array(8);for(let e=0;e<8;++e)c[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];c[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==c[e]&&this._children.push(new h(c[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){m.prune()}}const m=new c.Z({deallocator:null});var f=r(17662),p=r(4726),g=r(22807),v=r(16996);function _(e,t,r){return(0,o.f)(T,t,e),(0,o.f)(x,r,e),(0,o.l)((0,o.b)(T,T,x))/2}r(12981),new g.x(v.Ue),new g.x((()=>{return e?{p0:(0,u.g)(e.p0),p1:(0,u.g)(e.p1),p2:(0,u.g)(e.p2)}:{p0:(0,u.c)(),p1:(0,u.c)(),p2:(0,u.c)()};var e}));const T=(0,u.c)(),x=(0,u.c)(),E=(0,u.c)(),b=(0,u.c)(),A=(0,u.c)(),S=(0,u.c)();var R=r(99001);class M{constructor(e){this.channel=e,this.id=(0,R.D)()}}var w=r(35065);r(9820),(0,u.c)(),new Float32Array(6);class y extends f.c{constructor(e,t,r=null,i=p.U.Mesh,o=null,a=-1){super(),this.material=e,this.mapPositions=r,this.type=i,this.objectAndLayerIdColor=o,this.edgeIndicesLength=a,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,n.mi)(r.indices)}),e===w.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new y(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:s(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){const e=this._attributes.values().next().value.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===p.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===p.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.e)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.s)(t,0,0,0),(0,o.s)(S,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,u=n[e+2]*r;(0,o.s)(E,i[l],i[l+1],i[l+2]),(0,o.s)(b,i[c],i[c+1],i[c+2]),(0,o.s)(A,i[u],i[u+1],i[u+2]);const d=_(E,b,A);d?((0,o.g)(E,E,b),(0,o.g)(E,E,A),(0,o.i)(E,E,1/3*d),(0,o.g)(t,t,E),a+=d):((0,o.g)(S,S,E),(0,o.g)(S,S,b),(0,o.g)(S,S,A),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.i)(t,t,1/a),0):0===s||((0,o.i)(t,S,1/s),0)))}(this.attributes.get(w.T.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(w.T.POSITION);return function(e,t,r){if(!e)return!1;(0,o.s)(r,0,0,0),(0,o.s)(S,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,u=c+(t?2:0);for(let e=0;e<u;e+=2){const t=e<c?e+1:0,u=l[e<c?e:c]*a,d=l[t]*a;E[0]=s[u],E[1]=s[u+1],E[2]=s[u+2],b[0]=s[d],b[1]=s[d+1],b[2]=s[d+2],(0,o.i)(E,(0,o.g)(E,E,b),.5);const h=(0,o.r)(E,b);h>0?((0,o.g)(r,r,(0,o.i)(E,E,h)),i+=h):0===i&&((0,o.g)(S,S,E),n++)}return 0!==i?((0,o.i)(r,r,1/i),!0):0!==n&&((0,o.i)(r,S,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.s)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.i)(t,t,1/s),s>0}(this.attributes.get(w.T.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(w.T.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===p.U.Mesh?3:1;(0,d.hu)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,n.KF)(e.indices.length/t);return new h(r,t,e)}get transformation(){return this._transformation??i.I}set transformation(e){this._transformation=e&&e!==i.I?(0,i.b)(e):null}addHighlight(){const e=new M(l.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,n=r(65617),a=(r(74709),r(47026)),s=r(17662),l=r(4726),c=r(83475),u=r(57790);class d extends s.c{constructor(e,t){super(),this.type=l.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._vertexAttributeLocations=c.i,this._pp0=(0,n.f)(0,0,1),this._pp1=(0,n.f)(0,0,0),this._parameters=(0,u.Uf)(e,t),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bindParameters.decorations===a.Iq.ON)&&0!=(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){this.repository?.materialChanged(this)}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>n});var i=r(44553),o=r(49300);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,o.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t?.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),null!=this._fragmentUniforms&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},97995:(e,t,r)=>{var i;r.d(t,{r:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",e[e.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",e[e.ANTIALIASING=10]="ANTIALIASING",e[e.COMPOSITE=11]="COMPOSITE",e[e.BLIT=12]="BLIT",e[e.SSAO=13]="SSAO",e[e.HIGHLIGHT=14]="HIGHLIGHT",e[e.SHADOW_HIGHLIGHT=15]="SHADOW_HIGHLIGHT",e[e.ENVIRONMENT_OPAQUE=16]="ENVIRONMENT_OPAQUE",e[e.ENVIRONMENT_TRANSPARENT=17]="ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=18]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=19]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=20]="HUD_MATERIAL",e[e.LABEL_MATERIAL=21]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=22]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=23]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=24]="DRAPED_MATERIAL",e[e.DRAPED_WATER=25]="DRAPED_WATER",e[e.VOXEL=26]="VOXEL",e[e.MAX_SLOTS=27]="MAX_SLOTS"}(i||(i={}))},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},47026:(e,t,r)=>{var i,o,n,a,s,l,c,u,d;r.d(t,{Gv:()=>o,Iq:()=>u,JJ:()=>c,Rw:()=>a,Ti:()=>d,V_:()=>l,Vr:()=>i,hU:()=>s}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(u||(u={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},57790:(e,t,r)=>{r.d(t,{FZ:()=>M,Uf:()=>A,Bw:()=>f,LO:()=>S,Hx:()=>b});var i=r(67676),o=r(22021),n=r(17896),a=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return(0,o.t7)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const i=r.parameters;return u.scale=Math.min(i.divisor/(t-i.offset),1),u.factor=function(e){return Math.abs(e*e*e)}(e),u}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const u={scale:0,factor:0,minScaleFactor:0};var d=r(11726),h=r(35065);const m=(0,s.Ue)();function f(e,t,r,i,o,n){if(e.visible)if(e.boundingInfo){(0,d.hu)(e.type===l.U.Mesh);const a=t.tolerance;g(e.boundingInfo,r,i,a,o,n)}else{const t=e.attributes.get(h.T.POSITION),a=t.indices;_(r,i,0,a.length/3,a,t,void 0,o,n)}}const p=(0,a.c)();function g(e,t,r,i,o,a){if(null==e)return;const l=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(m,e.bbMin),(0,s.Tn)(m,e.bbMax),null!=o&&o.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,o){const n=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-i-t[1])*r[1],u=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,u)),l<0)return!1;if(s=Math.max(s,Math.min(c,u)),s>l)return!1;const d=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(d,h)),!(l<0)&&(s=Math.max(s,Math.min(d,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,l,i)){const{primitiveIndices:n,position:s}=e,l=n?n.length:s.indices.length/3;if(l>w){const n=e.getChildren();if(void 0!==n){for(const e of n)g(e,t,r,i,o,a);return}}_(t,r,0,l,s.indices,s,n,o,a)}}const v=(0,a.c)();function _(e,t,r,i,o,n,a,s,l){if(a)return function(e,t,r,i,o,n,a,s,l){const{data:c,stride:u}=n,d=e[0],h=e[1],m=e[2],f=t[0]-d,p=t[1]-h,g=t[2]-m;for(let e=r;e<i;++e){const t=a[e];let r=3*t,i=u*o[r++],n=c[i++],_=c[i++],T=c[i];i=u*o[r++];let x=c[i++],b=c[i++],A=c[i];i=u*o[r];let S=c[i++],R=c[i++],M=c[i];null!=s&&([n,_,T]=s.applyToVertex(n,_,T,e),[x,b,A]=s.applyToVertex(x,b,A,e),[S,R,M]=s.applyToVertex(S,R,M,e));const w=x-n,y=b-_,C=A-T,O=S-n,I=R-_,P=M-T,N=p*P-I*g,L=g*O-P*f,D=f*I-O*p,F=w*N+y*L+C*D;if(Math.abs(F)<=Number.EPSILON)continue;const H=d-n,B=h-_,G=m-T,U=H*N+B*L+G*D;if(F>0){if(U<0||U>F)continue}else if(U>0||U<F)continue;const z=B*C-y*G,V=G*w-C*H,W=H*y-w*B,j=f*z+p*V+g*W;if(F>0){if(j<0||U+j>F)continue}else if(j>0||U+j<F)continue;const q=(O*z+I*V+P*W)/F;q>=0&&l(q,E(w,y,C,O,I,P,v),t,!1)}}(e,t,r,i,o,n,a,s,l);const{data:c,stride:u}=n,d=e[0],h=e[1],m=e[2],f=t[0]-d,p=t[1]-h,g=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=u*o[t++],i=c[r++],n=c[r++],a=c[r];r=u*o[t++];let _=c[r++],T=c[r++],x=c[r];r=u*o[t++];let b=c[r++],A=c[r++],S=c[r];null!=s&&([i,n,a]=s.applyToVertex(i,n,a,e),[_,T,x]=s.applyToVertex(_,T,x,e),[b,A,S]=s.applyToVertex(b,A,S,e));const R=_-i,M=T-n,w=x-a,y=b-i,C=A-n,O=S-a,I=p*O-C*g,P=g*y-O*f,N=f*C-y*p,L=R*I+M*P+w*N;if(Math.abs(L)<=Number.EPSILON)continue;const D=d-i,F=h-n,H=m-a,B=D*I+F*P+H*N;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const G=F*w-M*H,U=H*R-w*D,z=D*M-R*F,V=f*G+p*U+g*z;if(L>0){if(V<0||B+V>L)continue}else if(V>0||B+V<L)continue;const W=(y*G+C*U+O*z)/L;W>=0&&l(W,E(R,M,w,y,C,O,v),e,!1)}}const T=(0,a.c)(),x=(0,a.c)();function E(e,t,r,i,o,a,s){return(0,n.s)(T,e,t,r),(0,n.s)(x,i,o,a),(0,n.b)(s,T,x),(0,n.n)(s,s),s}function b(e,t,r,i,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=c(a,i,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i?.forEach&&(i=R(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?null===e[o]?(e[o]=n.slice(),r=!0):(0,i.Vx)(e[o],n)&&(r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}function R(e){const t=[];return e.forEach((e=>t.push(e))),t}const M={multiply:1,ignore:2,replace:3,tint:4},w=1e3},64822:(e,t,r)=>{var i;r.d(t,{JY:()=>i}),function(e){e[e.Global=1]="Global",e[e.Local=2]="Local"}(i||(i={}))},95720:(e,t,r)=>{var i;r.d(t,{n:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))},4375:(e,t,r)=>{var i;r.d(t,{B:()=>i}),function(e){e[e.Texture=0]="Texture",e[e.RenderBuffer=1]="RenderBuffer"}(i||(i={}))},57088:(e,t,r)=>{r.d(t,{x:()=>d});var i=r(20102),o=(r(80442),r(22021)),n=r(49300),a=r(7575),s=r(35371),l=r(4375),c=r(47859);class u extends c.X{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case s.lP.R16F:case s.lP.R16I:case s.lP.R16UI:case s.lP.R32F:case s.lP.R32I:case s.lP.R32UI:case s.lP.R8_SNORM:case s.lP.R8:case s.lP.R8I:case s.lP.R8UI:this.pixelFormat=s.VI.RED}}static validate(e,t){return new u(e,t)}}let d=class{constructor(e,t=null,r=null){if(this.type=l.B.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=u.validate(e,t);if(!r)throw new i.Z("Texture descriptor invalid");this._descriptor=r}if(this._descriptor.context.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),v(this._descriptor.target)))throw new i.Z("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get gpuMemoryUsage(){return T.delete(this),(0,c.G)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(s._g.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.Z("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._descriptor.context?.gl)return;const r=this._descriptor.context.gl;(0,n.zu)(r),this._glName||(this._glName=r.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(s._g.Texture,this)),void 0===e&&(e=null);const o=this._descriptor,a=t??o.target,l=v(a);null===e&&(o.width=o.width||4,o.height=o.height||4,l&&(o.depth=o.depth??1));const c=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),h(this._descriptor.context,o),this._configurePixelStorage(),(0,n.zu)(r);const u=this._deriveInternalFormat();if(g(e)){let t="width"in e?e.width:e.codedWidth,i="height"in e?e.height:e.codedHeight;const s=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,i=e.videoHeight),o.width&&o.height,l&&o.depth,o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,u,o.hasMipmap,t,i,s),this._texImage(a,0,u,t,i,s,e),(0,n.zu)(r),o.hasMipmap&&this.generateMipmap(),o.width||(o.width=t),o.height||(o.height=i),l&&!o.depth&&(o.depth=s)}else{const{width:t,height:c,depth:d}=o;if(null==t||null==c)throw new i.Z("Width and height must be specified!");if(l&&null==d)throw new i.Z("Depth must be specified!");if(o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,u,o.hasMipmap,t,c,d),p(e)){const n=e.levels,l=_(a,t,c,d),h=Math.min(l-1,n.length-1);null!=this._descriptor.context.gl2?r.texParameteri(o.target,this._descriptor.context.gl2.TEXTURE_MAX_LEVEL,h):o.hasMipmap=o.hasMipmap&&l===n.length;const m=u;if(!(m in s.q_))throw new i.Z("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const o=n[Math.min(e,n.length-1)];this._compressedTexImage(a,e,m,t,r,i,o)}),h)}else this._texImage(a,0,u,t,c,d,e),(0,n.zu)(r),o.hasMipmap&&this.generateMipmap()}m(r,this._descriptor),f(r,this._descriptor),function(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}(this._descriptor.context,this._descriptor),(0,n.zu)(r),this._descriptor.context.bindTexture(c,d.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,o,n,a,s=0){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor.context.gl,c=this._descriptor.context.gl2,u=this._descriptor,h=this._deriveInternalFormat(),{pixelFormat:m,dataType:f,target:v,isImmutable:_}=u;if(_&&!this._wasImmutablyAllocated)throw new i.Z("Cannot update immutable texture before allocation!");const T=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||o>u.width||n>u.height||t+o>u.width||r+n>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),s){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,s)}if(g(a)?c?c.texSubImage2D(v,e,t,r,o,n,m,f,a):l.texSubImage2D(v,e,t,r,m,f,a):p(a)?l.compressedTexSubImage2D(v,e,t,r,o,n,h,a.levels[e]):l.texSubImage2D(v,e,t,r,o,n,m,f,a),s){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,0)}this._descriptor.context.bindTexture(T,d.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor.context.gl2;if(null==c)throw new i.Z("3D textures are not supported in WebGL1");const u=this._descriptor,h=this._deriveInternalFormat(),{pixelFormat:m,dataType:f,isImmutable:g,target:_}=u;if(g&&!this._wasImmutablyAllocated)throw new i.Z("Cannot update immutable texture before allocation!");v(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);if(this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||n>u.width||a>u.height||s>u.depth||t+n>u.width||r+a>u.height||o+s>u.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),p(l))l=l.levels[e],c.compressedTexSubImage3D(_,e,t,r,o,n,a,s,h,l);else{const i=l;c.texSubImage3D(_,e,t,r,o,n,a,s,m,f,i)}this._descriptor.context.bindTexture(T,d.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.Z("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,h(this._descriptor.context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,d.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,h(this._descriptor.context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor.context.gl,t=this._descriptor;this._samplingModeDirty&&(m(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(f(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.context.type===a.zO.WEBGL1)return this._descriptor.internalFormat=this._descriptor.pixelFormat;if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===s.VI.DEPTH_STENCIL&&(this._descriptor.internalFormat=s.VI.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case s.Br.FLOAT:switch(this._descriptor.pixelFormat){case s.VI.RGBA:return this._descriptor.internalFormat=s.lP.RGBA32F;case s.VI.RGB:return this._descriptor.internalFormat=s.lP.RGB32F;default:throw new i.Z("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case s.VI.RGBA:return this._descriptor.internalFormat=s.lP.RGBA8;case s.VI.RGB:return this._descriptor.internalFormat=s.lP.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===s.VI.DEPTH_STENCIL?s.VI.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,o,n,a){const l=this._descriptor.context.gl2;if(null==l)throw new i.Z("Immutable textures are not supported in WebGL1");if(!(t in s.lP))throw new i.Z("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?_(e,o,n,a):1;if(v(e)){if(null==a)throw new i.Z("Missing depth dimension for 3D texture upload");l.texStorage3D(e,c,t,o,n,a)}else l.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,s,l){const c=this._descriptor.context.gl,u=v(e),{isImmutable:d,pixelFormat:h,dataType:m}=this._descriptor,f=this._descriptor.context.type===a.zO.WEBGL2,p=f?c:null;if(f||!g(l))if(d){if(null!=l){const r=l;if(u){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");p.texSubImage3D(e,t,0,0,0,o,n,s,h,m,r)}else c.texSubImage2D(e,t,0,0,o,n,h,m,r)}}else{const a=l;if(u){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");p.texImage3D(e,t,r,o,n,s,0,h,m,a)}else c.texImage2D(e,t,r,o,n,0,h,m,a)}else c.texImage2D(e,0,r,h,m,l)}_compressedTexImage(e,t,r,o,n,s,l){const c=this._descriptor.context.gl;let u=null;const d=v(e),h=this._descriptor.isImmutable;if(d){if(this._descriptor.context.type!==a.zO.WEBGL2)throw new i.Z("3D textures are not supported in WebGL1");u=c}if(h){if(null!=l)if(d){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");u.compressedTexSubImage3D(e,t,0,0,0,o,n,s,r,l)}else c.compressedTexSubImage2D(e,t,0,0,o,n,r,l)}else if(d){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");u.compressedTexImage3D(e,t,r,o,n,s,0,l)}else c.compressedTexImage2D(e,t,r,o,n,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:l}=this._descriptor;const c=l===s.No.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.Z("Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}};function h(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===a.zO.WEBGL2;r||!t.isImmutable&&!v(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||null!=t.width&&(0,o.wt)(t.width)&&null!=t.height&&(0,o.wt)(t.height)||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}function m(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}function f(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}function p(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!p(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function v(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function _(e,t,r,i=1){let o=Math.max(t,r);return e===s.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}d.TEXTURE_UNIT_FOR_UPDATES=0;const T=new Map},47859:(e,t,r)=>{r.d(t,{G:()=>a,X:()=>n});var i=r(35371),o=r(45762);class n{constructor(e=0,t=e){this.width=e,this.height=t,this.target=i.No.TEXTURE_2D,this.pixelFormat=i.VI.RGBA,this.dataType=i.Br.UNSIGNED_BYTE,this.samplingMode=i.cw.LINEAR,this.wrapMode=i.e8.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function a(e){return e.width<=0||e.height<=0?0:e.width*e.height*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,o.RG)(e.internalFormat))}},45762:(e,t,r)=>{r.d(t,{RG:()=>o}),r(80442);var i=r(35371);function o(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.DEPTH24_STENCIL8:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const n=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return a}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n.error(new i.Z("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}},7575:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>n,zO:()=>i});var i,o=r(80442);function n(e,t,r={}){const o=t===i.WEBGL1?"webgl":"webgl2";return e.getContext(o,r)||null}function a(e){if("3d"===e)return[i.WEBGL2];const t=(0,o.Z)("esri-force-webgl");return t===i.WEBGL1||t===i.WEBGL2?[t]:(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1]}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],t[i]=n[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],n[1]=e[i]-n[0],t[i]=n[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const n=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>d,LZ:()=>u,if:()=>n,sm:()=>E,wK:()=>a,zp:()=>c});var i=r(47026),o=r(35371);function n(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.db.ADD,a=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,u={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function h(e){return S.intern(e)}function m(e){return M.intern(e)}function f(e){return y.intern(e)}function p(e){return O.intern(e)}function g(e){return P.intern(e)}function v(e){return L.intern(e)}function _(e){return F.intern(e)}function T(e){return B.intern(e)}function x(e){return U.intern(e)}function E(e){return V.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function A(e){return"["+e.join(",")+"]"}const S=new b(R,(e=>({__tag:"Blending",...e})));function R(e){return e?A([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const M=new b(w,(e=>({__tag:"Culling",...e})));function w(e){return e?A([e.face,e.mode]):null}const y=new b(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?A([e.factor,e.units]):null}const O=new b(I,(e=>({__tag:"DepthTest",...e})));function I(e){return e?A([e.func]):null}const P=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?A([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const L=new b(D,(e=>({__tag:"DepthWrite",...e})));function D(e){return e?A([e.zNear,e.zFar]):null}const F=new b(H,(e=>({__tag:"ColorWrite",...e})));function H(e){return e?A([e.r,e.g,e.b,e.a]):null}const B=new b(G,(e=>({__tag:"StencilWrite",...e})));function G(e){return e?A([e.mask]):null}const U=new b(z,(e=>({__tag:"DrawBuffers",...e})));function z(e){return e?A(e.buffers):null}const V=new b((function(e){return e?A([R(e.blending),w(e.culling),C(e.polygonOffset),I(e.depthTest),N(e.stencilTest),D(e.depthWrite),H(e.colorWrite),G(e.stencilWrite),z(e.drawBuffers)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:T(e.stencilWrite),drawBuffers:x(e.drawBuffers)})))}}]);
1098
+ }`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>m,Sv:()=>f,_8:()=>v});var i=r(52138),o=r(13598),n=r(17896),a=r(65617),s=r(70582),l=r(172),c=(r(21437),r(79884)),u=r(67498);class d extends c.x{constructor(e,t){super(e,"mat4",u.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,n.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new d("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin)));const r=e=>(0,n.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t))))}const p=(0,o.a)(),g=(0,a.c)();function v(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>c});var i=r(20102),o=r(92604),n=r(67498),a=r(11726);const s=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class l{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){s.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class c extends l{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new f,this.extensions=new p,this.constants=new v,this.outputs=new g}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s="vertex"===e?T:_,l=this.constants.generateSource().concat(o.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${c.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,t,o,n)}}}class u{constructor(){this._entries=new Map}add(...e){for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else s.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class h extends l{constructor(){super(...arguments),this.uniforms=new u,this.code=new d,this.constants=new v}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}p.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],p.ALLOWLIST_VERTEX=[];class g{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?(0,a.hu)(i.name===e&&i.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:g.DEFAULT_NAME,type:g.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}g.DEFAULT_TYPE="vec4",g.DEFAULT_NAME="fragColor";class v{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>v._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",T="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},o)switch(r){case i.P.Pass:this.bind[i.P.Pass]=o;break;case i.P.Draw:this.bind[i.P.Draw]=o}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var n;(n=o||(o={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(70586),o=r(35371);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipeline(e,t,r){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>n});var i=r(74709);class o extends i.K{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function n(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits??[0];let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<n)-1<<l;a[s]+=n,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},51417:(e,t,r)=>{r.d(t,{U:()=>i,a:()=>o});class i{constructor(e,t,r=t){this.data=e,this.size=t,this.stride=r}}class o extends i{constructor(e,t,r,i=!1,o=r){super(e,r,o),this.indices=t,this.exclusive=i}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.NORMALCOMPRESSED,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEOBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEMODEL,8],[i.T.INSTANCEMODELNORMAL,12],[i.T.INSTANCEMODELORIGINHI,11],[i.T.INSTANCEMODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),n=r(74709),a=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRepository,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},22631:(e,t,r)=>{r.d(t,{Z:()=>y});var i=r(13598),o=r(17896),n=r(24882),a=r(1533);function s(e){if(e.length<a.c8)return Array.from(e);if((0,a.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,a.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var l=r(47026),c=r(44553),u=r(65617),d=r(11726);class h{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,d.hu)(e.length>=1),(0,d.hu)(3===r.size||4===r.size);const{data:i,size:n,indices:a}=r;(0,d.hu)(a.length%this._numIndexPerPrimitive==0),(0,d.hu)(a.length>=e.length*this._numIndexPerPrimitive);const s=e.length;let l=n*a[this._numIndexPerPrimitive*e[0]];m.clear(),m.push(l);const c=(0,u.f)(i[l],i[l+1],i[l+2]),h=(0,u.g)(c);for(let t=0;t<s;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){l=n*a[r+e],m.push(l);let t=i[l];c[0]=Math.min(t,c[0]),h[0]=Math.max(t,h[0]),t=i[l+1],c[1]=Math.min(t,c[1]),h[1]=Math.max(t,h[1]),t=i[l+2],c[2]=Math.min(t,c[2]),h[2]=Math.max(t,h[2])}}this.bbMin=c,this.bbMax=h;const f=(0,o.p)((0,u.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(h[0]-c[0],h[1]-c[1]),h[2]-c[2]);let p=this.radius*this.radius;for(let e=0;e<m.length;++e){l=m.at(e);const t=i[l]-f[0],r=i[l+1]-f[1],o=i[l+2]-f[2],n=t*t+r*r+o*o;if(n<=p)continue;const a=Math.sqrt(n),s=.5*(a-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const c=s/a;f[0]+=t*c,f[1]+=r*c,f[2]+=o*c}this.center=f,m.clear()}getChildren(){if(this._children||(0,o.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.p)((0,u.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:a,indices:s}=this.position;for(let o=0;o<t;++o){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[o];let c=a*s[l],u=n[c],d=n[c+1],h=n[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=a*s[l+e];const t=n[c],r=n[c+1],i=n[c+2];t<u&&(u=t),r<d&&(d=r),i<h&&(h=i)}u<e[0]&&(t|=1),d<e[1]&&(t|=2),h<e[2]&&(t|=4),r[o]=t,++i[t]}let l=0;for(let e=0;e<8;++e)i[e]>0&&++l;if(l<2)return;const c=new Array(8);for(let e=0;e<8;++e)c[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];c[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==c[e]&&this._children.push(new h(c[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){m.prune()}}const m=new c.Z({deallocator:null});var f=r(17662),p=r(4726),g=r(22807),v=r(16996);function _(e,t,r){return(0,o.f)(T,t,e),(0,o.f)(x,r,e),(0,o.l)((0,o.b)(T,T,x))/2}r(12981),new g.x(v.Ue),new g.x((()=>{return e?{p0:(0,u.g)(e.p0),p1:(0,u.g)(e.p1),p2:(0,u.g)(e.p2)}:{p0:(0,u.c)(),p1:(0,u.c)(),p2:(0,u.c)()};var e}));const T=(0,u.c)(),x=(0,u.c)(),E=(0,u.c)(),b=(0,u.c)(),A=(0,u.c)(),S=(0,u.c)();var R=r(99001);class w{constructor(e){this.channel=e,this.id=(0,R.D)()}}var M=r(35065);r(9820),(0,u.c)(),new Float32Array(6);class y extends f.c{constructor(e,t,r=null,i=p.U.Mesh,o=null,a=-1){super(),this.material=e,this.mapPositions=r,this.type=i,this.objectAndLayerIdColor=o,this.edgeIndicesLength=a,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,n.mi)(r.indices)}),e===M.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new y(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:s(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){const e=this._attributes.values().next().value.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===p.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===p.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.e)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.s)(t,0,0,0),(0,o.s)(S,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,u=n[e+2]*r;(0,o.s)(E,i[l],i[l+1],i[l+2]),(0,o.s)(b,i[c],i[c+1],i[c+2]),(0,o.s)(A,i[u],i[u+1],i[u+2]);const d=_(E,b,A);d?((0,o.g)(E,E,b),(0,o.g)(E,E,A),(0,o.i)(E,E,1/3*d),(0,o.g)(t,t,E),a+=d):((0,o.g)(S,S,E),(0,o.g)(S,S,b),(0,o.g)(S,S,A),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.i)(t,t,1/a),0):0===s||((0,o.i)(t,S,1/s),0)))}(this.attributes.get(M.T.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(M.T.POSITION);return function(e,t,r){if(!e)return!1;(0,o.s)(r,0,0,0),(0,o.s)(S,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,u=c+(t?2:0);for(let e=0;e<u;e+=2){const t=e<c?e+1:0,u=l[e<c?e:c]*a,d=l[t]*a;E[0]=s[u],E[1]=s[u+1],E[2]=s[u+2],b[0]=s[d],b[1]=s[d+1],b[2]=s[d+2],(0,o.i)(E,(0,o.g)(E,E,b),.5);const h=(0,o.r)(E,b);h>0?((0,o.g)(r,r,(0,o.i)(E,E,h)),i+=h):0===i&&((0,o.g)(S,S,E),n++)}return 0!==i?((0,o.i)(r,r,1/i),!0):0!==n&&((0,o.i)(r,S,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.s)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.i)(t,t,1/s),s>0}(this.attributes.get(M.T.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(M.T.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===p.U.Mesh?3:1;(0,d.hu)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,n.KF)(e.indices.length/t);return new h(r,t,e)}get transformation(){return this._transformation??i.I}set transformation(e){this._transformation=e&&e!==i.I?(0,i.b)(e):null}addHighlight(){const e=new w(l.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,n=r(65617),a=(r(74709),r(47026)),s=r(17662),l=r(4726),c=r(83475),u=r(57790);class d extends s.c{constructor(e,t){super(),this.type=l.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._vertexAttributeLocations=c.i,this._pp0=(0,n.f)(0,0,1),this._pp1=(0,n.f)(0,0,0),this._parameters=(0,u.Uf)(e,t),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bindParameters.decorations===a.Iq.ON)&&0!=(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){this.repository?.materialChanged(this)}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>n});var i=r(44553),o=r(49300);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,o.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t?.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),null!=this._fragmentUniforms&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},97995:(e,t,r)=>{var i;r.d(t,{r:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",e[e.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",e[e.ANTIALIASING=10]="ANTIALIASING",e[e.COMPOSITE=11]="COMPOSITE",e[e.BLIT=12]="BLIT",e[e.SSAO=13]="SSAO",e[e.HIGHLIGHT=14]="HIGHLIGHT",e[e.SHADOW_HIGHLIGHT=15]="SHADOW_HIGHLIGHT",e[e.ENVIRONMENT_OPAQUE=16]="ENVIRONMENT_OPAQUE",e[e.ENVIRONMENT_TRANSPARENT=17]="ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=18]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=19]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=20]="HUD_MATERIAL",e[e.LABEL_MATERIAL=21]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=22]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=23]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=24]="DRAPED_MATERIAL",e[e.DRAPED_WATER=25]="DRAPED_WATER",e[e.VOXEL=26]="VOXEL",e[e.MAX_SLOTS=27]="MAX_SLOTS"}(i||(i={}))},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},47026:(e,t,r)=>{var i,o,n,a,s,l,c,u,d;r.d(t,{Gv:()=>o,Iq:()=>u,JJ:()=>c,Rw:()=>a,Ti:()=>d,V_:()=>l,Vr:()=>i,hU:()=>s}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(u||(u={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},57790:(e,t,r)=>{r.d(t,{FZ:()=>w,Uf:()=>A,Bw:()=>f,LO:()=>S,Hx:()=>b});var i=r(67676),o=r(22021),n=r(17896),a=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return(0,o.t7)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const i=r.parameters;return u.scale=Math.min(i.divisor/(t-i.offset),1),u.factor=function(e){return Math.abs(e*e*e)}(e),u}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const u={scale:0,factor:0,minScaleFactor:0};var d=r(11726),h=r(35065);const m=(0,s.Ue)();function f(e,t,r,i,o,n){if(e.visible)if(e.boundingInfo){(0,d.hu)(e.type===l.U.Mesh);const a=t.tolerance;g(e.boundingInfo,r,i,a,o,n)}else{const t=e.attributes.get(h.T.POSITION),a=t.indices;_(r,i,0,a.length/3,a,t,void 0,o,n)}}const p=(0,a.c)();function g(e,t,r,i,o,a){if(null==e)return;const l=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(m,e.bbMin),(0,s.Tn)(m,e.bbMax),null!=o&&o.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,o){const n=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-i-t[1])*r[1],u=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,u)),l<0)return!1;if(s=Math.max(s,Math.min(c,u)),s>l)return!1;const d=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(d,h)),!(l<0)&&(s=Math.max(s,Math.min(d,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,l,i)){const{primitiveIndices:n,position:s}=e,l=n?n.length:s.indices.length/3;if(l>M){const n=e.getChildren();if(void 0!==n){for(const e of n)g(e,t,r,i,o,a);return}}_(t,r,0,l,s.indices,s,n,o,a)}}const v=(0,a.c)();function _(e,t,r,i,o,n,a,s,l){if(a)return function(e,t,r,i,o,n,a,s,l){const{data:c,stride:u}=n,d=e[0],h=e[1],m=e[2],f=t[0]-d,p=t[1]-h,g=t[2]-m;for(let e=r;e<i;++e){const t=a[e];let r=3*t,i=u*o[r++],n=c[i++],_=c[i++],T=c[i];i=u*o[r++];let x=c[i++],b=c[i++],A=c[i];i=u*o[r];let S=c[i++],R=c[i++],w=c[i];null!=s&&([n,_,T]=s.applyToVertex(n,_,T,e),[x,b,A]=s.applyToVertex(x,b,A,e),[S,R,w]=s.applyToVertex(S,R,w,e));const M=x-n,y=b-_,C=A-T,O=S-n,I=R-_,P=w-T,N=p*P-I*g,L=g*O-P*f,D=f*I-O*p,F=M*N+y*L+C*D;if(Math.abs(F)<=Number.EPSILON)continue;const H=d-n,B=h-_,G=m-T,U=H*N+B*L+G*D;if(F>0){if(U<0||U>F)continue}else if(U>0||U<F)continue;const z=B*C-y*G,V=G*M-C*H,W=H*y-M*B,j=f*z+p*V+g*W;if(F>0){if(j<0||U+j>F)continue}else if(j>0||U+j<F)continue;const q=(O*z+I*V+P*W)/F;q>=0&&l(q,E(M,y,C,O,I,P,v),t,!1)}}(e,t,r,i,o,n,a,s,l);const{data:c,stride:u}=n,d=e[0],h=e[1],m=e[2],f=t[0]-d,p=t[1]-h,g=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=u*o[t++],i=c[r++],n=c[r++],a=c[r];r=u*o[t++];let _=c[r++],T=c[r++],x=c[r];r=u*o[t++];let b=c[r++],A=c[r++],S=c[r];null!=s&&([i,n,a]=s.applyToVertex(i,n,a,e),[_,T,x]=s.applyToVertex(_,T,x,e),[b,A,S]=s.applyToVertex(b,A,S,e));const R=_-i,w=T-n,M=x-a,y=b-i,C=A-n,O=S-a,I=p*O-C*g,P=g*y-O*f,N=f*C-y*p,L=R*I+w*P+M*N;if(Math.abs(L)<=Number.EPSILON)continue;const D=d-i,F=h-n,H=m-a,B=D*I+F*P+H*N;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const G=F*M-w*H,U=H*R-M*D,z=D*w-R*F,V=f*G+p*U+g*z;if(L>0){if(V<0||B+V>L)continue}else if(V>0||B+V<L)continue;const W=(y*G+C*U+O*z)/L;W>=0&&l(W,E(R,w,M,y,C,O,v),e,!1)}}const T=(0,a.c)(),x=(0,a.c)();function E(e,t,r,i,o,a,s){return(0,n.s)(T,e,t,r),(0,n.s)(x,i,o,a),(0,n.b)(s,T,x),(0,n.n)(s,s),s}function b(e,t,r,i,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=c(a,i,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i?.forEach&&(i=R(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?null===e[o]?(e[o]=n.slice(),r=!0):(0,i.Vx)(e[o],n)&&(r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}function R(e){const t=[];return e.forEach((e=>t.push(e))),t}const w={multiply:1,ignore:2,replace:3,tint:4},M=1e3},64822:(e,t,r)=>{var i;r.d(t,{JY:()=>i}),function(e){e[e.Global=1]="Global",e[e.Local=2]="Local"}(i||(i={}))},95720:(e,t,r)=>{var i;r.d(t,{n:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))},4375:(e,t,r)=>{var i;r.d(t,{B:()=>i}),function(e){e[e.Texture=0]="Texture",e[e.RenderBuffer=1]="RenderBuffer"}(i||(i={}))},57088:(e,t,r)=>{r.d(t,{x:()=>d});var i=r(20102),o=(r(80442),r(22021)),n=r(49300),a=r(7575),s=r(35371),l=r(4375),c=r(47859);class u extends c.X{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case s.lP.R16F:case s.lP.R16I:case s.lP.R16UI:case s.lP.R32F:case s.lP.R32I:case s.lP.R32UI:case s.lP.R8_SNORM:case s.lP.R8:case s.lP.R8I:case s.lP.R8UI:this.pixelFormat=s.VI.RED}}static validate(e,t){return new u(e,t)}}let d=class{constructor(e,t=null,r=null){if(this.type=l.B.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=u.validate(e,t);if(!r)throw new i.Z("Texture descriptor invalid");this._descriptor=r}if(this._descriptor.context.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),v(this._descriptor.target)))throw new i.Z("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get gpuMemoryUsage(){return T.delete(this),(0,c.G)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(s._g.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.Z("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._descriptor.context?.gl)return;const r=this._descriptor.context.gl;(0,n.zu)(r),this._glName||(this._glName=r.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(s._g.Texture,this)),void 0===e&&(e=null);const o=this._descriptor,a=t??o.target,l=v(a);null===e&&(o.width=o.width||4,o.height=o.height||4,l&&(o.depth=o.depth??1));const c=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),h(this._descriptor.context,o),this._configurePixelStorage(),(0,n.zu)(r);const u=this._deriveInternalFormat();if(g(e)){let t="width"in e?e.width:e.codedWidth,i="height"in e?e.height:e.codedHeight;const s=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,i=e.videoHeight),o.width&&o.height,l&&o.depth,o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,u,o.hasMipmap,t,i,s),this._texImage(a,0,u,t,i,s,e),(0,n.zu)(r),o.hasMipmap&&this.generateMipmap(),o.width||(o.width=t),o.height||(o.height=i),l&&!o.depth&&(o.depth=s)}else{const{width:t,height:c,depth:d}=o;if(null==t||null==c)throw new i.Z("Width and height must be specified!");if(l&&null==d)throw new i.Z("Depth must be specified!");if(o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,u,o.hasMipmap,t,c,d),p(e)){const n=e.levels,l=_(a,t,c,d),h=Math.min(l-1,n.length-1);null!=this._descriptor.context.gl2?r.texParameteri(o.target,this._descriptor.context.gl2.TEXTURE_MAX_LEVEL,h):o.hasMipmap=o.hasMipmap&&l===n.length;const m=u;if(!(m in s.q_))throw new i.Z("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const o=n[Math.min(e,n.length-1)];this._compressedTexImage(a,e,m,t,r,i,o)}),h)}else this._texImage(a,0,u,t,c,d,e),(0,n.zu)(r),o.hasMipmap&&this.generateMipmap()}m(r,this._descriptor),f(r,this._descriptor),function(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}(this._descriptor.context,this._descriptor),(0,n.zu)(r),this._descriptor.context.bindTexture(c,d.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,o,n,a,s=0){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor.context.gl,c=this._descriptor.context.gl2,u=this._descriptor,h=this._deriveInternalFormat(),{pixelFormat:m,dataType:f,target:v,isImmutable:_}=u;if(_&&!this._wasImmutablyAllocated)throw new i.Z("Cannot update immutable texture before allocation!");const T=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||o>u.width||n>u.height||t+o>u.width||r+n>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),s){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,s)}if(g(a)?c?c.texSubImage2D(v,e,t,r,o,n,m,f,a):l.texSubImage2D(v,e,t,r,m,f,a):p(a)?l.compressedTexSubImage2D(v,e,t,r,o,n,h,a.levels[e]):l.texSubImage2D(v,e,t,r,o,n,m,f,a),s){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,0)}this._descriptor.context.bindTexture(T,d.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor.context.gl2;if(null==c)throw new i.Z("3D textures are not supported in WebGL1");const u=this._descriptor,h=this._deriveInternalFormat(),{pixelFormat:m,dataType:f,isImmutable:g,target:_}=u;if(g&&!this._wasImmutablyAllocated)throw new i.Z("Cannot update immutable texture before allocation!");v(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);if(this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||n>u.width||a>u.height||s>u.depth||t+n>u.width||r+a>u.height||o+s>u.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),p(l))l=l.levels[e],c.compressedTexSubImage3D(_,e,t,r,o,n,a,s,h,l);else{const i=l;c.texSubImage3D(_,e,t,r,o,n,a,s,m,f,i)}this._descriptor.context.bindTexture(T,d.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.Z("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,h(this._descriptor.context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,d.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,h(this._descriptor.context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor.context.gl,t=this._descriptor;this._samplingModeDirty&&(m(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(f(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.context.type===a.zO.WEBGL1)return this._descriptor.internalFormat=this._descriptor.pixelFormat;if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===s.VI.DEPTH_STENCIL&&(this._descriptor.internalFormat=s.VI.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case s.Br.FLOAT:switch(this._descriptor.pixelFormat){case s.VI.RGBA:return this._descriptor.internalFormat=s.lP.RGBA32F;case s.VI.RGB:return this._descriptor.internalFormat=s.lP.RGB32F;default:throw new i.Z("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case s.VI.RGBA:return this._descriptor.internalFormat=s.lP.RGBA8;case s.VI.RGB:return this._descriptor.internalFormat=s.lP.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===s.VI.DEPTH_STENCIL?s.VI.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,o,n,a){const l=this._descriptor.context.gl2;if(null==l)throw new i.Z("Immutable textures are not supported in WebGL1");if(!(t in s.lP))throw new i.Z("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?_(e,o,n,a):1;if(v(e)){if(null==a)throw new i.Z("Missing depth dimension for 3D texture upload");l.texStorage3D(e,c,t,o,n,a)}else l.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,s,l){const c=this._descriptor.context.gl,u=v(e),{isImmutable:d,pixelFormat:h,dataType:m}=this._descriptor,f=this._descriptor.context.type===a.zO.WEBGL2,p=f?c:null;if(f||!g(l))if(d){if(null!=l){const r=l;if(u){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");p.texSubImage3D(e,t,0,0,0,o,n,s,h,m,r)}else c.texSubImage2D(e,t,0,0,o,n,h,m,r)}}else{const a=l;if(u){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");p.texImage3D(e,t,r,o,n,s,0,h,m,a)}else c.texImage2D(e,t,r,o,n,0,h,m,a)}else c.texImage2D(e,0,r,h,m,l)}_compressedTexImage(e,t,r,o,n,s,l){const c=this._descriptor.context.gl;let u=null;const d=v(e),h=this._descriptor.isImmutable;if(d){if(this._descriptor.context.type!==a.zO.WEBGL2)throw new i.Z("3D textures are not supported in WebGL1");u=c}if(h){if(null!=l)if(d){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");u.compressedTexSubImage3D(e,t,0,0,0,o,n,s,r,l)}else c.compressedTexSubImage2D(e,t,0,0,o,n,r,l)}else if(d){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");u.compressedTexImage3D(e,t,r,o,n,s,0,l)}else c.compressedTexImage2D(e,t,r,o,n,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:l}=this._descriptor;const c=l===s.No.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.Z("Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}};function h(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===a.zO.WEBGL2;r||!t.isImmutable&&!v(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||null!=t.width&&(0,o.wt)(t.width)&&null!=t.height&&(0,o.wt)(t.height)||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}function m(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}function f(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}function p(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!p(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function v(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function _(e,t,r,i=1){let o=Math.max(t,r);return e===s.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}d.TEXTURE_UNIT_FOR_UPDATES=0;const T=new Map},47859:(e,t,r)=>{r.d(t,{G:()=>a,X:()=>n});var i=r(35371),o=r(45762);class n{constructor(e=0,t=e){this.width=e,this.height=t,this.target=i.No.TEXTURE_2D,this.pixelFormat=i.VI.RGBA,this.dataType=i.Br.UNSIGNED_BYTE,this.samplingMode=i.cw.LINEAR,this.wrapMode=i.e8.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function a(e){return e.width<=0||e.height<=0?0:e.width*e.height*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,o.RG)(e.internalFormat))}},45762:(e,t,r)=>{r.d(t,{RG:()=>o}),r(80442);var i=r(35371);function o(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.DEPTH24_STENCIL8:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const n=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return a}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n.error(new i.Z("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}},7575:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>n,zO:()=>i});var i,o=r(80442);function n(e,t,r={}){const o=t===i.WEBGL1?"webgl":"webgl2";return e.getContext(o,r)||null}function a(e){if("3d"===e)return[i.WEBGL2];const t=(0,o.Z)("esri-force-webgl");return t===i.WEBGL1||t===i.WEBGL2?[t]:(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1]}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],t[i]=n[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],n[1]=e[i]-n[0],t[i]=n[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const n=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>d,LZ:()=>u,if:()=>n,sm:()=>E,wK:()=>a,zp:()=>c});var i=r(47026),o=r(35371);function n(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.db.ADD,a=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,u={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function h(e){return S.intern(e)}function m(e){return w.intern(e)}function f(e){return y.intern(e)}function p(e){return O.intern(e)}function g(e){return P.intern(e)}function v(e){return L.intern(e)}function _(e){return F.intern(e)}function T(e){return B.intern(e)}function x(e){return U.intern(e)}function E(e){return V.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function A(e){return"["+e.join(",")+"]"}const S=new b(R,(e=>({__tag:"Blending",...e})));function R(e){return e?A([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const w=new b(M,(e=>({__tag:"Culling",...e})));function M(e){return e?A([e.face,e.mode]):null}const y=new b(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?A([e.factor,e.units]):null}const O=new b(I,(e=>({__tag:"DepthTest",...e})));function I(e){return e?A([e.func]):null}const P=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?A([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const L=new b(D,(e=>({__tag:"DepthWrite",...e})));function D(e){return e?A([e.zNear,e.zFar]):null}const F=new b(H,(e=>({__tag:"ColorWrite",...e})));function H(e){return e?A([e.r,e.g,e.b,e.a]):null}const B=new b(G,(e=>({__tag:"StencilWrite",...e})));function G(e){return e?A([e.mask]):null}const U=new b(z,(e=>({__tag:"DrawBuffers",...e})));function z(e){return e?A(e.buffers):null}const V=new b((function(e){return e?A([R(e.blending),M(e.culling),C(e.polygonOffset),I(e.depthTest),N(e.stencilTest),D(e.depthWrite),H(e.colorWrite),G(e.stencilWrite),z(e.drawBuffers)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:T(e.stencilWrite),drawBuffers:x(e.drawBuffers)})))}}]);