@arcgis/core 4.24.0-next.20220329 → 4.24.0-next.20220401

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 (456) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/WebMap.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/analysis/LineOfSightAnalysisObserver.js +1 -1
  5. package/analysis/LineOfSightAnalysisTarget.js +1 -1
  6. package/arcade/featureset/actions/Adapted.js +1 -1
  7. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  8. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  10. package/arcade/featureset/support/FeatureSet.js +1 -1
  11. package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
  12. package/arcade/featureset/support/shared.js +1 -1
  13. package/arcade/functions/convertdirection.js +1 -1
  14. package/arcade/lib/character.js +1 -1
  15. package/arcade/lib/scanner.js +1 -1
  16. package/arcade/lib/tokenizer.js +1 -1
  17. package/arcade/request.js +1 -1
  18. package/arcade/treeAnalysis.js +1 -1
  19. package/assets/esri/core/workers/RemoteClient.js +1 -1
  20. package/assets/esri/core/workers/chunks/0bfedb1dbdff8205e468.js +1 -0
  21. package/assets/esri/core/workers/chunks/{5e472c89a38d6a42b84d.js → 0e29250c24a3a7b1ce13.js} +1 -1
  22. package/assets/esri/core/workers/chunks/0eb9c9477d36cd212f8b.js +1 -0
  23. package/assets/esri/core/workers/chunks/10779a256841c37f2429.js +1 -0
  24. package/assets/esri/core/workers/chunks/10a119889d1ab13402a3.js +1 -0
  25. package/assets/esri/core/workers/chunks/125b14c2ccd96d7c20c2.js +1 -0
  26. package/assets/esri/core/workers/chunks/23ec33a30db201e8b2c3.js +1 -0
  27. package/assets/esri/core/workers/chunks/2530e8ccf6e12787ce76.js +1 -0
  28. package/assets/esri/core/workers/chunks/2d9e97ba5b50aec4dd01.js +1 -0
  29. package/assets/esri/core/workers/chunks/365dc146398420f13f82.js +1 -0
  30. package/assets/esri/core/workers/chunks/3ae2827e8d55d6713d20.js +1 -0
  31. package/assets/esri/core/workers/chunks/3e3eebaa0844742db2f2.js +1 -0
  32. package/assets/esri/core/workers/chunks/3fd5b2d6eccd9098d492.js +1 -0
  33. package/assets/esri/core/workers/chunks/404f1d7bce014c7e6965.js +1 -0
  34. package/assets/esri/core/workers/chunks/411b7777bb5e943c156f.js +1 -0
  35. package/assets/esri/core/workers/chunks/{12ca192a5233bb2875d0.js → 4312902ab6e42fbe119b.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{4ef07f50da39f8607c1c.js → 44e95e87bd9e820aeb53.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{4d4c5e535d8b9ceb865a.js → 4810edf605838d07e5c5.js} +1 -1
  38. package/assets/esri/core/workers/chunks/4bce446391176a9d4588.js +1 -0
  39. package/assets/esri/core/workers/chunks/52a0e387073ea264e194.js +1 -0
  40. package/assets/esri/core/workers/chunks/560234694f3e53802aff.js +1 -0
  41. package/assets/esri/core/workers/chunks/5633710daeb3bbb79bcf.js +1 -0
  42. package/assets/esri/core/workers/chunks/5682039666f874836451.js +1 -0
  43. package/assets/esri/core/workers/chunks/6f01905936396fe87865.js +1 -0
  44. package/assets/esri/core/workers/chunks/6f7917da7166e8c6854b.js +1 -0
  45. package/assets/esri/core/workers/chunks/7388824eac8da01ea03d.js +1 -0
  46. package/assets/esri/core/workers/chunks/7745efef7d5119d0b087.js +1 -0
  47. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +1 -0
  48. package/assets/esri/core/workers/chunks/{da64dedf9270b64f42b2.js → 79bdb26244ec7b4472fe.js} +1 -1
  49. package/assets/esri/core/workers/chunks/79ec28b3e3c57fe026aa.js +1 -0
  50. package/assets/esri/core/workers/chunks/81e9d860a044acec74ce.js +1 -0
  51. package/assets/esri/core/workers/chunks/831dc0187f71e658550c.js +1 -0
  52. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +1 -0
  53. package/assets/esri/core/workers/chunks/{fb7397da8d4ec2ae4587.js → 87458fbf395338511662.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{1a859be598ad96bb4719.js → 8771296b537f366596c4.js} +18 -18
  55. package/assets/esri/core/workers/chunks/8958cd555f4887526e8b.js +1 -0
  56. package/assets/esri/core/workers/chunks/{e57b71ba70f088a3a052.js → 90dcd86cdef90099abfa.js} +1 -1
  57. package/assets/esri/core/workers/chunks/93067e27eea5844edc6c.js +1 -0
  58. package/assets/esri/core/workers/chunks/{9fbee2d9bf50c4c148c6.js → 9a146c9e9b4bf7fba88f.js} +1 -1
  59. package/assets/esri/core/workers/chunks/9b9821772b6cbe189fe0.js +1 -0
  60. package/assets/esri/core/workers/chunks/{6c4ce530b493c6f7c430.js → 9df2f9f7c28b31866be8.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{d0620ce99b620621d8bc.js → a0552044e123a3c51ddf.js} +1 -1
  62. package/assets/esri/core/workers/chunks/acc1a4acd57f5657e782.js +1 -0
  63. package/assets/esri/core/workers/chunks/b055ae7c54796751b64c.js +1 -0
  64. package/assets/esri/core/workers/chunks/{acc2cfb116fee7f82ae9.js → b26bd8fde2fc65bb67fb.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{9b45b94c4dbdc8d2c5fd.js → b34ba22c7a5adce8a7a2.js} +1 -1
  66. package/assets/esri/core/workers/chunks/b75665d0bf417c6ef24a.js +1 -0
  67. package/assets/esri/core/workers/chunks/bd50ec30688463b821d1.js +1 -0
  68. package/assets/esri/core/workers/chunks/c28f7ae4756ad1ba94bd.js +1 -0
  69. package/assets/esri/core/workers/chunks/c4f713959d4115b87c6c.js +1 -0
  70. package/assets/esri/core/workers/chunks/c58aa209492bd94b7aad.js +1 -0
  71. package/assets/esri/core/workers/chunks/{9b117097b7be0efd21d4.js → c59b0b58e24e6a60cf3e.js} +1 -1
  72. package/assets/esri/core/workers/chunks/c7bd5a4d318299388645.js +1 -0
  73. package/assets/esri/core/workers/chunks/c7cee13a962396b23a5e.js +1 -0
  74. package/assets/esri/core/workers/chunks/{3bbff5ea1ea0e955c592.js → cd3679fa86129ebabfdf.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{1a36dc0daffd536ea44d.js → cee7ce362860717713bf.js} +1 -1
  76. package/assets/esri/core/workers/chunks/cf463d6309f14df2f2fa.js +1 -0
  77. package/assets/esri/core/workers/chunks/{224c0e64160bdc170051.js → d076627bb7dadea89e89.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{fff4200bc61b82dd6193.js → d1d1c45243af614f2e74.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{1e0498dc9836658d9aba.js → d5fd12ea541c1a6b7fce.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{10322d990cda5aedf2f0.js → d6e32ca237ad9309c76a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/e06ad3a3d71154fed654.js +1 -0
  82. package/assets/esri/core/workers/chunks/{7a77d4cd27c30f1a5cae.js → ee3387a43dfbb3df23e1.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{5d5fa2b1fc48a17eb9ab.js → f4fc165420d449e442b8.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{3d6d9906a534ddd8fa37.js → f5ee03f3fca7a75192de.js} +1 -1
  85. package/assets/esri/themes/base/widgets/_Daylight.scss +1 -1
  86. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +1 -1
  87. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  88. package/assets/esri/themes/base/widgets/_Widget.scss +12 -0
  89. package/assets/esri/themes/dark/main.css +1 -1
  90. package/assets/esri/themes/dark-blue/main.css +1 -1
  91. package/assets/esri/themes/dark-green/main.css +1 -1
  92. package/assets/esri/themes/dark-purple/main.css +1 -1
  93. package/assets/esri/themes/dark-red/main.css +1 -1
  94. package/assets/esri/themes/light/main.css +1 -1
  95. package/assets/esri/themes/light/view.css +1 -1
  96. package/assets/esri/themes/light-blue/main.css +1 -1
  97. package/assets/esri/themes/light-green/main.css +1 -1
  98. package/assets/esri/themes/light-purple/main.css +1 -1
  99. package/assets/esri/themes/light-red/main.css +1 -1
  100. package/chunks/ComponentShader.glsl.js +25 -25
  101. package/chunks/HighlightApply.glsl.js +36 -0
  102. package/chunks/HighlightBlur.glsl.js +26 -0
  103. package/chunks/HighlightDownsample.glsl.js +12 -0
  104. package/chunks/ImageMaterial.glsl.js +8 -8
  105. package/chunks/LineCallout.glsl.js +1 -1
  106. package/chunks/Pattern.glsl.js +2 -2
  107. package/chunks/SimpleAtmosphere.glsl.js +7 -7
  108. package/chunks/Stars.glsl.js +1 -1
  109. package/chunks/arcade.js +1 -1
  110. package/chunks/color.js +1 -1
  111. package/chunks/languageUtils.js +1 -1
  112. package/chunks/mat3.js +1 -1
  113. package/copyright.txt +2 -2
  114. package/core/AsyncUpdate.js +1 -1
  115. package/core/Evented.js +1 -1
  116. package/core/PooledArray.js +1 -1
  117. package/core/accessorSupport/diffUtils.js +1 -1
  118. package/core/accessorSupport/get.js +1 -1
  119. package/core/accessorSupport/read.js +1 -1
  120. package/core/accessorSupport/set.js +1 -1
  121. package/core/accessorSupport/tracking.js +1 -1
  122. package/core/accessorSupport/utils.js +1 -1
  123. package/core/arrayUtils.js +1 -1
  124. package/core/libs/gl-matrix-2/mat3.js +1 -1
  125. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  126. package/core/number.js +1 -1
  127. package/core/object.js +1 -1
  128. package/core/string.js +1 -1
  129. package/core/unitUtils.js +1 -1
  130. package/core/watchUtils.js +1 -1
  131. package/core/workers/RemoteClient.js +1 -1
  132. package/exports/csv.js +1 -1
  133. package/geometry/support/heightModelInfoUtils.js +1 -1
  134. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  135. package/geometry/support/normalizeUtils.js +1 -1
  136. package/identity/IdentityManagerBase.js +1 -1
  137. package/interfaces.d.ts +155 -20
  138. package/layers/ImageryLayer.js +1 -1
  139. package/layers/MapImageLayer.js +1 -1
  140. package/layers/RouteLayer.js +1 -1
  141. package/layers/SceneLayer.js +1 -1
  142. package/layers/SubtypeGroupLayer.js +1 -1
  143. package/layers/TileLayer.js +1 -1
  144. package/layers/VectorTileLayer.js +1 -1
  145. package/layers/WMSLayer.js +1 -1
  146. package/layers/WMTSLayer.js +1 -1
  147. package/layers/WebTileLayer.js +1 -1
  148. package/layers/graphics/data/AttributesBuilder.js +1 -1
  149. package/layers/graphics/data/QueryEngine.js +1 -1
  150. package/layers/graphics/editingSupport.js +1 -1
  151. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  152. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  153. package/layers/graphics/sources/support/inferenceUtils.js +1 -1
  154. package/layers/mixins/ArcGISCachedService.js +1 -1
  155. package/layers/mixins/ArcGISImageService.js +1 -1
  156. package/layers/ogc/ogcFeatureUtils.js +1 -1
  157. package/layers/support/ExportImageServiceParameters.js +1 -1
  158. package/layers/support/PixelBlock.js +1 -1
  159. package/layers/support/RasterJobHandler.js +1 -1
  160. package/layers/support/SpriteSource.js +1 -1
  161. package/layers/support/Sublayer.js +1 -1
  162. package/layers/support/TilemapCache.js +1 -1
  163. package/layers/support/WMTSSublayer.js +1 -1
  164. package/layers/support/arcgisLayerUrl.js +1 -1
  165. package/layers/support/fieldUtils.js +1 -1
  166. package/layers/support/kmlUtils.js +1 -1
  167. package/layers/support/layerUtils.js +1 -1
  168. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  169. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  170. package/layers/support/rasterDatasets/RasterFactory.js +1 -1
  171. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  172. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  173. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  174. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  175. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  176. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  177. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  178. package/layers/support/vectorTileLayerLoader.js +1 -1
  179. package/layers/support/wmsUtils.js +1 -1
  180. package/layers/support/wmtsUtils.js +1 -1
  181. package/libs/i3s/I3SModule.js +1 -1
  182. package/libs/vxl/VxlModule.js +1 -1
  183. package/package.json +1 -1
  184. package/portal/Portal.js +1 -1
  185. package/portal/PortalItem.js +1 -1
  186. package/portal/schemas/definitions.js +1 -1
  187. package/portal/support/layersLoader.js +1 -1
  188. package/portal/support/portalItemUtils.js +1 -1
  189. package/portal/support/portalLayers.js +1 -1
  190. package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
  191. package/renderers/support/DictionaryLoader.js +1 -1
  192. package/renderers/support/RasterSymbolizer.js +1 -1
  193. package/renderers/support/numberUtils.js +1 -1
  194. package/renderers/support/rasterRendererHelper.js +1 -1
  195. package/renderers/support/utils.js +1 -1
  196. package/request.js +1 -1
  197. package/rest/imageService.js +1 -1
  198. package/rest/operations/find.js +1 -1
  199. package/rest/query/operations/query.js +1 -1
  200. package/rest/query/operations/queryRelatedRecords.js +1 -1
  201. package/rest/query/operations/queryTopFeatures.js +1 -1
  202. package/rest/support/DirectionLine.js +1 -1
  203. package/rest/support/DirectionPoint.js +1 -1
  204. package/rest/support/PointBarrier.js +1 -1
  205. package/rest/support/PolygonBarrier.js +1 -1
  206. package/rest/support/PolylineBarrier.js +1 -1
  207. package/rest/support/RouteInfo.js +1 -1
  208. package/rest/support/Stop.js +1 -1
  209. package/smartMapping/labels/clusters.js +1 -1
  210. package/smartMapping/popup/dotDensity.js +1 -1
  211. package/smartMapping/popup/support/clusterUtils.js +1 -1
  212. package/smartMapping/popup/support/utils.js +1 -1
  213. package/smartMapping/raster/support/utils.js +1 -1
  214. package/smartMapping/renderers/color.js +1 -1
  215. package/smartMapping/renderers/location.js +1 -1
  216. package/smartMapping/renderers/predominance.js +1 -1
  217. package/smartMapping/renderers/relationship.js +1 -1
  218. package/smartMapping/renderers/size.js +1 -1
  219. package/smartMapping/renderers/support/utils.js +1 -1
  220. package/smartMapping/renderers/type.js +1 -1
  221. package/smartMapping/renderers/univariateColorSize.js +1 -1
  222. package/smartMapping/statistics/summaryStatisticsForAge.js +1 -1
  223. package/smartMapping/statistics/support/ageUtils.js +1 -1
  224. package/smartMapping/statistics/support/utils.js +1 -1
  225. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  226. package/smartMapping/support/adapters/support/utils.js +1 -1
  227. package/smartMapping/support/utils.js +1 -1
  228. package/smartMapping/symbology/support/Theme.js +1 -1
  229. package/smartMapping/symbology/support/colorRamps.js +1 -1
  230. package/smartMapping/symbology/support/symbologyUtils.js +1 -1
  231. package/smartMapping/symbology/support/utils.js +1 -1
  232. package/statistics/utils.js +1 -1
  233. package/support/basemapDefinitions.js +1 -1
  234. package/support/basemapUtils.js +1 -1
  235. package/support/elevationInfoUtils.js +1 -1
  236. package/support/popupUtils.js +1 -1
  237. package/support/revision.js +1 -1
  238. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  239. package/symbols/cim/cimAnalyzer.js +1 -1
  240. package/symbols/cim/utils.js +1 -1
  241. package/symbols/support/previewSymbol3D.js +1 -1
  242. package/symbols/support/renderUtils.js +1 -1
  243. package/symbols/support/symbolLayerUtils.js +1 -1
  244. package/views/2d/engine/Bitmap.js +1 -1
  245. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  246. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  247. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  248. package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
  249. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  250. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  251. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  252. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  253. package/views/2d/engine/webgl/Profiler.js +1 -1
  254. package/views/2d/engine/webgl/Utils.js +1 -1
  255. package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
  256. package/views/2d/engine/webgl/definitions.js +1 -1
  257. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  258. package/views/2d/engine/webgl/effects/HittestEffectVTL.js +1 -1
  259. package/views/2d/engine/webgl/mesh/templates/WGLTemplateStore.js +1 -1
  260. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  261. package/views/2d/engine/webgl/util/Lock.js +1 -1
  262. package/views/2d/layers/RouteLayerView2D.js +1 -1
  263. package/views/2d/layers/features/schemaUtils.js +1 -1
  264. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  265. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  266. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  267. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  268. package/views/2d/layers/support/webStyleUtils.js +1 -1
  269. package/views/2d/support/Timeline.js +1 -1
  270. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  271. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  272. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  273. package/views/3d/analysis/Slice/SliceController.js +1 -1
  274. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  275. package/views/3d/environment/SceneViewAtmosphere.js +1 -1
  276. package/views/3d/environment/StarsTechnique.js +1 -1
  277. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  278. package/views/3d/glTF/loader.js +1 -1
  279. package/views/3d/interactive/analysisTools/lineOfSight/LineOfSightTool.js +1 -1
  280. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  281. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  282. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  283. package/views/3d/layers/I3SMeshView3D.js +1 -1
  284. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  285. package/views/3d/layers/LayerView3D.js +1 -1
  286. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  287. package/views/3d/layers/RouteLayerView3D.js +1 -1
  288. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  289. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  290. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  291. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  292. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  293. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  294. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  295. package/views/3d/layers/i3s/IDBMockCache.js +5 -0
  296. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  297. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  298. package/views/3d/state/ViewStateManager.js +1 -1
  299. package/views/3d/state/controllers/RotateController.js +1 -1
  300. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  301. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  302. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  303. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  304. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  305. package/views/3d/support/HighlightOptions.js +1 -1
  306. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  307. package/views/3d/support/debugFlags.js +1 -1
  308. package/views/3d/support/orientedBoundingBox.js +1 -1
  309. package/views/3d/terrain/TerrainSurface.js +1 -1
  310. package/views/3d/webgl-engine/Stage.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  313. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -3
  314. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +5 -5
  315. package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
  316. package/views/3d/webgl-engine/lib/HighlightHelper.js +1 -1
  317. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  318. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  319. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  320. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderParameters.js +1 -1
  321. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  322. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  323. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  324. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  325. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  326. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  327. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +5 -0
  328. package/views/3d/webgl-engine/shaders/HighlightApplyTechnique.js +5 -0
  329. package/views/3d/webgl-engine/shaders/HighlightBlur.glsl.js +5 -0
  330. package/views/3d/webgl-engine/shaders/HighlightBlurTechnique.js +5 -0
  331. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +5 -0
  332. package/views/3d/webgl-engine/shaders/HighlightDownsampleTechnique.js +5 -0
  333. package/views/3d/webgl-engine/shaders/HighlightOptions.js +4 -0
  334. package/views/3d/webgl-engine/shaders/HighlightPassParameters.js +5 -0
  335. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  336. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  337. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  338. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  339. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +5 -7
  340. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +14 -14
  341. package/views/SceneView.js +1 -1
  342. package/views/draw/support/GraphicMover.js +1 -1
  343. package/views/input/InputHandler.js +1 -1
  344. package/views/input/InputManager.js +1 -1
  345. package/views/layers/ImageryTileLayerView.js +1 -1
  346. package/views/layers/MapImageLayerView.js +1 -1
  347. package/views/layers/TileLayerView.js +1 -1
  348. package/views/layers/support/popupUtils.js +1 -1
  349. package/views/support/DefaultsFromMap.js +1 -1
  350. package/views/support/Scheduler.js +1 -1
  351. package/views/support/screenshotUtils.js +1 -1
  352. package/views/ui/DefaultUI.js +1 -1
  353. package/views/webgl/ShaderTranspiler.js +1 -1
  354. package/webscene/Slide.js +1 -1
  355. package/webscene/spec-certification/spec.js +1 -1
  356. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  357. package/widgets/Attachments/support/attachmentUtils.js +1 -1
  358. package/widgets/Attachments.js +1 -1
  359. package/widgets/Attribution.js +1 -1
  360. package/widgets/BasemapLayerList.js +1 -1
  361. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  362. package/widgets/Bookmarks.js +1 -1
  363. package/widgets/BuildingExplorer/support/filterUtils.js +1 -1
  364. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  365. package/widgets/CoordinateConversion/support/coordinateConversionUtils.js +1 -1
  366. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  367. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  368. package/widgets/Directions/DirectionsViewModel.js +1 -1
  369. package/widgets/Directions.js +1 -1
  370. package/widgets/Editor/EditorViewModel.js +1 -1
  371. package/widgets/Editor/workflowUtils.js +1 -1
  372. package/widgets/Editor.js +1 -1
  373. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  374. package/widgets/Feature/FeatureMedia.js +1 -1
  375. package/widgets/Feature/support/featureUtils.js +1 -1
  376. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  377. package/widgets/FeatureForm/InputField.js +1 -1
  378. package/widgets/FeatureForm.js +1 -1
  379. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  380. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  381. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  382. package/widgets/FeatureTemplates.js +1 -1
  383. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  384. package/widgets/LayerList/ListItemPanel.js +1 -1
  385. package/widgets/LayerList.js +1 -1
  386. package/widgets/Legend/LegendViewModel.js +1 -1
  387. package/widgets/Legend/styles/Card.js +1 -1
  388. package/widgets/Legend/styles/Classic.js +1 -1
  389. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  390. package/widgets/Legend/support/colorRampUtils.js +1 -1
  391. package/widgets/Legend/support/relationshipRampUtils.js +1 -1
  392. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  393. package/widgets/Popup/PopupViewModel.js +1 -1
  394. package/widgets/Popup/actionUtils.js +1 -1
  395. package/widgets/Print/PrintViewModel.js +1 -1
  396. package/widgets/Print.js +1 -1
  397. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  398. package/widgets/Search/SearchViewModel.js +1 -1
  399. package/widgets/Search/support/layerSearchUtils.js +1 -1
  400. package/widgets/Slider.js +1 -1
  401. package/widgets/Swipe.js +1 -1
  402. package/widgets/TableList.js +1 -1
  403. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  404. package/widgets/TimeSlider.js +1 -1
  405. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  406. package/widgets/support/DatePicker.js +1 -1
  407. package/widgets/support/Popover.js +1 -1
  408. package/widgets/support/SnappingControls.js +1 -1
  409. package/widgets/support/TimePicker.js +1 -1
  410. package/widgets/support/timeWidgetUtils.js +1 -1
  411. package/assets/esri/core/workers/chunks/083a5d10f8e243641cb9.js +0 -1
  412. package/assets/esri/core/workers/chunks/0872812ce4d0ec8faf8f.js +0 -1
  413. package/assets/esri/core/workers/chunks/0bc26899780c33637746.js +0 -1
  414. package/assets/esri/core/workers/chunks/113362697da1b69deaed.js +0 -1
  415. package/assets/esri/core/workers/chunks/11a2f9708938eac98815.js +0 -1
  416. package/assets/esri/core/workers/chunks/11a45709b703be84caaf.js +0 -1
  417. package/assets/esri/core/workers/chunks/1c1294ff1ebbd8f774f7.js +0 -1
  418. package/assets/esri/core/workers/chunks/1c915cc9a9d5729b6f17.js +0 -1
  419. package/assets/esri/core/workers/chunks/31786756b3d44540f8c0.js +0 -1
  420. package/assets/esri/core/workers/chunks/36a6f34fe40785beff5d.js +0 -1
  421. package/assets/esri/core/workers/chunks/373c16f8b8093d001064.js +0 -1
  422. package/assets/esri/core/workers/chunks/382a331a592abb61267f.js +0 -1
  423. package/assets/esri/core/workers/chunks/3bf106fe34e3992032c4.js +0 -1
  424. package/assets/esri/core/workers/chunks/3dcec610f1c1497d87bc.js +0 -1
  425. package/assets/esri/core/workers/chunks/46495e726d8739260d44.js +0 -1
  426. package/assets/esri/core/workers/chunks/4a82a6a473b3d540d0be.js +0 -1
  427. package/assets/esri/core/workers/chunks/4b6719377a95ac10fa43.js +0 -1
  428. package/assets/esri/core/workers/chunks/4d2ef57ff3a5cfc1313f.js +0 -1
  429. package/assets/esri/core/workers/chunks/4fd2b8153d62592210a2.js +0 -1
  430. package/assets/esri/core/workers/chunks/56e6a1079269e2964b02.js +0 -1
  431. package/assets/esri/core/workers/chunks/5b4d9786c010d265346c.js +0 -1
  432. package/assets/esri/core/workers/chunks/604637e1c3937b376a0d.js +0 -1
  433. package/assets/esri/core/workers/chunks/60f83257e361f87fa6fd.js +0 -1
  434. package/assets/esri/core/workers/chunks/6d3f80be6fceb2c18b5d.js +0 -1
  435. package/assets/esri/core/workers/chunks/6f827a32646bab0a8777.js +0 -1
  436. package/assets/esri/core/workers/chunks/70bd2ab42e3801ef5974.js +0 -1
  437. package/assets/esri/core/workers/chunks/746222184b361b50d6ba.js +0 -1
  438. package/assets/esri/core/workers/chunks/7fb72b2d11e8d840f982.js +0 -1
  439. package/assets/esri/core/workers/chunks/85bb6a1a7704fcdcbec2.js +0 -1
  440. package/assets/esri/core/workers/chunks/8b4c76cebb100e6c06f8.js +0 -1
  441. package/assets/esri/core/workers/chunks/9586a6b320edb1922926.js +0 -1
  442. package/assets/esri/core/workers/chunks/99638697ffda9022ce92.js +0 -1
  443. package/assets/esri/core/workers/chunks/a9da1cb118ca62a9581d.js +0 -1
  444. package/assets/esri/core/workers/chunks/aaa41a5013eef713c032.js +0 -1
  445. package/assets/esri/core/workers/chunks/ac321f939dd488ff6ce4.js +0 -1
  446. package/assets/esri/core/workers/chunks/add6027a96398ecf69de.js +0 -1
  447. package/assets/esri/core/workers/chunks/b75206b46ba81606087c.js +0 -1
  448. package/assets/esri/core/workers/chunks/bf8456828e38a768eba3.js +0 -1
  449. package/assets/esri/core/workers/chunks/c0720d0d8adcba6738d4.js +0 -1
  450. package/assets/esri/core/workers/chunks/c5bb712d5cf8c05a4e13.js +0 -1
  451. package/assets/esri/core/workers/chunks/d343f05a3366f95e0494.js +0 -1
  452. package/assets/esri/core/workers/chunks/d8b1f00075983d769985.js +0 -1
  453. package/chunks/Highlight.glsl.js +0 -88
  454. package/views/3d/webgl-engine/shaders/Highlight.glsl.js +0 -5
  455. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +0 -5
  456. package/views/3d/webgl-engine/shaders/HighlightTechniqueConfiguration.js +0 -5
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1190],{32078:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(1391),n=r(62707),o=r(18361),a=r(51546),s=r(77171),l=r(47624),c=r(64267),u=r(37099),d=r(76056),h=r(135),f=r(11317),m=r(99917),p=r(92555),g=r(22019),v=r(15817),_=r(66242),T=r(86602),x=r(42001),b=r(19419),A=r(26322),E=r(85504),S=r(72303),M=r(71838),R=r(94124),C=r(93396),w=r(90692),y=r(10962),P=r(32558),O=r(18465),N=r(45436),I=r(74709),D=r(85594),L=r(33680),F=r(12139),H=r(47026),B=r(35065);function U(e){const t=new L.kG,r=t.vertex.code,U=t.fragment.code;t.include(C.a,{name:"Default Material Shader",output:e.output});const z=(0,y.S)(t,e),G=e.hasModelTransformation;return G&&t.vertex.uniforms.add(new D.B("model")),t.include(u.f),t.varyings.add("vpos","vec3"),t.include(M.kl,e),t.include(l.f,e),t.include(p.LC,e),e.output!==o.H.Color&&e.output!==o.H.Alpha||((0,y.h)(t.vertex.uniforms,e),t.include(c.O,e),t.include(s.w,{linearDepth:!1,hasModelTransformation:G}),e.normalType===c.h.Attribute&&e.offsetBackfaces&&t.include(n.w),t.include(v.Q,e),t.include(m.Bb,e),e.instancedColor&&t.attributes.add(B.T.INSTANCECOLOR,"vec4"),t.varyings.add("localvpos","vec3"),t.include(h.D,e),t.include(i.q,e),t.include(d.R,e),t.include(f.c,e),t.vertex.uniforms.add(new O.y("externalColor")),t.varyings.add("vcolorExt","vec4"),e.hasMultipassTerrain&&t.varyings.add("depth","float"),r.add(I.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1190],{32078:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(1391),n=r(62707),o=r(18361),a=r(51546),s=r(77171),l=r(47624),c=r(64267),u=r(37099),d=r(76056),h=r(135),f=r(11317),m=r(15719),p=r(92555),g=r(22019),v=r(15817),_=r(66242),T=r(86602),x=r(42001),b=r(19419),A=r(26322),E=r(85504),S=r(72303),M=r(71838),R=r(94124),C=r(93396),w=r(90692),y=r(10962),P=r(32558),O=r(18465),N=r(45436),I=r(74709),D=r(85594),L=r(33680),F=r(12139),H=r(47026),B=r(35065);function U(e){const t=new L.kG,r=t.vertex.code,U=t.fragment.code;t.include(C.a,{name:"Default Material Shader",output:e.output});const z=(0,y.S)(t,e),G=e.hasModelTransformation;return G&&t.vertex.uniforms.add(new D.B("model")),t.include(u.f),t.varyings.add("vpos","vec3"),t.include(M.kl,e),t.include(l.f,e),t.include(p.LC,e),e.output!==o.H.Color&&e.output!==o.H.Alpha||((0,y.h)(t.vertex.uniforms,e),t.include(c.O,e),t.include(s.w,{linearDepth:!1,hasModelTransformation:G}),e.normalType===c.h.Attribute&&e.offsetBackfaces&&t.include(n.w),t.include(v.Q,e),t.include(m.Bb,e),e.instancedColor&&t.attributes.add(B.T.INSTANCECOLOR,"vec4"),t.varyings.add("localvpos","vec3"),t.include(h.D,e),t.include(i.q,e),t.include(d.R,e),t.include(f.c,e),t.vertex.uniforms.add(new O.y("externalColor")),t.varyings.add("vcolorExt","vec4"),e.hasMultipassTerrain&&t.varyings.add("depth","float"),r.add(I.H`
2
2
  void main(void) {
3
3
  forwardNormalizedVertexColor();
4
4
  vcolorExt = externalColor;
@@ -156,9 +156,9 @@
156
156
  gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
157
157
  ${e.transparencyPassType===I.Am.Color?"gl_FragColor = premultiplyAlpha(gl_FragColor);":""}
158
158
  }
159
- `)),t.include(p.s,e),t}const F=Object.freeze(Object.defineProperty({__proto__:null,build:L},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>n,i:()=>c,t:()=>o});var i=r(46851);function n(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 o(e,t){if(e===t){const r=t[1],i=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1],m=r[2],p=r[3],g=r[4],v=r[5],_=r[6],T=r[7],x=r[8];return e[0]=h*i+f*a+m*c,e[1]=h*n+f*s+m*u,e[2]=h*o+f*l+m*d,e[3]=p*i+g*a+v*c,e[4]=p*n+g*s+v*u,e[5]=p*o+g*l+v*d,e[6]=_*i+T*a+x*c,e[7]=_*n+T*s+x*u,e[8]=_*o+T*l+x*d,e}function s(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],f=t[11],m=t[12],p=t[13],g=t[14],v=t[15],_=r*s-i*a,T=r*l-n*a,x=r*c-o*a,b=i*l-n*s,A=i*c-o*s,E=n*c-o*l,S=u*p-d*m,M=u*g-h*m,R=u*v-f*m,C=d*g-h*p,w=d*v-f*p,y=h*v-f*g;let P=_*y-T*w+x*C+b*R-A*M+E*S;return P?(P=1/P,e[0]=(s*y-l*w+c*C)*P,e[1]=(l*R-a*y-c*M)*P,e[2]=(a*w-s*R+c*S)*P,e[3]=(n*w-i*y-o*C)*P,e[4]=(r*y-n*R+o*M)*P,e[5]=(i*R-r*w-o*S)*P,e[6]=(p*E-g*A+v*b)*P,e[7]=(g*x-m*E-v*T)*P,e[8]=(m*A-p*x+v*_)*P,e):null}function l(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function c(e){const t=i.E,r=e[0],n=e[1],o=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-(n*n+s*s+u*u))<=t&&Math.abs(1-(o*o+l*l+d*d))<=t}const u=a,d=l;Object.freeze(Object.defineProperty({__proto__:null,fromMat4:n,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},set:function(e,t,r,i,n,o,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:o,invert:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l;let m=r*d+i*h+n*f;return m?(m=1/m,e[0]=d*m,e[1]=(-u*i+n*c)*m,e[2]=(s*i-n*a)*m,e[3]=h*m,e[4]=(u*r-n*l)*m,e[5]=(-s*r+n*o)*m,e[6]=f*m,e[7]=(-c*r+i*l)*m,e[8]=(a*r-i*o)*m,e):null},adjoint:function(e,t){const r=t[0],i=t[1],n=t[2],o=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]=n*c-i*u,e[2]=i*s-n*a,e[3]=s*l-o*u,e[4]=r*u-n*l,e[5]=n*o-r*s,e[6]=o*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*o,e},determinant:function(e){const t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*o-a*l)+r*(-c*n+a*s)+i*(l*n-o*s)},multiply:a,translate:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+f*a+c,e[7]=h*n+f*s+u,e[8]=h*o+f*l+d,e},rotate:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(r),f=Math.cos(r);return e[0]=f*i+h*a,e[1]=f*n+h*s,e[2]=f*o+h*l,e[3]=f*a-h*i,e[4]=f*s-h*n,e[5]=f*l-h*o,e[6]=c,e[7]=u,e[8]=d,e},scale:function(e,t,r){const i=r[0],n=r[1],o=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=o*t[6],e[7]=o*t[7],e[8]=o*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromQuat:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=r+r,s=i+i,l=n+n,c=r*a,u=i*a,d=i*s,h=n*a,f=n*s,m=n*l,p=o*a,g=o*s,v=o*l;return e[0]=1-d-m,e[3]=u-v,e[6]=h+g,e[1]=u+v,e[4]=1-c-m,e[7]=f-p,e[2]=h-g,e[5]=f+p,e[8]=1-c-d,e},normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l,m=r*d+i*h+n*f;if(!m)return null;const p=1/m;return e[0]=d*p,e[1]=(-u*i+n*c)*p,e[2]=(s*i-n*a)*p,e[3]=h*p,e[4]=(u*r-n*l)*p,e[5]=(-s*r+n*o)*p,e[6]=f*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*o)*p,e},normalFromMat4:s,projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},subtract:l,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},equals:function(e,t){const r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=t[0],f=t[1],m=t[2],p=t[3],g=t[4],v=t[5],_=t[6],T=t[7],x=t[8];return Math.abs(r-h)<=i.E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-f)<=i.E*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-m)<=i.E*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-p)<=i.E*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-g)<=i.E*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=i.E*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(c-_)<=i.E*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-T)<=i.E*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(d-x)<=i.E*Math.max(1,Math.abs(d),Math.abs(x))},isOrthoNormal:c,mul:u,sub:d},Symbol.toStringTag,{value:"Module"}))},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function n(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>n,c:()=>i}),Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},fromValues:function(e,t,r,i,n,o,a,s,l){return[e,t,r,i,n,o,a,s,l]},createView:n},Symbol.toStringTag,{value:"Module"}))},13598:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}function o(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>a,a:()=>o,b:()=>n,c:()=>i});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:n,fromValues:function(e,t,r,i,n,o,a,s,l,c,u,d,h,f,m,p){return[e,t,r,i,n,o,a,s,l,c,u,d,h,f,m,p]},createView:o,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{c:()=>f,g:()=>u,j:()=>w,k:()=>p,m:()=>d,s:()=>c});var i=r(46521),n=r(94961),o=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>a.E?(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],n=t[1],o=t[2],a=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+a*s+n*c-o*l,e[1]=n*u+a*l+o*s-i*c,e[2]=o*u+a*c+i*l-n*s,e[3]=a*u-i*s-n*l-o*c,e}function h(e,t,r,i){const n=t[0],o=t[1],s=t[2],l=t[3];let c,u,d,h,f,m=r[0],p=r[1],g=r[2],v=r[3];return u=n*m+o*p+s*g+l*v,u<0&&(u=-u,m=-m,p=-p,g=-g,v=-v),1-u>a.E?(c=Math.acos(u),d=Math.sin(c),h=Math.sin((1-i)*c)/d,f=Math.sin(i*c)/d):(h=1-i,f=i),e[0]=h*n+f*m,e[1]=h*o+f*p,e[2]=h*s+f*g,e[3]=h*l+f*v,e}function f(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function m(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const n=(r+1)%3,o=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*n+n]-t[3*o+o]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*n+o]-t[3*o+n])*i,e[n]=(t[3*n+r]+t[3*r+n])*i,e[o]=(t[3*o+r]+t[3*r+o])*i}return e}function p(e,t,r,i){const n=.5*Math.PI/180;t*=n,r*=n,i*=n;const o=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]=o*l*u-a*s*c,e[1]=a*s*u+o*l*c,e[2]=a*l*c-o*s*u,e[3]=a*l*u+o*s*c,e}const g=l.c,v=l.s,_=l.a,T=d,x=l.b,b=l.d,A=l.l,E=l.e,S=E,M=l.f,R=M,C=l.n,w=l.g,y=l.h,P=(0,o.c)(),O=(0,o.f)(1,0,0),N=(0,o.f)(0,1,0),I=(0,n.a)(),D=(0,n.a)(),L=(0,i.c)();Object.freeze(Object.defineProperty({__proto__:null,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},setAxisAngle:c,getAxisAngle:u,multiply:d,rotateX:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=n*l+o*s,e[2]=o*l-n*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-o*s,e[1]=n*l+a*s,e[2]=o*l+i*s,e[3]=a*l-n*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*s,e[1]=n*l-i*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},calculateW:function(e,t){const r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e},slerp:h,random:function(e){const t=(0,a.R)(),r=(0,a.R)(),i=(0,a.R)(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*r),e[1]=n*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},invert:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=r*r+i*i+n*n+o*o,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-n*s,e[3]=o*s,e},conjugate:f,fromMat3:m,fromEuler:p,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},copy:g,set:v,add:_,mul:T,scale:x,dot:b,lerp:A,length:E,len:S,squaredLength:M,sqrLen:R,normalize:C,exactEquals:w,equals:y,rotationTo:function(e,t,r){const i=(0,s.e)(t,r);return i<-.999999?((0,s.f)(P,O,t),(0,s.u)(P)<1e-6&&(0,s.f)(P,N,t),(0,s.n)(P,P),c(e,P,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.f)(P,t,r),e[0]=P[0],e[1]=P[1],e[2]=P[2],e[3]=1+i,C(e,e))},sqlerp:function(e,t,r,i,n,o){return h(I,t,n,o),h(D,r,i,o),h(e,I,D,2*o*(1-o)),e},setAxes:function(e,t,r,i){const n=L;return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-t[0],n[5]=-t[1],n[8]=-t[2],C(e,m(e,n))}},Symbol.toStringTag,{value:"Module"}))},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3]]}function o(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>a,a:()=>i,b:()=>n,c:()=>o});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:n,fromValues:function(e,t,r,i){return[e,t,r,i]},createView:o,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>l,n:()=>s,s:()=>a,t:()=>n});var i=r(72220);function n(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.count,o=r[0],a=r[1],s=r[2],l=r[4],c=r[5],u=r[6],d=r[8],h=r[9],f=r[10],m=r[12],p=r[13],g=r[14],v=e.typedBuffer,_=e.typedBufferStride,T=t.typedBuffer,x=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*_,r=e*x,i=T[r],n=T[r+1],b=T[r+2];v[t]=o*i+l*n+d*b+m,v[t+1]=a*i+c*n+h*b+p,v[t+2]=s*i+u*n+f*b+g}}function o(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.count,o=r[0],a=r[1],s=r[2],l=r[3],c=r[4],u=r[5],d=r[6],h=r[7],f=r[8],m=e.typedBuffer,p=e.typedBufferStride,g=t.typedBuffer,v=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*p,r=e*v,i=g[r],n=g[r+1],_=g[r+2];m[t]=o*i+l*n+d*_,m[t+1]=a*i+c*n+h*_,m[t+2]=s*i+u*n+f*_}}function a(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*o,i=e*s;n[t]=r*a[i],n[t+1]=r*a[i+1],n[t+2]=r*a[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*n,r=e*a,s=o[r],l=o[r+1],c=o[r+2],u=s*s+l*l+c*c;if(u>0){const e=1/Math.sqrt(u);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*o,i=e*s;n[t]=a[i]>>r,n[t+1]=a[i+1]>>r,n[t+2]=a[i+2]>>r}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:n,transformMat3:o,scale:a,normalize:s,shiftRight:l},Symbol.toStringTag,{value:"Module"}))},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*n,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<s;++e)i[l]=o[c],i[l+1]=o[c+1],i[l+2]=o[c+2],l+=n,c+=a}function n(e,t,r,i,n){var o,a;const s=e.typedBuffer,l=e.typedBufferStride,c=null!=(o=null==n?void 0:n.count)?o:e.count;let u=(null!=(a=null==n?void 0:n.dstIndex)?a:0)*l;for(let e=0;e<c;++e)s[u]=t,s[u+1]=r,s[u+2]=i,u+=l}r.d(t,{c:()=>i,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,fill:n},Symbol.toStringTag,{value:"Module"}))},72119:(e,t,r)=>{function i(){return new Float32Array(3)}function n(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function o(){return i()}function a(){return n(1,1,1)}function s(){return n(1,0,0)}function l(){return n(0,1,0)}function c(){return n(0,0,1)}r.d(t,{c:()=>i,f:()=>n});const u=o(),d=a(),h=s(),f=l(),m=c();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:n,createView:function(e,t){return new Float32Array(e,t,3)},zeros:o,ones:a,unitX:s,unitY:l,unitZ:c,ZEROS:u,ONES:d,UNIT_X:h,UNIT_Y:f,UNIT_Z:m},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>{var r;return null!=(null==(r=e)?void 0:r.match(t))}))}function n(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(o)||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:()=>n});const o=/^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$/,o,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")},61190:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>ni,gltfToEngineResources:()=>ai,parseUrl:()=>oi});var i=r(32243),n=r(70586),o=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),u=r(65617),d=r(60437),h=r(56481),f=r(20773),m=r(11077),p=r(8323),g=r(40270),v=r(88246),_=r(91911),T=r(3172),x=r(66643),b=r(20102),A=r(92604),E=r(95330),S=r(23670);async function M(e,t){const{data:r}=await(0,T.default)(e,{responseType:"image",...t});return r}var R=r(47026),C=r(44553),w=r(11726);class y{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,u.c)(),(0,w.hu)(e.length>=1),(0,w.hu)(r.length%this._numIndexPerPrimitive==0),(0,w.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,w.hu)(3===i.size||4===i.size);const{data:n,size:o}=i,a=e.length;let s=o*r[this._numIndexPerPrimitive*e[0]];P.clear(),P.push(s),this.bbMin=(0,u.f)(n[s],n[s+1],n[s+2]),this.bbMax=(0,u.a)(this.bbMin);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=o*r[i+e],P.push(s);let t=n[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=n[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=n[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.h)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<P.length;++e){s=P.getItemAt(e);const t=n[s]-this.center[0],r=n[s+1]-this.center[1],i=n[s+2]-this.center[2],o=t*t+r*r+i*i;if(o<=l)continue;const a=Math.sqrt(o),c=.5*(a-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const u=c/a;this.center[0]+=t*u,this.center[1]+=r*u,this.center[2]+=i*u}P.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.d)(this.bbMin,this.bbMax)>1){const e=(0,c.h)((0,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:o}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=o*this.indices[s],c=n[l],u=n[l+1],d=n[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=o*this.indices[s+e];const t=n[l],r=n[l+1],i=n[l+2];t<c&&(c=t),r<u&&(u=r),i<d&&(d=i)}c<e[0]&&(t|=1),u<e[1]&&(t|=2),d<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new y(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){P.prune()}}const P=new C.Z({deallocator:null});var O,N,I=r(99001);class D{constructor(){this.id=(0,I.D)()}unload(){}}(N=O||(O={}))[N.Layer=0]="Layer",N[N.Object=1]="Object",N[N.Geometry=2]="Geometry",N[N.Material=3]="Material",N[N.Texture=4]="Texture",N[N.COUNT=5]="COUNT";var L=r(64291),F=r(35065);class H extends D{constructor(e,t=[],r=R.MX.Triangle,i=-1){super(),this._primitiveType=r,this.edgeIndicesLength=i,this.type=O.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,L.p)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,r]of t)r&&(this._indices.set(e,B(r)),e===F.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}cloneShallow(){const e=new H([],void 0,this._primitiveType,void 0),{_vertexAttributes:t,_indices:r}=e;return this._vertexAttributes.forEach(((e,r)=>{t.set(r,e)})),this._indices.forEach(((e,t)=>{r.set(t,e)})),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,n.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===R.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(F.T.POSITION),r=this.vertexAttributes.get(F.T.POSITION);return(0,L.cM)(r,t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(F.T.POSITION),r=this.vertexAttributes.get(F.T.POSITION);return(0,L.NO)(r,t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(F.T.POSITION);if(0===e.length)return null;const t=this.primitiveType===R.MX.Triangle?3:1;(0,w.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,L.p)(e.length/t),i=this.vertexAttributes.get(F.T.POSITION);return new y(r,t,e,i)}}function B(e){if(e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return e;for(const t of e)if(t>=65536)return e;return new Uint16Array(e)}var U=r(74085),z=r(32448),G=r(22021),V=r(1533),W=r(17452),q=r(85958),k=r(99880);let X;var $;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}($||($={}));var j=r(35371),K=r(75656);function Y(e,t,r,i,n=0){const o=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=n*e.stride;if(e.count<=4)o.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),o.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)o.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),o.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)o.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),o.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function Z(e,t,r,i){const n=e.gl,o=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)n.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(j.w0.ARRAY_BUFFER)}function J(e){switch(e){case j.VI.ALPHA:case j.VI.LUMINANCE:case j.VI.RED:case j.VI.RED_INTEGER:case j.lP.R8:case j.lP.R8I:case j.lP.R8UI:case j.lP.R8_SNORM:case j.Tg.STENCIL_INDEX8:return 1;case j.VI.LUMINANCE_ALPHA:case j.VI.RG:case j.VI.RG_INTEGER:case j.lP.RGBA4:case j.lP.R16F:case j.lP.R16I:case j.lP.R16UI:case j.lP.RG8:case j.lP.RG8I:case j.lP.RG8UI:case j.lP.RG8_SNORM:case j.lP.RGB565:case j.lP.RGB5_A1:case j.Tg.DEPTH_COMPONENT16:return 2;case j.VI.DEPTH_COMPONENT:case j.VI.RGB:case j.VI.RGB_INTEGER:case j.lP.RGB8:case j.lP.RGB8I:case j.lP.RGB8UI:case j.lP.RGB8_SNORM:case j.lP.SRGB8:case j.Tg.DEPTH_COMPONENT24:return 3;case j.VI.DEPTH_STENCIL:case j.VI.RGBA:case j.VI.RGBA_INTEGER:case j.lP.RGBA8:case j.lP.R32F:case j.lP.R11F_G11F_B10F:case j.lP.RG16F:case j.lP.R32I:case j.lP.R32UI:case j.lP.RG16I:case j.lP.RG16UI:case j.lP.RGBA8I:case j.lP.RGBA8UI:case j.lP.RGBA8_SNORM:case j.lP.SRGB8_ALPHA8:case j.lP.RGB9_E5:case j.lP.RGB10_A2UI:case j.lP.RGB10_A2:case j.Tg.DEPTH_STENCIL:case j.Tg.DEPTH_COMPONENT32F:case j.Tg.DEPTH24_STENCIL8:return 4;case j.Tg.DEPTH32F_STENCIL8:return 5;case j.lP.RGB16F:case j.lP.RGB16I:case j.lP.RGB16UI:return 6;case j.lP.RG32F:case j.lP.RG32I:case j.lP.RG32UI:case j.lP.RGBA16F:case j.lP.RGBA16I:case j.lP.RGBA16UI:return 8;case j.lP.RGB32F:case j.lP.RGB32I:case j.lP.RGB32UI:return 12;case j.lP.RGBA32F:case j.lP.RGBA32I:case j.lP.RGBA32UI:return 16;case j.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case j.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case j.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case j.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case j.q_.COMPRESSED_R11_EAC:case j.q_.COMPRESSED_SIGNED_R11_EAC:case j.q_.COMPRESSED_RGB8_ETC2:case j.q_.COMPRESSED_SRGB8_ETC2:case j.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case j.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case j.q_.COMPRESSED_RG11_EAC:case j.q_.COMPRESSED_SIGNED_RG11_EAC:case j.q_.COMPRESSED_RGBA8_ETC2_EAC:case j.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function Q(e){if((0,n.Wi)(e))return 0;if("descriptor"in e)return e.glName?Q(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return J(t)*i*r}r(80442);let ee=null,te=null;async function re(){return(0,n.Wi)(te)&&(te=function(){if((0,n.Wi)(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}(),ee=await te),te}function ie(e,t,r,i,n){const o=J(t?j.q_.COMPRESSED_RGBA8_ETC2_EAC:j.q_.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function ne(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ae(e,t,r,i,n,o,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),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,u))),s(e,u,f[e]);const m=f.length>1,p=m?j.cw.LINEAR_MIPMAP_LINEAR:j.cw.LINEAR,g={...t,samplingMode:p,hasMipmap:m,internalFormat:d,width:n,height:o};return new K.x(e,g,{type:"compressed",levels:f})}const se=A.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function le(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ce=le("DXT1"),ue=le("DXT3"),de=le("DXT5");const he=new Map([[F.T.POSITION,0],[F.T.NORMAL,1],[F.T.UV0,2],[F.T.COLOR,3],[F.T.SIZE,4],[F.T.TANGENT,4],[F.T.AUXPOS1,5],[F.T.SYMBOLCOLOR,5],[F.T.AUXPOS2,6],[F.T.FEATUREATTRIBUTE,6],[F.T.INSTANCEFEATUREATTRIBUTE,6],[F.T.INSTANCECOLOR,7],[F.T.MODEL,8],[F.T.MODELNORMAL,12],[F.T.MODELORIGINHI,11],[F.T.MODELORIGINLO,15]]);var fe=r(21968);new fe.G(F.T.POSITION,3,j.g.FLOAT,0,12),new fe.G(F.T.POSITION,3,j.g.FLOAT,0,20),new fe.G(F.T.UV0,2,j.g.FLOAT,12,20),new fe.G(F.T.POSITION,3,j.g.FLOAT,0,32),new fe.G(F.T.NORMAL,3,j.g.FLOAT,12,32),new fe.G(F.T.UV0,2,j.g.FLOAT,24,32),new fe.G(F.T.POSITION,3,j.g.FLOAT,0,16),new fe.G(F.T.COLOR,4,j.g.UNSIGNED_BYTE,12,16);const me=[new fe.G(F.T.POSITION,2,j.g.FLOAT,0,8)],pe=[new fe.G(F.T.POSITION,2,j.g.FLOAT,0,16),new fe.G(F.T.UV0,2,j.g.FLOAT,8,16)];var ge=r(67676),ve=r(49300),_e=r(54738);const Te=A.Z.getLogger("esri.views.webgl.BufferObject");class xe{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(j._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,ve.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new xe(e,j.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new xe(e,j.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==_e.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new xe(e,j.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=j.l1.STREAM_READ,r){if(e.type!==_e.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new xe(e,j.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=j.l1.STREAM_DRAW,r){if(e.type!==_e.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new xe(e,j.w0.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER?this._indexType===j.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===j.w0.ARRAY_BUFFER}dispose(){var e;null!=(e=this._context)&&e.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(j._g.BufferObject,this),this._context=null):this._glName&&Te.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&Te.error("Buffer size needs to be positive!"),this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER&&(0,n.pC)(t))switch(this._indexType=t,t){case j.g.UNSIGNED_SHORT:e*=2;break;case j.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER&&((0,V.Uc)(e)&&(t/=2,this._indexType=j.g.UNSIGNED_SHORT),(0,V.ZY)(e)&&(t/=4,this._indexType=j.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;(0,n.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,ve.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&Te.error("offset is out of range!");let n=t,o=r,a=i,s=e.byteLength;this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER&&((0,V.Uc)(e)?(s/=2,n*=2,o*=2,a*=2):(0,V.ZY)(e)&&(s/=4,n*=4,o*=4,a*=4)),void 0===i&&(i=s-1),r>=i&&Te.error("end must be bigger than start!"),t+r-i>this._size&&Te.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,u=ArrayBuffer.isView(e)?e.buffer:e,d=0===o&&a===e.byteLength?u:u.slice(o,a);c.bufferSubData(this.bufferType,n,d),(0,ve.zu)(c),this._isVAOAware&&this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&Te.error("offset is out of range!"),r>=i&&Te.error("end must be bigger than start!"),t+r-i>this._size&&Te.error("An attempt to write beyond the end of the buffer!");const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl;if(this._context.type===_e.zO.WEBGL2)o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const n=0===r&&i===e.length?e:e.subarray(r,i);o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,n)}(0,ve.zu)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,i){if(this._context.type!==_e.zO.WEBGL2)return void Te.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void Te.error("Problem getting subdata: offset and length were less than zero!");const n=function(e){return(0,ge.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(n*((null!=r?r:0)+(null!=i?i:0))>e.byteLength)return void Te.error("Problem getting subdata: offset and length exceeded destination size!");t+n*(null!=i?i:0)>this.byteSize&&Te.warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this._context.bindBuffer(this,j.w0.COPY_READ_BUFFER),o.getBufferSubData(j.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(j.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===_e.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):Te.error("Get buffer subdata is supported in WebGL2 only!")}}const be=A.Z.getLogger("esri.views.webgl.VertexArrayObject");class Ae{constructor(e,t,r,i,n=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=n,this._glName=null,this._initialized=!1,e.instanceCounter.increment(j._g.VertexArrayObject,this)}get glName(){return this._glName}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,n.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){var t,r;const e=null==(t=this._context)||null==(r=t.capabilities)?void 0:r.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):be.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e].dispose(),delete this._buffers[e];this._indexBuffer=(0,n.O3)(this._indexBuffer)}this._context.instanceCounter.decrement(j._g.VertexArrayObject,this),this._context=null}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&be.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||be.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||be.error("Vertex buffer is uninitialized!");const n=t[r];n||be.error("Vertex element descriptor is empty!"),Y(this._context,this._locations,i,n)}(0,n.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||be.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||be.error("Vertex buffer is uninitialized!");const n=t[r];Z(this._context,this._locations,i,n)}(0,n.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}class Ee{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment(j._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:a}=t;if(a){if(this._context.type!==_e.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n)}else r.renderbufferStorage(r.RENDERBUFFER,o,i,n)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(j._g.Renderbuffer,this),this._context=null)}}const Se=A.Z.getLogger("esri.views.webgl.FrameBufferObject");class Me{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(j._g.FramebufferObject,this),(0,n.pC)(r)){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=j.VY.COLOR_ATTACHMENT0+e;let n;we(t)?(Re(t)?(n=t.descriptor,this._colorAttachments.set(i,t)):(n=t,this._colorAttachments.set(i,new K.x(this._context,n))),ye(n,this._desc)):(Ce(t)?(n=t.descriptor,this._colorAttachments.set(i,t)):(n=t,this._colorAttachments.set(i,new Ee(this._context,n))),Pe(n,this._desc)),this._validateColorAttachmentPoint(i)}}if((0,n.pC)(i)){let e,t;if(we(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),Re(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new K.x(this._context,t)),ye(t,this._desc);else{var o;Ce(i)?(t=i.descriptor,e=i):(t=i,e=new Ee(this._context,t));const r=null!=(o=this._desc.depthStencilTarget)?o:j.OU.DEPTH_STENCIL_RENDER_BUFFER;r===j.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===j.OU.DEPTH_RENDER_BUFFER||r===j.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),Pe(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(j._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(j.VY.COLOR_ATTACHMENT0);return e&&Re(e)?e:null}get colorAttachment(){return this._colorAttachments.get(j.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width}get height(){return this._desc.height}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+Q(r)),0)+Q(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&Re(t)?t:null}attachColorTexture(e,t=j.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),ye(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=j.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(Re(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=j.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);Re(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if((0,n.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==j.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==j.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!"),ye(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==j.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=j.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,j.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,j.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,n.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==j.Tg.DEPTH_STENCIL&&t.internalFormat!==j.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),Pe(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===j.Tg.DEPTH_STENCIL?j.OU.DEPTH_STENCIL_RENDER_BUFFER:j.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===j.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(j.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===j.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(j.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=a.descriptor;a.descriptor.target!==j.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(e+r>s.width||t+i>s.height||n+r>l.width||o+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,u=c.bindTexture(a,K.x.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(K.x.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(j.No.TEXTURE_2D,0,n,o,e,t,r,i),c.bindTexture(u,K.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,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,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a){if(this._context.type!==_e.zO.WEBGL2)return(0,ve.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,n,o,a);const s=this._context.gl,l=xe.createPixelPack(this._context,j.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(j.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=j.qi.FRAMEBUFFER){var t,r,i,n;const o=this._context.gl;if(this._initialized)return void o.bindFramebuffer(e,this.glName);this._glName&&o.deleteFramebuffer(this._glName);const a=this._context,s=o.createFramebuffer(),l=this._desc,c=null!=(t=l.colorTarget)?t:j.Lm.RENDER_BUFFER,u=null!=(r=l.width)?r:1,d=null!=(i=l.height)?i:1;if(o.bindFramebuffer(e,s),0===this._colorAttachments.size)if(c===j.Lm.TEXTURE||c===j.Lm.CUBEMAP)this._colorAttachments.set(j.VY.COLOR_ATTACHMENT0,function(e,t,r){return new K.x(e,{target:r,pixelFormat:j.VI.RGBA,dataType:j.Br.UNSIGNED_BYTE,samplingMode:j.cw.NEAREST,wrapMode:j.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(a,l,this.descriptor.colorTarget===j.Lm.CUBEMAP?j.No.TEXTURE_CUBE_MAP:j.No.TEXTURE_2D));else{const e=new Ee(a,{internalFormat:j.lP.RGBA4,width:u,height:d});this._colorAttachments.set(j.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((t,r)=>{t&&(Re(t)?this._framebufferTexture2D(t.glName,r,Oe(t),e):o.framebufferRenderbuffer(e,r,o.RENDERBUFFER,t.glName))}));const h=null!=(n=l.depthStencilTarget)?n:j.OU.NONE;switch(h){case j.OU.DEPTH_RENDER_BUFFER:case j.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new Ee(a,{internalFormat:l.depthStencilTarget===j.OU.DEPTH_RENDER_BUFFER?j.Tg.DEPTH_COMPONENT16:j.Tg.DEPTH_STENCIL,width:u,height:d}));const t=h===j.OU.DEPTH_RENDER_BUFFER?o.DEPTH_ATTACHMENT:o.DEPTH_STENCIL_ATTACHMENT;o.framebufferRenderbuffer(e,t,o.RENDERBUFFER,this._depthAttachment.glName);break}case j.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new Ee(a,{internalFormat:j.Tg.STENCIL_INDEX8,width:u,height:d})),o.framebufferRenderbuffer(e,o.STENCIL_ATTACHMENT,o.RENDERBUFFER,this._stencilAttachment.glName);break;case j.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){a.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:j.No.TEXTURE_2D,pixelFormat:j.VI.DEPTH_STENCIL,dataType:j.Br.UNSIGNED_INT_24_8,samplingMode:j.cw.NEAREST,wrapMode:j.e8.CLAMP_TO_EDGE,width:u,height:d};this._depthStencilTexture=new K.x(a,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,o.DEPTH_STENCIL_ATTACHMENT,Oe(this._depthStencilTexture),e)}(0,ve.CG)()&&o.checkFramebufferStatus(e)!==o.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=s,this._initialized=!0}_framebufferTexture2D(e,t=j.VY.COLOR_ATTACHMENT0,r=j.No.TEXTURE_2D,i=j.qi.FRAMEBUFFER,n=0){this._context.gl.framebufferTexture2D(i,t,r,e,n)}_detachColorAttachment(e){(0,ve.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return Re(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(j.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===j.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(j.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(j.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===Me._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Me._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Me._MAX_COLOR_ATTACHMENTS=1}const t=e-j.VY.COLOR_ATTACHMENT0;t+1>Me._MAX_COLOR_ATTACHMENTS&&Se.error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Me._MAX_COLOR_ATTACHMENTS} color attachments`)}}function Re(e){return"type"in e&&"texture"===e.type}function Ce(e){return"type"in e&&"renderbuffer"===e.type}function we(e){return Re(e)||"pixelFormat"in e}function ye(e,t){e.target!==j.No.TEXTURE_2D&&e.target!==j.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function Pe(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function Oe(e){return e.descriptor.target===j.No.TEXTURE_CUBE_MAP?j.No.TEXTURE_CUBE_MAP_POSITIVE_X:j.No.TEXTURE_2D}Me._MAX_COLOR_ATTACHMENTS=-1;var Ne,Ie,De=r(46314);class Le extends D{constructor(e,t){super(),this.data=e,this.type=O.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.Z,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:j.e8.REPEAT,t:j.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||R.CE.STRETCH,this.estimatedTexMemRequired=Le._estimateTexMemRequired(this.data,this.params),this._startPreload()}_startPreload(){const e=this.data;(0,n.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){(0,W.jc)(e.src)||"auto"===e.preload&&e.crossOrigin||(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src)}_startPreloadImageElement(e){(0,W.HK)(e.src)||(0,W.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,n.Wi)(e))return 0;if((0,V.eP)(e)||(0,V.lq)(e))return t.encoding===Le.KTX2_ENCODING?function(e,t){if((0,n.Wi)(ee))return e.byteLength;const r=new ee.KTX2File(new Uint8Array(e)),i=oe(r)?ie(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===Le.BASIS_ENCODING?function(e,t){if((0,n.Wi)(ee))return e.byteLength;const r=new ee.BasisFile(new Uint8Array(e)),i=ne(r)?ie(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?Le._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this.data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){var t;return{target:j.No.TEXTURE_2D,pixelFormat:j.VI.RGBA,dataType:j.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?j.cw.LINEAR_MIPMAP_LINEAR:j.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:null!=(t=this.params.maxAnisotropy)?t:this.params.mipmap?e.parameters.maxMaxAnisotropy:1}}get glTexture(){return this._glTexture}load(e,t){if((0,n.pC)(this._glTexture))return this._glTexture;if((0,n.pC)(this._loadingPromise))return this._loadingPromise;const r=this.data;return(0,n.Wi)(r)?(this._glTexture=new K.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Le.DDS_ENCODING?(this.data=void 0,this._loadFromDDSData(e,r)):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Le.KTX2_ENCODING?(this.data=void 0,this._loadFromKTX2(e,r)):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Le.BASIS_ENCODING?(this.data=void 0,this._loadFromBasis(e,r)):(0,V.lq)(r)?this._loadFromPixelData(e,r):(0,V.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this.data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this.data instanceof HTMLVideoElement)||(0,n.Wi)(this._glTexture))return r;if(this.data.readyState<Ne.HAVE_CURRENT_DATA||r===this.data.currentTime)return r;if((0,n.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:n}=this._powerOfTwoStretchInfo;n.setData(this.data),this._drawStretchedTexture(e,t,r,i,n,this._glTexture)}else{const{width:e,height:t}=this.data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this.data):this._glTexture.setData(this.data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:n,width:o,height:a}=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return se.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return se.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case ce:n=8,o=j.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ue:n=16,o=j.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case de:n=16,o=j.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return se.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)||(se.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])),1===a||(0,G.wt)(s)&&(0,G.wt)(l)||(se.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,d=new Uint8Array(e,f,h),m.push(d),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:c,height:u}}(r,t.hasMipmap);return t.samplingMode=i.levels.length>1?j.cw.LINEAR_MIPMAP_LINEAR:j.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=o,t.height=a,new K.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,n.Wi)(ee)&&(ee=await re());const i=new ee.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ae(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){(0,n.Wi)(ee)&&(ee=await re());const i=new ee.BasisFile(new Uint8Array(r));if(!ne(i))return null;i.startTranscoding();const o=ae(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,w.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?j.VI.LUMINANCE:3===this.params.components?j.VI.RGB:j.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new K.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const n=await M(r,{signal:i});return(0,E.k_)(i),this._loadFromImage(e,n,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const n=await(0,q.f)(r,r.src,!1,i);return(0,E.k_)(i),this._loadFromImage(e,n,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Ne.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((o,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,n.hw)(u)},l=()=>{r.readyState>=Ne.HAVE_CURRENT_DATA&&(s(),o(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new b.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const u=(0,E.fu)(i,(()=>c((0,E.zE)())))}))))}_loadFromImage(e,t,r){const i=Le._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this.params.components?j.VI.RGB:j.VI.RGBA,!this._requiresPowerOfTwo(e,n)||(0,G.wt)(i.width)&&(0,G.wt)(i.height)?(n.width=i.width,n.height=i.height,this._glTexture=new K.x(e,n,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,n,r),this._glTexture)}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=j.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,De.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,n){const{width:o,height:a}=r,s=(0,G.Sf)(o),l=(0,G.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case R.CE.PAD:i.textureCoordinateScaleFactor=[o/s,a/l],c=new K.x(e,i),c.updateData(0,0,0,o,a,t);break;case R.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,n());break;default:(0,U.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const n=new K.x(e,r),o=new Me(e,{colorTarget:j.Lm.TEXTURE,depthStencilTarget:j.OU.NONE},n),a=new K.x(e,{target:j.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:j.Br.UNSIGNED_BYTE,wrapMode:j.e8.CLAMP_TO_EDGE,samplingMode:j.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=me,r=he,i=-1,n=1){let o=null;return o=t===pe?new Float32Array([i,i,0,0,n,i,1,0,i,n,0,1,n,n,1,1]):new Float32Array([i,i,n,i,i,n,n,n]),new Ae(e,r,{geometry:t},{geometry:xe.createVertex(e,j.l1.STATIC_DRAW,o)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,o,s,a,n),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:o}:(s.dispose(!0),a.dispose(),o.detachColorTexture(),o.dispose()),e.bindFramebuffer(l),n}_drawStretchedTexture(e,t,r,i,n,o){e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,o.descriptor.width,o.descriptor.height);const s=e.bindTechnique(t);s.setUniform4f("uColor",1,1,1,1),s.bindTexture("tex",n),e.bindVAO(i),e.drawArrays(j.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height)}unload(){if((0,n.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,n.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,n.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}Le.DDS_ENCODING="image/vnd-ms.dds",Le.KTX2_ENCODING="image/ktx2",Le.BASIS_ENCODING="image/x.basis",(Ie=Ne||(Ne={}))[Ie.HAVE_NOTHING=0]="HAVE_NOTHING",Ie[Ie.HAVE_METADATA=1]="HAVE_METADATA",Ie[Ie.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ie[Ie.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ie[Ie.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var Fe=r(64822),He=r(65576),Be=r(18361),Ue=r(64267),ze=r(99917),Ge=r(19419),Ve=r(85504),We=r(94124),qe=(r(97323),r(5543),r(57220),r(74709),r(12139),r(67498));r(42001),r(45436),r(85594);var ke=r(97995);function Xe(e){return(0,n.pC)(e.shadowMap)&&e.shadowMap.enabled}(0,u.c)(),(0,u.c)();var $e,je=r(37782);class Ke extends D{constructor(e,t){super(),this.type=O.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=he,this._parameters=(0,je.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,je.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.isVisibleInPass(e.pass)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleInPass(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,n.pC)(this.repository)&&this.repository.materialChanged(this)}}!function(e){e[e.Occlude=1]="Occlude",e[e.Transparent=2]="Transparent",e[e.OccludeAndTransparent=4]="OccludeAndTransparent",e[e.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",e[e.Opaque=16]="Opaque"}($e||($e={}));const Ye={renderOccluded:$e.Occlude};function Ze(e,t,r=j.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}const Je={face:j.LR.BACK,mode:j.Wf.CCW},Qe={face:j.LR.FRONT,mode:j.Wf.CCW},et=e=>e===R.Vr.Back?Je:e===R.Vr.Front?Qe:null,tt={zNear:0,zFar:1},rt={r:!0,g:!0,b:!0,a:!0};function it(e){return ft.intern(e)}function nt(e){return pt.intern(e)}function ot(e){return vt.intern(e)}function at(e){return Tt.intern(e)}function st(e){return bt.intern(e)}function lt(e){return Et.intern(e)}function ct(e){return Mt.intern(e)}function ut(e){return Ct.intern(e)}class dt{constructor(e,t){this.makeKey=e,this.makeRef=t,this.interns=new Map}intern(e){if(!e)return null;const t=this.makeKey(e),r=this.interns;return r.has(t)||r.set(t,this.makeRef(e)),r.get(t)}}function ht(e){return"["+e.join(",")+"]"}const ft=new dt(mt,(e=>({__tag:"Blending",...e})));function mt(e){return e?ht([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 pt=new dt(gt,(e=>({__tag:"Culling",...e})));function gt(e){return e?ht([e.face,e.mode]):null}const vt=new dt(_t,(e=>({__tag:"PolygonOffset",...e})));function _t(e){return e?ht([e.factor,e.units]):null}const Tt=new dt(xt,(e=>({__tag:"DepthTest",...e})));function xt(e){return e?ht([e.func]):null}const bt=new dt(At,(e=>({__tag:"StencilTest",...e})));function At(e){return e?ht([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const Et=new dt(St,(e=>({__tag:"DepthWrite",...e})));function St(e){return e?ht([e.zNear,e.zFar]):null}const Mt=new dt(Rt,(e=>({__tag:"ColorWrite",...e})));function Rt(e){return e?ht([e.r,e.g,e.b,e.a]):null}const Ct=new dt(wt,(e=>({__tag:"StencilWrite",...e})));function wt(e){return e?ht([e.mask]):null}const yt=new dt((function(e){return e?ht([mt(e.blending),gt(e.culling),_t(e.polygonOffset),xt(e.depthTest),At(e.stencilTest),St(e.depthWrite),Rt(e.colorWrite),wt(e.stencilWrite)]):null}),(e=>({blending:it(e.blending),culling:nt(e.culling),polygonOffset:ot(e.polygonOffset),depthTest:at(e.depthTest),stencilTest:st(e.stencilTest),depthWrite:lt(e.depthWrite),colorWrite:ct(e.colorWrite),stencilWrite:ut(e.stencilWrite)}))),Pt=function(e,t,r,i,n=j.db.ADD,o=j.db.ADD,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}(j.zi.SRC_ALPHA,j.zi.ONE,j.zi.ONE_MINUS_SRC_ALPHA,j.zi.ONE_MINUS_SRC_ALPHA),Ot=Ze(j.zi.ONE,j.zi.ONE),Nt=Ze(j.zi.ZERO,j.zi.ONE_MINUS_SRC_ALPHA);function It(e){return e===R.Am.FrontFace?null:e===R.Am.Alpha?Nt:Ot}const Dt={factor:-1,units:-2};function Lt(e){return e?Dt:null}function Ft(e,t=j.wb.LESS){return e===R.Am.NONE||e===R.Am.FrontFace?t:j.wb.LEQUAL}var Ht,Bt,Ut=r(50173),zt=r(51305),Gt=r(94961),Vt=r(72119),Wt=r(88669),qt=r(98766);(Bt=Ht||(Ht={}))[Bt.X=0]="X",Bt[Bt.Y=1]="Y",Bt[Bt.Z=2]="Z";var kt=r(22807),Xt=r(12981);new kt.x((function(){return{origin:null,direction:null}})),(0,u.c)(),(0,u.c)();const $t=A.Z.getLogger("esri.geometry.support.sphere");function jt(){return(0,Wt.c)()}function Kt(e,t=jt()){return(0,qt.c)(t,e)}function Yt(e){return Array.isArray(e)?e[3]:e}function Zt(e){return Array.isArray(e)?e:ar}function Jt(e,t,r){if((0,n.Wi)(t))return!1;const{origin:i,direction:o}=t,a=Qt;a[0]=i[0]-e[0],a[1]=i[1]-e[1],a[2]=i[2]-e[2];const s=o[0]*o[0]+o[1]*o[1]+o[2]*o[2],l=2*(o[0]*a[0]+o[1]*a[1]+o[2]*a[2]),c=l*l-4*s*(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-e[3]*e[3]);if(c<0)return!1;const u=Math.sqrt(c);let d=(-l-u)/(2*s);const h=(-l+u)/(2*s);return(d<0||h<d&&h>0)&&(d=h),!(d<0||(r&&(r[0]=i[0]+o[0]*d,r[1]=i[1]+o[1]*d,r[2]=i[2]+o[2]*d),0))}const Qt=(0,u.c)();function er(e,t,r){const i=Xt.WM.get(),n=Xt.MP.get();(0,c.f)(i,t.origin,t.direction);const o=Yt(e);(0,c.f)(r,i,t.origin),(0,c.g)(r,r,1/(0,c.l)(r)*o);const a=rr(e,t.origin),l=function(e,t){const r=(0,c.e)(e,t)/((0,c.l)(e)*(0,c.l)(t));return-(0,G.ZF)(r)}(t.origin,r);return(0,s.d)(n,l+a,i),(0,c.m)(r,r,n),r}function tr(e,t,r){const i=(0,c.b)(Xt.WM.get(),t,Zt(e)),n=(0,c.g)(Xt.WM.get(),i,e[3]/(0,c.l)(i));return(0,c.a)(r,n,Zt(e))}function rr(e,t){const r=(0,c.b)(Xt.WM.get(),t,Zt(e)),i=(0,c.l)(r),n=Yt(e),o=n+Math.abs(n-i);return(0,G.ZF)(n/o)}const ir=(0,u.c)();function nr(e,t,r,i){const n=(0,c.b)(ir,t,Zt(e));switch(r){case Ht.X:{const e=(0,G.jE)(n,ir)[2];return(0,c.s)(i,-Math.sin(e),Math.cos(e),0)}case Ht.Y:{const e=(0,G.jE)(n,ir),t=e[1],r=e[2],o=Math.sin(t);return(0,c.s)(i,-o*Math.cos(r),-o*Math.sin(r),Math.cos(t))}case Ht.Z:return(0,c.n)(i,n);default:return}}function or(e,t){const r=(0,c.b)(sr,t,Zt(e));return(0,c.l)(r)-e[3]}const ar=(0,u.c)(),sr=(0,u.c)();Object.freeze(Object.defineProperty({__proto__:null,create:jt,copy:Kt,fromCenterAndRadius:function(e,t){return(0,Wt.f)(e[0],e[1],e[2],t)},wrap:function(e){return e},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},fromRadius:function(e){return e},getRadius:Yt,getCenter:Zt,fromValues:function(e,t,r,i){return(0,Wt.f)(e,t,r,i)},elevate:function(e,t,r){return e!==r&&(0,c.c)(r,e),r[3]=e[3]+t,r},setExtent:function(e,t,r){return $t.error("sphere.setExtent is not yet supported"),e===r?r:Kt(e,r)},intersectRay:Jt,intersectsRay:function(e,t){return Jt(e,t,null)},intersectRayClosestSilhouette:function(e,t,r){if(Jt(e,t,r))return r;const i=er(e,t,Xt.WM.get());return(0,c.a)(r,t.origin,(0,c.g)(Xt.WM.get(),t.direction,(0,c.i)(t.origin,i)/(0,c.l)(t.direction))),r},closestPointOnSilhouette:er,closestPoint:function(e,t,r){return Jt(e,t,r)?r:(function(e,t,r){const i=(0,c.e)(e.direction,(0,c.b)(r,t,e.origin));(0,c.a)(r,e.origin,(0,c.g)(r,e.direction,i))}(t,Zt(e),r),tr(e,r,r))},projectPoint:tr,distanceToSilhouette:function(e,t){const r=(0,c.b)(Xt.WM.get(),t,Zt(e)),i=(0,c.p)(r),n=e[3]*e[3];return Math.sqrt(Math.abs(i-n))},angleToSilhouette:rr,axisAt:nr,altitudeAt:or,setAltitudeAt:function(e,t,r,i){const n=or(e,t),o=nr(e,t,Ht.Z,sr),a=(0,c.g)(sr,o,r-n);return(0,c.a)(i,t,a)}},Symbol.toStringTag,{value:"Module"}));const lr=new class{constructor(e=0){this.offset=e,this.sphere=jt(),this.tmpVertex=(0,u.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let n=i[0]*e+i[4]*t+i[8]*r+i[12],o=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(n*n+o*o+a*a);n+=n*s,o+=o*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*n+l[4]*o+l[8]*a+l[12],this.tmpVertex[1]=l[1]*n+l[5]*o+l[9]*a+l[13],this.tmpVertex[2]=l[2]*n+l[6]*o+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.offset=e,this.componentLocalOriginLength=0,this.tmpVertex=(0,u.c)(),this.mbs=(0,Wt.c)(),this.obb={center:(0,u.c)(),halfSize:(0,Vt.c)(),quaternion:null}}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,n=t,o=r+this.componentLocalOriginLength,a=this.offset/Math.sqrt(i*i+n*n+o*o);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+n*a,this.tmpVertex[2]=r+o*a,this.tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,n=e[3],o=e[4],a=e[5]+this.componentLocalOriginLength,s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(n*n+o*o+a*a);return e[3]+=n*l,e[4]+=o*l,e[5]+=a*l,e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.mbs[0]=e[0]+e[0]*r,this.mbs[1]=e[1]+e[1]*r,this.mbs[2]=e[2]+e[2]*r,this.mbs[3]=e[3]+e[3]*this.offset/t,this.mbs}applyToObb(e){const t=e.center,r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.obb.center[0]=t[0]+t[0]*r,this.obb.center[1]=t[1]+t[1]*r,this.obb.center[2]=t[2]+t[2]*r,(0,c.q)(this.obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this.obb.halfSize,this.obb.halfSize,e.center);const i=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*i,this.obb.halfSize[1]+=this.obb.halfSize[1]*i,this.obb.halfSize[2]+=this.obb.halfSize[2]*i,(0,c.b)(this.obb.halfSize,this.obb.halfSize,e.center),(0,zt.c)(cr,e.quaternion),(0,c.q)(this.obb.halfSize,this.obb.halfSize,cr),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=e.quaternion,this.obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],n=t+this.localOrigin[1],o=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+n*n+o*o);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+n*a,this.tmpVertex[2]=r+o*a,this.tmpVertex}applyToAabb(e){const t=e[0]+this.localOrigin[0],r=e[1]+this.localOrigin[1],i=e[2]+this.localOrigin[2],n=e[3]+this.localOrigin[0],o=e[4]+this.localOrigin[1],a=e[5]+this.localOrigin[2],s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(n*n+o*o+a*a);return e[3]+=n*l,e[4]+=o*l,e[5]+=a*l,e}};const cr=(0,Gt.a)();function ur(e,t,r,i){const n=r.typedBuffer,o=r.typedBufferStride,a=e.length;i*=o;for(let r=0;r<a;++r){const a=2*e[r];n[i]=t[a],n[i+1]=t[a+1],i+=o}}function dr(e,t,r,i,n){const o=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==n||1===n)for(let r=0;r<s;++r){const n=3*e[r];o[i]=t[n],o[i+1]=t[n+1],o[i+2]=t[n+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<n;++e)o[i]=t[s],o[i+1]=t[s+1],o[i+2]=t[s+2],i+=a}}function hr(e,t,r,i,n,o=1){if(!r)return void dr(e,t,i,n,o);const a=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],u=r[1],d=r[2],h=r[4],f=r[5],m=r[6],p=r[8],g=r[9],v=r[10],_=r[12],T=r[13],x=r[14];if(n*=s,1===o)for(let r=0;r<l;++r){const i=3*e[r],o=t[i],l=t[i+1],b=t[i+2];a[n]=c*o+h*l+p*b+_,a[n+1]=u*o+f*l+g*b+T,a[n+2]=d*o+m*l+v*b+x,n+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+p*A+_,S=u*l+f*b+g*A+T,M=d*l+m*b+v*A+x;for(let e=0;e<o;++e)a[n]=E,a[n+1]=S,a[n+2]=M,n+=s}}function fr(e,t,r,i,n,o=1){if(!r)return void dr(e,t,i,n,o);const a=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=a[0],h=a[1],f=a[2],m=a[4],p=a[5],g=a[6],v=a[8],_=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(n*=c,1===o)for(let r=0;r<u;++r){const i=3*e[r],o=t[i],a=t[i+1],s=t[i+2];let u=d*o+m*a+v*s,E=h*o+p*a+_*s,S=f*o+g*a+T*s;if(x){const e=u*u+E*E+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);u*=t,E*=t,S*=t}}l[n+0]=u,l[n+1]=E,l[n+2]=S,n+=c}else for(let r=0;r<u;++r){const i=3*e[r],a=t[i],s=t[i+1],u=t[i+2];let E=d*a+m*s+v*u,S=h*a+p*s+_*u,M=f*a+g*s+T*u;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<o;++e)l[n+0]=E,l[n+1]=S,l[n+2]=M,n+=c}}function mr(e,t,r,i,n,o=1){if(!r)return void function(e,t,r,i,n=1){const o=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===n)for(let r=0;r<s;++r){const n=4*e[r];o[i]=t[n],o[i+1]=t[n+1],o[i+2]=t[n+2],o[i+3]=t[n+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<n;++e)o[i]=t[s],o[i+1]=t[s+1],o[i+2]=t[s+2],o[i+3]=t[s+3],i+=a}}(e,t,i,n,o);const a=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=a[0],h=a[1],f=a[2],m=a[4],p=a[5],g=a[6],v=a[8],_=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(n*=c,1===o)for(let r=0;r<u;++r){const i=4*e[r],o=t[i],a=t[i+1],s=t[i+2],u=t[i+3];let E=d*o+m*a+v*s,S=h*o+p*a+_*s,M=f*o+g*a+T*s;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}l[n+0]=E,l[n+1]=S,l[n+2]=M,l[n+3]=u,n+=c}else for(let r=0;r<u;++r){const i=4*e[r],a=t[i],s=t[i+1],u=t[i+2],E=t[i+3];let S=d*a+m*s+v*u,M=h*a+p*s+_*u,R=f*a+g*s+T*u;if(x){const e=S*S+M*M+R*R;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,M*=t,R*=t}}for(let e=0;e<o;++e)l[n+0]=S,l[n+1]=M,l[n+2]=R,l[n+3]=E,n+=c}}function pr(e,t,r,i,n,o=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(n*=s,1===o){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=t[i+3],n+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=255,n+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<o;++e)a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=t[i+3],n+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<o;++e)a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=255,n+=s}}var gr=r(135),vr=r(92555),_r=r(72303),Tr=r(89243);class xr{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}class br{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new C.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(qe.P.Pass,this),this.bindDraw=t.generateBind(qe.P.Draw,this),this._fragmentUniforms=(0,ve.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get isCompiled(){return this._glProgram.isCompiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2f(e,t,r){this._glProgram.setUniform2f(e,t,r)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3f(e,t,r,i){this._glProgram.setUniform3f(e,t,r,i)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4f(e,t,r,i,n){this._glProgram.setUniform4f(e,t,r,i,n)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if((0,n.Wi)(t)||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),(0,n.pC)(this._fragmentUniforms)&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}j.wb.LESS,j.wb.ALWAYS;const Ar={mask:255},Er={function:{func:j.wb.ALWAYS,ref:R.hU.OutlineVisualElementMask,mask:R.hU.OutlineVisualElementMask},operation:{fail:j.xS.KEEP,zFail:j.xS.KEEP,zPass:j.xS.ZERO}},Sr={function:{func:j.wb.ALWAYS,ref:R.hU.OutlineVisualElementMask,mask:R.hU.OutlineVisualElementMask},operation:{fail:j.xS.KEEP,zFail:j.xS.KEEP,zPass:j.xS.REPLACE}};j.wb.EQUAL,R.hU.OutlineVisualElementMask,R.hU.OutlineVisualElementMask,j.xS.KEEP,j.xS.KEEP,j.xS.KEEP,j.wb.NOTEQUAL,R.hU.OutlineVisualElementMask,R.hU.OutlineVisualElementMask,j.xS.KEEP,j.xS.KEEP,j.xS.KEEP;var Mr=r(32078);const Rr=A.Z.getLogger("esri.views.3d.webgl-engine.shaders.DefaultTechnique");class Cr extends class{constructor(e,t,r){this.release=r,t&&(this.initializeConfiguration(e,t),this._configuration=t.snapshot()),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,n.O3)(this._program),this._pipeline=this._configuration=null}reload(e){(0,n.O3)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.isCompiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPass(e,t){this.program.bindPass(e,t)}bindDraw(e,t){this.program.bindDraw(e,t)}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return j.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}{initializeConfiguration(e,t){t.spherical=e.viewingMode===Fe.JY.Global,t.doublePrecisionRequiresObfuscation=(0,Tr.I)(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetalnessAndRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?gr.N.Default:gr.N.None}initializeProgram(e){return this._initializeProgram(e,Cr.shader)}_initializeProgram(e,t){const r=t.get().build(this.configuration);return new br(e.rctx,r,he)}bindPass(e,t){this.program.bindPass(e,t);const r=this.configuration.output;this.configuration.hasModelTransformation&&((0,n.pC)(e.modelTransformation)?this.program.setUniformMatrix4fv("model",e.modelTransformation):Rr.warnOnce("hasModelTransformation true, but no modelTransformation found.")),r===Be.H.Alpha&&(this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",je.FZ[e.colorMixMode])),r===Be.H.Color&&(t.lighting.setUniforms(this.program,!1,t.enableFillLights),this.program.setUniform3fv("ambient",e.ambient),this.program.setUniform3fv("diffuse",e.diffuse),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",je.FZ[e.colorMixMode]),this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),(0,Ve.nW)(this.program,e,this.configuration.pbrMode)),(0,vr.Mo)(this.program,e,t),(0,je.bj)(e.screenSizePerspective,this.program,"screenSizePerspectiveAlignment"),function(e,t){(0,n.pC)(t.texture)&&e.bindTexture("tex",t.texture),(0,n.pC)(t.textureNormal)&&e.bindTexture("normalTexture",t.textureNormal),(0,n.pC)(t.textureEmissive)&&e.bindTexture("texEmission",t.textureEmissive),(0,n.pC)(t.textureOcclusion)&&e.bindTexture("texOcclusion",t.textureOcclusion),(0,n.pC)(t.textureMetallicRoughness)&&e.bindTexture("texMetallicRoughness",t.textureMetallicRoughness)}(this.program,e),e.textureAlphaMode!==R.JJ.Mask&&e.textureAlphaMode!==R.JJ.MaskBlend||this.program.setUniform1f("textureAlphaCutoff",e.textureAlphaCutoff),(0,n.pC)(t.shadowMap)&&t.shadowMap.bind(this.program),(0,n.pC)(t.ssaoHelper)&&t.ssaoHelper.bind(this.program,t.camera)}bindDraw(e,t){if(this.program.bindDraw(e,t),this.program.rebindTextures(),this.configuration.output===Be.H.Color){const r=this.configuration.instancedDoublePrecision?(0,u.f)(t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]):e.origin;(0,_r.EA)(this.program,t.shadowMap,r)}}_convertDepthTestFunction(e){return e===R.Gv.Lequal?j.wb.LEQUAL:j.wb.LESS}_setPipeline(e,t){const r=this.configuration,i=e===R.Am.NONE,n=e===R.Am.FrontFace;return function(e){return yt.intern(e)}({blending:r.output!==Be.H.Color&&r.output!==Be.H.Alpha||!r.transparent?null:i?Pt:It(e),culling:wr(r)&&et(r.cullFace),depthTest:{func:Ft(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:i||n?r.writeDepth&&tt:null,colorWrite:rt,stencilWrite:r.hasOccludees?Ar:null,stencilTest:r.hasOccludees?t?Sr:Er:null,polygonOffset:i||n?null:Lt(r.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._setPipeline(this.configuration.transparencyPassType,!0),this._setPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function wr(e){return e.cullFace!==R.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Cr.shader=new xr(Mr.D,(()=>r.e(9291).then(r.bind(r,79291))));var yr=r(43697);function Pr(e={}){return(t,r)=>{var i;if(t._parameterNames=null!=(i=t._parameterNames)?i:[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{var n;const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),s=null!=(n=t._parameterBits)?n:[0];let l=0;for(;s[l]+a>16;)l++,l>=s.length&&s.push(0);t._parameterBits=s;const c=s[l],u=(1<<a)-1<<c;s[l]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[l]=this._parameterBits[l]&~u|+e<<c&u,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}}class Or extends class{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}{}(0,yr._)([Pr({constValue:!0})],Or.prototype,"hasSliceHighlight",void 0),(0,yr._)([Pr({constValue:!1})],Or.prototype,"hasSliceInVertexProgram",void 0),(0,yr._)([Pr({constValue:qe.P.Draw})],Or.prototype,"slicePlaneBindType",void 0),(0,yr._)([Pr({constValue:!1})],Or.prototype,"instancedDoublePrecision",void 0);class Nr extends Or{constructor(){super(...arguments),this.output=Be.H.Color,this.alphaDiscardMode=R.JJ.Opaque,this.doubleSidedMode=Ge.q.None,this.pbrMode=Ve.f7.Disabled,this.cullFace=R.Vr.None,this.transparencyPassType=R.Am.NONE,this.normalType=Ue.h.Attribute,this.textureCoordinateType=gr.N.None,this.customDepthTest=R.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.enableFillLights=!1}}(0,yr._)([Pr({count:Be.H.COUNT})],Nr.prototype,"output",void 0),(0,yr._)([Pr({count:R.JJ.COUNT})],Nr.prototype,"alphaDiscardMode",void 0),(0,yr._)([Pr({count:Ge.q.COUNT})],Nr.prototype,"doubleSidedMode",void 0),(0,yr._)([Pr({count:Ve.f7.COUNT})],Nr.prototype,"pbrMode",void 0),(0,yr._)([Pr({count:R.Vr.COUNT})],Nr.prototype,"cullFace",void 0),(0,yr._)([Pr({count:R.Am.COUNT})],Nr.prototype,"transparencyPassType",void 0),(0,yr._)([Pr({count:Ue.h.COUNT})],Nr.prototype,"normalType",void 0),(0,yr._)([Pr({count:gr.N.COUNT})],Nr.prototype,"textureCoordinateType",void 0),(0,yr._)([Pr({count:R.Gv.COUNT})],Nr.prototype,"customDepthTest",void 0),(0,yr._)([Pr()],Nr.prototype,"spherical",void 0),(0,yr._)([Pr()],Nr.prototype,"hasVertexColors",void 0),(0,yr._)([Pr()],Nr.prototype,"hasSymbolColors",void 0),(0,yr._)([Pr()],Nr.prototype,"hasVerticalOffset",void 0),(0,yr._)([Pr()],Nr.prototype,"hasSlicePlane",void 0),(0,yr._)([Pr()],Nr.prototype,"hasSliceHighlight",void 0),(0,yr._)([Pr()],Nr.prototype,"hasColorTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasMetalnessAndRoughnessTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasEmissionTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasOcclusionTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasNormalTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasScreenSizePerspective",void 0),(0,yr._)([Pr()],Nr.prototype,"hasVertexTangents",void 0),(0,yr._)([Pr()],Nr.prototype,"hasOccludees",void 0),(0,yr._)([Pr()],Nr.prototype,"hasMultipassTerrain",void 0),(0,yr._)([Pr()],Nr.prototype,"hasModelTransformation",void 0),(0,yr._)([Pr()],Nr.prototype,"offsetBackfaces",void 0),(0,yr._)([Pr()],Nr.prototype,"vvSize",void 0),(0,yr._)([Pr()],Nr.prototype,"vvColor",void 0),(0,yr._)([Pr()],Nr.prototype,"receiveShadows",void 0),(0,yr._)([Pr()],Nr.prototype,"receiveAmbientOcclusion",void 0),(0,yr._)([Pr()],Nr.prototype,"textureAlphaPremultiplied",void 0),(0,yr._)([Pr()],Nr.prototype,"instanced",void 0),(0,yr._)([Pr()],Nr.prototype,"instancedColor",void 0),(0,yr._)([Pr()],Nr.prototype,"instancedDoublePrecision",void 0),(0,yr._)([Pr()],Nr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,yr._)([Pr()],Nr.prototype,"writeDepth",void 0),(0,yr._)([Pr()],Nr.prototype,"transparent",void 0),(0,yr._)([Pr()],Nr.prototype,"enableOffset",void 0),(0,yr._)([Pr()],Nr.prototype,"cullAboveGround",void 0),(0,yr._)([Pr()],Nr.prototype,"enableFillLights",void 0),(0,yr._)([Pr({constValue:!0})],Nr.prototype,"hasVvInstancing",void 0),(0,yr._)([Pr({constValue:!1})],Nr.prototype,"useCustomDTRExponentForWater",void 0),(0,yr._)([Pr({constValue:!1})],Nr.prototype,"supportsTextureAtlas",void 0);var Ir=r(41846);class Dr extends Cr{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetalnessAndRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Ue.h.Attribute,t.doubleSidedMode=Ge.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Dr.shader)}}Dr.shader=new xr(Ir.R,(()=>r.e(8096).then(r.bind(r,38096))));class Lr extends Ke{constructor(e){super(e,Hr),this.supportsEdges=!0,this.techniqueConfig=new Nr,this.vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,He.U$)().vec3f(F.T.POSITION).vec3f(F.T.NORMAL);return e.hasVertexTangents&&r.vec4f(F.T.TANGENT),t&&r.vec2f(F.T.UV0),e.hasVertexColors&&r.vec4u8(F.T.COLOR),e.hasSymbolColors&&r.vec4u8(F.T.SYMBOLCOLOR),r}(this.parameters),this.instanceBufferLayout=e.instanced?function(e){let t=(0,He.U$)();return t=e.instancedDoublePrecision?t.vec3f(F.T.MODELORIGINHI).vec3f(F.T.MODELORIGINLO).mat3f(F.T.MODEL).mat3f(F.T.MODELNORMAL):t.mat4f(F.T.MODEL).mat4f(F.T.MODELNORMAL),e.instanced&&e.instanced.indexOf("color")>-1&&(t=t.vec4f(F.T.INSTANCECOLOR)),e.instanced&&e.instanced.indexOf("featureAttribute")>-1&&(t=t.vec4f(F.T.INSTANCEFEATUREATTRIBUTE)),t}(this.parameters):null}isVisibleInPass(e){return e!==Ut.C.MATERIAL_DEPTH_SHADOWMAP_ALL&&e!==Ut.C.MATERIAL_DEPTH_SHADOWMAP_DEFAULT&&e!==Ut.C.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{instanced:t,hasVertexColors:r,hasSymbolColors:i,vvColorEnabled:n}=e,o=!!t&&t.indexOf("color")>-1,a="replace"===e.colorMixMode,s=e.opacity>0,l=e.externalColor&&e.externalColor[3]>0;return r&&(o||n||i)?!!a||s:r?a?l:s:o||n||i?!!a||s:a?l:s}getConfiguration(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.hasNormalTexture=!!this.parameters.normalTextureId,this.techniqueConfig.hasColorTexture=!!this.parameters.textureId,this.techniqueConfig.hasVertexTangents=this.parameters.hasVertexTangents,this.techniqueConfig.instanced=!!this.parameters.instanced,this.techniqueConfig.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.hasVerticalOffset=null!==this.parameters.verticalOffset,this.techniqueConfig.hasScreenSizePerspective=null!==this.parameters.screenSizePerspective,this.techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this.techniqueConfig.hasSliceHighlight=this.parameters.hasSliceHighlight,this.techniqueConfig.alphaDiscardMode=this.parameters.textureAlphaMode,this.techniqueConfig.normalType="screenDerivative"===this.parameters.normals?Ue.h.ScreenDerivative:Ue.h.Attribute,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,(0,n.pC)(this.parameters.customDepthTest)&&(this.techniqueConfig.customDepthTest=this.parameters.customDepthTest),this.techniqueConfig.hasOccludees=this.parameters.hasOccludees,this.techniqueConfig.cullFace=this.parameters.hasSlicePlane?R.Vr.None:this.parameters.cullFace,this.techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this.techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this.techniqueConfig.hasModelTransformation=(0,n.pC)(this.parameters.modelTransformation),e!==Be.H.Color&&e!==Be.H.Alpha||(this.techniqueConfig.hasVertexColors=this.parameters.hasVertexColors,this.techniqueConfig.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this.techniqueConfig.doubleSidedMode=Ge.q.WindingOrder:this.techniqueConfig.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ge.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ge.q.WindingOrder:Ge.q.None,this.techniqueConfig.instancedColor=!!this.parameters.instanced&&this.parameters.instanced.indexOf("color")>-1,this.techniqueConfig.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this.techniqueConfig.receiveAmbientOcclusion=(r=t,!(!(0,n.pC)(r.ssaoHelper)||!r.ssaoHelper.enabled)&&this.parameters.receiveSSAO),this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this.techniqueConfig.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Ve.f7.Schematic:Ve.f7.Normal:Ve.f7.Disabled,this.techniqueConfig.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this.techniqueConfig.hasEmissionTexture=!!this.parameters.emissiveTextureId,this.techniqueConfig.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this.techniqueConfig.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<5e5),this.techniqueConfig;var r}intersect(e,t,r,i,o,a,s){if(null!==this.parameters.verticalOffset){const e=i.camera;(0,c.s)(qr,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case Fe.JY.Global:t=(0,c.n)(Vr,qr);break;case Fe.JY.Local:t=(0,c.c)(Vr,Gr)}let n=0;if(null!==this.parameters.verticalOffset){const r=(0,c.b)(kr,qr,e.eye),i=(0,c.l)(r),o=(0,c.g)(r,r,1/i);let a=null;this.parameters.screenSizePerspective&&(a=(0,c.e)(t,o)),n+=(0,je.Hx)(e,i,this.parameters.verticalOffset,a,this.parameters.screenSizePerspective)}(0,c.g)(t,t,n),(0,c.t)(Wr,t,i.transform.inverseRotation),o=(0,c.b)(Ur,o,Wr),a=(0,c.b)(zr,a,Wr)}var l;(0,je.Bw)(e,t,i,o,a,(l=i.verticalOffset,(0,n.pC)(l)?(lr.offset=l,lr):null),s)}requiresSlot(e){return e===(this.parameters.transparent?this.parameters.writeDepth?ke.r.TRANSPARENT_MATERIAL:ke.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:ke.r.OPAQUE_MATERIAL)||e===ke.r.DRAPED_MATERIAL}createGLMaterial(e){return e.output===Be.H.Color||e.output===Be.H.Alpha||e.output===Be.H.Depth||e.output===Be.H.Normal||e.output===Be.H.Shadow||e.output===Be.H.Highlight?new Fr(e):null}createBufferWriter(){return new Br(this.vertexBufferLayout,this.instanceBufferLayout)}}class Fr extends class extends class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(r,t),this._technique),this._technique}ensureResources(e){return R.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,n.RY)(this._texture),this._textureNormal=(0,n.RY)(this._textureNormal),this._textureEmissive=(0,n.RY)(this._textureEmissive),this._textureOcclusion=(0,n.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,n.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?R.Rw.LOADED:R.Rw.LOADING}get passParameters(){return{texture:(0,n.pC)(this._texture)?this._texture.glTexture:null,textureNormal:(0,n.pC)(this._textureNormal)?this._textureNormal.glTexture:null,textureEmissive:(0,n.pC)(this._textureEmissive)?this._textureEmissive.glTexture:null,textureOcclusion:(0,n.pC)(this._textureOcclusion)?this._textureOcclusion.glTexture:null,textureMetallicRoughness:(0,n.pC)(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null}}updateTexture(e){((0,n.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,n.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if((0,n.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,E.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,n.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const t=this._material.parameters;return this.updateTexture(t.textureId),this._material.setParameters(this.passParameters),this.ensureTechnique(t.treeRendering?Dr:Cr,e)}_updateShadowState(e){Xe(e)!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:Xe(e)})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==Be.H.Color&&this._output!==Be.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}const Hr={textureId:void 0,initTextureTransparent:!1,isSchematic:!1,usePBR:!1,normalTextureId:void 0,hasVertexTangents:!1,occlusionTextureId:void 0,emissiveTextureId:void 0,metallicRoughnessTextureId:void 0,emissiveFactor:[0,0,0],mrrFactors:[0,1,.5],ambient:[.2,.2,.2],diffuse:[.8,.8,.8],externalColor:[1,1,1,1],colorMixMode:"multiply",opacity:1,layerOpacity:1,hasVertexColors:!1,hasSymbolColors:!1,doubleSided:!1,doubleSidedType:"normal",cullFace:R.Vr.Back,instanced:void 0,instancedDoublePrecision:!1,normals:"default",receiveSSAO:!0,enableFillLights:!0,receiveShadows:!0,castShadows:!0,shadowMappingEnabled:!1,verticalOffset:null,screenSizePerspective:null,hasSlicePlane:!1,hasSliceHighlight:!0,offsetTransparentBackfaces:!1,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvSizeValue:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],vvSymbolAnchor:[0,0,0],vvSymbolRotationMatrix:(0,a.c)(),modelTransformation:null,transparent:!1,writeDepth:!0,customDepthTest:R.Gv.Less,textureAlphaMode:R.JJ.Blend,textureAlphaCutoff:We.F,textureAlphaPremultiplied:!1,hasOccludees:!1,...new ze.d4,...Ye};class Br{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(F.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,n,o){for(const a of t.fieldNames){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case F.T.POSITION:{(0,w.hu)(3===t.size);const e=n.getField(a,h.ct);e&&hr(s,t.data,r,e,o);break}case F.T.NORMAL:{(0,w.hu)(3===t.size);const e=n.getField(a,h.ct);e&&fr(s,t.data,i,e,o);break}case F.T.UV0:{(0,w.hu)(2===t.size);const e=n.getField(a,h.Eu);e&&ur(s,t.data,e,o);break}case F.T.COLOR:{(0,w.hu)(3===t.size||4===t.size);const e=n.getField(a,h.mc);e&&pr(s,t.data,t.size,e,o);break}case F.T.SYMBOLCOLOR:{(0,w.hu)(3===t.size||4===t.size);const e=n.getField(a,h.mc);e&&pr(s,t.data,t.size,e,o);break}case F.T.TANGENT:{(0,w.hu)(4===t.size);const e=n.getField(a,h.ek);e&&mr(s,t.data,i,e,o);break}}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const Ur=(0,u.c)(),zr=(0,u.c)(),Gr=(0,u.f)(0,0,1),Vr=(0,u.c)(),Wr=(0,u.c)(),qr=(0,u.c)(),kr=(0,u.c)(),Xr=A.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function $r(e){throw new b.Z("",`Request for object resource failed: ${e}`)}function jr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Xr.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Xr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Xr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Xr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Xr.warn("Indexed geometries must specify faces"),i=!1;break}default:Xr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Xr.warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(Xr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Kr(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,n.pC)(r)&&((0,d.pp)(t,r.getBBMin()),(0,d.pp)(t,r.getBBMax()))})),t}async function Yr(e,t){const r=[];for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Xr.warn("Externally referenced texture data is not yet supported");continue}const s=o.encoding+";base64,"+a,l="/textureDefinitions/"+i,c="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",u={noUnpackFlip:!0,wrap:{s:j.e8.REPEAT,t:j.e8.REPEAT},preMultiplyAlpha:Zr(c)!==R.JJ.Opaque},d=(0,n.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(d.then((e=>({refId:l,image:e,params:u,alphaChannelUsage:c}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}function Zr(e){switch(e){case"mask":return R.JJ.Mask;case"maskAndTransparency":return R.JJ.MaskBlend;case"none":return R.JJ.Opaque;default:return R.JJ.Blend}}function Jr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Qr=new S.G(1,2,"wosr");var ei=r(57758),ti=r(10816),ri=r(75488),ii=r(56067);async function ni(e,t){const r=oi((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,n.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,x.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,E.r9)(i.error),$r(i.error.details.url)}(e,r,t);const i=await(0,x.q6)((0,T.default)(e,(0,n.Wg)(t)));if(!0===i.ok)return i.value.data;(0,E.r9)(i.error),$r(i.error)}(e,t);return{resource:r,textures:await Yr(r.textureDefinitions,t)}}(r.url,t)),i=function(e,t){const r=[],i=[],o=[],a=[],s=e.resource,l=S.G.parse(s.version||"1.0","wosr");Qr.validate(l);const c=s.model.name,d=s.model.geometries,h=s.materialDefinitions,f=e.textures;let m=0;const p=new Map;for(let e=0;e<d.length;e++){const s=d[e];if(!jr(s))continue;const l=Jr(s),c=s.params.vertexAttributes,g=[];for(const e in c){const t=c[e],r=t.values;g.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const v=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)v.push([t,new Uint32Array(e[t].values)])}const _=f&&f[l.texture];if(_&&!p.has(l.texture)){const{image:e,params:t}=_,r=new Le(e,t);a.push(r),p.set(l.texture,r)}const T=p.get(l.texture),x=T?T.id:void 0;let b=o[l.material]?o[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,a=_?Zr(_.alphaChannelUsage):void 0,s={ambient:(0,u.d)(e.diffuse),diffuse:(0,u.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:a,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:R.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!_&&!!_.params.preMultiplyAlpha};(0,n.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new Lr(s),o[l.material]||(o[l.material]={}),o[l.material][l.texture]=b}i.push(b);const A=new H(g,v);m+=v.position?v.position.length:0,r.push(A)}return{name:c,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:Kr(r),numberOfVertices:m,lodThreshold:null}}(e,t);return{lods:[i],referenceBoundingBox:i.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const o=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,v.z)(new g.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,n.U2)(o.model.meta,"ESRI_proxyEllipsoid");o.meta.isEsriSymbolResource&&(0,n.pC)(a)&&-1!==o.meta.uri.indexOf("/RealisticTrees/")&&function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const o of i.parts){const i=o.attributes.normal;if((0,n.Wi)(i))return;const a=o.attributes.position,d=a.count,f=(0,u.c)(),m=(0,u.c)(),g=(0,u.c)(),v=(0,p.gS)(h.mc,d),_=(0,p.gS)(h.ct,d),T=(0,s.a)((0,l.c)(),o.transform);for(let n=0;n<d;n++){a.getVec(n,m),i.getVec(n,f),(0,c.m)(m,m,o.transform),(0,c.b)(g,m,t.center),(0,c.E)(g,g,t.radius);const s=g[2],l=(0,c.l)(g),u=Math.min(.45+.55*l*l,1);(0,c.E)(g,g,t.radius),(0,c.m)(g,g,T),(0,c.n)(g,g),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(g,g,f,s>-1?.2:Math.min(-4*s-3.8,1)),_.setVec(n,g),v.set(n,0,255*u),v.set(n,1,255*u),v.set(n,2,255*u),v.set(n,3,255)}o.attributes.normal=_,o.attributes.color=v}}}(o,a);const d=o.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:o.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:o.customMeta.esriTreeRendering};if(null!=r.specifiedLodIndex){const e=ai(o,d,f,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=ai(o,d,f,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1,remove:o.remove}}const m=ai(o,d,f);return{lods:m,referenceBoundingBox:m[0].boundingBox,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1,remove:o.remove}}function oi(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function ai(e,t,r,i){const s=e.model,l=(0,a.c)(),c=new Array,u=new Map,g=new Map;return s.lods.forEach(((e,a)=>{if(void 0!==i&&a!==i)return;const v={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,n.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,d.cS)()};c.push(v),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=s.materials.get(e.material),c=(0,n.pC)(e.attributes.texCoord0),T=(0,n.pC)(e.attributes.normal),x=function(e){switch(e){case"BLEND":return R.JJ.Blend;case"MASK":return R.JJ.Mask;case"OPAQUE":case null:case void 0:return R.JJ.Opaque}}(a.alphaMode);if(!u.has(i)){if(c){if((0,n.pC)(a.textureColor)&&!g.has(a.textureColor)){const e=s.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:x!==R.JJ.Opaque};g.set(a.textureColor,new Le(e.data,t))}if((0,n.pC)(a.textureNormal)&&!g.has(a.textureNormal)){const e=s.textures.get(a.textureNormal);g.set(a.textureNormal,new Le(e.data,e.parameters))}if((0,n.pC)(a.textureOcclusion)&&!g.has(a.textureOcclusion)){const e=s.textures.get(a.textureOcclusion);g.set(a.textureOcclusion,new Le(e.data,e.parameters))}if((0,n.pC)(a.textureEmissive)&&!g.has(a.textureEmissive)){const e=s.textures.get(a.textureEmissive);g.set(a.textureEmissive,new Le(e.data,e.parameters))}if((0,n.pC)(a.textureMetallicRoughness)&&!g.has(a.textureMetallicRoughness)){const e=s.textures.get(a.textureMetallicRoughness);g.set(a.textureMetallicRoughness,new Le(e.data,e.parameters))}}const o=a.color[0]**(1/ei.K),l=a.color[1]**(1/ei.K),d=a.color[2]**(1/ei.K),h=a.emissiveFactor[0]**(1/ei.K),f=a.emissiveFactor[1]**(1/ei.K),m=a.emissiveFactor[2]**(1/ei.K),p=(0,n.pC)(a.textureColor)&&c?g.get(a.textureColor):null;u.set(i,new Lr({...t,transparent:x===R.JJ.Blend,customDepthTest:R.Gv.Lequal,textureAlphaMode:x,textureAlphaCutoff:a.alphaCutoff,diffuse:[o,l,d],ambient:[o,l,d],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?R.Vr.None:R.Vr.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:T?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,enableFillLights:!0,textureId:(0,n.pC)(p)?p.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:(0,n.pC)(a.textureNormal)&&c?g.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:(0,n.pC)(p)&&!!p.params.preMultiplyAlpha,occlusionTextureId:(0,n.pC)(a.textureOcclusion)&&c?g.get(a.textureOcclusion).id:void 0,emissiveTextureId:(0,n.pC)(a.textureEmissive)&&c?g.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,n.pC)(a.textureMetallicRoughness)&&c?g.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,m],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...r}))}const b=function(e,t){switch(t){case j.MX.TRIANGLES:return(0,_.nh)(e);case j.MX.TRIANGLE_STRIP:return(0,_.DA)(e);case j.MX.TRIANGLE_FAN:return(0,_.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),A=e.attributes.position.count,E=(0,p.gS)(h.ct,A);(0,f.t)(E,e.attributes.position,e.transform);const S=[[F.T.POSITION,{data:E.typedBuffer,size:E.elementCount,exclusive:!0}]],M=[[F.T.POSITION,b]];if((0,n.pC)(e.attributes.normal)){const t=(0,p.gS)(h.ct,A);(0,o.a)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([F.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([F.T.NORMAL,b])}if((0,n.pC)(e.attributes.tangent)){const t=(0,p.gS)(h.ek,A);(0,o.a)(l,e.transform),(0,m.t)(t,e.attributes.tangent,l),S.push([F.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([F.T.TANGENT,b])}if((0,n.pC)(e.attributes.texCoord0)){const t=(0,p.gS)(h.Eu,A);(0,ti.n)(t,e.attributes.texCoord0),S.push([F.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([F.T.UV0,b])}if((0,n.pC)(e.attributes.color)){const t=(0,p.gS)(h.mc,A);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,m.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,ri.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,m.s)(t,e.attributes.color,1/256);else{(0,ri.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,ii.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([F.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([F.T.COLOR,b])}const C=new H(S,M);v.stageResources.geometries.push(C),v.stageResources.materials.push(u.get(i)),c&&((0,n.pC)(a.textureColor)&&v.stageResources.textures.push(g.get(a.textureColor)),(0,n.pC)(a.textureNormal)&&v.stageResources.textures.push(g.get(a.textureNormal)),(0,n.pC)(a.textureOcclusion)&&v.stageResources.textures.push(g.get(a.textureOcclusion)),(0,n.pC)(a.textureEmissive)&&v.stageResources.textures.push(g.get(a.textureEmissive)),(0,n.pC)(a.textureMetallicRoughness)&&v.stageResources.textures.push(g.get(a.textureMetallicRoughness))),v.numberOfVertices+=A;const w=C.boundingInfo;(0,n.pC)(w)&&((0,d.pp)(v.boundingBox,w.getBBMin()),(0,d.pp)(v.boundingBox,w.getBBMax()))}))})),c}},6206:(e,t,r)=>{var i,n;r.d(t,{a9:()=>i}),r(22021),(n=i||(i={}))[n.Multiply=1]="Multiply",n[n.Ignore=2]="Ignore",n[n.Replace=3]="Replace",n[n.Tint=4]="Tint"},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),n=r(79583);class o{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new o(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}}}class a{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,n.n1)(t.ElementType),o=this.stride;this.fields.set(e,{size:i,constructor:t,offset:o,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.indexOf(e)>=0}createBuffer(e){return new o(this,e)}createView(e){return new o(this,e)}clone(){const e=new a;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new a}},1391:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(18361),n=r(57220),o=r(74709),a=r(67498);function s(e,t){t.output===i.H.Color&&t.receiveShadows?(e.varyings.add("linearDepth","float"),e.vertex.code.add(o.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`)):t.output===i.H.Depth||t.output===i.H.Shadow?(e.varyings.add("linearDepth","float"),e.vertex.uniforms.add(new n.e("nearFar",a.P.Pass,((e,t)=>t.camera.nearFar))),e.vertex.code.add(o.H`void forwardLinearDepth() {
160
- linearDepth = (-position_view().z - nearFar[0]) / (nearFar[1] - nearFar[0]);
161
- }`)):e.vertex.code.add(o.H`void forwardLinearDepth() {}`)}},62707:(e,t,r)=>{r.d(t,{w:()=>n});var i=r(74709);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
159
+ `)),t.include(p.s,e),t}const F=Object.freeze(Object.defineProperty({__proto__:null,build:L},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>n,i:()=>c,t:()=>o});var i=r(46851);function n(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 o(e,t){if(e===t){const r=t[1],i=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1],m=r[2],p=r[3],g=r[4],v=r[5],_=r[6],T=r[7],x=r[8];return e[0]=h*i+f*a+m*c,e[1]=h*n+f*s+m*u,e[2]=h*o+f*l+m*d,e[3]=p*i+g*a+v*c,e[4]=p*n+g*s+v*u,e[5]=p*o+g*l+v*d,e[6]=_*i+T*a+x*c,e[7]=_*n+T*s+x*u,e[8]=_*o+T*l+x*d,e}function s(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],f=t[11],m=t[12],p=t[13],g=t[14],v=t[15],_=r*s-i*a,T=r*l-n*a,x=r*c-o*a,b=i*l-n*s,A=i*c-o*s,E=n*c-o*l,S=u*p-d*m,M=u*g-h*m,R=u*v-f*m,C=d*g-h*p,w=d*v-f*p,y=h*v-f*g;let P=_*y-T*w+x*C+b*R-A*M+E*S;return P?(P=1/P,e[0]=(s*y-l*w+c*C)*P,e[1]=(l*R-a*y-c*M)*P,e[2]=(a*w-s*R+c*S)*P,e[3]=(n*w-i*y-o*C)*P,e[4]=(r*y-n*R+o*M)*P,e[5]=(i*R-r*w-o*S)*P,e[6]=(p*E-g*A+v*b)*P,e[7]=(g*x-m*E-v*T)*P,e[8]=(m*A-p*x+v*_)*P,e):null}function l(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function c(e){const t=i.E,r=e[0],n=e[1],o=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-(n*n+s*s+u*u))<=t&&Math.abs(1-(o*o+l*l+d*d))<=t}const u=a,d=l;Object.freeze(Object.defineProperty({__proto__:null,fromMat4:n,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},set:function(e,t,r,i,n,o,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:o,invert:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l;let m=r*d+i*h+n*f;return m?(m=1/m,e[0]=d*m,e[1]=(-u*i+n*c)*m,e[2]=(s*i-n*a)*m,e[3]=h*m,e[4]=(u*r-n*l)*m,e[5]=(-s*r+n*o)*m,e[6]=f*m,e[7]=(-c*r+i*l)*m,e[8]=(a*r-i*o)*m,e):null},adjoint:function(e,t){const r=t[0],i=t[1],n=t[2],o=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]=n*c-i*u,e[2]=i*s-n*a,e[3]=s*l-o*u,e[4]=r*u-n*l,e[5]=n*o-r*s,e[6]=o*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*o,e},determinant:function(e){const t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*o-a*l)+r*(-c*n+a*s)+i*(l*n-o*s)},multiply:a,translate:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+f*a+c,e[7]=h*n+f*s+u,e[8]=h*o+f*l+d,e},rotate:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(r),f=Math.cos(r);return e[0]=f*i+h*a,e[1]=f*n+h*s,e[2]=f*o+h*l,e[3]=f*a-h*i,e[4]=f*s-h*n,e[5]=f*l-h*o,e[6]=c,e[7]=u,e[8]=d,e},scale:function(e,t,r){const i=r[0],n=r[1],o=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=o*t[6],e[7]=o*t[7],e[8]=o*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromQuat:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=r+r,s=i+i,l=n+n,c=r*a,u=i*a,d=i*s,h=n*a,f=n*s,m=n*l,p=o*a,g=o*s,v=o*l;return e[0]=1-d-m,e[3]=u-v,e[6]=h+g,e[1]=u+v,e[4]=1-c-m,e[7]=f-p,e[2]=h-g,e[5]=f+p,e[8]=1-c-d,e},normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l,m=r*d+i*h+n*f;if(!m)return null;const p=1/m;return e[0]=d*p,e[1]=(-u*i+n*c)*p,e[2]=(s*i-n*a)*p,e[3]=h*p,e[4]=(u*r-n*l)*p,e[5]=(-s*r+n*o)*p,e[6]=f*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*o)*p,e},normalFromMat4:s,projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},subtract:l,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},equals:function(e,t){const r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=t[0],f=t[1],m=t[2],p=t[3],g=t[4],v=t[5],_=t[6],T=t[7],x=t[8];return Math.abs(r-h)<=i.E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-f)<=i.E*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-m)<=i.E*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-p)<=i.E*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-g)<=i.E*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=i.E*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(c-_)<=i.E*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-T)<=i.E*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(d-x)<=i.E*Math.max(1,Math.abs(d),Math.abs(x))},isOrthoNormal:c,mul:u,sub:d},Symbol.toStringTag,{value:"Module"}))},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function n(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>n,c:()=>i}),Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},fromValues:function(e,t,r,i,n,o,a,s,l){return[e,t,r,i,n,o,a,s,l]},createView:n},Symbol.toStringTag,{value:"Module"}))},13598:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}function o(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>a,a:()=>o,b:()=>n,c:()=>i});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:n,fromValues:function(e,t,r,i,n,o,a,s,l,c,u,d,h,f,m,p){return[e,t,r,i,n,o,a,s,l,c,u,d,h,f,m,p]},createView:o,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{c:()=>f,g:()=>u,j:()=>w,k:()=>p,m:()=>d,s:()=>c});var i=r(46521),n=r(94961),o=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>a.E?(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],n=t[1],o=t[2],a=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+a*s+n*c-o*l,e[1]=n*u+a*l+o*s-i*c,e[2]=o*u+a*c+i*l-n*s,e[3]=a*u-i*s-n*l-o*c,e}function h(e,t,r,i){const n=t[0],o=t[1],s=t[2],l=t[3];let c,u,d,h,f,m=r[0],p=r[1],g=r[2],v=r[3];return u=n*m+o*p+s*g+l*v,u<0&&(u=-u,m=-m,p=-p,g=-g,v=-v),1-u>a.E?(c=Math.acos(u),d=Math.sin(c),h=Math.sin((1-i)*c)/d,f=Math.sin(i*c)/d):(h=1-i,f=i),e[0]=h*n+f*m,e[1]=h*o+f*p,e[2]=h*s+f*g,e[3]=h*l+f*v,e}function f(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function m(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const n=(r+1)%3,o=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*n+n]-t[3*o+o]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*n+o]-t[3*o+n])*i,e[n]=(t[3*n+r]+t[3*r+n])*i,e[o]=(t[3*o+r]+t[3*r+o])*i}return e}function p(e,t,r,i){const n=.5*Math.PI/180;t*=n,r*=n,i*=n;const o=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]=o*l*u-a*s*c,e[1]=a*s*u+o*l*c,e[2]=a*l*c-o*s*u,e[3]=a*l*u+o*s*c,e}const g=l.c,v=l.s,_=l.a,T=d,x=l.b,b=l.d,A=l.l,E=l.e,S=E,M=l.f,R=M,C=l.n,w=l.g,y=l.h,P=(0,o.c)(),O=(0,o.f)(1,0,0),N=(0,o.f)(0,1,0),I=(0,n.a)(),D=(0,n.a)(),L=(0,i.c)();Object.freeze(Object.defineProperty({__proto__:null,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},setAxisAngle:c,getAxisAngle:u,multiply:d,rotateX:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=n*l+o*s,e[2]=o*l-n*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-o*s,e[1]=n*l+a*s,e[2]=o*l+i*s,e[3]=a*l-n*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*s,e[1]=n*l-i*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},calculateW:function(e,t){const r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e},slerp:h,random:function(e){const t=(0,a.R)(),r=(0,a.R)(),i=(0,a.R)(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*r),e[1]=n*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},invert:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=r*r+i*i+n*n+o*o,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-n*s,e[3]=o*s,e},conjugate:f,fromMat3:m,fromEuler:p,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},copy:g,set:v,add:_,mul:T,scale:x,dot:b,lerp:A,length:E,len:S,squaredLength:M,sqrLen:R,normalize:C,exactEquals:w,equals:y,rotationTo:function(e,t,r){const i=(0,s.e)(t,r);return i<-.999999?((0,s.f)(P,O,t),(0,s.u)(P)<1e-6&&(0,s.f)(P,N,t),(0,s.n)(P,P),c(e,P,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.f)(P,t,r),e[0]=P[0],e[1]=P[1],e[2]=P[2],e[3]=1+i,C(e,e))},sqlerp:function(e,t,r,i,n,o){return h(I,t,n,o),h(D,r,i,o),h(e,I,D,2*o*(1-o)),e},setAxes:function(e,t,r,i){const n=L;return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-t[0],n[5]=-t[1],n[8]=-t[2],C(e,m(e,n))}},Symbol.toStringTag,{value:"Module"}))},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3]]}function o(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>a,a:()=>i,b:()=>n,c:()=>o});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:n,fromValues:function(e,t,r,i){return[e,t,r,i]},createView:o,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>l,n:()=>s,s:()=>a,t:()=>n});var i=r(72220);function n(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.count,o=r[0],a=r[1],s=r[2],l=r[4],c=r[5],u=r[6],d=r[8],h=r[9],f=r[10],m=r[12],p=r[13],g=r[14],v=e.typedBuffer,_=e.typedBufferStride,T=t.typedBuffer,x=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*_,r=e*x,i=T[r],n=T[r+1],b=T[r+2];v[t]=o*i+l*n+d*b+m,v[t+1]=a*i+c*n+h*b+p,v[t+2]=s*i+u*n+f*b+g}}function o(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.count,o=r[0],a=r[1],s=r[2],l=r[3],c=r[4],u=r[5],d=r[6],h=r[7],f=r[8],m=e.typedBuffer,p=e.typedBufferStride,g=t.typedBuffer,v=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*p,r=e*v,i=g[r],n=g[r+1],_=g[r+2];m[t]=o*i+l*n+d*_,m[t+1]=a*i+c*n+h*_,m[t+2]=s*i+u*n+f*_}}function a(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*o,i=e*s;n[t]=r*a[i],n[t+1]=r*a[i+1],n[t+2]=r*a[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*n,r=e*a,s=o[r],l=o[r+1],c=o[r+2],u=s*s+l*l+c*c;if(u>0){const e=1/Math.sqrt(u);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*o,i=e*s;n[t]=a[i]>>r,n[t+1]=a[i+1]>>r,n[t+2]=a[i+2]>>r}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:n,transformMat3:o,scale:a,normalize:s,shiftRight:l},Symbol.toStringTag,{value:"Module"}))},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*n,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<s;++e)i[l]=o[c],i[l+1]=o[c+1],i[l+2]=o[c+2],l+=n,c+=a}function n(e,t,r,i,n){var o,a;const s=e.typedBuffer,l=e.typedBufferStride,c=null!=(o=null==n?void 0:n.count)?o:e.count;let u=(null!=(a=null==n?void 0:n.dstIndex)?a:0)*l;for(let e=0;e<c;++e)s[u]=t,s[u+1]=r,s[u+2]=i,u+=l}r.d(t,{c:()=>i,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,fill:n},Symbol.toStringTag,{value:"Module"}))},72119:(e,t,r)=>{function i(){return new Float32Array(3)}function n(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function o(){return i()}function a(){return n(1,1,1)}function s(){return n(1,0,0)}function l(){return n(0,1,0)}function c(){return n(0,0,1)}r.d(t,{c:()=>i,f:()=>n});const u=o(),d=a(),h=s(),f=l(),m=c();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:n,createView:function(e,t){return new Float32Array(e,t,3)},zeros:o,ones:a,unitX:s,unitY:l,unitZ:c,ZEROS:u,ONES:d,UNIT_X:h,UNIT_Y:f,UNIT_Z:m},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>{var r;return null!=(null==(r=e)?void 0:r.match(t))}))}function n(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(o)||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:()=>n});const o=/^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$/,o,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")},61190:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>ni,gltfToEngineResources:()=>ai,parseUrl:()=>oi});var i=r(32243),n=r(70586),o=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),u=r(65617),d=r(60437),h=r(56481),f=r(20773),m=r(11077),p=r(8323),g=r(40270),v=r(88246),_=r(91911),T=r(3172),x=r(66643),b=r(20102),A=r(92604),E=r(95330),S=r(23670);async function M(e,t){const{data:r}=await(0,T.default)(e,{responseType:"image",...t});return r}var R=r(47026),C=r(44553),w=r(11726);class y{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,u.c)(),(0,w.hu)(e.length>=1),(0,w.hu)(r.length%this._numIndexPerPrimitive==0),(0,w.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,w.hu)(3===i.size||4===i.size);const{data:n,size:o}=i,a=e.length;let s=o*r[this._numIndexPerPrimitive*e[0]];P.clear(),P.push(s),this.bbMin=(0,u.f)(n[s],n[s+1],n[s+2]),this.bbMax=(0,u.a)(this.bbMin);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=o*r[i+e],P.push(s);let t=n[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=n[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=n[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.h)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<P.length;++e){s=P.getItemAt(e);const t=n[s]-this.center[0],r=n[s+1]-this.center[1],i=n[s+2]-this.center[2],o=t*t+r*r+i*i;if(o<=l)continue;const a=Math.sqrt(o),c=.5*(a-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const u=c/a;this.center[0]+=t*u,this.center[1]+=r*u,this.center[2]+=i*u}P.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.d)(this.bbMin,this.bbMax)>1){const e=(0,c.h)((0,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:o}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=o*this.indices[s],c=n[l],u=n[l+1],d=n[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=o*this.indices[s+e];const t=n[l],r=n[l+1],i=n[l+2];t<c&&(c=t),r<u&&(u=r),i<d&&(d=i)}c<e[0]&&(t|=1),u<e[1]&&(t|=2),d<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new y(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){P.prune()}}const P=new C.Z({deallocator:null});var O,N,I=r(99001);class D{constructor(){this.id=(0,I.D)()}unload(){}}(N=O||(O={}))[N.Layer=0]="Layer",N[N.Object=1]="Object",N[N.Geometry=2]="Geometry",N[N.Material=3]="Material",N[N.Texture=4]="Texture",N[N.COUNT=5]="COUNT";var L=r(64291),F=r(35065);class H extends D{constructor(e,t=[],r=R.MX.Triangle,i=-1){super(),this._primitiveType=r,this.edgeIndicesLength=i,this.type=O.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,L.p)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,r]of t)r&&(this._indices.set(e,B(r)),e===F.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}cloneShallow(){const e=new H([],void 0,this._primitiveType,void 0),{_vertexAttributes:t,_indices:r}=e;return this._vertexAttributes.forEach(((e,r)=>{t.set(r,e)})),this._indices.forEach(((e,t)=>{r.set(t,e)})),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,n.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===R.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(F.T.POSITION),r=this.vertexAttributes.get(F.T.POSITION);return(0,L.cM)(r,t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(F.T.POSITION),r=this.vertexAttributes.get(F.T.POSITION);return(0,L.NO)(r,t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(F.T.POSITION);if(0===e.length)return null;const t=this.primitiveType===R.MX.Triangle?3:1;(0,w.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,L.p)(e.length/t),i=this.vertexAttributes.get(F.T.POSITION);return new y(r,t,e,i)}}function B(e){if(e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return e;for(const t of e)if(t>=65536)return e;return new Uint16Array(e)}var U=r(74085),z=r(32448),G=r(22021),V=r(1533),W=r(17452),q=r(85958),k=r(99880);let X;var $;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}($||($={}));var j=r(35371),K=r(75656);function Y(e,t,r,i,n=0){const o=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=n*e.stride;if(e.count<=4)o.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),o.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)o.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),o.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)o.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),o.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function Z(e,t,r,i){const n=e.gl,o=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)n.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(j.w0.ARRAY_BUFFER)}function J(e){switch(e){case j.VI.ALPHA:case j.VI.LUMINANCE:case j.VI.RED:case j.VI.RED_INTEGER:case j.lP.R8:case j.lP.R8I:case j.lP.R8UI:case j.lP.R8_SNORM:case j.Tg.STENCIL_INDEX8:return 1;case j.VI.LUMINANCE_ALPHA:case j.VI.RG:case j.VI.RG_INTEGER:case j.lP.RGBA4:case j.lP.R16F:case j.lP.R16I:case j.lP.R16UI:case j.lP.RG8:case j.lP.RG8I:case j.lP.RG8UI:case j.lP.RG8_SNORM:case j.lP.RGB565:case j.lP.RGB5_A1:case j.Tg.DEPTH_COMPONENT16:return 2;case j.VI.DEPTH_COMPONENT:case j.VI.RGB:case j.VI.RGB_INTEGER:case j.lP.RGB8:case j.lP.RGB8I:case j.lP.RGB8UI:case j.lP.RGB8_SNORM:case j.lP.SRGB8:case j.Tg.DEPTH_COMPONENT24:return 3;case j.VI.DEPTH_STENCIL:case j.VI.RGBA:case j.VI.RGBA_INTEGER:case j.lP.RGBA8:case j.lP.R32F:case j.lP.R11F_G11F_B10F:case j.lP.RG16F:case j.lP.R32I:case j.lP.R32UI:case j.lP.RG16I:case j.lP.RG16UI:case j.lP.RGBA8I:case j.lP.RGBA8UI:case j.lP.RGBA8_SNORM:case j.lP.SRGB8_ALPHA8:case j.lP.RGB9_E5:case j.lP.RGB10_A2UI:case j.lP.RGB10_A2:case j.Tg.DEPTH_STENCIL:case j.Tg.DEPTH_COMPONENT32F:case j.Tg.DEPTH24_STENCIL8:return 4;case j.Tg.DEPTH32F_STENCIL8:return 5;case j.lP.RGB16F:case j.lP.RGB16I:case j.lP.RGB16UI:return 6;case j.lP.RG32F:case j.lP.RG32I:case j.lP.RG32UI:case j.lP.RGBA16F:case j.lP.RGBA16I:case j.lP.RGBA16UI:return 8;case j.lP.RGB32F:case j.lP.RGB32I:case j.lP.RGB32UI:return 12;case j.lP.RGBA32F:case j.lP.RGBA32I:case j.lP.RGBA32UI:return 16;case j.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case j.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case j.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case j.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case j.q_.COMPRESSED_R11_EAC:case j.q_.COMPRESSED_SIGNED_R11_EAC:case j.q_.COMPRESSED_RGB8_ETC2:case j.q_.COMPRESSED_SRGB8_ETC2:case j.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case j.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case j.q_.COMPRESSED_RG11_EAC:case j.q_.COMPRESSED_SIGNED_RG11_EAC:case j.q_.COMPRESSED_RGBA8_ETC2_EAC:case j.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function Q(e){if((0,n.Wi)(e))return 0;if("descriptor"in e)return e.glName?Q(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return J(t)*i*r}r(80442);let ee=null,te=null;async function re(){return(0,n.Wi)(te)&&(te=function(){if((0,n.Wi)(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}(),ee=await te),te}function ie(e,t,r,i,n){const o=J(t?j.q_.COMPRESSED_RGBA8_ETC2_EAC:j.q_.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function ne(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ae(e,t,r,i,n,o,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),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,u))),s(e,u,f[e]);const m=f.length>1,p=m?j.cw.LINEAR_MIPMAP_LINEAR:j.cw.LINEAR,g={...t,samplingMode:p,hasMipmap:m,internalFormat:d,width:n,height:o};return new K.x(e,g,{type:"compressed",levels:f})}const se=A.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function le(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ce=le("DXT1"),ue=le("DXT3"),de=le("DXT5");const he=new Map([[F.T.POSITION,0],[F.T.NORMAL,1],[F.T.UV0,2],[F.T.COLOR,3],[F.T.SIZE,4],[F.T.TANGENT,4],[F.T.AUXPOS1,5],[F.T.SYMBOLCOLOR,5],[F.T.AUXPOS2,6],[F.T.FEATUREATTRIBUTE,6],[F.T.INSTANCEFEATUREATTRIBUTE,6],[F.T.INSTANCECOLOR,7],[F.T.MODEL,8],[F.T.MODELNORMAL,12],[F.T.MODELORIGINHI,11],[F.T.MODELORIGINLO,15]]);var fe=r(21968);new fe.G(F.T.POSITION,3,j.g.FLOAT,0,12),new fe.G(F.T.POSITION,3,j.g.FLOAT,0,20),new fe.G(F.T.UV0,2,j.g.FLOAT,12,20),new fe.G(F.T.POSITION,3,j.g.FLOAT,0,32),new fe.G(F.T.NORMAL,3,j.g.FLOAT,12,32),new fe.G(F.T.UV0,2,j.g.FLOAT,24,32),new fe.G(F.T.POSITION,3,j.g.FLOAT,0,16),new fe.G(F.T.COLOR,4,j.g.UNSIGNED_BYTE,12,16);const me=[new fe.G(F.T.POSITION,2,j.g.FLOAT,0,8)],pe=[new fe.G(F.T.POSITION,2,j.g.FLOAT,0,16),new fe.G(F.T.UV0,2,j.g.FLOAT,8,16)];var ge=r(67676),ve=r(49300),_e=r(54738);const Te=A.Z.getLogger("esri.views.webgl.BufferObject");class xe{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(j._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,ve.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new xe(e,j.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new xe(e,j.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==_e.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new xe(e,j.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=j.l1.STREAM_READ,r){if(e.type!==_e.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new xe(e,j.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=j.l1.STREAM_DRAW,r){if(e.type!==_e.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new xe(e,j.w0.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER?this._indexType===j.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===j.w0.ARRAY_BUFFER}dispose(){var e;null!=(e=this._context)&&e.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(j._g.BufferObject,this),this._context=null):this._glName&&Te.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&Te.error("Buffer size needs to be positive!"),this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER&&(0,n.pC)(t))switch(this._indexType=t,t){case j.g.UNSIGNED_SHORT:e*=2;break;case j.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER&&((0,V.Uc)(e)&&(t/=2,this._indexType=j.g.UNSIGNED_SHORT),(0,V.ZY)(e)&&(t/=4,this._indexType=j.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;(0,n.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,ve.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&Te.error("offset is out of range!");let n=t,o=r,a=i,s=e.byteLength;this.bufferType===j.w0.ELEMENT_ARRAY_BUFFER&&((0,V.Uc)(e)?(s/=2,n*=2,o*=2,a*=2):(0,V.ZY)(e)&&(s/=4,n*=4,o*=4,a*=4)),void 0===i&&(i=s-1),r>=i&&Te.error("end must be bigger than start!"),t+r-i>this._size&&Te.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,u=ArrayBuffer.isView(e)?e.buffer:e,d=0===o&&a===e.byteLength?u:u.slice(o,a);c.bufferSubData(this.bufferType,n,d),(0,ve.zu)(c),this._isVAOAware&&this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&Te.error("offset is out of range!"),r>=i&&Te.error("end must be bigger than start!"),t+r-i>this._size&&Te.error("An attempt to write beyond the end of the buffer!");const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl;if(this._context.type===_e.zO.WEBGL2)o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const n=0===r&&i===e.length?e:e.subarray(r,i);o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,n)}(0,ve.zu)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,i){if(this._context.type!==_e.zO.WEBGL2)return void Te.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void Te.error("Problem getting subdata: offset and length were less than zero!");const n=function(e){return(0,ge.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(n*((null!=r?r:0)+(null!=i?i:0))>e.byteLength)return void Te.error("Problem getting subdata: offset and length exceeded destination size!");t+n*(null!=i?i:0)>this.byteSize&&Te.warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this._context.bindBuffer(this,j.w0.COPY_READ_BUFFER),o.getBufferSubData(j.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(j.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===_e.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):Te.error("Get buffer subdata is supported in WebGL2 only!")}}const be=A.Z.getLogger("esri.views.webgl.VertexArrayObject");class Ae{constructor(e,t,r,i,n=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=n,this._glName=null,this._initialized=!1,e.instanceCounter.increment(j._g.VertexArrayObject,this)}get glName(){return this._glName}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,n.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){var t,r;const e=null==(t=this._context)||null==(r=t.capabilities)?void 0:r.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):be.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e].dispose(),delete this._buffers[e];this._indexBuffer=(0,n.O3)(this._indexBuffer)}this._context.instanceCounter.decrement(j._g.VertexArrayObject,this),this._context=null}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&be.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||be.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||be.error("Vertex buffer is uninitialized!");const n=t[r];n||be.error("Vertex element descriptor is empty!"),Y(this._context,this._locations,i,n)}(0,n.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||be.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||be.error("Vertex buffer is uninitialized!");const n=t[r];Z(this._context,this._locations,i,n)}(0,n.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}class Ee{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment(j._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:a}=t;if(a){if(this._context.type!==_e.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n)}else r.renderbufferStorage(r.RENDERBUFFER,o,i,n)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(j._g.Renderbuffer,this),this._context=null)}}const Se=A.Z.getLogger("esri.views.webgl.FrameBufferObject");class Me{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(j._g.FramebufferObject,this),(0,n.pC)(r)){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=j.VY.COLOR_ATTACHMENT0+e;let n;we(t)?(Re(t)?(n=t.descriptor,this._colorAttachments.set(i,t)):(n=t,this._colorAttachments.set(i,new K.x(this._context,n))),ye(n,this._desc)):(Ce(t)?(n=t.descriptor,this._colorAttachments.set(i,t)):(n=t,this._colorAttachments.set(i,new Ee(this._context,n))),Pe(n,this._desc)),this._validateColorAttachmentPoint(i)}}if((0,n.pC)(i)){let e,t;if(we(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),Re(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new K.x(this._context,t)),ye(t,this._desc);else{var o;Ce(i)?(t=i.descriptor,e=i):(t=i,e=new Ee(this._context,t));const r=null!=(o=this._desc.depthStencilTarget)?o:j.OU.DEPTH_STENCIL_RENDER_BUFFER;r===j.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===j.OU.DEPTH_RENDER_BUFFER||r===j.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),Pe(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(j._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(j.VY.COLOR_ATTACHMENT0);return e&&Re(e)?e:null}get colorAttachment(){return this._colorAttachments.get(j.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width}get height(){return this._desc.height}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+Q(r)),0)+Q(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&Re(t)?t:null}attachColorTexture(e,t=j.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),ye(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=j.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(Re(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=j.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);Re(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if((0,n.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==j.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==j.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!"),ye(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==j.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=j.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,j.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,j.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,n.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==j.Tg.DEPTH_STENCIL&&t.internalFormat!==j.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),Pe(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===j.Tg.DEPTH_STENCIL?j.OU.DEPTH_STENCIL_RENDER_BUFFER:j.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===j.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(j.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===j.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(j.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=a.descriptor;a.descriptor.target!==j.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(e+r>s.width||t+i>s.height||n+r>l.width||o+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,u=c.bindTexture(a,K.x.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(K.x.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(j.No.TEXTURE_2D,0,n,o,e,t,r,i),c.bindTexture(u,K.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,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,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a){if(this._context.type!==_e.zO.WEBGL2)return(0,ve.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,n,o,a);const s=this._context.gl,l=xe.createPixelPack(this._context,j.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(j.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=j.qi.FRAMEBUFFER){var t,r,i,n;const o=this._context.gl;if(this._initialized)return void o.bindFramebuffer(e,this.glName);this._glName&&o.deleteFramebuffer(this._glName);const a=this._context,s=o.createFramebuffer(),l=this._desc,c=null!=(t=l.colorTarget)?t:j.Lm.RENDER_BUFFER,u=null!=(r=l.width)?r:1,d=null!=(i=l.height)?i:1;if(o.bindFramebuffer(e,s),0===this._colorAttachments.size)if(c===j.Lm.TEXTURE||c===j.Lm.CUBEMAP)this._colorAttachments.set(j.VY.COLOR_ATTACHMENT0,function(e,t,r){return new K.x(e,{target:r,pixelFormat:j.VI.RGBA,dataType:j.Br.UNSIGNED_BYTE,samplingMode:j.cw.NEAREST,wrapMode:j.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(a,l,this.descriptor.colorTarget===j.Lm.CUBEMAP?j.No.TEXTURE_CUBE_MAP:j.No.TEXTURE_2D));else{const e=new Ee(a,{internalFormat:j.lP.RGBA4,width:u,height:d});this._colorAttachments.set(j.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((t,r)=>{t&&(Re(t)?this._framebufferTexture2D(t.glName,r,Oe(t),e):o.framebufferRenderbuffer(e,r,o.RENDERBUFFER,t.glName))}));const h=null!=(n=l.depthStencilTarget)?n:j.OU.NONE;switch(h){case j.OU.DEPTH_RENDER_BUFFER:case j.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new Ee(a,{internalFormat:l.depthStencilTarget===j.OU.DEPTH_RENDER_BUFFER?j.Tg.DEPTH_COMPONENT16:j.Tg.DEPTH_STENCIL,width:u,height:d}));const t=h===j.OU.DEPTH_RENDER_BUFFER?o.DEPTH_ATTACHMENT:o.DEPTH_STENCIL_ATTACHMENT;o.framebufferRenderbuffer(e,t,o.RENDERBUFFER,this._depthAttachment.glName);break}case j.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new Ee(a,{internalFormat:j.Tg.STENCIL_INDEX8,width:u,height:d})),o.framebufferRenderbuffer(e,o.STENCIL_ATTACHMENT,o.RENDERBUFFER,this._stencilAttachment.glName);break;case j.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){a.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:j.No.TEXTURE_2D,pixelFormat:j.VI.DEPTH_STENCIL,dataType:j.Br.UNSIGNED_INT_24_8,samplingMode:j.cw.NEAREST,wrapMode:j.e8.CLAMP_TO_EDGE,width:u,height:d};this._depthStencilTexture=new K.x(a,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,o.DEPTH_STENCIL_ATTACHMENT,Oe(this._depthStencilTexture),e)}(0,ve.CG)()&&o.checkFramebufferStatus(e)!==o.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=s,this._initialized=!0}_framebufferTexture2D(e,t=j.VY.COLOR_ATTACHMENT0,r=j.No.TEXTURE_2D,i=j.qi.FRAMEBUFFER,n=0){this._context.gl.framebufferTexture2D(i,t,r,e,n)}_detachColorAttachment(e){(0,ve.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return Re(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(j.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===j.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(j.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(j.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===Me._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Me._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Me._MAX_COLOR_ATTACHMENTS=1}const t=e-j.VY.COLOR_ATTACHMENT0;t+1>Me._MAX_COLOR_ATTACHMENTS&&Se.error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Me._MAX_COLOR_ATTACHMENTS} color attachments`)}}function Re(e){return"type"in e&&"texture"===e.type}function Ce(e){return"type"in e&&"renderbuffer"===e.type}function we(e){return Re(e)||"pixelFormat"in e}function ye(e,t){e.target!==j.No.TEXTURE_2D&&e.target!==j.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function Pe(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function Oe(e){return e.descriptor.target===j.No.TEXTURE_CUBE_MAP?j.No.TEXTURE_CUBE_MAP_POSITIVE_X:j.No.TEXTURE_2D}Me._MAX_COLOR_ATTACHMENTS=-1;var Ne,Ie,De=r(46314);class Le extends D{constructor(e,t){super(),this.data=e,this.type=O.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.Z,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:j.e8.REPEAT,t:j.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||R.CE.STRETCH,this.estimatedTexMemRequired=Le._estimateTexMemRequired(this.data,this.params),this._startPreload()}_startPreload(){const e=this.data;(0,n.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){(0,W.jc)(e.src)||"auto"===e.preload&&e.crossOrigin||(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src)}_startPreloadImageElement(e){(0,W.HK)(e.src)||(0,W.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,n.Wi)(e))return 0;if((0,V.eP)(e)||(0,V.lq)(e))return t.encoding===Le.KTX2_ENCODING?function(e,t){if((0,n.Wi)(ee))return e.byteLength;const r=new ee.KTX2File(new Uint8Array(e)),i=oe(r)?ie(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===Le.BASIS_ENCODING?function(e,t){if((0,n.Wi)(ee))return e.byteLength;const r=new ee.BasisFile(new Uint8Array(e)),i=ne(r)?ie(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?Le._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this.data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){var t;return{target:j.No.TEXTURE_2D,pixelFormat:j.VI.RGBA,dataType:j.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?j.cw.LINEAR_MIPMAP_LINEAR:j.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:null!=(t=this.params.maxAnisotropy)?t:this.params.mipmap?e.parameters.maxMaxAnisotropy:1}}get glTexture(){return this._glTexture}load(e,t){if((0,n.pC)(this._glTexture))return this._glTexture;if((0,n.pC)(this._loadingPromise))return this._loadingPromise;const r=this.data;return(0,n.Wi)(r)?(this._glTexture=new K.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Le.DDS_ENCODING?(this.data=void 0,this._loadFromDDSData(e,r)):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Le.KTX2_ENCODING?(this.data=void 0,this._loadFromKTX2(e,r)):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Le.BASIS_ENCODING?(this.data=void 0,this._loadFromBasis(e,r)):(0,V.lq)(r)?this._loadFromPixelData(e,r):(0,V.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this.data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this.data instanceof HTMLVideoElement)||(0,n.Wi)(this._glTexture))return r;if(this.data.readyState<Ne.HAVE_CURRENT_DATA||r===this.data.currentTime)return r;if((0,n.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:n}=this._powerOfTwoStretchInfo;n.setData(this.data),this._drawStretchedTexture(e,t,r,i,n,this._glTexture)}else{const{width:e,height:t}=this.data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this.data):this._glTexture.setData(this.data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:n,width:o,height:a}=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return se.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return se.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case ce:n=8,o=j.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ue:n=16,o=j.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case de:n=16,o=j.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return se.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)||(se.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])),1===a||(0,G.wt)(s)&&(0,G.wt)(l)||(se.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,d=new Uint8Array(e,f,h),m.push(d),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:c,height:u}}(r,t.hasMipmap);return t.samplingMode=i.levels.length>1?j.cw.LINEAR_MIPMAP_LINEAR:j.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=o,t.height=a,new K.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,n.Wi)(ee)&&(ee=await re());const i=new ee.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ae(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){(0,n.Wi)(ee)&&(ee=await re());const i=new ee.BasisFile(new Uint8Array(r));if(!ne(i))return null;i.startTranscoding();const o=ae(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,w.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?j.VI.LUMINANCE:3===this.params.components?j.VI.RGB:j.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new K.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const n=await M(r,{signal:i});return(0,E.k_)(i),this._loadFromImage(e,n,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const n=await(0,q.f)(r,r.src,!1,i);return(0,E.k_)(i),this._loadFromImage(e,n,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Ne.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((o,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,n.hw)(u)},l=()=>{r.readyState>=Ne.HAVE_CURRENT_DATA&&(s(),o(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new b.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const u=(0,E.fu)(i,(()=>c((0,E.zE)())))}))))}_loadFromImage(e,t,r){const i=Le._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this.params.components?j.VI.RGB:j.VI.RGBA,!this._requiresPowerOfTwo(e,n)||(0,G.wt)(i.width)&&(0,G.wt)(i.height)?(n.width=i.width,n.height=i.height,this._glTexture=new K.x(e,n,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,n,r),this._glTexture)}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=j.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,De.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,n){const{width:o,height:a}=r,s=(0,G.Sf)(o),l=(0,G.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case R.CE.PAD:i.textureCoordinateScaleFactor=[o/s,a/l],c=new K.x(e,i),c.updateData(0,0,0,o,a,t);break;case R.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,n());break;default:(0,U.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const n=new K.x(e,r),o=new Me(e,{colorTarget:j.Lm.TEXTURE,depthStencilTarget:j.OU.NONE},n),a=new K.x(e,{target:j.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:j.Br.UNSIGNED_BYTE,wrapMode:j.e8.CLAMP_TO_EDGE,samplingMode:j.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=me,r=he,i=-1,n=1){let o=null;return o=t===pe?new Float32Array([i,i,0,0,n,i,1,0,i,n,0,1,n,n,1,1]):new Float32Array([i,i,n,i,i,n,n,n]),new Ae(e,r,{geometry:t},{geometry:xe.createVertex(e,j.l1.STATIC_DRAW,o)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,o,s,a,n),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:o}:(s.dispose(!0),a.dispose(),o.detachColorTexture(),o.dispose()),e.bindFramebuffer(l),n}_drawStretchedTexture(e,t,r,i,n,o){e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,o.descriptor.width,o.descriptor.height);const s=e.bindTechnique(t);s.setUniform4f("uColor",1,1,1,1),s.bindTexture("tex",n),e.bindVAO(i),e.drawArrays(j.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height)}unload(){if((0,n.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,n.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,n.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}Le.DDS_ENCODING="image/vnd-ms.dds",Le.KTX2_ENCODING="image/ktx2",Le.BASIS_ENCODING="image/x.basis",(Ie=Ne||(Ne={}))[Ie.HAVE_NOTHING=0]="HAVE_NOTHING",Ie[Ie.HAVE_METADATA=1]="HAVE_METADATA",Ie[Ie.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ie[Ie.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ie[Ie.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var Fe=r(64822),He=r(65576),Be=r(18361),Ue=r(64267),ze=r(15719),Ge=r(19419),Ve=r(85504),We=r(94124),qe=(r(97323),r(5543),r(57220),r(74709),r(12139),r(67498));r(42001),r(45436),r(85594);var ke=r(97995);function Xe(e){return(0,n.pC)(e.shadowMap)&&e.shadowMap.enabled}(0,u.c)(),(0,u.c)();var $e,je=r(37782);class Ke extends D{constructor(e,t){super(),this.type=O.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=he,this._parameters=(0,je.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,je.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.isVisibleInPass(e.pass)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleInPass(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,n.pC)(this.repository)&&this.repository.materialChanged(this)}}!function(e){e[e.Occlude=1]="Occlude",e[e.Transparent=2]="Transparent",e[e.OccludeAndTransparent=4]="OccludeAndTransparent",e[e.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",e[e.Opaque=16]="Opaque"}($e||($e={}));const Ye={renderOccluded:$e.Occlude};function Ze(e,t,r=j.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}const Je={face:j.LR.BACK,mode:j.Wf.CCW},Qe={face:j.LR.FRONT,mode:j.Wf.CCW},et=e=>e===R.Vr.Back?Je:e===R.Vr.Front?Qe:null,tt={zNear:0,zFar:1},rt={r:!0,g:!0,b:!0,a:!0};function it(e){return ft.intern(e)}function nt(e){return pt.intern(e)}function ot(e){return vt.intern(e)}function at(e){return Tt.intern(e)}function st(e){return bt.intern(e)}function lt(e){return Et.intern(e)}function ct(e){return Mt.intern(e)}function ut(e){return Ct.intern(e)}class dt{constructor(e,t){this.makeKey=e,this.makeRef=t,this.interns=new Map}intern(e){if(!e)return null;const t=this.makeKey(e),r=this.interns;return r.has(t)||r.set(t,this.makeRef(e)),r.get(t)}}function ht(e){return"["+e.join(",")+"]"}const ft=new dt(mt,(e=>({__tag:"Blending",...e})));function mt(e){return e?ht([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 pt=new dt(gt,(e=>({__tag:"Culling",...e})));function gt(e){return e?ht([e.face,e.mode]):null}const vt=new dt(_t,(e=>({__tag:"PolygonOffset",...e})));function _t(e){return e?ht([e.factor,e.units]):null}const Tt=new dt(xt,(e=>({__tag:"DepthTest",...e})));function xt(e){return e?ht([e.func]):null}const bt=new dt(At,(e=>({__tag:"StencilTest",...e})));function At(e){return e?ht([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const Et=new dt(St,(e=>({__tag:"DepthWrite",...e})));function St(e){return e?ht([e.zNear,e.zFar]):null}const Mt=new dt(Rt,(e=>({__tag:"ColorWrite",...e})));function Rt(e){return e?ht([e.r,e.g,e.b,e.a]):null}const Ct=new dt(wt,(e=>({__tag:"StencilWrite",...e})));function wt(e){return e?ht([e.mask]):null}const yt=new dt((function(e){return e?ht([mt(e.blending),gt(e.culling),_t(e.polygonOffset),xt(e.depthTest),At(e.stencilTest),St(e.depthWrite),Rt(e.colorWrite),wt(e.stencilWrite)]):null}),(e=>({blending:it(e.blending),culling:nt(e.culling),polygonOffset:ot(e.polygonOffset),depthTest:at(e.depthTest),stencilTest:st(e.stencilTest),depthWrite:lt(e.depthWrite),colorWrite:ct(e.colorWrite),stencilWrite:ut(e.stencilWrite)}))),Pt=function(e,t,r,i,n=j.db.ADD,o=j.db.ADD,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}(j.zi.SRC_ALPHA,j.zi.ONE,j.zi.ONE_MINUS_SRC_ALPHA,j.zi.ONE_MINUS_SRC_ALPHA),Ot=Ze(j.zi.ONE,j.zi.ONE),Nt=Ze(j.zi.ZERO,j.zi.ONE_MINUS_SRC_ALPHA);function It(e){return e===R.Am.FrontFace?null:e===R.Am.Alpha?Nt:Ot}const Dt={factor:-1,units:-2};function Lt(e){return e?Dt:null}function Ft(e,t=j.wb.LESS){return e===R.Am.NONE||e===R.Am.FrontFace?t:j.wb.LEQUAL}var Ht,Bt,Ut=r(50173),zt=r(51305),Gt=r(94961),Vt=r(72119),Wt=r(88669),qt=r(98766);(Bt=Ht||(Ht={}))[Bt.X=0]="X",Bt[Bt.Y=1]="Y",Bt[Bt.Z=2]="Z";var kt=r(22807),Xt=r(12981);new kt.x((function(){return{origin:null,direction:null}})),(0,u.c)(),(0,u.c)();const $t=A.Z.getLogger("esri.geometry.support.sphere");function jt(){return(0,Wt.c)()}function Kt(e,t=jt()){return(0,qt.c)(t,e)}function Yt(e){return Array.isArray(e)?e[3]:e}function Zt(e){return Array.isArray(e)?e:ar}function Jt(e,t,r){if((0,n.Wi)(t))return!1;const{origin:i,direction:o}=t,a=Qt;a[0]=i[0]-e[0],a[1]=i[1]-e[1],a[2]=i[2]-e[2];const s=o[0]*o[0]+o[1]*o[1]+o[2]*o[2],l=2*(o[0]*a[0]+o[1]*a[1]+o[2]*a[2]),c=l*l-4*s*(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-e[3]*e[3]);if(c<0)return!1;const u=Math.sqrt(c);let d=(-l-u)/(2*s);const h=(-l+u)/(2*s);return(d<0||h<d&&h>0)&&(d=h),!(d<0||(r&&(r[0]=i[0]+o[0]*d,r[1]=i[1]+o[1]*d,r[2]=i[2]+o[2]*d),0))}const Qt=(0,u.c)();function er(e,t,r){const i=Xt.WM.get(),n=Xt.MP.get();(0,c.f)(i,t.origin,t.direction);const o=Yt(e);(0,c.f)(r,i,t.origin),(0,c.g)(r,r,1/(0,c.l)(r)*o);const a=rr(e,t.origin),l=function(e,t){const r=(0,c.e)(e,t)/((0,c.l)(e)*(0,c.l)(t));return-(0,G.ZF)(r)}(t.origin,r);return(0,s.d)(n,l+a,i),(0,c.m)(r,r,n),r}function tr(e,t,r){const i=(0,c.b)(Xt.WM.get(),t,Zt(e)),n=(0,c.g)(Xt.WM.get(),i,e[3]/(0,c.l)(i));return(0,c.a)(r,n,Zt(e))}function rr(e,t){const r=(0,c.b)(Xt.WM.get(),t,Zt(e)),i=(0,c.l)(r),n=Yt(e),o=n+Math.abs(n-i);return(0,G.ZF)(n/o)}const ir=(0,u.c)();function nr(e,t,r,i){const n=(0,c.b)(ir,t,Zt(e));switch(r){case Ht.X:{const e=(0,G.jE)(n,ir)[2];return(0,c.s)(i,-Math.sin(e),Math.cos(e),0)}case Ht.Y:{const e=(0,G.jE)(n,ir),t=e[1],r=e[2],o=Math.sin(t);return(0,c.s)(i,-o*Math.cos(r),-o*Math.sin(r),Math.cos(t))}case Ht.Z:return(0,c.n)(i,n);default:return}}function or(e,t){const r=(0,c.b)(sr,t,Zt(e));return(0,c.l)(r)-e[3]}const ar=(0,u.c)(),sr=(0,u.c)();Object.freeze(Object.defineProperty({__proto__:null,create:jt,copy:Kt,fromCenterAndRadius:function(e,t){return(0,Wt.f)(e[0],e[1],e[2],t)},wrap:function(e){return e},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},fromRadius:function(e){return e},getRadius:Yt,getCenter:Zt,fromValues:function(e,t,r,i){return(0,Wt.f)(e,t,r,i)},elevate:function(e,t,r){return e!==r&&(0,c.c)(r,e),r[3]=e[3]+t,r},setExtent:function(e,t,r){return $t.error("sphere.setExtent is not yet supported"),e===r?r:Kt(e,r)},intersectRay:Jt,intersectsRay:function(e,t){return Jt(e,t,null)},intersectRayClosestSilhouette:function(e,t,r){if(Jt(e,t,r))return r;const i=er(e,t,Xt.WM.get());return(0,c.a)(r,t.origin,(0,c.g)(Xt.WM.get(),t.direction,(0,c.i)(t.origin,i)/(0,c.l)(t.direction))),r},closestPointOnSilhouette:er,closestPoint:function(e,t,r){return Jt(e,t,r)?r:(function(e,t,r){const i=(0,c.e)(e.direction,(0,c.b)(r,t,e.origin));(0,c.a)(r,e.origin,(0,c.g)(r,e.direction,i))}(t,Zt(e),r),tr(e,r,r))},projectPoint:tr,distanceToSilhouette:function(e,t){const r=(0,c.b)(Xt.WM.get(),t,Zt(e)),i=(0,c.p)(r),n=e[3]*e[3];return Math.sqrt(Math.abs(i-n))},angleToSilhouette:rr,axisAt:nr,altitudeAt:or,setAltitudeAt:function(e,t,r,i){const n=or(e,t),o=nr(e,t,Ht.Z,sr),a=(0,c.g)(sr,o,r-n);return(0,c.a)(i,t,a)}},Symbol.toStringTag,{value:"Module"}));const lr=new class{constructor(e=0){this.offset=e,this.sphere=jt(),this.tmpVertex=(0,u.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let n=i[0]*e+i[4]*t+i[8]*r+i[12],o=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(n*n+o*o+a*a);n+=n*s,o+=o*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*n+l[4]*o+l[8]*a+l[12],this.tmpVertex[1]=l[1]*n+l[5]*o+l[9]*a+l[13],this.tmpVertex[2]=l[2]*n+l[6]*o+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.offset=e,this.componentLocalOriginLength=0,this.tmpVertex=(0,u.c)(),this.mbs=(0,Wt.c)(),this.obb={center:(0,u.c)(),halfSize:(0,Vt.c)(),quaternion:null}}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,n=t,o=r+this.componentLocalOriginLength,a=this.offset/Math.sqrt(i*i+n*n+o*o);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+n*a,this.tmpVertex[2]=r+o*a,this.tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,n=e[3],o=e[4],a=e[5]+this.componentLocalOriginLength,s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(n*n+o*o+a*a);return e[3]+=n*l,e[4]+=o*l,e[5]+=a*l,e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.mbs[0]=e[0]+e[0]*r,this.mbs[1]=e[1]+e[1]*r,this.mbs[2]=e[2]+e[2]*r,this.mbs[3]=e[3]+e[3]*this.offset/t,this.mbs}applyToObb(e){const t=e.center,r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.obb.center[0]=t[0]+t[0]*r,this.obb.center[1]=t[1]+t[1]*r,this.obb.center[2]=t[2]+t[2]*r,(0,c.q)(this.obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this.obb.halfSize,this.obb.halfSize,e.center);const i=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*i,this.obb.halfSize[1]+=this.obb.halfSize[1]*i,this.obb.halfSize[2]+=this.obb.halfSize[2]*i,(0,c.b)(this.obb.halfSize,this.obb.halfSize,e.center),(0,zt.c)(cr,e.quaternion),(0,c.q)(this.obb.halfSize,this.obb.halfSize,cr),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=e.quaternion,this.obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],n=t+this.localOrigin[1],o=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+n*n+o*o);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+n*a,this.tmpVertex[2]=r+o*a,this.tmpVertex}applyToAabb(e){const t=e[0]+this.localOrigin[0],r=e[1]+this.localOrigin[1],i=e[2]+this.localOrigin[2],n=e[3]+this.localOrigin[0],o=e[4]+this.localOrigin[1],a=e[5]+this.localOrigin[2],s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(n*n+o*o+a*a);return e[3]+=n*l,e[4]+=o*l,e[5]+=a*l,e}};const cr=(0,Gt.a)();function ur(e,t,r,i){const n=r.typedBuffer,o=r.typedBufferStride,a=e.length;i*=o;for(let r=0;r<a;++r){const a=2*e[r];n[i]=t[a],n[i+1]=t[a+1],i+=o}}function dr(e,t,r,i,n){const o=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==n||1===n)for(let r=0;r<s;++r){const n=3*e[r];o[i]=t[n],o[i+1]=t[n+1],o[i+2]=t[n+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<n;++e)o[i]=t[s],o[i+1]=t[s+1],o[i+2]=t[s+2],i+=a}}function hr(e,t,r,i,n,o=1){if(!r)return void dr(e,t,i,n,o);const a=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],u=r[1],d=r[2],h=r[4],f=r[5],m=r[6],p=r[8],g=r[9],v=r[10],_=r[12],T=r[13],x=r[14];if(n*=s,1===o)for(let r=0;r<l;++r){const i=3*e[r],o=t[i],l=t[i+1],b=t[i+2];a[n]=c*o+h*l+p*b+_,a[n+1]=u*o+f*l+g*b+T,a[n+2]=d*o+m*l+v*b+x,n+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+p*A+_,S=u*l+f*b+g*A+T,M=d*l+m*b+v*A+x;for(let e=0;e<o;++e)a[n]=E,a[n+1]=S,a[n+2]=M,n+=s}}function fr(e,t,r,i,n,o=1){if(!r)return void dr(e,t,i,n,o);const a=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=a[0],h=a[1],f=a[2],m=a[4],p=a[5],g=a[6],v=a[8],_=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(n*=c,1===o)for(let r=0;r<u;++r){const i=3*e[r],o=t[i],a=t[i+1],s=t[i+2];let u=d*o+m*a+v*s,E=h*o+p*a+_*s,S=f*o+g*a+T*s;if(x){const e=u*u+E*E+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);u*=t,E*=t,S*=t}}l[n+0]=u,l[n+1]=E,l[n+2]=S,n+=c}else for(let r=0;r<u;++r){const i=3*e[r],a=t[i],s=t[i+1],u=t[i+2];let E=d*a+m*s+v*u,S=h*a+p*s+_*u,M=f*a+g*s+T*u;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<o;++e)l[n+0]=E,l[n+1]=S,l[n+2]=M,n+=c}}function mr(e,t,r,i,n,o=1){if(!r)return void function(e,t,r,i,n=1){const o=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===n)for(let r=0;r<s;++r){const n=4*e[r];o[i]=t[n],o[i+1]=t[n+1],o[i+2]=t[n+2],o[i+3]=t[n+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<n;++e)o[i]=t[s],o[i+1]=t[s+1],o[i+2]=t[s+2],o[i+3]=t[s+3],i+=a}}(e,t,i,n,o);const a=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=a[0],h=a[1],f=a[2],m=a[4],p=a[5],g=a[6],v=a[8],_=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(n*=c,1===o)for(let r=0;r<u;++r){const i=4*e[r],o=t[i],a=t[i+1],s=t[i+2],u=t[i+3];let E=d*o+m*a+v*s,S=h*o+p*a+_*s,M=f*o+g*a+T*s;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}l[n+0]=E,l[n+1]=S,l[n+2]=M,l[n+3]=u,n+=c}else for(let r=0;r<u;++r){const i=4*e[r],a=t[i],s=t[i+1],u=t[i+2],E=t[i+3];let S=d*a+m*s+v*u,M=h*a+p*s+_*u,R=f*a+g*s+T*u;if(x){const e=S*S+M*M+R*R;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,M*=t,R*=t}}for(let e=0;e<o;++e)l[n+0]=S,l[n+1]=M,l[n+2]=R,l[n+3]=E,n+=c}}function pr(e,t,r,i,n,o=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(n*=s,1===o){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=t[i+3],n+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=255,n+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<o;++e)a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=t[i+3],n+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<o;++e)a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=255,n+=s}}var gr=r(135),vr=r(92555),_r=r(72303),Tr=r(89243);class xr{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}class br{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new C.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(qe.P.Pass,this),this.bindDraw=t.generateBind(qe.P.Draw,this),this._fragmentUniforms=(0,ve.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get isCompiled(){return this._glProgram.isCompiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2f(e,t,r){this._glProgram.setUniform2f(e,t,r)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3f(e,t,r,i){this._glProgram.setUniform3f(e,t,r,i)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4f(e,t,r,i,n){this._glProgram.setUniform4f(e,t,r,i,n)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if((0,n.Wi)(t)||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),(0,n.pC)(this._fragmentUniforms)&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}j.wb.LESS,j.wb.ALWAYS;const Ar={mask:255},Er={function:{func:j.wb.ALWAYS,ref:R.hU.OutlineVisualElementMask,mask:R.hU.OutlineVisualElementMask},operation:{fail:j.xS.KEEP,zFail:j.xS.KEEP,zPass:j.xS.ZERO}},Sr={function:{func:j.wb.ALWAYS,ref:R.hU.OutlineVisualElementMask,mask:R.hU.OutlineVisualElementMask},operation:{fail:j.xS.KEEP,zFail:j.xS.KEEP,zPass:j.xS.REPLACE}};j.wb.EQUAL,R.hU.OutlineVisualElementMask,R.hU.OutlineVisualElementMask,j.xS.KEEP,j.xS.KEEP,j.xS.KEEP,j.wb.NOTEQUAL,R.hU.OutlineVisualElementMask,R.hU.OutlineVisualElementMask,j.xS.KEEP,j.xS.KEEP,j.xS.KEEP;var Mr=r(32078);const Rr=A.Z.getLogger("esri.views.3d.webgl-engine.shaders.DefaultTechnique");class Cr extends class{constructor(e,t,r){this.release=r,t&&(this.initializeConfiguration(e,t),this._configuration=t.snapshot()),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,n.O3)(this._program),this._pipeline=this._configuration=null}reload(e){(0,n.O3)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.isCompiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPass(e,t){this.program.bindPass(e,t)}bindDraw(e,t){this.program.bindDraw(e,t)}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return j.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}{initializeConfiguration(e,t){t.spherical=e.viewingMode===Fe.JY.Global,t.doublePrecisionRequiresObfuscation=(0,Tr.I)(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetalnessAndRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?gr.N.Default:gr.N.None}initializeProgram(e){return this._initializeProgram(e,Cr.shader)}_initializeProgram(e,t){const r=t.get().build(this.configuration);return new br(e.rctx,r,he)}bindPass(e,t){this.program.bindPass(e,t);const r=this.configuration.output;this.configuration.hasModelTransformation&&((0,n.pC)(e.modelTransformation)?this.program.setUniformMatrix4fv("model",e.modelTransformation):Rr.warnOnce("hasModelTransformation true, but no modelTransformation found.")),r===Be.H.Alpha&&(this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",je.FZ[e.colorMixMode])),r===Be.H.Color&&(t.lighting.setUniforms(this.program,!1,t.enableFillLights),this.program.setUniform3fv("ambient",e.ambient),this.program.setUniform3fv("diffuse",e.diffuse),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",je.FZ[e.colorMixMode]),this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),(0,Ve.nW)(this.program,e,this.configuration.pbrMode)),(0,vr.Mo)(this.program,e,t),(0,je.bj)(e.screenSizePerspective,this.program,"screenSizePerspectiveAlignment"),function(e,t){(0,n.pC)(t.texture)&&e.bindTexture("tex",t.texture),(0,n.pC)(t.textureNormal)&&e.bindTexture("normalTexture",t.textureNormal),(0,n.pC)(t.textureEmissive)&&e.bindTexture("texEmission",t.textureEmissive),(0,n.pC)(t.textureOcclusion)&&e.bindTexture("texOcclusion",t.textureOcclusion),(0,n.pC)(t.textureMetallicRoughness)&&e.bindTexture("texMetallicRoughness",t.textureMetallicRoughness)}(this.program,e),e.textureAlphaMode!==R.JJ.Mask&&e.textureAlphaMode!==R.JJ.MaskBlend||this.program.setUniform1f("textureAlphaCutoff",e.textureAlphaCutoff),(0,n.pC)(t.shadowMap)&&t.shadowMap.bind(this.program),(0,n.pC)(t.ssaoHelper)&&t.ssaoHelper.bind(this.program,t.camera)}bindDraw(e,t){if(this.program.bindDraw(e,t),this.program.rebindTextures(),this.configuration.output===Be.H.Color){const r=this.configuration.instancedDoublePrecision?(0,u.f)(t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]):e.origin;(0,_r.EA)(this.program,t.shadowMap,r)}}_convertDepthTestFunction(e){return e===R.Gv.Lequal?j.wb.LEQUAL:j.wb.LESS}_setPipeline(e,t){const r=this.configuration,i=e===R.Am.NONE,n=e===R.Am.FrontFace;return function(e){return yt.intern(e)}({blending:r.output!==Be.H.Color&&r.output!==Be.H.Alpha||!r.transparent?null:i?Pt:It(e),culling:wr(r)&&et(r.cullFace),depthTest:{func:Ft(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:i||n?r.writeDepth&&tt:null,colorWrite:rt,stencilWrite:r.hasOccludees?Ar:null,stencilTest:r.hasOccludees?t?Sr:Er:null,polygonOffset:i||n?null:Lt(r.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._setPipeline(this.configuration.transparencyPassType,!0),this._setPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function wr(e){return e.cullFace!==R.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Cr.shader=new xr(Mr.D,(()=>r.e(9291).then(r.bind(r,79291))));var yr=r(43697);function Pr(e={}){return(t,r)=>{var i;if(t._parameterNames=null!=(i=t._parameterNames)?i:[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{var n;const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),s=null!=(n=t._parameterBits)?n:[0];let l=0;for(;s[l]+a>16;)l++,l>=s.length&&s.push(0);t._parameterBits=s;const c=s[l],u=(1<<a)-1<<c;s[l]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[l]=this._parameterBits[l]&~u|+e<<c&u,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}}class Or extends class{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}{}(0,yr._)([Pr({constValue:!0})],Or.prototype,"hasSliceHighlight",void 0),(0,yr._)([Pr({constValue:!1})],Or.prototype,"hasSliceInVertexProgram",void 0),(0,yr._)([Pr({constValue:qe.P.Draw})],Or.prototype,"slicePlaneBindType",void 0),(0,yr._)([Pr({constValue:!1})],Or.prototype,"instancedDoublePrecision",void 0);class Nr extends Or{constructor(){super(...arguments),this.output=Be.H.Color,this.alphaDiscardMode=R.JJ.Opaque,this.doubleSidedMode=Ge.q.None,this.pbrMode=Ve.f7.Disabled,this.cullFace=R.Vr.None,this.transparencyPassType=R.Am.NONE,this.normalType=Ue.h.Attribute,this.textureCoordinateType=gr.N.None,this.customDepthTest=R.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.enableFillLights=!1}}(0,yr._)([Pr({count:Be.H.COUNT})],Nr.prototype,"output",void 0),(0,yr._)([Pr({count:R.JJ.COUNT})],Nr.prototype,"alphaDiscardMode",void 0),(0,yr._)([Pr({count:Ge.q.COUNT})],Nr.prototype,"doubleSidedMode",void 0),(0,yr._)([Pr({count:Ve.f7.COUNT})],Nr.prototype,"pbrMode",void 0),(0,yr._)([Pr({count:R.Vr.COUNT})],Nr.prototype,"cullFace",void 0),(0,yr._)([Pr({count:R.Am.COUNT})],Nr.prototype,"transparencyPassType",void 0),(0,yr._)([Pr({count:Ue.h.COUNT})],Nr.prototype,"normalType",void 0),(0,yr._)([Pr({count:gr.N.COUNT})],Nr.prototype,"textureCoordinateType",void 0),(0,yr._)([Pr({count:R.Gv.COUNT})],Nr.prototype,"customDepthTest",void 0),(0,yr._)([Pr()],Nr.prototype,"spherical",void 0),(0,yr._)([Pr()],Nr.prototype,"hasVertexColors",void 0),(0,yr._)([Pr()],Nr.prototype,"hasSymbolColors",void 0),(0,yr._)([Pr()],Nr.prototype,"hasVerticalOffset",void 0),(0,yr._)([Pr()],Nr.prototype,"hasSlicePlane",void 0),(0,yr._)([Pr()],Nr.prototype,"hasSliceHighlight",void 0),(0,yr._)([Pr()],Nr.prototype,"hasColorTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasMetalnessAndRoughnessTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasEmissionTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasOcclusionTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasNormalTexture",void 0),(0,yr._)([Pr()],Nr.prototype,"hasScreenSizePerspective",void 0),(0,yr._)([Pr()],Nr.prototype,"hasVertexTangents",void 0),(0,yr._)([Pr()],Nr.prototype,"hasOccludees",void 0),(0,yr._)([Pr()],Nr.prototype,"hasMultipassTerrain",void 0),(0,yr._)([Pr()],Nr.prototype,"hasModelTransformation",void 0),(0,yr._)([Pr()],Nr.prototype,"offsetBackfaces",void 0),(0,yr._)([Pr()],Nr.prototype,"vvSize",void 0),(0,yr._)([Pr()],Nr.prototype,"vvColor",void 0),(0,yr._)([Pr()],Nr.prototype,"receiveShadows",void 0),(0,yr._)([Pr()],Nr.prototype,"receiveAmbientOcclusion",void 0),(0,yr._)([Pr()],Nr.prototype,"textureAlphaPremultiplied",void 0),(0,yr._)([Pr()],Nr.prototype,"instanced",void 0),(0,yr._)([Pr()],Nr.prototype,"instancedColor",void 0),(0,yr._)([Pr()],Nr.prototype,"instancedDoublePrecision",void 0),(0,yr._)([Pr()],Nr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,yr._)([Pr()],Nr.prototype,"writeDepth",void 0),(0,yr._)([Pr()],Nr.prototype,"transparent",void 0),(0,yr._)([Pr()],Nr.prototype,"enableOffset",void 0),(0,yr._)([Pr()],Nr.prototype,"cullAboveGround",void 0),(0,yr._)([Pr()],Nr.prototype,"enableFillLights",void 0),(0,yr._)([Pr({constValue:!0})],Nr.prototype,"hasVvInstancing",void 0),(0,yr._)([Pr({constValue:!1})],Nr.prototype,"useCustomDTRExponentForWater",void 0),(0,yr._)([Pr({constValue:!1})],Nr.prototype,"supportsTextureAtlas",void 0);var Ir=r(41846);class Dr extends Cr{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetalnessAndRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Ue.h.Attribute,t.doubleSidedMode=Ge.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Dr.shader)}}Dr.shader=new xr(Ir.R,(()=>r.e(8096).then(r.bind(r,38096))));class Lr extends Ke{constructor(e){super(e,Hr),this.supportsEdges=!0,this.techniqueConfig=new Nr,this.vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,He.U$)().vec3f(F.T.POSITION).vec3f(F.T.NORMAL);return e.hasVertexTangents&&r.vec4f(F.T.TANGENT),t&&r.vec2f(F.T.UV0),e.hasVertexColors&&r.vec4u8(F.T.COLOR),e.hasSymbolColors&&r.vec4u8(F.T.SYMBOLCOLOR),r}(this.parameters),this.instanceBufferLayout=e.instanced?function(e){let t=(0,He.U$)();return t=e.instancedDoublePrecision?t.vec3f(F.T.MODELORIGINHI).vec3f(F.T.MODELORIGINLO).mat3f(F.T.MODEL).mat3f(F.T.MODELNORMAL):t.mat4f(F.T.MODEL).mat4f(F.T.MODELNORMAL),e.instanced&&e.instanced.includes("color")&&(t=t.vec4f(F.T.INSTANCECOLOR)),e.instanced&&e.instanced.includes("featureAttribute")&&(t=t.vec4f(F.T.INSTANCEFEATUREATTRIBUTE)),t}(this.parameters):null}isVisibleInPass(e){return e!==Ut.C.MATERIAL_DEPTH_SHADOWMAP_ALL&&e!==Ut.C.MATERIAL_DEPTH_SHADOWMAP_DEFAULT&&e!==Ut.C.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{instanced:t,hasVertexColors:r,hasSymbolColors:i,vvColorEnabled:n}=e,o=!!t&&t.includes("color"),a="replace"===e.colorMixMode,s=e.opacity>0,l=e.externalColor&&e.externalColor[3]>0;return r&&(o||n||i)?!!a||s:r?a?l:s:o||n||i?!!a||s:a?l:s}getConfiguration(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.hasNormalTexture=!!this.parameters.normalTextureId,this.techniqueConfig.hasColorTexture=!!this.parameters.textureId,this.techniqueConfig.hasVertexTangents=this.parameters.hasVertexTangents,this.techniqueConfig.instanced=!!this.parameters.instanced,this.techniqueConfig.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.hasVerticalOffset=null!==this.parameters.verticalOffset,this.techniqueConfig.hasScreenSizePerspective=null!==this.parameters.screenSizePerspective,this.techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this.techniqueConfig.hasSliceHighlight=this.parameters.hasSliceHighlight,this.techniqueConfig.alphaDiscardMode=this.parameters.textureAlphaMode,this.techniqueConfig.normalType="screenDerivative"===this.parameters.normals?Ue.h.ScreenDerivative:Ue.h.Attribute,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,(0,n.pC)(this.parameters.customDepthTest)&&(this.techniqueConfig.customDepthTest=this.parameters.customDepthTest),this.techniqueConfig.hasOccludees=this.parameters.hasOccludees,this.techniqueConfig.cullFace=this.parameters.hasSlicePlane?R.Vr.None:this.parameters.cullFace,this.techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this.techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this.techniqueConfig.hasModelTransformation=(0,n.pC)(this.parameters.modelTransformation),e!==Be.H.Color&&e!==Be.H.Alpha||(this.techniqueConfig.hasVertexColors=this.parameters.hasVertexColors,this.techniqueConfig.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this.techniqueConfig.doubleSidedMode=Ge.q.WindingOrder:this.techniqueConfig.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ge.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ge.q.WindingOrder:Ge.q.None,this.techniqueConfig.instancedColor=!!this.parameters.instanced&&this.parameters.instanced.includes("color"),this.techniqueConfig.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this.techniqueConfig.receiveAmbientOcclusion=(r=t,!(!(0,n.pC)(r.ssaoHelper)||!r.ssaoHelper.enabled)&&this.parameters.receiveSSAO),this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this.techniqueConfig.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Ve.f7.Schematic:Ve.f7.Normal:Ve.f7.Disabled,this.techniqueConfig.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this.techniqueConfig.hasEmissionTexture=!!this.parameters.emissiveTextureId,this.techniqueConfig.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this.techniqueConfig.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<5e5),this.techniqueConfig;var r}intersect(e,t,r,i,o,a,s){if(null!==this.parameters.verticalOffset){const e=i.camera;(0,c.s)(qr,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case Fe.JY.Global:t=(0,c.n)(Vr,qr);break;case Fe.JY.Local:t=(0,c.c)(Vr,Gr)}let n=0;if(null!==this.parameters.verticalOffset){const r=(0,c.b)(kr,qr,e.eye),i=(0,c.l)(r),o=(0,c.g)(r,r,1/i);let a=null;this.parameters.screenSizePerspective&&(a=(0,c.e)(t,o)),n+=(0,je.Hx)(e,i,this.parameters.verticalOffset,a,this.parameters.screenSizePerspective)}(0,c.g)(t,t,n),(0,c.t)(Wr,t,i.transform.inverseRotation),o=(0,c.b)(Ur,o,Wr),a=(0,c.b)(zr,a,Wr)}var l;(0,je.Bw)(e,t,i,o,a,(l=i.verticalOffset,(0,n.pC)(l)?(lr.offset=l,lr):null),s)}requiresSlot(e){return e===(this.parameters.transparent?this.parameters.writeDepth?ke.r.TRANSPARENT_MATERIAL:ke.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:ke.r.OPAQUE_MATERIAL)||e===ke.r.DRAPED_MATERIAL}createGLMaterial(e){return e.output===Be.H.Color||e.output===Be.H.Alpha||e.output===Be.H.Depth||e.output===Be.H.Normal||e.output===Be.H.Shadow||e.output===Be.H.Highlight?new Fr(e):null}createBufferWriter(){return new Br(this.vertexBufferLayout,this.instanceBufferLayout)}}class Fr extends class extends class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(r,t),this._technique),this._technique}ensureResources(e){return R.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,n.RY)(this._texture),this._textureNormal=(0,n.RY)(this._textureNormal),this._textureEmissive=(0,n.RY)(this._textureEmissive),this._textureOcclusion=(0,n.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,n.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?R.Rw.LOADED:R.Rw.LOADING}get passParameters(){return{texture:(0,n.pC)(this._texture)?this._texture.glTexture:null,textureNormal:(0,n.pC)(this._textureNormal)?this._textureNormal.glTexture:null,textureEmissive:(0,n.pC)(this._textureEmissive)?this._textureEmissive.glTexture:null,textureOcclusion:(0,n.pC)(this._textureOcclusion)?this._textureOcclusion.glTexture:null,textureMetallicRoughness:(0,n.pC)(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null}}updateTexture(e){((0,n.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,n.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if((0,n.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,E.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,n.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const t=this._material.parameters;return this.updateTexture(t.textureId),this._material.setParameters(this.passParameters),this.ensureTechnique(t.treeRendering?Dr:Cr,e)}_updateShadowState(e){Xe(e)!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:Xe(e)})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==Be.H.Color&&this._output!==Be.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}const Hr={textureId:void 0,initTextureTransparent:!1,isSchematic:!1,usePBR:!1,normalTextureId:void 0,hasVertexTangents:!1,occlusionTextureId:void 0,emissiveTextureId:void 0,metallicRoughnessTextureId:void 0,emissiveFactor:[0,0,0],mrrFactors:[0,1,.5],ambient:[.2,.2,.2],diffuse:[.8,.8,.8],externalColor:[1,1,1,1],colorMixMode:"multiply",opacity:1,layerOpacity:1,hasVertexColors:!1,hasSymbolColors:!1,doubleSided:!1,doubleSidedType:"normal",cullFace:R.Vr.Back,instanced:void 0,instancedDoublePrecision:!1,normals:"default",receiveSSAO:!0,enableFillLights:!0,receiveShadows:!0,castShadows:!0,shadowMappingEnabled:!1,verticalOffset:null,screenSizePerspective:null,hasSlicePlane:!1,hasSliceHighlight:!0,offsetTransparentBackfaces:!1,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvSizeValue:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],vvSymbolAnchor:[0,0,0],vvSymbolRotationMatrix:(0,a.c)(),modelTransformation:null,transparent:!1,writeDepth:!0,customDepthTest:R.Gv.Less,textureAlphaMode:R.JJ.Blend,textureAlphaCutoff:We.F,textureAlphaPremultiplied:!1,hasOccludees:!1,...new ze.d4,...Ye};class Br{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(F.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,n,o){for(const a of t.fieldNames){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case F.T.POSITION:{(0,w.hu)(3===t.size);const e=n.getField(a,h.ct);e&&hr(s,t.data,r,e,o);break}case F.T.NORMAL:{(0,w.hu)(3===t.size);const e=n.getField(a,h.ct);e&&fr(s,t.data,i,e,o);break}case F.T.UV0:{(0,w.hu)(2===t.size);const e=n.getField(a,h.Eu);e&&ur(s,t.data,e,o);break}case F.T.COLOR:{(0,w.hu)(3===t.size||4===t.size);const e=n.getField(a,h.mc);e&&pr(s,t.data,t.size,e,o);break}case F.T.SYMBOLCOLOR:{(0,w.hu)(3===t.size||4===t.size);const e=n.getField(a,h.mc);e&&pr(s,t.data,t.size,e,o);break}case F.T.TANGENT:{(0,w.hu)(4===t.size);const e=n.getField(a,h.ek);e&&mr(s,t.data,i,e,o);break}}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const Ur=(0,u.c)(),zr=(0,u.c)(),Gr=(0,u.f)(0,0,1),Vr=(0,u.c)(),Wr=(0,u.c)(),qr=(0,u.c)(),kr=(0,u.c)(),Xr=A.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function $r(e){throw new b.Z("",`Request for object resource failed: ${e}`)}function jr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Xr.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Xr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Xr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Xr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Xr.warn("Indexed geometries must specify faces"),i=!1;break}default:Xr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Xr.warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(Xr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Kr(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,n.pC)(r)&&((0,d.pp)(t,r.getBBMin()),(0,d.pp)(t,r.getBBMax()))})),t}async function Yr(e,t){const r=[];for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Xr.warn("Externally referenced texture data is not yet supported");continue}const s=o.encoding+";base64,"+a,l="/textureDefinitions/"+i,c="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",u={noUnpackFlip:!0,wrap:{s:j.e8.REPEAT,t:j.e8.REPEAT},preMultiplyAlpha:Zr(c)!==R.JJ.Opaque},d=(0,n.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(d.then((e=>({refId:l,image:e,params:u,alphaChannelUsage:c}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}function Zr(e){switch(e){case"mask":return R.JJ.Mask;case"maskAndTransparency":return R.JJ.MaskBlend;case"none":return R.JJ.Opaque;default:return R.JJ.Blend}}function Jr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Qr=new S.G(1,2,"wosr");var ei=r(57758),ti=r(10816),ri=r(75488),ii=r(56067);async function ni(e,t){const r=oi((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,n.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,x.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,E.r9)(i.error),$r(i.error.details.url)}(e,r,t);const i=await(0,x.q6)((0,T.default)(e,(0,n.Wg)(t)));if(!0===i.ok)return i.value.data;(0,E.r9)(i.error),$r(i.error)}(e,t);return{resource:r,textures:await Yr(r.textureDefinitions,t)}}(r.url,t)),i=function(e,t){const r=[],i=[],o=[],a=[],s=e.resource,l=S.G.parse(s.version||"1.0","wosr");Qr.validate(l);const c=s.model.name,d=s.model.geometries,h=s.materialDefinitions,f=e.textures;let m=0;const p=new Map;for(let e=0;e<d.length;e++){const s=d[e];if(!jr(s))continue;const l=Jr(s),c=s.params.vertexAttributes,g=[];for(const e in c){const t=c[e],r=t.values;g.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const v=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)v.push([t,new Uint32Array(e[t].values)])}const _=f&&f[l.texture];if(_&&!p.has(l.texture)){const{image:e,params:t}=_,r=new Le(e,t);a.push(r),p.set(l.texture,r)}const T=p.get(l.texture),x=T?T.id:void 0;let b=o[l.material]?o[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,a=_?Zr(_.alphaChannelUsage):void 0,s={ambient:(0,u.d)(e.diffuse),diffuse:(0,u.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:a,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:R.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!_&&!!_.params.preMultiplyAlpha};(0,n.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new Lr(s),o[l.material]||(o[l.material]={}),o[l.material][l.texture]=b}i.push(b);const A=new H(g,v);m+=v.position?v.position.length:0,r.push(A)}return{name:c,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:Kr(r),numberOfVertices:m,lodThreshold:null}}(e,t);return{lods:[i],referenceBoundingBox:i.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const o=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,v.z)(new g.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,n.U2)(o.model.meta,"ESRI_proxyEllipsoid");o.meta.isEsriSymbolResource&&(0,n.pC)(a)&&o.meta.uri.includes("/RealisticTrees/")&&function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const o of i.parts){const i=o.attributes.normal;if((0,n.Wi)(i))return;const a=o.attributes.position,d=a.count,f=(0,u.c)(),m=(0,u.c)(),g=(0,u.c)(),v=(0,p.gS)(h.mc,d),_=(0,p.gS)(h.ct,d),T=(0,s.a)((0,l.c)(),o.transform);for(let n=0;n<d;n++){a.getVec(n,m),i.getVec(n,f),(0,c.m)(m,m,o.transform),(0,c.b)(g,m,t.center),(0,c.E)(g,g,t.radius);const s=g[2],l=(0,c.l)(g),u=Math.min(.45+.55*l*l,1);(0,c.E)(g,g,t.radius),(0,c.m)(g,g,T),(0,c.n)(g,g),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(g,g,f,s>-1?.2:Math.min(-4*s-3.8,1)),_.setVec(n,g),v.set(n,0,255*u),v.set(n,1,255*u),v.set(n,2,255*u),v.set(n,3,255)}o.attributes.normal=_,o.attributes.color=v}}}(o,a);const d=o.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:o.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:o.customMeta.esriTreeRendering};if(null!=r.specifiedLodIndex){const e=ai(o,d,f,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=ai(o,d,f,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1,remove:o.remove}}const m=ai(o,d,f);return{lods:m,referenceBoundingBox:m[0].boundingBox,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1,remove:o.remove}}function oi(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function ai(e,t,r,i){const s=e.model,l=(0,a.c)(),c=new Array,u=new Map,g=new Map;return s.lods.forEach(((e,a)=>{if(void 0!==i&&a!==i)return;const v={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,n.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,d.cS)()};c.push(v),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=s.materials.get(e.material),c=(0,n.pC)(e.attributes.texCoord0),T=(0,n.pC)(e.attributes.normal),x=function(e){switch(e){case"BLEND":return R.JJ.Blend;case"MASK":return R.JJ.Mask;case"OPAQUE":case null:case void 0:return R.JJ.Opaque}}(a.alphaMode);if(!u.has(i)){if(c){if((0,n.pC)(a.textureColor)&&!g.has(a.textureColor)){const e=s.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:x!==R.JJ.Opaque};g.set(a.textureColor,new Le(e.data,t))}if((0,n.pC)(a.textureNormal)&&!g.has(a.textureNormal)){const e=s.textures.get(a.textureNormal);g.set(a.textureNormal,new Le(e.data,e.parameters))}if((0,n.pC)(a.textureOcclusion)&&!g.has(a.textureOcclusion)){const e=s.textures.get(a.textureOcclusion);g.set(a.textureOcclusion,new Le(e.data,e.parameters))}if((0,n.pC)(a.textureEmissive)&&!g.has(a.textureEmissive)){const e=s.textures.get(a.textureEmissive);g.set(a.textureEmissive,new Le(e.data,e.parameters))}if((0,n.pC)(a.textureMetallicRoughness)&&!g.has(a.textureMetallicRoughness)){const e=s.textures.get(a.textureMetallicRoughness);g.set(a.textureMetallicRoughness,new Le(e.data,e.parameters))}}const o=a.color[0]**(1/ei.K),l=a.color[1]**(1/ei.K),d=a.color[2]**(1/ei.K),h=a.emissiveFactor[0]**(1/ei.K),f=a.emissiveFactor[1]**(1/ei.K),m=a.emissiveFactor[2]**(1/ei.K),p=(0,n.pC)(a.textureColor)&&c?g.get(a.textureColor):null;u.set(i,new Lr({...t,transparent:x===R.JJ.Blend,customDepthTest:R.Gv.Lequal,textureAlphaMode:x,textureAlphaCutoff:a.alphaCutoff,diffuse:[o,l,d],ambient:[o,l,d],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?R.Vr.None:R.Vr.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:T?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,enableFillLights:!0,textureId:(0,n.pC)(p)?p.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:(0,n.pC)(a.textureNormal)&&c?g.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:(0,n.pC)(p)&&!!p.params.preMultiplyAlpha,occlusionTextureId:(0,n.pC)(a.textureOcclusion)&&c?g.get(a.textureOcclusion).id:void 0,emissiveTextureId:(0,n.pC)(a.textureEmissive)&&c?g.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,n.pC)(a.textureMetallicRoughness)&&c?g.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,m],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...r}))}const b=function(e,t){switch(t){case j.MX.TRIANGLES:return(0,_.nh)(e);case j.MX.TRIANGLE_STRIP:return(0,_.DA)(e);case j.MX.TRIANGLE_FAN:return(0,_.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),A=e.attributes.position.count,E=(0,p.gS)(h.ct,A);(0,f.t)(E,e.attributes.position,e.transform);const S=[[F.T.POSITION,{data:E.typedBuffer,size:E.elementCount,exclusive:!0}]],M=[[F.T.POSITION,b]];if((0,n.pC)(e.attributes.normal)){const t=(0,p.gS)(h.ct,A);(0,o.a)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([F.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([F.T.NORMAL,b])}if((0,n.pC)(e.attributes.tangent)){const t=(0,p.gS)(h.ek,A);(0,o.a)(l,e.transform),(0,m.t)(t,e.attributes.tangent,l),S.push([F.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([F.T.TANGENT,b])}if((0,n.pC)(e.attributes.texCoord0)){const t=(0,p.gS)(h.Eu,A);(0,ti.n)(t,e.attributes.texCoord0),S.push([F.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([F.T.UV0,b])}if((0,n.pC)(e.attributes.color)){const t=(0,p.gS)(h.mc,A);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,m.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,ri.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,m.s)(t,e.attributes.color,1/256);else{(0,ri.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,ii.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([F.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([F.T.COLOR,b])}const C=new H(S,M);v.stageResources.geometries.push(C),v.stageResources.materials.push(u.get(i)),c&&((0,n.pC)(a.textureColor)&&v.stageResources.textures.push(g.get(a.textureColor)),(0,n.pC)(a.textureNormal)&&v.stageResources.textures.push(g.get(a.textureNormal)),(0,n.pC)(a.textureOcclusion)&&v.stageResources.textures.push(g.get(a.textureOcclusion)),(0,n.pC)(a.textureEmissive)&&v.stageResources.textures.push(g.get(a.textureEmissive)),(0,n.pC)(a.textureMetallicRoughness)&&v.stageResources.textures.push(g.get(a.textureMetallicRoughness))),v.numberOfVertices+=A;const w=C.boundingInfo;(0,n.pC)(w)&&((0,d.pp)(v.boundingBox,w.getBBMin()),(0,d.pp)(v.boundingBox,w.getBBMax()))}))})),c}},6206:(e,t,r)=>{var i,n;r.d(t,{a9:()=>i}),r(22021),(n=i||(i={}))[n.Multiply=1]="Multiply",n[n.Ignore=2]="Ignore",n[n.Replace=3]="Replace",n[n.Tint=4]="Tint"},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),n=r(79583);class o{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new o(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}}}class a{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,n.n1)(t.ElementType),o=this.stride;this.fields.set(e,{size:i,constructor:t,offset:o,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new o(this,e)}createView(e){return new o(this,e)}clone(){const e=new a;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new a}},1391:(e,t,r)=>{r.d(t,{q:()=>l});var i=r(18361),n=r(2095),o=r(57220),a=r(74709),s=r(67498);function l(e,t){t.output===i.H.Color&&t.receiveShadows?(e.varyings.add("linearDepth","float"),e.vertex.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`)):t.output===i.H.Depth||t.output===i.H.Shadow?(e.include(n.up,t),e.varyings.add("linearDepth","float"),e.vertex.uniforms.add(new o.e("nearFar",s.P.Pass,((e,t)=>t.camera.nearFar))),e.vertex.code.add(a.H`void forwardLinearDepth() {
160
+ linearDepth = (-positionView().z - nearFar[0]) / (nearFar[1] - nearFar[0]);
161
+ }`)):e.vertex.code.add(a.H`void forwardLinearDepth() {}`)}},62707:(e,t,r)=>{r.d(t,{w:()=>n});var i=r(74709);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
162
162
  vec3 camToVert = posWorld - camPosWorld;
163
163
  bool isBackface = dot(camToVert, normalWorld) > 0.0;
164
164
  if (isBackface) {
@@ -306,7 +306,14 @@ vuv0 = uv0;
306
306
  vuv0 = uv0;
307
307
  vuvRegion = uvRegion;
308
308
  }`);case i.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);default:(0,o.Bg)(t.textureCoordinateType);case i.COUNT:return}}(n=i||(i={}))[n.None=0]="None",n[n.Default=1]="Default",n[n.Atlas=2]="Atlas",n[n.COUNT=3]="COUNT"},11317:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(74709),n=r(35065);function o(e,t){t.hasVertexColors?(e.attributes.add(n.T.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
309
- void forwardNormalizedVertexColor() {}`)}},99917:(e,t,r)=>{r.d(t,{Bb:()=>p,d4:()=>g});var i=r(46521),n=(r(88669),r(64267)),o=r(13598),a=r(65617),s=r(37099),l=r(89243),c=r(32558),u=r(74709),d=r(21471),h=r(85594),f=r(67498);function m(e,t){e.include(s.f),e.vertex.include(l.$,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3");const r=e.vertex.uniforms;r.add(new c.K("transformWorldFromViewTH",f.P.Pass,(e=>e.transformWorldFromViewTH))),r.add(new c.K("transformWorldFromViewTL",f.P.Pass,(e=>e.transformWorldFromViewTL))),r.add(new d.c("transformViewFromCameraRelativeRS",f.P.Pass,(e=>e.transformViewFromCameraRelativeRS))),r.add(new h.B("transformProjFromView",f.P.Pass,(e=>e.transformProjFromView))),r.add(new d.c("transformWorldFromModelRS",f.P.Draw,(e=>e.transformWorldFromModelRS))),r.add(new c.K("transformWorldFromModelTH",f.P.Draw,(e=>e.transformWorldFromModelTH))),r.add(new c.K("transformWorldFromModelTL",f.P.Draw,(e=>e.transformWorldFromModelTL))),e.vertex.code.add(u.H`vec3 positionWorldCameraRelative() {
309
+ void forwardNormalizedVertexColor() {}`)}},15719:(e,t,r)=>{r.d(t,{Bb:()=>c,d4:()=>u});var i=r(46521),n=(r(88669),r(64267)),o=r(2095),a=r(74709),s=r(21471),l=r(67498);function c(e,t){if(t.normalType===n.h.Attribute||t.normalType===n.h.CompressedAttribute){e.include(n.O,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3");const r=e.vertex.uniforms;r.add(new s.c("transformNormalGlobalFromModel",l.P.Draw,(e=>e.transformNormalGlobalFromModel))),r.add(new s.c("transformNormalViewFromGlobal",l.P.Pass,(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(a.H`void forwardNormal() {
310
+ vNormalWorld = transformNormalGlobalFromModel * normalModel();
311
+ vNormalView = transformNormalViewFromGlobal * vNormalWorld;
312
+ }`)}else t.normalType===n.h.Ground?(e.include(o.up,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(a.H`
313
+ void forwardNormal() {
314
+ vNormalWorld = ${t.spherical?a.H`normalize(vPositionWorldCameraRelative);`:a.H`vec3(0.0, 0.0, 1.0);`}
315
+ }
316
+ `)):e.vertex.code.add(a.H`void forwardNormal() {}`)}class u extends o.su{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.c)()}}},2095:(e,t,r)=>{r.d(t,{su:()=>m,up:()=>f});var i=r(46521),n=r(13598),o=(r(72119),r(65617)),a=r(37099),s=r(89243),l=r(32558),c=r(74709),u=r(21471),d=r(85594),h=r(67498);function f(e,t){e.include(a.f);const r=e.vertex;r.include(s.$,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new l.K("transformWorldFromViewTH",h.P.Pass,(e=>e.transformWorldFromViewTH))),r.uniforms.add(new l.K("transformWorldFromViewTL",h.P.Pass,(e=>e.transformWorldFromViewTL))),r.uniforms.add(new u.c("transformViewFromCameraRelativeRS",h.P.Pass,(e=>e.transformViewFromCameraRelativeRS))),r.uniforms.add(new d.B("transformProjFromView",h.P.Pass,(e=>e.transformProjFromView))),r.uniforms.add([new u.c("transformWorldFromModelRS",h.P.Draw,(e=>e.transformWorldFromModelRS)),new l.K("transformWorldFromModelTH",h.P.Draw,(e=>e.transformWorldFromModelTH)),new l.K("transformWorldFromModelTL",h.P.Draw,(e=>e.transformWorldFromModelTL))]),r.code.add(c.H`vec3 positionWorldCameraRelative() {
310
317
  vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
311
318
  vec3 transform_CameraRelativeFromModel = dpAdd(
312
319
  transformWorldFromModelTL,
@@ -316,26 +323,19 @@ transformWorldFromModelTH,
316
323
  );
317
324
  return transform_CameraRelativeFromModel + rotatedModelPosition;
318
325
  }
319
- vec3 position_view() {
326
+ vec3 positionView() {
320
327
  return transformViewFromCameraRelativeRS * positionWorldCameraRelative();
321
328
  }
322
329
  void forwardPosition() {
323
330
  vPositionWorldCameraRelative = positionWorldCameraRelative();
324
- vPosition_view = position_view();
331
+ vPosition_view = positionView();
325
332
  gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
326
333
  }
327
334
  vec3 positionWorld() {
328
335
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
329
- }`),e.fragment.uniforms.add(new c.K("transformWorldFromViewTL",f.P.Pass,(e=>e.transformWorldFromViewTL))),e.fragment.code.add(u.H`vec3 positionWorld() {
336
+ }`),e.fragment.uniforms.add(new l.K("transformWorldFromViewTL",h.P.Pass,(e=>e.transformWorldFromViewTL))),e.fragment.code.add(c.H`vec3 positionWorld() {
330
337
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
331
- }`)}function p(e,t){if(t.normalType===n.h.Attribute||t.normalType===n.h.CompressedAttribute){e.include(n.O,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3");const r=e.vertex.uniforms;r.add(new d.c("transformNormalGlobalFromModel",f.P.Draw,(e=>e.transformNormalGlobalFromModel))),r.add(new d.c("transformNormalViewFromGlobal",f.P.Pass,(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(u.H`void forwardNormal() {
332
- vNormalWorld = transformNormalGlobalFromModel * normalModel();
333
- vNormalView = transformNormalViewFromGlobal * vNormalWorld;
334
- }`)}else t.normalType===n.h.Ground?(e.include(m,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(u.H`
335
- void forwardNormal() {
336
- vNormalWorld = ${t.spherical?u.H`normalize(vPositionWorldCameraRelative);`:u.H`vec3(0.0, 0.0, 1.0);`}
337
- }
338
- `)):e.vertex.code.add(u.H`void forwardNormal() {}`)}class g extends class{constructor(){this.transformWorldFromViewTH=(0,a.c)(),this.transformWorldFromViewTL=(0,a.c)(),this.transformViewFromCameraRelativeRS=(0,i.c)(),this.transformProjFromView=(0,o.c)()}}{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.c)()}}},91982:(e,t,r)=>{r.d(t,{i:()=>s});var i=r(74085),n=r(135),o=r(74709);function a(e){e.extensions.add("GL_EXT_shader_texture_lod"),e.extensions.add("GL_OES_standard_derivatives"),e.fragment.code.add(o.H`#ifndef GL_EXT_shader_texture_lod
338
+ }`)}class m{constructor(){this.transformWorldFromViewTH=(0,o.c)(),this.transformWorldFromViewTL=(0,o.c)(),this.transformViewFromCameraRelativeRS=(0,i.c)(),this.transformProjFromView=(0,n.c)()}}},91982:(e,t,r)=>{r.d(t,{i:()=>s});var i=r(74085),n=r(135),o=r(74709);function a(e){e.extensions.add("GL_EXT_shader_texture_lod"),e.extensions.add("GL_OES_standard_derivatives"),e.fragment.code.add(o.H`#ifndef GL_EXT_shader_texture_lod
339
339
  float calcMipMapLevel(const vec2 ddx, const vec2 ddy) {
340
340
  float deltaMaxSqr = max(dot(ddx, ddx), dot(ddy, ddy));
341
341
  return max(0.0, 0.5 * log2(deltaMaxSqr));
@@ -412,7 +412,7 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
412
412
  vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
413
413
  return worldPos + calculateVerticalOffset(worldPos, localOrigin);
414
414
  }
415
- `)):r.add(i.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}function l(e,t,r){if(!t.verticalOffset)return;const i=function(e,t,r,i=c){return i.screenLength=e.screenLength,i.perDistance=Math.tan(.5*t)/(.5*r),i.minWorldLength=e.minWorldLength,i.maxWorldLength=e.maxWorldLength,i}(t.verticalOffset,r.camera.fovY,r.camera.fullViewport[3]),n=r.camera.pixelRatio||1;e.setUniform4f("verticalOffset",i.screenLength*n,i.perDistance,i.minWorldLength,i.maxWorldLength)}const c={screenLength:0,perDistance:0,minWorldLength:0,maxWorldLength:0}},22019:(e,t,r)=>{r.d(t,{s:()=>A});var i=r(18361),n=r(51546),o=r(77171),a=r(64267),s=r(135),l=r(99917),c=r(20285),u=r(74709);function d(e,t){e.fragment.include(c.n),t.output===i.H.Shadow?(e.extensions.add("GL_OES_standard_derivatives"),e.fragment.code.add(u.H`float _calculateFragDepth(const in float depth) {
415
+ `)):r.add(i.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}function l(e,t,r){if(!t.verticalOffset)return;const i=function(e,t,r,i=c){return i.screenLength=e.screenLength,i.perDistance=Math.tan(.5*t)/(.5*r),i.minWorldLength=e.minWorldLength,i.maxWorldLength=e.maxWorldLength,i}(t.verticalOffset,r.camera.fovY,r.camera.fullViewport[3]),n=r.camera.pixelRatio||1;e.setUniform4f("verticalOffset",i.screenLength*n,i.perDistance,i.minWorldLength,i.maxWorldLength)}const c={screenLength:0,perDistance:0,minWorldLength:0,maxWorldLength:0}},22019:(e,t,r)=>{r.d(t,{s:()=>A});var i=r(18361),n=r(51546),o=r(77171),a=r(64267),s=r(135),l=r(15719),c=r(20285),u=r(74709);function d(e,t){e.fragment.include(c.n),t.output===i.H.Shadow?(e.extensions.add("GL_OES_standard_derivatives"),e.fragment.code.add(u.H`float _calculateFragDepth(const in float depth) {
416
416
  const float SLOPE_SCALE = 2.0;
417
417
  const float BIAS = 2.0 * .000015259;
418
418
  float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
@@ -973,4 +973,4 @@ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
973
973
  );
974
974
  float rgba2float(vec4 rgba) {
975
975
  return dot(rgba, RGBA_2_FLOAT_FACTORS);
976
- }`)}},10962:(e,t,r)=>{r.d(t,{S:()=>d,h:()=>u});var i=r(52138),n=r(10937),o=r(17896),a=r(65617),s=r(32558),l=r(85594),c=r(67498);function u(e,t){e.add(new s.K("cameraPosition",c.P.Draw,((e,r)=>t.instancedDoublePrecision?a.Z:(0,o.s)(f,r.camera.viewInverseTransposeMatrix[3]-e.origin[0],r.camera.viewInverseTransposeMatrix[7]-e.origin[1],r.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function d(e,t){if(e.vertex.uniforms.add(new l.B("proj",c.P.Pass,((e,t)=>t.camera.projectionMatrix))),t.instancedDoublePrecision){const t=(e,t)=>(0,o.s)(f,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]);e.vertex.uniforms.add(new l.B("view",c.P.Pass,((e,r)=>(0,i.j)(h,r.camera.viewMatrix,t(e,r)))));const r=new s.K("localOrigin",c.P.Pass,t);return e.vertex.uniforms.add(r),r}e.vertex.uniforms.add(new l.B("view",c.P.Draw,((e,t)=>(0,i.j)(h,t.camera.viewMatrix,e.origin))));const r=new s.K("localOrigin",c.P.Draw,(e=>e.origin));return e.vertex.uniforms.add(r),r}const h=(0,n.c)(),f=(0,a.c)()},57220:(e,t,r)=>{r.d(t,{e:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"vec2",t,r?(t,i,n)=>t.setUniform2fv(e,r(i,n)):null);default:super(e,"vec2")}}}},32558:(e,t,r)=>{r.d(t,{K:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"vec3",t,r?(t,i,n)=>t.setUniform3fv(e,r(i,n)):null);default:super(e,"vec3")}}}},18465:(e,t,r)=>{r.d(t,{y:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"vec4",t,r?(t,i,n)=>t.setUniform4fv(e,r(i,n)):null);default:super(e,"vec4")}}}},45436:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"float",t,r?(t,i,n)=>t.setUniform1f(e,r(i,n)):null);default:super(e,"float")}}}},68174:(e,t,r)=>{r.d(t,{S:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"int",t,r?(t,i,n)=>t.setUniform1i(e,r(i,n)):null);default:super(e,"int")}}}},21471:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"mat3",t,r?(t,i,n)=>t.setUniformMatrix3fv(e,r(i,n)):null);default:super(e,"mat3",null,null)}}}},85594:(e,t,r)=>{r.d(t,{B:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r,i=null){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"mat4",t,r?(t,i,n)=>t.setUniformMatrix4fv(e,r(i,n)):null,i);default:super(e,"mat4",null,null,i)}}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),n=r(92604),o=r(70586);const a=n.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this.includedModules=new Map}include(e,t){this.includedModules.has(e)?this.includedModules.get(e)!==t&&a.error("Trying to include shader module multiple times with different sets of options."):(this.includedModules.set(e,t),e(this.builder,t))}}class l extends s{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new h,this.varyings=new f,this.extensions=new m,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s="vertex"===e?v:g,l=this.constants.generateSource().concat(n.constants.generateSource());return`\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${o.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${a.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,o.pC)(i)&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,o.pC)(i)&&r.set(t.name,i)}));const i=Array.from(r.values());return(e,r)=>{for(const n of i)n(t,e,r)}}}class c{constructor(){this._entries=new Map}add(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)}generateSource(){return Array.from(this._entries.values()).map((e=>(0,o.pC)(e.arraySize)?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class u{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class d extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new u,this.constants=new p}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`attribute ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(){return this._entries.map((e=>`varying ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=[]}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.push(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",v="precision highp float;\nprecision highp sampler2D;"},12139:(e,t,r)=>{r.d(t,{Q:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r,i=null){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"sampler2D",t,r?(t,i,n)=>t.bindTexture(e,r(i,n)):null,i);default:super(e,"sampler2D",null,null,i)}}}},79884:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(67498);class n{constructor(e,t,r,n,o=null){this.name=e,this.type=t,this.arraySize=o,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},this.bind[r]=n}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{function i(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;r.d(t,{H:()=>i}),(n=i||(i={})).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={}))},50173:(e,t,r)=>{var i;r.d(t,{C:()=>i}),function(e){e[e.MATERIAL=0]="MATERIAL",e[e.MATERIAL_ALPHA=1]="MATERIAL_ALPHA",e[e.MATERIAL_DEPTH=2]="MATERIAL_DEPTH",e[e.MATERIAL_NORMAL=3]="MATERIAL_NORMAL",e[e.MATERIAL_DEPTH_SHADOWMAP_ALL=4]="MATERIAL_DEPTH_SHADOWMAP_ALL",e[e.MATERIAL_HIGHLIGHT=5]="MATERIAL_HIGHLIGHT",e[e.MATERIAL_DEPTH_SHADOWMAP_DEFAULT=6]="MATERIAL_DEPTH_SHADOWMAP_DEFAULT",e[e.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT=7]="MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT"}(i||(i={}))},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.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",e[e.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=12]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=14]="HUD_MATERIAL",e[e.LABEL_MATERIAL=15]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=16]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",e[e.DRAPED_WATER=19]="DRAPED_WATER",e[e.VOXEL=20]="VOXEL",e[e.MAX_SLOTS=21]="MAX_SLOTS"}(i||(i={}))},11726:(e,t,r)=>{r.d(t,{hu:()=>n}),r(4307),r(97323),r(98766),(0,r(88669).c)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function n(e,t){if(!e)throw t=t||"assert",console.log(new Error(t).stack),new i(t)}},35065:(e,t,r)=>{var i;r.d(t,{T:()=>i}),function(e){e.POSITION="position",e.NORMAL="normal",e.UV0="uv0",e.AUXPOS1="auxpos1",e.AUXPOS2="auxpos2",e.MAPPOS="mapPos",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.TANGENT="tangent",e.OFFSET="offset",e.SUBDIVISIONFACTOR="subdivisionFactor",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.NORMALCOMPRESSED="normalCompressed",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.FEATUREVALUE="featureValue",e.MODELORIGINHI="modelOriginHi",e.MODELORIGINLO="modelOriginLo",e.MODEL="model",e.MODELNORMAL="modelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMALA="normalA",e.NORMALB="normalB",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.U8PADDING="u8padding",e.U16PADDING="u16padding",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.EXTRUDE="extrude"}(i||(i={}))},47026:(e,t,r)=>{var i,n,o,a,s,l,c,u,d,h,f,m,p,g;r.d(t,{Am:()=>a,CE:()=>f,Gv:()=>n,JJ:()=>p,MX:()=>h,Rw:()=>l,Vr:()=>i,hU:()=>c}),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"}(n||(n={})),function(e){e[e.NONE=0]="NONE",e[e.SMAA=1]="SMAA"}(o||(o={})),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"}(a||(a={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(s||(s={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(l||(l={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(c||(c={})),function(e){e[e.ASYNC=0]="ASYNC",e[e.SYNC=1]="SYNC"}(u||(u={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(d||(d={})),function(e){e[e.Triangle=0]="Triangle",e[e.Point=1]="Point",e[e.Line=2]="Line"}(h||(h={})),function(e){e[e.STRETCH=1]="STRETCH",e[e.PAD=2]="PAD"}(f||(f={})),function(e){e[e.CHANGED=0]="CHANGED",e[e.UNCHANGED=1]="UNCHANGED"}(m||(m={})),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"}(p||(p={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(g||(g={}))},37782:(e,t,r)=>{r.d(t,{bj:()=>M,FZ:()=>y,Uf:()=>R,Bw:()=>g,LO:()=>C,Hx:()=>S});var i=r(67676),n=r(22021),o=r(70586),a=r(17896),s=r(65617),l=r(60437),c=r(47026);function u(e,t){return Math.max((0,n.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}r(64822),(0,n.Vl)(10),(0,n.Vl)(12),(0,n.Vl)(70),(0,n.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var h=r(11726),f=r(35065),m=(r(52138),r(13598));r(9820),new Float64Array(3),new Float32Array(6),(0,m.c)();const p=(0,l.Ue)();function g(e,t,r,i,n,a,s){if(!function(e){return!!(0,o.pC)(e)&&!e.visible}(t))if(e.boundingInfo){(0,h.hu)(e.primitiveType===c.MX.Triangle);const t=r.tolerance;_(e.boundingInfo,i,n,t,a,s)}else{const t=e.indices.get(f.T.POSITION),r=e.vertexAttributes.get(f.T.POSITION);x(i,n,0,t.length/3,t,r,void 0,a,s)}}const v=(0,s.c)();function _(e,t,r,i,n,s){if((0,o.Wi)(e))return;const c=function(e,t,r){return(0,a.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,v);if((0,l.op)(p,e.getBBMin()),(0,l.Tn)(p,e.getBBMax()),(0,o.pC)(n)&&n.applyToAabb(p),function(e,t,r,i){return function(e,t,r,i,n){const o=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(o,a),l=Math.max(o,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)}(p,t,c,i)){const{primitiveIndices:o,indices:a,position:l}=e,c=o?o.length:a.length/3;if(c>P){const o=e.getChildren();if(void 0!==o){for(let e=0;e<8;++e)void 0!==o[e]&&_(o[e],t,r,i,n,s);return}}x(t,r,0,c,a,l,o,n,s)}}const T=(0,s.c)();function x(e,t,r,i,n,a,s,l,c){if(s)return function(e,t,r,i,n,a,s,l,c){const u=a.data,d=a.stride||a.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,v=t[2]-m;for(let e=r;e<i;++e){const t=s[e];let r=3*t,i=d*n[r++],a=u[i++],_=u[i++],x=u[i];i=d*n[r++];let b=u[i++],A=u[i++],S=u[i];i=d*n[r];let M=u[i++],R=u[i++],C=u[i];(0,o.pC)(l)&&([a,_,x]=l.applyToVertex(a,_,x,e),[b,A,S]=l.applyToVertex(b,A,S,e),[M,R,C]=l.applyToVertex(M,R,C,e));const w=b-a,y=A-_,P=S-x,O=M-a,N=R-_,I=C-x,D=g*I-N*v,L=v*O-I*p,F=p*N-O*g,H=w*D+y*L+P*F;if(Math.abs(H)<=Number.EPSILON)continue;const B=h-a,U=f-_,z=m-x,G=B*D+U*L+z*F;if(H>0){if(G<0||G>H)continue}else if(G>0||G<H)continue;const V=U*P-y*z,W=z*w-P*B,q=B*y-w*U,k=p*V+g*W+v*q;if(H>0){if(k<0||G+k>H)continue}else if(k>0||G+k<H)continue;const X=(O*V+N*W+I*q)/H;X>=0&&c(X,E(w,y,P,O,N,I,T),t,!1)}}(e,t,r,i,n,a,s,l,c);const u=a.data,d=a.stride||a.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,v=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=d*n[t++],i=u[r++],a=u[r++],s=u[r];r=d*n[t++];let _=u[r++],x=u[r++],b=u[r];r=d*n[t++];let A=u[r++],S=u[r++],M=u[r];(0,o.pC)(l)&&([i,a,s]=l.applyToVertex(i,a,s,e),[_,x,b]=l.applyToVertex(_,x,b,e),[A,S,M]=l.applyToVertex(A,S,M,e));const R=_-i,C=x-a,w=b-s,y=A-i,P=S-a,O=M-s,N=g*O-P*v,I=v*y-O*p,D=p*P-y*g,L=R*N+C*I+w*D;if(Math.abs(L)<=Number.EPSILON)continue;const F=h-i,H=f-a,B=m-s,U=F*N+H*I+B*D;if(L>0){if(U<0||U>L)continue}else if(U>0||U<L)continue;const z=H*w-C*B,G=B*R-w*F,V=F*C-R*H,W=p*z+g*G+v*V;if(L>0){if(W<0||U+W>L)continue}else if(W>0||U+W<L)continue;const q=(y*z+P*G+O*V)/L;q>=0&&c(q,E(R,C,w,y,P,O,T),e,!1)}}const b=(0,s.c)(),A=(0,s.c)();function E(e,t,r,i,n,o,s){return(0,a.s)(b,e,t,r),(0,a.s)(A,i,n,o),(0,a.f)(s,b,A),(0,a.n)(s,s),s}function S(e,t,r,i,o){let a=(r.screenLength||0)*e.pixelRatio;o&&(a=function(e,t,r,i){return u(e,function(e,t,r){const i=r.parameters,n=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=n,d}(t,r,i))}(a,i,t,o));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function M(e,t,r){if(!e)return;const i=e.parameters,n=e.paddingPixelsOverride;t.setUniform4f(r,i.divisor,i.offset,i.minPixelSize,n)}function R(e,t){const r=t?R(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=w(i)),null==i&&t in r||(r[t]=i)}return r}function C(e,t){let r=!1;for(const n in t){const o=t[n];void 0!==o&&(Array.isArray(o)?null===e[n]?(e[n]=o.slice(),r=!0):(0,i.Vx)(e[n],o)&&(r=!0):e[n]!==o&&(r=!0,e[n]=o))}return r}function w(e){const t=[];return e.forEach((e=>t.push(e))),t}const y={multiply:1,ignore:2,replace:3,tint:4},P=1e3},64822:(e,t,r)=>{var i;r.d(t,{JY:()=>i}),function(e){e[e.Global=1]="Global",e[e.Local=2]="Local"}(i||(i={}))},75656:(e,t,r)=>{r.d(t,{x:()=>c}),r(80442);var i=r(22021),n=r(70586),o=r(49300),a=r(54738),s=r(35371),l=r(46314);class c{constructor(e,t,r=null){if(this._context=e,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(s._g.Texture,this),this._descriptor={target:s.No.TEXTURE_2D,samplingMode:s.cw.LINEAR,wrapMode:s.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1,...t},e.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),h(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTextureAllUnits(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor;null!=t||(t=i.target);const a=h(t);var m;null===e&&(i.width=i.width||4,i.height=i.height||4,a&&(i.depth=null!=(m=i.depth)?m:1));const p=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),c._validateTexture(this._context,i),this._configurePixelStorage();const g=i.pixelFormat;let v=i.internalFormat?i.internalFormat:this._deriveInternalFormat(g,i.dataType);if(d(e)){let n=e.width,s=e.height;const l=1;e instanceof HTMLVideoElement&&(n=e.videoWidth,s=e.videoHeight),i.width&&i.height,a&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,v,i.hasMipmap,n,s,l),this._texImage(t,0,v,n,s,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=n),void 0===i.height&&(i.height=s),a&&void 0===i.depth&&(i.depth=l)}else{const{width:c,height:d,depth:h}=i;if(null!=c&&null!=d||console.error("Width and height must be specified!"),a&&null==h&&console.error("Depth must be specified!"),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,v,i.hasMipmap,c,d,h),r.DEPTH24_STENCIL8&&v===r.DEPTH_STENCIL&&(v=r.DEPTH24_STENCIL8),u(e)){const n=e.levels,o=f(t,c,d,h),a=Math.min(o-1,n.length-1);(0,l.Z)(r)?r.texParameteri(i.target,r.TEXTURE_MAX_LEVEL,a):i.hasMipmap=i.hasMipmap&&o===n.length;const u=v;if(!function(e){return e in s.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,r,i,o)=>{const a=n[Math.min(e,n.length-1)];this._compressedTexImage(t,e,u,r,i,o,a)}),a)}else(0,n.pC)(e)?(this._texImage(t,0,v,c,d,h,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,i,n,a)=>{this._texImage(t,e,v,i,n,a,null),(0,o.zu)(r)}))}c._applySamplingMode(r,this._descriptor),c._applyWrapMode(r,this._descriptor),c._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(p,c.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,n,o){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const a=this._context.gl,s=this._descriptor,{pixelFormat:l,internalFormat:h,dataType:f,isImmutable:m,target:p}=s;if(m&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);(t<0||r<0||i>s.width||n>s.height||t+i>s.width||r+n>s.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),d(o)?a.texSubImage2D(p,e,t,r,l,f,o):u(o)?a.compressedTexSubImage2D(p,e,t,r,i,n,h,o.levels[e]):a.texSubImage2D(p,e,t,r,i,n,l,f,o),this._context.bindTexture(g,c.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,n,o,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl;if(!(0,l.Z)(d))throw new Error("3D textures are not supported in WebGL1");const f=this._descriptor,{pixelFormat:m,dataType:p,isImmutable:g,target:v,internalFormat:_}=f;if(g&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");h(v)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||n>f.width||o>f.height||a>f.depth||t+n>f.width||r+o>f.height||i+a>f.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),u(s))s=s.levels[e],d.compressedTexSubImage3D(v,e,t,r,i,n,o,a,_,s);else{const l=s;d.texSubImage3D(v,e,t,r,i,n,o,a,m,p,l)}this._context.bindTexture(T,c.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,c._validateTexture(this._context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,c.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,c._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(c._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(c._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===a.zO.WEBGL1)return e;switch(t){case s.Br.FLOAT:switch(e){case s.VI.RGBA:return s.lP.RGBA32F;case s.VI.RGB:return s.lP.RGB32F;default:throw new Error("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(e){case s.VI.RGBA:return s.lP.RGBA8;case s.VI.RGB:return s.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,n,o){const a=this._context.gl;if(!(0,l.Z)(a))throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in s.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?f(e,i,n,o):1;h(e)?a.texStorage3D(e,c,t,i,n,o):a.texStorage2D(e,c,t,i,n),this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,s,l){const c=this._context.gl;let u=null;const f=this._context.type===a.zO.WEBGL2,m=h(e),{isImmutable:p,pixelFormat:g,dataType:v}=this._descriptor;if(f&&(u=c),f||!d(l))if(p){if((0,n.pC)(l)){const r=l;m?u.texSubImage3D(e,t,0,0,0,i,o,s,g,v,r):c.texSubImage2D(e,t,0,0,i,o,g,v,r)}}else{const a=(0,n.Wg)(l);m?u.texImage3D(e,t,r,i,o,s,0,g,v,a):c.texImage2D(e,t,r,i,o,0,g,v,a)}else c.texImage2D(e,0,r,g,v,l)}_compressedTexImage(e,t,r,i,o,s,l){const c=this._context.gl;let u=null;const d=h(e),f=this._descriptor.isImmutable;if(d){if(this._context.type!==a.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");u=c}f?(0,n.pC)(l)&&(d?u.compressedTexSubImage3D(e,t,0,0,0,i,o,s,r,l):c.compressedTexSubImage2D(e,t,0,0,i,o,r,l)):d?u.compressedTexImage3D(e,t,r,i,o,s,0,l):c.compressedTexImage2D(e,t,r,i,o,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:n,hasMipmap:o,target:a}=this._descriptor;const l=a===s.No.TEXTURE_3D;for(let a=0;e(a,r,i,n),o&&(1!==r||1!==i||l&&1!==n)&&!(a>=t);++a)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(n=Math.max(1,n>>1))}static _validateTexture(e,t){(t.width<0||t.height<0||t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=(0,l.Z)(e.gl),n=(0,i.wt)(t.width)&&(0,i.wt)(t.height);r||!t.isImmutable&&!h(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||n||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){var r;const i=e.capabilities.textureFilterAnisotropic;i&&e.gl.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY,null!=(r=t.maxAnisotropy)?r:1)}}function u(e){return(0,n.pC)(e)&&"type"in e&&"compressed"===e.type}function d(e){return(0,n.pC)(e)&&!u(e)&&!function(e){return(0,n.pC)(e)&&"byteLength"in e}(e)}function h(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let n=Math.max(t,r);return e===s.No.TEXTURE_3D&&(n=Math.max(n,i)),Math.round(Math.log(n)/Math.LN2)+1}c.TEXTURE_UNIT_FOR_UPDATES=0},21968:(e,t,r)=>{r.d(t,{G:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a}}},46314:(e,t,r)=>{function i(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}r.d(t,{Z:()=>i})},49300:(e,t,r)=>{r.d(t,{CG:()=>l,hZ:()=>s,zu:()=>c});var i=r(20102),n=r(80442);const o=r(92604).Z.getLogger("esri/views/webgl"),a=!!(0,n.Z)("enable-feature:webgl-debug");function s(){return a}function l(){return a}function c(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),n=(new Error).stack;o.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:n}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>s,zO:()=>i});var i,n,o=r(80442);function a(e){const t=(0,o.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":case"3d":return[i.WEBGL2,i.WEBGL1]}}function s(e,t,r={}){const n=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let o=null;for(const t of n){try{o=e.getContext(t,r)}catch(e){}if(o)break}return o}(n=i||(i={}))[n.WEBGL1=1]="WEBGL1",n[n.WEBGL2=2]="WEBGL2"},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)o[0]=e[i],t[i]=o[0];return t}function n(e,t){const r=e.length;for(let i=0;i<r;++i)o[0]=e[i],o[1]=e[i]-o[0],t[i]=o[1];return t}r.d(t,{GB:()=>n,U8:()=>i});const o=new Float32Array(2)}}]);
976
+ }`)}},10962:(e,t,r)=>{r.d(t,{S:()=>d,h:()=>u});var i=r(52138),n=r(10937),o=r(17896),a=r(65617),s=r(32558),l=r(85594),c=r(67498);function u(e,t){e.add(new s.K("cameraPosition",c.P.Draw,((e,r)=>t.instancedDoublePrecision?a.Z:(0,o.s)(f,r.camera.viewInverseTransposeMatrix[3]-e.origin[0],r.camera.viewInverseTransposeMatrix[7]-e.origin[1],r.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function d(e,t){if(e.vertex.uniforms.add(new l.B("proj",c.P.Pass,((e,t)=>t.camera.projectionMatrix))),t.instancedDoublePrecision){const t=(e,t)=>(0,o.s)(f,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]);e.vertex.uniforms.add(new l.B("view",c.P.Pass,((e,r)=>(0,i.j)(h,r.camera.viewMatrix,t(e,r)))));const r=new s.K("localOrigin",c.P.Pass,t);return e.vertex.uniforms.add(r),r}e.vertex.uniforms.add(new l.B("view",c.P.Draw,((e,t)=>(0,i.j)(h,t.camera.viewMatrix,e.origin))));const r=new s.K("localOrigin",c.P.Draw,(e=>e.origin));return e.vertex.uniforms.add(r),r}const h=(0,n.c)(),f=(0,a.c)()},57220:(e,t,r)=>{r.d(t,{e:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"vec2",t,r?(t,i,n)=>t.setUniform2fv(e,r(i,n)):null);default:super(e,"vec2")}}}},32558:(e,t,r)=>{r.d(t,{K:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"vec3",t,r?(t,i,n)=>t.setUniform3fv(e,r(i,n)):null);default:super(e,"vec3")}}}},18465:(e,t,r)=>{r.d(t,{y:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"vec4",t,r?(t,i,n)=>t.setUniform4fv(e,r(i,n)):null);default:super(e,"vec4")}}}},45436:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"float",t,r?(t,i,n)=>t.setUniform1f(e,r(i,n)):null);default:super(e,"float")}}}},68174:(e,t,r)=>{r.d(t,{S:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"int",t,r?(t,i,n)=>t.setUniform1i(e,r(i,n)):null);default:super(e,"int")}}}},21471:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"mat3",t,r?(t,i,n)=>t.setUniformMatrix3fv(e,r(i,n)):null);default:super(e,"mat3",null,null)}}}},85594:(e,t,r)=>{r.d(t,{B:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r,i=null){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"mat4",t,r?(t,i,n)=>t.setUniformMatrix4fv(e,r(i,n)):null,i);default:super(e,"mat4",null,null,i)}}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),n=r(92604),o=r(70586);const a=n.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this.includedModules=new Map}include(e,t){this.includedModules.has(e)?this.includedModules.get(e)!==t&&a.error("Trying to include shader module multiple times with different sets of options."):(this.includedModules.set(e,t),e(this.builder,t))}}class l extends s{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new h,this.varyings=new f,this.extensions=new m,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s="vertex"===e?v:g,l=this.constants.generateSource().concat(n.constants.generateSource());return`\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${o.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${a.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,o.pC)(i)&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,o.pC)(i)&&r.set(t.name,i)}));const i=Array.from(r.values()),n=i.length;return(e,r)=>{for(let o=0;o<n;++o)i[o](t,e,r)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}_add(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)}generateSource(){return Array.from(this._entries.values()).map((e=>(0,o.pC)(e.arraySize)?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class u{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class d extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new u,this.constants=new p}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`attribute ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(){return this._entries.map((e=>`varying ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=[]}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.push(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",v="precision highp float;\nprecision highp sampler2D;"},12139:(e,t,r)=>{r.d(t,{Q:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t,r,i=null){switch(t){case n.P.Draw:case n.P.Pass:return void super(e,"sampler2D",t,r?(t,i,n)=>t.bindTexture(e,r(i,n)):null,i);default:super(e,"sampler2D",null,null,i)}}}},79884:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(67498);class n{constructor(e,t,r,n,o=null){this.name=e,this.type=t,this.arraySize=o,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},this.bind[r]=n}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{function i(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;r.d(t,{H:()=>i}),(n=i||(i={})).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={}))},50173:(e,t,r)=>{var i;r.d(t,{C:()=>i}),function(e){e[e.MATERIAL=0]="MATERIAL",e[e.MATERIAL_ALPHA=1]="MATERIAL_ALPHA",e[e.MATERIAL_DEPTH=2]="MATERIAL_DEPTH",e[e.MATERIAL_NORMAL=3]="MATERIAL_NORMAL",e[e.MATERIAL_DEPTH_SHADOWMAP_ALL=4]="MATERIAL_DEPTH_SHADOWMAP_ALL",e[e.MATERIAL_HIGHLIGHT=5]="MATERIAL_HIGHLIGHT",e[e.MATERIAL_DEPTH_SHADOWMAP_DEFAULT=6]="MATERIAL_DEPTH_SHADOWMAP_DEFAULT",e[e.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT=7]="MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT"}(i||(i={}))},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.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",e[e.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=12]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=14]="HUD_MATERIAL",e[e.LABEL_MATERIAL=15]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=16]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",e[e.DRAPED_WATER=19]="DRAPED_WATER",e[e.VOXEL=20]="VOXEL",e[e.MAX_SLOTS=21]="MAX_SLOTS"}(i||(i={}))},11726:(e,t,r)=>{r.d(t,{hu:()=>n}),r(4307),r(97323),r(98766),(0,r(88669).c)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function n(e,t){if(!e)throw t=t||"assert",console.log(new Error(t).stack),new i(t)}},35065:(e,t,r)=>{var i;r.d(t,{T:()=>i}),function(e){e.POSITION="position",e.NORMAL="normal",e.UV0="uv0",e.AUXPOS1="auxpos1",e.AUXPOS2="auxpos2",e.MAPPOS="mapPos",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.TANGENT="tangent",e.OFFSET="offset",e.SUBDIVISIONFACTOR="subdivisionFactor",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.NORMALCOMPRESSED="normalCompressed",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.FEATUREVALUE="featureValue",e.MODELORIGINHI="modelOriginHi",e.MODELORIGINLO="modelOriginLo",e.MODEL="model",e.MODELNORMAL="modelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMALA="normalA",e.NORMALB="normalB",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.U8PADDING="u8padding",e.U16PADDING="u16padding",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.EXTRUDE="extrude"}(i||(i={}))},47026:(e,t,r)=>{var i,n,o,a,s,l,c,u,d,h,f,m,p,g;r.d(t,{Am:()=>a,CE:()=>f,Gv:()=>n,JJ:()=>p,MX:()=>h,Rw:()=>l,Vr:()=>i,hU:()=>c}),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"}(n||(n={})),function(e){e[e.NONE=0]="NONE",e[e.SMAA=1]="SMAA"}(o||(o={})),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"}(a||(a={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(s||(s={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(l||(l={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(c||(c={})),function(e){e[e.ASYNC=0]="ASYNC",e[e.SYNC=1]="SYNC"}(u||(u={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(d||(d={})),function(e){e[e.Triangle=0]="Triangle",e[e.Point=1]="Point",e[e.Line=2]="Line"}(h||(h={})),function(e){e[e.STRETCH=1]="STRETCH",e[e.PAD=2]="PAD"}(f||(f={})),function(e){e[e.CHANGED=0]="CHANGED",e[e.UNCHANGED=1]="UNCHANGED"}(m||(m={})),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"}(p||(p={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(g||(g={}))},37782:(e,t,r)=>{r.d(t,{bj:()=>M,FZ:()=>y,Uf:()=>R,Bw:()=>g,LO:()=>C,Hx:()=>S});var i=r(67676),n=r(22021),o=r(70586),a=r(17896),s=r(65617),l=r(60437),c=r(47026);function u(e,t){return Math.max((0,n.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}r(64822),(0,n.Vl)(10),(0,n.Vl)(12),(0,n.Vl)(70),(0,n.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var h=r(11726),f=r(35065),m=(r(52138),r(13598));r(9820),new Float64Array(3),new Float32Array(6),(0,m.c)();const p=(0,l.Ue)();function g(e,t,r,i,n,a,s){if(!function(e){return!!(0,o.pC)(e)&&!e.visible}(t))if(e.boundingInfo){(0,h.hu)(e.primitiveType===c.MX.Triangle);const t=r.tolerance;_(e.boundingInfo,i,n,t,a,s)}else{const t=e.indices.get(f.T.POSITION),r=e.vertexAttributes.get(f.T.POSITION);x(i,n,0,t.length/3,t,r,void 0,a,s)}}const v=(0,s.c)();function _(e,t,r,i,n,s){if((0,o.Wi)(e))return;const c=function(e,t,r){return(0,a.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,v);if((0,l.op)(p,e.getBBMin()),(0,l.Tn)(p,e.getBBMax()),(0,o.pC)(n)&&n.applyToAabb(p),function(e,t,r,i){return function(e,t,r,i,n){const o=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(o,a),l=Math.max(o,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)}(p,t,c,i)){const{primitiveIndices:o,indices:a,position:l}=e,c=o?o.length:a.length/3;if(c>P){const o=e.getChildren();if(void 0!==o){for(let e=0;e<8;++e)void 0!==o[e]&&_(o[e],t,r,i,n,s);return}}x(t,r,0,c,a,l,o,n,s)}}const T=(0,s.c)();function x(e,t,r,i,n,a,s,l,c){if(s)return function(e,t,r,i,n,a,s,l,c){const u=a.data,d=a.stride||a.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,v=t[2]-m;for(let e=r;e<i;++e){const t=s[e];let r=3*t,i=d*n[r++],a=u[i++],_=u[i++],x=u[i];i=d*n[r++];let b=u[i++],A=u[i++],S=u[i];i=d*n[r];let M=u[i++],R=u[i++],C=u[i];(0,o.pC)(l)&&([a,_,x]=l.applyToVertex(a,_,x,e),[b,A,S]=l.applyToVertex(b,A,S,e),[M,R,C]=l.applyToVertex(M,R,C,e));const w=b-a,y=A-_,P=S-x,O=M-a,N=R-_,I=C-x,D=g*I-N*v,L=v*O-I*p,F=p*N-O*g,H=w*D+y*L+P*F;if(Math.abs(H)<=Number.EPSILON)continue;const B=h-a,U=f-_,z=m-x,G=B*D+U*L+z*F;if(H>0){if(G<0||G>H)continue}else if(G>0||G<H)continue;const V=U*P-y*z,W=z*w-P*B,q=B*y-w*U,k=p*V+g*W+v*q;if(H>0){if(k<0||G+k>H)continue}else if(k>0||G+k<H)continue;const X=(O*V+N*W+I*q)/H;X>=0&&c(X,E(w,y,P,O,N,I,T),t,!1)}}(e,t,r,i,n,a,s,l,c);const u=a.data,d=a.stride||a.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,v=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=d*n[t++],i=u[r++],a=u[r++],s=u[r];r=d*n[t++];let _=u[r++],x=u[r++],b=u[r];r=d*n[t++];let A=u[r++],S=u[r++],M=u[r];(0,o.pC)(l)&&([i,a,s]=l.applyToVertex(i,a,s,e),[_,x,b]=l.applyToVertex(_,x,b,e),[A,S,M]=l.applyToVertex(A,S,M,e));const R=_-i,C=x-a,w=b-s,y=A-i,P=S-a,O=M-s,N=g*O-P*v,I=v*y-O*p,D=p*P-y*g,L=R*N+C*I+w*D;if(Math.abs(L)<=Number.EPSILON)continue;const F=h-i,H=f-a,B=m-s,U=F*N+H*I+B*D;if(L>0){if(U<0||U>L)continue}else if(U>0||U<L)continue;const z=H*w-C*B,G=B*R-w*F,V=F*C-R*H,W=p*z+g*G+v*V;if(L>0){if(W<0||U+W>L)continue}else if(W>0||U+W<L)continue;const q=(y*z+P*G+O*V)/L;q>=0&&c(q,E(R,C,w,y,P,O,T),e,!1)}}const b=(0,s.c)(),A=(0,s.c)();function E(e,t,r,i,n,o,s){return(0,a.s)(b,e,t,r),(0,a.s)(A,i,n,o),(0,a.f)(s,b,A),(0,a.n)(s,s),s}function S(e,t,r,i,o){let a=(r.screenLength||0)*e.pixelRatio;o&&(a=function(e,t,r,i){return u(e,function(e,t,r){const i=r.parameters,n=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=n,d}(t,r,i))}(a,i,t,o));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function M(e,t,r){if(!e)return;const i=e.parameters,n=e.paddingPixelsOverride;t.setUniform4f(r,i.divisor,i.offset,i.minPixelSize,n)}function R(e,t){const r=t?R(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=w(i)),null==i&&t in r||(r[t]=i)}return r}function C(e,t){let r=!1;for(const n in t){const o=t[n];void 0!==o&&(Array.isArray(o)?null===e[n]?(e[n]=o.slice(),r=!0):(0,i.Vx)(e[n],o)&&(r=!0):e[n]!==o&&(r=!0,e[n]=o))}return r}function w(e){const t=[];return e.forEach((e=>t.push(e))),t}const y={multiply:1,ignore:2,replace:3,tint:4},P=1e3},64822:(e,t,r)=>{var i;r.d(t,{JY:()=>i}),function(e){e[e.Global=1]="Global",e[e.Local=2]="Local"}(i||(i={}))},75656:(e,t,r)=>{r.d(t,{x:()=>c}),r(80442);var i=r(22021),n=r(70586),o=r(49300),a=r(54738),s=r(35371),l=r(46314);class c{constructor(e,t,r=null){if(this._context=e,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(s._g.Texture,this),this._descriptor={target:s.No.TEXTURE_2D,samplingMode:s.cw.LINEAR,wrapMode:s.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1,...t},e.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),h(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTextureAllUnits(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor;null!=t||(t=i.target);const a=h(t);var m;null===e&&(i.width=i.width||4,i.height=i.height||4,a&&(i.depth=null!=(m=i.depth)?m:1));const p=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),c._validateTexture(this._context,i),this._configurePixelStorage();const g=i.pixelFormat;let v=i.internalFormat?i.internalFormat:this._deriveInternalFormat(g,i.dataType);if(d(e)){let n=e.width,s=e.height;const l=1;e instanceof HTMLVideoElement&&(n=e.videoWidth,s=e.videoHeight),i.width&&i.height,a&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,v,i.hasMipmap,n,s,l),this._texImage(t,0,v,n,s,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=n),void 0===i.height&&(i.height=s),a&&void 0===i.depth&&(i.depth=l)}else{const{width:c,height:d,depth:h}=i;if(null!=c&&null!=d||console.error("Width and height must be specified!"),a&&null==h&&console.error("Depth must be specified!"),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,v,i.hasMipmap,c,d,h),r.DEPTH24_STENCIL8&&v===r.DEPTH_STENCIL&&(v=r.DEPTH24_STENCIL8),u(e)){const n=e.levels,o=f(t,c,d,h),a=Math.min(o-1,n.length-1);(0,l.Z)(r)?r.texParameteri(i.target,r.TEXTURE_MAX_LEVEL,a):i.hasMipmap=i.hasMipmap&&o===n.length;const u=v;if(!function(e){return e in s.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,r,i,o)=>{const a=n[Math.min(e,n.length-1)];this._compressedTexImage(t,e,u,r,i,o,a)}),a)}else(0,n.pC)(e)?(this._texImage(t,0,v,c,d,h,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,i,n,a)=>{this._texImage(t,e,v,i,n,a,null),(0,o.zu)(r)}))}c._applySamplingMode(r,this._descriptor),c._applyWrapMode(r,this._descriptor),c._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(p,c.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,n,o){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const a=this._context.gl,s=this._descriptor,{pixelFormat:l,internalFormat:h,dataType:f,isImmutable:m,target:p}=s;if(m&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);(t<0||r<0||i>s.width||n>s.height||t+i>s.width||r+n>s.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),d(o)?a.texSubImage2D(p,e,t,r,l,f,o):u(o)?a.compressedTexSubImage2D(p,e,t,r,i,n,h,o.levels[e]):a.texSubImage2D(p,e,t,r,i,n,l,f,o),this._context.bindTexture(g,c.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,n,o,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl;if(!(0,l.Z)(d))throw new Error("3D textures are not supported in WebGL1");const f=this._descriptor,{pixelFormat:m,dataType:p,isImmutable:g,target:v,internalFormat:_}=f;if(g&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");h(v)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||n>f.width||o>f.height||a>f.depth||t+n>f.width||r+o>f.height||i+a>f.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),u(s))s=s.levels[e],d.compressedTexSubImage3D(v,e,t,r,i,n,o,a,_,s);else{const l=s;d.texSubImage3D(v,e,t,r,i,n,o,a,m,p,l)}this._context.bindTexture(T,c.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,c._validateTexture(this._context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,c.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,c._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(c._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(c._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===a.zO.WEBGL1)return e;switch(t){case s.Br.FLOAT:switch(e){case s.VI.RGBA:return s.lP.RGBA32F;case s.VI.RGB:return s.lP.RGB32F;default:throw new Error("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(e){case s.VI.RGBA:return s.lP.RGBA8;case s.VI.RGB:return s.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,n,o){const a=this._context.gl;if(!(0,l.Z)(a))throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in s.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?f(e,i,n,o):1;h(e)?a.texStorage3D(e,c,t,i,n,o):a.texStorage2D(e,c,t,i,n),this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,s,l){const c=this._context.gl;let u=null;const f=this._context.type===a.zO.WEBGL2,m=h(e),{isImmutable:p,pixelFormat:g,dataType:v}=this._descriptor;if(f&&(u=c),f||!d(l))if(p){if((0,n.pC)(l)){const r=l;m?u.texSubImage3D(e,t,0,0,0,i,o,s,g,v,r):c.texSubImage2D(e,t,0,0,i,o,g,v,r)}}else{const a=(0,n.Wg)(l);m?u.texImage3D(e,t,r,i,o,s,0,g,v,a):c.texImage2D(e,t,r,i,o,0,g,v,a)}else c.texImage2D(e,0,r,g,v,l)}_compressedTexImage(e,t,r,i,o,s,l){const c=this._context.gl;let u=null;const d=h(e),f=this._descriptor.isImmutable;if(d){if(this._context.type!==a.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");u=c}f?(0,n.pC)(l)&&(d?u.compressedTexSubImage3D(e,t,0,0,0,i,o,s,r,l):c.compressedTexSubImage2D(e,t,0,0,i,o,r,l)):d?u.compressedTexImage3D(e,t,r,i,o,s,0,l):c.compressedTexImage2D(e,t,r,i,o,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:n,hasMipmap:o,target:a}=this._descriptor;const l=a===s.No.TEXTURE_3D;for(let a=0;e(a,r,i,n),o&&(1!==r||1!==i||l&&1!==n)&&!(a>=t);++a)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(n=Math.max(1,n>>1))}static _validateTexture(e,t){(t.width<0||t.height<0||t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=(0,l.Z)(e.gl),n=(0,i.wt)(t.width)&&(0,i.wt)(t.height);r||!t.isImmutable&&!h(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||n||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){var r;const i=e.capabilities.textureFilterAnisotropic;i&&e.gl.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY,null!=(r=t.maxAnisotropy)?r:1)}}function u(e){return(0,n.pC)(e)&&"type"in e&&"compressed"===e.type}function d(e){return(0,n.pC)(e)&&!u(e)&&!function(e){return(0,n.pC)(e)&&"byteLength"in e}(e)}function h(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let n=Math.max(t,r);return e===s.No.TEXTURE_3D&&(n=Math.max(n,i)),Math.round(Math.log(n)/Math.LN2)+1}c.TEXTURE_UNIT_FOR_UPDATES=0},21968:(e,t,r)=>{r.d(t,{G:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a}}},46314:(e,t,r)=>{function i(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}r.d(t,{Z:()=>i})},49300:(e,t,r)=>{r.d(t,{CG:()=>l,hZ:()=>s,zu:()=>c});var i=r(20102),n=r(80442);const o=r(92604).Z.getLogger("esri/views/webgl"),a=!!(0,n.Z)("enable-feature:webgl-debug");function s(){return a}function l(){return a}function c(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),n=(new Error).stack;o.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:n}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>s,zO:()=>i});var i,n,o=r(80442);function a(e){const t=(0,o.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":case"3d":return[i.WEBGL2,i.WEBGL1]}}function s(e,t,r={}){const n=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let o=null;for(const t of n){try{o=e.getContext(t,r)}catch(e){}if(o)break}return o}(n=i||(i={}))[n.WEBGL1=1]="WEBGL1",n[n.WEBGL2=2]="WEBGL2"},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)o[0]=e[i],t[i]=o[0];return t}function n(e,t){const r=e.length;for(let i=0;i<r;++i)o[0]=e[i],o[1]=e[i]-o[0],t[i]=o[1];return t}r.d(t,{GB:()=>n,U8:()=>i});const o=new Float32Array(2)}}]);