@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"../../../core/Accessor.js";import{difference as r}from"../../../core/arrayUtils.js";import s from"../../../core/CollectionFlattener.js";import a from"../../../core/Evented.js";import n from"../../../core/Handles.js";import l from"../../../core/Logger.js";import{clamp as o}from"../../../core/mathUtils.js";import{releaseMaybe as h,destroyMaybe as d,isNone as u,isSome as p}from"../../../core/maybe.js";import c from"../../../core/ObjectPool.js";import _ from"../../../core/PooledArray.js";import{isAbortError as m,isAborted as g,createAbortError as y}from"../../../core/promiseUtils.js";import{watch as f,sync as T}from"../../../core/reactiveUtils.js";import{init as v}from"../../../core/watchUtils.js";import{aliasOf as w}from"../../../core/accessorSupport/decorators/aliasOf.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{property as S}from"../../../core/accessorSupport/decorators/property.js";import{subclass as L}from"../../../core/accessorSupport/decorators/subclass.js";import{m as x}from"../../../chunks/mat4.js";import{c as E}from"../../../chunks/mat4f64.js";import{g as D}from"../../../chunks/vec3.js";import{c as P}from"../../../chunks/vec3f64.js";import{c as C}from"../../../chunks/vec4f64.js";import{projectVectorToVector as R,projectPointToVector as U}from"../../../geometry/projection.js";import{getReferenceEllipsoid as j}from"../../../geometry/projectionEllipsoid.js";import{create as M,equals as b,intersection as I,containsPoint as A,empty as V,expand as O,intersectsSphere as k}from"../../../geometry/support/aaBoundingRect.js";import{create as q,copy as B}from"../../../geometry/support/frustum.js";import{isRefreshableLayer as N}from"../../../layers/mixins/RefreshableLayer.js";import{ElevationQueryTileCache as F}from"../../../layers/support/ElevationQueryTileCache.js";import{isBaseLayer as H}from"../../../layers/support/layerUtils.js";import{acquireDecoder as G}from"../../../layers/support/LercDecoder.js";import{printAllocations as W}from"../../2d/engine/vectorTiles/VectorTile.js";import Q from"../layers/ElevationLayerView3D.js";import{directionToHeadingTilt as X,scaleToZoom as z}from"../support/cameraUtils.js";import Y from"../support/debugFlags.js";import{toBoundingRect as $}from"../support/extentUtils.js";import{ClientType as K}from"../support/index.js";import{updatingProgress as J}from"../support/updatingProperties.js";import{ElevationBounds as Z}from"./ElevationBounds.js";import{sampleElevation as ee,ElevationData as te}from"./ElevationData.js";import{create as ie}from"./ExtentHelper.js";import{LODSnapping as re,TextureUpdate as se}from"./interfaces.js";import{LayerClass as ae,LayerClasses as ne}from"./LayerClass.js";import{OverlayManager as le}from"./OverlayManager.js";import{PlanarPatch as oe}from"./PlanarPatch.js";import{RenderOrder as he}from"./RenderOrder.js";import{SphericalPatch as de}from"./SphericalPatch.js";import{DEFAULT_TILE_BACKGROUND as ue,MAX_ROOT_TILES as pe,TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR as ce,TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR as _e,MAX_MEMORY_LOD_BIAS as me,ELEVATION_NODATA_VALUE as ge}from"./TerrainConst.js";import ye from"./TerrainRenderer.js";import fe from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as Te,computeSkirtScale as ve,isSurfaceLayerView as we,isElevationLayerView as Se,isVectorTileLayerView as Le,useFetchTileForLayer as xe,isImageryTileLayerView as Ee,isTileLayerView as De,releaseTileData as Pe}from"./terrainUtils.js";import{SplitLimits as Ce,Tile as Re}from"./Tile.js";import{printAllocations as Ue}from"./TilePerLayerInfo.js";import{TileUpdate as je}from"./TileUpdate.js";import{IteratorPreorder as Me,IteratorPostorder as be,hasLoadableSiblings as Ie,sortTilesByPOI as Ae,sortTiles as Ve}from"./tileUtils.js";import{TilingSchemeLogic as Oe}from"./TilingSchemeLogic.js";import{UpsampleInfo as ke}from"./UpsampleInfo.js";import{RenderRequestType as qe}from"../webgl-engine/lib/basicInterfaces.js";import{ImmediateTask as Be,TaskPriority as Ne,noBudget as Fe}from"../../support/Scheduler.js";import{WatchUpdatingTracking as He}from"../../support/WatchUpdatingTracking.js";const Ge=l.getLogger("esri.views.3d.terrain.TerrainSurface"),We=.25;let Qe=class extends(a.EventedMixin(i)){constructor(e){super(e),this._elevationBounds=new Z,this._iteratorPool=new c(Me,(e=>e.remove=()=>this._iteratorPool.release(e))),this._postorderIterator=new be,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._visible=!1,this._usedMemory=Ke,this._performanceInfo=new fe,this._viewChanged=!1,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=P(),this._eyePosSurfaceSR=P(),this._splitLimits=new Ce,this._snapLevel=1/0,this._frustum=q(),this._viewProjectionMatrix=E(),this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._handles=new n,this._watchUpdatingTracking=new He,this._frameTask=Be,this._allTiles=new _,this._upsampleInfoPool=new c(ke),this._rootTilesExtent=M(),this._maxNumUpdating=1,this.maxTextureScale=1.2,this.backgroundImage=ue,this.backgroundColor=null,this._layerViewsDirty=!1}initialize(){this._lercDecoder=G(this.view.resourceController),this._tilePool=this.view.state.isLocal?new c(oe):new c(de);const e=this.view.resourceController.memoryController;this._upsampleMapCache=e.newCache("esri.views.3d.terrain.upsample",(e=>e.unloadMapData())),this._elevationQueryCache=new F(e.newCache("elevation-query")),this._set("overlayManager",new le({surface:this})),this._handles.add([this.watch("overlayManager.hasHighlights",(e=>this._renderer.setNeedsHighlight(e))),this.watch("overlayManager.rendersOccluded",(e=>this._renderer.setRenderOccludedOverlay(e)))],"overlayManager"),this._renderer=new ye({overlayRenderer:this.overlayManager.renderer,ellipsoidRadius:j(this.view.spatialReference).radius,stage:this.view._stage,allTiles:this._allTiles}),this._handles.add([v(this,"baseOpacity",(e=>{this._handleLayerViewChanges(),this._updateBaseOpacity(e)}),!0),v(this,"_background",(()=>{this._handleLayerViewChanges(),this._renderer.setTileBackground(this._background)}),!0),this.view.watch("pointsOfInterest",(e=>{this._renderer.pointsOfInterest=e,this._watchUpdatingTracking.removeAll(),e&&this._watchUpdatingTracking.add((()=>e.focus.renderLocation),(()=>()=>this._allTilesSorted=!1))})),v(Y,"TERRAIN_TILE_TREE_SHOW_TILES",(e=>{e&&!this._treeDebugger?import("../layers/support/TerrainTileTree3DDebugger.js").then((({TerrainTileTree3DDebugger:e})=>{!this._treeDebugger&&Y.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new e({view:this.view}))})):e||(this._treeDebugger=d(this._treeDebugger))}))]),this._extentHelper=ie(this.viewingMode,{layers:this.view.map.allLayers,layerViews:this.view.allLayerViews,viewSpatialReference:this.view.spatialReference});const t=this.view.defaultsFromMap?new s({getCollections:()=>{var e,t,i;return null==(e=this.view)||null==(t=e.defaultsFromMap)||null==(i=t.mapCollections)?void 0:i.map((({layers:e})=>e))},getChildrenFunction:e=>e&&"layers"in e?e.layers:null}):this.view.map.allLayers,i=new Oe({layers:t,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:this.view.spatialReference});this._set("tilingSchemeLogic",i),this._updateTilingScheme(),this._elevationDataRequester=this.view.resourceController.createStreamDataRequester(K.ELEVATION),this._mapDataRequester=this.view.resourceController.createStreamDataRequester(K.BASEMAP);const r=this.view.resourceController.scheduler;this._frameTask=r.registerTask(Ne.TERRAIN_SURFACE,this),this.view.resourceController.memoryController.events.on("quality-changed",(()=>this._viewChangeUpdate())),this._handles.add([v(this._extentHelper,"stencilEnabledExtents",(e=>this._renderer.setStencilEnabledLayerExtents(e))),this.tilingSchemeLogic.watch("tilingScheme",(()=>this._updateTilingScheme()),!0),v(this,"extent",(()=>this._updateRootTiles())),this.view.on("resize",(()=>this._viewChangeUpdate())),this.view.watch("state.camera",(()=>this._viewChangeUpdate()),!0),this.view.watch("state.contentCamera",(()=>this.view.state.fixedContentCamera&&this._viewChangeUpdate()),!0),this.view.watch("qualitySettings.tiledSurface.lodBias",(()=>this._viewChangeUpdate())),v(this.view,"qualitySettings.tiledSurface.textureFadeDuration",(e=>this._renderer.textureFadingEnabled=e>0)),this.view.watch("lodSnapping",(()=>this._viewChangeUpdate())),f((()=>this._userClippingExtent),(()=>this._updateClippingExtent()),T)]),this._handles.add(this.view.allLayerViews.on("after-changes",(()=>this._layerViewsDirty=!0))),this._layerViewsDirty=!0,this._handleLayerViewChanges()}destroy(){this._frameTask.remove(),this._handles.destroy(),this._watchUpdatingTracking.destroy(),this._lercDecoder=h(this._lercDecoder),this._removeAllTiles(),this._upsampleMapCache=d(this._upsampleMapCache),this._elevationQueryCache=d(this._elevationQueryCache),this._set("tilingSchemeLogic",d(this.tilingSchemeLogic)),this._extentHelper=d(this._extentHelper),this._basemapLayerViewHandles.forEach(((e,t)=>this._unregisterTiledLayerView(t))),this._elevationDataRequester=null,this._mapDataRequester=null,this._set("overlayManager",d(this.overlayManager)),this._tilePool=d(this._tilePool),Re.prune(),this._treeDebugger&&(this._treeDebugger.destroy(),this._treeDebugger=null),this._renderer=d(this._renderer),this._iteratorPool=d(this._iteratorPool),this._set("view",null),this._upsampleInfoPool=d(this._upsampleInfoPool),W(),Ue()}get renderer(){return this._renderer}get frustum(){return this._frustum}get snapLevel(){var e,t;const i=null==(e=this.view.pointsOfInterest)||null==(t=e.contentCameraOnSurface)?void 0:t.scale;if(i){const e=this.view.state.contentCamera;let t=X(this.view,e.eye,e.viewForward,e.up).tilt;t>90&&(t=180-t);const r=2*(t/90)**2,s=z(this.view,i)-r;Math.abs(this._snapLevel-s)>We&&(Math.round(s)!==Math.round(this._snapLevel)&&(this._viewChanged=!0),this._snapLevel=s)}return Math.round(this._snapLevel)}get lodSnapping(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences?re.ON:re.OFF}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get mapTileRequester(){return this._mapDataRequester}get _userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(u(t)||u(e))return null;const i=M(),r=$(t,i,e)?i:null,s=this._get("extent");return b(r,s)?s:r}get extent(){const e=I(this.groundExtent,this._userClippingExtent,M()),t=this._get("extent");return b(e,t)?t:e}get groundExtent(){return p(this._tilingSchemeExtent)?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){var e;return null==(e=this.tilingSchemeLogic)?void 0:e.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),!!((this._watchUpdatingTracking.updating||this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||this._asyncWorkItems>0||!this._allTilesSorted||this._renderer.updating||this._layerViewsDirty)&&this.ready&&!this.suspended||this.overlayManager.updating||this._frameTask.updating)}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get viewingMode(){return this.view.state.viewingMode}get ready(){return p(this.rootTiles)}set renderOrder(e){this._renderer.renderOrder=e,this._set("renderOrder",e)}set skirtScale(e){this._renderer.skirtScale=e}get skirtScale(){return this._renderer.skirtScale}get spatialReference(){var e,t;return null!=(e=null==(t=this.tilingScheme)?void 0:t.spatialReference)?e:null}get _background(){return null!=this.backgroundColor?this.backgroundColor:this.backgroundImage}set slicePlaneEnabled(e){var t,i;this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),null==(t=this.view)||null==(i=t._stage)||i.renderView.setRenderParameters({opaqueTerrain:this.opaque})}set velvetOverground(e){e!==this.velvetOverground&&(this._renderer.velvetOverground=e),this._set("velvetOverground",e)}set visible(e){e!==this._visible&&(this._visible=e,this._renderer.setVisibility(e),this.suspended=!e)}get opaque(){return this._renderer.opaque}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}intersect(e,t,i,r){this._renderer.intersect(e,t,i,r)}getElevation(e,t,i,r){const s=this.getTileWithElevation(e,t,i,r,Je);return u(s)?null:ee(Je[0],Je[1],s.renderData.geometryState.samplerData)}getTileWithElevation(e,t,i,r,s=Je){var a;const n=this.rootTiles;if(u(n)||!n.length)return null;if(0===n[0].layerInfo[ae.ELEVATION].length)return null;if(s[0]=e,s[1]=t,s[2]=i,!R(s,r,s,null==(a=this.tilingScheme)?void 0:a.spatialReference))return Ge.error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;for(let l of n){if(!l.containsPoint(s))continue;for(;l&&!l.rendered&&!l.isLeaf;){let e=0;s[0]>.5*(l.extent[0]+l.extent[2])&&(e+=1),s[1]<.5*(l.extent[1]+l.extent[3])&&(e+=2),l=l.children[e]}const e=l.renderData;return(e?e.geometryState.samplerData:null)?l:null}return null}get elevationBounds(){return this._elevationBounds}getScale(e){if(this.tilingScheme){if(!U(e,Je,this.spatialReference))return Ge.error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;const t=this.rootTiles;if(p(t))for(let e of t)if(e.containsPoint(Je)){for(;null!=e.children[0];){let t=0;Je[0]>e.children[0].extent[2]&&(t+=1),Je[1]<e.children[0].extent[1]&&(t+=2),e=e.children[t]}return this._getLodBiasCorrectedScale(e.level)}}return 1e100}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!U(e,Je,this.spatialReference))return Ge.error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;Je[3]=t;let i=null;const r=e=>{if(e&&k(e.extent,Je))if(null!=e.children[0])for(const t of e.children)r(t);else{const t=this._getLodBiasCorrectedScale(e.level);i=null==i?t:Math.min(i,t)}},s=this.rootTiles;if(p(s))for(const a of s)r(a);return i}queryVisibleScaleRange(e,t,i,r){const s=t?this.tilingScheme.levelAtScale(t):0,a=i?this.tilingScheme.levelAtScale(i):1/0,n=this.lodBias;this._renderer.queryVisibleLevelRange(e,s+n,a+n,r)}_updateBaseOpacity(e){const t=this._renderer.opaque;this._renderer.opaque=e>=1,this._renderer.isTransparent=this._allTransparentSurfaceLayers();const i=t===this._renderer.opaque?se.UNFADED:se.IMMEDIATE;var r,s;i===se.IMMEDIATE&&(null==(r=this.view)||null==(s=r._stage)||s.renderView.setRenderParameters({opaqueTerrain:this.opaque}));this._updateTileTextures(i)}_updateTilingScheme(){const e=this.tilingSchemeLogic.tilingScheme;e!==this.tilingScheme&&(Te(!!e,"tiling scheme cannot be reset to undefined"),this.tilingScheme&&this._removeAllTiles(),this._set("tilingScheme",e),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.setTileSize(e.pixelSize),this.overlayManager.setSpatialReference(e.spatialReference),this._updateRootTiles()))}_acquireTile(e,t,i,r){const s=this._tilePool.acquire();return et[0]=e,et[1]=t,et[2]=i,s.init(et,r,this),s}_updateRootTiles(){const{extent:e,tilingScheme:t}=this;if(!t)return;const i=Ze;let s=t.rootTilesInExtent(e,i,5*pe);if(p(this.rootTiles)){if(s.length>pe)return void Ge.warn(ce);const e=this.rootTiles.map((e=>e.lij)),t=r(e,s,ze);if(t.removed.length>0||t.added.length>0){const e=this.rootTiles.filter((e=>!(t.removed.findIndex((t=>ze(t,e.lij)))>-1)||(this._purgeTile(e),!1)));t.added.forEach((t=>e.push(this._newRootTile(t)))),this._setRootTiles(e)}}else s.length>pe&&(Ge.warn(_e),s=t.rootTilesInExtent(e,i,pe)),this._setRootTiles(s.map((e=>this._newRootTile(e))));b(i,this._rootTilesExtent)||(this._rootTilesExtent=M(i)),this.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready")}_newRootTile(e){const t=this._acquireTile(0,e[1],e[2],null);return t.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.lodSnapping)===je.SPLIT&&t.setPendingUpdate(je.SPLIT),this._loadTile(t),t}_setRootTiles(e){if(this._set("rootTiles",e),this._allTiles.clear(),p(e)){const t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this.rootTiles),this._updateTilesVisibility(e)}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this._visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateSkirts(),this._updateTilesVisibility(this.rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.extent)&&e.resetPendingUpdate(je.GEOMETRY)&&this._updateTileGeometry(e)}_updateTilesVisibility(e){if(u(e))return;const t=Ie(e);let i=t?this._elevationBounds.min:1/0,r=t?this._elevationBounds.max:-1/0;const s=this.view.state.fixedContentCamera,a=this.extent,n=this._viewProjectionMatrix;this.setTileTreeDirty();const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const e=l.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(je.GEOMETRY)&&this._updateTileGeometry(e),e.setPendingUpdate(je.RENDERDATA);const t=e.updateVisibilityNow();s||t?(e.updateScreenDepth(n),e.renderData&&(i=Math.min(e.elevationBounds[0],i),r=Math.max(e.elevationBounds[1],r))):l.skipSubtree()}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,isFinite(i)&&isFinite(r)&&(this._elevationBounds.min===i&&this._elevationBounds.max===r||(this._elevationBounds.min=i,this._elevationBounds.max=r,this.emit("elevation-bounds-change",null)))}_updateViewDependentParameters(){const e=this.view.state.camera,t=this.view.state.contentCamera,i=Math.tan(.5*t.fovX),r=Math.tan(.5*t.fovY),s=this.tilingScheme.pixelSize,a=2**-this.lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?(u(this._splitLimits.frustum)&&(this._splitLimits.frustum=q()),B(t.frustum,this._splitLimits.frustum)):this._splitLimits.frustum=null,B(e.frustum,this._frustum),x(this._viewProjectionMatrix,t.projectionMatrix,t.viewMatrix),D(this._eyePosRenderSR,t.eye),R(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateSkirts(){const e=this.view.state.camera,t=this.view.state.constraints.collision.enabled?0:1.11*e.near;this.skirtScale=ve(this,this._eyePosSurfaceSR,t)}_updateRenderData(e){e.rendered&&!e.shouldLoad&&(Ye(e)?this._loadChildren(e):$e(e)&&this._loadParent(e))}_updateTileGeometry(e){e.updateVisibility(),this._renderer.updateTileGeometry(e),this._elevationUpdate(e),this._usedMemory=Ke}_updateTileTexture(e,t){const i=e.resetPendingUpdate(je.TEXTURE_FADING)?je.TEXTURE_FADING:!!e.resetPendingUpdate(je.TEXTURE_NOFADING)&&je.TEXTURE_NOFADING;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=Ke,t.madeProgress())}_elevationUpdate(e){it.spatialReference=this.spatialReference,it.tile=e,it.extent=e.extent,this.emit("elevation-change",it),A(e.extent,this._eyePosSurfaceSR)&&this._updateSkirts()}get running(){return this.updating&&this.ready&&!this.suspended}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateTileStatus(e),this._sortTiles(e);const t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),e.run((()=>this._updateElevation(e))),e.run((()=>this._updateTextures(e))),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty(),e.done&&this.requestUpdate(),this.notifyChange("updatingProgressValue")}_updateTileStatus(e){if(!this._viewChanged||!this.rootTiles||e.done)return;this._viewChanged=!1;const t=this._iteratorPool.acquire();for(t.reset(this.rootTiles);!t.done;){const e=t.next();if(e.loadable){const i=e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.lodSnapping);if(i===je.SPLIT){e.resetPendingUpdate(je.MERGE),e.isLeaf&&(e.setPendingUpdate(je.SPLIT),t.skipSubtree());continue}e.resetPendingUpdate(je.SPLIT)&&e.updateAgentSuspension(),i===je.VSPLITMERGE&&e.updateAgents(ae.ELEVATION)}if(t.skipSubtree(),!e.isLeaf){e.setPendingUpdate(je.MERGE),e.resetPendingUpdate(je.SPLIT);const t=this._iteratorPool.acquire();t.resetOne(e);for(let e=t.next();!t.done;e=t.next())this._updateClippingStatus(e),e.updateVisibility(),e.loadable&&e.updateScreenDepth(this._viewProjectionMatrix);t.remove()}}t.remove(),this.requestUpdate(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||(Ae(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger&&this._treeDebugger.update(),e.madeProgress())}_mergeAndSplit(e,t){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=0;for(;!e.done;){let r=!1;i=0;const s=!this._allTiles.some((s=>{if(i+=s.usedMemory,s.resetPendingUpdate(je.MERGE)){if(!t)return s.setPendingUpdate(je.MERGE),e.done;this._mergeTile(s),r=!0,e.madeProgress()}else s.resetPendingUpdate(je.SPLIT)&&(this._splitTile(s),r=!0,e.madeProgress());return!e.done&&s.resetPendingUpdate(je.RENDERDATA)&&(this._updateRenderData(s),e.madeProgress()),e.done}));if(r&&(this._allTilesSorted=!1,this._allTilesDirty=!0),s){if(this._usedMemory=i,!r)break;this._updateTilesVisibility(this.rootTiles)}else this._allTilesDirty=!0}0===i&&(this._allTilesDirty=!0),this._sortTiles(e)}_updateElevation(e){return this._allTiles.some((t=>(t.resetPendingUpdate(je.GEOMETRY)&&(this._updateTileGeometry(t),this._updateTileTexture(t,e),e.madeProgress()),e.done))),e.hasProgressed}_updateTextures(e){return this._allTiles.some((t=>(this._updateTileTexture(t,e),e.done))),e.hasProgressed}_updateClippingExtent(){this.spatialReference&&(this.updateTileOverlayParams(qe.UPDATE),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get lodBias(){const e=this.view.resourceController.memoryController.memoryFactor;return this.view.qualitySettings.tiledSurface.lodBias-(1-e)*me}_getLodBiasCorrectedScale(e){const t=this.tilingScheme.levels,i=o(e-this.lodBias,0,t.length-1),r=i-Math.floor(i);return t[Math.floor(i)].scale*(1-r)+t[Math.ceil(i)].scale*r}_removeAllTiles(){p(this.rootTiles)&&(this.rootTiles.forEach((e=>this._purgeTile(e))),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this.visible=!1}_purgeChildTiles(e){if(e.isLeaf)return!1;let t=this._purgeTile(e.children[0]);return t=this._purgeTile(e.children[1])||t,t=this._purgeTile(e.children[2])||t,t=this._purgeTile(e.children[3])||t,e.unsetChildren(),t}_purgeTile(e){const t=this._purgeChildTiles(e)||e.rendered;return this._allTiles.removeUnordered(e),e.unload(this._renderer),this._tilePool.release(e),t}_splitTile(e){Te(e.isLeaf,"tile that is already split should not be split again!");const t=e.level+1,i=2*e.lij[1],r=2*e.lij[2];e.setChildren(this._createTile(t,i,r,e),this._createTile(t,i,r+1,e),this._createTile(t,i+1,r,e),this._createTile(t,i+1,r+1,e)),e.setPendingUpdate(je.RENDERDATA),e.updateAgentSuspension(),this._allTiles.pushArray(e.children),this._allTilesDirty=!0,this._emitTileScaleChange(e,t),++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){rt.spatialReference=this.spatialReference,rt.extent=e.extent,rt.scale=this._getLodBiasCorrectedScale(t),this.emit("scale-change",rt)}_createTile(e,t,i,r){Te(!!r,"_createTile sanity check");const s=this._acquireTile(e,t,i,r);return s.updateClippingStatus(this.extent),s.loadable&&(s.updateScreenDepth(this._viewProjectionMatrix),s.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.lodSnapping)===je.SPLIT&&s.setPendingUpdate(je.SPLIT)),s}_mergeTile(e){Te(!e.hasPendingUpdate(je.SPLIT),"_mergeTile sanity check"),this._purgeChildTiles(e)&&(Te(!e.renderData,"_mergeTile sanity check"),this._loadTile(e)),this._allTilesDirty=!0,++this._performanceInfo.numMerged,this._emitTileScaleChange(e)}_loadChildren(e){Te(e.rendered,"parent should be rendered"),e.unload(this._renderer),this._loadTile(e.children[0]),this._loadTile(e.children[1]),this._loadTile(e.children[2]),this._loadTile(e.children[3])}_loadParent(e){const t=e.parent;this._unloadChildren(t),this._loadTile(t)}_unloadChildren(e){e.isLeaf||(this._unloadChildren(e.children[0]),e.children[0].unload(this._renderer),this._unloadChildren(e.children[1]),e.children[1].unload(this._renderer),this._unloadChildren(e.children[2]),e.children[2].unload(this._renderer),this._unloadChildren(e.children[3]),e.children[3].unload(this._renderer))}_loadTile(e){e.load(this._renderer),e.setPendingUpdate(je.RENDERDATA),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager&&this.overlayManager.hasOverlays&&this.overlayManager.setTileParameters(e),this._elevationUpdate(e)}_elevationDataArrived(e,t,i){const r=new te(e.lij,e.extent,i);e.dataArrived(t,ae.ELEVATION,r);const s=[e],a=e.level,n=this._iteratorPool.acquire();for(n.reset(s);!n.done;){const e=n.next();e.findElevationBoundsForLayer(t,a),e.computeElevationBounds()}n.remove(),this._updateTilesVisibility(s)}_handleLayerViewChanges(e=Fe){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1;const i=new Set;let r=-1;for(const s of this.view.allLayerViews.items)if(i.add(s.uid),we(s))if(this._basemapLayerViewHandles.has(s.uid)){const e=this._layerClassFromLayerView(s),i=this._layerIndexByUid[e].get(s.uid);i<r&&(t=!0),r=i}else this._registerTiledLayerView(s),s.layer.loaded&&(t=!0);this._basemapLayerViewHandles.forEach(((e,r)=>{i.has(r)||(this._unregisterTiledLayerView(r),t=!0)})),t&&this._updateTiledLayers(),this._renderer.isTransparent=this._allTransparentSurfaceLayers(),e.madeProgress()}_allTransparentSurfaceLayers(){let e=0===this.view.map.ground.opacity;for(const t of this.view.allLayerViews.items)if(we(t)&&!Se(t)&&!H(t.layer)&&0!==t.fullOpacity)return e=!1,e;return e}_layerClassFromLayerView(e){return Se(e)?ae.ELEVATION:ae.MAP}_registerTiledLayerView(e){const t=[],i=this._layerClassFromLayerView(e);t.push(e.watch("suspended",(()=>this._updateTiledLayers()))),t.push(e.watch("fullOpacity",(()=>this._updateTileTextures(se.UNFADED)))),t.push(e.layer.watch("effectiveScaleRange",(()=>this._restartAllAgents(i)))),e.on("data-changed",(()=>{const t=this._layerIndexByUid[i].get(e.uid);null!=t&&this._invalidateLayerData(t,i)})),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){const t=this._basemapLayerViewHandles.get(e);if(t){for(let e=0;e<t.length;e++)t[e].remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,t=[[],[]];let i=null;const r=V();e.forEach((e=>{const s=e.layer;if(!s||e.suspended||!we(e))return;const a=e.fullExtent;if(!a)return void Ge.warn("Terrain: Map or elevation layer does not have fullExtent: "+s.id);if(!this.tilingScheme.compatibleWith(e.tileInfo))return void Ge.warn("Terrain: tiling scheme of layer "+s.id+" is incompatible with other tiled layers, will not be drawn");O(r,a,r);const n=this._layerClassFromLayerView(e);if(n===ae.MAP){const t=e.displayLevelRange;t.maxLevel!==1/0&&(null===i||t.maxLevel>i)&&(i=t.maxLevel)}t[n].push(e)}));for(const s of ne){const e=this._layerViews[s],i=t[s];i.reverse();const r=i.length;let a=e.length!==r;const n=new Array(r),l=new Array(e.length);this._layerIndexByUid[s].clear();for(let t=0;t<r;t++){const r=i[t].uid;this._layerIndexByUid[s].set(r,t);const o=e.indexOf(i[t]);n[t]=o,t!==o&&(a=!0),o>-1&&(l[o]=t)}if(a){const e=this._postorderIterator;for(e.reset(this.rootTiles);!e.done;)e.next().modifyLayers(l,n,s);this._layerViews[s]=i,this._restartAllAgents(s),this._updateTilesVisibility(this.rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&this._viewChangeUpdate()}_restartAllAgents(e){const t=this._postorderIterator;for(t.reset(this.rootTiles);!t.done;){const i=t.next();i.restartAgents(e),e===ae.ELEVATION&&i.computeElevationBounds()}}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll((t=>{t.updateAgents(ae.MAP),e===se.IMMEDIATE?this.renderer.updateTileTexture(t,je.TEXTURE_NOFADING):t.updateRenderData(ae.MAP,e)})),this._renderer.isTransparent=this._allTransparentSurfaceLayers()}_invalidateLayerData(e,t){this._allTiles.forAll((i=>i.removeLayerAgent(e,t))),this._allTiles.forAll((i=>i.invalidateLayerData(e,t)))}setTileTreeDirty(){this._allTilesDirty=!0}requestRender(e=qe.UPDATE){this.renderer.setNeedsRender(e)}requestUpdate(){1==++this._pendingUpdates&&(this._hasPendingUpdates=!0)}requestTileData(e,t,i,r){const s=this.layerViewByIndex(t,i),a=s.layer;return!a.tilemapCache||Le(s)?this._requestTileData(e,i,s,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.lij[0],e.lij[1],e.lij[2],{...r,timeout:6e3}).then((()=>--this._asyncWorkItems)).catch((t=>{throw--this._asyncWorkItems,m(t)||this._dataMissing(e,i,s,{notInTilemap:!0}),t})).then((()=>this._frameTask.schedule((()=>this._requestTileData(e,i,s,r)),r.signal))))}_requestTileData(e,t,i,r){return t===ae.ELEVATION?this._requestElevationTileData(e,i,r):this._requestMapTileData(e,i,r)}_requestElevationTileData(e,t,i){if(!Se(t))return void Te(!1,"_requestElevationTileData can only be called for elevation layer views");const r=r=>{if(--this._asyncWorkItems,g(i))return;const s=this._layerIndexByUid[ae.ELEVATION].get(t.uid);null!=s?(this._usedMemory=Ke,this.requestUpdate(),this._elevationDataArrived(e,s,r)):Ge.warn("TerrainSurface: received data from unknown layer %d %s",ae.ELEVATION,e.lij.toString())},s=i=>{--this._asyncWorkItems,m(i)||(this._dataMissing(e,ae.ELEVATION,t,i),this.requestUpdate())};if(++this._asyncWorkItems,xe(t.layer))return t.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],{noDataValue:ge,signal:i.signal}).then((e=>{if(g(i))return Ge.warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."),void s(y());this._frameTask.schedule((()=>r(e)),i.signal,s)}),s);const a=t.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);return this._elevationDataRequester.request(a,"binary",i).then((e=>this._lercDecoder.decode(e,{noDataValue:ge},i.signal))).then((e=>{r({values:e.pixelData,width:e.width,height:e.height,noDataValue:e.noDataValue,minValue:e.minValue,maxValue:e.maxValue})}),s)}_requestMapTileData(e,t,i){if(t instanceof Q)return Promise.reject();++this._asyncWorkItems;const r=(r,s)=>{--this._asyncWorkItems,Pe(s),g(i)||(this._dataMissing(e,ae.MAP,t,r),this.requestUpdate())},s=e=>t=>r(t,e),a=r=>this._frameTask.schedule((()=>{--this._asyncWorkItems,this.requestUpdate(),g(i)?Pe(r):this._mapTileDataArrived(e,t,r)}),i.signal,s(r)).catch(s(r)),n=(e,t=null)=>this._frameTask.schedule((()=>r(e,t)));if(Le(t)){const r=t.schemaHelper.getLevelRowColumn(e.lij);return t.fetchTile(r[0],r[1],r[2],i).then(a,n)}if(Ee(t))return t.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then(a,n);if(De(t)&&xe(t.layer))return t.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then((e=>{if(g(i))return Ge.warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."),void n(y());a(e)}),n);let l=t.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);N(t.layer)&&t.layer.refreshTimestamp&&(l+=`${l.includes("?")?"&":"?"}_ts=${t.layer.refreshTimestamp}`);const o=t.hasMixedImageFormats?"image+type":"image";return this._mapDataRequester.request(l,o,i).then(a,n)}_mapTileDataArrived(e,t,i){const r=this._layerIndexByUid[ae.MAP].get(t.uid);null!=r?e.dataArrived(r,ae.MAP,i):(Pe(i),Ge.warn("TerrainSurface: received data from unknown layer"))}_dataMissing(e,t,i,r){const s=this._layerIndexByUid[t].get(i.uid);null!=s?e.dataMissing(s,t,r):Ge.warn("TerrainSurface: received data from unknown layer")}updateTileOverlayParams(e){this.rootTiles&&this.overlayManager&&(this._allTiles.forAll((e=>{e.renderData&&this.overlayManager.setTileParameters(e)})),this._renderer.setNeedsRender(e))}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll((t=>{t.isLeaf&&e.numLeaves++;const i=t.level;t.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))})),e}getUsedMemory(){return this.tilingScheme?(this._usedMemory===Ke&&(this._usedMemory=0,this._allTiles.forAll((e=>this._usedMemory+=e.usedMemory))),this._usedMemory):0}getUsedMemoryForLayerView(e){let t=0;const i=this._layerClassFromLayerView(e),r=this._layerIndexByUid[i].get(e.uid);return this._allTiles.forAll((e=>t+=e.getUsedMemoryForLayer(i,r))),t}getTile(e){if(u(e)||u(this.rootTiles))return null;const t=e.split("/").map((e=>+e));if(0===t[0])return this.rootTiles.find((e=>e.lij[1]===t[1]&&e.lij[2]===t[2]));const i=2**t[0],r=Math.floor(t[1]/i),s=Math.floor(t[2]/i);let a;if(this.rootTiles.some((e=>e.lij[1]===r&&e.lij[2]===s&&(a=e,!0))),a){let e=1<<t[0]-1;for(;a.lij[0]<t[0];){let i=t[1]&e?2:0;if((t[2]&e)>0&&i++,!a.children[i])return null;a=a.children[i],e>>=1}return Te(a.lij[0]===t[0]&&a.lij[1]===t[1]&&a.lij[2]===t[2],"not the right tile?"),a}return null}get test(){const e=this;return{renderer:e._renderer,lercDecoder:e._lercDecoder,forceReload:()=>{p(e.rootTiles)&&(e._mergeTile(e.rootTiles[0]),e._viewChangeUpdate())},getTiles:()=>e._allTiles.toArray(),getRenderedTiles(){tt.clear(),e._allTiles.forAll((e=>{e.visible&&e.rendered&&tt.push(e)}));const t=tt.toArray();return Ve(e.renderOrder,t),t},lockTilingScheme(t,i){e._extentHelper.defaultTiledLayersExtent=i,e.tilingSchemeLogic.test.lockTilingScheme(t)}}}};e([S()],Qe.prototype,"_renderer",void 0),e([S()],Qe.prototype,"_hasPendingUpdates",void 0),e([S()],Qe.prototype,"_asyncWorkItems",void 0),e([S()],Qe.prototype,"_allTilesDirty",void 0),e([S()],Qe.prototype,"_allTilesSorted",void 0),e([S()],Qe.prototype,"_viewChanged",void 0),e([S({readOnly:!0})],Qe.prototype,"_watchUpdatingTracking",void 0),e([S()],Qe.prototype,"_frameTask",void 0),e([S({readOnly:!0})],Qe.prototype,"snapLevel",null),e([S({readOnly:!0})],Qe.prototype,"lodSnapping",null),e([S({constructOnly:!0})],Qe.prototype,"view",void 0),e([S()],Qe.prototype,"_userClippingExtent",null),e([S()],Qe.prototype,"_rootTilesExtent",void 0),e([S({readOnly:!0})],Qe.prototype,"extent",null),e([S({readOnly:!0})],Qe.prototype,"groundExtent",null),e([S({readOnly:!0})],Qe.prototype,"_tilingSchemeExtent",null),e([S({readOnly:!0})],Qe.prototype,"updating",null),e([S(J)],Qe.prototype,"updatingProgress",void 0),e([S({readOnly:!0})],Qe.prototype,"updatingProgressValue",null),e([S()],Qe.prototype,"_maxNumUpdating",void 0),e([S({aliasOf:"view.map.ground.opacity"})],Qe.prototype,"baseOpacity",void 0),e([S({readOnly:!0})],Qe.prototype,"overlayManager",void 0),e([S({readOnly:!0})],Qe.prototype,"viewingMode",null),e([S()],Qe.prototype,"maxTextureScale",void 0),e([S({readOnly:!0})],Qe.prototype,"ready",null),e([S({value:he.FRONT_TO_BACK})],Qe.prototype,"renderOrder",null),e([S({readOnly:!0})],Qe.prototype,"rootTiles",void 0),e([S({readOnly:!0})],Qe.prototype,"spatialReference",null),e([S()],Qe.prototype,"backgroundImage",void 0),e([S({type:t,aliasOf:"view.map.ground.surfaceColor"})],Qe.prototype,"backgroundColor",void 0),e([S()],Qe.prototype,"_background",null),e([S({value:!1})],Qe.prototype,"slicePlaneEnabled",null),e([S({readOnly:!0})],Qe.prototype,"tilingScheme",void 0),e([S({readOnly:!0,aliasOf:"tilingSchemeLogic.tilingSchemeLocked"})],Qe.prototype,"tilingSchemeLocked",void 0),e([S({readOnly:!0,aliasOf:"tilingSchemeLogic.tilingSchemeDone"})],Qe.prototype,"tilingSchemeDone",void 0),e([S({readOnly:!0})],Qe.prototype,"tilingSchemeLogic",void 0),e([S({value:!0})],Qe.prototype,"velvetOverground",null),e([w("_renderer.wireframe")],Qe.prototype,"wireframe",void 0),e([S({value:!1})],Qe.prototype,"suspended",null),e([S({readOnly:!0,aliasOf:"view.qualitySettings.tiledSurface.textureFadeDuration"})],Qe.prototype,"textureFadeDuration",void 0),e([S()],Qe.prototype,"_layerViewsDirty",void 0),e([w("_renderer.renderPatchBorders")],Qe.prototype,"renderPatchBorders",void 0),e([w("_renderer.renderingDisabled")],Qe.prototype,"renderingDisabled",void 0),Qe=e([L("esri.views.3d.terrain.TerrainSurface")],Qe);const Xe=Qe;function ze(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ye(e){return!e.isLeaf&&(e.children[0].shouldLoad||e.children[1].shouldLoad||e.children[2].shouldLoad||e.children[3].shouldLoad||Ye(e.children[0])||Ye(e.children[1])||Ye(e.children[2])||Ye(e.children[3]))}function $e(e){return e.isLeaf&&e.parent&&e.parent.shouldLoad}const Ke=-1,Je=C(),Ze=M(),et=[0,0,0],tt=new _,it={spatialReference:null,tile:null,extent:null,context:"ground"},rt={spatialReference:null,extent:null,scale:0};export{Xe as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../core/Accessor.js";import{difference as r}from"../../../core/arrayUtils.js";import s from"../../../core/CollectionFlattener.js";import a from"../../../core/Evented.js";import n from"../../../core/Handles.js";import l from"../../../core/Logger.js";import{clamp as o}from"../../../core/mathUtils.js";import{releaseMaybe as h,destroyMaybe as d,isNone as u,isSome as p}from"../../../core/maybe.js";import c from"../../../core/ObjectPool.js";import _ from"../../../core/PooledArray.js";import{isAbortError as m,isAborted as g,createAbortError as y}from"../../../core/promiseUtils.js";import{watch as f,sync as T}from"../../../core/reactiveUtils.js";import{init as v}from"../../../core/watchUtils.js";import{aliasOf as w}from"../../../core/accessorSupport/decorators/aliasOf.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{property as S}from"../../../core/accessorSupport/decorators/property.js";import{subclass as L}from"../../../core/accessorSupport/decorators/subclass.js";import{m as x}from"../../../chunks/mat4.js";import{c as E}from"../../../chunks/mat4f64.js";import{g as D}from"../../../chunks/vec3.js";import{c as P}from"../../../chunks/vec3f64.js";import{c as C}from"../../../chunks/vec4f64.js";import{projectVectorToVector as R,projectPointToVector as U}from"../../../geometry/projection.js";import{getReferenceEllipsoid as j}from"../../../geometry/projectionEllipsoid.js";import{create as M,equals as b,intersection as I,containsPoint as A,empty as V,expand as O,intersectsSphere as k}from"../../../geometry/support/aaBoundingRect.js";import{create as q,copy as B}from"../../../geometry/support/frustum.js";import{isRefreshableLayer as N}from"../../../layers/mixins/RefreshableLayer.js";import{ElevationQueryTileCache as F}from"../../../layers/support/ElevationQueryTileCache.js";import{isBaseLayer as H}from"../../../layers/support/layerUtils.js";import{acquireDecoder as G}from"../../../layers/support/LercDecoder.js";import{printAllocations as W}from"../../2d/engine/vectorTiles/VectorTile.js";import Q from"../layers/ElevationLayerView3D.js";import{directionToHeadingTilt as X,scaleToZoom as z}from"../support/cameraUtils.js";import Y from"../support/debugFlags.js";import{toBoundingRect as $}from"../support/extentUtils.js";import{ClientType as K}from"../support/index.js";import{updatingProgress as J}from"../support/updatingProperties.js";import{ElevationBounds as Z}from"./ElevationBounds.js";import{sampleElevation as ee,ElevationData as te}from"./ElevationData.js";import{create as ie}from"./ExtentHelper.js";import{LODSnapping as re,TextureUpdate as se}from"./interfaces.js";import{LayerClass as ae,LayerClasses as ne}from"./LayerClass.js";import{OverlayManager as le}from"./OverlayManager.js";import{PlanarPatch as oe}from"./PlanarPatch.js";import{RenderOrder as he}from"./RenderOrder.js";import{SphericalPatch as de}from"./SphericalPatch.js";import{DEFAULT_TILE_BACKGROUND as ue,MAX_ROOT_TILES as pe,TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR as ce,TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR as _e,MAX_MEMORY_LOD_BIAS as me,ELEVATION_NODATA_VALUE as ge}from"./TerrainConst.js";import ye from"./TerrainRenderer.js";import fe from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as Te,computeSkirtScale as ve,isSurfaceLayerView as we,isElevationLayerView as Se,isVectorTileLayerView as Le,useFetchTileForLayer as xe,isImageryTileLayerView as Ee,isTileLayerView as De,releaseTileData as Pe}from"./terrainUtils.js";import{SplitLimits as Ce,Tile as Re}from"./Tile.js";import{printAllocations as Ue}from"./TilePerLayerInfo.js";import{TileUpdate as je}from"./TileUpdate.js";import{IteratorPreorder as Me,IteratorPostorder as be,hasLoadableSiblings as Ie,sortTilesByPOI as Ae,sortTiles as Ve}from"./tileUtils.js";import{TilingSchemeLogic as Oe}from"./TilingSchemeLogic.js";import{UpsampleInfo as ke}from"./UpsampleInfo.js";import{RenderRequestType as qe}from"../webgl-engine/lib/basicInterfaces.js";import{ImmediateTask as Be,TaskPriority as Ne,noBudget as Fe}from"../../support/Scheduler.js";import{WatchUpdatingTracking as He}from"../../support/WatchUpdatingTracking.js";const Ge=l.getLogger("esri.views.3d.terrain.TerrainSurface"),We=.25;let Qe=class extends(a.EventedMixin(i)){constructor(e){super(e),this._elevationBounds=new Z,this._iteratorPool=new c(Me,(e=>e.remove=()=>this._iteratorPool.release(e))),this._postorderIterator=new be,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._visible=!1,this._usedMemory=Ke,this._performanceInfo=new fe,this._viewChanged=!1,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=P(),this._eyePosSurfaceSR=P(),this._splitLimits=new Ce,this._snapLevel=1/0,this._frustum=q(),this._viewProjectionMatrix=E(),this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._handles=new n,this._watchUpdatingTracking=new He,this._frameTask=Be,this._allTiles=new _,this._upsampleInfoPool=new c(ke),this._rootTilesExtent=M(),this._maxNumUpdating=1,this.maxTextureScale=1.2,this.backgroundImage=ue,this.backgroundColor=null,this._layerViewsDirty=!1}initialize(){this._lercDecoder=G(this.view.resourceController),this._tilePool=this.view.state.isLocal?new c(oe):new c(de);const e=this.view.resourceController.memoryController;this._upsampleMapCache=e.newCache("esri.views.3d.terrain.upsample",(e=>e.unloadMapData())),this._elevationQueryCache=new F(e.newCache("elevation-query")),this._set("overlayManager",new le({surface:this})),this._handles.add([this.watch("overlayManager.hasHighlights",(e=>this._renderer.setNeedsHighlight(e))),this.watch("overlayManager.rendersOccluded",(e=>this._renderer.setRenderOccludedOverlay(e)))],"overlayManager"),this._renderer=new ye({overlayRenderer:this.overlayManager.renderer,ellipsoidRadius:j(this.view.spatialReference).radius,stage:this.view._stage,allTiles:this._allTiles}),this._handles.add([v(this,"baseOpacity",(e=>{this._handleLayerViewChanges(),this._updateBaseOpacity(e)}),!0),v(this,"_background",(()=>{this._handleLayerViewChanges(),this._renderer.setTileBackground(this._background)}),!0),this.view.watch("pointsOfInterest",(e=>{this._renderer.pointsOfInterest=e,this._watchUpdatingTracking.removeAll(),e&&this._watchUpdatingTracking.add((()=>e.focus.renderLocation),(()=>()=>this._allTilesSorted=!1))})),v(Y,"TERRAIN_TILE_TREE_SHOW_TILES",(e=>{e&&!this._treeDebugger?import("../layers/support/TerrainTileTree3DDebugger.js").then((({TerrainTileTree3DDebugger:e})=>{!this._treeDebugger&&Y.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new e({view:this.view}))})):e||(this._treeDebugger=d(this._treeDebugger))}))]),this._extentHelper=ie(this.viewingMode,{layers:this.view.map.allLayers,layerViews:this.view.allLayerViews,viewSpatialReference:this.view.spatialReference});const t=this.view.defaultsFromMap?new s({getCollections:()=>{var e,t,i;return null==(e=this.view)||null==(t=e.defaultsFromMap)||null==(i=t.mapCollections)?void 0:i.map((({layers:e})=>e))},getChildrenFunction:e=>e&&"layers"in e?e.layers:null}):this.view.map.allLayers,i=new Oe({layers:t,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:this.view.spatialReference});this._set("tilingSchemeLogic",i),this._updateTilingScheme(),this._elevationDataRequester=this.view.resourceController.createStreamDataRequester(K.ELEVATION),this._mapDataRequester=this.view.resourceController.createStreamDataRequester(K.BASEMAP);const r=this.view.resourceController.scheduler;this._frameTask=r.registerTask(Ne.TERRAIN_SURFACE,this),this.view.resourceController.memoryController.events.on("quality-changed",(()=>this._viewChangeUpdate())),this._handles.add([v(this._extentHelper,"stencilEnabledExtents",(e=>this._renderer.setStencilEnabledLayerExtents(e))),this.tilingSchemeLogic.watch("tilingScheme",(()=>this._updateTilingScheme()),!0),v(this,"extent",(()=>this._updateRootTiles())),this.view.on("resize",(()=>this._viewChangeUpdate())),this.view.watch("state.camera",(()=>this._viewChangeUpdate()),!0),this.view.watch("state.contentCamera",(()=>this.view.state.fixedContentCamera&&this._viewChangeUpdate()),!0),this.view.watch("qualitySettings.tiledSurface.lodBias",(()=>this._viewChangeUpdate())),v(this.view,"qualitySettings.tiledSurface.textureFadeDuration",(e=>this._renderer.textureFadingEnabled=e>0)),this.view.watch("lodSnapping",(()=>this._viewChangeUpdate())),f((()=>this._userClippingExtent),(()=>this._updateClippingExtent()),T)]),this._handles.add(this.view.allLayerViews.on("after-changes",(()=>this._layerViewsDirty=!0))),this._layerViewsDirty=!0,this._handleLayerViewChanges()}destroy(){this._frameTask.remove(),this._handles.destroy(),this._watchUpdatingTracking.destroy(),this._lercDecoder=h(this._lercDecoder),this._removeAllTiles(),this._upsampleMapCache=d(this._upsampleMapCache),this._elevationQueryCache=d(this._elevationQueryCache),this._set("tilingSchemeLogic",d(this.tilingSchemeLogic)),this._extentHelper=d(this._extentHelper),this._basemapLayerViewHandles.forEach(((e,t)=>this._unregisterTiledLayerView(t))),this._elevationDataRequester=null,this._mapDataRequester=null,this._set("overlayManager",d(this.overlayManager)),this._tilePool=d(this._tilePool),Re.prune(),this._treeDebugger&&(this._treeDebugger.destroy(),this._treeDebugger=null),this._renderer=d(this._renderer),this._iteratorPool=d(this._iteratorPool),this._set("view",null),this._upsampleInfoPool=d(this._upsampleInfoPool),W(),Ue()}get renderer(){return this._renderer}get frustum(){return this._frustum}get snapLevel(){var e,t;const i=null==(e=this.view.pointsOfInterest)||null==(t=e.contentCameraOnSurface)?void 0:t.scale;if(i){const e=this.view.state.contentCamera;let t=X(this.view,e.eye,e.viewForward,e.up).tilt;t>90&&(t=180-t);const r=2*(t/90)**2,s=z(this.view,i)-r;Math.abs(this._snapLevel-s)>We&&(Math.round(s)!==Math.round(this._snapLevel)&&(this._viewChanged=!0),this._snapLevel=s)}return Math.round(this._snapLevel)}get lodSnapping(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences?re.ON:re.OFF}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get mapTileRequester(){return this._mapDataRequester}get _userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(u(t)||u(e))return null;const i=M(),r=$(t,i,e)?i:null,s=this._get("extent");return b(r,s)?s:r}get extent(){const e=I(this.groundExtent,this._userClippingExtent,M()),t=this._get("extent");return b(e,t)?t:e}get groundExtent(){return p(this._tilingSchemeExtent)?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){var e;return null==(e=this.tilingSchemeLogic)?void 0:e.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),!!((this._watchUpdatingTracking.updating||this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||this._asyncWorkItems>0||!this._allTilesSorted||this._renderer.updating||this._layerViewsDirty)&&this.ready&&!this.suspended||this.overlayManager.updating||this._frameTask.updating)}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get viewingMode(){return this.view.state.viewingMode}get ready(){return p(this.rootTiles)}set renderOrder(e){this._renderer.renderOrder=e,this._set("renderOrder",e)}set skirtScale(e){this._renderer.skirtScale=e}get skirtScale(){return this._renderer.skirtScale}get spatialReference(){var e,t;return null!=(e=null==(t=this.tilingScheme)?void 0:t.spatialReference)?e:null}get _background(){return null!=this.backgroundColor?this.backgroundColor:this.backgroundImage}set slicePlaneEnabled(e){var t,i;this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),null==(t=this.view)||null==(i=t._stage)||i.renderView.setRenderParameters({opaqueTerrain:this.opaque})}set velvetOverground(e){e!==this.velvetOverground&&(this._renderer.velvetOverground=e),this._set("velvetOverground",e)}set visible(e){e!==this._visible&&(this._visible=e,this._renderer.setVisibility(e),this.suspended=!e)}get opaque(){return this._renderer.opaque}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}intersect(e,t,i,r){this._renderer.intersect(e,t,i,r)}getElevation(e,t,i,r){const s=this.getTileWithElevation(e,t,i,r,Je);return u(s)?null:ee(Je[0],Je[1],s.renderData.geometryState.samplerData)}getTileWithElevation(e,t,i,r,s=Je){var a;const n=this.rootTiles;if(u(n)||!n.length)return null;if(0===n[0].layerInfo[ae.ELEVATION].length)return null;if(s[0]=e,s[1]=t,s[2]=i,!R(s,r,s,null==(a=this.tilingScheme)?void 0:a.spatialReference))return Ge.error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;for(let l of n){if(!l.containsPoint(s))continue;for(;l&&!l.rendered&&!l.isLeaf;){let e=0;s[0]>.5*(l.extent[0]+l.extent[2])&&(e+=1),s[1]<.5*(l.extent[1]+l.extent[3])&&(e+=2),l=l.children[e]}const e=l.renderData;return(e?e.geometryState.samplerData:null)?l:null}return null}get elevationBounds(){return this._elevationBounds}getScale(e){if(this.tilingScheme){if(!U(e,Je,this.spatialReference))return Ge.error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;const t=this.rootTiles;if(p(t))for(let e of t)if(e.containsPoint(Je)){for(;null!=e.children[0];){let t=0;Je[0]>e.children[0].extent[2]&&(t+=1),Je[1]<e.children[0].extent[1]&&(t+=2),e=e.children[t]}return this._getLodBiasCorrectedScale(e.level)}}return 1e100}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!U(e,Je,this.spatialReference))return Ge.error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;Je[3]=t;let i=null;const r=e=>{if(e&&k(e.extent,Je))if(null!=e.children[0])for(const t of e.children)r(t);else{const t=this._getLodBiasCorrectedScale(e.level);i=null==i?t:Math.min(i,t)}},s=this.rootTiles;if(p(s))for(const a of s)r(a);return i}queryVisibleScaleRange(e,t,i,r){const s=t?this.tilingScheme.levelAtScale(t):0,a=i?this.tilingScheme.levelAtScale(i):1/0,n=this.lodBias;this._renderer.queryVisibleLevelRange(e,s+n,a+n,r)}_updateBaseOpacity(e){const t=this._renderer.opaque;this._renderer.opaque=e>=1,this._renderer.isTransparent=this._allTransparentSurfaceLayers();const i=t===this._renderer.opaque?se.UNFADED:se.IMMEDIATE;var r,s;i===se.IMMEDIATE&&(null==(r=this.view)||null==(s=r._stage)||s.renderView.setRenderParameters({opaqueTerrain:this.opaque}));this._updateTileTextures(i)}_updateTilingScheme(){const e=this.tilingSchemeLogic.tilingScheme;e!==this.tilingScheme&&(Te(!!e,"tiling scheme cannot be reset to undefined"),this.tilingScheme&&this._removeAllTiles(),this._set("tilingScheme",e),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.setTileSize(e.pixelSize),this.overlayManager.setSpatialReference(e.spatialReference),this._updateRootTiles()))}_acquireTile(e,t,i,r){const s=this._tilePool.acquire();return et[0]=e,et[1]=t,et[2]=i,s.init(et,r,this),s}_updateRootTiles(){const{extent:e,tilingScheme:t}=this;if(!t)return;const i=Ze;let s=t.rootTilesInExtent(e,i,5*pe);if(p(this.rootTiles)){if(s.length>pe)return void Ge.warn(ce);const e=this.rootTiles.map((e=>e.lij)),t=r(e,s,ze);if(t.removed.length>0||t.added.length>0){const e=this.rootTiles.filter((e=>!(t.removed.findIndex((t=>ze(t,e.lij)))>-1)||(this._purgeTile(e),!1)));t.added.forEach((t=>e.push(this._newRootTile(t)))),this._setRootTiles(e)}}else s.length>pe&&(Ge.warn(_e),s=t.rootTilesInExtent(e,i,pe)),this._setRootTiles(s.map((e=>this._newRootTile(e))));b(i,this._rootTilesExtent)||(this._rootTilesExtent=M(i)),this.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready")}_newRootTile(e){const t=this._acquireTile(0,e[1],e[2],null);return t.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.lodSnapping)===je.SPLIT&&t.setPendingUpdate(je.SPLIT),this._loadTile(t),t}_setRootTiles(e){if(this._set("rootTiles",e),this._allTiles.clear(),p(e)){const t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this.rootTiles),this._updateTilesVisibility(e)}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this._visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateSkirts(),this._updateTilesVisibility(this.rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.extent)&&e.resetPendingUpdate(je.GEOMETRY)&&this._updateTileGeometry(e)}_updateTilesVisibility(e){if(u(e))return;const t=Ie(e);let i=t?this._elevationBounds.min:1/0,r=t?this._elevationBounds.max:-1/0;const s=this.view.state.fixedContentCamera,a=this.extent,n=this._viewProjectionMatrix;this.setTileTreeDirty();const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const e=l.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(je.GEOMETRY)&&this._updateTileGeometry(e),e.setPendingUpdate(je.RENDERDATA);const t=e.computeVisibility();s||t?(e.updateScreenDepth(n),e.renderData&&(i=Math.min(e.elevationBounds[0],i),r=Math.max(e.elevationBounds[1],r))):l.skipSubtree()}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,isFinite(i)&&isFinite(r)&&(this._elevationBounds.min===i&&this._elevationBounds.max===r||(this._elevationBounds.min=i,this._elevationBounds.max=r,this.emit("elevation-bounds-change",null)))}_updateViewDependentParameters(){const e=this.view.state.camera,t=this.view.state.contentCamera,i=Math.tan(.5*t.fovX),r=Math.tan(.5*t.fovY),s=this.tilingScheme.pixelSize,a=2**-this.lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?(u(this._splitLimits.frustum)&&(this._splitLimits.frustum=q()),B(this._splitLimits.frustum,t.frustum)):this._splitLimits.frustum=null,B(this._frustum,e.frustum),x(this._viewProjectionMatrix,t.projectionMatrix,t.viewMatrix),D(this._eyePosRenderSR,t.eye),R(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateSkirts(){const e=this.view.state.camera,t=this.view.state.constraints.collision.enabled?0:1.11*e.near;this.skirtScale=ve(this,this._eyePosSurfaceSR,t)}_updateRenderData(e){e.rendered&&!e.shouldLoad&&(Ye(e)?this._loadChildren(e):$e(e)&&this._loadParent(e))}_updateTileGeometry(e){e.updateVisibility(),this._renderer.updateTileGeometry(e),this._elevationUpdate(e),this._usedMemory=Ke}_updateTileTexture(e,t){const i=e.resetPendingUpdate(je.TEXTURE_FADING)?je.TEXTURE_FADING:!!e.resetPendingUpdate(je.TEXTURE_NOFADING)&&je.TEXTURE_NOFADING;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=Ke,t.madeProgress())}_elevationUpdate(e){it.spatialReference=this.spatialReference,it.tile=e,it.extent=e.extent,this.emit("elevation-change",it),A(e.extent,this._eyePosSurfaceSR)&&this._updateSkirts()}get running(){return this.updating&&this.ready&&!this.suspended}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateTileStatus(e),this._sortTiles(e);const t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),e.run((()=>this._updateElevation(e))),e.run((()=>this._updateTextures(e))),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty(),e.done&&this.requestUpdate(),this.notifyChange("updatingProgressValue")}_updateTileStatus(e){if(!this._viewChanged||!this.rootTiles||e.done)return;this._viewChanged=!1;const t=this._iteratorPool.acquire();for(t.reset(this.rootTiles);!t.done;){const e=t.next();if(e.loadable){const i=e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.lodSnapping);if(i===je.SPLIT){e.resetPendingUpdate(je.MERGE),e.isLeaf&&(e.setPendingUpdate(je.SPLIT),t.skipSubtree());continue}e.resetPendingUpdate(je.SPLIT)&&e.updateAgentSuspension(),i===je.VSPLITMERGE&&e.updateAgents(ae.ELEVATION)}if(t.skipSubtree(),!e.isLeaf){e.setPendingUpdate(je.MERGE),e.resetPendingUpdate(je.SPLIT);const t=this._iteratorPool.acquire();t.resetOne(e);for(let e=t.next();!t.done;e=t.next())this._updateClippingStatus(e),e.updateVisibility(),e.loadable&&e.updateScreenDepth(this._viewProjectionMatrix);t.remove()}}t.remove(),this.requestUpdate(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||(Ae(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger&&this._treeDebugger.update(),e.madeProgress())}_mergeAndSplit(e,t){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=0;for(;!e.done;){let r=!1;i=0;const s=!this._allTiles.some((s=>{if(i+=s.usedMemory,s.resetPendingUpdate(je.MERGE)){if(!t)return s.setPendingUpdate(je.MERGE),e.done;this._mergeTile(s),r=!0,e.madeProgress()}else s.resetPendingUpdate(je.SPLIT)&&(this._splitTile(s),r=!0,e.madeProgress());return!e.done&&s.resetPendingUpdate(je.RENDERDATA)&&(this._updateRenderData(s),e.madeProgress()),e.done}));if(r&&(this._allTilesSorted=!1,this._allTilesDirty=!0),s){if(this._usedMemory=i,!r)break;this._updateTilesVisibility(this.rootTiles)}else this._allTilesDirty=!0}0===i&&(this._allTilesDirty=!0),this._sortTiles(e)}_updateElevation(e){return this._allTiles.some((t=>(t.resetPendingUpdate(je.GEOMETRY)&&(this._updateTileGeometry(t),this._updateTileTexture(t,e),e.madeProgress()),e.done))),e.hasProgressed}_updateTextures(e){return this._allTiles.some((t=>(this._updateTileTexture(t,e),e.done))),e.hasProgressed}_updateClippingExtent(){this.spatialReference&&(this.updateTileOverlayParams(qe.UPDATE),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get lodBias(){const e=this.view.resourceController.memoryController.memoryFactor;return this.view.qualitySettings.tiledSurface.lodBias-(1-e)*me}_getLodBiasCorrectedScale(e){const t=this.tilingScheme.levels,i=o(e-this.lodBias,0,t.length-1),r=i-Math.floor(i);return t[Math.floor(i)].scale*(1-r)+t[Math.ceil(i)].scale*r}_removeAllTiles(){p(this.rootTiles)&&(this.rootTiles.forEach((e=>this._purgeTile(e))),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this.visible=!1}_purgeChildTiles(e){if(e.isLeaf)return!1;let t=this._purgeTile(e.children[0]);return t=this._purgeTile(e.children[1])||t,t=this._purgeTile(e.children[2])||t,t=this._purgeTile(e.children[3])||t,e.unsetChildren(),t}_purgeTile(e){const t=this._purgeChildTiles(e)||e.rendered;return this._allTiles.removeUnordered(e),e.unload(this._renderer),this._tilePool.release(e),t}_splitTile(e){Te(e.isLeaf,"tile that is already split should not be split again!");const t=e.level+1,i=2*e.lij[1],r=2*e.lij[2];e.setChildren(this._createTile(t,i,r,e),this._createTile(t,i,r+1,e),this._createTile(t,i+1,r,e),this._createTile(t,i+1,r+1,e)),e.setPendingUpdate(je.RENDERDATA),e.updateAgentSuspension(),this._allTiles.pushArray(e.children),this._allTilesDirty=!0,this._emitTileScaleChange(e,t),++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){rt.spatialReference=this.spatialReference,rt.extent=e.extent,rt.scale=this._getLodBiasCorrectedScale(t),this.emit("scale-change",rt)}_createTile(e,t,i,r){Te(!!r,"_createTile sanity check");const s=this._acquireTile(e,t,i,r);return s.updateClippingStatus(this.extent),s.loadable&&(s.updateScreenDepth(this._viewProjectionMatrix),s.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.lodSnapping)===je.SPLIT&&s.setPendingUpdate(je.SPLIT)),s}_mergeTile(e){Te(!e.hasPendingUpdate(je.SPLIT),"_mergeTile sanity check"),this._purgeChildTiles(e)&&(Te(!e.renderData,"_mergeTile sanity check"),this._loadTile(e)),this._allTilesDirty=!0,++this._performanceInfo.numMerged,this._emitTileScaleChange(e)}_loadChildren(e){Te(e.rendered,"parent should be rendered"),e.unload(this._renderer),this._loadTile(e.children[0]),this._loadTile(e.children[1]),this._loadTile(e.children[2]),this._loadTile(e.children[3])}_loadParent(e){const t=e.parent;this._unloadChildren(t),this._loadTile(t)}_unloadChildren(e){e.isLeaf||(this._unloadChildren(e.children[0]),e.children[0].unload(this._renderer),this._unloadChildren(e.children[1]),e.children[1].unload(this._renderer),this._unloadChildren(e.children[2]),e.children[2].unload(this._renderer),this._unloadChildren(e.children[3]),e.children[3].unload(this._renderer))}_loadTile(e){e.load(this._renderer),e.setPendingUpdate(je.RENDERDATA),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager&&this.overlayManager.hasOverlays&&this.overlayManager.setTileParameters(e),this._elevationUpdate(e)}_elevationDataArrived(e,t,i){const r=new te(e.lij,e.extent,i);e.dataArrived(t,ae.ELEVATION,r);const s=[e],a=e.level,n=this._iteratorPool.acquire();for(n.reset(s);!n.done;){const e=n.next();e.findElevationBoundsForLayer(t,a),e.computeElevationBounds()}n.remove(),this._updateTilesVisibility(s)}_handleLayerViewChanges(e=Fe){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1;const i=new Set;let r=-1;for(const s of this.view.allLayerViews.items)if(i.add(s.uid),we(s))if(this._basemapLayerViewHandles.has(s.uid)){const e=this._layerClassFromLayerView(s),i=this._layerIndexByUid[e].get(s.uid);i<r&&(t=!0),r=i}else this._registerTiledLayerView(s),s.layer.loaded&&(t=!0);this._basemapLayerViewHandles.forEach(((e,r)=>{i.has(r)||(this._unregisterTiledLayerView(r),t=!0)})),t&&this._updateTiledLayers(),this._renderer.isTransparent=this._allTransparentSurfaceLayers(),e.madeProgress()}_allTransparentSurfaceLayers(){let e=0===this.view.map.ground.opacity;for(const t of this.view.allLayerViews.items)if(we(t)&&!Se(t)&&!H(t.layer)&&0!==t.fullOpacity)return e=!1,e;return e}_layerClassFromLayerView(e){return Se(e)?ae.ELEVATION:ae.MAP}_registerTiledLayerView(e){const t=[],i=this._layerClassFromLayerView(e);t.push(e.watch("suspended",(()=>this._updateTiledLayers()))),t.push(e.watch("fullOpacity",(()=>this._updateTileTextures(se.UNFADED)))),t.push(e.layer.watch("effectiveScaleRange",(()=>this._restartAllAgents(i)))),e.on("data-changed",(()=>{const t=this._layerIndexByUid[i].get(e.uid);null!=t&&this._invalidateLayerData(t,i)})),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){const t=this._basemapLayerViewHandles.get(e);if(t){for(let e=0;e<t.length;e++)t[e].remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,t=[[],[]];let i=null;const r=V();e.forEach((e=>{const s=e.layer;if(!s||e.suspended||!we(e))return;const a=e.fullExtent;if(!a)return void Ge.warn("Terrain: Map or elevation layer does not have fullExtent: "+s.id);if(!this.tilingScheme.compatibleWith(e.tileInfo))return void Ge.warn("Terrain: tiling scheme of layer "+s.id+" is incompatible with other tiled layers, will not be drawn");O(r,a,r);const n=this._layerClassFromLayerView(e);if(n===ae.MAP){const t=e.displayLevelRange;t.maxLevel!==1/0&&(null===i||t.maxLevel>i)&&(i=t.maxLevel)}t[n].push(e)}));for(const s of ne){const e=this._layerViews[s],i=t[s];i.reverse();const r=i.length;let a=e.length!==r;const n=new Array(r),l=new Array(e.length);this._layerIndexByUid[s].clear();for(let t=0;t<r;t++){const r=i[t].uid;this._layerIndexByUid[s].set(r,t);const o=e.indexOf(i[t]);n[t]=o,t!==o&&(a=!0),o>-1&&(l[o]=t)}if(a){const e=this._postorderIterator;for(e.reset(this.rootTiles);!e.done;)e.next().modifyLayers(l,n,s);this._layerViews[s]=i,this._restartAllAgents(s),this._updateTilesVisibility(this.rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&this._viewChangeUpdate()}_restartAllAgents(e){const t=this._postorderIterator;for(t.reset(this.rootTiles);!t.done;){const i=t.next();i.restartAgents(e),e===ae.ELEVATION&&i.computeElevationBounds()}}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll((t=>{t.updateAgents(ae.MAP),e===se.IMMEDIATE?this.renderer.updateTileTexture(t,je.TEXTURE_NOFADING):t.updateRenderData(ae.MAP,e)})),this._renderer.isTransparent=this._allTransparentSurfaceLayers()}_invalidateLayerData(e,t){this._allTiles.forAll((i=>i.removeLayerAgent(e,t))),this._allTiles.forAll((i=>i.invalidateLayerData(e,t)))}setTileTreeDirty(){this._allTilesDirty=!0}requestRender(e=qe.UPDATE){this.renderer.setNeedsRender(e)}requestUpdate(){1==++this._pendingUpdates&&(this._hasPendingUpdates=!0)}requestTileData(e,t,i,r){const s=this.layerViewByIndex(t,i),a=s.layer;return!a.tilemapCache||Le(s)?this._requestTileData(e,i,s,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.lij[0],e.lij[1],e.lij[2],{...r,timeout:6e3}).then((()=>--this._asyncWorkItems)).catch((t=>{throw--this._asyncWorkItems,m(t)||this._dataMissing(e,i,s,{notInTilemap:!0}),t})).then((()=>this._frameTask.schedule((()=>this._requestTileData(e,i,s,r)),r.signal))))}_requestTileData(e,t,i,r){return t===ae.ELEVATION?this._requestElevationTileData(e,i,r):this._requestMapTileData(e,i,r)}_requestElevationTileData(e,t,i){if(!Se(t))return void Te(!1,"_requestElevationTileData can only be called for elevation layer views");const r=r=>{if(--this._asyncWorkItems,g(i))return;const s=this._layerIndexByUid[ae.ELEVATION].get(t.uid);null!=s?(this._usedMemory=Ke,this.requestUpdate(),this._elevationDataArrived(e,s,r)):Ge.warn("TerrainSurface: received data from unknown layer %d %s",ae.ELEVATION,e.lij.toString())},s=i=>{--this._asyncWorkItems,m(i)||(this._dataMissing(e,ae.ELEVATION,t,i),this.requestUpdate())};if(++this._asyncWorkItems,xe(t.layer))return t.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],{noDataValue:ge,signal:i.signal}).then((e=>{if(g(i))return Ge.warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."),void s(y());this._frameTask.schedule((()=>r(e)),i.signal,s)}),s);const a=t.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);return this._elevationDataRequester.request(a,"binary",i).then((e=>this._lercDecoder.decode(e,{noDataValue:ge},i.signal))).then((e=>{r({values:e.pixelData,width:e.width,height:e.height,noDataValue:e.noDataValue,minValue:e.minValue,maxValue:e.maxValue})}),s)}_requestMapTileData(e,t,i){if(t instanceof Q)return Promise.reject();++this._asyncWorkItems;const r=(r,s)=>{--this._asyncWorkItems,Pe(s),g(i)||(this._dataMissing(e,ae.MAP,t,r),this.requestUpdate())},s=e=>t=>r(t,e),a=r=>this._frameTask.schedule((()=>{--this._asyncWorkItems,this.requestUpdate(),g(i)?Pe(r):this._mapTileDataArrived(e,t,r)}),i.signal,s(r)).catch(s(r)),n=(e,t=null)=>this._frameTask.schedule((()=>r(e,t)));if(Le(t)){const r=t.schemaHelper.getLevelRowColumn(e.lij);return t.fetchTile(r[0],r[1],r[2],i).then(a,n)}if(Ee(t))return t.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then(a,n);if(De(t)&&xe(t.layer))return t.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then((e=>{if(g(i))return Ge.warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."),void n(y());a(e)}),n);let l=t.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);N(t.layer)&&t.layer.refreshTimestamp&&(l+=`${l.includes("?")?"&":"?"}_ts=${t.layer.refreshTimestamp}`);const o=t.hasMixedImageFormats?"image+type":"image";return this._mapDataRequester.request(l,o,i).then(a,n)}_mapTileDataArrived(e,t,i){const r=this._layerIndexByUid[ae.MAP].get(t.uid);null!=r?e.dataArrived(r,ae.MAP,i):(Pe(i),Ge.warn("TerrainSurface: received data from unknown layer"))}_dataMissing(e,t,i,r){const s=this._layerIndexByUid[t].get(i.uid);null!=s?e.dataMissing(s,t,r):Ge.warn("TerrainSurface: received data from unknown layer")}updateTileOverlayParams(e){this.rootTiles&&this.overlayManager&&(this._allTiles.forAll((e=>{e.renderData&&this.overlayManager.setTileParameters(e)})),this._renderer.setNeedsRender(e))}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll((t=>{t.isLeaf&&e.numLeaves++;const i=t.level;t.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))})),e}getUsedMemory(){return this.tilingScheme?(this._usedMemory===Ke&&(this._usedMemory=0,this._allTiles.forAll((e=>this._usedMemory+=e.usedMemory))),this._usedMemory):0}getUsedMemoryForLayerView(e){let t=0;const i=this._layerClassFromLayerView(e),r=this._layerIndexByUid[i].get(e.uid);return this._allTiles.forAll((e=>t+=e.getUsedMemoryForLayer(i,r))),t}getTile(e){if(u(e)||u(this.rootTiles))return null;const t=e.split("/").map((e=>+e));if(0===t[0])return this.rootTiles.find((e=>e.lij[1]===t[1]&&e.lij[2]===t[2]));const i=2**t[0],r=Math.floor(t[1]/i),s=Math.floor(t[2]/i);let a;if(this.rootTiles.some((e=>e.lij[1]===r&&e.lij[2]===s&&(a=e,!0))),a){let e=1<<t[0]-1;for(;a.lij[0]<t[0];){let i=t[1]&e?2:0;if((t[2]&e)>0&&i++,!a.children[i])return null;a=a.children[i],e>>=1}return Te(a.lij[0]===t[0]&&a.lij[1]===t[1]&&a.lij[2]===t[2],"not the right tile?"),a}return null}get test(){const e=this;return{renderer:e._renderer,lercDecoder:e._lercDecoder,forceReload:()=>{p(e.rootTiles)&&(e._mergeTile(e.rootTiles[0]),e._viewChangeUpdate())},getTiles:()=>e._allTiles.toArray(),getRenderedTiles(){tt.clear(),e._allTiles.forAll((e=>{e.visible&&e.rendered&&tt.push(e)}));const t=tt.toArray();return Ve(e.renderOrder,t),t},lockTilingScheme(t,i){e._extentHelper.defaultTiledLayersExtent=i,e.tilingSchemeLogic.test.lockTilingScheme(t)}}}};e([S()],Qe.prototype,"_renderer",void 0),e([S()],Qe.prototype,"_hasPendingUpdates",void 0),e([S()],Qe.prototype,"_asyncWorkItems",void 0),e([S()],Qe.prototype,"_allTilesDirty",void 0),e([S()],Qe.prototype,"_allTilesSorted",void 0),e([S()],Qe.prototype,"_viewChanged",void 0),e([S({readOnly:!0})],Qe.prototype,"_watchUpdatingTracking",void 0),e([S()],Qe.prototype,"_frameTask",void 0),e([S({readOnly:!0})],Qe.prototype,"snapLevel",null),e([S({readOnly:!0})],Qe.prototype,"lodSnapping",null),e([S({constructOnly:!0})],Qe.prototype,"view",void 0),e([S()],Qe.prototype,"_userClippingExtent",null),e([S()],Qe.prototype,"_rootTilesExtent",void 0),e([S({readOnly:!0})],Qe.prototype,"extent",null),e([S({readOnly:!0})],Qe.prototype,"groundExtent",null),e([S({readOnly:!0})],Qe.prototype,"_tilingSchemeExtent",null),e([S({readOnly:!0})],Qe.prototype,"updating",null),e([S(J)],Qe.prototype,"updatingProgress",void 0),e([S({readOnly:!0})],Qe.prototype,"updatingProgressValue",null),e([S()],Qe.prototype,"_maxNumUpdating",void 0),e([S({aliasOf:"view.map.ground.opacity"})],Qe.prototype,"baseOpacity",void 0),e([S({readOnly:!0})],Qe.prototype,"overlayManager",void 0),e([S({readOnly:!0})],Qe.prototype,"viewingMode",null),e([S()],Qe.prototype,"maxTextureScale",void 0),e([S({readOnly:!0})],Qe.prototype,"ready",null),e([S({value:he.FRONT_TO_BACK})],Qe.prototype,"renderOrder",null),e([S({readOnly:!0})],Qe.prototype,"rootTiles",void 0),e([S({readOnly:!0})],Qe.prototype,"spatialReference",null),e([S()],Qe.prototype,"backgroundImage",void 0),e([S({type:t,aliasOf:"view.map.ground.surfaceColor"})],Qe.prototype,"backgroundColor",void 0),e([S()],Qe.prototype,"_background",null),e([S({value:!1})],Qe.prototype,"slicePlaneEnabled",null),e([S({readOnly:!0})],Qe.prototype,"tilingScheme",void 0),e([S({readOnly:!0,aliasOf:"tilingSchemeLogic.tilingSchemeLocked"})],Qe.prototype,"tilingSchemeLocked",void 0),e([S({readOnly:!0,aliasOf:"tilingSchemeLogic.tilingSchemeDone"})],Qe.prototype,"tilingSchemeDone",void 0),e([S({readOnly:!0})],Qe.prototype,"tilingSchemeLogic",void 0),e([S({value:!0})],Qe.prototype,"velvetOverground",null),e([w("_renderer.wireframe")],Qe.prototype,"wireframe",void 0),e([S({value:!1})],Qe.prototype,"suspended",null),e([S({readOnly:!0,aliasOf:"view.qualitySettings.tiledSurface.textureFadeDuration"})],Qe.prototype,"textureFadeDuration",void 0),e([S()],Qe.prototype,"_layerViewsDirty",void 0),e([w("_renderer.renderPatchBorders")],Qe.prototype,"renderPatchBorders",void 0),e([w("_renderer.renderingDisabled")],Qe.prototype,"renderingDisabled",void 0),Qe=e([L("esri.views.3d.terrain.TerrainSurface")],Qe);const Xe=Qe;function ze(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ye(e){return!e.isLeaf&&(e.children[0].shouldLoad||e.children[1].shouldLoad||e.children[2].shouldLoad||e.children[3].shouldLoad||Ye(e.children[0])||Ye(e.children[1])||Ye(e.children[2])||Ye(e.children[3]))}function $e(e){return e.isLeaf&&e.parent&&e.parent.shouldLoad}const Ke=-1,Je=C(),Ze=M(),et=[0,0,0],tt=new _,it={spatialReference:null,tile:null,extent:null,context:"ground"},rt={spatialReference:null,extent:null,scale:0};export{Xe 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{clamp as e}from"../../../core/mathUtils.js";import{isSome as t,abortMaybe as i,isNone as s}from"../../../core/maybe.js";import n from"../../../core/ObjectPool.js";import{c as r,s as a}from"../../../chunks/vec2.js";import{a as o}from"../../../chunks/vec2f64.js";import{f as h,p as l,d,a as u,b as p,l as c}from"../../../chunks/vec3.js";import{c as g,u as f}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/projectionEllipsoid.js";import{create as _,equals as y}from"../../../geometry/support/aaBoundingRect.js";import{c as A}from"../../../chunks/sphere.js";import{VectorTile as v}from"../../2d/engine/vectorTiles/VectorTile.js";import{ImageWithType as M}from"../support/StreamDataLoader.js";import{ElevationBounds as T}from"./ElevationBounds.js";import{ElevationTileAgent as I}from"./ElevationTileAgent.js";import{LODSnapping as L,TextureUpdate as E}from"./interfaces.js";import{LayerClass as D,LayerClasses as U}from"./LayerClass.js";import{MapTileAgent as j}from"./MapTileAgent.js";import{RasterTile as B}from"./RasterTile.js";import{MAX_PATCH_TESSELATION as O,getElevationDesiredResolutionLevel as C}from"./TerrainConst.js";import{weakAssert as N,getLayerWithExtentRange as S}from"./terrainUtils.js";import{TILE_AGENT_DONE as x}from"./TileAgent.js";import{TilePerLayerInfo as P}from"./TilePerLayerInfo.js";import R from"./TileTexture.js";import{TileUpdate as b}from"./TileUpdate.js";import{fallsWithinLayer as V}from"./tileUtils.js";import{getGpuMemoryUsage as q}from"../../webgl/Util.js";const w=g(),G=g(),F=g(),W=.1;class k{constructor(){this.fovX=0,this.fovY=0,this.relativeWidthLimit=0,this.relativeHeightLimit=0,this.maxLod=0,this.angledSplitBias=0,this.aboveGround=!0}}class X{constructor(){this.lij=[0,0,0],this._children=[null,null,null,null],this._pendingUpdates=0,this._dirty=!0,this._previouslyRendered=!1,this.extent=_(),this._elevationBounds=o(),this.layerInfo=[[],[]],this.extentInRadians=_(),this.centerAtSeaLevel=g(),this._center=[g(),A(),g()],this.up=f(),this._isWithinClippingArea=!0,this._intersectsClippingArea=!0,this._maxTesselation=0,this._usedMemory=J,this._mapTileMemory=0,this._mapDataRefCount=0,this._screenDepth=0,this.renderOrder=0,this._edgeLen=0,this._edgeLen2=0,this._curvatureHeight=0}static prune(){Y.prune(0),$.prune(0),P.prune()}get usedMemory(){return this._usedMemory===J&&this._updateMemoryUsed(),this._usedMemory+(this.isCached?0:this.mapTileMemory)}get cachedMemory(){return this.isCached?this.mapTileMemory:0}get mapTileMemory(){this._usedMemory===J&&this._updateMemoryUsed();let e=this._mapTileMemory;for(const{data:t}of this.layerInfo[D.MAP])t instanceof v&&(e+=t.memoryUsage);return e}get isCached(){return!this.shouldLoad&&this._mapDataRefCount<=0}get maxTesselation(){return this._maxTesselation}get isWithinClippingArea(){return this._isWithinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBounds(){return this._elevationBounds}get level(){return this.lij[0]}get key(){return`${this.lij[0]}/${this.lij[1]}/${this.lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[K.MIDDLE][3]}get screenDepth(){return this._screenDepth}get visible(){return this._dirty&&this.updateVisibilityNow(),this._visible}updateVisibilityNow(){this._dirty=!1;const e=this._intersectsClippingArea&&this._isVisible(this.surface.frustum);return e!==this._visible&&(this._visible=e,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setNeedsRender(),this.updateAgentSuspension()),this._visible}get loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const e=!!this.renderData;return e!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=e,this._surface.renderer.setNeedsRender()),e}get shouldLoad(){if(!this.loadable)return!1;if(this._surface.lodSnapping===L.ON){const e=this.level-this._surface.snapLevel;if(0===e)return!0;if(1===e)return!1}return this.isLeaf}init(e,t,i){this.lij[0]=e[0],this.lij[1]=e[1],this.lij[2]=e[2],this.ellipsoid=m(i.tilingScheme.spatialReference),i.tilingScheme.getExtent(e[0],e[1],e[2],this.extent),i.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians),this._isWithinClippingArea=!0,this._intersectsClippingArea=!0,this._clippingArea=null,this._mapDataRefCount=0,i.upsampleMapCache.pop(this.key),this._edgeLen=0,this._edgeLen2=0,this._center[K.MIDDLE][3]=0,this.vlevel=e?e[0]:0,t&&t.elevationBounds?r(this._elevationBounds,t.elevationBounds):a(this._elevationBounds,0,0),this._pendingUpdates=0,this.renderData=null,this._screenDepth=0,this._visible=!1,this._previouslyRendered=!1,this._parent=t,this.unsetChildren(),this._surface=i,this.updateVisibility();for(const s of U){const e=i.numLayers(s),t=this.layerInfo[s];for(const i of t)i.release();t.length=e;for(let i=0;i<e;i++)t[i]=P.acquire(this._surface.upsampleInfoPool),s===D.ELEVATION&&this.findElevationBoundsForLayer(i,-1)}this.computeElevationBounds(),this._maxTesselation=Math.min(i.tilingScheme.pixelSize,O)}release(){N(!this.renderData,"tile.renderData was not unloaded"),this._surface.upsampleMapCache.pop(this.key);for(const e of U){for(const t of this.layerInfo[e])t.release();this.layerInfo[e].length=0}this._parent=null,this._surface=null,this._usedMemory=J}refMapData(){++this._mapDataRefCount,this.isCached||this._surface.upsampleMapCache.pop(this.key)}unrefMapData(){if(--this._mapDataRefCount,this.isCached){const e=this.cachedMemory;e>0&&(this._surface.upsampleMapCache.put(this.key,this,e),this.setMemoryDirty())}}setMemoryDirty(){this._usedMemory=J}get cpuImageMemorySize(){const e=4,t=this._surface.tilingScheme.pixelSize;return t*t*e}_updateMemoryUsed(){this._usedMemory=0,this._mapTileMemory=0;const e=this.cpuImageMemorySize;for(const{data:t}of this.layerInfo[D.MAP])t instanceof R?this._mapTileMemory+=q(t.texture):t instanceof HTMLImageElement||t instanceof M?this._mapTileMemory+=e:t instanceof B&&(this._mapTileMemory+=t.memoryUsage);for(const t of this.layerInfo[D.ELEVATION])this._usedMemory+=t.data?e:0;this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._mapTileMemory+=q(this.renderData.textureDescriptor)),this.isCached&&this._surface.upsampleMapCache.updateSize(this.key,this,this.cachedMemory)}getUsedMemoryForLayer(e,t){const i=this.layerInfo[e][t];if(!i||!i.data)return 0;if(e!==D.MAP||this.isCached){if(e===D.ELEVATION)return this.cpuImageMemorySize}else{const e=i.data;if(e instanceof R)return q(e.texture);if(e instanceof HTMLImageElement||e instanceof M)return this.cpuImageMemorySize;if(e instanceof v||e instanceof B)return e.memoryUsage}return 0}updateScreenDepth(e){const t=this._center[K.MIDDLE],i=e,s=t[0],n=t[1],r=t[2],a=i[2]*s+i[6]*n+i[10]*r+i[14];this._screenDepth=a<0?0:a/(i[3]*s+i[7]*n+i[11]*r+i[15])}shouldSplit(e,i,s){if(t(e.frustum)&&(!this._intersectsClippingArea||!this._isVisible(e.frustum)))return b.NONE;const n=this.level;h(w,this._center[K.MIDDLE],i);let r=l(w),a=K.MIDDLE;h(G,this._center[K.TOP],i);const o=l(G);o<r&&(r=o,a=K.TOP),h(G,this._center[K.BOTTOM],i);const g=l(G);if(g<r&&(r=g,a=K.BOTTOM),this._edgeLen2>r&&n<e.maxLod)return b.SPLIT;const f=Math.sqrt(r),m=e.fovX*f*2,_=this._edgeLen/m,y=()=>{const t=n+Math.ceil(-Math.log2(e.relativeWidthLimit/_));return t!==this.vlevel?(this.vlevel=t,b.VSPLITMERGE):b.NONE_HIT_MAXLOD};if(s===L.ON){if(1===this._surface.snapLevel-n)return n>=e.maxLod?y():b.SPLIT}const A=d(this.up,w),v=this._elevationBounds[1]-this._elevationBounds[0],M=v/this.edgeLen;if(e.aboveGround&&A>0&&M<.001){if(A/f-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-M>0)return b.NONE}if(_<e.relativeWidthLimit)return this.vlevel!==this.level?(this.vlevel=this.level,b.VSPLITMERGE):b.NONE;if(n>=e.maxLod)return y();if(n>6){h(G,this._center[a],i),u(F,this.up,A),h(F,F,G);const t=l(F);if(t>this.radius*this.radius){u(F,F,this.radius/Math.sqrt(t)),p(F,F,this._center[a]),h(F,i,F);const s=Math.min(1,(Math.abs(d(F,this.up))+.5*v+this._curvatureHeight)/c(F)),n=W/e.angledSplitBias,r=e.fovY*f*2;if(s*(this._edgeLen/r)<n*e.relativeHeightLimit)return b.NONE}}return b.SPLIT}setChildren(e,t,i,s){N(!!(e&&t&&i&&s),"Null child passed"),this._children[0]=e,this._children[1]=t,this._children[2]=i,this._children[3]=s}unsetChildren(){this._children[0]=null,this._children[1]=null,this._children[2]=null,this._children[3]=null}load(e){this.refMapData();for(const t of U)this._createOrUpdateAgents(0,t);e.loadTile(this)}unload(e){e.unloadTile(this);for(const t of U){const e=this.layerInfo[t];for(const t of e)t.loadingAgent&&t.loadingAgent!==x&&(z(t.loadingAgent),t.loadingAgent=null),t.pendingUpdates=0}this.resetPendingUpdate(b.GEOMETRY),this.resetPendingUpdate(b.TEXTURE_NOFADING),this.resetPendingUpdate(b.TEXTURE_FADING),this.unrefMapData()}unloadMapData(){const e=this.layerInfo[D.MAP];for(const t of e)t.loadingAgent&&t.loadingAgent!==x&&(z(t.loadingAgent),t.loadingAgent=null),t.pendingUpdates=0;this.renderData&&this.renderData.releaseTexture(),this.setMemoryDirty()}updateClippingStatus(e){if(y(e,this._clippingArea))return!1;const i=this._intersectsClippingArea,s=this._isWithinClippingArea;t(e)?(this._intersectsClippingArea=this.intersectsExtent(e),this._isWithinClippingArea=this._isWithinExtent(e)):(this._intersectsClippingArea=!0,this._isWithinClippingArea=!0),this._clippingArea=e,this.updateVisibility();const n=s&&this._isWithinClippingArea,r=!(s||i||this._isWithinClippingArea||this._intersectsClippingArea);return!this.renderData||n||r||this.setPendingUpdate(b.GEOMETRY),!0}updateVisibility(){this._dirty=!0,this._surface.setTileTreeDirty()}getLayerInfo(e,t){return this.layerInfo[t][e]}hasLayerData(e,t){const i=this.layerInfo[t][e];return!(!i||!i.data||i.dataInvalidated)}get updating(){if(this.hasPendingUpdates)return!0;for(const e of U){const t=this.layerInfo[e];for(const e of t)if(e.loadingAgent&&e.loadingAgent!==x&&e.loadingAgent.updating)return!0}return!1}_isSuspended(e){return!!this.hasPendingUpdate(b.SPLIT)||e!==D.ELEVATION&&!this.loadable}get hasPendingUpdates(){return 0!==this._pendingUpdates}hasPendingUpdate(e){return(this._pendingUpdates&e)===e}setPendingUpdate(e){this._pendingUpdates|=e,e===b.SPLIT||e===b.MERGE?this._surface.setTileTreeDirty():this._surface.requestUpdate()}resetPendingUpdate(e){return!!this.hasPendingUpdate(e)&&(this._pendingUpdates&=~e,!0)}requestLayerData(e,t,s){const n=this.layerInfo[t][e];if(n.waitingAgents.has(s))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this.lij.toString(),s.tile.lij.toString(),t,e),!0;if(n.waitingAgents.push(s),n.data&&!n.dataInvalidated)return console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",this.lij.toString(),s.tile.lij.toString(),t,e),s.dataArrived(this),!0;if(n.requestPromise)return!0;i(n.requestAbort),n.requestAbort=new AbortController;const r=this._surface.requestTileData(this,e,t,n.requestAbort);if(!r)return n.requestAbort=null,!1;const a=()=>{n.requestPromise===r&&(n.requestPromise=null,n.requestAbort=null)};return n.requestPromise=r,r.then(a,a),!0}get isLeaf(){return null==this._children[0]}hasLij(e){return this.lij[0]===e[0]&&this.lij[1]===e[1]&&this.lij[2]===e[2]}findByLij(e){if(this.hasLij(e))return this;if(this.isLeaf)return null;const t=this._children[0].findByLij(e)||this._children[1].findByLij(e)||this._children[2].findByLij(e)||this._children[3].findByLij(e);return t||null}distanceToSquared(e){return l(h(F,this._center[K.MIDDLE],e))}containsPoint(e){const t=this.extent;return e[0]>=t[0]&&e[1]>=t[1]&&e[0]<=t[2]&&e[1]<=t[3]}unrequestLayerData(e,t,i){const s=this.layerInfo[t][e],n=s.waitingAgents,r=null!=n.removeUnordered(i);N(r,"agent has not requested this piece of map data"),n.length<1&&(s.abortRequest(),this._updateMemoryUsed())}dataArrived(e,t,i){const s=this.layerInfo[t][e];s.data=i,s.dataInvalidated=!1,s.waitingAgents.forAll((e=>e.dataArrived(this))),s.waitingAgents.clear(),this._updateMemoryUsed()}dataMissing(e,t,i){i.notInTilemap||console.error(`Tile ${this.lij.toString()} layer ${t}/${e} error ${i}`);const s=this.layerInfo[t][e];s.dataMissing=!0,s.waitingAgents.forAll((e=>e.dataMissing())),s.waitingAgents.clear(),this._updateMemoryUsed()}updateRenderData(e,t){switch(e){case D.MAP:return this._updateTexture(t);case D.ELEVATION:return this._updateGeometry()}}_updateTexture(e){this.renderData&&(this.resetPendingUpdate(e===E.FADING?b.TEXTURE_NOFADING:b.TEXTURE_FADING),this.setPendingUpdate(e===E.FADING?b.TEXTURE_FADING:b.TEXTURE_NOFADING))}_updateGeometry(){this.setPendingUpdate(b.GEOMETRY);for(const e of this.layerInfo[D.ELEVATION])e.pendingUpdates|=b.GEOMETRY}invalidateLayerData(e,t){this.layerInfo[t][e].invalidateSourceData(),this.restartAgents(t)}computeElevationBounds(){a(this._elevationBounds,Number.MAX_VALUE,-Number.MAX_VALUE);const e=this.layerInfo[D.ELEVATION];let i=!0;for(const s of e)t(s.elevationBounds)&&(this._elevationBounds[0]=Math.min(this._elevationBounds[0],s.elevationBounds.min),this._elevationBounds[1]=Math.max(this._elevationBounds[1],s.elevationBounds.max),s.elevationBounds.hasNoDataValues||(i=!1));i&&(this._elevationBounds[0]=Math.min(this._elevationBounds[0],0),this._elevationBounds[1]=Math.max(this._elevationBounds[1],0)),this.updateRadiusAndCenter(),this._surface.setTileTreeDirty()}_updateCenter(){const e=.5*(this._elevationBounds[0]+this._elevationBounds[1]);u(F,this.up,e),p(this._center[K.MIDDLE],this.centerAtSeaLevel,F),u(F,this.up,this._elevationBounds[0]),p(this._center[K.TOP],this.centerAtSeaLevel,F),u(F,this.up,this._elevationBounds[1]),p(this._center[K.BOTTOM],this.centerAtSeaLevel,F)}findElevationBoundsForLayer(e,i){const n=this.layerInfo[D.ELEVATION][e];if(t(n.elevationBounds)&&n.elevationBounds.level>=i)return;const r=this._surface.layerViewByIndex(e,D.ELEVATION),a=S(r);if(!V(this,a,!1))return;const o=Q;let h=!1;if(n.data){const e=n.data;o.min=e.bounds[0],o.max=e.bounds[1],o.hasNoDataValues=e.hasNoDataValues,o.level=this.lij[0],h=!0}else{let t,i,s=0;for(let n=this._parent;n&&(!i||s<C(this.level))&&(s=this.vlevel-n.level,t=i||t,i=n.layerInfo[D.ELEVATION][e].data,!(!i&&t&&s>=C(this.level)));n=n.parent);i=i||t,i&&(i.computeMinMaxValue(this.lij[0],this.lij[1],this.lij[2],o),o.min!==1/0&&(o.level=i.level,h=!0))}h&&(s(n.elevationBounds)&&(n.elevationBounds=new T),n.elevationBounds.copyFrom(o))}modifyLayers(e,t,i){const s=this.layerInfo[i];for(const a of s)a.loadingAgent&&a.loadingAgent!==x&&(z(a.loadingAgent),a.loadingAgent=null),a.waitingAgents.clear();for(let a=0;a<s.length;++a)void 0===e[a]&&s[a].release();const n=new Array(...s),r=t.length;s.length=r;for(let a=0;a<r;a++){const e=t[a];s[a]=e>-1?n[e]:P.acquire(this._surface.upsampleInfoPool)}this._updateMemoryUsed()}restartAgents(e){this.renderData&&(this._createOrUpdateAgents(0,e),this.updateRenderData(e,E.FADING))}updateAgents(e){if(this.renderData){const t=this.layerInfo[e];for(const e of t)e.loadingAgent===x&&(e.loadingAgent=null);this._createOrUpdateAgents(0,e)}}updateAgentSuspension(){for(const e of U){const t=this._isSuspended(e);for(const i of this.layerInfo[e])i.loadingAgent&&i.loadingAgent!==x&&(i.loadingAgent.setSuspension(t),i.loadingAgent===x&&this.updateRenderData(e,E.FADING))}}removeLayerAgent(e,t){const i=this.layerInfo[t][e];i.loadingAgent&&i.loadingAgent!==x&&i.loadingAgent.dispose(),i.loadingAgent=null}agentDone(e,t){const i=this.layerInfo[t][e];i.loadingAgent=x,i.data||i.upsampleInfo||this._createOrUpdateAgents(e+1,t)}_createOrUpdateAgents(e,t){const i=this._isSuspended(t),s=this.layerInfo[t];for(let n=e;n<s.length;++n){const e=s[n];let r=!1;const a=this._surface.layerViewByIndex(n,t),o=S(a);if(e.loadingAgent?V(this,o,!1)?(e.loadingAgent!==x&&e.loadingAgent.setSuspension(i),e.loadingAgent!==x&&(r=e.loadingAgent.update())):e.dispose():V(this,o,!1)&&(e.loadingAgent=H(this,n,t,i),r=e.loadingAgent.startLoading(),r?e.loadingAgent===x&&this.setPendingUpdate(b.GEOMETRY):(z(e.loadingAgent),e.loadingAgent=x)),e.loadingAgent===x&&this.updateRenderData(t,E.FADING),r&&a.isOpaque)return}}_isWithinExtent(e){const t=this.extent;return t[0]>=e[0]&&e[2]>=t[2]&&t[1]>=e[1]&&e[3]>=t[3]}intersectsExtent(e){const t=this.extent;return t[2]>=e[0]&&e[2]>=t[0]&&t[3]>=e[1]&&e[3]>=t[1]}getElevationBasedVerticesPerRow(t){const i=this.vlevel-this.level,s=Math.max(this.level-t,C(this.level)-i);return e(1+(this.maxTesselation>>s),2,this.maxTesselation+1)}get test(){return{cachedMemory:this.cachedMemory}}}function H(e,t,i,s){const n=i===D.ELEVATION?$.acquire():Y.acquire();return n.init(e,t,i,s),n}function z(e){e.dispose(),e instanceof I?$.release(e):e instanceof j&&Y.release(e)}const Y=new n(j),$=new n(I),Q=new T,J=-1;var K;!function(e){e[e.TOP=0]="TOP",e[e.MIDDLE=1]="MIDDLE",e[e.BOTTOM=2]="BOTTOM"}(K||(K={}));export{K as CenterPosition,k as SplitLimits,X as Tile};
5
+ import{clamp as e}from"../../../core/mathUtils.js";import{isSome as t,abortMaybe as i,isNone as s}from"../../../core/maybe.js";import n from"../../../core/ObjectPool.js";import{c as r,s as a}from"../../../chunks/vec2.js";import{a as o}from"../../../chunks/vec2f64.js";import{f as h,p as l,d,a as u,b as c,l as p}from"../../../chunks/vec3.js";import{c as g,u as f}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/projectionEllipsoid.js";import{create as _,equals as y}from"../../../geometry/support/aaBoundingRect.js";import{c as A}from"../../../chunks/sphere.js";import{VectorTile as v}from"../../2d/engine/vectorTiles/VectorTile.js";import{ImageWithType as M}from"../support/StreamDataLoader.js";import{ElevationBounds as T}from"./ElevationBounds.js";import{ElevationTileAgent as I}from"./ElevationTileAgent.js";import{LODSnapping as L,TextureUpdate as E}from"./interfaces.js";import{LayerClass as D,LayerClasses as U}from"./LayerClass.js";import{MapTileAgent as j}from"./MapTileAgent.js";import{RasterTile as B}from"./RasterTile.js";import{MAX_PATCH_TESSELATION as O,getElevationDesiredResolutionLevel as C}from"./TerrainConst.js";import{weakAssert as N,getLayerWithExtentRange as S}from"./terrainUtils.js";import{TILE_AGENT_DONE as x}from"./TileAgent.js";import{TilePerLayerInfo as P}from"./TilePerLayerInfo.js";import R from"./TileTexture.js";import{TileUpdate as b}from"./TileUpdate.js";import{fallsWithinLayer as V}from"./tileUtils.js";import{getGpuMemoryUsage as q}from"../../webgl/Util.js";const G=g(),w=g(),F=g(),W=.1;class k{constructor(){this.fovX=0,this.fovY=0,this.relativeWidthLimit=0,this.relativeHeightLimit=0,this.maxLod=0,this.angledSplitBias=0,this.aboveGround=!0}}class X{constructor(){this.lij=[0,0,0],this._children=[null,null,null,null],this._pendingUpdates=0,this._dirty=!0,this._previouslyRendered=!1,this.extent=_(),this._elevationBounds=o(),this.layerInfo=[[],[]],this.extentInRadians=_(),this.centerAtSeaLevel=g(),this._center=[g(),A(),g()],this.up=f(),this._isWithinClippingArea=!0,this._intersectsClippingArea=!0,this._maxTesselation=0,this._usedMemory=J,this._mapTileMemory=0,this._mapDataRefCount=0,this._screenDepth=0,this.renderOrder=0,this._edgeLen=0,this._edgeLen2=0,this._curvatureHeight=0}static prune(){Y.prune(0),$.prune(0),P.prune()}get usedMemory(){return this._usedMemory===J&&this._updateMemoryUsed(),this._usedMemory+(this.isCached?0:this.mapTileMemory)}get cachedMemory(){return this.isCached?this.mapTileMemory:0}get mapTileMemory(){this._usedMemory===J&&this._updateMemoryUsed();let e=this._mapTileMemory;for(const{data:t}of this.layerInfo[D.MAP])t instanceof v&&(e+=t.memoryUsage);return e}get isCached(){return!this.shouldLoad&&this._mapDataRefCount<=0}get maxTesselation(){return this._maxTesselation}get isWithinClippingArea(){return this._isWithinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBounds(){return this._elevationBounds}get level(){return this.lij[0]}get key(){return`${this.lij[0]}/${this.lij[1]}/${this.lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[K.MIDDLE][3]}get screenDepth(){return this._screenDepth}get visible(){return this._dirty&&this.computeVisibility(),this._visible}computeVisibility(){this._dirty=!1;const e=this._intersectsClippingArea&&this._isVisible(this.surface.frustum);return e!==this._visible&&(this._visible=e,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setNeedsRender(),this.updateAgentSuspension()),this._visible}get loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const e=!!this.renderData;return e!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=e,this._surface.renderer.setNeedsRender()),e}get shouldLoad(){if(!this.loadable)return!1;if(this._surface.lodSnapping===L.ON){const e=this.level-this._surface.snapLevel;if(0===e)return!0;if(1===e)return!1}return this.isLeaf}init(e,t,i){this.lij[0]=e[0],this.lij[1]=e[1],this.lij[2]=e[2],this.ellipsoid=m(i.tilingScheme.spatialReference),i.tilingScheme.getExtent(e[0],e[1],e[2],this.extent),i.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians),this._isWithinClippingArea=!0,this._intersectsClippingArea=!0,this._clippingArea=null,this._mapDataRefCount=0,i.upsampleMapCache.pop(this.key),this._edgeLen=0,this._edgeLen2=0,this._center[K.MIDDLE][3]=0,this.vlevel=e?e[0]:0,t&&t.elevationBounds?r(this._elevationBounds,t.elevationBounds):a(this._elevationBounds,0,0),this._pendingUpdates=0,this.renderData=null,this._screenDepth=0,this._visible=!1,this._previouslyRendered=!1,this._parent=t,this.unsetChildren(),this._surface=i,this.updateVisibility();for(const s of U){const e=i.numLayers(s),t=this.layerInfo[s];for(const i of t)i.release();t.length=e;for(let i=0;i<e;i++)t[i]=P.acquire(this._surface.upsampleInfoPool),s===D.ELEVATION&&this.findElevationBoundsForLayer(i,-1)}this.computeElevationBounds(),this._maxTesselation=Math.min(i.tilingScheme.pixelSize,O)}release(){N(!this.renderData,"tile.renderData was not unloaded"),this._surface.upsampleMapCache.pop(this.key);for(const e of U){for(const t of this.layerInfo[e])t.release();this.layerInfo[e].length=0}this._parent=null,this._surface=null,this._usedMemory=J}refMapData(){++this._mapDataRefCount,this.isCached||this._surface.upsampleMapCache.pop(this.key)}unrefMapData(){if(--this._mapDataRefCount,this.isCached){const e=this.cachedMemory;e>0&&(this._surface.upsampleMapCache.put(this.key,this,e),this.setMemoryDirty())}}setMemoryDirty(){this._usedMemory=J}get cpuImageMemorySize(){const e=4,t=this._surface.tilingScheme.pixelSize;return t*t*e}_updateMemoryUsed(){this._usedMemory=0,this._mapTileMemory=0;const e=this.cpuImageMemorySize;for(const{data:t}of this.layerInfo[D.MAP])t instanceof R?this._mapTileMemory+=q(t.texture):t instanceof HTMLImageElement||t instanceof M?this._mapTileMemory+=e:t instanceof B&&(this._mapTileMemory+=t.memoryUsage);for(const t of this.layerInfo[D.ELEVATION])this._usedMemory+=t.data?e:0;this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._mapTileMemory+=q(this.renderData.textureDescriptor)),this.isCached&&this._surface.upsampleMapCache.updateSize(this.key,this,this.cachedMemory)}getUsedMemoryForLayer(e,t){const i=this.layerInfo[e][t];if(!i||!i.data)return 0;if(e!==D.MAP||this.isCached){if(e===D.ELEVATION)return this.cpuImageMemorySize}else{const e=i.data;if(e instanceof R)return q(e.texture);if(e instanceof HTMLImageElement||e instanceof M)return this.cpuImageMemorySize;if(e instanceof v||e instanceof B)return e.memoryUsage}return 0}updateScreenDepth(e){const t=this._center[K.MIDDLE],i=e,s=t[0],n=t[1],r=t[2],a=i[2]*s+i[6]*n+i[10]*r+i[14];this._screenDepth=a<0?0:a/(i[3]*s+i[7]*n+i[11]*r+i[15])}shouldSplit(e,i,s){if(t(e.frustum)&&(!this._intersectsClippingArea||!this._isVisible(e.frustum)))return b.NONE;const n=this.level;h(G,this._center[K.MIDDLE],i);let r=l(G),a=K.MIDDLE;h(w,this._center[K.TOP],i);const o=l(w);o<r&&(r=o,a=K.TOP),h(w,this._center[K.BOTTOM],i);const g=l(w);if(g<r&&(r=g,a=K.BOTTOM),this._edgeLen2>r&&n<e.maxLod)return b.SPLIT;const f=Math.sqrt(r),m=e.fovX*f*2,_=this._edgeLen/m,y=()=>{const t=n+Math.ceil(-Math.log2(e.relativeWidthLimit/_));return t!==this.vlevel?(this.vlevel=t,b.VSPLITMERGE):b.NONE_HIT_MAXLOD};if(s===L.ON){if(1===this._surface.snapLevel-n)return n>=e.maxLod?y():b.SPLIT}const A=d(this.up,G),v=this._elevationBounds[1]-this._elevationBounds[0],M=v/this.edgeLen;if(e.aboveGround&&A>0&&M<.001){if(A/f-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-M>0)return b.NONE}if(_<e.relativeWidthLimit)return this.vlevel!==this.level?(this.vlevel=this.level,b.VSPLITMERGE):b.NONE;if(n>=e.maxLod)return y();if(n>6){h(w,this._center[a],i),u(F,this.up,A),h(F,F,w);const t=l(F);if(t>this.radius*this.radius){u(F,F,this.radius/Math.sqrt(t)),c(F,F,this._center[a]),h(F,i,F);const s=Math.min(1,(Math.abs(d(F,this.up))+.5*v+this._curvatureHeight)/p(F)),n=W/e.angledSplitBias,r=e.fovY*f*2;if(s*(this._edgeLen/r)<n*e.relativeHeightLimit)return b.NONE}}return b.SPLIT}setChildren(e,t,i,s){N(!!(e&&t&&i&&s),"Null child passed"),this._children[0]=e,this._children[1]=t,this._children[2]=i,this._children[3]=s}unsetChildren(){this._children[0]=null,this._children[1]=null,this._children[2]=null,this._children[3]=null}load(e){this.refMapData();for(const t of U)this._createOrUpdateAgents(0,t);e.loadTile(this)}unload(e){e.unloadTile(this);for(const t of U){const e=this.layerInfo[t];for(const t of e)t.loadingAgent&&t.loadingAgent!==x&&(z(t.loadingAgent),t.loadingAgent=null),t.pendingUpdates=0}this.resetPendingUpdate(b.GEOMETRY),this.resetPendingUpdate(b.TEXTURE_NOFADING),this.resetPendingUpdate(b.TEXTURE_FADING),this.unrefMapData()}unloadMapData(){const e=this.layerInfo[D.MAP];for(const t of e)t.loadingAgent&&t.loadingAgent!==x&&(z(t.loadingAgent),t.loadingAgent=null),t.pendingUpdates=0;this.renderData&&this.renderData.releaseTexture(),this.setMemoryDirty()}updateClippingStatus(e){if(y(e,this._clippingArea))return!1;const i=this._intersectsClippingArea,s=this._isWithinClippingArea;t(e)?(this._intersectsClippingArea=this.intersectsExtent(e),this._isWithinClippingArea=this._isWithinExtent(e)):(this._intersectsClippingArea=!0,this._isWithinClippingArea=!0),this._clippingArea=e,this.updateVisibility();const n=s&&this._isWithinClippingArea,r=!(s||i||this._isWithinClippingArea||this._intersectsClippingArea);return!this.renderData||n||r||this.setPendingUpdate(b.GEOMETRY),!0}updateVisibility(){this._dirty=!0,this._surface.setTileTreeDirty()}getLayerInfo(e,t){return this.layerInfo[t][e]}hasLayerData(e,t){const i=this.layerInfo[t][e];return!(!i||!i.data||i.dataInvalidated)}get updating(){if(this.hasPendingUpdates)return!0;for(const e of U){const t=this.layerInfo[e];for(const e of t)if(e.loadingAgent&&e.loadingAgent!==x&&e.loadingAgent.updating)return!0}return!1}_isSuspended(e){return!!this.hasPendingUpdate(b.SPLIT)||e!==D.ELEVATION&&!this.loadable}get hasPendingUpdates(){return 0!==this._pendingUpdates}hasPendingUpdate(e){return(this._pendingUpdates&e)===e}setPendingUpdate(e){this._pendingUpdates|=e,e===b.SPLIT||e===b.MERGE?this._surface.setTileTreeDirty():this._surface.requestUpdate()}resetPendingUpdate(e){return!!this.hasPendingUpdate(e)&&(this._pendingUpdates&=~e,!0)}requestLayerData(e,t,s){const n=this.layerInfo[t][e];if(n.waitingAgents.has(s))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this.lij.toString(),s.tile.lij.toString(),t,e),!0;if(n.waitingAgents.push(s),n.data&&!n.dataInvalidated)return console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",this.lij.toString(),s.tile.lij.toString(),t,e),s.dataArrived(this),!0;if(n.requestPromise)return!0;i(n.requestAbort),n.requestAbort=new AbortController;const r=this._surface.requestTileData(this,e,t,n.requestAbort);if(!r)return n.requestAbort=null,!1;const a=()=>{n.requestPromise===r&&(n.requestPromise=null,n.requestAbort=null)};return n.requestPromise=r,r.then(a,a),!0}get isLeaf(){return null==this._children[0]}hasLij(e){return this.lij[0]===e[0]&&this.lij[1]===e[1]&&this.lij[2]===e[2]}findByLij(e){if(this.hasLij(e))return this;if(this.isLeaf)return null;const t=this._children[0].findByLij(e)||this._children[1].findByLij(e)||this._children[2].findByLij(e)||this._children[3].findByLij(e);return t||null}distanceToSquared(e){return l(h(F,this._center[K.MIDDLE],e))}containsPoint(e){const t=this.extent;return e[0]>=t[0]&&e[1]>=t[1]&&e[0]<=t[2]&&e[1]<=t[3]}unrequestLayerData(e,t,i){const s=this.layerInfo[t][e],n=s.waitingAgents,r=null!=n.removeUnordered(i);N(r,"agent has not requested this piece of map data"),n.length<1&&(s.abortRequest(),this._updateMemoryUsed())}dataArrived(e,t,i){const s=this.layerInfo[t][e];s.data=i,s.dataInvalidated=!1,s.waitingAgents.forAll((e=>e.dataArrived(this))),s.waitingAgents.clear(),this._updateMemoryUsed()}dataMissing(e,t,i){i.notInTilemap||console.error(`Tile ${this.lij.toString()} layer ${t}/${e} error ${i}`);const s=this.layerInfo[t][e];s.dataMissing=!0,s.waitingAgents.forAll((e=>e.dataMissing())),s.waitingAgents.clear(),this._updateMemoryUsed()}updateRenderData(e,t){switch(e){case D.MAP:return this._updateTexture(t);case D.ELEVATION:return this._updateGeometry()}}_updateTexture(e){this.renderData&&(this.resetPendingUpdate(e===E.FADING?b.TEXTURE_NOFADING:b.TEXTURE_FADING),this.setPendingUpdate(e===E.FADING?b.TEXTURE_FADING:b.TEXTURE_NOFADING))}_updateGeometry(){this.setPendingUpdate(b.GEOMETRY);for(const e of this.layerInfo[D.ELEVATION])e.pendingUpdates|=b.GEOMETRY}invalidateLayerData(e,t){this.layerInfo[t][e].invalidateSourceData(),this.restartAgents(t)}computeElevationBounds(){a(this._elevationBounds,Number.MAX_VALUE,-Number.MAX_VALUE);const e=this.layerInfo[D.ELEVATION];let i=!0;for(const s of e)t(s.elevationBounds)&&(this._elevationBounds[0]=Math.min(this._elevationBounds[0],s.elevationBounds.min),this._elevationBounds[1]=Math.max(this._elevationBounds[1],s.elevationBounds.max),s.elevationBounds.hasNoDataValues||(i=!1));i&&(this._elevationBounds[0]=Math.min(this._elevationBounds[0],0),this._elevationBounds[1]=Math.max(this._elevationBounds[1],0)),this.updateRadiusAndCenter(),this._surface.setTileTreeDirty()}_updateCenter(){const e=.5*(this._elevationBounds[0]+this._elevationBounds[1]);u(F,this.up,e),c(this._center[K.MIDDLE],this.centerAtSeaLevel,F),u(F,this.up,this._elevationBounds[0]),c(this._center[K.TOP],this.centerAtSeaLevel,F),u(F,this.up,this._elevationBounds[1]),c(this._center[K.BOTTOM],this.centerAtSeaLevel,F)}findElevationBoundsForLayer(e,i){const n=this.layerInfo[D.ELEVATION][e];if(t(n.elevationBounds)&&n.elevationBounds.level>=i)return;const r=this._surface.layerViewByIndex(e,D.ELEVATION),a=S(r);if(!V(this,a,!1))return;const o=Q;let h=!1;if(n.data){const e=n.data;o.min=e.bounds[0],o.max=e.bounds[1],o.hasNoDataValues=e.hasNoDataValues,o.level=this.lij[0],h=!0}else{let t,i,s=0;for(let n=this._parent;n&&(!i||s<C(this.level))&&(s=this.vlevel-n.level,t=i||t,i=n.layerInfo[D.ELEVATION][e].data,!(!i&&t&&s>=C(this.level)));n=n.parent);i=i||t,i&&(i.computeMinMaxValue(this.lij[0],this.lij[1],this.lij[2],o),o.min!==1/0&&(o.level=i.level,h=!0))}h&&(s(n.elevationBounds)&&(n.elevationBounds=new T),n.elevationBounds.copyFrom(o))}modifyLayers(e,t,i){const s=this.layerInfo[i];for(const a of s)a.loadingAgent&&a.loadingAgent!==x&&(z(a.loadingAgent),a.loadingAgent=null),a.waitingAgents.clear();for(let a=0;a<s.length;++a)void 0===e[a]&&s[a].release();const n=new Array(...s),r=t.length;s.length=r;for(let a=0;a<r;a++){const e=t[a];s[a]=e>-1?n[e]:P.acquire(this._surface.upsampleInfoPool)}this._updateMemoryUsed()}restartAgents(e){this.renderData&&(this._createOrUpdateAgents(0,e),this.updateRenderData(e,E.FADING))}updateAgents(e){if(this.renderData){const t=this.layerInfo[e];for(const e of t)e.loadingAgent===x&&(e.loadingAgent=null);this._createOrUpdateAgents(0,e)}}updateAgentSuspension(){for(const e of U){const t=this._isSuspended(e);for(const i of this.layerInfo[e])i.loadingAgent&&i.loadingAgent!==x&&(i.loadingAgent.setSuspension(t),i.loadingAgent===x&&this.updateRenderData(e,E.FADING))}}removeLayerAgent(e,t){const i=this.layerInfo[t][e];i.loadingAgent&&i.loadingAgent!==x&&i.loadingAgent.dispose(),i.loadingAgent=null}agentDone(e,t){const i=this.layerInfo[t][e];i.loadingAgent=x,i.data||i.upsampleInfo||this._createOrUpdateAgents(e+1,t)}_createOrUpdateAgents(e,t){const i=this._isSuspended(t),s=this.layerInfo[t];for(let n=e;n<s.length;++n){const e=s[n];let r=!1;const a=this._surface.layerViewByIndex(n,t),o=S(a);if(e.loadingAgent?V(this,o,!1)?(e.loadingAgent!==x&&e.loadingAgent.setSuspension(i),e.loadingAgent!==x&&(r=e.loadingAgent.update())):e.dispose():V(this,o,!1)&&(e.loadingAgent=H(this,n,t,i),r=e.loadingAgent.startLoading(),r?e.loadingAgent===x&&this.setPendingUpdate(b.GEOMETRY):(z(e.loadingAgent),e.loadingAgent=x)),e.loadingAgent===x&&this.updateRenderData(t,E.FADING),r&&a.isOpaque)return}}_isWithinExtent(e){const t=this.extent;return t[0]>=e[0]&&e[2]>=t[2]&&t[1]>=e[1]&&e[3]>=t[3]}intersectsExtent(e){const t=this.extent;return t[2]>=e[0]&&e[2]>=t[0]&&t[3]>=e[1]&&e[3]>=t[1]}getElevationBasedVerticesPerRow(t){const i=this.vlevel-this.level,s=Math.max(this.level-t,C(this.level)-i);return e(1+(this.maxTesselation>>s),2,this.maxTesselation+1)}get test(){return{cachedMemory:this.cachedMemory}}}function H(e,t,i,s){const n=i===D.ELEVATION?$.acquire():Y.acquire();return n.init(e,t,i,s),n}function z(e){e.dispose(),e instanceof I?$.release(e):e instanceof j&&Y.release(e)}const Y=new n(j),$=new n(I),Q=new T,J=-1;var K;!function(e){e[e.TOP=0]="TOP",e[e.MIDDLE=1]="MIDDLE",e[e.BOTTOM=2]="BOTTOM"}(K||(K={}));export{K as CenterPosition,k as SplitLimits,X as Tile};
@@ -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{unwrapOr as t,isSome as e}from"../../../core/maybe.js";import{ViewingMode as n}from"../../ViewingMode.js";import{ImageWithType as l}from"../support/StreamDataLoader.js";import{t as i}from"../../../chunks/terrainUtilsPlanar.js";import{t as o}from"../../../chunks/terrainUtilsSpherical.js";const r={[n.Global]:o,[n.Local]:i};function u(t,e){t||console.warn("Terrain: "+e)}const a=1.2,c=80/180*Math.PI,f=110/180*Math.PI;function s(n,l,i){const o=r[n.viewingMode];let u;if(o.isInsideExtent(n,l))u=t(n.getElevation(l[0],l[1],l[1],n.spatialReference),0);else{if(!o.isInsideExtent(n,l,a))return 0;const t=n.getTileWithElevation(l[0],l[1],l[1],n.spatialReference);u=.5*((e(t)?t.elevationBounds[0]:n.elevationBounds.min)+(e(t)?t.elevationBounds[1]:n.elevationBounds.max));const i=o.tiltToExtentEdge(n,l,u);if(i>c&&i<f)return 0}const s=l[2]-u;return Math.abs(s)<i?0:s<0?-1:1}function d(t){return v(t)?{fullExtent:t.fullExtent,minScale:t.layer.minScale,maxScale:t.layer.maxScale,tilemapCache:null}:t.layer}function p(t){return"vector-tile"===(null==t?void 0:t.type)}function m(t){return"imagery-tile"===(null==t?void 0:t.type)||"wcs"===(null==t?void 0:t.type)}function v(t){return"imagery-tile-3d"===(null==t?void 0:t.type)}function y(t){return"tile-3d"===(null==t?void 0:t.type)}function I(t){return"vector-tile-3d"===(null==t?void 0:t.type)}function x(t){return"wmts-3d"===(null==t?void 0:t.type)}function E(t){return"elevation-3d"===(null==t?void 0:t.type)}function h(t){return t&&(y(t)||v(t)||E(t)||I(t)||x(t))}function L(t){var n;const l=null==t||null==(n=t.sourceLayerInfo)?void 0:n.data;return e(l)&&"type"in l&&"raster-tile"===l.type}function T(t){var n;const l=null==t||null==(n=t.sourceLayerInfo)?void 0:n.data;return e(l)&&"type"in l&&"vector-tile"===l.type}function g(t){var n;const l=null==t||null==(n=t.sourceLayerInfo)?void 0:n.data;return e(l)&&"type"in l&&"tile-texture"===l.type}function S(t){var e;const n=null==t||null==(e=t.sourceLayerInfo)?void 0:e.data;return n instanceof HTMLImageElement||n instanceof l||n instanceof HTMLCanvasElement||n instanceof ImageData}function M(t){return e(t)&&"release"in t&&t.release(),null}function w(t){return t.fetchTile&&!1!==t.hasOverriddenFetchTile}function b(t,e,n,l){return r[l].checkIfTileInfoSupportedForViewSR(t,n,e)}function j(t,l,i){let o=null,r=null;if("wmts"===t.type){const e=t.activeLayer;if(e){const t=e.tileMatrixSet;if(t)o=t.tileInfo,r=t.fullExtent;else{const t=e.tileMatrixSets;if(t){const e=t.find((t=>null==b(t.tileInfo,t.fullExtent,l,i)));if(e)return{tileInfo:e.tileInfo,fullExtent:e.fullExtent}}}}}else r=m(t)?t.getCompatibleFullExtent(l):t.fullExtent,o=p(t)&&!B.force512VTL?t.compatibleTileInfo256:m(t)?t.getCompatibleTileInfo(l,r,i===n.Local):t.tileInfo;return e(o)&&e(r)&&null==b(o,r,l,i)?{tileInfo:o,fullExtent:r}:null}const B={force512VTL:!1};export{b as checkIfTileInfoSupportedForView,s as computeSkirtScale,d as getLayerWithExtentRange,j as getTiledLayerInfo,E as isElevationLayerView,v as isImageryTileLayerView,L as isImageryTileRenderInfo,m as isProjectableRasterLayer,S as isRasterTileRenderInfo,h as isSurfaceLayerView,g as isTextureTileRenderInfo,y as isTileLayerView,p as isVectorTileLayer,I as isVectorTileLayerView,T as isVectorTileRenderInfo,x as isWMTSLayerView,M as releaseTileData,B as test,w as useFetchTileForLayer,u as weakAssert};
5
+ import{unwrapOr as t,isSome as e}from"../../../core/maybe.js";import{ViewingMode as n}from"../../ViewingMode.js";import{ImageWithType as l}from"../support/StreamDataLoader.js";import{t as i}from"../../../chunks/terrainUtilsPlanar.js";import{t as o}from"../../../chunks/terrainUtilsSpherical.js";const r={[n.Global]:o,[n.Local]:i};function u(t,e){t||console.warn("Terrain: "+e)}const a=1.2,c=80/180*Math.PI,f=110/180*Math.PI;function s(n,l,i){const o=r[n.viewingMode];let u;if(o.isInsideExtent(n,l))u=t(n.getElevation(l[0],l[1],l[1],n.spatialReference),0);else{if(!o.isInsideExtent(n,l,a))return 0;const t=n.getTileWithElevation(l[0],l[1],l[1],n.spatialReference);u=.5*((e(t)?t.elevationBounds[0]:n.elevationBounds.min)+(e(t)?t.elevationBounds[1]:n.elevationBounds.max));const i=o.tiltToExtentEdge(n,l,u);if(i>c&&i<f)return 0}const s=l[2]-u;return Math.abs(s)<i?0:s<0?-1:1}function d(t){return v(t)?{fullExtent:t.fullExtent,minScale:t.layer.minScale,maxScale:t.layer.maxScale,tilemapCache:null}:t.layer}function p(t){return"vector-tile"===(null==t?void 0:t.type)}function m(t){return"imagery-tile"===(null==t?void 0:t.type)||"wcs"===(null==t?void 0:t.type)}function v(t){return"imagery-tile-3d"===(null==t?void 0:t.type)}function y(t){return"tile-3d"===(null==t?void 0:t.type)}function I(t){return"vector-tile-3d"===(null==t?void 0:t.type)}function x(t){return"wmts-3d"===(null==t?void 0:t.type)}function E(t){return"elevation-3d"===(null==t?void 0:t.type)}function g(t){return t&&(y(t)||v(t)||E(t)||I(t)||x(t))}function h(t){var n;const l=null==t||null==(n=t.sourceLayerInfo)?void 0:n.data;return e(l)&&"type"in l&&"raster-tile"===l.type}function L(t){var n;const l=null==t||null==(n=t.sourceLayerInfo)?void 0:n.data;return e(l)&&"type"in l&&"vector-tile"===l.type}function T(t){var n;const l=null==t||null==(n=t.sourceLayerInfo)?void 0:n.data;return e(l)&&"type"in l&&"tile-texture"===l.type}function S(t){var e;const n=null==t||null==(e=t.sourceLayerInfo)?void 0:e.data;return n instanceof HTMLImageElement||n instanceof l||n instanceof HTMLCanvasElement||n instanceof ImageData}function M(t){return e(t)&&"release"in t&&t.release(),null}function w(t){return t.fetchTile&&!1!==t.hasOverriddenFetchTile}function b(t,e,n,l){return r[l].checkIfTileInfoSupportedForViewSR(t,n,e)}function C(t,l,i){let o=null,r=null;if("wmts"===t.type){const e=t.activeLayer;if(e){const t=e.tileMatrixSet;if(t)o=t.tileInfo,r=t.fullExtent;else{const t=e.tileMatrixSets;if(t){const e=t.find((t=>null==b(t.tileInfo,t.fullExtent,l,i)));if(e)return{tileInfo:e.tileInfo,fullExtent:e.fullExtent}}}}}else r=m(t)?t.getCompatibleFullExtent(l):t.fullExtent,o=p(t)&&!j.force512VTL?t.tileInfo.getOrCreateCompatible(256):m(t)?t.getCompatibleTileInfo(l,r,i===n.Local):t.tileInfo;return e(o)&&e(r)&&null==b(o,r,l,i)?{tileInfo:o,fullExtent:r}:null}const j={force512VTL:!1};export{b as checkIfTileInfoSupportedForView,s as computeSkirtScale,d as getLayerWithExtentRange,C as getTiledLayerInfo,E as isElevationLayerView,v as isImageryTileLayerView,h as isImageryTileRenderInfo,m as isProjectableRasterLayer,S as isRasterTileRenderInfo,g as isSurfaceLayerView,T as isTextureTileRenderInfo,y as isTileLayerView,p as isVectorTileLayer,I as isVectorTileLayerView,L as isVectorTileRenderInfo,x as isWMTSLayerView,M as releaseTileData,j as test,w as useFetchTileForLayer,u as weakAssert};
@@ -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{isSome as t,isNone as e}from"../../../core/maybe.js";import n from"../../../core/PooledArray.js";class r{constructor(){this._queue=new n,this._last=null,this.remove=()=>{}}get done(){return 0===this._queue.length&&(!this._last||this._last.isLeaf)}resetOne(t){this._queue.clear(),this._queue.push(t),this._last=null}reset(e=null){this._queue.clear(),t(e)&&this._queue.pushArray(e),this._last=null}skipSubtree(){this._last=null}next(){return this._last&&!this._last.isLeaf&&this._queue.pushArray(this._last.children),this._last=this._queue.pop(),this._last}}class s{constructor(){this.q=new n}get done(){return 0===this.q.length}reset(t){if(this.q.clear(),!e(t)){this.q.pushArray(t);for(let t=0;t<this.q.length;++t){const e=this.q.data[t];e.isLeaf||this.q.pushArray(e.children)}}}next(){return this.q.pop()}}function i(t,e){if(Array.isArray(t))for(let n=0;n<t.length;n++)l(t[n],e);else l(t,e)}function l(t,e){if(e(t),!t.isLeaf)for(const n of t.children)l(n,e)}function u(t,n,r){if(e(n)||e(n.fullExtent))return!1;const s=n.fullExtent,i=t.extent;if(r){if(i[0]<s.xmin||i[1]<s.ymin||i[2]>s.xmax||i[3]>s.ymax)return!1}else if(s.xmin>i[2]||s.ymin>i[3]||s.xmax<i[0]||s.ymax<i[1])return!1;const l=t.surface.tilingScheme.levels[t.level].scale;return!(n.minScale>0&&l>1.00000001*n.minScale)&&!(n.maxScale>0&&l<.99999999*n.maxScale)}function o(t,e){e.sort(((e,n)=>a(e,n,t)))}function a(t,e,n){const r=t.screenDepth,s=e.screenDepth;return r<s?-n:r>s?n:0}function h(t,e){const n=new Map;t.forAll((t=>n.set(t,t.distanceToSquared(e)))),t.sort(((t,e)=>n.get(t)-n.get(e)))}function c(t,e,n){let r=1,s=0,i=0;for(;t!==e;)if(r*=.5,s*=.5,i*=.5,1&t.lij[2]&&(s+=.5),0==(1&t.lij[1])&&(i+=.5),null==(t=t.parent))throw new Error("tile was not a descendant of upsampleTile");n.init(e,s,i,r)}function f(t){for(let e=0;e<t.length;e++){const n=t[e],r=n.parent;if(r)for(let t=0;t<4;t++){const e=r.children[t];if(e&&e!==n&&e.loadable)return!0}}return!1}function m(t,e){if(!t||!e||t[0]===e[0])return!1;const n=t[0]<e[0],r=n?t:e,s=n?e:t,i=1<<s[0]-r[0];return Math.floor(s[1]/i)===r[1]&&Math.floor(s[2]/i)===r[2]}export{s as IteratorPostorder,r as IteratorPreorder,a as compareTiles,c as computeUpsampleInfo,u as fallsWithinLayer,f as hasLoadableSiblings,o as sortTiles,h as sortTilesByPOI,m as tilesAreRelated,i as traverseTilesPreorder};
5
+ import{isSome as t,isNone as e}from"../../../core/maybe.js";import n from"../../../core/PooledArray.js";class r{constructor(){this._queue=new n,this._last=null,this.remove=()=>{}}get done(){return 0===this._queue.length&&(!this._last||this._last.isLeaf)}resetOne(t){this._queue.clear(),this._queue.push(t),this._last=null}reset(e=null){this._queue.clear(),t(e)&&this._queue.pushArray(e),this._last=null}skipSubtree(){this._last=null}next(){return this._last&&!this._last.isLeaf&&this._queue.pushArray(this._last.children),this._last=this._queue.pop(),this._last}}class s{constructor(){this.q=new n}get done(){return 0===this.q.length}reset(t){if(this.q.clear(),!e(t)){this.q.pushArray(t);for(let t=0;t<this.q.length;++t){const e=this.q.data[t];e.isLeaf||this.q.pushArray(e.children)}}}next(){return this.q.pop()}}function i(t,e){if(Array.isArray(t))for(let n=0;n<t.length;n++)l(t[n],e);else l(t,e)}function l(t,e){if(e(t),!t.isLeaf)for(const n of t.children)l(n,e)}function u(t,n,r){if(e(n)||e(n.fullExtent))return!1;const s=n.fullExtent,i=t.extent;if(r){if(i[0]<s.xmin||i[1]<s.ymin||i[2]>s.xmax||i[3]>s.ymax)return!1}else if(s.xmin>i[2]||s.ymin>i[3]||s.xmax<i[0]||s.ymax<i[1])return!1;const l=t.surface.tilingScheme.levels[t.level].scale;return!(n.minScale>0&&l>1.00000001*n.minScale)&&!(n.maxScale>0&&l<.99999999*n.maxScale)}function o(t,e){e.sort(((e,n)=>a(e,n,t)))}function a(t,e,n){const r=t.screenDepth,s=e.screenDepth;return r<s?-n:r>s?n:0}function h(t,e){const n=new Map;t.forAll((t=>n.set(t.lij,t.distanceToSquared(e)))),t.sort(((t,e)=>n.get(t.lij)-n.get(e.lij)))}function c(t,e,n){let r=1,s=0,i=0;for(;t!==e;)if(r*=.5,s*=.5,i*=.5,1&t.lij[2]&&(s+=.5),0==(1&t.lij[1])&&(i+=.5),null==(t=t.parent))throw new Error("tile was not a descendant of upsampleTile");n.init(e,s,i,r)}function f(t){for(let e=0;e<t.length;e++){const n=t[e],r=n.parent;if(r)for(let t=0;t<4;t++){const e=r.children[t];if(e&&e!==n&&e.loadable)return!0}}return!1}function m(t,e){if(!t||!e||t[0]===e[0])return!1;const n=t[0]<e[0],r=n?t:e,s=n?e:t,i=1<<s[0]-r[0];return Math.floor(s[1]/i)===r[1]&&Math.floor(s[2]/i)===r[2]}export{s as IteratorPostorder,r as IteratorPreorder,a as compareTiles,c as computeUpsampleInfo,u as fallsWithinLayer,f as hasLoadableSiblings,o as sortTiles,h as sortTilesByPOI,m as tilesAreRelated,i as traverseTilesPreorder};
@@ -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 e from"../../../../../core/Logger.js";import{isSome as t,isNone as o,applySome as r,unwrap as n}from"../../../../../core/maybe.js";import i from"../../../../../core/PooledArray.js";import{e as s,t as a,g as m}from"../../../../../chunks/mat3.js";import{c,a as l}from"../../../../../chunks/mat3f32.js";import{h as p,v as h,t as f,g as u}from"../../../../../chunks/vec3.js";import{c as b}from"../../../../../chunks/vec3f64.js";import{c as g}from"../../../../../chunks/vec4.js";import{c as d}from"../../../../../chunks/vec4f32.js";import{ColorMixModeEnum as y,encodeSymbolColor as C}from"../../../layers/support/symbolColorUtils.js";import{clone as j,radius as w}from"../../../support/orientedBoundingBox.js";import{glLayout as M}from"../../../support/buffer/glUtil.js";import{newLayout as x}from"../../../support/buffer/InterleavedLayout.js";import _ from"./ComponentData.js";import{State as S,ComponentObject as v}from"./ComponentObject.js";import{isVaryingComponentParameters as D}from"./interface.js";import A from"./IntersectionGeometry.js";import{Renderable as P}from"./Renderable.js";import{RenderGeometry as O}from"./RenderGeometry.js";import{RenderSubmitSystem as T}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as k}from"./SourceGeometry.js";import{ComponentParametersVarying as I,ComponentParametersUniform as R,ComponentParameterSummary as U,ComponentMaterial as B}from"./Material/ComponentMaterial.js";import{ComponentDrawParameters as G}from"./Material/ComponentTechnique.js";import{TwoVectorPosition as V}from"../../core/util/TwoVectorPosition.js";import{VertexAttribute as E}from"../../lib/basicInterfaces.js";import{getVisibility as N,updateVisibilityWithCount as L}from"../../lib/ComponentUtils.js";import{assert as H}from"../../lib/Util.js";import{BufferManager as q}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as F}from"../../../../webgl/BufferObject.js";import{Usage as z,PrimitiveType as W}from"../../../../webgl/enums.js";import{VertexArrayObject as X}from"../../../../webgl/VertexArrayObject.js";const J=e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class K{constructor(e){this._renderManager=e,this._objects=[new i,new i],this._renderSubmit=new T(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new q(e.rctx)}dispose(){H(0===this._objects[S.Hidden].length&&0===this._objects[S.Visible].length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy()}createObject(e){const t=new v;return t.toMapSpace=e.toMapSpace.slice(),t.transform=e.transform,t.obb=j(e.obb),t.components=new _(this._componentBufferManager,e.geometry.componentOffsets),t.renderable=this._createRenderable(e,t.components),t.intersectionGeometry=new A(e.geometry.positionData,t.components),this._objects[t.visible].push(t),t}destroyObject(e){const t=e;this._objects[t.visible].removeUnordered(t),t.dispose(),this._notifyDirty()}setObjectVisibility(e,t){const o=e;t!==o.visible&&(this._objects[o.visible].removeUnordered(o),this._objects[t].push(o),o.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll((e=>{const o=p(t,e.obb.center);e.renderable.meta.cameraDepthSquared=o}))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const o=e.renderable.material;t(o),o.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const o=e;o.components.visibility.reset(t),o.components.visibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.components.visibility.forEachComponent(t)}getComponentCount(e){const t=e,o=t.components.visibility.componentCount();return{visible:o,invisible:t.components.count-o}}setComponentData(e,t){const o=e,r=o.renderable.material;if(D(t)){const e=o.components,n=e.materialDataBuffer,i=e.materialDataIndices,s={castShadows:!0,pickable:!0,externalColor:d(),externalColorMixMode:y.Multiply},a=n.textureBuffer,m=new Uint8Array(4),c=new Uint32Array(m.buffer);let l=0,p=0,h=0,f=!1,u=0;for(let o=0;o<e.count;o++)t(o,s),l+=+(s.externalColor[3]<1),p+=+(s.externalColorMixMode===y.Replace&&1===s.externalColor[3]),h+=+s.castShadows,C(s.externalColor,s.externalColorMixMode,m),m[2]=254&m[2]|+s.castShadows,a.setData(i[o],0,m[0],m[1],m[2],m[3]),f=f||o>0&&u!==c[0],u=c[0],s.pickable!==N(e.pickability,o)&&(e.pickability=L(e.pickability,e.count,o,s.pickable));f?(r.componentParameters=new I,r.componentParameters.castShadows=Y(h,e.count),r.componentParameters.transparent=Y(l,e.count),r.componentParameters.opaqueOverride=Y(p,e.count),r.componentParameters.texture=a,a.updateTexture()):(r.componentParameters=new R,r.componentParameters.castShadows=s.castShadows?U.All:U.None,r.componentParameters.externalColor=s.externalColor,r.componentParameters.externalColorMixMode=s.externalColorMixMode)}else r.componentParameters=new R,r.componentParameters.castShadows=t.castShadows?U.All:U.None,r.componentParameters.externalColor=t.externalColor,r.componentParameters.externalColorMixMode=t.externalColorMixMode;this._notifyDirty()}getComponentAabb(e,t,o){return e.intersectionGeometry.getComponentAabb(t,o)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,o){return e.intersectionGeometry.getComponentPositions(t,o)}intersect(e,o,r,n,i,m){const c=e;t(i)&&(i.localOrigin=c.transform.position);const l=s(Z,c.transform.rotationScale);h($,o,c.transform.position),h(ee,r,c.transform.position),f($,$,l),f(ee,ee,l);const p=a(Z,l);return c.intersectionGeometry.intersect($,ee,n,p,i,m)}addEdges(e,t,o,r){const n=e,{indices:i,positions:s}=n.intersectionGeometry,a=n.components.offsets;return t.addComponentObject(e,n.transform,{center:n.obb.center,radius:w(n.obb)},s,i,a,o,r)}addComponentHighlight(e,t){const r=e.components;o(r.highlightCounts)&&(r.highlightCounts=new Uint32Array(r.count+1));0===r.highlightCounts[t]++&&(r.highlightsDirty(),this._notifyDirty()),r.highlightCounts[r.count]++}removeComponentHighlight(e,t){const r=e.components;if(o(r.highlightCounts))return void J.warn("Removing non-existing highlight.");const n=r.highlightCounts[t],i=r.highlightCounts[r.count];if(0!==n){if(n>1)return r.highlightCounts[t]=n-1,void(r.highlightCounts[r.count]=i-1);r.highlightCounts[t]=0,r.highlightsDirty(),this._notifyDirty(),1===i?r.highlightCounts=null:r.highlightCounts[r.count]=i-1}else J.warn("Removing non-existing highlight.")}clearHighlights(e){const o=e.components;t(o.highlightCounts)&&(o.highlightCounts=null,o.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._objects[S.Visible]}_createRenderable(e,o){const i=this._renderManager.rctx,c=e.geometry,p=c.vertices.layoutParameters,h=F.createVertex(i,z.STATIC_DRAW,c.vertices.data),f=r(c.indices,(e=>F.createIndex(i,z.STATIC_DRAW,e))),b=M(k(p)),d=new Uint16Array(c.vertices.count);for(let r=0;r<o.count;r++){const e=o.offsets[r],n=o.offsets[r+1],i=o.materialDataIndices[r];if(t(c.indices))for(let t=e;t<n;t++){d[c.indices[t]]=i}else for(let t=e;t<n;t++)d[t]=i}const y=F.createVertex(i,z.STATIC_DRAW,d.buffer),C=new V(e.transform.position),j=l(e.transform.rotationScale);s(j,j),a(j,j);const w=new G;u(w.worldFromModel_TL,C.low),u(w.worldFromModel_TH,C.high),m(w.worldFromModel_RS,e.transform.rotationScale),m(w.transformNormal_GlobalFromModel,j),g(w.toMapSpace,e.toMapSpace);const x=new B,_=new X(i,x.attributeLocations,{data:b,componentIndices:Q},{data:h,componentIndices:y},n(f)),S=new O(_,W.TRIANGLES,p,t(f)),v={cameraDepthSquared:.5,gpuMemoryEstimate:h.byteSize+y.byteSize+(t(f)?f.byteSize:0)};return new P(x,w,S,v)}_notifyDirty(){this._renderManager.notifyDirty()}}const Q=M(x().u16(E.COMPONENTINDEX));function Y(e,t){return e===t?U.All:0===e?U.None:U.Some}const Z=c(),$=b(),ee=b();export{K as ComponentObjectCollection};
5
+ import e from"../../../../../core/Logger.js";import{isSome as t,isNone as o,applySome as r,unwrap as n}from"../../../../../core/maybe.js";import i from"../../../../../core/PooledArray.js";import{e as s,t as a,g as m}from"../../../../../chunks/mat3.js";import{c,a as l}from"../../../../../chunks/mat3f32.js";import{h as p,v as h,t as f,g as u}from"../../../../../chunks/vec3.js";import{c as b}from"../../../../../chunks/vec3f64.js";import{c as g}from"../../../../../chunks/vec4.js";import{c as d}from"../../../../../chunks/vec4f32.js";import{ColorMixModeEnum as y,encodeSymbolColor as C}from"../../../layers/support/symbolColorUtils.js";import{clone as j,radius as M}from"../../../support/orientedBoundingBox.js";import{glLayout as w}from"../../../support/buffer/glUtil.js";import{newLayout as x}from"../../../support/buffer/InterleavedLayout.js";import S from"./ComponentData.js";import{State as v,ComponentObject as _}from"./ComponentObject.js";import{isVaryingComponentParameters as D}from"./interface.js";import A from"./IntersectionGeometry.js";import{Renderable as P}from"./Renderable.js";import{RenderGeometry as O}from"./RenderGeometry.js";import{RenderSubmitSystem as T}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as k}from"./SourceGeometry.js";import{ComponentParametersVarying as R,ComponentParametersUniform as I,ComponentParameterSummary as U,ComponentMaterial as B}from"./Material/ComponentMaterial.js";import{ComponentDrawParameters as G}from"./Material/ComponentTechnique.js";import{TwoVectorPosition as V}from"../../core/util/TwoVectorPosition.js";import{getVisibility as E,updateVisibilityWithCount as N}from"../../lib/ComponentUtils.js";import{assert as L}from"../../lib/Util.js";import{VertexAttribute as W}from"../../lib/VertexAttribute.js";import{BufferManager as H}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as q}from"../../../../webgl/BufferObject.js";import{Usage as F,PrimitiveType as z}from"../../../../webgl/enums.js";import{VertexArrayObject as X}from"../../../../webgl/VertexArrayObject.js";const J=e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class K{constructor(e){this._renderManager=e,this._objects=[new i,new i],this._renderSubmit=new T(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new H(e.rctx)}dispose(){L(0===this._objects[v.Hidden].length&&0===this._objects[v.Visible].length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy()}createObject(e){const t=new _;return t.toMapSpace=e.toMapSpace.slice(),t.transform=e.transform,t.obb=j(e.obb),t.components=new S(this._componentBufferManager,e.geometry.componentOffsets),t.renderable=this._createRenderable(e,t.components),t.intersectionGeometry=new A(e.geometry.positionData,t.components),this._objects[t.visible].push(t),t}destroyObject(e){const t=e;this._objects[t.visible].removeUnordered(t),t.dispose(),this._notifyDirty()}setObjectVisibility(e,t){const o=e;t!==o.visible&&(this._objects[o.visible].removeUnordered(o),this._objects[t].push(o),o.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll((e=>{const o=p(t,e.obb.center);e.renderable.meta.cameraDepthSquared=o}))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const o=e.renderable.material;t(o),o.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const o=e;o.components.visibility.reset(t),o.components.visibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.components.visibility.forEachComponent(t)}getComponentCount(e){const t=e,o=t.components.visibility.componentCount();return{visible:o,invisible:t.components.count-o}}setComponentData(e,t){const o=e,r=o.renderable.material;if(D(t)){const e=o.components,n=e.materialDataBuffer,i=e.materialDataIndices,s={castShadows:!0,pickable:!0,externalColor:d(),externalColorMixMode:y.Multiply},a=n.textureBuffer,m=new Uint8Array(4),c=new Uint32Array(m.buffer);let l=0,p=0,h=0,f=!1,u=0;for(let o=0;o<e.count;o++)t(o,s),l+=+(s.externalColor[3]<1),p+=+(s.externalColorMixMode===y.Replace&&1===s.externalColor[3]),h+=+s.castShadows,C(s.externalColor,s.externalColorMixMode,m),m[2]=254&m[2]|+s.castShadows,a.setData(i[o],0,m[0],m[1],m[2],m[3]),f=f||o>0&&u!==c[0],u=c[0],s.pickable!==E(e.pickability,o)&&(e.pickability=N(e.pickability,e.count,o,s.pickable));f?(r.componentParameters=new R,r.componentParameters.castShadows=Y(h,e.count),r.componentParameters.transparent=Y(l,e.count),r.componentParameters.opaqueOverride=Y(p,e.count),r.componentParameters.texture=a,a.updateTexture()):(r.componentParameters=new I,r.componentParameters.castShadows=s.castShadows?U.All:U.None,r.componentParameters.externalColor=s.externalColor,r.componentParameters.externalColorMixMode=s.externalColorMixMode)}else r.componentParameters=new I,r.componentParameters.castShadows=t.castShadows?U.All:U.None,r.componentParameters.externalColor=t.externalColor,r.componentParameters.externalColorMixMode=t.externalColorMixMode;this._notifyDirty()}getComponentAabb(e,t,o){return e.intersectionGeometry.getComponentAabb(t,o)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,o){return e.intersectionGeometry.getComponentPositions(t,o)}intersect(e,o,r,n,i,m){const c=e;t(i)&&(i.localOrigin=c.transform.position);const l=s(Z,c.transform.rotationScale);h($,o,c.transform.position),h(ee,r,c.transform.position),f($,$,l),f(ee,ee,l);const p=a(Z,l);return c.intersectionGeometry.intersect($,ee,n,p,i,m)}addEdges(e,t,o,r){const n=e,{indices:i,positions:s}=n.intersectionGeometry,a=n.components.offsets;return t.addComponentObject(e,n.transform,{center:n.obb.center,radius:M(n.obb)},s,i,a,o,r)}addComponentHighlight(e,t){const r=e.components;o(r.highlightCounts)&&(r.highlightCounts=new Uint32Array(r.count+1));0===r.highlightCounts[t]++&&(r.highlightsDirty(),this._notifyDirty()),r.highlightCounts[r.count]++}removeComponentHighlight(e,t){const r=e.components;if(o(r.highlightCounts))return void J.warn("Removing non-existing highlight.");const n=r.highlightCounts[t],i=r.highlightCounts[r.count];if(0!==n){if(n>1)return r.highlightCounts[t]=n-1,void(r.highlightCounts[r.count]=i-1);r.highlightCounts[t]=0,r.highlightsDirty(),this._notifyDirty(),1===i?r.highlightCounts=null:r.highlightCounts[r.count]=i-1}else J.warn("Removing non-existing highlight.")}clearHighlights(e){const o=e.components;t(o.highlightCounts)&&(o.highlightCounts=null,o.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._objects[v.Visible]}_createRenderable(e,o){const i=this._renderManager.rctx,c=e.geometry,p=c.vertices.layoutParameters,h=q.createVertex(i,F.STATIC_DRAW,c.vertices.data),f=r(c.indices,(e=>q.createIndex(i,F.STATIC_DRAW,e))),b=w(k(p)),d=new Uint16Array(c.vertices.count);for(let r=0;r<o.count;r++){const e=o.offsets[r],n=o.offsets[r+1],i=o.materialDataIndices[r];if(t(c.indices))for(let t=e;t<n;t++){d[c.indices[t]]=i}else for(let t=e;t<n;t++)d[t]=i}const y=q.createVertex(i,F.STATIC_DRAW,d.buffer),C=new V(e.transform.position),j=l(e.transform.rotationScale);s(j,j),a(j,j);const M=new G;u(M.transformWorldFromModelTL,C.low),u(M.transformWorldFromModelTH,C.high),m(M.transformWorldFromModelRS,e.transform.rotationScale),m(M.transformNormalGlobalFromModel,j),g(M.toMapSpace,e.toMapSpace);const x=new B,S=new X(i,x.attributeLocations,{data:b,componentIndices:Q},{data:h,componentIndices:y},n(f)),v=new O(S,z.TRIANGLES,p,t(f)),_={cameraDepthSquared:.5,gpuMemoryEstimate:h.byteSize+y.byteSize+(t(f)?f.byteSize:0)};return new P(x,M,v,_)}_notifyDirty(){this._renderManager.notifyDirty()}}const Q=w(x().u16(W.COMPONENTINDEX));function Y(e,t){return e===t?U.All:0===e?U.None:U.Some}const Z=c(),$=b(),ee=b();export{K as ComponentObjectCollection};
@@ -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{releaseMaybe as t,isSome as r}from"../../../../../../core/maybe.js";import{C as s}from"../../../../../../chunks/vec3.js";import{f as o}from"../../../../../../chunks/vec3f32.js";import{g as a,c as i,v as n}from"../../../../../../chunks/vec4.js";import{f as l}from"../../../../../../chunks/vec4f32.js";import{f as p}from"../../../../../../chunks/vec4f64.js";import{ColorMixModeEnum as h}from"../../../../layers/support/symbolColorUtils.js";import{ComponentTechniqueConfiguration as u,IntegratedMeshMode as d,ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentDataType as m}from"./shader/ComponentData.glsl.js";import{a as y}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as v}from"./shader/VertexDiscardByOpacity.glsl.js";import{parameter as b,parameterBlock as T,MaterialBase as g,MaterialParameterBlock as f}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as x,MaterialSubPass as M}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as O}from"../../../core/shaderLibrary/ShaderOutputOptions.js";import{Normals as P}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{defaultMaskAlphaCutoff as C}from"../../../core/shaderLibrary/util/AlphaDiscard.glsl.js";import{EllipsoidMode as D}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{AlphaDiscardMode as q,TransparencyPassType as E,CullFaceOptions as w}from"../../../lib/basicInterfaces.js";class S extends g{constructor(){super(...arguments),this.baseColor=l(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=o(1,1,.5),this.emissiveFactor=o(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.overlayTexOffset=p(-1,-1,-1,-1),this.overlayTexScale=p(0,0,0,0),this.overlayColor=null,this.overlayHighlight=null,this.overlayNormal=null,this.objectOpacity=1,this.commonMaterialParameters=new R,this.componentParameters=new I,this.alphaCutoff=C,this.alphaDiscardMode=q.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=D.Earth,this.sceneHasOcludees=!1,this._techniqueConfig=new u}dispose(){this._technique=t(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}prepareTechnique(e,t,s){const o=this._techniqueConfig;if(o.hasVertexColors=s.colors,o.hasNormals=s.normals,o.vertexTextureCoordinates=s.textureCoordinates,o.usePBR=this.usePBR,o.hasMetalnessAndRoughnessTexture=r(this.metallicRoughnessTexture),o.hasEmissionTexture=r(this.emissionTexture),o.hasOcclusionTexture=r(this.occlusionTexture),o.hasNormalTexture=r(this.normalTexture),o.transparencyPassType=t.identifier===x.Material&&null!=t.transparencyPassType?t.transparencyPassType:E.NONE,o.multipassTerrainEnabled=t.identifier===x.Material&&null!=t.multipassTerrainParams&&t.multipassTerrainParams.multipassTerrainEnabled,o.cullAboveGround=t.identifier===x.Material&&null!=t.multipassTerrainParams&&t.multipassTerrainParams.cullAboveGround,o.ellipsoidMode=this.ellipsoidMode,this.dirty){o.componentData=this.componentParameters.type,o.cullFace=this.commonMaterialParameters.cullFace,o.doubleSidedMode=this.commonMaterialParameters.doubleSided?P.DoubleSidedMode.View:P.DoubleSidedMode.None,o.baseColorTexture=r(this.baseColorTexture),o.isSchematic=this.hasParametersFromSource&&!r(this.baseColorTexture);const e=this._computeWhichMaterialPass();o.blendingEnabled=e===A.Transparent||e===A.OpaqueAndTransparent,o.alphaDiscardMode=this.alphaDiscardMode,o.integratedMeshMode=this.isIntegratedMesh?this.overlayColor?this.overlayNormal?d.ColorOverlayWithWater:d.ColorOverlay:d.NoOverlay:d.None,o.polygonOffsetEnabled=this.polygonOffsetEnabled,this._setClean()}return o.slicePlaneEnabled=t.slicePlaneEnabled&&this.commonMaterialParameters.slicePlaneEnabled,t.identifier===x.ShadowMap?(o.output=O.Shadow,o.vertexDiscardMode=v.None):t.identifier===x.Highlight?(o.output=O.Highlight,o.vertexDiscardMode=v.None):(this._computeWhichMaterialPass()===A.OpaqueAndTransparent?o.vertexDiscardMode=t.transparent?v.Opaque:v.Transparent:o.vertexDiscardMode=v.None,o.output=k(t.subPass),t.subPass===M.Alpha&&(o.sceneHasOcludees=t.sceneHasOcludees),t.subPass===M.Color?(o.receiveAmbientOcclusion=t.ambientOcclusionEnabled,o.sceneHasOcludees=t.sceneHasOcludees,o.receiveShadows=t.shadowsEnabled,o.ssrEnabled=t.ssrParams.ssrEnabled):(o.receiveAmbientOcclusion=!1,o.receiveShadows=!1)),this._technique=e.releaseAndAcquire(c,o,this._technique),this._technique}submit(e,t){if(0===this.objectOpacity)return;const s=t.renderable.geometry,o=t.components,a=t.renderable.drawParameters,i=t.renderable.meta.cameraDepthSquared,n=o.geometryRanges,l=o.highlightRanges,p=o.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case A.Opaque:e.materialOpaque.submitDraw(this,s,n,a,i);break;case A.Transparent:e.materialTransparent.submitDraw(this,s,n,a,i);break;case A.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,s,n,a,i),e.materialTransparent.submitDraw(this,s,n,a,i);break;case A.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,s,n,a,i),this.overlayHighlight&&e.highlightIntegratedMesh.submitDraw(this,s,n,a,i)}const h=this.componentParameters.castShadows!==j.None;h&&e.shadowMap.submitDraw(this,s,n,a,i),r(l)&&(e.highlight.submitDraw(this,s,l,a,i),h&&e.highlightShadowMap.submitDraw(this,s,l,a,i)),h&&r(p)&&e.defaultShadowMap.submitDraw(this,s,p,a,i)}get attributeLocations(){return y}_computeWhichMaterialPass(){return this.isIntegratedMesh?A.IntegratedMesh:this.objectOpacity<1?A.Transparent:this.componentParameters.opaqueOverride===j.All?A.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===q.Blend||this.alphaDiscardMode===q.MaskBlend?A.Transparent:this.componentParameters.transparent===j.None?A.Opaque:this.componentParameters.transparent===j.All?A.Transparent:A.OpaqueAndTransparent}}var N,A,j;e([b({vectorOps:n})],S.prototype,"baseColor",void 0),e([b()],S.prototype,"usePBR",void 0),e([b()],S.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:s})],S.prototype,"mrrFactors",void 0),e([b({vectorOps:s})],S.prototype,"emissiveFactor",void 0),e([b({dispose:!0})],S.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],S.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],S.prototype,"emissionTexture",void 0),e([b({dispose:!0})],S.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],S.prototype,"normalTexture",void 0),e([b({vectorOps:{equals:a,copy:i}})],S.prototype,"overlayTexOffset",void 0),e([b({vectorOps:{equals:a,copy:i}})],S.prototype,"overlayTexScale",void 0),e([b()],S.prototype,"overlayColor",void 0),e([b()],S.prototype,"overlayHighlight",void 0),e([b()],S.prototype,"overlayNormal",void 0),e([b()],S.prototype,"objectOpacity",void 0),e([T()],S.prototype,"commonMaterialParameters",void 0),e([T()],S.prototype,"componentParameters",void 0),e([b()],S.prototype,"alphaCutoff",void 0),e([b()],S.prototype,"alphaDiscardMode",void 0),e([b()],S.prototype,"isIntegratedMesh",void 0),e([b()],S.prototype,"polygonOffsetEnabled",void 0),e([b()],S.prototype,"ellipsoidMode",void 0),e([b()],S.prototype,"sceneHasOcludees",void 0),function(e){e[e.VERTEX=0]="VERTEX",e[e.GROUND=1]="GROUND",e[e.SCREEN_DERIVATIVE=2]="SCREEN_DERIVATIVE"}(N||(N={})),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(A||(A={}));class R extends f{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=w.Back,this.slicePlaneEnabled=!0}}e([b()],R.prototype,"doubleSided",void 0),e([b()],R.prototype,"cullFace",void 0),e([b()],R.prototype,"slicePlaneEnabled",void 0);class I extends f{constructor(){super(...arguments),this.externalColor=l(1,1,1,1),this.externalColorMixMode=h.Multiply,this.castShadows=j.All}get transparent(){return this.externalColor[3]<1?j.All:j.None}get opaqueOverride(){return this.externalColorMixMode===h.Replace&&1===this.externalColor[3]?j.All:j.None}get visible(){return this.externalColor[3]>0?j.All:j.None}get type(){return m.Uniform}}e([b({vectorOps:n})],I.prototype,"externalColor",void 0),e([b()],I.prototype,"externalColorMixMode",void 0),e([b()],I.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(j||(j={}));class _ extends f{constructor(){super(...arguments),this.texture=null,this.transparent=j.None,this.opaqueOverride=j.None,this.castShadows=j.None}get type(){return m.Varying}}function k(e){switch(e){case M.Color:return O.Color;case M.Alpha:return O.Alpha;case M.Depth:return O.Depth;case M.Normal:return O.Normal}}e([b()],_.prototype,"texture",void 0),e([b()],_.prototype,"transparent",void 0),e([b()],_.prototype,"opaqueOverride",void 0),e([b()],_.prototype,"castShadows",void 0);export{R as CommonMaterialParameters,S as ComponentMaterial,j as ComponentParameterSummary,I as ComponentParametersUniform,_ as ComponentParametersVarying,N as ShadingNormalSource};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{releaseMaybe as t,isSome as r}from"../../../../../../core/maybe.js";import{C as s}from"../../../../../../chunks/vec3.js";import{f as a}from"../../../../../../chunks/vec3f32.js";import{g as o,c as i,v as n}from"../../../../../../chunks/vec4.js";import{f as l}from"../../../../../../chunks/vec4f32.js";import{f as p}from"../../../../../../chunks/vec4f64.js";import{ColorMixModeEnum as h}from"../../../../layers/support/symbolColorUtils.js";import{ComponentTechniqueConfiguration as u,IntegratedMeshMode as c,ComponentTechnique as d}from"./ComponentTechnique.js";import{ComponentDataType as m}from"./shader/ComponentData.glsl.js";import{a as y}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as v}from"./shader/VertexDiscardByOpacity.glsl.js";import{parameter as b,parameterBlock as T,MaterialBase as g,MaterialParameterBlock as f}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as x,MaterialSubPass as M}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as O}from"../../../core/shaderLibrary/ShaderOutputOptions.js";import{NormalsDoubleSidedMode as P}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{defaultMaskAlphaCutoff as C}from"../../../core/shaderLibrary/util/AlphaDiscard.glsl.js";import{EllipsoidMode as q}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{AlphaDiscardMode as E,TransparencyPassType as w,CullFaceOptions as D}from"../../../lib/basicInterfaces.js";class N extends g{constructor(){super(...arguments),this.baseColor=l(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=a(1,1,.5),this.emissiveFactor=a(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.overlayTexOffset=p(-1,-1,-1,-1),this.overlayTexScale=p(0,0,0,0),this.overlayColor=null,this.overlayHighlight=null,this.overlayNormal=null,this.objectOpacity=1,this.commonMaterialParameters=new R,this.componentParameters=new I,this.alphaCutoff=C,this.alphaDiscardMode=E.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=q.Earth,this.sceneHasOcludees=!1,this._techniqueConfig=new u}dispose(){this._technique=t(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}prepareTechnique(e,t,s){const a=this._techniqueConfig;if(a.hasVertexColors=s.colors,a.hasNormals=s.normals,a.vertexTextureCoordinates=s.textureCoordinates,a.usePBR=this.usePBR,a.hasMetalnessAndRoughnessTexture=r(this.metallicRoughnessTexture),a.hasEmissionTexture=r(this.emissionTexture),a.hasOcclusionTexture=r(this.occlusionTexture),a.hasNormalTexture=r(this.normalTexture),a.transparencyPassType=t.identifier===x.Material&&null!=t.transparencyPassType?t.transparencyPassType:w.NONE,a.multipassTerrainEnabled=t.identifier===x.Material&&null!=t.multipassTerrainParams&&t.multipassTerrainParams.multipassTerrainEnabled,a.cullAboveGround=t.identifier===x.Material&&null!=t.multipassTerrainParams&&t.multipassTerrainParams.cullAboveGround,a.ellipsoidMode=this.ellipsoidMode,this.dirty){a.componentData=this.componentParameters.type,a.cullFace=this.commonMaterialParameters.cullFace,a.doubleSidedMode=this.commonMaterialParameters.doubleSided?P.View:P.None,a.baseColorTexture=r(this.baseColorTexture),a.isSchematic=this.hasParametersFromSource&&!r(this.baseColorTexture);const e=this._computeWhichMaterialPass();a.blendingEnabled=e===A.Transparent||e===A.OpaqueAndTransparent,a.alphaDiscardMode=this.alphaDiscardMode,a.integratedMeshMode=this.isIntegratedMesh?this.overlayColor?this.overlayNormal?c.ColorOverlayWithWater:c.ColorOverlay:c.NoOverlay:c.None,a.polygonOffsetEnabled=this.polygonOffsetEnabled,this._setClean()}return a.slicePlaneEnabled=t.slicePlaneEnabled&&this.commonMaterialParameters.slicePlaneEnabled,t.identifier===x.ShadowMap?(a.output=O.Shadow,a.vertexDiscardMode=v.None):t.identifier===x.Highlight?(a.output=O.Highlight,a.vertexDiscardMode=v.None):(this._computeWhichMaterialPass()===A.OpaqueAndTransparent?a.vertexDiscardMode=t.transparent?v.Opaque:v.Transparent:a.vertexDiscardMode=v.None,a.output=k(t.subPass),t.subPass===M.Alpha&&(a.sceneHasOcludees=t.sceneHasOcludees),t.subPass===M.Color?(a.receiveAmbientOcclusion=t.ambientOcclusionEnabled,a.sceneHasOcludees=t.sceneHasOcludees,a.receiveShadows=t.shadowsEnabled,a.ssrEnabled=t.ssrParams.ssrEnabled):(a.receiveAmbientOcclusion=!1,a.receiveShadows=!1)),this._technique=e.releaseAndAcquire(d,a,this._technique),this._technique}submit(e,t){if(0===this.objectOpacity)return;const s=t.renderable.geometry,a=t.components,o=t.renderable.drawParameters,i=t.renderable.meta.cameraDepthSquared,n=a.geometryRanges,l=a.highlightRanges,p=a.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case A.Opaque:e.materialOpaque.submitDraw(this,s,n,o,i);break;case A.Transparent:e.materialTransparent.submitDraw(this,s,n,o,i);break;case A.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,s,n,o,i),e.materialTransparent.submitDraw(this,s,n,o,i);break;case A.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,s,n,o,i),this.overlayHighlight&&e.highlightIntegratedMesh.submitDraw(this,s,n,o,i)}const h=this.componentParameters.castShadows!==j.None;h&&e.shadowMap.submitDraw(this,s,n,o,i),r(l)&&(e.highlight.submitDraw(this,s,l,o,i),h&&e.highlightShadowMap.submitDraw(this,s,l,o,i)),h&&r(p)&&e.defaultShadowMap.submitDraw(this,s,p,o,i)}get attributeLocations(){return y}_computeWhichMaterialPass(){return this.isIntegratedMesh?A.IntegratedMesh:this.objectOpacity<1?A.Transparent:this.componentParameters.opaqueOverride===j.All?A.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===E.Blend||this.alphaDiscardMode===E.MaskBlend?A.Transparent:this.componentParameters.transparent===j.None?A.Opaque:this.componentParameters.transparent===j.All?A.Transparent:A.OpaqueAndTransparent}}var S,A,j;e([b({vectorOps:n})],N.prototype,"baseColor",void 0),e([b()],N.prototype,"usePBR",void 0),e([b()],N.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:s})],N.prototype,"mrrFactors",void 0),e([b({vectorOps:s})],N.prototype,"emissiveFactor",void 0),e([b({dispose:!0})],N.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],N.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],N.prototype,"emissionTexture",void 0),e([b({dispose:!0})],N.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],N.prototype,"normalTexture",void 0),e([b({vectorOps:{equals:o,copy:i}})],N.prototype,"overlayTexOffset",void 0),e([b({vectorOps:{equals:o,copy:i}})],N.prototype,"overlayTexScale",void 0),e([b()],N.prototype,"overlayColor",void 0),e([b()],N.prototype,"overlayHighlight",void 0),e([b()],N.prototype,"overlayNormal",void 0),e([b()],N.prototype,"objectOpacity",void 0),e([T()],N.prototype,"commonMaterialParameters",void 0),e([T()],N.prototype,"componentParameters",void 0),e([b()],N.prototype,"alphaCutoff",void 0),e([b()],N.prototype,"alphaDiscardMode",void 0),e([b()],N.prototype,"isIntegratedMesh",void 0),e([b()],N.prototype,"polygonOffsetEnabled",void 0),e([b()],N.prototype,"ellipsoidMode",void 0),e([b()],N.prototype,"sceneHasOcludees",void 0),function(e){e[e.VERTEX=0]="VERTEX",e[e.GROUND=1]="GROUND",e[e.SCREEN_DERIVATIVE=2]="SCREEN_DERIVATIVE"}(S||(S={})),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(A||(A={}));class R extends f{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=D.Back,this.slicePlaneEnabled=!0}}e([b()],R.prototype,"doubleSided",void 0),e([b()],R.prototype,"cullFace",void 0),e([b()],R.prototype,"slicePlaneEnabled",void 0);class I extends f{constructor(){super(...arguments),this.externalColor=l(1,1,1,1),this.externalColorMixMode=h.Multiply,this.castShadows=j.All}get transparent(){return this.externalColor[3]<1?j.All:j.None}get opaqueOverride(){return this.externalColorMixMode===h.Replace&&1===this.externalColor[3]?j.All:j.None}get visible(){return this.externalColor[3]>0?j.All:j.None}get type(){return m.Uniform}}e([b({vectorOps:n})],I.prototype,"externalColor",void 0),e([b()],I.prototype,"externalColorMixMode",void 0),e([b()],I.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(j||(j={}));class _ extends f{constructor(){super(...arguments),this.texture=null,this.transparent=j.None,this.opaqueOverride=j.None,this.castShadows=j.None}get type(){return m.Varying}}function k(e){switch(e){case M.Color:return O.Color;case M.Alpha:return O.Alpha;case M.Depth:return O.Depth;case M.Normal:return O.Normal}}e([b()],_.prototype,"texture",void 0),e([b()],_.prototype,"transparent",void 0),e([b()],_.prototype,"opaqueOverride",void 0),e([b()],_.prototype,"castShadows",void 0);export{R as CommonMaterialParameters,N as ComponentMaterial,j as ComponentParameterSummary,I as ComponentParametersUniform,_ as ComponentParametersVarying,S as ShadingNormalSource};
@@ -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{isSome as r}from"../../../../../../core/maybe.js";import{c as o}from"../../../../../../chunks/mat3f64.js";import{c as t}from"../../../../../../chunks/vec4f64.js";import{ComponentDataType as i}from"./shader/ComponentData.glsl.js";import{C as a}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as s}from"./shader/VertexDiscardByOpacity.glsl.js";import{RenderPassIdentifier as n,MaterialSubPass as l}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as d}from"../../../core/shaderLibrary/ShaderOutputOptions.js";import{bindSliceUniforms as p}from"../../../core/shaderLibrary/Slice.glsl.js";import{NormalAttribute as u}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as c}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexPosition as m}from"../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{bindOutputHighlight as h}from"../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import{Normals as b}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{bindPBRUniforms as T,PBRMode as f}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{bindSSRUniforms as x}from"../../../core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import{doublePrecisionRequiresObfuscation as g}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{EllipsoidMode as v}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{ReloadableShaderModule as y}from"../../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as M}from"../../../core/shaderTechnique/ShaderTechnique.js";import{parameter as C,ShaderTechniqueConfiguration as O}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as N,AlphaDiscardMode as S,TransparencyPassType as P,StencilBits as E}from"../../../lib/basicInterfaces.js";import{blendingDefault as j,oitBlending as U,oitDepthTest as D,OITPolygonOffset as A}from"../../../lib/OrderIndependentTransparency.js";import{Program as w}from"../../../lib/Program.js";import{stencilWriteMaskOn as F,replaceBitWhenDepthTestPasses as R,stencilBaseAllZerosParams as L}from"../../../lib/StencilUtils.js";import{makePipelineState as W,cullingParams as _,defaultDepthWriteParams as V,defaultColorWriteParams as G}from"../../../../../webgl/renderState.js";class q extends M{bindPass(e){const r=this.program;m.bindViewProjTransform(r,e.viewTransform),p(this.program,this.configuration,e.slicePlane),e.identifier===n.Material&&(void 0!==e.ssrParams&&x(this.program,e.ssrParams),r.setUniformMatrix3fv("uTransformNormal_ViewFromGlobal",e.transformNormal_ViewFromGlobal),e.subPass===l.Depth&&r.setUniform2fv("cameraNearFar",e.cameraNearFar),e.subPass===l.Color&&e.lighting.setUniforms(this.program,e.integratedMesh)),e.identifier===n.ShadowMap&&this.program.setUniform2fv("cameraNearFar",e.cameraNearFar)}bindMaterial(e,o){this._material=e;const t=this.program;t.setUniform4fv("uBaseColor",e.baseColor),t.setUniform1f("uObjectOpacity",e.objectOpacity),t.setUniform1f("textureAlphaCutoff",e.alphaCutoff),e.componentParameters.type===i.Varying?e.componentParameters.texture.bind(t,"uComponentColorTex","uComponentColorTexInvDim"):(t.setUniform4fv("uExternalColor",e.componentParameters.externalColor),t.setUniform1i("uExternalColorMixMode",e.componentParameters.externalColorMixMode)),r(e.baseColorTexture)&&e.baseColorTexture.bind(t,"uBaseColorTexture","uBaseColorTextureSize"),this.configuration.output!==d.Color&&this.configuration.output!==d.Alpha||(T(this.program,e,this.configuration.isSchematic),r(e.metallicRoughnessTexture)&&e.metallicRoughnessTexture.bind(t,"texMetallicRoughness","texMetallicRoughnessSize"),r(e.emissionTexture)&&e.emissionTexture.bind(t,"texEmission","texEmissionSize"),r(e.occlusionTexture)&&e.occlusionTexture.bind(t,"texOcclusion","texOcclusionSize"),r(e.normalTexture)&&e.normalTexture.bind(t,"normalTexture","normalTextureSize")),e.isIntegratedMesh&&(o.identifier===n.Material&&o.subPass===l.Color?(t.bindTexture(e.overlayColor,"ovColorTex"),t.bindTexture(e.overlayNormal,"ovNormalTex")):o.identifier===n.Highlight&&t.bindTexture(e.overlayHighlight,"ovColorTex"),t.setUniform1f("overlayOpacity",1)),o.identifier===n.Highlight&&h(this.program,o),o.identifier===n.Material&&o.subPass===l.Color&&(o.ambientOcclusionEnabled&&o.bindAmbientOcclusion(t),o.shadowsEnabled&&o.bindShadowMap(t)),o.identifier!==n.Material||o.subPass!==l.Color&&o.subPass!==l.Alpha||!o.multipassTerrainParams.multipassTerrainEnabled||(this.program.setUniform2fv("cameraNearFar",o.cameraNearFar),t.setUniform2fv("inverseViewport",o.inverseViewport),o.multipassTerrainParams.terrainLinearDepthTexture&&t.bindTexture(o.multipassTerrainParams.terrainLinearDepthTexture,"terrainDepthTexture"))}bindDraw(e){if(m.bindModelTransform(this.program,e),this.program.setUniformMatrix3fv("uTransformNormal_GlobalFromModel",e.transformNormal_GlobalFromModel),this.program.rebindTextures(),r(this._material)&&this._material.isIntegratedMesh){const r=this._material.overlayTexScale,o=this._material.overlayTexOffset;this.program.setUniform4fv("overlayTexOffset",[e.toMapSpace[0]*r[0]+o[0],e.toMapSpace[1]*r[1]+o[1],e.toMapSpace[0]*r[2]+o[2],e.toMapSpace[1]*r[3]+o[3]]),this.program.setUniform4fv("overlayTexScale",[e.toMapSpace[2]*r[0],e.toMapSpace[3]*r[1],e.toMapSpace[2]*r[2],e.toMapSpace[3]*r[3]])}}initializeProgram(e){const r=q.shader.get(),o=this.configuration,t=r.build({multipassTerrainEnabled:o.multipassTerrainEnabled,cullAboveGround:o.cullAboveGround,OITEnabled:o.transparencyPassType===P.Color,output:o.output,normalType:o.integratedMeshMode===I.None?o.hasNormals?u.Type.CompressedAttribute:u.Type.ScreenDerivative:u.Type.Ground,attributeColor:o.hasVertexColors,attributeTextureCoordinates:o.vertexTextureCoordinates,componentData:o.componentData,alphaDiscardMode:o.alphaDiscardMode,baseColorTexture:o.baseColorTexture,doubleSidedMode:o.doubleSidedMode,receiveAmbientOcclusion:o.receiveAmbientOcclusion,receiveShadows:o.receiveShadows,slicePlaneEnabled:o.slicePlaneEnabled,sliceHighlightDisabled:!1,sliceEnabledForVertexPrograms:!1,viewingMode:e.viewingMode,vertexDiscardMode:o.vertexDiscardMode,pbrMode:o.integratedMeshMode===I.ColorOverlayWithWater?f.WaterOnIntegratedMesh:o.usePBR?o.isSchematic?f.Schematic:f.Normal:f.Disabled,hasMetalnessAndRoughnessTexture:o.hasMetalnessAndRoughnessTexture,hasEmissionTexture:o.hasEmissionTexture,hasOcclusionTexture:o.hasOcclusionTexture,hasNormalTexture:o.hasNormalTexture,vertexTangents:!1,supportsTextureAtlas:!0,doublePrecisionRequiresObfuscation:g(e.rctx),overlayEnabled:o.integratedMeshMode===I.ColorOverlay||o.integratedMeshMode===I.ColorOverlayWithWater,ssrEnabled:o.ssrEnabled,highStepCount:!1,ellipsoidMode:o.ellipsoidMode});return new w(e.rctx,t,r.attributeLocations)}_setPipelineState(e){const r=this.configuration,o=r.integratedMeshMode!==I.None,t=e===P.NONE,i=e===P.FrontFace;return W({blending:r.output!==d.Color&&r.output!==d.Alpha||!r.blendingEnabled?null:t?j:U(e),culling:_(r.cullFace),depthTest:{func:D(e)},depthWrite:t||i?V:null,colorWrite:G,stencilWrite:o||r.sceneHasOcludees?F:null,stencilTest:o?R(E.IntegratedMeshMaskExcluded):r.sceneHasOcludees?L:null,polygonOffset:t||i?r.polygonOffsetEnabled?{factor:2,units:2}:null:A})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}q.shader=new y(a,(()=>import("./shader/ComponentShader.glsl.js")));class B extends m.ModelTransform{constructor(){super(...arguments),this.transformNormal_GlobalFromModel=o(),this.toMapSpace=t()}}var H,I;!function(e){e[e.None=0]="None",e[e.Transparent=1]="Transparent",e[e.Opaque=2]="Opaque",e[e.COUNT=3]="COUNT"}(H||(H={})),function(e){e[e.None=0]="None",e[e.NoOverlay=1]="NoOverlay",e[e.ColorOverlay=2]="ColorOverlay",e[e.ColorOverlayWithWater=3]="ColorOverlayWithWater",e[e.COUNT=4]="COUNT"}(I||(I={}));class z extends O{constructor(){super(...arguments),this.output=d.Color,this.hasVertexColors=!1,this.hasNormals=!1,this.vertexTextureCoordinates=c.AttributeType.None,this.componentData=i.Uniform,this.slicePlaneEnabled=!1,this.cullFace=N.Back,this.baseColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.vertexDiscardMode=s.None,this.doubleSidedMode=b.DoubleSidedMode.WindingOrder,this.blendingEnabled=!0,this.alphaDiscardMode=S.Opaque,this.integratedMeshMode=I.None,this.ssrEnabled=!1,this.polygonOffsetEnabled=!1,this.usePBR=!1,this.isSchematic=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.sceneHasOcludees=!1,this.transparencyPassType=P.NONE,this.ellipsoidMode=v.Earth,this.multipassTerrainEnabled=!1,this.cullAboveGround=!1}}e([C({count:d.COUNT})],z.prototype,"output",void 0),e([C()],z.prototype,"hasVertexColors",void 0),e([C()],z.prototype,"hasNormals",void 0),e([C({count:c.AttributeType.COUNT})],z.prototype,"vertexTextureCoordinates",void 0),e([C({count:i.COUNT})],z.prototype,"componentData",void 0),e([C()],z.prototype,"slicePlaneEnabled",void 0),e([C({count:N.COUNT})],z.prototype,"cullFace",void 0),e([C()],z.prototype,"baseColorTexture",void 0),e([C()],z.prototype,"receiveAmbientOcclusion",void 0),e([C()],z.prototype,"receiveShadows",void 0),e([C({count:s.COUNT})],z.prototype,"vertexDiscardMode",void 0),e([C({count:b.DoubleSidedMode.COUNT})],z.prototype,"doubleSidedMode",void 0),e([C()],z.prototype,"blendingEnabled",void 0),e([C({count:S.COUNT})],z.prototype,"alphaDiscardMode",void 0),e([C({count:I.COUNT})],z.prototype,"integratedMeshMode",void 0),e([C()],z.prototype,"ssrEnabled",void 0),e([C()],z.prototype,"polygonOffsetEnabled",void 0),e([C()],z.prototype,"usePBR",void 0),e([C()],z.prototype,"isSchematic",void 0),e([C()],z.prototype,"hasMetalnessAndRoughnessTexture",void 0),e([C()],z.prototype,"hasEmissionTexture",void 0),e([C()],z.prototype,"hasOcclusionTexture",void 0),e([C()],z.prototype,"hasNormalTexture",void 0),e([C()],z.prototype,"sceneHasOcludees",void 0),e([C({count:P.COUNT})],z.prototype,"transparencyPassType",void 0),e([C({count:v.COUNT})],z.prototype,"ellipsoidMode",void 0),e([C()],z.prototype,"multipassTerrainEnabled",void 0),e([C()],z.prototype,"cullAboveGround",void 0);export{B as ComponentDrawParameters,q as ComponentTechnique,z as ComponentTechniqueConfiguration,I as IntegratedMeshMode,H as PassDiscardMode};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{isSome as r}from"../../../../../../core/maybe.js";import{c as o}from"../../../../../../chunks/mat3f64.js";import{c as t}from"../../../../../../chunks/vec4f64.js";import{ComponentDataType as i}from"./shader/ComponentData.glsl.js";import{C as s}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as a}from"./shader/VertexDiscardByOpacity.glsl.js";import{RenderPassIdentifier as n,MaterialSubPass as l}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as d}from"../../../core/shaderLibrary/ShaderOutputOptions.js";import{bindSliceUniforms as p}from"../../../core/shaderLibrary/Slice.glsl.js";import{NormalAttributeType as u}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as c}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{bindViewProjTransform as h,bindModelTransform as m,VertexPositionModelTransform as b}from"../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{bindOutputHighlight as f}from"../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import{NormalsDoubleSidedMode as T}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{bindPBRUniforms as x,PBRMode as g}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{bindSSRUniforms as v}from"../../../core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import{doublePrecisionRequiresObfuscation as y}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{EllipsoidMode as M}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{ReloadableShaderModule as C}from"../../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as O}from"../../../core/shaderTechnique/ShaderTechnique.js";import{parameter as N,ShaderTechniqueConfiguration as S}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as P,AlphaDiscardMode as E,TransparencyPassType as U,StencilBits as j}from"../../../lib/basicInterfaces.js";import{blendingDefault as D,oitBlending as A,oitDepthTest as w,OITPolygonOffset as F}from"../../../lib/OrderIndependentTransparency.js";import{Program as R}from"../../../lib/Program.js";import{stencilWriteMaskOn as L,replaceBitWhenDepthTestPasses as W,stencilBaseAllZerosParams as V}from"../../../lib/StencilUtils.js";import{makePipelineState as G,cullingParams as q,defaultDepthWriteParams as H,defaultColorWriteParams as _}from"../../../../../webgl/renderState.js";class z extends O{bindPass(e){const r=this.program;h(r,e.viewTransform),p(this.program,this.configuration,e.slicePlane),e.identifier===n.Material&&(void 0!==e.ssrParams&&v(this.program,e.ssrParams),r.setUniformMatrix3fv("transformNormalViewFromGlobal",e.transformNormalViewFromGlobal),e.subPass===l.Depth&&r.setUniform2fv("nearFar",e.nearFar),e.subPass===l.Color&&e.lighting.setUniforms(this.program,e.integratedMesh)),e.identifier===n.ShadowMap&&this.program.setUniform2fv("nearFar",e.nearFar)}bindMaterial(e,o){this._material=e;const t=this.program;t.setUniform4fv("baseColor",e.baseColor),t.setUniform1f("objectOpacity",e.objectOpacity),t.setUniform1f("textureAlphaCutoff",e.alphaCutoff),e.componentParameters.type===i.Varying?e.componentParameters.texture.bind(t,"componentColorTex","componentColorTexInvDim"):(t.setUniform4fv("externalColor",e.componentParameters.externalColor),t.setUniform1i("externalColorMixMode",e.componentParameters.externalColorMixMode)),r(e.baseColorTexture)&&e.baseColorTexture.bind(t,"baseColorTexture","baseColorTextureSize"),this.configuration.output!==d.Color&&this.configuration.output!==d.Alpha||(x(this.program,e,this.configuration.isSchematic),r(e.metallicRoughnessTexture)&&e.metallicRoughnessTexture.bind(t,"texMetallicRoughness","texMetallicRoughnessSize"),r(e.emissionTexture)&&e.emissionTexture.bind(t,"texEmission","texEmissionSize"),r(e.occlusionTexture)&&e.occlusionTexture.bind(t,"texOcclusion","texOcclusionSize"),r(e.normalTexture)&&e.normalTexture.bind(t,"normalTexture","normalTextureSize")),e.isIntegratedMesh&&(o.identifier===n.Material&&o.subPass===l.Color?(t.bindTexture(e.overlayColor,"ovColorTex"),t.bindTexture(e.overlayNormal,"ovNormalTex")):o.identifier===n.Highlight&&t.bindTexture(e.overlayHighlight,"ovColorTex"),t.setUniform1f("overlayOpacity",1)),o.identifier===n.Highlight&&f(this.program,o),o.identifier===n.Material&&o.subPass===l.Color&&(o.ambientOcclusionEnabled&&o.bindAmbientOcclusion(t),o.shadowsEnabled&&o.bindShadowMap(t)),o.identifier!==n.Material||o.subPass!==l.Color&&o.subPass!==l.Alpha||!o.multipassTerrainParams.multipassTerrainEnabled||(this.program.setUniform2fv("nearFar",o.nearFar),t.setUniform2fv("inverseViewport",o.inverseViewport),o.multipassTerrainParams.terrainLinearDepthTexture&&t.bindTexture(o.multipassTerrainParams.terrainLinearDepthTexture,"terrainDepthTexture"))}bindDraw(e){if(m(this.program,e),this.program.setUniformMatrix3fv("transformNormalGlobalFromModel",e.transformNormalGlobalFromModel),this.program.rebindTextures(),r(this._material)&&this._material.isIntegratedMesh){const r=this._material.overlayTexScale,o=this._material.overlayTexOffset;this.program.setUniform4fv("overlayTexOffset",[e.toMapSpace[0]*r[0]+o[0],e.toMapSpace[1]*r[1]+o[1],e.toMapSpace[0]*r[2]+o[2],e.toMapSpace[1]*r[3]+o[3]]),this.program.setUniform4fv("overlayTexScale",[e.toMapSpace[2]*r[0],e.toMapSpace[3]*r[1],e.toMapSpace[2]*r[2],e.toMapSpace[3]*r[3]])}}initializeProgram(e){const r=z.shader.get(),o=this.configuration,t=r.build({multipassTerrainEnabled:o.multipassTerrainEnabled,cullAboveGround:o.cullAboveGround,oitEnabled:o.transparencyPassType===U.Color,output:o.output,normalType:o.integratedMeshMode===B.None?o.hasNormals?u.CompressedAttribute:u.ScreenDerivative:u.Ground,attributeColor:o.hasVertexColors,attributeTextureCoordinates:o.vertexTextureCoordinates,componentData:o.componentData,alphaDiscardMode:o.alphaDiscardMode,baseColorTexture:o.baseColorTexture,doubleSidedMode:o.doubleSidedMode,receiveAmbientOcclusion:o.receiveAmbientOcclusion,receiveShadows:o.receiveShadows,slicePlaneEnabled:o.slicePlaneEnabled,sliceHighlightDisabled:!1,sliceEnabledForVertexPrograms:!1,viewingMode:e.viewingMode,vertexDiscardMode:o.vertexDiscardMode,pbrMode:o.integratedMeshMode===B.ColorOverlayWithWater?g.WaterOnIntegratedMesh:o.usePBR?o.isSchematic?g.Schematic:g.Normal:g.Disabled,hasMetalnessAndRoughnessTexture:o.hasMetalnessAndRoughnessTexture,hasEmissionTexture:o.hasEmissionTexture,hasOcclusionTexture:o.hasOcclusionTexture,hasNormalTexture:o.hasNormalTexture,vertexTangents:!1,supportsTextureAtlas:!0,doublePrecisionRequiresObfuscation:y(e.rctx),overlayEnabled:o.integratedMeshMode===B.ColorOverlay||o.integratedMeshMode===B.ColorOverlayWithWater,ssrEnabled:o.ssrEnabled,highStepCount:!1,ellipsoidMode:o.ellipsoidMode});return new R(e.rctx,t,r.attributeLocations)}_setPipelineState(e){const r=this.configuration,o=r.integratedMeshMode!==B.None,t=e===U.NONE,i=e===U.FrontFace;return G({blending:r.output!==d.Color&&r.output!==d.Alpha||!r.blendingEnabled?null:t?D:A(e),culling:q(r.cullFace),depthTest:{func:w(e)},depthWrite:t||i?H:null,colorWrite:_,stencilWrite:o||r.sceneHasOcludees?L:null,stencilTest:o?W(j.IntegratedMeshMaskExcluded):r.sceneHasOcludees?V:null,polygonOffset:t||i?r.polygonOffsetEnabled?{factor:2,units:2}:null:F})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}z.shader=new C(s,(()=>import("./shader/ComponentShader.glsl.js")));class I extends b{constructor(){super(...arguments),this.transformNormalGlobalFromModel=o(),this.toMapSpace=t()}}var k,B;!function(e){e[e.None=0]="None",e[e.Transparent=1]="Transparent",e[e.Opaque=2]="Opaque",e[e.COUNT=3]="COUNT"}(k||(k={})),function(e){e[e.None=0]="None",e[e.NoOverlay=1]="NoOverlay",e[e.ColorOverlay=2]="ColorOverlay",e[e.ColorOverlayWithWater=3]="ColorOverlayWithWater",e[e.COUNT=4]="COUNT"}(B||(B={}));class J extends S{constructor(){super(...arguments),this.output=d.Color,this.hasVertexColors=!1,this.hasNormals=!1,this.vertexTextureCoordinates=c.None,this.componentData=i.Uniform,this.slicePlaneEnabled=!1,this.cullFace=P.Back,this.baseColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.vertexDiscardMode=a.None,this.doubleSidedMode=T.WindingOrder,this.blendingEnabled=!0,this.alphaDiscardMode=E.Opaque,this.integratedMeshMode=B.None,this.ssrEnabled=!1,this.polygonOffsetEnabled=!1,this.usePBR=!1,this.isSchematic=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.sceneHasOcludees=!1,this.transparencyPassType=U.NONE,this.ellipsoidMode=M.Earth,this.multipassTerrainEnabled=!1,this.cullAboveGround=!1}}e([N({count:d.COUNT})],J.prototype,"output",void 0),e([N()],J.prototype,"hasVertexColors",void 0),e([N()],J.prototype,"hasNormals",void 0),e([N({count:c.COUNT})],J.prototype,"vertexTextureCoordinates",void 0),e([N({count:i.COUNT})],J.prototype,"componentData",void 0),e([N()],J.prototype,"slicePlaneEnabled",void 0),e([N({count:P.COUNT})],J.prototype,"cullFace",void 0),e([N()],J.prototype,"baseColorTexture",void 0),e([N()],J.prototype,"receiveAmbientOcclusion",void 0),e([N()],J.prototype,"receiveShadows",void 0),e([N({count:a.COUNT})],J.prototype,"vertexDiscardMode",void 0),e([N({count:T.COUNT})],J.prototype,"doubleSidedMode",void 0),e([N()],J.prototype,"blendingEnabled",void 0),e([N({count:E.COUNT})],J.prototype,"alphaDiscardMode",void 0),e([N({count:B.COUNT})],J.prototype,"integratedMeshMode",void 0),e([N()],J.prototype,"ssrEnabled",void 0),e([N()],J.prototype,"polygonOffsetEnabled",void 0),e([N()],J.prototype,"usePBR",void 0),e([N()],J.prototype,"isSchematic",void 0),e([N()],J.prototype,"hasMetalnessAndRoughnessTexture",void 0),e([N()],J.prototype,"hasEmissionTexture",void 0),e([N()],J.prototype,"hasOcclusionTexture",void 0),e([N()],J.prototype,"hasNormalTexture",void 0),e([N()],J.prototype,"sceneHasOcludees",void 0),e([N({count:U.COUNT})],J.prototype,"transparencyPassType",void 0),e([N({count:M.COUNT})],J.prototype,"ellipsoidMode",void 0),e([N()],J.prototype,"multipassTerrainEnabled",void 0),e([N()],J.prototype,"cullAboveGround",void 0);export{I as ComponentDrawParameters,z as ComponentTechnique,J as ComponentTechniqueConfiguration,B as IntegratedMeshMode,k as PassDiscardMode};
@@ -2,13 +2,13 @@
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{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{glsl as e}from"../../../../core/shaderModules/interfaces.js";import{VertexAttribute as r}from"../../../../lib/basicInterfaces.js";var n;function l(l,t){t.componentData===n.Varying&&(l.vertex.uniforms.add("uComponentColorTex","sampler2D"),l.vertex.uniforms.add("uComponentColorTexInvDim","vec2"),l.attributes.add(r.COMPONENTINDEX,"float"),l.varyings.add("vExternalColorMixMode","mediump float"),l.varyings.add("vExternalColor","vec4"),l.include(o),l.vertex.code.add(e`vec4 _readComponentColor() {
6
- float normalizedIndex = (componentIndex + 0.5) * uComponentColorTexInvDim.x;
5
+ import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{glsl as e}from"../../../../core/shaderModules/interfaces.js";import{VertexAttribute as r}from"../../../../lib/VertexAttribute.js";var n;function l(l,t){t.componentData===n.Varying&&(l.vertex.uniforms.add("componentColorTex","sampler2D"),l.vertex.uniforms.add("componentColorTexInvDim","vec2"),l.attributes.add(r.COMPONENTINDEX,"float"),l.varyings.add("vExternalColorMixMode","mediump float"),l.varyings.add("vExternalColor","vec4"),l.include(o),l.vertex.code.add(e`vec4 _readComponentColor() {
6
+ float normalizedIndex = (componentIndex + 0.5) * componentColorTexInvDim.x;
7
7
  vec2 indexCoord = vec2(
8
8
  mod(normalizedIndex, 1.0),
9
- (floor(normalizedIndex) + 0.5) * uComponentColorTexInvDim.y
9
+ (floor(normalizedIndex) + 0.5) * componentColorTexInvDim.y
10
10
  );
11
- return texture2D(uComponentColorTex, indexCoord);
11
+ return texture2D(componentColorTex, indexCoord);
12
12
  }
13
13
  vec4 forwardExternalColor(out bool castShadows) {
14
14
  vec4 componentColor = _readComponentColor() * 255.0;
@@ -22,11 +22,11 @@ return vExternalColor;
22
22
  }`),l.fragment.code.add(e`void readExternalColor(out vec4 externalColor, out int externalColorMixMode) {
23
23
  externalColor = vExternalColor;
24
24
  externalColorMixMode = int(vExternalColorMixMode);
25
- }`)),t.componentData===n.Uniform&&(l.vertex.uniforms.add("uExternalColor","vec4"),l.fragment.uniforms.add("uExternalColorMixMode","int"),l.varyings.add("vExternalColor","vec4"),l.vertex.code.add(e`vec4 forwardExternalColor(out bool castShadows) {
26
- vExternalColor = uExternalColor;
25
+ }`)),t.componentData===n.Uniform&&(l.vertex.uniforms.add("externalColor","vec4"),l.fragment.uniforms.add("externalColorMixMode","int"),l.varyings.add("vExternalColor","vec4"),l.vertex.code.add(e`vec4 forwardExternalColor(out bool castShadows) {
26
+ vExternalColor = externalColor;
27
27
  castShadows = true;
28
- return uExternalColor;
29
- }`),l.fragment.code.add(e`void readExternalColor(out vec4 externalColor, out int externalColorMixMode) {
30
- externalColor = vExternalColor;
31
- externalColorMixMode = uExternalColorMixMode;
28
+ return externalColor;
29
+ }`),l.fragment.code.add(e`void readExternalColor(out vec4 color, out int colorMixMode) {
30
+ color = vExternalColor;
31
+ colorMixMode = externalColorMixMode;
32
32
  }`))}!function(o){o[o.Uniform=0]="Uniform",o[o.Varying=1]="Varying",o[o.COUNT=2]="COUNT"}(n||(n={}));export{l as ComponentData,n as ComponentDataType};
@@ -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"../../../../../../../geometry/support/Ellipsoid.js";import"../../../../../../ViewingMode.js";import"./ComponentData.glsl.js";import"./VertexDiscardByOpacity.glsl.js";import"../../../../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../../../../core/shaderLibrary/ShaderOutputOptions.js";import"../../../../core/shaderLibrary/Slice.glsl.js";import"../../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../../core/shaderLibrary/output/ReadLinearDepth.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeShadingNormal.glsl.js";import"../../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../../../../core/shaderLibrary/util/EllipsoidMode.js";import"../../../../core/shaderModules/interfaces.js";import"../../../../core/shaderModules/ShaderBuilder.js";import"../../../../lib/basicInterfaces.js";export{a as attributeLocations,b as build}from"../../../../../../../chunks/ComponentShader.glsl.js";
5
+ import"../../../../../../../geometry/support/Ellipsoid.js";import"../../../../../../ViewingMode.js";import"./ComponentData.glsl.js";import"./VertexDiscardByOpacity.glsl.js";import"../../../../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../../../../core/shaderLibrary/ShaderOutputOptions.js";import"../../../../core/shaderLibrary/Slice.glsl.js";import"../../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../../core/shaderLibrary/output/ReadLinearDepth.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeShadingNormal.glsl.js";import"../../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../../../../core/shaderLibrary/util/EllipsoidMode.js";import"../../../../core/shaderModules/interfaces.js";import"../../../../core/shaderModules/ShaderBuilder.js";import"../../../../lib/VertexAttribute.js";export{a as attributeLocations,b as build}from"../../../../../../../chunks/ComponentShader.glsl.js";
@@ -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{newLayout as e}from"../../../support/buffer/InterleavedLayout.js";import{TextureCoordinateAttribute as t}from"../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexAttribute as r}from"../../lib/basicInterfaces.js";function o(o){const i=e().vec3f(r.POSITION);return o.normals&&i.vec2i16(r.NORMALCOMPRESSED,{glNormalized:!0}),o.textureCoordinates===t.AttributeType.Default?i.vec2f(r.UV0):o.textureCoordinates===t.AttributeType.Atlas&&(i.vec2f(r.UV0),i.vec4u16(r.UVREGION,{glNormalized:!0})),o.colors&&i.vec4u8(r.COLOR,{glNormalized:!0}),i.alignTo(4)}export{o as createVertexBufferLayout};
5
+ import{newLayout as e}from"../../../support/buffer/InterleavedLayout.js";import{TextureCoordinateAttributeType as r}from"../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexAttribute as t}from"../../lib/VertexAttribute.js";function o(o){const i=e().vec3f(t.POSITION);return o.normals&&i.vec2i16(t.NORMALCOMPRESSED,{glNormalized:!0}),o.textureCoordinates===r.Default?i.vec2f(t.UV0):o.textureCoordinates===r.Atlas&&(i.vec2f(t.UV0),i.vec4u16(t.UVREGION,{glNormalized:!0})),o.colors&&i.vec4u8(t.COLOR,{glNormalized:!0}),i.alignTo(4)}export{o as createVertexBufferLayout};
@@ -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{c as s}from"../../../../../chunks/mat3f64.js";import{a as t}from"../../../../../chunks/vec2f64.js";import{c as r}from"../../../../../chunks/vec4f64.js";import{c as e}from"../../../../../chunks/boundedPlane.js";import{VertexPosition as i}from"../shaderLibrary/attributes/VertexPosition.glsl.js";import{TransparencyPassType as a}from"../../lib/basicInterfaces.js";var o,n;!function(s){s[s.Material=0]="Material",s[s.ShadowMap=1]="ShadowMap",s[s.Highlight=2]="Highlight"}(o||(o={})),function(s){s[s.Color=0]="Color",s[s.Alpha=1]="Alpha",s[s.Depth=2]="Depth",s[s.Normal=3]="Normal"}(n||(n={}));class h{constructor(){this.viewTransform=new i.ViewProjectionTransform,this.slicePlane=e()}}class c extends h{constructor(){super(...arguments),this.identifier=o.Material,this.slicePlaneEnabled=!0,this.transparent=!1,this.integratedMesh=!1,this.transformNormal_ViewFromGlobal=s(),this.cameraNearFar=t(),this.inverseViewport=t(),this.ambientOcclusionEnabled=!0,this.shadowsEnabled=!0,this.sceneHasOcludees=!1,this.transparencyPassType=a.NONE}}class l extends h{constructor(){super(...arguments),this.identifier=o.ShadowMap,this.cameraNearFar=t()}}class m extends h{constructor(){super(...arguments),this.identifier=o.Highlight,this.inverseViewport=t(),this.viewport=r()}}export{m as HighlightPassParameters,c as MaterialPassesParameters,n as MaterialSubPass,h as PassParameters,o as RenderPassIdentifier,l as ShadowMapPassParameters};
5
+ import{c as s}from"../../../../../chunks/mat3f64.js";import{a as t}from"../../../../../chunks/vec2f64.js";import{c as i}from"../../../../../chunks/vec4f64.js";import{c as e}from"../../../../../chunks/boundedPlane.js";import{VertexPositionViewProjectionTransform as r}from"../shaderLibrary/attributes/VertexPosition.glsl.js";import{TransparencyPassType as a}from"../../lib/basicInterfaces.js";var o,n;!function(s){s[s.Material=0]="Material",s[s.ShadowMap=1]="ShadowMap",s[s.Highlight=2]="Highlight"}(o||(o={})),function(s){s[s.Color=0]="Color",s[s.Alpha=1]="Alpha",s[s.Depth=2]="Depth",s[s.Normal=3]="Normal"}(n||(n={}));class h{constructor(){this.viewTransform=new r,this.slicePlane=e()}}class c extends h{constructor(){super(...arguments),this.identifier=o.Material,this.slicePlaneEnabled=!0,this.transparent=!1,this.integratedMesh=!1,this.transformNormalViewFromGlobal=s(),this.nearFar=t(),this.inverseViewport=t(),this.ambientOcclusionEnabled=!0,this.shadowsEnabled=!0,this.sceneHasOcludees=!1,this.transparencyPassType=a.NONE}}class l extends h{constructor(){super(...arguments),this.identifier=o.ShadowMap,this.nearFar=t()}}class p extends h{constructor(){super(...arguments),this.identifier=o.Highlight,this.inverseViewport=t(),this.viewport=i()}}export{p as HighlightPassParameters,c as MaterialPassesParameters,n as MaterialSubPass,h as PassParameters,o as RenderPassIdentifier,l as ShadowMapPassParameters};