@arcgis/core 4.23.0-next.20220123 → 4.23.0-next.20220128

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 (624) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
  5. package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
  6. package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
  7. package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +1 -0
  8. package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 0d02c6ad1f4688bfa374.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
  10. package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
  11. package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → 17de7a324dfa7f57ad5d.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
  16. package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
  17. package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +1 -0
  18. package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
  19. package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
  20. package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
  22. package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +1 -0
  23. package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
  24. package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 2c8fe9bc988c3c5760a5.js} +1 -1
  25. package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
  26. package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
  27. package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +1 -0
  28. package/assets/esri/core/workers/chunks/37c03cfc19086ce631c6.js +1 -0
  29. package/assets/esri/core/workers/chunks/391e96192d1ec4e55ce2.js +1 -0
  30. package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
  31. package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
  32. package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
  33. package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
  34. package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 4954fd86b48cc68b737c.js} +1 -1
  36. package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
  37. package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
  38. package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
  39. package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
  40. package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
  41. package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
  42. package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +1 -0
  43. package/assets/esri/core/workers/chunks/5bcb3240b3c005e5fe72.js +1 -0
  44. package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
  45. package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
  46. package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
  47. package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
  48. package/assets/esri/core/workers/chunks/{4c9084a04948b6924749.js → 655b55ac0cd533d7e9d7.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
  51. package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
  52. package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
  53. package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
  55. package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
  56. package/assets/esri/core/workers/chunks/{625d2663daa8e0cf64b0.js → 85b1f36790df95b17659.js} +1 -1
  57. package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
  58. package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
  59. package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
  60. package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
  61. package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
  62. package/assets/esri/core/workers/chunks/952980635afc7ec81804.js +1 -0
  63. package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +1 -0
  64. package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
  65. package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
  66. package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
  67. package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
  68. package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
  69. package/assets/esri/core/workers/chunks/aeaa1667c2d9f1b3366b.js +1 -0
  70. package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
  71. package/assets/esri/core/workers/chunks/b3f5e91116112b0b612a.js +1 -0
  72. package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
  73. package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
  74. package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
  75. package/assets/esri/core/workers/chunks/bac9fc90e6756e211160.js +1 -0
  76. package/assets/esri/core/workers/chunks/be588873c16770ceb9ef.js +1 -0
  77. package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
  78. package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
  79. package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
  80. package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
  81. package/assets/esri/core/workers/chunks/c2253a9f29c1aabb2b75.js +1 -0
  82. package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
  83. package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
  84. package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
  85. package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
  86. package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → db3c729ce0c0b2690dc9.js} +1 -1
  87. package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
  88. package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
  89. package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → e0c8d61c7a85ce15499a.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
  91. package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
  92. package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +1 -0
  93. package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
  94. package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
  95. package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
  96. package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
  97. package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
  98. package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +1 -0
  99. package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
  100. package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
  101. package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
  102. package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +1 -0
  103. package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
  104. package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
  105. package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
  106. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  107. package/assets/esri/themes/base/_mixins.scss +4 -1
  108. package/assets/esri/themes/base/icons/style.scss +11 -2
  109. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
  110. package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
  111. package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
  112. package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
  113. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
  114. package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
  115. package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
  116. package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
  117. package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
  118. package/assets/esri/themes/base/widgets/_Print.scss +24 -11
  119. package/assets/esri/themes/base/widgets/_Search.scss +4 -2
  120. package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
  121. package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
  122. package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
  123. package/assets/esri/themes/dark/main.css +1 -1
  124. package/assets/esri/themes/dark-blue/main.css +1 -1
  125. package/assets/esri/themes/dark-green/main.css +1 -1
  126. package/assets/esri/themes/dark-purple/main.css +1 -1
  127. package/assets/esri/themes/dark-red/main.css +1 -1
  128. package/assets/esri/themes/light/main.css +1 -1
  129. package/assets/esri/themes/light/view.css +1 -1
  130. package/assets/esri/themes/light-blue/main.css +1 -1
  131. package/assets/esri/themes/light-green/main.css +1 -1
  132. package/assets/esri/themes/light-purple/main.css +1 -1
  133. package/assets/esri/themes/light-red/main.css +1 -1
  134. package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
  135. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  136. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  137. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  138. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  139. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  140. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  141. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  142. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  143. package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
  144. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  145. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  146. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  147. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  148. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  149. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  150. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  151. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  152. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  153. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  154. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  155. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  156. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  157. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  158. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  159. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  160. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  161. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  162. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  163. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  164. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  165. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  166. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  167. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  168. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  169. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  170. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  171. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  172. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  173. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  174. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  175. package/chunks/BlendLayers.glsl.js +2 -2
  176. package/chunks/ChapmanAtmosphere.glsl.js +17 -17
  177. package/chunks/CheckerBoard.glsl.js +3 -3
  178. package/chunks/Clouds.glsl.js +2 -2
  179. package/chunks/CloudsComposition.glsl.js +1 -1
  180. package/chunks/ColorMaterial.glsl.js +12 -12
  181. package/chunks/ComponentShader.glsl.js +21 -21
  182. package/chunks/Compositing.glsl.js +1 -1
  183. package/chunks/DefaultMaterial.glsl.js +33 -33
  184. package/chunks/EdgeShaderProgram.glsl.js +7 -7
  185. package/chunks/Fog.glsl.js +10 -12
  186. package/chunks/HUDMaterial.glsl.js +2 -2
  187. package/chunks/HighlightComposition.glsl.js +5 -5
  188. package/chunks/ImageMaterial.glsl.js +6 -6
  189. package/chunks/LaserlinePath.glsl.js +8 -8
  190. package/chunks/LineCallout.glsl.js +6 -6
  191. package/chunks/MeasurementArrow.glsl.js +1 -1
  192. package/chunks/NativeLine.glsl.js +1 -1
  193. package/chunks/Path.glsl.js +5 -5
  194. package/chunks/Pattern.glsl.js +9 -9
  195. package/chunks/PointRenderer.glsl.js +14 -14
  196. package/chunks/Precipitation.glsl.js +91 -0
  197. package/chunks/RealisticTree.glsl.js +21 -21
  198. package/chunks/RibbonLine.glsl.js +11 -11
  199. package/chunks/SMAA.glsl.js +40 -40
  200. package/chunks/ShadedColorMaterial.glsl.js +12 -12
  201. package/chunks/ShadowCast.glsl.js +6 -6
  202. package/chunks/ShadowHighlight.glsl.js +4 -4
  203. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  204. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  205. package/chunks/Stars.glsl.js +3 -3
  206. package/chunks/Terrain.glsl.js +3 -3
  207. package/chunks/TextureOnly.glsl.js +2 -2
  208. package/chunks/WaterSurface.glsl.js +22 -22
  209. package/chunks/boundedPlane.js +1 -1
  210. package/chunks/pe.js +1 -1
  211. package/chunks/vec3.js +1 -1
  212. package/chunks/vxlLayer.js +1 -1
  213. package/core/accessorSupport/ensureType.js +1 -1
  214. package/core/accessorSupport/get.js +1 -1
  215. package/core/accessorSupport/read.js +1 -1
  216. package/core/accessorSupport/set.js +1 -1
  217. package/core/accessorSupport/watch.js +1 -1
  218. package/core/accessorSupport/write.js +1 -1
  219. package/core/clock.js +1 -1
  220. package/core/jsonMap.js +1 -1
  221. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  222. package/core/loadAll.js +1 -1
  223. package/core/promiseUtils.js +1 -1
  224. package/core/reactiveUtils.js +1 -1
  225. package/form/ExpressionInfo.js +1 -1
  226. package/geometry/pe.js +1 -1
  227. package/geometry/support/axisAngleDegrees.js +1 -1
  228. package/geometry/support/frustum.js +1 -1
  229. package/geometry/support/plane.js +1 -1
  230. package/interfaces.d.ts +263 -35
  231. package/layers/VectorTileLayer.js +1 -1
  232. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  233. package/layers/graphics/featureConversionUtils.js +1 -1
  234. package/layers/support/LayerContingentValuesCache.js +1 -1
  235. package/layers/support/TileInfo.js +1 -1
  236. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  237. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  238. package/package.json +2 -2
  239. package/popup/content/AttachmentsContent.js +1 -1
  240. package/popup/content/support/mediaInfoTypes.js +1 -1
  241. package/rest/print.js +1 -1
  242. package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
  243. package/support/arcadeOnDemand.js +1 -1
  244. package/support/featureFlags.js +1 -1
  245. package/support/revision.js +1 -1
  246. package/symbols/FillSymbol3DLayer.js +1 -1
  247. package/symbols/IconSymbol3DLayer.js +1 -1
  248. package/symbols/LabelSymbol3D.js +1 -1
  249. package/symbols/ObjectSymbol3DLayer.js +1 -1
  250. package/symbols/PointSymbol3D.js +1 -1
  251. package/symbols/Symbol3D.js +1 -1
  252. package/symbols/WebStyleSymbol.js +1 -1
  253. package/symbols/cim/CIMSymbolHelper.js +1 -1
  254. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  255. package/symbols/cim/cimAnalyzer.js +1 -1
  256. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  257. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  258. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  259. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  260. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  261. package/symbols/support/Symbol3DIconOutline.js +1 -1
  262. package/symbols/support/Symbol3DOutline.js +1 -1
  263. package/symbols/support/Symbol3DVerticalOffset.js +1 -1
  264. package/symbols/support/Thumbnail.js +1 -1
  265. package/symbols/support/previewCIMSymbol.js +1 -1
  266. package/symbols/support/previewSymbol2D.js +1 -1
  267. package/symbols/support/previewSymbol3D.js +1 -1
  268. package/symbols/support/previewWebStyleSymbol.js +1 -1
  269. package/symbols/support/svgUtils.js +1 -1
  270. package/symbols/support/webStyleSymbolUtils.js +1 -1
  271. package/symbols.js +1 -1
  272. package/views/2d/MapViewConstraints.js +1 -1
  273. package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
  274. package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
  275. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  276. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  277. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  278. package/views/2d/viewpointUtils.js +1 -1
  279. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  280. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  281. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  282. package/views/3d/environment/CloudsComposition.js +1 -1
  283. package/views/3d/environment/CloudsGenerator.js +1 -1
  284. package/views/3d/environment/CloudsPresets.js +1 -1
  285. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  286. package/views/3d/environment/Fog.glsl.js +1 -1
  287. package/views/3d/environment/Fog.js +1 -1
  288. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  289. package/views/3d/environment/Precipitation.glsl.js +5 -0
  290. package/views/3d/environment/Precipitation.js +5 -0
  291. package/views/3d/environment/PrecipitationTechnique.js +5 -0
  292. package/views/3d/environment/RainyWeather.js +1 -1
  293. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  294. package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
  295. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  296. package/views/3d/environment/SnowyWeather.js +5 -0
  297. package/views/3d/environment/Stars.glsl.js +1 -1
  298. package/views/3d/environment/Stars.js +1 -1
  299. package/views/3d/environment/weather.js +1 -1
  300. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  301. package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
  302. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  303. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  304. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  305. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  306. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  307. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  308. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  309. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  310. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  311. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  312. package/views/3d/layers/GraphicsView3D.js +1 -1
  313. package/views/3d/layers/I3SMeshView3D.js +1 -1
  314. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  315. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  316. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  317. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  318. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  319. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  320. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  321. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  322. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  323. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  324. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  325. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  326. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  327. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  328. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  329. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  330. package/views/3d/layers/graphics/lineUtils.js +1 -1
  331. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  332. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  333. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  334. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  335. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  336. package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
  337. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  338. package/views/3d/layers/support/patternUtils.js +1 -1
  339. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  340. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  341. package/views/3d/support/LaserLineRenderer.js +1 -1
  342. package/views/3d/support/LaserlinePathData.js +1 -1
  343. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  344. package/views/3d/support/sunUtils.js +1 -1
  345. package/views/3d/terrain/OverlayRenderer.js +1 -1
  346. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  347. package/views/3d/terrain/TerrainRenderer.js +1 -1
  348. package/views/3d/terrain/TerrainSurface.js +1 -1
  349. package/views/3d/terrain/Tile.js +1 -1
  350. package/views/3d/terrain/terrainUtils.js +1 -1
  351. package/views/3d/terrain/tileUtils.js +1 -1
  352. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  353. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  354. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  355. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
  356. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  357. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  358. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  359. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  360. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  361. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
  362. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
  363. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  364. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  365. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
  366. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
  367. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  368. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
  369. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
  370. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
  371. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
  372. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
  373. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
  374. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  375. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
  376. package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
  377. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
  378. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
  379. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  380. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
  381. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  382. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
  383. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
  384. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
  385. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
  386. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
  387. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
  388. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  389. package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
  390. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
  391. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  392. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +22 -14
  393. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  394. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  395. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  396. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
  397. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  398. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  399. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  400. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  401. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  402. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  403. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  404. package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
  405. package/views/3d/webgl-engine/lib/Material.js +1 -1
  406. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  407. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  408. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  409. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  410. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  411. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  412. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  413. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  414. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  415. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  416. package/views/3d/{layers/graphics/IGraphics3DFeatureProcessor.js → webgl-engine/lib/TextureUniformName.js} +0 -0
  417. package/views/3d/webgl-engine/lib/UniformName.js +4 -0
  418. package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
  419. package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
  420. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  421. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  422. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  423. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  424. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  425. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  426. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  427. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  428. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  429. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  430. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  431. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  432. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  433. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  434. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  435. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  436. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  437. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  438. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  439. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  440. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  441. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  442. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  443. package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
  444. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  445. package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
  446. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  447. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  448. package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
  449. package/views/3d/webgl-engine/parts/Model.js +1 -1
  450. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  451. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  452. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  453. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  454. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  455. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  456. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  457. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  458. package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
  459. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
  460. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  461. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  462. package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
  463. package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
  464. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  465. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  466. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
  467. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  468. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  469. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  470. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  471. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  472. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  473. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  474. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  475. package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
  476. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  477. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  478. package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
  479. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  480. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  481. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  482. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
  483. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
  484. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
  485. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
  486. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
  487. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
  488. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
  489. package/views/MapView.js +1 -1
  490. package/views/SceneView.js +1 -1
  491. package/views/View.js +1 -1
  492. package/views/input/recognizers/DoubleTapDrag.js +1 -1
  493. package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
  494. package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
  495. package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
  496. package/views/interactive/dragEventPipeline.js +1 -1
  497. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  498. package/views/support/DefaultsFromMap.js +1 -1
  499. package/views/support/WatchUpdatingTracking.js +1 -1
  500. package/views/support/projectionUtils.js +5 -0
  501. package/views/webgl/BufferObject.js +1 -1
  502. package/views/webgl/InstanceCounter.js +1 -1
  503. package/views/webgl/Program.js +1 -1
  504. package/views/webgl/rasterUtils.js +1 -1
  505. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  506. package/widgets/Attachments.js +1 -1
  507. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  508. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  509. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  510. package/widgets/BasemapGallery.js +1 -1
  511. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  512. package/widgets/FeatureForm/InputField.js +1 -1
  513. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  514. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  515. package/widgets/FeatureTable.js +1 -1
  516. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  517. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  518. package/widgets/Popup/PopupViewModel.js +1 -1
  519. package/widgets/Popup/actionUtils.js +1 -1
  520. package/widgets/Search/support/locatorUtils.js +1 -1
  521. package/widgets/Search.js +1 -1
  522. package/widgets/Slice/SliceViewModel.js +1 -1
  523. package/widgets/Slider/SliderViewModel.js +1 -1
  524. package/widgets/Slider.js +1 -1
  525. package/widgets/Weather/WeatherViewModel.js +1 -1
  526. package/widgets/Weather/css.js +1 -1
  527. package/widgets/Weather/enums.js +5 -0
  528. package/widgets/Weather.js +1 -1
  529. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  530. package/widgets/support/InteractiveToolViewModel.js +1 -1
  531. package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
  532. package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
  533. package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
  534. package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
  535. package/assets/components/assets/calcite-icon/squareF16.json +0 -1
  536. package/assets/components/assets/calcite-icon/squareF24.json +0 -1
  537. package/assets/components/assets/calcite-icon/squareF32.json +0 -1
  538. package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
  539. package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
  540. package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
  541. package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
  542. package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
  543. package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
  544. package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
  545. package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
  546. package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
  547. package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
  548. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +0 -1
  549. package/assets/esri/core/workers/chunks/0c3e3a5baf54bd5e210c.js +0 -1
  550. package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
  551. package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
  552. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
  553. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
  554. package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
  555. package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
  556. package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
  557. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
  558. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
  559. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
  560. package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
  561. package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
  562. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
  563. package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
  564. package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
  565. package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
  566. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +0 -1
  567. package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
  568. package/assets/esri/core/workers/chunks/5383a8f3e4ec1a8a4fcd.js +0 -1
  569. package/assets/esri/core/workers/chunks/5538639a49c7cc2eca63.js +0 -1
  570. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
  571. package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
  572. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
  573. package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
  574. package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
  575. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
  576. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +0 -1
  577. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +0 -1
  578. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +0 -1
  579. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +0 -1
  580. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +0 -1
  581. package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
  582. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
  583. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
  584. package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
  585. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
  586. package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
  587. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
  588. package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +0 -1
  589. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +0 -1
  590. package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
  591. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
  592. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +0 -1
  593. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
  594. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
  595. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
  596. package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +0 -1
  597. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +0 -1
  598. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
  599. package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
  600. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +0 -1
  601. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
  602. package/assets/esri/core/workers/chunks/c080114a69fa95b88d22.js +0 -1
  603. package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
  604. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
  605. package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
  606. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
  607. package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
  608. package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +0 -1
  609. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
  610. package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
  611. package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
  612. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
  613. package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
  614. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
  615. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
  616. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +0 -1
  617. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
  618. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +0 -1
  619. package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +0 -1
  620. package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
  621. package/assets/esri/core/workers/chunks/f678293de9a6d8f5b5db.js +0 -1
  622. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +0 -1
  623. package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
  624. package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{ByteSizeUnit as s}from"../../../core/byteSizeEstimations.js";import r from"../../../core/Collection.js";import o from"../../../core/has.js";import a from"../../../core/Logger.js";import{someMap as n}from"../../../core/MapUtils.js";import{unwrapOr as l,destroyMaybe as d,isSome as h,isNone as c,applySome as u,unwrap as _}from"../../../core/maybe.js";import m from"../../../core/PooledArray.js";import{throwIfAborted as g,createResolver as p}from"../../../core/promiseUtils.js";import{initial as f}from"../../../core/reactiveUtils.js";import{schedule as b}from"../../../core/scheduling.js";import{isArrayBuffer as y}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as I}from"../../../core/unitUtils.js";import{init as v}from"../../../core/watchUtils.js";import{property as M}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{f as x}from"../../../chunks/mat3.js";import{c as O}from"../../../chunks/mat3f32.js";import{m as S,B as E}from"../../../chunks/mat4.js";import{b as j,c as w}from"../../../chunks/mat4f64.js";import{m as T,g as N}from"../../../chunks/vec3.js";import{c as D}from"../../../chunks/vec3f64.js";import{s as R}from"../../../chunks/vec4.js";import{projectBuffer as F,getProjectorName as A,localLinearScaleFactors as P,projectVectorToVector as V,projectBoundingSphere as U}from"../../../geometry/projection.js";import{create as H,empty as G,expandWithBuffer as L,toRect as B}from"../../../geometry/support/aaBoundingBox.js";import{create as k,intersects as q}from"../../../geometry/support/aaBoundingRect.js";import z from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as K}from"../../../layers/support/fieldUtils.js";import{areLabelsVisible as W}from"../../../layers/support/layerUtils.js";import $ from"../../../layers/support/SceneModification.js";import{getColor as X,getOpacity as Y}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as Q}from"../../../support/arcadeOnDemand.js";import J from"../../../symbols/Symbol3D.js";import{getMetersPerUnit as Z}from"../../../symbols/support/unitConversionUtils.js";import ee from"./I3SMeshViewLabeler.js";import{I3SMeshWorkerHandle as te,toWasmModification as ie}from"./I3SMeshWorkerHandle.js";import{ForAllFeaturesVisibilityMode as se,ForAllFeaturesReturnType as re}from"./II3SMeshView3D.js";import{initialize as oe,setModificationsSync as ae,filterObbsForModificationsSync as ne,interpretObbModificationResults as le}from"./SceneLayerWorker.js";import{overrideColor as de}from"./graphics/graphicUtils.js";import{TextureUsage as he,TextureEncoding as ce}from"./i3s/enums.js";import ue from"./i3s/Highlights.js";import{I3SAttributeOverrides as _e}from"./i3s/I3SAttributeOverrides.js";import{I3SCrossfadeHelper as me,NodeCrossfadeMetaData as ge}from"./i3s/I3SCrossfadeHelper.js";import pe from"./i3s/I3SElevationProvider.js";import{boundingBoxCornerPoints as fe}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as be}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as ye,selectEncoding as Ie,createTexture as ve,configureMaterial as Me}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as Ce,NodeState as xe}from"./i3s/I3SNode.js";import{computeGlobalTransformation as Oe,getLocalOrigin as Se}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Ee,checkSceneLayerValid as je,checkSceneLayerCompatibleWithView as we,getCacheKeySuffix as Te,whenGraphicAttributes as Ne,computeVisibilityObb as De,filterInPlace as Re,getCachedAttributeValue as Fe,intersectBoundingRectWithMbs as Ae,MbsIntersectResult as Pe,addWraparound as Ve,getSymbolInfo as Ue,transparentEdgeMaterial as He,getClipRect as Ge}from"./i3s/I3SUtil.js";import{IDBCache as Le}from"./i3s/IDBCache.js";import{attributeLookup as Be}from"./support/attributeUtils.js";import{ColorMixModeEnum as ke}from"./support/symbolColorUtils.js";import qe from"../support/debugFlags.js";import{toBoundingRect as ze}from"../support/extentUtils.js";import{create as Ke,clone as We}from"../support/orientedBoundingBox.js";import{updatingProgress as $e}from"../support/updatingProperties.js";import{glLayout as Xe}from"../support/buffer/glUtil.js";import{State as Ye}from"../webgl-engine/collections/Component/ComponentObject.js";import{createVertexBufferLayout as Qe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{TextureCoordinateAttribute as Je}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasis as Ze}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as et}from"../webgl-engine/lib/edgeRendering/interfaces.js";const tt=a.getLogger("esri.views.3d.layers.SceneLayerView3D"),it=[1,1,1,1];class st extends ge{constructor(e,t,i,s,r,o,a){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbology=null}}var rt;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(rt||(rt={}));const ot=19,at=100*s.MEGABYTES,nt=t=>{let s=class extends t{constructor(...e){super(e),this._elevationProvider=null,this._intersectionHandler=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._idbCache=new Le("esri-scenelayer-cache","geometries"),this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.filter=null,this.slicePlaneEnabled=!1,this._modifications=new Array,this._layerUrl="",this._cacheKeySuffix=null,this._arcade=null,this._tmpAttributeOnlyGraphic=new i(null,null,{}),this._crossfadeHelper=new me(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ee(this._currentRenderer)?this._usePBR()||this._hasLoadedPBRTextures?he.AllTexturesPBR:he.AllTextures:this._usePBR()||this._hasLoadedPBRTextures?he.GeometryTexturesPBR:he.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null!=e&&"absolute-height"===e.mode){const t=I(this.i3slayer.spatialReference),i=Z(e.unit);return l(e.offset,0)*i/t}return 0}get supportedTextureEncodings(){return ye(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){var e;const t=null==(e=this.view)?void 0:e.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,i=0==(this.supportedTextureEncodings&ce.DDS_S3TC);return t&&i}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController;if(this.attributeOverrides=new _e(this.i3slayer,e.memoryController),this._worker=new te((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._worker.setLegacySchema(this.layerUid,this.i3slayer.store.defaultGeometrySchema),je(this.i3slayer),we(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new z({layerView:this}),this.gpuMemoryEstimate=0,this.texMemoryEstimate=0,this.geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this._highlights=new ue({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,se.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._isIntegratedMesh||!this.i3slayer.store.defaultGeometrySchema)this._hasSymbolColors=!1;else{const e=this.i3slayer.store.defaultGeometrySchema.featureAttributes;this._hasSymbolColors=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=this.i3slayer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.i3slayer.cachedDrawingInfo||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderView.ensureEdgeView());const t=this.view.resourceController.memoryController.newCache(this.i3slayer.uid,(e=>this._deleteComponentObject(e)));this._memCache=t;const i=e=>h(this._controller.index)&&h(this._controller.index.rootNode)?this._controller.index.traverse(this._controller.index.rootNode,(t=>{const i=t.index,s=this._nodeId2Meta.get(i)||this._nodeId2MetaReloading.get(i);return e(t,h(s)?s.objectHandle:null)})):()=>{};this._intersectionHandler=new be({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:i}),this._elevationProvider=new pe({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR(),this.updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),f),this.updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this.updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this.updatingHandles.add((()=>this.filter),(()=>this._filterChange()),f),this.updatingHandles.add((()=>this.view.qualitySettings.physicallyBasedRenderingEnabled),(()=>this._updatePBR()));const s=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add((()=>this.rendererTextureUsage),s),this.updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),s),this.updatingHandles.add((()=>this.suspended),(e=>this._suspendedChange(e)),f),this.updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),f),this.handles.add([v(qe,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&qe.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||qe.I3S_TREE_SHOW_TILES||(this._treeDebugger=d(this._treeDebugger))})),v(qe,"I3S_SHOW_MODIFICATIONS",(()=>this._showModifications()))]),this._cacheKeySuffix=Te(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch((e=>tt.warn(`Failed to initialize IndexedDB cache: ${e}`)))}destroy(){this._clearAddTasks(),this.attributeOverrides=d(this.attributeOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.i3slayer.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=d(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=d(this._labeler),this._treeDebugger=d(this._treeDebugger),this._controller=d(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.estimatedTexMemRequired;return this.gpuMemoryEstimate+=t,this.texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(h(e)){const t=e.estimatedTexMemRequired;this.gpuMemoryEstimate-=t,this.texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this.gpuMemoryEstimate+=t,this.geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this.gpuMemoryEstimate-=t,this.geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}getUsedMemory(){let e=h(this._labeler)?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=h(t)?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=h(t)?t.node.memory:0)),e}getUnloadedMemory(){return(h(this._controller)?this._controller.unloadedMemoryEstimate:0)+(h(this._labeler)?this._labeler.unloadedMemoryEstimate:0)}ignoresMemoryFactor(){return!1}_labelingChanged(){if(!(W(this.i3slayer)&&this._supportsLabeling))return void(h(this._labeler)&&(this._labeler.destroy(),this._labeler=null));if(h(this._labeler))return;const e=new ee({view:this.view,layer:this.i3slayer,collection:this._collection});this._nodeId2Meta.forEach((t=>h(t)&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=oe().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.i3slayer.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=ie(this._layerClippingArea,this._modifications,t);ae({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new m:null;this._nodeId2Meta.forEach(((e,t)=>{c(e)?this._nodeId2Meta.delete(t):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):h(s)&&s.push(e.node)})),h(s)&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),h(s)&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==Ce.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),this._nodeId2Meta.delete(e.index),h(t)&&this._nodeId2MetaReloading.set(e.index,t)}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(h(this._modificationGraphics)&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!qe.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){s.geometry.spatialReference=this.i3slayer.spatialReference;const r={...t,color:e[s.type]};this._modificationGraphics.push(new i({geometry:s.geometry,symbol:r}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_suspendedChange(e){e?(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler)):(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);h(i)&&h(i.attributeInfo)&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);h(s)&&(await this.attributeOverrides.apply(s.featureIds,t,i),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,h(this._labeler)&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){h(this._memCache)&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>h(t)&&e.push(t.node))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!o("disable-feature:i3s-basis")&&0!=(this.supportedTextureEncodings&ce.Basis)&&u(this.i3slayer.textureSetDefinitions,(e=>e.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))))&&Ze()}_getVertexBufferLayout(e,t){const i={hasTexture:gt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return Xe(Qe(this._getGeometryParameters(i)))}_getObjectIdField(){return this.i3slayer.objectIdField||"OBJECTID"}_findGraphicNodeAndIndex(e){const t=Be(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let i=null;return n(this._nodeId2Meta,(e=>{if(c(e))return!1;const s=e.featureIds.indexOf(t);return-1!==s&&(i={node:e.node,index:s},!0)})),i}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(c(i))return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=Be(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this._nodeId2Meta.get(t.node.index);if(c(i))return Promise.reject();const s=i.objectHandle,r=fe(t.index,this._collection,s,new Float64Array(24)),o=this.view.renderSpatialReference,a=this.view.spatialReference;if(F(r,o,0,r,a,0,8)){const e=G();return L(e,r,0,8),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}}whenGraphicAttributes(e,t){return Ne(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(h)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return c(t)||null==t.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${ot}/${e.id}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return h(this._memCache)?this._memCache.pop(this._getMemCacheKey(e.index)):null}deleteCachedGPUData(e){h(e)&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(c(this._memCache))return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,i)}loadMissingTextures(e,t,i,s){const r=e.filter(((e,i)=>{if(0==(e.usage&this.rendererTextureUsage))return!1;if(c(t))return!0;const s=Ie(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(c(r)||null==r.data||s&&r.encoding!==s.encoding)}));return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e)),null):(e.geometryObb=s.geometryObb,this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&h(s.textureData)&&(s.byteSize=bt(s.transformedGeometry,s.textureData),s.textureData.every(ft)&&yt(e,s)&&this._idbCache.put(this._getCacheKey(e),s).catch((t=>tt.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),g(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return pt(t)?this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(c(s))return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,transformedGeometry:n}=s,l=this._controller.crsIndex,d=this.view.renderSpatialReference,u=Oe(e.mbs,this.elevationOffset,l,d);e.geometryObb=Ke([r.center.x,r.center.y,r.center.z],[r.extents.x,r.extents.y,r.extents.z],[r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]),T(e.geometryObb.center,e.geometryObb.center,u),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.prototype.slice.call(a));const _={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:n,globalTrafo:u,geometryObb:e.geometryObb,byteSize:bt(n,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&yt(e,_)){const t=h(_.textureData)?_.textureData.map((e=>ft(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e),{..._,textureData:t}).catch((t=>tt.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,_,i)}),i))))):Promise.reject()}computeVisibilityObb(e){return De(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications)}_transformNode(e,t,i){const s=t.geometryData.geometries,r=new Array(s.length);for(let c=0;c<s.length;++c)r[c]=this._getVertexBufferLayout(s[c],t.geometryDescriptor);const o=e.mbs,a=this.elevationOffset,n=this._controller.crsIndex,l=this._controller.crsVertex,d=this.view.renderSpatialReference,h=Se(o,a,n),u=Oe(o,a,n,d),_=A(n,l),m=A(l,d);if(c(_)||c(m))return Promise.resolve(null);const g={context:this.i3slayer.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,localOrigin:h,globalTrafo:u,mbs:o,obb:e.serviceObb,elevationOffset:a,needNormals:!this._isIntegratedMesh&&this._controller.isMeshPyramid,normalReferenceFrame:this.i3slayer.normalReferenceFrame||"none",indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get supportsNodeCrossFading(){var e,t;return!(null!=(e=this.view)&&null!=(t=e._stage)&&t.renderView.hasShadowsEnabled)}get nodeCrossfadingEnabled(){return this.supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this.supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(e.geometryObb=We(this._collection.getComponentObb(t.objectHandle)),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);h(this._labeler)&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,Ye.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this._updateEngineObject(t),this._highlights.objectCreated(t),h(this._treeDebugger)&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async _addCachedNodeData(e,t,i){if(this.suspended||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(c(t))return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:a,globalTrafo:n}=t;await this.attributeOverrides.apply(r.featureIds,s.attributeInfo,i);const l=h(t.textureData)?t.textureData.filter((e=>h(e)&&0!=(e.usage&this.rendererTextureUsage))):[];!o("disable-feature:i3s-basis")&&l.some((e=>h(e)&&(e.encoding===ce.Basis||e.encoding===ce.KTX2)))&&await Ze(),e.memory=0;const{componentOffsets:d,geometries:u,featureIds:m}=r,g=this._collection,p=u[0],{layout:f,indices:b,interleavedVertexData:y,positionData:I,hasColors:v}=a,M=this._materialParameters(p,f),C=d||new Uint32Array([0,b?b.length:y.byteLength/f[0].stride]),T={vertices:{data:y,count:y.byteLength/f[0].stride,layoutParameters:M.geometryParams},positionData:{positions:I.data,indices:I.indices},indices:b,componentOffsets:C},N=p.transformation?j(p.transformation):w();S(N,n,N);const R=E(D(),N),F=x(O(),N),A=this.view.renderSpatialReference,U=this.view.basemapTerrain.spatialReference,H=D(),G=[1,1,1];P(R,A,G,U)||tt.errorOnce("Unsupported coordinate system for IM overlay"),V(R,A,H,U);const L=g.createObject({toMapSpace:[H[0],H[1],G[0],G[1]],geometry:T,obb:_(e.geometryObb),transform:{position:R,rotationScale:F}}),B=M.geometryParams.textureCoordinates===Je.AttributeType.Atlas,{textures:k,texturePromise:q}=this._initMaterialAndTextures(L,M.material,l,B);e.memory+=this._memEstimateGeometryAdded(L),e.memory+=k.reduce(((e,t)=>e+(h(t)?this._memEstimateTextureAdded(t):0)),0);const z=!!M.material.hasParametersFromSource,K="blend"!==M.material.alphaMode&&M.material.metallicRoughness.baseColorFactor[3]>=1,W=new st(e,m,L,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:z,isOpaque:K},k);s.meta=W,!this._hasTextures&&t.requiredTextures.some((({usage:e})=>0!=(e&he.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||v,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const $=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(W),q]).then((([t,s])=>(h(t)&&t.updateObjectVisibility(W.objectHandle,!1),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(h(this._labeler)&&this._addMetaToLabeler(this._labeler,W),this._addNodeMeta(e.index,W),i.meta=null,this.suspended)return void this._removeNodeStageData(e.index,this.elevationOffset);g.setObjectVisibility(L,Ye.Visible),h(t)&&t.updateObjectVisibility(W.objectHandle,!0),W.attributeInfo=i.attributeInfo;const s=W.cachedRendererVersion!==this._rendererVersion,r=$!==this.slicePlaneEnabled;this._setObjectSymbolColors(W);const o=this._applyFiltersToNode(W);(s||h(t)&&(r||o))&&this._addOrUpdateEdgeRendering(W),this._visibleGeometryChanged(W),this._highlights.objectCreated(W),this._updateMaterial(W),this._setNewNodeOpacity(W),h(this._treeDebugger)&&this._treeDebugger.update()}),i)))).catch((e=>{throw h(s.meta)&&(this._cacheGPUData(s.meta),s.meta=null),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){tt.error("Removing duplicated node");const t=this._nodeId2Meta.get(e);h(t)&&this._deleteComponentObject(t)}h(t)&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Mt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_safeReschedule(e,t){return g(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=e.params.material,s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=gt(i);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>ve(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=Me(e,t,o,i,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR(),isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:o,texturePromise:a}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?Je.AttributeType.Atlas:Je.AttributeType.Default:Je.AttributeType.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,i){let s=this._addTasks.get(e.index);return s?s.attributeInfo=t:(s={...p(),attributeInfo:t,meta:null},this._addTasks.set(e.index,s),i().then(s.resolve,s.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))),s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{h(e.meta)&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=k();this._renderClippingArea=ze(this.view.clippingArea,i,e)?i:null;const s=k();this._layerClippingArea=ze(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}_geometryFilterChange(){this._controller.geometryFilterChanged(this.hasGeometryFilter)}get hasGeometryFilter(){return!1}_filterChange(){this._applyFilters(!1)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{h(e)&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e))}))}getFilters(){const e=[],t=this._renderClippingArea;return h(t)&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(h(t)){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=h(t.attributeInfo)&&t.attributeInfo.attributeData;s.every((e=>null!=d[e]||e===n))&&Re(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=Fe(d[i],e));try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return U(e.node.mbs,this._controller.crsIndex,mt,this.view.renderSpatialReference),Ae(t,mt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,lt),B(lt,dt),q(i,dt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===Pe.INSIDE)return;if(r===Pe.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(ht,i,t.objectHandle);Re(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const i=this._edgeView;if(c(i))return Promise.resolve(null);const s=e.objectHandle,r=i.hasObject(s),{hasEdges:o,perFeatureEdgeMaterials:a}=this._getFilteredEdgeMaterials(e),n={slicePlaneEnabled:this.slicePlaneEnabled};if(o&&r){if(this.nodeCrossfadingEnabled){Mt(a,this.getNodeOpacity(e))}return i.updateAllComponentMaterials(s,a,n,t),i.updateObjectVisibility(s,!0),Promise.resolve(i)}return o&&!r?this._collection.addEdges(s,i,a,n).then((t=>(e.edgeMemoryUsage=t,e.node.memory+=t,i))):(!o&&r&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,i.removeObject(s)),Promise.resolve(null))}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(h(this._labeler)&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=0===t.getComponentCount(e.objectHandle).invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!i;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!i;const s=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,s),!0}_updateCachedFilteredIds(e){null!=e.filteredIds&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const i of this._filters)if(i(t,e),0===t.length)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array;return e.featureIds.forEach(((i,s)=>{e.filteredIds[t.length]===i&&t.push(s)})),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading)))}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading)}_removeNodeStageData(e,t,i=this._nodeId2Meta){const s=i.get(e);c(s)?i.delete(e):(this._collection.setObjectVisibility(s.objectHandle,Ye.Hidden),h(this._edgeView)&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1),this._visibleGeometryChanged(s),h(this._labeler)&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),h(this._treeDebugger)&&this._treeDebugger.update())}_deleteComponentObject(e){if(h(this._edgeView)&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===xe.Hole))}_invalidateAllSymbols(){this._rendererVersion=Ve(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Ve(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Ve(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await Q()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:tt.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())"mesh-3d"!==t.type&&tt.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasSymbolColors&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getSymbolColors(e){this._hasSymbolColors&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(e,i)=>{const s=5*e;R(i.externalColor,t[s+0]/255,t[s+1]/255,t[s+2]/255,t[s+3]/255),i.externalColorMixMode=t[s+4]&(1<<rt.CastShadows)-1,i.castShadows=0!=(t[s+4]&1<<rt.CastShadows),i.pickable=0!=(t[s+4]&1<<rt.Pickable)}}_getSymbolInfo(e,t){const i=e&&e.getSymbol(t,{arcade:this._arcade});if(!(i instanceof J))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=Ue(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=h(this._symbologyOverrideFields)&&this._symbologyOverrideFields.length>0?h(this._rendererFields)&&this._rendererFields.length>0?K(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasSymbolColors)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=h(e.attributeInfo)&&e.attributeInfo.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&h(this._symbologyFields)&&this._symbologyFields.length>0,n=a?[]:null,l=a?[]:null;if(a&&h(this._symbologyFields))for(const h of this._symbologyFields){const e=r[h];e&&(n.push(h),l.push(e))}e.cachedSymbology||(e.cachedSymbology=new Uint8Array(5*e.featureIds.length));const d={color:ut,castShadows:!0,pickable:!0,colorMixMode:ke.Multiply,edgeMaterial:null},u=this.fullOpacity,_=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let m=null,g=et.OPAQUE,p=He,f=0;for(let b=0;b<e.featureIds.length;b++){if(null!=o&&(i[o]=e.featureIds[b]),a)for(let e=0;e<n.length;e++)i[n[e]]=Fe(l[e],b);const r=this._getSymbolInfo(s,t);let u=null,y=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=X(this._colorVariable,t,{color:_t,arcade:this._arcade});e&&(u=ut,u[0]=e.r/255,u[1]=e.g/255,u[2]=e.b/255,this._opacityVariable||null===e.a||(y=e.a))}this._opacityVariable&&(y=Y(this._opacityVariable,t,{arcade:this._arcade}))}if(r&&r.material){const e=r.material;u=c(u)||c(y)?de(u,y,e.color,e.alpha,it,ut):de(u,y,null,null,it,ut)}if(c(u)&&(u=ut,u[0]=1,u[1]=1,u[2]=1,u[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r&&r.material?r.material.colorMixMode:ke.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,h(this._symbologyOverride)&&(d.color=u,this._symbologyOverride(t,d),u=d.color),h(d.edgeMaterial)){const t=u[3]<=0?et.INVISIBLE:u[3]>=1&&(e.material.isOpaque||d.colorMixMode===ke.Replace)?et.OPAQUE:et.TRANSPARENT;d.edgeMaterial===m&&t===g||(p={...d.edgeMaterial,opacity:_,objectTransparency:t},m=d.edgeMaterial,g=t),e.cachedEdgeMaterials[b]=p}else e.cachedEdgeMaterials[b]=He;e.cachedSymbology[f+0]=Math.round(255*u[0]),e.cachedSymbology[f+1]=Math.round(255*u[1]),e.cachedSymbology[f+2]=Math.round(255*u[2]),e.cachedSymbology[f+3]=Math.round(255*u[3]),e.cachedSymbology[f+4]=d.colorMixMode|+d.castShadows<<rt.CastShadows|+d.pickable<<rt.Pickable,f+=5}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);if(this.nodeCrossfadingEnabled||Mt(t,this.fullOpacity),c(e.filteredIds)){return{hasEdges:t.some((e=>e!==He)),perFeatureEdgeMaterials:t}}let i=0,s=!1;const r=t.map(((t,r)=>e.featureIds[r]!==e.filteredIds[i]?He:(s=s||t!==He,i++,t)));return{hasEdges:s,perFeatureEdgeMaterials:r}}_setObjectSymbolColors(e){if(!this._hasSymbolColors)return;const t=e.objectHandle,i=this._getSymbolColors(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Mt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.slicePlaneEnabled=this.slicePlaneEnabled,e.usePBR=this._usePBR(),this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._setObjectSymbolColors(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),h(this._labeler)&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>{t.commonMaterialParameters.slicePlaneEnabled=e})),this._updateEdgeRendering(t,!1))}))}_updatePBR(){this._nodeId2Meta.forEach((e=>{c(e)||this._collection.updateMaterial(e.objectHandle,(e=>{e.usePBR=this._usePBR()}))})),this._hasLoadedPBRTextures=!0}_usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){h(this._edgeView)&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_forAllFeatures(e,t,i=se.VISIBLE_ONLY){n(this._nodeId2Meta,(s=>{if(c(s))return!1;if(h(t)){switch(t(s)){case re.EXIT:return!0;case re.SKIP:return!1}}let r=re.CONTINUE;switch(i){case se.ALL:r=this._forAllFeaturesOfNode(s,e);break;case se.VISIBLE_ONLY:r=this._forVisibleFeaturesOfNode(s,e);break;case se.ALL_IN_CLIPPING_AREA:r=this._forAllFeaturesOfNodeInClippingArea(s,e)}return r===re.EXIT}))}_forAllFeaturesOfNode(e,t){let i=re.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===re.EXIT)return i;return i}_forVisibleFeaturesOfNode(e,t){let i=re.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===re.CONTINUE))),i}_forAllFeaturesOfNodeInClippingArea(e,t){if(c(this._renderClippingArea))return this._forAllFeaturesOfNode(e,t);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===Pe.OUTSIDE)return re.CONTINUE;if(i===Pe.INSIDE)return this._forAllFeaturesOfNode(e,t);const s=re.CONTINUE,r=e.featureIds,o=e.objectHandle,a=Ge(this._renderClippingArea,this._collection.getObjectTransform(o));for(let n=0;n<r.length;n++){if(!this._boundingRectFeatureTest(e,n,a))continue;const i=t(r[n],n,e);if(i===re.EXIT)return i}return s}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=h(t.attributeInfo)&&t.attributeInfo.attributeData;if(h(s))for(const r of Object.keys(s))i[r]=Fe(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e){const t=this._highlights;if("number"==typeof e||e instanceof i?e=[e]:e instanceof r&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof i){const i=e,s=this.i3slayer.fieldsIndex,r=this._getObjectIdField(),o=i.map((e=>Be(s,e.attributes,r))),{set:a,handle:n}=t.acquireSet();return t.setFeatureIds(a,o),n}if("number"==typeof e[0]){const i=e,{set:s,handle:r}=t.acquireSet();return t.setFeatureIds(s,i),r}}return vt}_visibleGeometryChanged(e){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=b((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this.gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this.geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this.texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.getUnloadedMemory()/1048576).toFixed(1)+"MB"};return h(this._memCache)&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures((e=>(t.push(e),re.CONTINUE)),null,se.VISIBLE_ONLY),t.sort(((e,t)=>e-t)),t},get numNodes(){return e._nodeId2Meta.size}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return h(e)?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(((t,i)=>e(i,t)))}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);h(s)&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(!h(this._edgeView)||!e.cachedEdgeMaterials)return;Mt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t)}get hasModifications(){return this._isIntegratedMesh&&h(this._layerClippingArea)||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.i3slayer.uid,s=It(e);if(h(s)){const t={context:i,buffer:s.buffer};ne(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=le(i);e.imModificationImpact=s,s!==Ce.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||h(this._labeler)&&this._labeler.updating||this._crossfadeHelper.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0}};return e([M()],s.prototype,"_hasLoadedPBRTextures",void 0),e([M()],s.prototype,"_asyncModuleLoading",void 0),e([M()],s.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([M()],s.prototype,"view",void 0),e([M()],s.prototype,"i3slayer",void 0),e([M()],s.prototype,"_controller",void 0),e([M()],s.prototype,"_labeler",void 0),e([M()],s.prototype,"updating",void 0),e([M()],s.prototype,"suspended",void 0),e([M()],s.prototype,"holeFilling",void 0),e([M($e)],s.prototype,"updatingProgress",void 0),e([M({readOnly:!0,aliasOf:"_controller.updatingProgress"})],s.prototype,"updatingProgressValue",void 0),e([M({readOnly:!0})],s.prototype,"hasTexturesOrVertexColors",null),e([M({readOnly:!0})],s.prototype,"rendererTextureUsage",null),e([M()],s.prototype,"filter",void 0),e([M({readOnly:!0})],s.prototype,"elevationOffset",null),e([M({type:Boolean})],s.prototype,"slicePlaneEnabled",void 0),e([M()],s.prototype,"supportedTextureEncodings",null),e([M()],s.prototype,"uncompressedTextureDownsamplingEnabled",null),e([M({type:[$]})],s.prototype,"_modifications",void 0),s=e([C("esri.views.3d.layers.I3SMeshView3D")],s),s},lt=H(),dt=k(),ht=k(),ct=Ke(),ut=[0,0,0,0],_t=new t([0,0,0,0]),mt=[0,0,0,0];function gt(e){const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function pt(e){return"geometryData"in e}function ft(e){return h(e)&&y(e.data)}function bt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(h(t))for(const s of t)h(s)&&y(s.data)&&(i+=s.data.byteLength);return i}function yt(e,t){return t.byteSize>at?(tt.warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function It(e){if(0===e.length)return null;const t=10*e.length,i=new Float64Array(t);return e.forAll(((e,t)=>{let s=e.serviceObb;c(s)&&(s=ct,N(s.center,e.mbs),s.halfSize[0]=s.halfSize[1]=s.halfSize[2]=e.mbs[3]);const r=10*t;i[r+0]=s.center[0],i[r+1]=s.center[1],i[r+2]=s.center[2],i[r+3]=s.halfSize[0],i[r+4]=s.halfSize[1],i[r+5]=s.halfSize[2],i[r+6]=s.quaternion[0],i[r+7]=s.quaternion[1],i[r+8]=s.quaternion[2],i[r+9]=s.quaternion[3]})),i}const vt={remove(){},pause(){},resume(){}};function Mt(e,t){e.forEach((e=>e.opacity=t))}export{nt as I3SMeshView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{ByteSizeUnit as s}from"../../../core/byteSizeEstimations.js";import r from"../../../core/Collection.js";import o from"../../../core/has.js";import a from"../../../core/Logger.js";import{someMap as n}from"../../../core/MapUtils.js";import{unwrapOr as l,destroyMaybe as d,isSome as h,isNone as c,applySome as u,unwrap as _}from"../../../core/maybe.js";import m from"../../../core/PooledArray.js";import{throwIfAborted as g,createResolver as p}from"../../../core/promiseUtils.js";import{initial as f}from"../../../core/reactiveUtils.js";import{schedule as b}from"../../../core/scheduling.js";import{isArrayBuffer as y}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as I}from"../../../core/unitUtils.js";import{init as v}from"../../../core/watchUtils.js";import{property as M}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{f as x}from"../../../chunks/mat3.js";import{c as O}from"../../../chunks/mat3f32.js";import{m as S,B as E}from"../../../chunks/mat4.js";import{b as j,c as w}from"../../../chunks/mat4f64.js";import{m as N,g as D}from"../../../chunks/vec3.js";import{c as R}from"../../../chunks/vec3f64.js";import{s as T}from"../../../chunks/vec4.js";import{projectBuffer as F,getProjectorName as A,localLinearScaleFactors as P,projectVectorToVector as V,projectBoundingSphere as U}from"../../../geometry/projection.js";import{create as H,empty as G,expandWithBuffer as L,toRect as B}from"../../../geometry/support/aaBoundingBox.js";import{create as k,intersects as q}from"../../../geometry/support/aaBoundingRect.js";import z from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as K}from"../../../layers/support/fieldUtils.js";import{areLabelsVisible as W}from"../../../layers/support/layerUtils.js";import $ from"../../../layers/support/SceneModification.js";import{getColor as X,getOpacity as Y}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as Q}from"../../../support/arcadeOnDemand.js";import J from"../../../symbols/Symbol3D.js";import{getMetersPerUnit as Z}from"../../../symbols/support/unitConversionUtils.js";import ee from"./I3SMeshViewLabeler.js";import{I3SMeshWorkerHandle as te,toWasmModification as ie}from"./I3SMeshWorkerHandle.js";import{ForAllFeaturesVisibilityMode as se,ForAllFeaturesReturnType as re}from"./II3SMeshView3D.js";import{initialize as oe,setModificationsSync as ae,filterObbsForModificationsSync as ne,interpretObbModificationResults as le}from"./SceneLayerWorker.js";import{overrideColor as de}from"./graphics/graphicUtils.js";import{TextureUsage as he,TextureEncoding as ce}from"./i3s/enums.js";import ue from"./i3s/Highlights.js";import{I3SAttributeOverrides as _e}from"./i3s/I3SAttributeOverrides.js";import{I3SCrossfadeHelper as me,NodeCrossfadeMetaData as ge}from"./i3s/I3SCrossfadeHelper.js";import pe from"./i3s/I3SElevationProvider.js";import{boundingBoxCornerPoints as fe}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as be}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as ye,selectEncoding as Ie,createTexture as ve,configureMaterial as Me}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as Ce,NodeState as xe}from"./i3s/I3SNode.js";import{computeGlobalTransformation as Oe,getLocalOrigin as Se}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Ee,checkSceneLayerValid as je,checkSceneLayerCompatibleWithView as we,getCacheKeySuffix as Ne,whenGraphicAttributes as De,computeVisibilityObb as Re,filterInPlace as Te,getCachedAttributeValue as Fe,intersectBoundingRectWithMbs as Ae,MbsIntersectResult as Pe,addWraparound as Ve,getSymbolInfo as Ue,transparentEdgeMaterial as He,getClipRect as Ge}from"./i3s/I3SUtil.js";import{IDBCache as Le}from"./i3s/IDBCache.js";import{attributeLookup as Be}from"./support/attributeUtils.js";import{ColorMixModeEnum as ke}from"./support/symbolColorUtils.js";import qe from"../support/debugFlags.js";import{toBoundingRect as ze}from"../support/extentUtils.js";import{create as Ke,clone as We}from"../support/orientedBoundingBox.js";import{updatingProgress as $e}from"../support/updatingProperties.js";import{glLayout as Xe}from"../support/buffer/glUtil.js";import{State as Ye}from"../webgl-engine/collections/Component/ComponentObject.js";import{createVertexBufferLayout as Qe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{TextureCoordinateAttributeType as Je}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasis as Ze}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as et}from"../webgl-engine/lib/edgeRendering/interfaces.js";const tt=a.getLogger("esri.views.3d.layers.SceneLayerView3D"),it=[1,1,1,1];class st extends ge{constructor(e,t,i,s,r,o,a){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbology=null}}var rt;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(rt||(rt={}));const ot=19,at=100*s.MEGABYTES,nt=t=>{let s=class extends t{constructor(...e){super(e),this._elevationProvider=null,this._intersectionHandler=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._idbCache=new Le("esri-scenelayer-cache","geometries"),this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.filter=null,this.slicePlaneEnabled=!1,this._modifications=new Array,this._layerUrl="",this._cacheKeySuffix=null,this._arcade=null,this._tmpAttributeOnlyGraphic=new i(null,null,{}),this._crossfadeHelper=new me(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ee(this._currentRenderer)?this._usePBR()||this._hasLoadedPBRTextures?he.AllTexturesPBR:he.AllTextures:this._usePBR()||this._hasLoadedPBRTextures?he.GeometryTexturesPBR:he.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null!=e&&"absolute-height"===e.mode){const t=I(this.i3slayer.spatialReference),i=Z(e.unit);return l(e.offset,0)*i/t}return 0}get supportedTextureEncodings(){return ye(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){var e;const t=null==(e=this.view)?void 0:e.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,i=0==(this.supportedTextureEncodings&ce.DDS_S3TC);return t&&i}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController;if(this.attributeOverrides=new _e(this.i3slayer,e.memoryController),this._worker=new te((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._worker.setLegacySchema(this.layerUid,this.i3slayer.store.defaultGeometrySchema),je(this.i3slayer),we(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new z({layerView:this}),this.gpuMemoryEstimate=0,this.texMemoryEstimate=0,this.geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this._highlights=new ue({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,se.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._isIntegratedMesh||!this.i3slayer.store.defaultGeometrySchema)this._hasSymbolColors=!1;else{const e=this.i3slayer.store.defaultGeometrySchema.featureAttributes;this._hasSymbolColors=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=this.i3slayer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.i3slayer.cachedDrawingInfo||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderView.ensureEdgeView());const t=this.view.resourceController.memoryController.newCache(this.i3slayer.uid,(e=>this._deleteComponentObject(e)));this._memCache=t;const i=e=>h(this._controller.index)&&h(this._controller.index.rootNode)?this._controller.index.traverse(this._controller.index.rootNode,(t=>{const i=t.index,s=this._nodeId2Meta.get(i)||this._nodeId2MetaReloading.get(i);return e(t,h(s)?s.objectHandle:null)})):()=>{};this._intersectionHandler=new be({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:i}),this._elevationProvider=new pe({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR(),this.updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),f),this.updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this.updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this.updatingHandles.add((()=>this.filter),(()=>this._filterChange()),f),this.updatingHandles.add((()=>this.view.qualitySettings.physicallyBasedRenderingEnabled),(()=>this._updatePBR()));const s=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add((()=>this.rendererTextureUsage),s),this.updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),s),this.updatingHandles.add((()=>this.suspended),(e=>this._suspendedChange(e)),f),this.updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),f),this.handles.add([v(qe,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&qe.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||qe.I3S_TREE_SHOW_TILES||(this._treeDebugger=d(this._treeDebugger))})),v(qe,"I3S_SHOW_MODIFICATIONS",(()=>this._showModifications()))]),this._cacheKeySuffix=Ne(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch((e=>tt.warn(`Failed to initialize IndexedDB cache: ${e}`)))}destroy(){this._clearAddTasks(),this.attributeOverrides=d(this.attributeOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.i3slayer.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=d(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=d(this._labeler),this._treeDebugger=d(this._treeDebugger),this._controller=d(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.estimatedTexMemRequired;return this.gpuMemoryEstimate+=t,this.texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(h(e)){const t=e.estimatedTexMemRequired;this.gpuMemoryEstimate-=t,this.texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this.gpuMemoryEstimate+=t,this.geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this.gpuMemoryEstimate-=t,this.geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}getUsedMemory(){let e=h(this._labeler)?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=h(t)?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=h(t)?t.node.memory:0)),e}getUnloadedMemory(){return(h(this._controller)?this._controller.unloadedMemoryEstimate:0)+(h(this._labeler)?this._labeler.unloadedMemoryEstimate:0)}ignoresMemoryFactor(){return!1}_labelingChanged(){if(!(W(this.i3slayer)&&this._supportsLabeling))return void(h(this._labeler)&&(this._labeler.destroy(),this._labeler=null));if(h(this._labeler))return;const e=new ee({view:this.view,layer:this.i3slayer,collection:this._collection});this._nodeId2Meta.forEach((t=>h(t)&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=oe().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.i3slayer.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=ie(this._layerClippingArea,this._modifications,t);ae({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new m:null;this._nodeId2Meta.forEach(((e,t)=>{c(e)?this._nodeId2Meta.delete(t):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):h(s)&&s.push(e.node)})),h(s)&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),h(s)&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==Ce.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),this._nodeId2Meta.delete(e.index),h(t)&&this._nodeId2MetaReloading.set(e.index,t)}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(h(this._modificationGraphics)&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!qe.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){s.geometry.spatialReference=this.i3slayer.spatialReference;const r={...t,color:e[s.type]};this._modificationGraphics.push(new i({geometry:s.geometry,symbol:r}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_suspendedChange(e){e?(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler)):(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);h(i)&&h(i.attributeInfo)&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);h(s)&&(await this.attributeOverrides.apply(s.featureIds,t,i),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,h(this._labeler)&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){h(this._memCache)&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>h(t)&&e.push(t.node))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!o("disable-feature:i3s-basis")&&0!=(this.supportedTextureEncodings&ce.Basis)&&u(this.i3slayer.textureSetDefinitions,(e=>e.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))))&&Ze()}_getVertexBufferLayout(e,t){const i={hasTexture:gt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return Xe(Qe(this._getGeometryParameters(i)))}_getObjectIdField(){return this.i3slayer.objectIdField||"OBJECTID"}_findGraphicNodeAndIndex(e){const t=Be(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let i=null;return n(this._nodeId2Meta,(e=>{if(c(e))return!1;const s=e.featureIds.indexOf(t);return-1!==s&&(i={node:e.node,index:s},!0)})),i}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(c(i))return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=Be(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this._nodeId2Meta.get(t.node.index);if(c(i))return Promise.reject();const s=i.objectHandle,r=fe(t.index,this._collection,s,new Float64Array(24)),o=this.view.renderSpatialReference,a=this.view.spatialReference;if(F(r,o,0,r,a,0,8)){const e=G();return L(e,r,0,8),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}}whenGraphicAttributes(e,t){return De(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(h)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return c(t)||null==t.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${ot}/${e.id}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return h(this._memCache)?this._memCache.pop(this._getMemCacheKey(e.index)):null}deleteCachedGPUData(e){h(e)&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(c(this._memCache))return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,i)}loadMissingTextures(e,t,i,s){const r=e.filter(((e,i)=>{if(0==(e.usage&this.rendererTextureUsage))return!1;if(c(t))return!0;const s=Ie(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(c(r)||null==r.data||s&&r.encoding!==s.encoding)}));return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e)),null):(e.geometryObb=s.geometryObb,this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&h(s.textureData)&&(s.byteSize=bt(s.transformedGeometry,s.textureData),s.textureData.every(ft)&&yt(e,s)&&this._idbCache.put(this._getCacheKey(e),s).catch((t=>tt.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),g(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return pt(t)?this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(c(s))return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,transformedGeometry:n}=s,l=this._controller.crsIndex,d=this.view.renderSpatialReference,u=Oe(e.mbs,this.elevationOffset,l,d);e.geometryObb=Ke([r.center.x,r.center.y,r.center.z],[r.extents.x,r.extents.y,r.extents.z],[r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]),N(e.geometryObb.center,e.geometryObb.center,u),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.prototype.slice.call(a));const _={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:n,globalTrafo:u,geometryObb:e.geometryObb,byteSize:bt(n,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&yt(e,_)){const t=h(_.textureData)?_.textureData.map((e=>ft(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e),{..._,textureData:t}).catch((t=>tt.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,_,i)}),i))))):Promise.reject()}computeVisibilityObb(e){return Re(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications)}_transformNode(e,t,i){const s=t.geometryData.geometries,r=new Array(s.length);for(let c=0;c<s.length;++c)r[c]=this._getVertexBufferLayout(s[c],t.geometryDescriptor);const o=e.mbs,a=this.elevationOffset,n=this._controller.crsIndex,l=this._controller.crsVertex,d=this.view.renderSpatialReference,h=Se(o,a,n),u=Oe(o,a,n,d),_=A(n,l),m=A(l,d);if(c(_)||c(m))return Promise.resolve(null);const g={context:this.i3slayer.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,localOrigin:h,globalTrafo:u,mbs:o,obb:e.serviceObb,elevationOffset:a,needNormals:!this._isIntegratedMesh&&this._controller.isMeshPyramid,normalReferenceFrame:this.i3slayer.normalReferenceFrame||"none",indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get supportsNodeCrossFading(){var e,t;return!(null!=(e=this.view)&&null!=(t=e._stage)&&t.renderView.hasShadowsEnabled)}get nodeCrossfadingEnabled(){return this.supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this.supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(e.geometryObb=We(this._collection.getComponentObb(t.objectHandle)),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);h(this._labeler)&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,Ye.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this._updateEngineObject(t),this._highlights.objectCreated(t),h(this._treeDebugger)&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async _addCachedNodeData(e,t,i){if(this.suspended||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(c(t))return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:a,globalTrafo:n}=t;await this.attributeOverrides.apply(r.featureIds,s.attributeInfo,i);const l=h(t.textureData)?t.textureData.filter((e=>h(e)&&0!=(e.usage&this.rendererTextureUsage))):[];!o("disable-feature:i3s-basis")&&l.some((e=>h(e)&&(e.encoding===ce.Basis||e.encoding===ce.KTX2)))&&await Ze(),e.memory=0;const{componentOffsets:d,geometries:u,featureIds:m}=r,g=this._collection,p=u[0],{layout:f,indices:b,interleavedVertexData:y,positionData:I,hasColors:v}=a,M=this._materialParameters(p,f),C=d||new Uint32Array([0,b?b.length:y.byteLength/f[0].stride]),N={vertices:{data:y,count:y.byteLength/f[0].stride,layoutParameters:M.geometryParams},positionData:{positions:I.data,indices:I.indices},indices:b,componentOffsets:C},D=p.transformation?j(p.transformation):w();S(D,n,D);const T=E(R(),D),F=x(O(),D),A=this.view.renderSpatialReference,U=this.view.basemapTerrain.spatialReference,H=R(),G=[1,1,1];P(T,A,G,U)||tt.errorOnce("Unsupported coordinate system for IM overlay"),V(T,A,H,U);const L=g.createObject({toMapSpace:[H[0],H[1],G[0],G[1]],geometry:N,obb:_(e.geometryObb),transform:{position:T,rotationScale:F}}),B=M.geometryParams.textureCoordinates===Je.Atlas,{textures:k,texturePromise:q}=this._initMaterialAndTextures(L,M.material,l,B);e.memory+=this._memEstimateGeometryAdded(L),e.memory+=k.reduce(((e,t)=>e+(h(t)?this._memEstimateTextureAdded(t):0)),0);const z=!!M.material.hasParametersFromSource,K="blend"!==M.material.alphaMode&&M.material.metallicRoughness.baseColorFactor[3]>=1,W=new st(e,m,L,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:z,isOpaque:K},k);s.meta=W,!this._hasTextures&&t.requiredTextures.some((({usage:e})=>0!=(e&he.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||v,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const $=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(W),q]).then((([t,s])=>(h(t)&&t.updateObjectVisibility(W.objectHandle,!1),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(h(this._labeler)&&this._addMetaToLabeler(this._labeler,W),this._addNodeMeta(e.index,W),i.meta=null,this.suspended)return void this._removeNodeStageData(e.index,this.elevationOffset);g.setObjectVisibility(L,Ye.Visible),h(t)&&t.updateObjectVisibility(W.objectHandle,!0),W.attributeInfo=i.attributeInfo;const s=W.cachedRendererVersion!==this._rendererVersion,r=$!==this.slicePlaneEnabled;this._setObjectSymbolColors(W);const o=this._applyFiltersToNode(W);(s||h(t)&&(r||o))&&this._addOrUpdateEdgeRendering(W),this._visibleGeometryChanged(W),this._highlights.objectCreated(W),this._updateMaterial(W),this._setNewNodeOpacity(W),h(this._treeDebugger)&&this._treeDebugger.update()}),i)))).catch((e=>{throw h(s.meta)&&(this._cacheGPUData(s.meta),s.meta=null),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){tt.error("Removing duplicated node");const t=this._nodeId2Meta.get(e);h(t)&&this._deleteComponentObject(t)}h(t)&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Mt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_safeReschedule(e,t){return g(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=e.params.material,s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=gt(i);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>ve(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=Me(e,t,o,i,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR(),isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:o,texturePromise:a}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?Je.Atlas:Je.Default:Je.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,i){let s=this._addTasks.get(e.index);return s?s.attributeInfo=t:(s={...p(),attributeInfo:t,meta:null},this._addTasks.set(e.index,s),i().then(s.resolve,s.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))),s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{h(e.meta)&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=k();this._renderClippingArea=ze(this.view.clippingArea,i,e)?i:null;const s=k();this._layerClippingArea=ze(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}_geometryFilterChange(){this._controller.geometryFilterChanged(this.hasGeometryFilter)}get hasGeometryFilter(){return!1}_filterChange(){this._applyFilters(!1)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{h(e)&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e))}))}getFilters(){const e=[],t=this._renderClippingArea;return h(t)&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(h(t)){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=h(t.attributeInfo)&&t.attributeInfo.attributeData;s.every((e=>null!=d[e]||e===n))&&Te(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=Fe(d[i],e));try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return U(e.node.mbs,this._controller.crsIndex,mt,this.view.renderSpatialReference),Ae(t,mt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,lt),B(lt,dt),q(i,dt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===Pe.INSIDE)return;if(r===Pe.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(ht,i,t.objectHandle);Te(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const i=this._edgeView;if(c(i))return Promise.resolve(null);const s=e.objectHandle,r=i.hasObject(s),{hasEdges:o,perFeatureEdgeMaterials:a}=this._getFilteredEdgeMaterials(e),n={slicePlaneEnabled:this.slicePlaneEnabled};if(o&&r){if(this.nodeCrossfadingEnabled){Mt(a,this.getNodeOpacity(e))}return i.updateAllComponentMaterials(s,a,n,t),i.updateObjectVisibility(s,!0),Promise.resolve(i)}return o&&!r?this._collection.addEdges(s,i,a,n).then((t=>(e.edgeMemoryUsage=t,e.node.memory+=t,i))):(!o&&r&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,i.removeObject(s)),Promise.resolve(null))}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(h(this._labeler)&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=0===t.getComponentCount(e.objectHandle).invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!i;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!i;const s=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,s),!0}_updateCachedFilteredIds(e){null!=e.filteredIds&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const i of this._filters)if(i(t,e),0===t.length)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array;return e.featureIds.forEach(((i,s)=>{e.filteredIds[t.length]===i&&t.push(s)})),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading)))}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading)}_removeNodeStageData(e,t,i=this._nodeId2Meta){const s=i.get(e);c(s)?i.delete(e):(this._collection.setObjectVisibility(s.objectHandle,Ye.Hidden),h(this._edgeView)&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1),this._visibleGeometryChanged(s),h(this._labeler)&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),h(this._treeDebugger)&&this._treeDebugger.update())}_deleteComponentObject(e){if(h(this._edgeView)&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===xe.Hole))}_invalidateAllSymbols(){this._rendererVersion=Ve(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Ve(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Ve(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await Q()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:tt.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())"mesh-3d"!==t.type&&tt.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasSymbolColors&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getSymbolColors(e){this._hasSymbolColors&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(e,i)=>{const s=5*e;T(i.externalColor,t[s+0]/255,t[s+1]/255,t[s+2]/255,t[s+3]/255),i.externalColorMixMode=t[s+4]&(1<<rt.CastShadows)-1,i.castShadows=0!=(t[s+4]&1<<rt.CastShadows),i.pickable=0!=(t[s+4]&1<<rt.Pickable)}}_getSymbolInfo(e,t){const i=e&&e.getSymbol(t,{arcade:this._arcade});if(!(i instanceof J))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=Ue(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=h(this._symbologyOverrideFields)&&this._symbologyOverrideFields.length>0?h(this._rendererFields)&&this._rendererFields.length>0?K(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasSymbolColors)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=h(e.attributeInfo)&&e.attributeInfo.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&h(this._symbologyFields)&&this._symbologyFields.length>0,n=a?[]:null,l=a?[]:null;if(a&&h(this._symbologyFields))for(const h of this._symbologyFields){const e=r[h];e&&(n.push(h),l.push(e))}e.cachedSymbology||(e.cachedSymbology=new Uint8Array(5*e.featureIds.length));const d={color:ut,castShadows:!0,pickable:!0,colorMixMode:ke.Multiply,edgeMaterial:null},u=this.fullOpacity,_=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let m=null,g=et.OPAQUE,p=He,f=0;for(let b=0;b<e.featureIds.length;b++){if(null!=o&&(i[o]=e.featureIds[b]),a)for(let e=0;e<n.length;e++)i[n[e]]=Fe(l[e],b);const r=this._getSymbolInfo(s,t);let u=null,y=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=X(this._colorVariable,t,{color:_t,arcade:this._arcade});e&&(u=ut,u[0]=e.r/255,u[1]=e.g/255,u[2]=e.b/255,this._opacityVariable||null===e.a||(y=e.a))}this._opacityVariable&&(y=Y(this._opacityVariable,t,{arcade:this._arcade}))}if(r&&r.material){const e=r.material;u=c(u)||c(y)?de(u,y,e.color,e.alpha,it,ut):de(u,y,null,null,it,ut)}if(c(u)&&(u=ut,u[0]=1,u[1]=1,u[2]=1,u[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r&&r.material?r.material.colorMixMode:ke.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,h(this._symbologyOverride)&&(d.color=u,this._symbologyOverride(t,d),u=d.color),h(d.edgeMaterial)){const t=u[3]<=0?et.INVISIBLE:u[3]>=1&&(e.material.isOpaque||d.colorMixMode===ke.Replace)?et.OPAQUE:et.TRANSPARENT;d.edgeMaterial===m&&t===g||(p={...d.edgeMaterial,opacity:_,objectTransparency:t},m=d.edgeMaterial,g=t),e.cachedEdgeMaterials[b]=p}else e.cachedEdgeMaterials[b]=He;e.cachedSymbology[f+0]=Math.round(255*u[0]),e.cachedSymbology[f+1]=Math.round(255*u[1]),e.cachedSymbology[f+2]=Math.round(255*u[2]),e.cachedSymbology[f+3]=Math.round(255*u[3]),e.cachedSymbology[f+4]=d.colorMixMode|+d.castShadows<<rt.CastShadows|+d.pickable<<rt.Pickable,f+=5}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);if(this.nodeCrossfadingEnabled||Mt(t,this.fullOpacity),c(e.filteredIds)){return{hasEdges:t.some((e=>e!==He)),perFeatureEdgeMaterials:t}}let i=0,s=!1;const r=t.map(((t,r)=>e.featureIds[r]!==e.filteredIds[i]?He:(s=s||t!==He,i++,t)));return{hasEdges:s,perFeatureEdgeMaterials:r}}_setObjectSymbolColors(e){if(!this._hasSymbolColors)return;const t=e.objectHandle,i=this._getSymbolColors(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Mt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.slicePlaneEnabled=this.slicePlaneEnabled,e.usePBR=this._usePBR(),this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._setObjectSymbolColors(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),h(this._labeler)&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>{t.commonMaterialParameters.slicePlaneEnabled=e})),this._updateEdgeRendering(t,!1))}))}_updatePBR(){this._nodeId2Meta.forEach((e=>{c(e)||this._collection.updateMaterial(e.objectHandle,(e=>{e.usePBR=this._usePBR()}))})),this._hasLoadedPBRTextures=!0}_usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){h(this._edgeView)&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_forAllFeatures(e,t,i=se.VISIBLE_ONLY){n(this._nodeId2Meta,(s=>{if(c(s))return!1;if(h(t)){switch(t(s)){case re.EXIT:return!0;case re.SKIP:return!1}}let r=re.CONTINUE;switch(i){case se.ALL:r=this._forAllFeaturesOfNode(s,e);break;case se.VISIBLE_ONLY:r=this._forVisibleFeaturesOfNode(s,e);break;case se.ALL_IN_CLIPPING_AREA:r=this._forAllFeaturesOfNodeInClippingArea(s,e)}return r===re.EXIT}))}_forAllFeaturesOfNode(e,t){let i=re.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===re.EXIT)return i;return i}_forVisibleFeaturesOfNode(e,t){let i=re.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===re.CONTINUE))),i}_forAllFeaturesOfNodeInClippingArea(e,t){if(c(this._renderClippingArea))return this._forAllFeaturesOfNode(e,t);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===Pe.OUTSIDE)return re.CONTINUE;if(i===Pe.INSIDE)return this._forAllFeaturesOfNode(e,t);const s=re.CONTINUE,r=e.featureIds,o=e.objectHandle,a=Ge(this._renderClippingArea,this._collection.getObjectTransform(o));for(let n=0;n<r.length;n++){if(!this._boundingRectFeatureTest(e,n,a))continue;const i=t(r[n],n,e);if(i===re.EXIT)return i}return s}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=h(t.attributeInfo)&&t.attributeInfo.attributeData;if(h(s))for(const r of Object.keys(s))i[r]=Fe(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e){const t=this._highlights;if("number"==typeof e||e instanceof i?e=[e]:e instanceof r&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof i){const i=e,s=this.i3slayer.fieldsIndex,r=this._getObjectIdField(),o=i.map((e=>Be(s,e.attributes,r))),{set:a,handle:n}=t.acquireSet();return t.setFeatureIds(a,o),n}if("number"==typeof e[0]){const i=e,{set:s,handle:r}=t.acquireSet();return t.setFeatureIds(s,i),r}}return vt}_visibleGeometryChanged(e){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=b((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this.gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this.geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this.texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.getUnloadedMemory()/1048576).toFixed(1)+"MB"};return h(this._memCache)&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures((e=>(t.push(e),re.CONTINUE)),null,se.VISIBLE_ONLY),t.sort(((e,t)=>e-t)),t},get numNodes(){return e._nodeId2Meta.size}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return h(e)?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(((t,i)=>e(i,t)))}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);h(s)&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(!h(this._edgeView)||!e.cachedEdgeMaterials)return;Mt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t)}get hasModifications(){return this._isIntegratedMesh&&h(this._layerClippingArea)||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.i3slayer.uid,s=It(e);if(h(s)){const t={context:i,buffer:s.buffer};ne(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=le(i);e.imModificationImpact=s,s!==Ce.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||h(this._labeler)&&this._labeler.updating||this._crossfadeHelper.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0}};return e([M()],s.prototype,"_hasLoadedPBRTextures",void 0),e([M()],s.prototype,"_asyncModuleLoading",void 0),e([M()],s.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([M()],s.prototype,"view",void 0),e([M()],s.prototype,"i3slayer",void 0),e([M()],s.prototype,"_controller",void 0),e([M()],s.prototype,"_labeler",void 0),e([M()],s.prototype,"updating",void 0),e([M()],s.prototype,"suspended",void 0),e([M()],s.prototype,"holeFilling",void 0),e([M($e)],s.prototype,"updatingProgress",void 0),e([M({readOnly:!0,aliasOf:"_controller.updatingProgress"})],s.prototype,"updatingProgressValue",void 0),e([M({readOnly:!0})],s.prototype,"hasTexturesOrVertexColors",null),e([M({readOnly:!0})],s.prototype,"rendererTextureUsage",null),e([M()],s.prototype,"filter",void 0),e([M({readOnly:!0})],s.prototype,"elevationOffset",null),e([M({type:Boolean})],s.prototype,"slicePlaneEnabled",void 0),e([M()],s.prototype,"supportedTextureEncodings",null),e([M()],s.prototype,"uncompressedTextureDownsamplingEnabled",null),e([M({type:[$]})],s.prototype,"_modifications",void 0),s=e([C("esri.views.3d.layers.I3SMeshView3D")],s),s},lt=H(),dt=k(),ht=k(),ct=Ke(),ut=[0,0,0,0],_t=new t([0,0,0,0]),mt=[0,0,0,0];function gt(e){const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function pt(e){return"geometryData"in e}function ft(e){return h(e)&&y(e.data)}function bt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(h(t))for(const s of t)h(s)&&y(s.data)&&(i+=s.data.byteLength);return i}function yt(e,t){return t.byteSize>at?(tt.warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function It(e){if(0===e.length)return null;const t=10*e.length,i=new Float64Array(t);return e.forAll(((e,t)=>{let s=e.serviceObb;c(s)&&(s=ct,D(s.center,e.mbs),s.halfSize[0]=s.halfSize[1]=s.halfSize[2]=e.mbs[3]);const r=10*t;i[r+0]=s.center[0],i[r+1]=s.center[1],i[r+2]=s.center[2],i[r+3]=s.halfSize[0],i[r+4]=s.halfSize[1],i[r+5]=s.halfSize[2],i[r+6]=s.quaternion[0],i[r+7]=s.quaternion[1],i[r+8]=s.quaternion[2],i[r+9]=s.quaternion[3]})),i}const vt={remove(){},pause(){},resume(){}};function Mt(e,t){e.forEach((e=>e.opacity=t))}export{nt as I3SMeshView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Logger.js";import{destroyMaybe as i,isSome as s,isNone as o,unwrap as a}from"../../../core/maybe.js";import{initial as n}from"../../../core/reactiveUtils.js";import{init as d}from"../../../core/watchUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{b as u}from"../../../chunks/vec3.js";import{f as c,c as p}from"../../../chunks/vec3f64.js";import{projectBuffer as g,projectVectorToVector as m,projectBoundingRect as f}from"../../../geometry/projection.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{extentContainsCoords3D as _}from"../../../geometry/support/contains.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{makeDehydratedPoint as v,estimateSize as E}from"../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import I from"../../../layers/graphics/controllers/I3SOnDemandController.js";import w from"../../../layers/support/FeatureFilter.js";import{getRenderingInfo as S,getRenderingInfoAsync as C}from"../../../renderers/support/renderingInfoUtils.js";import D from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as F}from"./I3SPointsWorkerHandle.js";import{DrapeSourceType as A}from"./interfaces.js";import{LayerView3D as O}from"./LayerView3D.js";import j from"./graphics/Graphics3DFeatureProcessor.js";import N from"./graphics/QueryEngine.js";import{createInteractiveEditSession as T,processAttributeEdits as G}from"./i3s/attributeEditing.js";import{I3SAttributeOverrides as V}from"./i3s/I3SAttributeOverrides.js";import{checkSpatialReferences as M,containsDraco as R,whenGraphicAttributes as P,getCachedAttributeValue as U}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as L}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import{PopupSceneLayerView as q}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as Q}from"./support/SceneLayerViewRequiredFields.js";import k from"../support/debugFlags.js";import{GraphicsMap as B}from"../support/GraphicsMap.js";import{compute as z}from"../support/orientedBoundingBox.js";import{updatingProgress as W}from"../support/updatingProperties.js";import{UpdatePolicy as K}from"../webgl-engine/lib/basicInterfaces.js";import Z from"../../layers/SceneLayerView.js";import{TaskPriority as Y}from"../../support/Scheduler.js";const J=r.getLogger("esri.views.3d.layers.SceneLayerGraphicsView3D"),$=H();let X=class extends(L(q(O(Z)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this.drapeSourceType=A.Features,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new B,this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}initialize(){var e,t;const r=this.layer;this.addResolvingPromise(r.indexInfo),this._attributeOverrides=new V(this.layer,null==(e=this.view.resourceController)?void 0:e.memoryController),M(r,this.view.spatialReference,this.view.viewingMode),this.fieldsHelper=new Q({layerView:this}),this.updatingHandles.add((()=>r.rangeInfos),(e=>this._rangeInfosChanged(e)),n),this.updatingHandles.add((()=>r.renderer),((e,t)=>this._rendererChange(e,t))),this.updatingHandles.add((()=>this.parsedDefinitionExpression),(()=>this._filterChange())),this.updatingHandles.add((()=>this.view.floors),(()=>this.processor.filterVisibility.filterChanged())),this.handles.add(d(k,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&k.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||k.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}))),this._set("processor",new j({owner:this,layer:r,preferredUpdatePolicy:K.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,suspendResumeExtentMode:"data",dataExtent:r.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),null==(t=this.processor.elevationAlignment)||t.events.on("invalidate-elevation",(e=>this._invalidateElevation(e))),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",r.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.setup()),this._memCache=this.view.resourceController.memoryController.newCache(r.uid),this._controller=new I({layerView:this,scaleVisibilityEnabled:!1}),R(this.layer.geometryDefinitions)&&(this._worker=new F((e=>this.view.resourceController.schedule(e)))),this.handles.add(this.layer.on("apply-edits",(e=>this.updatingHandles.addPromise(e.result)))),this.handles.add(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{this._queryEngine=new N({layerView:this,priority:Y.FEATURE_QUERY_ENGINE}),this.updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),n),this.updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._attributeOverrides=i(this._attributeOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this._nodesAddedToStage.clear(),this.fieldsHelper=i(this.fieldsHelper)}get requiredFields(){var e,t;return null!=(e=null==(t=this.fieldsHelper)?void 0:t.requiredFields)?e:[]}get maximumNumberOfFeatures(){const e=this.processor&&this.processor.graphicsCore&&this.processor.graphicsCore.displayFeatureLimit;return e?e.maximumNumberOfFeatures:0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller&&!this._controller.leavesReached)}get hasM(){return!1}get hasZ(){return!0}notifyGraphicGeometryChanged(e){this.processor.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.processor.graphicsCore.notifyGraphicVisibilityChanged(e)}async whenGraphicAttributes(e,t){return P(this.layer,e,this._getObjectIdField(),t,(()=>[...this._nodesAddedToStage.values()]))}getGraphicFromGraphicUid(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,t):null}whenGraphicBounds(e,t){return this.processor.graphicsCore.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.graphicsCore.computeAttachmentOrigin(e,t)}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}isUpdating(){var e,t,r;return!!(null!=(e=this._controller)&&e.updating||null!=(t=this.processor)&&t.updating||null!=(r=this.fieldsHelper)&&r.updating)}getRenderingInfo(e,t,r){const i=S(e,{renderer:t,arcade:r});if(s(i)&&i.color){const e=i.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return i}async getRenderingInfoAsync(e,t,r,i){return C(e,{renderer:t,arcade:r,...i})}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return T(this.attributeEditingContext,e)}async _extractBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};return o(this._worker)&&(this._worker=new F((e=>this.view.resourceController.schedule(e)))),this._worker.invoke(r,t).then((e=>{if(s(e)){return{positionData:e.positions,featureIds:e.featureIds}}throw new Error("Failed to decompress Draco point data")}))}_checkExtent(e,t){e&&!_(e,t)&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&J.error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&J.error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++)}async addNode(e,t,r){if(!re(t)&&!te(t))return Promise.reject();if(this._nodesAddedToStage.has(e.index))return void J.error("I3S node "+e.id+" already added");const i=s(this.layer.fullExtent)?se(this.layer.fullExtent.clone(),.5):null,o=this._controller.crsVertex,a=[],n={graphics:null,featureIds:null,attributeInfo:t.attributeDataInfo,node:e};if(re(t)?await this._addNodeBinaryPointData(e,n,t,i,a,r):te(t)&&this._addNodeLegacyPointData(e,n,t,i,a),await this._attributeOverrides.apply(n.featureIds,t.attributeDataInfo,r),e.numFeatures=n.graphics.length,this._updateNodeMemory(e),ie(n),a.length>0&&(this._computeObb(e,a,o),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return this._cacheNodeData(n),Promise.resolve();if(s(this._verticalScale))for(const s of n.graphics)this._verticalScale(s.geometry);return this._nodesAddedToStage.set(e.index,n),this.loadedGraphics.addMany(n.graphics),this._filterNode(n),this._treeDebugger&&this._treeDebugger.update(),Promise.resolve()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;g(t,r,0,t,s,0,t.length/3);const o={data:t,size:3};e.serviceObb=z(o),i.isGeographic&&m(e.serviceObb.center,s,e.serviceObb.center,i)}isNodeLoaded(e){return this._nodesAddedToStage.has(e)}isNodeReloading(){return!1}updateNodeState(){}async _addNodeBinaryPointData(e,r,i,o,n,d){const l=await this._extractBinaryPointData(i,d);if(null==l)return Promise.reject();const h=this._getObjectIdField(),p=this._controller.crsVertex,m=this.view.spatialReference,f=this.processor.graphicsCore,{positionData:y,featureIds:_}=l,b=3,E=y.length/b,x=new Array;for(let I=0;I<E;I++){const r=s(e.serviceObb)?e.serviceObb.center:[0,0,0],i=I*b,d=c(y[i+0],y[i+1],y[i+2]);u(d,d,r),e.serviceObb||n.push(d[0],d[1],d[2]),s(o)&&this._checkExtent(o,d);const l=_[I],E={};null!=l&&(E[h]=l);const w=null==l?t.generateUID():l;g(d,p,0,ae,m,0,1);const S=v(ae[0],ae[1],ae[2],m),C=this.loadedGraphics.get(w);if(s(C))C.level<e.level&&(ne.property="geometry",ne.graphic=C,ne.oldValue=a(C.geometry),ne.newValue=S,C.geometry=S,f.graphicUpdateHandler(ne)),x.push(C);else{const r=t.generateUID();x.push({objectId:w,uid:r,geometry:S,attributes:E,visible:!0,level:e.level})}}r.graphics=x,r.featureIds=_}_addNodeLegacyPointData(e,r,i,o,a){const n=this._getObjectIdField(),d=this._controller.crsVertex,l=this.view.spatialReference,h=[0,0,0],u=new Array,c=new Array;for(const p of i.pointData){const r=p.featureDataPosition,i=r.length,m=p.geometries&&p.geometries[0]||oe[i],f=p.featureIds[0];if("points"!==m.params.type)continue;s(o)&&this._checkExtent(o,r);const y={};null!=f&&(y[n]=f);const _=null==f?t.generateUID():f;let b;"Embedded"===m.type&&(b=m.params.vertexAttributes.position);for(let o=0;o<b.length;o+=i){for(let e=0;e<i;e++)h[e]=r[e]+b[o+e];const n=3===i;e.serviceObb||a.push(h[0],h[1],n?h[2]:0),g(h,d,0,ae,l,0,1);const u=v(ae[0],ae[1],n?ae[2]:void 0,l),p=this.loadedGraphics.get(_);s(p)?c.push(p):c.push({objectId:_,uid:t.generateUID(),geometry:u,attributes:y,visible:!0})}u.push(f)}r.graphics=c,r.featureIds=u}_updateNodeMemory(e){e.memory=4096+(s(e.numFeatures)?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>E(t)+e),512+8*e.featureIds.length+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this._nodesAddedToStage.forEach((e=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}})),this._nodesAddedToStage.clear(),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this._nodesAddedToStage.get(e);return t?(this.loadedGraphics.removeMany(t.graphics),this._nodesAddedToStage.delete(e),this._treeDebugger&&this._treeDebugger.update(),t):null}async loadCachedNodeData(e){return this._memCache.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,i){if(!this._nodesAddedToStage.has(e.index))return this.loadedGraphics.addMany(t.graphics),this._nodesAddedToStage.set(e.index,t),this._updateNodeMemory(e),await this.updateAttributes(e.index,r,i),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update(),Promise.resolve();J.error("I3S node "+e.id+" already added")}getLoadedNodeIds(){const e=[];return this._nodesAddedToStage.forEach((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this._nodesAddedToStage.forEach((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this._nodesAddedToStage.forEach(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this._nodesAddedToStage.get(e);if(t&&s(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&s(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!o(r.attributeInfo)&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this._nodesAddedToStage.get(e);i&&(await this._attributeOverrides.apply(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){if(ie(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||"OBJECTID"}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every(((e,t)=>s[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&J.warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this._nodesAddedToStage.forEach((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression;for(const r of e.graphics){const e=r.visible;r.visible=!t||this._evaluateClause(t,r),e!==r.visible&&(ne.graphic=r,ne.property="visible",ne.oldValue=e,ne.newValue=r.visible,this.processor.graphicsCore.graphicUpdateHandler(ne))}}_invalidateElevation(e){const t=this._controller.crsIndex;f(e.extent,e.spatialReference,de,t),this._controller.updateElevationChanged(de,t)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return s(this.filter)?this.filter.createQuery(e):new D(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),null==t?void 0:t.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),null==t?void 0:t.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),null==t?void 0:t.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),null==t?void 0:t.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():D.from(e))}getUsedMemory(){const e=this.processor&&this.processor.graphicsCore;return e?e.usedMemory:0}getUnloadedMemory(){const e=this.processor&&this.processor.graphicsCore;return.8*((this._controller?this._controller.unloadedMemoryEstimate:0)+(e?e.unprocessedMemoryEstimate:0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){G(this.attributeEditingContext,e)}get attributeEditingContext(){const e=this._getObjectIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,forEachNode:e=>this._nodesAddedToStage.forEach((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo,attributeOverrides:this._attributeOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const o=this._nodesAddedToStage.get(t);if(s(i)){const t=this.loadedGraphics.get(i.attributes[e]);s(t)&&this.processor.graphicsCore.recreateGraphics([t])}else s(o)&&this.processor.graphicsCore.recreateGraphics(o.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this._nodesAddedToStage.size,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this._nodesAddedToStage.size,numFeatures:this.loadedGraphics.length}}};e([l()],X.prototype,"processor",void 0),e([l({type:w})],X.prototype,"filter",void 0),e([l()],X.prototype,"loadedGraphics",void 0),e([l({aliasOf:"layer"})],X.prototype,"i3slayer",void 0),e([l()],X.prototype,"_controller",void 0),e([l()],X.prototype,"updating",void 0),e([l()],X.prototype,"suspended",void 0),e([l()],X.prototype,"holeFilling",void 0),e([l(W)],X.prototype,"updatingProgress",void 0),e([l({aliasOf:"_controller.updatingProgress"})],X.prototype,"updatingProgressValue",void 0),e([l($.requiredFields)],X.prototype,"requiredFields",null),e([l($.availableFields)],X.prototype,"availableFields",void 0),e([l()],X.prototype,"fieldsHelper",void 0),e([l({type:Number})],X.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],X.prototype,"maximumNumberOfFeaturesExceeded",null),e([l({readOnly:!0,aliasOf:"view.qualitySettings.sceneService.point.lodFactor"})],X.prototype,"lodFactor",void 0),e([l({readOnly:!0})],X.prototype,"hasM",null),e([l({readOnly:!0})],X.prototype,"hasZ",null),X=e([h("esri.views.3d.layers.SceneLayerGraphicsView3D")],X);const ee=X;function te(e){return"pointData"in e}function re(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function ie(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const i=e.graphics[r];if(i.attributes||(i.attributes={}),s(t)&&s(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(i.attributes[e]=U(t.attributeData[e],r))}}function se(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.hasZ&&(e.zmin-=t,e.zmax+=t),e.hasM&&(e.mmin-=t,e.mmax+=t),e}const oe={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},ae=p(),ne={graphic:null,property:null,oldValue:null,newValue:null},de=y();export{ee as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Logger.js";import{destroyMaybe as i,isNone as s,isSome as o,unwrap as a}from"../../../core/maybe.js";import{initial as n}from"../../../core/reactiveUtils.js";import{init as d}from"../../../core/watchUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{b as h}from"../../../chunks/vec3.js";import{f as c,c as p}from"../../../chunks/vec3f64.js";import{projectBuffer as g,projectVectorToVector as m,projectBoundingRect as f}from"../../../geometry/projection.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{extentContainsCoords3D as _}from"../../../geometry/support/contains.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{makeDehydratedPoint as v,estimateSize as E}from"../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import I from"../../../layers/graphics/controllers/I3SOnDemandController.js";import w from"../../../layers/support/FeatureFilter.js";import S from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as D}from"./I3SPointsWorkerHandle.js";import{DrapeSourceType as F}from"./interfaces.js";import{LayerView3D as C}from"./LayerView3D.js";import A from"./graphics/Graphics3DFeatureProcessor.js";import O from"./graphics/QueryEngine.js";import{createInteractiveEditSession as j,processAttributeEdits as N}from"./i3s/attributeEditing.js";import{I3SAttributeOverrides as T}from"./i3s/I3SAttributeOverrides.js";import{checkSpatialReferences as V,containsDraco as G,whenGraphicAttributes as M,getCachedAttributeValue as P}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as R}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import{PopupSceneLayerView as H}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as U}from"./support/SceneLayerViewRequiredFields.js";import q from"../support/debugFlags.js";import{GraphicsMap as Q}from"../support/GraphicsMap.js";import{compute as k}from"../support/orientedBoundingBox.js";import{updatingProgress as B}from"../support/updatingProperties.js";import{UpdatePolicy as z}from"../webgl-engine/lib/basicInterfaces.js";import W from"../../layers/SceneLayerView.js";import{TaskPriority as K}from"../../support/Scheduler.js";const Z=r.getLogger("esri.views.3d.layers.SceneLayerGraphicsView3D"),Y=L();let J=class extends(R(H(C(W)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this.drapeSourceType=F.Features,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new Q,this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}initialize(){var e,t;const r=this.layer;this.addResolvingPromise(r.indexInfo),this._attributeOverrides=new T(this.layer,null==(e=this.view.resourceController)?void 0:e.memoryController),V(r,this.view.spatialReference,this.view.viewingMode),this.fieldsHelper=new U({layerView:this}),this.updatingHandles.add((()=>r.rangeInfos),(e=>this._rangeInfosChanged(e)),n),this.updatingHandles.add((()=>r.renderer),((e,t)=>this._rendererChange(e,t))),this.updatingHandles.add((()=>this.parsedDefinitionExpression),(()=>this._filterChange())),this.updatingHandles.add((()=>this.view.floors),(()=>this.processor.filterVisibility.filterChanged())),this.handles.add(d(q,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&q.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||q.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}))),this._set("processor",new A({owner:this,preferredUpdatePolicy:z.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,dataExtent:r.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),null==(t=this.processor.elevationAlignment)||t.events.on("invalidate-elevation",(e=>this._invalidateElevation(e))),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",r.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.setup()),this._memCache=this.view.resourceController.memoryController.newCache(r.uid),this._controller=new I({layerView:this,scaleVisibilityEnabled:!1}),G(this.layer.geometryDefinitions)&&(this._worker=new D((e=>this.view.resourceController.schedule(e)))),this.handles.add(this.layer.on("apply-edits",(e=>this.updatingHandles.addPromise(e.result)))),this.handles.add(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{this._queryEngine=new O({layerView:this,priority:K.FEATURE_QUERY_ENGINE}),this.updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),n),this.updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._attributeOverrides=i(this._attributeOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this._nodesAddedToStage.clear(),this.fieldsHelper=i(this.fieldsHelper)}get requiredFields(){var e,t;return null!=(e=null==(t=this.fieldsHelper)?void 0:t.requiredFields)?e:[]}get maximumNumberOfFeatures(){var e,t,r;const i=null==(e=this.processor)||null==(t=e.graphicsCore)?void 0:t.displayFeatureLimit;return null!=(r=null==i?void 0:i.maximumNumberOfFeatures)?r:0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller&&!this._controller.leavesReached)}get hasM(){return!1}get hasZ(){return!0}async whenGraphicAttributes(e,t){return M(this.layer,e,this._getObjectIdField(),t,(()=>[...this._nodesAddedToStage.values()]))}getGraphicFromGraphicUid(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,t):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}isUpdating(){var e,t,r;return!!(null!=(e=this._controller)&&e.updating||null!=(t=this.processor)&&t.updating||null!=(r=this.fieldsHelper)&&r.updating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return j(this.attributeEditingContext,e)}async _extractBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};return s(this._worker)&&(this._worker=new D((e=>this.view.resourceController.schedule(e)))),this._worker.invoke(r,t).then((e=>{if(o(e)){return{positionData:e.positions,featureIds:e.featureIds}}throw new Error("Failed to decompress Draco point data")}))}_checkExtent(e,t){e&&!_(e,t)&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&Z.error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&Z.error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++)}async addNode(e,t,r){if(!ee(t)&&!X(t))return Promise.reject();if(this._nodesAddedToStage.has(e.index))return void Z.error("I3S node "+e.id+" already added");const i=o(this.layer.fullExtent)?re(this.layer.fullExtent.clone(),.5):null,s=this._controller.crsVertex,a=[],n={graphics:null,featureIds:null,attributeInfo:t.attributeDataInfo,node:e};if(ee(t)?await this._addNodeBinaryPointData(e,n,t,i,a,r):X(t)&&this._addNodeLegacyPointData(e,n,t,i,a),await this._attributeOverrides.apply(n.featureIds,t.attributeDataInfo,r),e.numFeatures=n.graphics.length,this._updateNodeMemory(e),te(n),a.length>0&&(this._computeObb(e,a,s),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return this._cacheNodeData(n),Promise.resolve();if(o(this._verticalScale))for(const o of n.graphics)this._verticalScale(o.geometry);return this._nodesAddedToStage.set(e.index,n),this.loadedGraphics.addMany(n.graphics),this._filterNode(n),this._treeDebugger&&this._treeDebugger.update(),Promise.resolve()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;g(t,r,0,t,s,0,t.length/3);const o={data:t,size:3};e.serviceObb=k(o),i.isGeographic&&m(e.serviceObb.center,s,e.serviceObb.center,i)}isNodeLoaded(e){return this._nodesAddedToStage.has(e)}isNodeReloading(){return!1}updateNodeState(){}async _addNodeBinaryPointData(e,r,i,s,n,d){const l=await this._extractBinaryPointData(i,d);if(null==l)return Promise.reject();const u=this._getObjectIdField(),p=this._controller.crsVertex,m=this.view.spatialReference,f=this.processor.graphicsCore,{positionData:y,featureIds:_}=l,b=3,E=y.length/b,x=new Array;for(let I=0;I<E;I++){const r=o(e.serviceObb)?e.serviceObb.center:[0,0,0],i=I*b,d=c(y[i+0],y[i+1],y[i+2]);h(d,d,r),e.serviceObb||n.push(d[0],d[1],d[2]),o(s)&&this._checkExtent(s,d);const l=_[I],E={};null!=l&&(E[u]=l);const w=null==l?t.generateUID():l;g(d,p,0,se,m,0,1);const S=v(se[0],se[1],se[2],m),D=this.loadedGraphics.get(w);if(o(D))D.level<e.level&&(oe.property="geometry",oe.graphic=D,oe.oldValue=a(D.geometry),oe.newValue=S,D.geometry=S,f.graphicUpdateHandler(oe)),x.push(D);else{const r=t.generateUID();x.push({objectId:w,uid:r,geometry:S,attributes:E,visible:!0,level:e.level})}}r.graphics=x,r.featureIds=_}_addNodeLegacyPointData(e,r,i,s,a){const n=this._getObjectIdField(),d=this._controller.crsVertex,l=this.view.spatialReference,u=[0,0,0],h=new Array,c=new Array;for(const p of i.pointData){const r=p.featureDataPosition,i=r.length,m=p.geometries&&p.geometries[0]||ie[i],f=p.featureIds[0];if("points"!==m.params.type)continue;o(s)&&this._checkExtent(s,r);const y={};null!=f&&(y[n]=f);const _=null==f?t.generateUID():f;let b;"Embedded"===m.type&&(b=m.params.vertexAttributes.position);for(let s=0;s<b.length;s+=i){for(let e=0;e<i;e++)u[e]=r[e]+b[s+e];const n=3===i;e.serviceObb||a.push(u[0],u[1],n?u[2]:0),g(u,d,0,se,l,0,1);const h=v(se[0],se[1],n?se[2]:void 0,l),p=this.loadedGraphics.get(_);o(p)?c.push(p):c.push({objectId:_,uid:t.generateUID(),geometry:h,attributes:y,visible:!0})}h.push(f)}r.graphics=c,r.featureIds=h}_updateNodeMemory(e){e.memory=4096+(o(e.numFeatures)?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>E(t)+e),512+8*e.featureIds.length+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this._nodesAddedToStage.forEach((e=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}})),this._nodesAddedToStage.clear(),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this._nodesAddedToStage.get(e);return t?(this.loadedGraphics.removeMany(t.graphics),this._nodesAddedToStage.delete(e),this._treeDebugger&&this._treeDebugger.update(),t):null}async loadCachedNodeData(e){return this._memCache.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,i){if(!this._nodesAddedToStage.has(e.index))return this.loadedGraphics.addMany(t.graphics),this._nodesAddedToStage.set(e.index,t),this._updateNodeMemory(e),await this.updateAttributes(e.index,r,i),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update(),Promise.resolve();Z.error("I3S node "+e.id+" already added")}getLoadedNodeIds(){const e=[];return this._nodesAddedToStage.forEach((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this._nodesAddedToStage.forEach((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this._nodesAddedToStage.forEach(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this._nodesAddedToStage.get(e);if(t&&o(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&o(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!s(r.attributeInfo)&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this._nodesAddedToStage.get(e);i&&(await this._attributeOverrides.apply(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){if(te(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||"OBJECTID"}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every(((e,t)=>s[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&Z.warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this._nodesAddedToStage.forEach((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression;for(const r of e.graphics){const e=r.visible;r.visible=!t||this._evaluateClause(t,r),e!==r.visible&&(oe.graphic=r,oe.property="visible",oe.oldValue=e,oe.newValue=r.visible,this.processor.graphicsCore.graphicUpdateHandler(oe))}}_invalidateElevation(e){const t=this._controller.crsIndex;f(e.extent,e.spatialReference,ae,t),this._controller.updateElevationChanged(ae,t)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return o(this.filter)?this.filter.createQuery(e):new S(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),null==t?void 0:t.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),null==t?void 0:t.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),null==t?void 0:t.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),null==t?void 0:t.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(s(e)?this.createQuery():S.from(e))}getUsedMemory(){var e,t,r;return null!=(e=null==(t=this.processor)||null==(r=t.graphicsCore)?void 0:r.usedMemory)?e:0}getUnloadedMemory(){var e,t,r,i,s;return.8*((null!=(e=null==(t=this._controller)?void 0:t.unloadedMemoryEstimate)?e:0)+(null!=(r=null==(i=this.processor)||null==(s=i.graphicsCore)?void 0:s.unprocessedMemoryEstimate)?r:0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){N(this.attributeEditingContext,e)}get attributeEditingContext(){const e=this._getObjectIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,forEachNode:e=>this._nodesAddedToStage.forEach((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo,attributeOverrides:this._attributeOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this._nodesAddedToStage.get(t);if(o(i)){const t=this.loadedGraphics.get(i.attributes[e]);o(t)&&this.processor.graphicsCore.recreateGraphics([t])}else o(s)&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this._nodesAddedToStage.size,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this._nodesAddedToStage.size,numFeatures:this.loadedGraphics.length}}};e([l()],J.prototype,"processor",void 0),e([l({type:w})],J.prototype,"filter",void 0),e([l()],J.prototype,"loadedGraphics",void 0),e([l({aliasOf:"layer"})],J.prototype,"i3slayer",void 0),e([l()],J.prototype,"_controller",void 0),e([l()],J.prototype,"updating",void 0),e([l()],J.prototype,"suspended",void 0),e([l()],J.prototype,"holeFilling",void 0),e([l(B)],J.prototype,"updatingProgress",void 0),e([l({aliasOf:"_controller.updatingProgress"})],J.prototype,"updatingProgressValue",void 0),e([l(Y.requiredFields)],J.prototype,"requiredFields",null),e([l(Y.availableFields)],J.prototype,"availableFields",void 0),e([l()],J.prototype,"fieldsHelper",void 0),e([l({type:Number})],J.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],J.prototype,"maximumNumberOfFeaturesExceeded",null),e([l({readOnly:!0,aliasOf:"view.qualitySettings.sceneService.point.lodFactor"})],J.prototype,"lodFactor",void 0),e([l({readOnly:!0})],J.prototype,"hasM",null),e([l({readOnly:!0})],J.prototype,"hasZ",null),J=e([u("esri.views.3d.layers.SceneLayerGraphicsView3D")],J);const $=J;function X(e){return"pointData"in e}function ee(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function te(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const i=e.graphics[r];if(i.attributes||(i.attributes={}),o(t)&&o(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(i.attributes[e]=P(t.attributeData[e],r))}}function re(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.hasZ&&(e.zmin-=t,e.zmax+=t),e.hasM&&(e.mmin-=t,e.mmax+=t),e}const ie={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},se=p(),oe={graphic:null,property:null,oldValue:null,newValue:null},ae=y();export{$ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as i,disposeMaybe as r,destroyMaybe as l}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{whenTrueOnce as o}from"../../../core/watchUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import h from"../../2d/engine/vectorTiles/SchemaHelper.js";import c from"../../2d/engine/vectorTiles/TileHandler3D.js";import p from"../../2d/engine/vectorTiles/VTLPainter3D.js";import m from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as d}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{test as f}from"../terrain/terrainUtils.js";import u from"../../layers/LayerView.js";let g=class extends(y(d(u))){constructor(){super(...arguments),this.type="vector-tile-3d"}initialize(){if(i(this.layer.fullExtent))return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const e=f.force512VTL?this.layer.tileInfo:this.layer.compatibleTileInfo256,r=this._getTileInfoSupportError(e,this.layer.fullExtent);if(r)return this.addResolvingPromise(Promise.reject(r));const{basemapTerrain:l,spatialReference:n,pixelRatio:a}=this.view,d=o(this.view,"basemapTerrain.tilingSchemeLocked").then((()=>{const e=l.tilingScheme,t=e.pixelSize;let i;this.schemaHelper=new h(t,n.isGeographic),i=256===t?this.layer.compatibleTileInfo256:this.view.spatialReference.isGeographic?this.layer.compatibleTileInfo512:this.layer.tileInfo;const r=this._getTileInfoCompatibilityError(i,e);if(r)throw r;this._set("tileInfo",i)}));this._tileHandlerController=new AbortController;const y=this.view.resourceController;this._memCache=y.memoryController.newCache(this.layer.uid,(e=>{e.release()}));const{style:u}=this.layer.currentStyleInfo,g=new m(u),_=l.mapTileRequester;this._tileHandler=new c(this.layer,g,a,this._memCache,_);const v=this._tileHandlerController.signal,H=e=>y.schedule(e),w=this._tileHandler.start({signal:v,schedule:H}),C=this._tileHandler.spriteMosaic;C.then((e=>{!s(v)&&this._tileHandler&&(this.painter=new p(e,this._tileHandler.glyphMosaic))})),w.then((()=>this._tileHandlerController=null));const T=()=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const{style:e}=this.layer.currentStyleInfo,t=new m(e),i=new c(this.layer,t,a,this._memCache,_),r=i.start({signal:this._tileHandlerController.signal,schedule:H}),l=i.spriteMosaic;r.then((()=>this._tileHandlerController=null)),this.updatingHandles.addPromise(Promise.all([r,l]).then((([,e])=>{const t=this._tileHandler,r=this.painter;this.painter=new p(e,i.glyphMosaic),this._tileHandler=i,this.emit("data-changed"),t.destroy(),r&&r.dispose()})))};this.updatingHandles.add((()=>[this.layer.currentStyleInfo,this.view.pixelRatio]),T);const j=Promise.all([d,w,C]);this.addResolvingPromise(j)}destroy(){this.painter=r(this.painter),this._tileHandlerController&&(this._tileHandlerController.abort(),this._tileHandlerController=null),l(this._tileHandler),this._memCache=l(this._memCache),this._tileHandler=null}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,i=e[e.length-1].scale,r=this.levelRangeFromScaleRange(t,i);return 1===r.minLevel&&256===this.tileInfo.size[0]&&(r.minLevel=0),r}async fetchTile(e,t,i,r){return this._tileHandler.getVectorTile(e,t,i,r)}};e([n({aliasOf:"layer.fullExtent"})],g.prototype,"fullExtent",void 0),e([n()],g.prototype,"layer",void 0),e([n()],g.prototype,"tileInfo",void 0),e([n()],g.prototype,"dataLevelRange",null),e([n()],g.prototype,"updatingProgressValue",void 0),g=e([a("esri.views.3d.layers.VectorTileLayerView3D")],g);const _=g;export{_ as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as r,disposeMaybe as i,destroyMaybe as l}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{whenTrueOnce as o}from"../../../core/watchUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{SchemaHelper as h}from"../../2d/engine/vectorTiles/SchemaHelper.js";import c from"../../2d/engine/vectorTiles/TileHandler3D.js";import p from"../../2d/engine/vectorTiles/VTLPainter3D.js";import m from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as d}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{test as f}from"../terrain/terrainUtils.js";import u from"../../layers/LayerView.js";let g=class extends(y(d(u))){constructor(){super(...arguments),this.type="vector-tile-3d"}initialize(){if(r(this.layer.fullExtent))return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const e=f.force512VTL?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256),i=this._getTileInfoSupportError(e,this.layer.fullExtent);if(i)return this.addResolvingPromise(Promise.reject(i));const{basemapTerrain:l,spatialReference:n,pixelRatio:a}=this.view,d=o(this.view,"basemapTerrain.tilingSchemeLocked").then((()=>{const e=l.tilingScheme,t=e.pixelSize;let r;this.schemaHelper=new h(t,n.isGeographic),r=256===t?this.layer.tileInfo.getOrCreateCompatible(256):this.view.spatialReference.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512):this.layer.tileInfo;const i=this._getTileInfoCompatibilityError(r,e);if(i)throw i;this._set("tileInfo",r)}));this._tileHandlerController=new AbortController;const y=this.view.resourceController;this._memCache=y.memoryController.newCache(this.layer.uid,(e=>{e.release()}));const{style:u}=this.layer.currentStyleInfo,g=new m(u),_=l.mapTileRequester;this._tileHandler=new c(this.layer,g,a,this._memCache,_);const C=this._tileHandlerController.signal,v=e=>y.schedule(e),H=this._tileHandler.start({signal:C,schedule:v}),w=this._tileHandler.spriteMosaic;w.then((e=>{!s(C)&&this._tileHandler&&(this.painter=new p(e,this._tileHandler.glyphMosaic))})),H.then((()=>this._tileHandlerController=null));const j=()=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const{style:e}=this.layer.currentStyleInfo,t=new m(e),r=new c(this.layer,t,a,this._memCache,_),i=r.start({signal:this._tileHandlerController.signal,schedule:v}),l=r.spriteMosaic;i.then((()=>this._tileHandlerController=null)),this.updatingHandles.addPromise(Promise.all([i,l]).then((([,e])=>{const t=this._tileHandler,i=this.painter;this.painter=new p(e,r.glyphMosaic),this._tileHandler=r,this.emit("data-changed"),t.destroy(),i&&i.dispose()})))};this.updatingHandles.add((()=>[this.layer.currentStyleInfo,this.view.pixelRatio]),j);const T=Promise.all([d,H,w]);this.addResolvingPromise(T)}destroy(){this.painter=i(this.painter),this._tileHandlerController&&(this._tileHandlerController.abort(),this._tileHandlerController=null),l(this._tileHandler),this._memCache=l(this._memCache),this._tileHandler=null}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,r=e[e.length-1].scale,i=this.levelRangeFromScaleRange(t,r);return 1===i.minLevel&&256===this.tileInfo.size[0]&&(i.minLevel=0),i}async fetchTile(e,t,r,i){return this._tileHandler.getVectorTile(e,t,r,i)}};e([n({aliasOf:"layer.fullExtent"})],g.prototype,"fullExtent",void 0),e([n()],g.prototype,"layer",void 0),e([n()],g.prototype,"tileInfo",void 0),e([n()],g.prototype,"dataLevelRange",null),e([n()],g.prototype,"updatingProgressValue",void 0),g=e([a("esri.views.3d.layers.VectorTileLayerView3D")],g);const _=g;export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import{isNone as e,isSome as r}from"../../../../core/maybe.js";import a from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as n}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{a as l}from"../../../../chunks/vec2f64.js";import{m as p,a as u,s as d,g as f}from"../../../../chunks/vec3.js";import{Z as m,c as g}from"../../../../chunks/vec3f64.js";import{s as b,t as v,b as y}from"../../../../chunks/vec4.js";import{c as _}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as G}from"../../../../geometry/projectionEllipsoid.js";import{create as S,empty as B,offset as w,width as D,height as N,expand as j,intersects as I}from"../../../../geometry/support/aaBoundingRect.js";import{c as V,a as P,e as C}from"../../../../chunks/boundedPlane.js";import{create as A}from"../../../../geometry/support/ray.js";import{d as O,g as x,e as M,c as T}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as z,prepare as E,drawPoly as F}from"./deconflictorDebug.js";import{VisibilityGroup as X,VisibilityFlag as R}from"./enums.js";import L from"../../support/debugFlags.js";import{VertexAttribute as Y}from"../../webgl-engine/lib/basicInterfaces.js";import k from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as W}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as U}from"../../webgl-engine/materials/HUDMaterial.js";const H=g(),Z=_(),q=_(),J=g(),K=h(),Q=T(),$=A(),ii=g(),ti=S();class si{constructor(){this.aabr=S(),this.distance=0,this.culled=!1,this.visible=!1}}class ei{constructor(i,t,s={}){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info=s}}class ri{constructor(){this.active=new Map,this.visible=new Map}clear(){this.active.clear(),this.visible.clear()}}class ai{}class oi{constructor(){this.sortArray=new a({allocator:i=>i||new ai})}}var ci;!function(i){i[i.Idle=0]="Idle",i[i.Process=1]="Process",i[i.Sort=2]="Sort",i[i.Deconflict=3]="Deconflict",i[i.NumStates=4]="NumStates"}(ci||(ci={}));class ni{constructor(){this.camera=new k,this.slicePlane=V(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),P(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let hi=class extends t{constructor(){super(...arguments),this._dirty=!1,this._runningViewState=new ni,this._state=ci.Idle,this.graphics=new ri,this.iterators=new oi,this.accBinsNumX=15,this.accBinsNumY=20,this.accBinsSizeX=0,this.accBinsSizeY=0,this.accBins=null,this.accNumTests=0}get dirty(){return this._dirty}get state(){return this._state}destroy(){this.graphics.clear(),this.iterators=null}setDirty(){!this._dirty&&this.graphics.active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==ci.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/ci.NumStates;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case ci.Idle:this._startUpdate(),i.madeProgress();case ci.Process:if(this._state=ci.Process,!this._processActiveGraphics(i))return;case ci.Sort:if(this._state=ci.Sort,!this._sortVisibleGraphics(i))return;case ci.Deconflict:if(this._state=ci.Deconflict,!this._deconflictVisibleGraphics(i))return;default:z(this,this.graphics.visible),this._state=ci.Idle,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(e(i)||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?t.geometryRecords.length:0))return!1;return t.geometryRecords[0].material instanceof U}_startUpdate(){E(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this._initBins(i,t),this._resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new si,this.graphics.active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this._removeFromVisibleGraphics(i),li(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this.graphics.active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}_addToVisibleGraphics(i){this.graphics.visible.set(i.graphics3DGraphic.graphic.uid,i)}_removeFromVisibleGraphics(i){this.graphics.visible.delete(i.graphics3DGraphic.graphic.uid)}_processActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),s=n(K,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?Q:null;let a=0;for(r(e)&&(p(e,m,this._runningViewState.camera.viewMatrix),e[3]=G(this.view.spatialReference).radius,a=O(e,m));!i.done;){i.madeProgress();const r=t.next();if(!0===r.done)return this._resetActiveGraphicsIterator(),!0;const o=r.value,c=o&&o.info[this.visibilityGroup];c&&(this._collectGraphics3DGraphics(o,s,e,a),c.culled?this._removeFromVisibleGraphics(o):this._addToVisibleGraphics(o))}return!1}_sortVisibleGraphics(i){const t=this._ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),!0===s.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(i){const t=this._ensureVisibleGraphicsIterator(),s=this.visibilityGroup===X.LABEL;for(;!i.done;){i.madeProgress();const e=t.next();if(!0===e.done)return this._resetVisibleGraphicsIterator(),!0;const r=e.value,a=r.info[this.visibilityGroup];if(!a||a.culled)continue;const o=r.graphics3DGraphic,c=(!s||o.isVisible())&&!this._isConflicted(r);c&&this._addToBins(r),a.visible=c,this._setGraphicVisibility(r,c),F(a,c)}return!1}_resetIterators(){this.iterators.active=null,this.iterators.visible=null,this.iterators.sort=null}_ensureActiveGraphicsIterator(){return this.iterators.active||(this.iterators.active=pi(this.graphics.active)),this.iterators.active}_resetActiveGraphicsIterator(){this.iterators.active=null}_ensureVisibleGraphicsIterator(){return this.iterators.visible||(this.iterators.visible=pi(this.graphics.visible)),this.iterators.visible}_resetVisibleGraphicsIterator(){this.iterators.visible=null}_ensureSortGraphicsIterator(){return this.iterators.sort||(this.iterators.sort=ui(this.graphics.visible,this.iterators.sortArray,this.visibilityGroup)),this.iterators.sort}_resetSortGraphicsIterator(){this.iterators.sort=null}_collectGraphics3DGraphics(i,t,s,a){const o=i.graphics3DGraphic;if(o.destroyed)return;const c=i.info[this.visibilityGroup];if(!o.isVisible(X.GRAPHIC,R.DECONFLICTION))return void(c.culled=!0);const n=this.getGraphicsLayers(o);B(c.aabr);let h=null;for(const l of n){if(!this.layerSupportsDeconfliction(l))continue;const o=l.stageObject.geometryRecords[0].material;if(e(h)){if(h=this._getProjectionInfo(l,t,mi),h.isOutsideScreen||this._isCulledBySlice(i,H)||r(s)&&this._isCulledByHorizon(h,s,a))return void(c.culled=!0);!L.TESTS_DISABLE_OPTIMIZATIONS&&c.visible&&(h.distance*=.7)}this._expandBoundingRect(c,l,o,h)}e(h)?c.culled=!0:(c.distance=h.distance,c.culled=!1)}_getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,a=r.geometryRecords[0],o=a.material,c=x(r.boundingVolumeWorldSpace.bounds);p(H,c,e.viewMatrix);const n=a.geometry.vertexAttributes,h=n.get(Y.NORMAL).data,l=n.get(Y.AUXPOS1).data;return o.applyShaderOffsetsView(H,h,r.transformation,l,e,s.scaleInfo,H),b(Z,H[0],H[1],H[2],1),v(q,Z,e.projectionMatrix),u(s.positionNDC,q,1/q[3]),o.applyShaderOffsetsNDC(s.positionNDC,l,e,s.positionNDC,J),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(J[2]),s.distance=J[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),b(q,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),v(Z,q,t),y(Z,Z,1/Z[3]),d(s.positionView,H[0],H[1],H[2]),s}_isCulledByHorizon(i,t,s){return f($.direction,i.positionView),d($.origin,0,0,0),!!M(t,$,ii)&&i.distanceWithoutPolygonOffset>s}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&C(this._runningViewState.slicePlane,t)}_expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:a}){const o=this._runningViewState.camera,c=t.getScreenSize(di);W(c,a.factor,c),c[0]*=o.pixelRatio,c[1]*=o.pixelRatio;const n=w(e.calculateRelativeScreenBounds(c,a.factorAlignment.scale,ti),s(0,o.fullWidth,.5+.5*r[0]),s(0,o.fullHeight,.5+.5*r[1])),h=this.iconMarginFactor;if(0!==h){const i=h*Math.min(D(n),N(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}j(i.aabr,n,i.aabr)}_isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];for(let e=Math.floor(s.aabr[0]/this.accBinsSizeX);e<=Math.floor(s.aabr[2]/this.accBinsSizeX);e++)if(!(e<0||e>=this.accBinsNumX))for(let i=Math.floor(s.aabr[1]/this.accBinsSizeY);i<=Math.floor(s.aabr[3]/this.accBinsSizeY);i++){if(i<0||i>=this.accBinsNumY)continue;const r=this.accBins[e][i];for(let i=0;i<r.length;i++){const e=r.data[i],a=e.info[this.visibilityGroup];if(a&&a.visible&&(e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,I(a.aabr,s.aabr))))return!0}}return!1}_initBins(i,t){if(null==this.accBins){this.accBins=[];for(let i=0;i<this.accBinsNumX;i++){this.accBins.push([]);const i=this.accBins[this.accBins.length-1];for(let t=0;t<this.accBinsNumY;t++)i.push(new a)}}else for(let s=0;s<this.accBinsNumX;s++)for(let i=0;i<this.accBinsNumY;i++)this.accBins[s][i].clear();this.accBinsSizeX=i/this.accBinsNumX,this.accBinsSizeY=t/this.accBinsNumY,this.accNumTests=0}_addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this.accBinsSizeX),e=Math.floor(t.aabr[2]/this.accBinsSizeX),r=Math.floor(t.aabr[1]/this.accBinsSizeY),a=Math.floor(t.aabr[3]/this.accBinsSizeY);for(let o=s;o<=e;o++)if(!(o<0||o>=this.accBinsNumX))for(let t=r;t<=a;t++)t<0||t>=this.accBinsNumY||this.accBins[o][t].push(i)}_setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(R.DECONFLICTION,t,this.visibilityGroup),this.visibilityGroup===X.LABEL&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function li(i,t){const s=i.graphics3DGraphic;s.destroyed||s.clearVisibilityFlag(R.DECONFLICTION,t)}function*pi(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ui(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.prio=i.info?-i.info[s].distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>t.prio-i.prio));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([o({constructOnly:!0})],hi.prototype,"view",void 0),i([o({type:Boolean,readOnly:!0})],hi.prototype,"updating",null),hi=i([c("esri.views.3d.layers.graphics.Deconflictor")],hi);const di=l();class fi{constructor(){this.positionView=g(),this.positionNDC=g(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}}}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const mi=new fi;export{hi as Deconflictor,ei as DeconflictorGraphic,ni as DeconflictorViewState,ci as State};
5
+ import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import{isNone as e,isSome as r}from"../../../../core/maybe.js";import a from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as n}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{a as l}from"../../../../chunks/vec2f64.js";import{m as p,a as u,s as d,g as f}from"../../../../chunks/vec3.js";import{Z as m,c as g}from"../../../../chunks/vec3f64.js";import{s as b,t as v,b as y}from"../../../../chunks/vec4.js";import{c as _}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as G}from"../../../../geometry/projectionEllipsoid.js";import{create as S,empty as B,offset as w,width as D,height as N,expand as j,intersects as V}from"../../../../geometry/support/aaBoundingRect.js";import{c as I,a as P,e as C}from"../../../../chunks/boundedPlane.js";import{create as A}from"../../../../geometry/support/ray.js";import{d as x,g as O,e as M,c as T}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as z,prepare as E,drawPoly as F}from"./deconflictorDebug.js";import{VisibilityGroup as X,VisibilityFlag as R}from"./enums.js";import L from"../../support/debugFlags.js";import Y from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as k}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as W}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as U}from"../../webgl-engine/materials/HUDMaterial.js";const H=g(),Z=_(),q=_(),J=g(),K=h(),Q=T(),$=A(),ii=g(),ti=S();class si{constructor(){this.aabr=S(),this.distance=0,this.culled=!1,this.visible=!1}}class ei{constructor(i,t,s={}){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info=s}}class ri{constructor(){this.active=new Map,this.visible=new Map}clear(){this.active.clear(),this.visible.clear()}}class ai{}class oi{constructor(){this.sortArray=new a({allocator:i=>i||new ai})}}var ci;!function(i){i[i.Idle=0]="Idle",i[i.Process=1]="Process",i[i.Sort=2]="Sort",i[i.Deconflict=3]="Deconflict",i[i.NumStates=4]="NumStates"}(ci||(ci={}));class ni{constructor(){this.camera=new Y,this.slicePlane=I(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),P(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let hi=class extends t{constructor(){super(...arguments),this._dirty=!1,this._runningViewState=new ni,this._state=ci.Idle,this.graphics=new ri,this.iterators=new oi,this.accBinsNumX=15,this.accBinsNumY=20,this.accBinsSizeX=0,this.accBinsSizeY=0,this.accBins=null,this.accNumTests=0}get dirty(){return this._dirty}get state(){return this._state}destroy(){this.graphics.clear(),this.iterators=null}setDirty(){!this._dirty&&this.graphics.active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==ci.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/ci.NumStates;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case ci.Idle:this._startUpdate(),i.madeProgress();case ci.Process:if(this._state=ci.Process,!this._processActiveGraphics(i))return;case ci.Sort:if(this._state=ci.Sort,!this._sortVisibleGraphics(i))return;case ci.Deconflict:if(this._state=ci.Deconflict,!this._deconflictVisibleGraphics(i))return;default:z(this,this.graphics.visible),this._state=ci.Idle,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(e(i)||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?t.geometryRecords.length:0))return!1;return t.geometryRecords[0].material instanceof U}_startUpdate(){E(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this._initBins(i,t),this._resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new si,this.graphics.active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this._removeFromVisibleGraphics(i),li(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this.graphics.active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}_addToVisibleGraphics(i){this.graphics.visible.set(i.graphics3DGraphic.graphic.uid,i)}_removeFromVisibleGraphics(i){this.graphics.visible.delete(i.graphics3DGraphic.graphic.uid)}_processActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),s=n(K,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?Q:null;let a=0;for(r(e)&&(p(e,m,this._runningViewState.camera.viewMatrix),e[3]=G(this.view.spatialReference).radius,a=x(e,m));!i.done;){i.madeProgress();const r=t.next();if(!0===r.done)return this._resetActiveGraphicsIterator(),!0;const o=r.value,c=o&&o.info[this.visibilityGroup];c&&(this._collectGraphics3DGraphics(o,s,e,a),c.culled?this._removeFromVisibleGraphics(o):this._addToVisibleGraphics(o))}return!1}_sortVisibleGraphics(i){const t=this._ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),!0===s.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(i){const t=this._ensureVisibleGraphicsIterator(),s=this.visibilityGroup===X.LABEL;for(;!i.done;){i.madeProgress();const e=t.next();if(!0===e.done)return this._resetVisibleGraphicsIterator(),!0;const r=e.value,a=r.info[this.visibilityGroup];if(!a||a.culled)continue;const o=r.graphics3DGraphic,c=(!s||o.isVisible())&&!this._isConflicted(r);c&&this._addToBins(r),a.visible=c,this._setGraphicVisibility(r,c),F(a,c)}return!1}_resetIterators(){this.iterators.active=null,this.iterators.visible=null,this.iterators.sort=null}_ensureActiveGraphicsIterator(){return this.iterators.active||(this.iterators.active=pi(this.graphics.active)),this.iterators.active}_resetActiveGraphicsIterator(){this.iterators.active=null}_ensureVisibleGraphicsIterator(){return this.iterators.visible||(this.iterators.visible=pi(this.graphics.visible)),this.iterators.visible}_resetVisibleGraphicsIterator(){this.iterators.visible=null}_ensureSortGraphicsIterator(){return this.iterators.sort||(this.iterators.sort=ui(this.graphics.visible,this.iterators.sortArray,this.visibilityGroup)),this.iterators.sort}_resetSortGraphicsIterator(){this.iterators.sort=null}_collectGraphics3DGraphics(i,t,s,a){const o=i.graphics3DGraphic;if(o.destroyed)return;const c=i.info[this.visibilityGroup];if(!o.isVisible(X.GRAPHIC,R.DECONFLICTION))return void(c.culled=!0);const n=this.getGraphicsLayers(o);B(c.aabr);let h=null;for(const l of n){if(!this.layerSupportsDeconfliction(l))continue;const o=l.stageObject.geometryRecords[0].material;if(e(h)){if(h=this._getProjectionInfo(l,t,mi),h.isOutsideScreen||this._isCulledBySlice(i,H)||r(s)&&this._isCulledByHorizon(h,s,a))return void(c.culled=!0);!L.TESTS_DISABLE_OPTIMIZATIONS&&c.visible&&(h.distance*=.7)}this._expandBoundingRect(c,l,o,h)}e(h)?c.culled=!0:(c.distance=h.distance,c.culled=!1)}_getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,a=r.geometryRecords[0],o=a.material,c=O(r.boundingVolumeWorldSpace.bounds);p(H,c,e.viewMatrix);const n=a.geometry.vertexAttributes,h=n.get(W.NORMAL).data,l=n.get(W.AUXPOS1).data;return o.applyShaderOffsetsView(H,h,r.transformation,l,e,s.scaleInfo,H),b(Z,H[0],H[1],H[2],1),v(q,Z,e.projectionMatrix),u(s.positionNDC,q,1/q[3]),o.applyShaderOffsetsNDC(s.positionNDC,l,e,s.positionNDC,J),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(J[2]),s.distance=J[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),b(q,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),v(Z,q,t),y(Z,Z,1/Z[3]),d(s.positionView,H[0],H[1],H[2]),s}_isCulledByHorizon(i,t,s){return f($.direction,i.positionView),d($.origin,0,0,0),!!M(t,$,ii)&&i.distanceWithoutPolygonOffset>s}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&C(this._runningViewState.slicePlane,t)}_expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:a}){const o=this._runningViewState.camera,c=t.getScreenSize(di);k(c,a.factor,c),c[0]*=o.pixelRatio,c[1]*=o.pixelRatio;const n=w(e.calculateRelativeScreenBounds(c,a.factorAlignment.scale,ti),s(0,o.fullWidth,.5+.5*r[0]),s(0,o.fullHeight,.5+.5*r[1])),h=this.iconMarginFactor;if(0!==h){const i=h*Math.min(D(n),N(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}j(i.aabr,n,i.aabr)}_isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];for(let e=Math.floor(s.aabr[0]/this.accBinsSizeX);e<=Math.floor(s.aabr[2]/this.accBinsSizeX);e++)if(!(e<0||e>=this.accBinsNumX))for(let i=Math.floor(s.aabr[1]/this.accBinsSizeY);i<=Math.floor(s.aabr[3]/this.accBinsSizeY);i++){if(i<0||i>=this.accBinsNumY)continue;const r=this.accBins[e][i];for(let i=0;i<r.length;i++){const e=r.data[i],a=e.info[this.visibilityGroup];if(a&&a.visible&&(e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,V(a.aabr,s.aabr))))return!0}}return!1}_initBins(i,t){if(null==this.accBins){this.accBins=[];for(let i=0;i<this.accBinsNumX;i++){this.accBins.push([]);const i=this.accBins[this.accBins.length-1];for(let t=0;t<this.accBinsNumY;t++)i.push(new a)}}else for(let s=0;s<this.accBinsNumX;s++)for(let i=0;i<this.accBinsNumY;i++)this.accBins[s][i].clear();this.accBinsSizeX=i/this.accBinsNumX,this.accBinsSizeY=t/this.accBinsNumY,this.accNumTests=0}_addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this.accBinsSizeX),e=Math.floor(t.aabr[2]/this.accBinsSizeX),r=Math.floor(t.aabr[1]/this.accBinsSizeY),a=Math.floor(t.aabr[3]/this.accBinsSizeY);for(let o=s;o<=e;o++)if(!(o<0||o>=this.accBinsNumX))for(let t=r;t<=a;t++)t<0||t>=this.accBinsNumY||this.accBins[o][t].push(i)}_setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(R.DECONFLICTION,t,this.visibilityGroup),this.visibilityGroup===X.LABEL&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function li(i,t){const s=i.graphics3DGraphic;s.destroyed||s.clearVisibilityFlag(R.DECONFLICTION,t)}function*pi(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ui(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.prio=i.info?-i.info[s].distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>t.prio-i.prio));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([o({constructOnly:!0})],hi.prototype,"view",void 0),i([o({type:Boolean,readOnly:!0})],hi.prototype,"updating",null),hi=i([c("esri.views.3d.layers.graphics.Deconflictor")],hi);const di=l();class fi{constructor(){this.positionView=g(),this.positionNDC=g(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}}}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const mi=new fi;export{hi as Deconflictor,ei as DeconflictorGraphic,ni as DeconflictorViewState,ci as State};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as t}from"../../../../core/maybe.js";import{c as e}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{projectBuffer as n,computeTranslationToOriginAndRotation as r}from"../../../../geometry/projection.js";import{evaluateElevationInfoAtPoint as i,SampleElevationInfo as c}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as l}from"./graphicUtils.js";import m from"../../support/debugFlags.js";import{SamplePosition as f}from"../../support/ElevationProvider.js";import{VertexAttribute as p}from"../../webgl-engine/lib/basicInterfaces.js";function u(t,e,a,o){const s=t.stageObject,r=a.spatialReference,c=s.geometryRecords,l="absolute-height"!==e.mode;let u=0;for(const b of c){const t=b.geometry,c=b.getShaderTransformation();g[0]=c[12],g[1]=c[13],g[2]=c[14],t.invalidateBoundingInfo();const d=t.getMutableAttribute(p.POSITION),I=d.data,M=t.vertexAttributes.get(p.MAPPOS).data,A=d.size,O=I.length/A,j=new f(M,r);let v=0,y=!1,P=0;for(let s=0;s<O;s++){if(S[0]=I[v],S[1]=I[v+1],S[2]=I[v+2],i(j,a,e,o,E),l&&(P+=E.sampledElevation),m.TESTS_DISABLE_OPTIMIZATIONS)I[v]=j.array[j.offset],I[v+1]=j.array[j.offset+1],I[v+2]=E.z,n(I,r,v,I,o.spatialReference,v,1),I[v]-=g[0],I[v+1]-=g[1],I[v+2]-=g[2],y=!0;else{h[0]=I[v]+g[0],h[1]=I[v+1]+g[1],h[2]=I[v+2]+g[2],o.setAltitude(h,E.z),I[v]=h[0]-g[0],I[v+1]=h[1]-g[1],I[v+2]=h[2]-g[2];const t=T/o.unitInMeters;(Math.abs(S[0]-I[v])>=t||Math.abs(S[1]-I[v+1])>=t||Math.abs(S[2]-I[v+2])>=t)&&(y=!0)}v+=A,j.offset+=3}u+=P/O,y&&s.geometryVertexAttrsUpdated(b)}return u/c.length}function b(t,a,s,n){const c=t.stageObject,f=a.centerPointInElevationSR;let p=0;if(c.metadata.usesVerticalDistanceToGround)i(f,s,a,n,E),l(c,E.verticalDistanceToGround),p=E.sampledElevation;else{i(f,s,a,n,E);"absolute-height"!==a.mode&&(p=E.sampledElevation)}const u=e(d,c.transformation),b=o(A,u[12],u[13],u[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=f.x,h[1]=f.y,h[2]=E.z,r(f.spatialReference,h,u,n.spatialReference)&&(c.transformation=u)):n.setAltitudeOfTransformation(E.z,u);const I=T/n.unitInMeters;return(Math.abs(u[12]-b[0])>=I||Math.abs(u[13]-b[1])>=I||Math.abs(u[14]-b[2])>=I)&&(c.transformation=u),p}const d=a();function I(e,a,s,n){const c=e.graphics3DSymbolLayer.lodRenderer;if(t(c))return 0;const l=a.centerPointInElevationSR;i(l,s,a,n,E);const f="absolute-height"!==a.mode?E.sampledElevation:0,p=c.instanceData,u=e.instanceIndex,b=M;p.getGlobalTransform(u,b);const d=o(A,b[12],b[13],b[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=l.x,h[1]=l.y,h[2]=E.z,r(l.spatialReference,h,b,n.spatialReference)&&p.setGlobalTransform(u,b)):n.setAltitudeOfTransformation(E.z,b);const I=T/n.unitInMeters;return(m.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(b[12]-d[0])>=I||Math.abs(b[13]-d[1])>=I||Math.abs(b[14]-d[2])>=I)&&p.setGlobalTransform(u,b),f}const T=.01,h=s(),g=s(),S=s(),M=a(),A=s(),E=new c;export{I as perLodInstanceElevationAligner,b as perObjectElevationAligner,u as perVertexElevationAligner};
5
+ import{isNone as t}from"../../../../core/maybe.js";import{c as e}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{projectBuffer as r,computeTranslationToOriginAndRotation as n}from"../../../../geometry/projection.js";import{evaluateElevationInfoAtPoint as i,SampleElevationInfo as l}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as c}from"./graphicUtils.js";import m from"../../support/debugFlags.js";import{SamplePosition as f}from"../../support/ElevationProvider.js";import{VertexAttribute as u}from"../../webgl-engine/lib/VertexAttribute.js";function p(t,e,a,o){const s=t.stageObject,n=a.spatialReference,l=s.geometryRecords,c="absolute-height"!==e.mode;let p=0;for(const b of l){const t=b.geometry,l=b.getShaderTransformation();g[0]=l[12],g[1]=l[13],g[2]=l[14],t.invalidateBoundingInfo();const d=t.getMutableAttribute(u.POSITION),I=d.data,M=t.vertexAttributes.get(u.MAPPOS).data,A=d.size,O=I.length/A,j=new f(M,n);let v=0,y=!1,P=0;for(let s=0;s<O;s++){if(S[0]=I[v],S[1]=I[v+1],S[2]=I[v+2],i(j,a,e,o,E),c&&(P+=E.sampledElevation),m.TESTS_DISABLE_OPTIMIZATIONS)I[v]=j.array[j.offset],I[v+1]=j.array[j.offset+1],I[v+2]=E.z,r(I,n,v,I,o.spatialReference,v,1),I[v]-=g[0],I[v+1]-=g[1],I[v+2]-=g[2],y=!0;else{h[0]=I[v]+g[0],h[1]=I[v+1]+g[1],h[2]=I[v+2]+g[2],o.setAltitude(h,E.z),I[v]=h[0]-g[0],I[v+1]=h[1]-g[1],I[v+2]=h[2]-g[2];const t=T/o.unitInMeters;(Math.abs(S[0]-I[v])>=t||Math.abs(S[1]-I[v+1])>=t||Math.abs(S[2]-I[v+2])>=t)&&(y=!0)}v+=A,j.offset+=3}p+=P/O,y&&s.geometryVertexAttrsUpdated(b)}return p/l.length}function b(t,a,s,r){const l=t.stageObject,f=a.centerPointInElevationSR;let u=0;if(l.metadata.usesVerticalDistanceToGround)i(f,s,a,r,E),c(l,E.verticalDistanceToGround),u=E.sampledElevation;else{i(f,s,a,r,E);"absolute-height"!==a.mode&&(u=E.sampledElevation)}const p=e(d,l.transformation),b=o(A,p[12],p[13],p[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=f.x,h[1]=f.y,h[2]=E.z,n(f.spatialReference,h,p,r.spatialReference)&&(l.transformation=p)):r.setAltitudeOfTransformation(E.z,p);const I=T/r.unitInMeters;return(Math.abs(p[12]-b[0])>=I||Math.abs(p[13]-b[1])>=I||Math.abs(p[14]-b[2])>=I)&&(l.transformation=p),u}const d=a();function I(e,a,s,r){const l=e.graphics3DSymbolLayer.lodRenderer;if(t(l))return 0;const c=a.centerPointInElevationSR;i(c,s,a,r,E);const f="absolute-height"!==a.mode?E.sampledElevation:0,u=l.instanceData,p=e.instanceIndex,b=M;u.getGlobalTransform(p,b);const d=o(A,b[12],b[13],b[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=c.x,h[1]=c.y,h[2]=E.z,n(c.spatialReference,h,b,r.spatialReference)&&u.setGlobalTransform(p,b)):r.setAltitudeOfTransformation(E.z,b);const I=T/r.unitInMeters;return(m.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(b[12]-d[0])>=I||Math.abs(b[13]-d[1])>=I||Math.abs(b[14]-d[2])>=I)&&u.setGlobalTransform(p,b),f}const T=.01,h=s(),g=s(),S=s(),M=a(),A=s(),E=new l;export{I as perLodInstanceElevationAligner,b as perObjectElevationAligner,p as perVertexElevationAligner};