@arcgis/core 6.0.0-next.56 → 6.0.0-next.58

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 (695) hide show
  1. package/WebLinkChart.d.ts +0 -12
  2. package/WebLinkChart.js +1 -1
  3. package/applications/Components/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  4. package/applications/WebEditor/sketchUtils.js +1 -1
  5. package/arcade/arcadeCompiler.js +5 -5
  6. package/arcade/containerUtils.js +1 -1
  7. package/arcade/featureset/actions/Adapted.js +1 -1
  8. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  10. package/arcade/featureset/support/shared.js +1 -1
  11. package/arcade/featureset/support/sqlUtils.js +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/00c227bcecc28fe278bb.js +1 -0
  14. package/assets/esri/core/workers/chunks/075e6c60e741482e673f.js +1 -0
  15. package/assets/esri/core/workers/chunks/076c2098570ee885d117.js +1 -0
  16. package/assets/esri/core/workers/chunks/091ce6b3de590e1d9ff6.js +1 -0
  17. package/assets/esri/core/workers/chunks/099dec4103f6e7556eb0.js +1 -0
  18. package/assets/esri/core/workers/chunks/{77267e0807cbbc00496d.js → 0be55d9bab7c3510a7f2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{da69e8cd52aa77aa4c2c.js → 0fc1facd26c9ef96e081.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{f97dc99afe3375fc8e16.js → 1179a3574c580f7ce390.js} +1 -1
  21. package/assets/esri/core/workers/chunks/129140104be2620c0382.js +1 -0
  22. package/assets/esri/core/workers/chunks/1295fcf866e7347b2d53.js +1 -0
  23. package/assets/esri/core/workers/chunks/16219f0c56d6f6213c24.js +1 -0
  24. package/assets/esri/core/workers/chunks/185b317eec95f3370970.js +1 -0
  25. package/assets/esri/core/workers/chunks/1afc8820c283ef785729.js +1 -0
  26. package/assets/esri/core/workers/chunks/1bdef2e142e78341fec0.js +1 -0
  27. package/assets/esri/core/workers/chunks/1c874f86bfd0963aa3d2.js +1 -0
  28. package/assets/esri/core/workers/chunks/1ce0bf4ff14af8a68a5c.js +1 -0
  29. package/assets/esri/core/workers/chunks/1f1515313baeecc095a2.js +1 -0
  30. package/assets/esri/core/workers/chunks/1f710c91a82f6fd3d0f6.js +1 -0
  31. package/assets/esri/core/workers/chunks/{1894c39dabc78e7a5af8.js → 1fad7a7211bb8c9b58e3.js} +1 -1
  32. package/assets/esri/core/workers/chunks/24374aaa6fb3e12960d1.js +1 -0
  33. package/assets/esri/core/workers/chunks/24aa7b81814b4e519b01.js +1 -0
  34. package/assets/esri/core/workers/chunks/294097140e349e073b7e.js +1 -0
  35. package/assets/esri/core/workers/chunks/{c8c79d21dfce5695a089.js → 2b69fdf51b6f0b2abb75.js} +1 -1
  36. package/assets/esri/core/workers/chunks/2ba9b3b4d49eb2740a42.js +1 -0
  37. package/assets/esri/core/workers/chunks/2eb3297014f063fb4bc9.js +1 -0
  38. package/assets/esri/core/workers/chunks/2eb3cec44ce7587980a4.js +1 -0
  39. package/assets/esri/core/workers/chunks/2ee3cd6b2e5274932d31.js +1 -0
  40. package/assets/esri/core/workers/chunks/2f31766bc0f9d1d70c5a.js +1 -0
  41. package/assets/esri/core/workers/chunks/31df02c6f5b04a143ae6.js +1 -0
  42. package/assets/esri/core/workers/chunks/32d5aae2e0953420216a.js +1 -0
  43. package/assets/esri/core/workers/chunks/35109db6a6be66f895f7.js +1 -0
  44. package/assets/esri/core/workers/chunks/373b140f92eda3857f82.js +1 -0
  45. package/assets/esri/core/workers/chunks/3a1510650ce8de7edec8.js +1 -0
  46. package/assets/esri/core/workers/chunks/3b0933cea2a902a26bb7.js +1 -0
  47. package/assets/esri/core/workers/chunks/3d96676b94e8ecb6a4d1.js +1 -0
  48. package/assets/esri/core/workers/chunks/3edfd8ecf000b00a4a92.js +1 -0
  49. package/assets/esri/core/workers/chunks/3fc4b7d0ee460fc96176.js +1 -0
  50. package/assets/esri/core/workers/chunks/{f053cbfe671bd14c7d5b.js → 419d8116d8e7faccfed5.js} +1 -1
  51. package/assets/esri/core/workers/chunks/41d57b45cc2361305af3.js +1 -0
  52. package/assets/esri/core/workers/chunks/42ee1f8732e644371ea9.js +1 -0
  53. package/assets/esri/core/workers/chunks/4309f3e72c6332e01d75.js +1 -0
  54. package/assets/esri/core/workers/chunks/44ca7a56fb28227fdcbf.js +1 -0
  55. package/assets/esri/core/workers/chunks/4537f0866e903d2e9bb9.js +1 -0
  56. package/assets/esri/core/workers/chunks/49f61832e0d3b24e1608.js +1 -0
  57. package/assets/esri/core/workers/chunks/4a45505fb9a40b503672.js +29 -0
  58. package/assets/esri/core/workers/chunks/4b456c1f26d70392f7d4.js +1 -0
  59. package/assets/esri/core/workers/chunks/{28fae7da8cc4ae7a83e4.js → 4c510b1caffeec80dc6b.js} +1 -1
  60. package/assets/esri/core/workers/chunks/4ce5c9b658ba79a0b668.js +1 -0
  61. package/assets/esri/core/workers/chunks/{41694ee8990e799da225.js → 4d8f23b2e6721fb5b289.js} +1 -1
  62. package/assets/esri/core/workers/chunks/4fb8708666a614df583d.js +1 -0
  63. package/assets/esri/core/workers/chunks/4feec96a312dcc137911.js +1 -0
  64. package/assets/esri/core/workers/chunks/52ad9306fd40d488376d.js +1 -0
  65. package/assets/esri/core/workers/chunks/5375bdf46b602b19fa86.js +1 -0
  66. package/assets/esri/core/workers/chunks/549a8e7313f75ea3f85b.js +1 -0
  67. package/assets/esri/core/workers/chunks/55f97942c58455f47975.js +1 -0
  68. package/assets/esri/core/workers/chunks/566d72534d694c318e30.js +1 -0
  69. package/assets/esri/core/workers/chunks/5ce00674305e5716d27b.js +1 -0
  70. package/assets/esri/core/workers/chunks/5e032d209df500fad321.js +1 -0
  71. package/assets/esri/core/workers/chunks/{dfa1b0308e5e82d1ddfe.js → 5e4de4ddd3bdc74100e0.js} +34 -33
  72. package/assets/esri/core/workers/chunks/5ea8cdc28a81744913cd.js +1 -0
  73. package/assets/esri/core/workers/chunks/61565d4674cf77cbf1dd.js +1 -0
  74. package/assets/esri/core/workers/chunks/651e33be8bb3995d749f.js +1 -0
  75. package/assets/esri/core/workers/chunks/{d296c9561f6a6aeff973.js → 68b8dff748f1ef588653.js} +1 -1
  76. package/assets/esri/core/workers/chunks/690041373d03d02a3044.js +1 -0
  77. package/assets/esri/core/workers/chunks/{6d99e7e1aa007a6f1039.js → 69316db52d7bed746879.js} +1 -1
  78. package/assets/esri/core/workers/chunks/69384a9703abee1903c5.js +1 -0
  79. package/assets/esri/core/workers/chunks/6992a7728451c5a7b673.js +1 -0
  80. package/assets/esri/core/workers/chunks/69e5efe1acbdaddee90d.js +1 -0
  81. package/assets/esri/core/workers/chunks/6b2e09e43f449020d5ad.js +1 -0
  82. package/assets/esri/core/workers/chunks/6b5f8bf8b3480910666d.js +1 -0
  83. package/assets/esri/core/workers/chunks/70fe8b90f174ec64db2e.js +1 -0
  84. package/assets/esri/core/workers/chunks/720356fc6d5e18008471.js +1 -0
  85. package/assets/esri/core/workers/chunks/721f43554b9654481de7.js +1 -0
  86. package/assets/esri/core/workers/chunks/{3869ea1be105eaad4a38.js → 7328aca34c95fd0fc752.js} +1 -1
  87. package/assets/esri/core/workers/chunks/789567124c4a15235952.js +1 -0
  88. package/assets/esri/core/workers/chunks/{a24dc5350af001db417a.js → 7affab0d0692bdb76036.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{b6e628b5d2643af4c19b.js → 7b4063f45b45ad8a7289.js} +1 -1
  90. package/assets/esri/core/workers/chunks/7c22d3669087f38c92b9.js +1 -0
  91. package/assets/esri/core/workers/chunks/7cb7bdc30f970eb9ff7f.js +1 -0
  92. package/assets/esri/core/workers/chunks/7d71cf65bbc1b3308856.js +1 -0
  93. package/assets/esri/core/workers/chunks/81cdb9705f7eee9e792f.js +1 -0
  94. package/assets/esri/core/workers/chunks/821003fe1be30d5d29aa.js +1 -0
  95. package/assets/esri/core/workers/chunks/822b9c1e172c835b9624.js +1 -0
  96. package/assets/esri/core/workers/chunks/{a7dfca326883384d2751.js → 823228f1fa6ba4e8bff2.js} +1 -1
  97. package/assets/esri/core/workers/chunks/84021d57822f374217ef.js +1 -0
  98. package/assets/esri/core/workers/chunks/847ec6b337cfb2e4a15b.js +1 -0
  99. package/assets/esri/core/workers/chunks/84f41ddd7366bfbf5b25.js +1 -0
  100. package/assets/esri/core/workers/chunks/8920d0b11951b57d6a66.js +1 -0
  101. package/assets/esri/core/workers/chunks/{c6e7c95391a54978402b.js → 893363ee500fc1288781.js} +1 -1
  102. package/assets/esri/core/workers/chunks/8b0cdbbf5c81283eae13.js +1 -0
  103. package/assets/esri/core/workers/chunks/{7850e306d7cd12653b23.js → 90de2f93b0ba1eb337fd.js} +1 -1
  104. package/assets/esri/core/workers/chunks/91b0035e3eae9e452fbc.js +1 -0
  105. package/assets/esri/core/workers/chunks/92d97e0fcc20dd5f5ac4.js +1 -0
  106. package/assets/esri/core/workers/chunks/93262d3616ac0cc4b532.js +1 -0
  107. package/assets/esri/core/workers/chunks/9748a0db6451336d51ef.js +1 -0
  108. package/assets/esri/core/workers/chunks/{69a09c6acb5ae03c67f6.js → 985ce51da8ae4984a4db.js} +1 -1
  109. package/assets/esri/core/workers/chunks/9bbff9230298b1bac46a.js +1 -0
  110. package/assets/esri/core/workers/chunks/9ca84fa9423654061d05.js +1 -0
  111. package/assets/esri/core/workers/chunks/9cae59db5b9cb37baea9.js +1 -0
  112. package/assets/esri/core/workers/chunks/{ed2626a895ca1d4a7216.js → 9dbb9e74754392b066a8.js} +1 -1
  113. package/assets/esri/core/workers/chunks/9dd3863b9d7c1a5ea20a.js +1 -0
  114. package/assets/esri/core/workers/chunks/9e62cfcb4e0188d51294.js +1 -0
  115. package/assets/esri/core/workers/chunks/a2a3edec2ee31273d609.js +1 -0
  116. package/assets/esri/core/workers/chunks/{d0e8d0f8b4e4cc13e837.js → a301aa62a03d3618eba9.js} +1 -1
  117. package/assets/esri/core/workers/chunks/a39d595fc11afedc1875.js +1 -0
  118. package/assets/esri/core/workers/chunks/a57b506c538e2186909d.js +1 -0
  119. package/assets/esri/core/workers/chunks/a722114f01e66a608cec.js +1 -0
  120. package/assets/esri/core/workers/chunks/{5bda285f6ecf725676b3.js → a7b4821fd3080cf2756f.js} +1 -1
  121. package/assets/esri/core/workers/chunks/a8d91c2654c5012400b4.js +1 -0
  122. package/assets/esri/core/workers/chunks/aa70d98e6bcbd06a8461.js +1 -0
  123. package/assets/esri/core/workers/chunks/add538f52c7bcfd154da.js +1 -0
  124. package/assets/esri/core/workers/chunks/ae0b0a562f0ab57e1883.js +1 -0
  125. package/assets/esri/core/workers/chunks/b10c534cbe311d17b7d5.js +1 -0
  126. package/assets/esri/core/workers/chunks/b2c3652c8ce9597dcf89.js +1 -0
  127. package/assets/esri/core/workers/chunks/b725d944ecd5da02fd9e.js +1 -0
  128. package/assets/esri/core/workers/chunks/b7fbbbeabaa5bfcdeabc.js +1 -0
  129. package/assets/esri/core/workers/chunks/{70ead4c231cba4084cf4.js → b856ef3a949ca06a4af5.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{ae2cd50c2b938b39417b.js → b8b4f68305a4f654fa75.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{97107e64407fa6825620.js → ba324fd300b6e6a584ae.js} +1 -1
  132. package/assets/esri/core/workers/chunks/bc40b96080346b91e507.js +1 -0
  133. package/assets/esri/core/workers/chunks/c5ca8245113576b35acc.js +1 -0
  134. package/assets/esri/core/workers/chunks/{c7a0c4ca37ebd1d98cf1.js → c629a676b707138e7a1c.js} +1 -1
  135. package/assets/esri/core/workers/chunks/c8a1aa90ec6d455ff82d.js +1 -0
  136. package/assets/esri/core/workers/chunks/c8dd8b67100177109619.js +1 -0
  137. package/assets/esri/core/workers/chunks/c8eb8744f1ed9d1897dc.js +1 -0
  138. package/assets/esri/core/workers/chunks/cb0e3614b78c78040662.js +1 -0
  139. package/assets/esri/core/workers/chunks/ccc89208aad7206aabd9.js +1 -0
  140. package/assets/esri/core/workers/chunks/cebd6732fe573f79849c.js +1 -0
  141. package/assets/esri/core/workers/chunks/d22e3b5d836dffdf91cc.js +1 -0
  142. package/assets/esri/core/workers/chunks/{c5ddf8b347c31fe772a3.js → d45769f8a02abe5d2917.js} +1 -1
  143. package/assets/esri/core/workers/chunks/d4b62e78bb27272a5f83.js +1 -0
  144. package/assets/esri/core/workers/chunks/d52b2a591e5e6abaa133.js +1 -0
  145. package/assets/esri/core/workers/chunks/{0978e12dd6a1cbc50b80.js → d572b125bed40a4d02b1.js} +1 -1
  146. package/assets/esri/core/workers/chunks/d65206fea850b1fc0712.js +1 -0
  147. package/assets/esri/core/workers/chunks/d6a42c936ead00ab7ad4.js +1 -0
  148. package/assets/esri/core/workers/chunks/d77887edc10d5be39ac9.js +1 -0
  149. package/assets/esri/core/workers/chunks/d7b9c16fe73f50a41099.js +1 -0
  150. package/assets/esri/core/workers/chunks/{7b6fd287e7043ad50f4e.js → d9bf0be2323e9df55834.js} +1 -1
  151. package/assets/esri/core/workers/chunks/dab98890d77a6b0b2741.js +1 -0
  152. package/assets/esri/core/workers/chunks/e2ac387e154d68fd10ca.js +1 -0
  153. package/assets/esri/core/workers/chunks/e39259ff441fb67cd3e4.js +1 -0
  154. package/assets/esri/core/workers/chunks/e3c152eeaa1c95f0f2d2.js +1 -0
  155. package/assets/esri/core/workers/chunks/e42e9dd3c933f5f864ab.js +1 -0
  156. package/assets/esri/core/workers/chunks/e4ae0fad312467f218df.js +1 -0
  157. package/assets/esri/core/workers/chunks/e50cc686db878d0a9399.js +1 -0
  158. package/assets/esri/core/workers/chunks/e7cd5eeb15d3783f803d.js +1 -0
  159. package/assets/esri/core/workers/chunks/e8042584e422044ca1d1.js +1 -0
  160. package/assets/esri/core/workers/chunks/e89640667b71c1bb4ee3.js +1 -0
  161. package/assets/esri/core/workers/chunks/e9649aa2d0fdd28d91ac.js +1 -0
  162. package/assets/esri/core/workers/chunks/ee31801144602ce816d3.js +1 -0
  163. package/assets/esri/core/workers/chunks/eff8a1a880e0eb1a6814.js +1 -0
  164. package/assets/esri/core/workers/chunks/f2b7c61462f530d812c4.js +1 -0
  165. package/assets/esri/core/workers/chunks/f56404d401dfbce29473.js +1 -0
  166. package/assets/esri/core/workers/chunks/f87416f2aa791cd1bebe.js +1 -0
  167. package/assets/esri/core/workers/chunks/{f3744b12a5d0d8ca8621.js → fa65aafac2b99478c32a.js} +1 -1
  168. package/assets/esri/core/workers/chunks/fb14a0c8d2edf868838c.js +1 -0
  169. package/assets/esri/core/workers/chunks/fb8a24aa04bd2fa43241.js +1 -0
  170. package/assets/esri/core/workers/chunks/fbb27d2cef962f725180.js +1 -0
  171. package/assets/esri/core/workers/chunks/{3c6e7dcb79d13e8aecc5.js → fc965ace82bef4c6111b.js} +1 -1
  172. package/assets/esri/core/workers/chunks/{5954f02c3901b28d8e73.js → fd9382e5207b6da74b91.js} +1 -1
  173. package/assets/esri/core/workers/chunks/fdb370546be4ad552959.js +1 -0
  174. package/assets/esri/core/workers/chunks/fefac70ebe29dff54b4c.js +1 -0
  175. package/chunks/BlurEmission.glsl.js +4 -17
  176. package/chunks/Bufferer-CclWhXVb.js +1 -1
  177. package/chunks/ColorMaterial.glsl.js +1 -1
  178. package/chunks/Component.glsl.js +2 -1
  179. package/chunks/EmissionComposite.glsl.js +2 -2
  180. package/chunks/Envelope.js +1 -1
  181. package/chunks/Envelope2D.js +1 -1
  182. package/chunks/Fog.glsl.js +3 -3
  183. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  184. package/chunks/GlobalIllumination.glsl.js +12 -11
  185. package/chunks/GlobalIlluminationBlur.glsl.js +6 -4
  186. package/chunks/ImageMaterial.glsl.js +1 -1
  187. package/chunks/LineMarker.glsl.js +2 -2
  188. package/chunks/MultiPathImpl.js +1 -1
  189. package/chunks/OperatorGeodesicBuffer.js +1 -1
  190. package/chunks/OperatorGeodeticArea.js +1 -1
  191. package/chunks/OperatorShapePreservingProject.js +1 -1
  192. package/chunks/Point2D.js +1 -1
  193. package/chunks/RealisticAtmosphere.glsl.js +7 -9
  194. package/chunks/RealisticAtmosphereCompositing.glsl.js +6 -10
  195. package/chunks/RibbonLine.glsl.js +2 -2
  196. package/chunks/Terrain.glsl.js +28 -27
  197. package/chunks/UPCPointRenderer.glsl.js +100 -0
  198. package/chunks/UnitFactory.js +1 -1
  199. package/chunks/Water.glsl.js +25 -24
  200. package/chunks/arcade.js +1 -1
  201. package/chunks/arcgis-knowledge-client-core-simd.js +4 -4
  202. package/chunks/arcgis-knowledge-client-core.js +4 -4
  203. package/chunks/array.js +1 -1
  204. package/chunks/basis_encoder.js +3 -3
  205. package/chunks/basis_transcoder.js +2 -2
  206. package/chunks/draco_mesh_decoder.js +2 -2
  207. package/chunks/dxt_encoder.js +3 -3
  208. package/chunks/i3s.js +2 -2
  209. package/chunks/languageUtils.js +1 -1
  210. package/chunks/lclayout.js +3 -3
  211. package/chunks/lerc-wasm.js +1 -1
  212. package/chunks/lyr3DWorker.js +2 -2
  213. package/chunks/pe.js +1 -1
  214. package/chunks/projector.js +1 -1
  215. package/chunks/qb3-wasm.js +1 -1
  216. package/chunks/vxlLayer.js +2 -2
  217. package/colorUtils.js +1 -1
  218. package/config.js +1 -1
  219. package/core/AsyncUpdate.js +1 -1
  220. package/core/Clonable.js +1 -1
  221. package/core/Identifiable.js +1 -1
  222. package/core/Loadable.js +1 -1
  223. package/core/MultiOriginJSONSupport.js +1 -1
  224. package/core/NumericIdentifiable.js +1 -1
  225. package/core/Promise.js +1 -1
  226. package/core/ReadOnlyMultiOriginJSONSupport.js +1 -1
  227. package/core/accessorSupport/metadata.js +1 -1
  228. package/core/accessorSupport/trackingUtils.js +1 -1
  229. package/core/asyncUtils.js +1 -1
  230. package/core/handleUtils.js +1 -1
  231. package/core/mapCollectionUtils.js +1 -1
  232. package/core/memoryEstimations.js +1 -1
  233. package/core/reactiveUtils.js +1 -1
  234. package/core/sql/SqlTimestampOffset.js +1 -1
  235. package/core/sql/WhereClause.js +1 -1
  236. package/core/sql/WhereGrammar.js +1 -1
  237. package/core/sql/writeUtils.js +1 -1
  238. package/core/sql.js +1 -1
  239. package/core/urlUtils.js +1 -1
  240. package/core/workers/workers.js +1 -1
  241. package/geohash/GeohashCell.js +1 -1
  242. package/geohash/GeohashTree.js +1 -1
  243. package/geometry/coordinateConversion/CoordinateConversionModel.d.ts +11 -56
  244. package/geometry/coordinateConversion/support/Conversion.d.ts +5 -17
  245. package/geometry/coordinateConversion/support/Format.d.ts +6 -30
  246. package/geometry/coordinateConversion/types.d.ts +15 -15
  247. package/geometry/operators/reshapeOperator.js +1 -1
  248. package/geometry/support/MeshMaterial.js +1 -1
  249. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  250. package/geometry/support/meshUtils/elevationSampler.js +1 -1
  251. package/graphic/AggregateGraphicOrigin.js +1 -1
  252. package/graphic/AnnotationFeatureGraphicOrigin.js +1 -1
  253. package/graphic/BuildingGraphicOrigin.js +1 -1
  254. package/graphic/CSVGraphicOrigin.js +1 -1
  255. package/graphic/CatalogGraphicOrigin.js +1 -1
  256. package/graphic/DimensionFeatureGraphicOrigin.js +1 -1
  257. package/graphic/FeatureGraphicOrigin.js +1 -1
  258. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  259. package/graphic/GeoRSSGraphicOrigin.js +1 -1
  260. package/graphic/ImageryGraphicOrigin.js +1 -1
  261. package/graphic/ImageryTileGraphicOrigin.js +1 -1
  262. package/graphic/KMLGraphicOrigin.js +1 -1
  263. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  264. package/graphic/LinkChartGraphicOrigin.js +1 -1
  265. package/graphic/MapImageGraphicOrigin.js +1 -1
  266. package/graphic/MapNotesGraphicOrigin.js +1 -1
  267. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  268. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  269. package/graphic/ParquetGraphicOrigin.js +1 -1
  270. package/graphic/PointCloudGraphicOrigin.js +1 -1
  271. package/graphic/SceneGraphicOrigin.js +1 -1
  272. package/graphic/SketchGraphicOrigin.js +1 -1
  273. package/graphic/StreamGraphicOrigin.js +1 -1
  274. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  275. package/graphic/TileGraphicOrigin.js +1 -1
  276. package/graphic/TrackGraphicOrigin.js +1 -1
  277. package/graphic/VectorTileGraphicOrigin.js +1 -1
  278. package/graphic/VoxelGraphicOrigin.js +1 -1
  279. package/graphic/WCSGraphicOrigin.js +1 -1
  280. package/graphic/WFSGraphicOrigin.js +1 -1
  281. package/graphic/getLayerViewLayer.js +2 -0
  282. package/identity/IdentityManagerBase.js +1 -1
  283. package/interfaces.d.ts +0 -1
  284. package/kernel.js +1 -1
  285. package/layers/ElevationLayer.js +1 -1
  286. package/layers/LinkChartLayer.d.ts +1 -1
  287. package/layers/LinkChartLayer.js +1 -1
  288. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  289. package/layers/PointCloudLayer.js +3 -3
  290. package/layers/VectorTileLayer.d.ts +17 -10
  291. package/layers/VoxelWasmPerSceneView.js +1 -1
  292. package/layers/WMTSLayer.js +1 -1
  293. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  294. package/layers/graphics/dehydratedFeatures.js +1 -1
  295. package/layers/graphics/transferFeatures.js +1 -1
  296. package/layers/knowledgeGraph/KnowledgeGraphSublayerBase.js +1 -1
  297. package/layers/mixins/APIKeyMixin.js +1 -1
  298. package/layers/mixins/ArcGISCachedService.js +1 -1
  299. package/layers/mixins/ArcGISImageService.js +1 -1
  300. package/layers/mixins/ArcGISMapService.js +1 -1
  301. package/layers/mixins/ArcGISService.js +1 -1
  302. package/layers/mixins/BlendLayer.js +1 -1
  303. package/layers/mixins/CustomParametersMixin.js +1 -1
  304. package/layers/mixins/DataElementMixin.js +1 -1
  305. package/layers/mixins/DataSeriesLayer.js +1 -1
  306. package/layers/mixins/DisplayFilteredLayer.js +1 -1
  307. package/layers/mixins/EditBusLayer.js +1 -1
  308. package/layers/mixins/FeatureEffectLayer.js +1 -1
  309. package/layers/mixins/FeatureLayerBase.js +1 -1
  310. package/layers/mixins/FeatureReductionLayer.js +1 -1
  311. package/layers/mixins/HeightModelInfoMixin.js +1 -1
  312. package/layers/mixins/OperationalLayer.js +1 -1
  313. package/layers/mixins/OrderedLayer.js +1 -1
  314. package/layers/mixins/PortalLayer.js +1 -1
  315. package/layers/mixins/PublishableLayer.js +1 -1
  316. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  317. package/layers/mixins/RasterPresetRendererMixin.js +1 -1
  318. package/layers/mixins/RefreshableLayer.js +1 -1
  319. package/layers/mixins/ReloadableLayer.js +1 -1
  320. package/layers/mixins/ScaleRangeLayer.js +1 -1
  321. package/layers/mixins/SceneService.js +1 -1
  322. package/layers/mixins/SublayersOwner.js +1 -1
  323. package/layers/mixins/TemporalLayer.js +1 -1
  324. package/layers/mixins/TrackableLayer.js +1 -1
  325. package/layers/orientedImagery/transformations/utils.js +1 -1
  326. package/layers/raster/datasets/TIFFRaster.js +1 -1
  327. package/layers/raster/datasets/pixelReader.js +1 -1
  328. package/layers/raster/datasets/xmlUtilities.js +1 -1
  329. package/layers/raster/formats/Lerc.js +1 -1
  330. package/layers/raster/formats/Qb3.js +1 -1
  331. package/layers/raster/formats/TiffDecoder.js +1 -1
  332. package/layers/raster/formats/blosc.js +1 -1
  333. package/layers/raster/formats/tiffParser.js +1 -1
  334. package/layers/raster/formats/tiffSpatialReferenceUtils.js +2 -0
  335. package/layers/raster/formats/tiffTag.js +1 -1
  336. package/layers/raster/functions/colormaps.js +1 -1
  337. package/layers/support/TitleCreator.js +1 -1
  338. package/layers/support/WMTSSublayer.js +1 -1
  339. package/layers/support/fieldUtils.d.ts +129 -57
  340. package/layers/support/fieldUtils.js +1 -1
  341. package/layers/support/geospatialPDFUtils.js +1 -1
  342. package/layers/support/imageUtils.js +1 -1
  343. package/layers/support/labelUtils.js +1 -1
  344. package/layers/support/tiles3DUtils.js +1 -1
  345. package/layers/video/VideoController.js +14 -14
  346. package/legend/ActiveLayerInfo.js +1 -1
  347. package/legend/support/sizeRampUtils.js +1 -1
  348. package/libs/basisu/BasisUEncoder.js +1 -1
  349. package/libs/basisu/BasisUTranscoder.js +1 -1
  350. package/libs/dracoMeshDecoder/dracoMeshDecoder.js +1 -1
  351. package/libs/dxtEncoder/DXTEncoder.js +1 -1
  352. package/libs/i3s/I3SModule.js +1 -1
  353. package/libs/librust-parquet/loadParquetModule.js +1 -1
  354. package/libs/librust-text/loadTextModule.js +1 -1
  355. package/libs/linkchartlayout/LinkChartLayout.js +1 -1
  356. package/libs/maquette-advanced-projector/projector.js +1 -1
  357. package/networks/Network.js +1 -1
  358. package/networks/support/TopologyValidationJobInfo.js +1 -1
  359. package/package.json +2 -2
  360. package/popup/FeaturesModel.d.ts +6 -0
  361. package/popup/FeaturesModel.js +1 -1
  362. package/portal/PortalUser.js +1 -1
  363. package/renderers/mixins/VisualVariablesMixin.js +1 -1
  364. package/renderers/visualVariables/VisualVariableFactory.js +1 -1
  365. package/rest/identify.js +1 -1
  366. package/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js +1 -1
  367. package/rest/layerSources/utils.js +1 -1
  368. package/rest/networks/validateNetworkTopology.js +1 -1
  369. package/rest/support/CameraInfoMixin.js +1 -1
  370. package/rest/support/NormalizationBinParametersMixin.js +1 -1
  371. package/rest/support/generateRendererUtils.js +1 -1
  372. package/smartMapping/raster/renderers/vectorField.js +1 -1
  373. package/smartMapping/renderers/type.js +1 -1
  374. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  375. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  376. package/smartMapping/symbology/color.js +1 -1
  377. package/smartMapping/symbology/support/Theme.js +1 -1
  378. package/support/BasemapStyle.js +1 -1
  379. package/support/LayersMixin.js +1 -1
  380. package/support/TablesMixin.js +1 -1
  381. package/support/actions/ActionBase.d.ts +14 -2
  382. package/support/actions/ActionBase.js +1 -1
  383. package/support/actions/ActionButton.js +1 -1
  384. package/support/actions/ActionToggle.js +1 -1
  385. package/support/loadArcade.js +1 -1
  386. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  387. package/views/2d/engine/flow/utils.js +1 -1
  388. package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
  389. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  390. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  391. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  392. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  393. package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +1 -1
  394. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  395. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/bitmapUtils.js +1 -1
  396. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
  397. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  398. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  399. package/views/2d/layerViewModuleImportUtils.js +1 -1
  400. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  401. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  402. package/views/2d/layers/LayerView2D.js +1 -1
  403. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  404. package/views/2d/layers/TileLayerView2D.js +1 -1
  405. package/views/2d/layers/features/FeatureContainer.js +1 -1
  406. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  407. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  408. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  409. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  410. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  411. package/views/3d/GroundView3D.js +1 -1
  412. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  413. package/views/3d/layerViewModuleImportUtils.js +1 -1
  414. package/views/3d/layers/BuildingSublayerView3D.js +1 -1
  415. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  416. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  417. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  418. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  419. package/views/3d/layers/I3SMeshView3D.js +1 -1
  420. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  421. package/views/3d/layers/LayerView3D.js +1 -1
  422. package/views/3d/layers/Lyr3DWorker.js +1 -1
  423. package/views/3d/layers/PointCloudIntersector.js +2 -0
  424. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  425. package/views/3d/layers/SceneLayerWorker.js +1 -1
  426. package/views/3d/layers/TiledLayerView3D.js +1 -1
  427. package/views/3d/layers/UPCPointRenderer.js +2 -0
  428. package/views/3d/layers/UPCPointRendererNode.js +2 -0
  429. package/views/3d/layers/UpdatablePointCloudLayerView3D.js +2 -0
  430. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  431. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  432. package/views/3d/layers/i3s/PointCloudHighlights.js +1 -1
  433. package/views/3d/layers/i3s/PointCloudNodeHighlights.js +2 -0
  434. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  435. package/views/3d/layers/i3s/PointCloudRendererNode.js +1 -1
  436. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  437. package/views/3d/layers/support/GraphicsProcessorLayerView3D.js +1 -1
  438. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  439. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  440. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  441. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
  442. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  443. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  444. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  445. package/views/3d/support/GroundAndIMSurface.js +1 -1
  446. package/views/3d/support/QualityProfile.js +1 -1
  447. package/views/3d/support/QualitySettings.js +1 -1
  448. package/views/3d/support/cameraUtils.js +1 -1
  449. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  450. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  451. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  452. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  453. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  454. package/views/3d/terrain/TerrainRenderer.js +1 -1
  455. package/views/3d/webgl/RenderNode.js +1 -1
  456. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  457. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
  458. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  459. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  460. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +9 -9
  461. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  462. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  463. package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
  464. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  465. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +19 -19
  466. package/views/3d/webgl-engine/core/shaderLibrary/lastFrameUniforms.js +1 -1
  467. package/views/3d/webgl-engine/core/shaderLibrary/outputEmission.glsl.js +5 -0
  468. package/views/3d/webgl-engine/core/shaderLibrary/{util/CloudsParallaxShading.glsl.js → renderClouds.glsl.js} +5 -4
  469. package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +2 -2
  470. package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +1 -5
  471. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +7 -7
  472. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +15 -12
  473. package/views/3d/webgl-engine/core/shaderLibrary/terrain/blendLayers.glsl.js +9 -9
  474. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  475. package/views/3d/webgl-engine/core/shaderModules/glsl.js +1 -1
  476. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  477. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  478. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  479. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphere.glsl.js +1 -1
  480. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphere.js +1 -1
  481. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereCompositing.glsl.js +1 -1
  482. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereConfiguration.js +1 -1
  483. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  484. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  485. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  486. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
  487. package/views/3d/webgl-engine/effects/globalIllumination/globalIlluminationUniforms.js +1 -1
  488. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +30 -53
  489. package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
  490. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  491. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  492. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  493. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  494. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  495. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  496. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  497. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  498. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  499. package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
  500. package/views/3d/webgl-engine/materials/LineCalloutMaterialBaseInstance.js +1 -1
  501. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  502. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  503. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  504. package/views/3d/webgl-engine/materials/getWaterColor.glsl.js +89 -0
  505. package/views/3d/webgl-engine/materials/renderers/BufferCache.js +1 -1
  506. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +12 -14
  507. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  508. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  509. package/views/3d/webgl-engine/shaders/UPCPointRenderer.glsl.js +2 -0
  510. package/views/3d/webgl-engine/shaders/UPCPointRendererTechnique.js +2 -0
  511. package/views/3d/webgl-engine/shaders/UPCPointRendererTechniqueConfiguration.js +2 -0
  512. package/views/BreakpointsOwner.js +1 -1
  513. package/views/DOMContainer.js +1 -1
  514. package/views/PopupView.js +1 -1
  515. package/views/View.d.ts +27 -1
  516. package/views/View.js +1 -1
  517. package/views/Viewport2DBaseMixin.js +1 -1
  518. package/views/Viewport2DMixin.js +1 -1
  519. package/views/animation/pointToPoint/Animation.js +1 -1
  520. package/views/interactive/Tooltip.d.ts +1 -1
  521. package/views/interactive/Tooltip.js +1 -1
  522. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  523. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  524. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
  525. package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
  526. package/views/layers/MapImageLayerView.js +1 -1
  527. package/views/layers/PointCloudLayerView.js +1 -1
  528. package/views/layers/RefreshableLayerView.js +1 -1
  529. package/views/layers/WMSLayerView.js +1 -1
  530. package/views/overlay/ViewOverlay.js +1 -1
  531. package/views/support/flow/utils.js +1 -1
  532. package/views/support/screenshotUtils.js +1 -1
  533. package/views/types.d.ts +15 -0
  534. package/views/webgl/AllocationTracer.js +1 -1
  535. package/views/webgl/InstanceCounter.js +1 -1
  536. package/views/webgl/RenderingContext.js +1 -1
  537. package/views/webgl/ShaderBuilder.js +23 -23
  538. package/views/webgl/ShaderTranspiler.js +1 -1
  539. package/views/webgl/capabilities/DisjointTimerQuery.js +1 -1
  540. package/views/webgl/capabilities.js +1 -1
  541. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +1 -1
  542. package/widgets/CoordinateConversion/support/Conversion.d.ts +1 -0
  543. package/widgets/CoordinateConversion/support/Format.d.ts +1 -0
  544. package/widgets/Editor/EditorViewModel.js +1 -1
  545. package/widgets/Editor/workflowUtils.js +1 -1
  546. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  547. package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
  548. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  549. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  550. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  551. package/widgets/OrientedImageryViewer/mixins/DrawHandlerMixin.js +1 -1
  552. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  553. package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
  554. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  555. package/widgets/OrientedImageryViewer/mixins/TriangulatedSketchHandlerMixin.js +1 -1
  556. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  557. package/widgets/Sketch/support/ResponsiveToolbar/ToolbarGroupBase.js +1 -1
  558. package/widgets/smartMapping/support/utils.js +1 -1
  559. package/widgets/support/AnalysisViewModelMixin.js +1 -1
  560. package/widgets/support/AnchorElementViewModel.js +1 -1
  561. package/widgets/support/GoTo.js +1 -1
  562. package/widgets/support/InteractiveToolViewModelMixin.js +1 -1
  563. package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +0 -1
  564. package/assets/esri/core/workers/chunks/04f09e1afda92cbe09f5.js +0 -1
  565. package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +0 -1
  566. package/assets/esri/core/workers/chunks/0b74d353f80974ff6fea.js +0 -1
  567. package/assets/esri/core/workers/chunks/0e100855bb3832a68e4b.js +0 -1
  568. package/assets/esri/core/workers/chunks/0ede8ba757fd0976d485.js +0 -1
  569. package/assets/esri/core/workers/chunks/0f39576806866cff777d.js +0 -1
  570. package/assets/esri/core/workers/chunks/0fea695721a818955abf.js +0 -1
  571. package/assets/esri/core/workers/chunks/110f78d5e78732750097.js +0 -1
  572. package/assets/esri/core/workers/chunks/1507297550c3cd1268e2.js +0 -1
  573. package/assets/esri/core/workers/chunks/193a73a2c7f4f8482c21.js +0 -1
  574. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +0 -1
  575. package/assets/esri/core/workers/chunks/21aa29039a95debd7f44.js +0 -1
  576. package/assets/esri/core/workers/chunks/29b74a3ff03d3c8b65dc.js +0 -1
  577. package/assets/esri/core/workers/chunks/2ad6db80a508285a3e5d.js +0 -1
  578. package/assets/esri/core/workers/chunks/2b87d5b8931305b11ff6.js +0 -1
  579. package/assets/esri/core/workers/chunks/2d4788be418a4e5f6606.js +0 -1
  580. package/assets/esri/core/workers/chunks/2f07dc632e51fddb2d48.js +0 -1
  581. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +0 -1
  582. package/assets/esri/core/workers/chunks/3169d639ab54bf508e2c.js +0 -1
  583. package/assets/esri/core/workers/chunks/333140b18aeb5a50b654.js +0 -1
  584. package/assets/esri/core/workers/chunks/3354f1fa90f8ce4c8fde.js +0 -1
  585. package/assets/esri/core/workers/chunks/3809a8b3f31bb811d964.js +0 -1
  586. package/assets/esri/core/workers/chunks/3982409149571a827390.js +0 -1
  587. package/assets/esri/core/workers/chunks/3b11e4d2e69b7aea1d65.js +0 -1
  588. package/assets/esri/core/workers/chunks/3c1651e9e8d2e83d22df.js +0 -1
  589. package/assets/esri/core/workers/chunks/3df6631895d0a7109e00.js +0 -1
  590. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +0 -1
  591. package/assets/esri/core/workers/chunks/3f8d66d8447036f122ae.js +0 -1
  592. package/assets/esri/core/workers/chunks/420c6a14107a77ddad36.js +0 -1
  593. package/assets/esri/core/workers/chunks/421b8244d01736d82e7a.js +0 -1
  594. package/assets/esri/core/workers/chunks/4761cd436abceee858bf.js +0 -1
  595. package/assets/esri/core/workers/chunks/48b60ff59afbae865de1.js +0 -1
  596. package/assets/esri/core/workers/chunks/4953314fd9afd52b6eec.js +0 -1
  597. package/assets/esri/core/workers/chunks/4cf8bddc3e0619e34424.js +0 -1
  598. package/assets/esri/core/workers/chunks/4d0bb5e4a1d789cc0d75.js +0 -1
  599. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +0 -1
  600. package/assets/esri/core/workers/chunks/4de08ead94660025075b.js +0 -1
  601. package/assets/esri/core/workers/chunks/5060be52a380fc4920f8.js +0 -1
  602. package/assets/esri/core/workers/chunks/5082cdc3e91e1c6d1070.js +0 -1
  603. package/assets/esri/core/workers/chunks/52ded087d19a93e29d93.js +0 -1
  604. package/assets/esri/core/workers/chunks/53bbb9aa6e4e4a0a8121.js +0 -1
  605. package/assets/esri/core/workers/chunks/54d3cb7d95d948998591.js +0 -1
  606. package/assets/esri/core/workers/chunks/560ebf5524ade7d1f85b.js +0 -1
  607. package/assets/esri/core/workers/chunks/56f227e1a9e51d1fd742.js +0 -1
  608. package/assets/esri/core/workers/chunks/5bd451c7db17ee8f0315.js +0 -1
  609. package/assets/esri/core/workers/chunks/5c34d49a6c9cc34b7626.js +0 -1
  610. package/assets/esri/core/workers/chunks/5d75fcaded78f76efd3e.js +0 -1
  611. package/assets/esri/core/workers/chunks/5f7505ada0991cfbdd84.js +0 -1
  612. package/assets/esri/core/workers/chunks/62ddd3a82864e26f009a.js +0 -1
  613. package/assets/esri/core/workers/chunks/6737b2a4a70bbdafaf67.js +0 -1
  614. package/assets/esri/core/workers/chunks/6a339a47e765b9937dd7.js +0 -1
  615. package/assets/esri/core/workers/chunks/6c21964eb7c25c8b1e9a.js +0 -1
  616. package/assets/esri/core/workers/chunks/6fd10891506925560443.js +0 -29
  617. package/assets/esri/core/workers/chunks/703373f529c1c334cfad.js +0 -1
  618. package/assets/esri/core/workers/chunks/71a05edd6f7f3197e621.js +0 -1
  619. package/assets/esri/core/workers/chunks/72b7e7b518c88b7569dd.js +0 -1
  620. package/assets/esri/core/workers/chunks/733c32d8091427d84de7.js +0 -1
  621. package/assets/esri/core/workers/chunks/73918ca7fdf41272d941.js +0 -1
  622. package/assets/esri/core/workers/chunks/7673217a688d739141e2.js +0 -1
  623. package/assets/esri/core/workers/chunks/76869c14dd7ffaae7eff.js +0 -1
  624. package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +0 -1
  625. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +0 -1
  626. package/assets/esri/core/workers/chunks/7bd5a074d9f4ba137649.js +0 -1
  627. package/assets/esri/core/workers/chunks/7c13d7754fc914a87817.js +0 -1
  628. package/assets/esri/core/workers/chunks/7dc2e714234b2cee8701.js +0 -1
  629. package/assets/esri/core/workers/chunks/835e0315661003caa71f.js +0 -1
  630. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +0 -1
  631. package/assets/esri/core/workers/chunks/860552f49f17de2f3353.js +0 -1
  632. package/assets/esri/core/workers/chunks/86578c191d76062157ec.js +0 -1
  633. package/assets/esri/core/workers/chunks/87d6e99d83db9a8cda7c.js +0 -1
  634. package/assets/esri/core/workers/chunks/88df1b8b295d3aed649f.js +0 -1
  635. package/assets/esri/core/workers/chunks/8c9934d30655dd2c48da.js +0 -1
  636. package/assets/esri/core/workers/chunks/9117c9b720c9ba6e7a6e.js +0 -1
  637. package/assets/esri/core/workers/chunks/939fb9a8c301ace07186.js +0 -1
  638. package/assets/esri/core/workers/chunks/94a38c9b3d086b37242f.js +0 -1
  639. package/assets/esri/core/workers/chunks/98e1751f888975532afc.js +0 -1
  640. package/assets/esri/core/workers/chunks/9b727f45dfea84357b57.js +0 -1
  641. package/assets/esri/core/workers/chunks/9d61f10f2bef15b5811d.js +0 -1
  642. package/assets/esri/core/workers/chunks/9dcf5be203f8b1e47d9d.js +0 -1
  643. package/assets/esri/core/workers/chunks/9eb00bb8dab995c2dcb3.js +0 -1
  644. package/assets/esri/core/workers/chunks/9ed81757937fe08363ed.js +0 -1
  645. package/assets/esri/core/workers/chunks/9fe07947cf4ec44014e8.js +0 -1
  646. package/assets/esri/core/workers/chunks/a05a2c2aaf0c288f9681.js +0 -1
  647. package/assets/esri/core/workers/chunks/a1d265614d038eb603f7.js +0 -1
  648. package/assets/esri/core/workers/chunks/a3d02885d6962b49eee4.js +0 -1
  649. package/assets/esri/core/workers/chunks/a66d6298236d59a615db.js +0 -1
  650. package/assets/esri/core/workers/chunks/a710c7a0584d9e45a469.js +0 -1
  651. package/assets/esri/core/workers/chunks/ab76170c374fd67ce8cd.js +0 -1
  652. package/assets/esri/core/workers/chunks/ab784764ddf9d7f693a1.js +0 -1
  653. package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +0 -1
  654. package/assets/esri/core/workers/chunks/aebd12488b4004e207a3.js +0 -1
  655. package/assets/esri/core/workers/chunks/b7426e5f290573cb9689.js +0 -1
  656. package/assets/esri/core/workers/chunks/b88e1084097a93a89f61.js +0 -1
  657. package/assets/esri/core/workers/chunks/baa5aa0670b23db86b50.js +0 -1
  658. package/assets/esri/core/workers/chunks/c0867890a84b4c98e0ba.js +0 -1
  659. package/assets/esri/core/workers/chunks/c1a551c4aa77f123d091.js +0 -1
  660. package/assets/esri/core/workers/chunks/c58f859dec9d6675dbd6.js +0 -1
  661. package/assets/esri/core/workers/chunks/c7425fb5e804f0f9d4dd.js +0 -1
  662. package/assets/esri/core/workers/chunks/c7b1c6d57603fa385c54.js +0 -1
  663. package/assets/esri/core/workers/chunks/c85184baccb4004bf42b.js +0 -1
  664. package/assets/esri/core/workers/chunks/ccf4b5fdcdace533bcb7.js +0 -1
  665. package/assets/esri/core/workers/chunks/cd8181600623e18f511c.js +0 -1
  666. package/assets/esri/core/workers/chunks/cef537fa9705dd1cf685.js +0 -1
  667. package/assets/esri/core/workers/chunks/d33403d578fbeecaf844.js +0 -1
  668. package/assets/esri/core/workers/chunks/d5bb6f479c0cdfc21d8a.js +0 -1
  669. package/assets/esri/core/workers/chunks/d689e7c685dd9a444d19.js +0 -1
  670. package/assets/esri/core/workers/chunks/d8b84d21144a58b6b911.js +0 -1
  671. package/assets/esri/core/workers/chunks/d8ffb1502def5c85740b.js +0 -1
  672. package/assets/esri/core/workers/chunks/db96d1d9f6d1a4d7fd2a.js +0 -1
  673. package/assets/esri/core/workers/chunks/ddbfa664e69612295785.js +0 -1
  674. package/assets/esri/core/workers/chunks/de35baceeb815e6befd5.js +0 -1
  675. package/assets/esri/core/workers/chunks/ded81c504bf44806ca7d.js +0 -1
  676. package/assets/esri/core/workers/chunks/e0466387b2ab54d706ca.js +0 -1
  677. package/assets/esri/core/workers/chunks/e164198dbb87ee202ba1.js +0 -1
  678. package/assets/esri/core/workers/chunks/e4eb6fdf5115bed48856.js +0 -1
  679. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +0 -1
  680. package/assets/esri/core/workers/chunks/e59271f8b142a7602b7a.js +0 -1
  681. package/assets/esri/core/workers/chunks/ee70be138831cc2a0f56.js +0 -1
  682. package/assets/esri/core/workers/chunks/eef3fa804e456beac4c1.js +0 -1
  683. package/assets/esri/core/workers/chunks/efd6ea0966f60ab19520.js +0 -1
  684. package/assets/esri/core/workers/chunks/f23c4fd014126ea7abc6.js +0 -1
  685. package/assets/esri/core/workers/chunks/f319b59228b64e7f9008.js +0 -1
  686. package/assets/esri/core/workers/chunks/f42adcea81390fb21c66.js +0 -1
  687. package/assets/esri/core/workers/chunks/f52d081bbde5c95265cf.js +0 -1
  688. package/assets/esri/core/workers/chunks/f6e40f3faf0c80cf1b3a.js +0 -1
  689. package/assets/esri/core/workers/chunks/f7ab4bf14ec8e986ef7c.js +0 -1
  690. package/assets/esri/core/workers/chunks/f92c92c0fd1b5b33ca21.js +0 -1
  691. package/assets/esri/core/workers/chunks/fbd5f3b81cd9f061824d.js +0 -1
  692. package/assets/esri/core/workers/chunks/fdcc5fe4630a4ccf58de.js +0 -1
  693. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +0 -1
  694. package/assets/esri/core/workers/chunks/ff225735eba7f9130e19.js +0 -1
  695. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +0 -70
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as t}from"../../../../core/mathUtils.js";import{estimateNumberArrayMemory as n}from"../../../../core/memoryEstimations.js";import{isFloat32Array as r}from"../../../../core/typedArrayUtil.js";import{create as i,copy as a,nan as o,fromValues as s,empty as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as l}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{intersectsTransformedAabb as d}from"../../../../geometry/support/frustumPlanes.js";import{newContinuousIndexArray as f}from"../../../../geometry/support/Indices.js";import{createPositionReader as p}from"./PositionReader.js";import{MeshIntersectionOptions as m,intersectRayTriangles as h}from"./RayIntersections.js";import{forEachTriangleRangeScreenPolygonHit as g}from"./screenPolygonTriangleIntersections.js";const _=1e-6;class v{constructor(n,r,i){this.globalTriangleVertexIndices=n,this.numTriangles=r,this.positions=i,this._rayDirection=e(),this._callback=T,this._intersectionOptions=w,this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonIntersector=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this.bspNodeTree=[],this.triangleIndexMap=f(r),this._readPosition=p(i.data,n,i.stride);let{triangleAABBs:a,rootAabb:o}=S(n,r,i.data,i.stride);if(this._rootAabb=o,r<=40)return;let s=t(Math.log2(r/40),2,10),c=(e,t,n,r)=>{let i=t-e,{axis:o,midValue:l}=x(r),{next:u,mid:d,leftAabb:f,middleAabb:p,rightAabb:m}=b(this.triangleIndexMap,a,e,t,o,l),h=new y(f,p,m,o,l,u,d);if(this.bspNodeTree.push(h),n<=s){let r=.8*i,a=u-e;a>40&&a<r&&(h.leftNode=c(e,u,n+1,f));let o=t-d;o>40&&o<r&&(h.rightNode=c(d,t,n+1,m))}return h};c(0,r,0,this._rootAabb)}intersectRayTriangleRange(e,t){if(e>=t)return;let{data:n,stride:r}=this.positions;h(this._rayFrom,this._rayDirection,e,t,this.globalTriangleVertexIndices,n,r,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap),v.numFacesTested+=t-e}forEachScreenPolygonHit(e,t,n,r,i){e.camera!=null&&(this._screenPolygonIntersector=e,this._screenPolygonTransformation=t,this._screenPolygonQuery=n,this._screenPolygonDisplacement=r,this._screenPolygonCallback=i,this._intersectScreenPolygonBSP(this.bspNodeTree[0],0,this.triangleIndexMap.length),this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this._screenPolygonIntersector=null)}intersectRay(e,t,n,r){v.numFacesTested=0;let i=e,a=t,o=a[0]-i[0],s=a[1]-i[1],c=a[2]-i[2];if(o*o+s*s+c*c<_)return;this._rayFrom=i;let l=this._rayDirection;l[0]=o,l[1]=s,l[2]=c;let u=this.triangleIndexMap.length;this._callback=r,this._intersectionOptions=n;let d=this.bspNodeTree[0];d===void 0?C(this._rootAabb,i,l)&&this.intersectRayTriangleRange(0,u):this.intersectRayBSP(d,0,u),this._callback=T,this._intersectionOptions=w}intersectRayBSP(e,t,n){let r=this._rayFrom,i=this._rayDirection;this._traverseBSP(e,t,n,e=>C(e,r,i),e=>{let t=e.axis;return r[t]<=e.d||i[t]<0},e=>{let t=e.axis;return r[t]>=e.d||i[t]>0},(e,t)=>this.intersectRayTriangleRange(e,t))}_intersectScreenPolygonTriangleRange(e,t){if(e>=t)return;let n=this._screenPolygonIntersector,r=this._screenPolygonQuery;if(n!=null&&r!=null)for(let i of g(n,this._screenPolygonTransformation,r,e,t,this._readPosition,this._screenPolygonDisplacement,this.triangleIndexMap))this._screenPolygonCallback(i.distance,i.primitiveIndex,i.point)}_intersectScreenPolygonBSP(e,t,n){let r=this._screenPolygonIntersector,i=this._screenPolygonQuery;r?.camera!=null&&i!=null&&(e===void 0?this._nodeIntersectsScreenPolygonBroadPhase(this._rootAabb)&&this._intersectScreenPolygonTriangleRange(t,n):this._traverseBSP(e,t,n,e=>this._nodeIntersectsScreenPolygonBroadPhase(e),()=>!0,()=>!0,(e,t)=>this._intersectScreenPolygonTriangleRange(e,t)))}_traverseBSP(e,t,n,r,i,a,o){if(!r(this._rootAabb))return;let s=[{node:e,rangeStart:t,rangeEnd:n}];for(;s.length>0;){let{node:e,rangeStart:t,rangeEnd:n}=s.pop();i(e)&&this._traverseBSPRange(s,e.leftNode,e.leftAabb,t,e.midStartIndex,r,o),e.midStartIndex<e.rightStartIndex&&r(e.middleAabb)&&o(e.midStartIndex,e.rightStartIndex),a(e)&&this._traverseBSPRange(s,e.rightNode,e.rightAabb,e.rightStartIndex,n,r,o)}}_traverseBSPRange(e,t,n,r,i,a,o){r>=i||!a(n)||(t===void 0?o(r,i):e.push({node:t,rangeStart:r,rangeEnd:i}))}_nodeIntersectsScreenPolygonBroadPhase(e){let t=this._screenPolygonQuery;if(t==null)return!1;let n=this._screenPolygonDisplacement,r=n?n.applyToAabb(a(D,e)):e;return d(t.broadPhaseFrustum,r,this._screenPolygonTransformation)}static{this.numFacesTested=0}get estimatedMemoryUsage(){return n(this.triangleIndexMap)}}class y{constructor(e,t,n,r,i,a,o){this.leftAabb=e,this.middleAabb=t,this.rightAabb=n,this.axis=r,this.d=i,this.midStartIndex=a,this.rightStartIndex=o}}function b(e,t,n,r,i,a){let s=i+3,l=c(),u=c(),d=c(),f=n,p=n,m=r;for(;p<m;){let n=e[p],r=n*6,o=t[r+s],c;o<=a?(c=l,p!==f&&(e[p]=e[f],e[f]=n),++f,++p):t[r+i]>=a?(c=d,--m,p!==m&&(e[p]=e[m],e[m]=n)):(c=u,++p),c[0]=Math.min(c[0],t[r]),c[1]=Math.min(c[1],t[r+1]),c[2]=Math.min(c[2],t[r+2]),c[3]=Math.max(c[3],t[r+3]),c[4]=Math.max(c[4],t[r+4]),c[5]=Math.max(c[5],t[r+5])}return{next:f,mid:m,leftAabb:n<f?l:o,middleAabb:f<m?u:o,rightAabb:m<r?d:o}}function x(e){let t=e[3]-e[0],n=e[4]-e[1],r=e[5]-e[2],i=t>n?t>r?0:n>r?1:2:n>r?1:r>t?2:0;return{axis:i,midValue:(e[i]+e[i+3])/2}}function S(e,t,n,i){let a=r(n)?u(t*6,!0):l(t*6),c=1/0,d=1/0,f=1/0,p=-1/0,m=-1/0,h=-1/0;for(let r=0;r<t;++r){let t=3*r,o=e[t]*i,s=e[t+1]*i,l=e[t+2]*i,u=n[o],g=n[o+1],_=n[o+2],v=n[s],y=n[s+1],b=n[s+2],x=n[l],S=n[l+1],C=n[l+2],w=Math.min(u,v,x),T=Math.min(g,y,S),E=Math.min(_,b,C),D=Math.max(u,v,x),O=Math.max(g,y,S),k=Math.max(_,b,C),A=r*6;a[A]=w,a[A+1]=T,a[A+2]=E,a[A+3]=D,a[A+4]=O,a[A+5]=k,c=Math.min(c,w),d=Math.min(d,T),f=Math.min(f,E),p=Math.max(p,D),m=Math.max(m,O),h=Math.max(h,k)}return{triangleAABBs:a,rootAabb:t>0?s(c,d,f,p,m,h):o}}function C(e,t,n){let r=t,i=n,a=0,o=1/0;for(let t=0;t<3;++t){{let n=e[t];if(r[t]<n){if(i[t]<=0)return!1;let e=(n-r[t])/i[t];a=Math.max(a,e)}else if(i[t]<=-1e-6){let e=(n-r[t])/i[t];o=Math.min(o,e)}if(a>o)return!1}{let n=e[t+3];if(r[t]>n){if(i[t]>=0)return!1;let e=(n-r[t])/i[t];a=Math.max(a,e)}else if(i[t]>=_){let e=(n-r[t])/i[t];o=Math.min(o,e)}if(a>o)return!1}}return!0}const w=new m,T=()=>{},E=()=>{},D=i();export{v as TriangleIntersectionData};
2
+ import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as t}from"../../../../core/mathUtils.js";import{estimateNumberArrayMemory as n}from"../../../../core/memoryEstimations.js";import{isFloat32Array as r}from"../../../../core/typedArrayUtil.js";import{create as i,nan as a,copy as o,fromValues as s,empty as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as l}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{intersectsTransformedAabb as d}from"../../../../geometry/support/frustumPlanes.js";import{newContinuousIndexArray as f}from"../../../../geometry/support/Indices.js";import{createPositionReader as p}from"./PositionReader.js";import{MeshIntersectionOptions as m,intersectRayTriangles as h}from"./RayIntersections.js";import{forEachTriangleRangeScreenPolygonHit as g}from"./screenPolygonTriangleIntersections.js";import{noBudget as _}from"../../../support/Scheduler.js";const v=1e-6;class y{constructor(t,n,r,i=!1){this.globalTriangleVertexIndices=t,this.numTriangles=n,this.positions=r,this._rayDirection=e(),this._rootAabb=a,this._callback=E,this._intersectionOptions=T,this._screenPolygonCallback=D,this._screenPolygonDisplacement=null,this._screenPolygonIntersector=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this.bspNodeTree=[],this.triangleIndexMap=f(n),this._readPosition=p(r.data,t,r.stride),this._preparation=this._prepare(),i||this.advance(_)}advance(e){for(;this._preparation&&!e.done;)this._preparation.next().done&&(this._preparation=null),e.madeProgress()}get ready(){return this._preparation==null}*_prepare(){let{globalTriangleVertexIndices:e,numTriangles:n,positions:r}=this,{triangleAABBs:i,rootAabb:a}=yield*C(e,n,r.data,r.stride);if(this._rootAabb=a,n<=40)return;let o=t(Math.log2(n/40),2,10),s=this.triangleIndexMap,c=this.bspNodeTree;function*l(e,t,n,r){let a=t-e,{axis:u,midValue:d}=S(r),{next:f,mid:p,leftAabb:m,middleAabb:h,rightAabb:g}=yield*x(s,i,e,t,u,d),_=new b(m,h,g,u,d,f,p);if(c.push(_),yield,n<=o){let r=.8*a,i=f-e;i>40&&i<r&&(_.leftNode=yield*l(e,f,n+1,m));let o=t-p;o>40&&o<r&&(_.rightNode=yield*l(p,t,n+1,g))}return _}yield*l(0,n,0,a)}intersectRayTriangleRange(e,t){if(e>=t)return;let{data:n,stride:r}=this.positions;h(this._rayFrom,this._rayDirection,e,t,this.globalTriangleVertexIndices,n,r,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap),y.numFacesTested+=t-e}forEachScreenPolygonHit(e,t,n,r,i){e.camera!=null&&(this.advance(_),this._screenPolygonIntersector=e,this._screenPolygonTransformation=t,this._screenPolygonQuery=n,this._screenPolygonDisplacement=r,this._screenPolygonCallback=i,this._intersectScreenPolygonBSP(this.bspNodeTree[0],0,this.triangleIndexMap.length),this._screenPolygonCallback=D,this._screenPolygonDisplacement=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this._screenPolygonIntersector=null)}intersectRay(e,t,n,r){this.advance(_),y.numFacesTested=0;let i=e,a=t,o=a[0]-i[0],s=a[1]-i[1],c=a[2]-i[2];if(o*o+s*s+c*c<v)return;this._rayFrom=i;let l=this._rayDirection;l[0]=o,l[1]=s,l[2]=c;let u=this.triangleIndexMap.length;this._callback=r,this._intersectionOptions=n;let d=this.bspNodeTree[0];d===void 0?w(this._rootAabb,i,l)&&this.intersectRayTriangleRange(0,u):this.intersectRayBSP(d,0,u),this._callback=E,this._intersectionOptions=T}intersectRayBSP(e,t,n){let r=this._rayFrom,i=this._rayDirection;this._traverseBSP(e,t,n,e=>w(e,r,i),e=>{let t=e.axis;return r[t]<=e.d||i[t]<0},e=>{let t=e.axis;return r[t]>=e.d||i[t]>0},(e,t)=>this.intersectRayTriangleRange(e,t))}_intersectScreenPolygonTriangleRange(e,t){if(e>=t)return;let n=this._screenPolygonIntersector,r=this._screenPolygonQuery;if(n!=null&&r!=null)for(let i of g(n,this._screenPolygonTransformation,r,e,t,this._readPosition,this._screenPolygonDisplacement,this.triangleIndexMap))this._screenPolygonCallback(i.distance,i.primitiveIndex,i.point)}_intersectScreenPolygonBSP(e,t,n){let r=this._screenPolygonIntersector,i=this._screenPolygonQuery;r?.camera!=null&&i!=null&&(e===void 0?this._nodeIntersectsScreenPolygonBroadPhase(this._rootAabb)&&this._intersectScreenPolygonTriangleRange(t,n):this._traverseBSP(e,t,n,e=>this._nodeIntersectsScreenPolygonBroadPhase(e),()=>!0,()=>!0,(e,t)=>this._intersectScreenPolygonTriangleRange(e,t)))}_traverseBSP(e,t,n,r,i,a,o){if(!r(this._rootAabb))return;let s=[{node:e,rangeStart:t,rangeEnd:n}];for(;s.length>0;){let{node:e,rangeStart:t,rangeEnd:n}=s.pop();i(e)&&this._traverseBSPRange(s,e.leftNode,e.leftAabb,t,e.midStartIndex,r,o),e.midStartIndex<e.rightStartIndex&&r(e.middleAabb)&&o(e.midStartIndex,e.rightStartIndex),a(e)&&this._traverseBSPRange(s,e.rightNode,e.rightAabb,e.rightStartIndex,n,r,o)}}_traverseBSPRange(e,t,n,r,i,a,o){r>=i||!a(n)||(t===void 0?o(r,i):e.push({node:t,rangeStart:r,rangeEnd:i}))}_nodeIntersectsScreenPolygonBroadPhase(e){let t=this._screenPolygonQuery;if(t==null)return!1;let n=this._screenPolygonDisplacement,r=n?n.applyToAabb(o(O,e)):e;return d(t.broadPhaseFrustum,r,this._screenPolygonTransformation)}static{this.numFacesTested=0}get estimatedMemoryUsage(){return n(this.triangleIndexMap)}}class b{constructor(e,t,n,r,i,a,o){this.leftAabb=e,this.middleAabb=t,this.rightAabb=n,this.axis=r,this.d=i,this.midStartIndex=a,this.rightStartIndex=o}}function*x(e,t,n,r,i,o){let s=i+3,l=c(),u=c(),d=c(),f=n,p=n,m=r,h=0;for(;p<m;){let n=e[p],r=n*6,a=t[r+s],c;a<=o?(c=l,p!==f&&(e[p]=e[f],e[f]=n),++f,++p):t[r+i]>=o?(c=d,--m,p!==m&&(e[p]=e[m],e[m]=n)):(c=u,++p),c[0]=Math.min(c[0],t[r]),c[1]=Math.min(c[1],t[r+1]),c[2]=Math.min(c[2],t[r+2]),c[3]=Math.max(c[3],t[r+3]),c[4]=Math.max(c[4],t[r+4]),c[5]=Math.max(c[5],t[r+5]),++h%128==0&&(yield)}return{next:f,mid:m,leftAabb:n<f?l:a,middleAabb:f<m?u:a,rightAabb:m<r?d:a}}function S(e){let t=e[3]-e[0],n=e[4]-e[1],r=e[5]-e[2],i=t>n?t>r?0:n>r?1:2:n>r?1:r>t?2:0;return{axis:i,midValue:(e[i]+e[i+3])/2}}function*C(e,t,n,i){let o=r(n)?u(t*6,!0):l(t*6),c=1/0,d=1/0,f=1/0,p=-1/0,m=-1/0,h=-1/0;for(let r=0;r<t;++r){let t=3*r,a=e[t]*i,s=e[t+1]*i,l=e[t+2]*i,u=n[a],g=n[a+1],_=n[a+2],v=n[s],y=n[s+1],b=n[s+2],x=n[l],S=n[l+1],C=n[l+2],w=Math.min(u,v,x),T=Math.min(g,y,S),E=Math.min(_,b,C),D=Math.max(u,v,x),O=Math.max(g,y,S),k=Math.max(_,b,C),A=r*6;o[A]=w,o[A+1]=T,o[A+2]=E,o[A+3]=D,o[A+4]=O,o[A+5]=k,c=Math.min(c,w),d=Math.min(d,T),f=Math.min(f,E),p=Math.max(p,D),m=Math.max(m,O),h=Math.max(h,k),(r+1)%128==0&&(yield)}return{triangleAABBs:o,rootAabb:t>0?s(c,d,f,p,m,h):a}}function w(e,t,n){let r=t,i=n,a=0,o=1/0;for(let t=0;t<3;++t){{let n=e[t];if(r[t]<n){if(i[t]<=0)return!1;let e=(n-r[t])/i[t];a=Math.max(a,e)}else if(i[t]<=-1e-6){let e=(n-r[t])/i[t];o=Math.min(o,e)}if(a>o)return!1}{let n=e[t+3];if(r[t]>n){if(i[t]>=0)return!1;let e=(n-r[t])/i[t];a=Math.max(a,e)}else if(i[t]>=v){let e=(n-r[t])/i[t];o=Math.min(o,e)}if(a>o)return!1}}return!0}const T=new m,E=()=>{},D=()=>{},O=i();export{y as TriangleIntersectionData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{fromTranslation as e,multiply as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4Z as r,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{lerp as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import s from"../../../../core/PooledArray.js";import{intersectsSphere as c}from"../../../../geometry/support/frustumPlanes.js";import{Sphere as l}from"../../../../geometry/support/sphere.js";import{maxScale as u}from"../../support/mathUtils.js";import{DepthRange as d}from"./DepthRange.js";import{assert as f}from"./Util.js";function p(e,t,n,r){let i=0;if(!t.some(e=>e.material?(i+=e.numGeometries,i>=1e4):!1))return j.compute(e,t,r);let a=new d;return n.forEach(t=>a.union(m(e,t))),a}function m(e,t){if(!t.visible)return;let n=new d,r=t.getSpatialQueryAccelerator();return r?h(n,e,r):g(n,e,t.objects),n}function h(e,t,n){let{eye:r,viewForward:i,frustum:a}=t,o=e=>e.visible,s=n.objectCount;if(s<500)k.set(t.near,Math.min(e.near,t.far)),n.forEachInDepthRange(r,i,1,k,(n,r)=>{_(e,t,n),k.far=e.near,r.setRange(k)},a,o),k.set(Math.max(e.far,t.near),t.far),n.forEachInDepthRange(r,i,-1,k,(n,r)=>{_(e,t,n),k.near=e.far,r.setRange(k)},a,o);else{let r=Math.max(Math.min(s,500),Math.ceil(s*.1)),c=n.findClosest(i,1,a,o,r),l=n.findClosest(i,-1,a,o,r);c&&l&&(y(e,t,c.boundingVolumeWorldSpace.sphere),y(e,t,l.boundingVolumeWorldSpace.sphere))}}function g(e,t,n){A.clear(),n.forEach(e=>{e.visible&&e.geometries.length!==0&&A.add(e,t)}),A.empty||(A.sort(),k.set(t.near,Math.min(e.near,t.far)),A.forEachInDepthRange(k,1,(n,r)=>{r<e.near&&_(e,t,n)}),k.set(Math.max(e.far,t.near),t.far),A.forEachInDepthRange(k,-1,(t,n,r)=>{e.far=Math.max(e.far,r)}))}function _(n,r,i){if(!i.visible||!c(r.frustum,i.boundingVolumeWorldSpace.sphere))return;let a=i.transformation,o=O;i.geometries.forEach(i=>{i.type===0?t(o,a,i.transformation):e(o,i.localOrigin.vec3);let s=u(o);v(n,r,i.boundingInfo,o,s)})}function v(e,t,n,r,a){if(n==null)return;i(D.center,n.sphere.center,r);let{eye:o,viewForward:s}=t,l=s[0]*(D.center[0]-o[0])+s[1]*(D.center[1]-o[1])+s[2]*(D.center[2]-o[2]);if(D.radius=n.sphere.radius*a,!(l-D.radius>e.near&&l+D.radius<e.far)&&c(t.frustum,D)){if(n.sphere.radius>100&&n.children)for(let i of n.children)v(e,t,i,r,a);else M.unionDepthRangeWithAABB(e,t.viewProjectionMatrix,r,n.box)}}function y(e,t,n){let r=t.eye,i=t.viewForward,a=(n.center[0]-r[0])*i[0]+(n.center[1]-r[1])*i[1]+(n.center[2]-r[2])*i[2];e.near=Math.min(e.near,a-n.radius),e.far=Math.max(e.far,a+n.radius)}class b{constructor(){this._items=new s({allocator:e=>e||{object:null,distance:0,near:0,far:0},deallocator:e=>(e.object=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return this._items.length===0}clear(){this._items.clear()}add(e,t){let n=t.eye,r=t.viewForward,i=e.boundingVolumeWorldSpace.sphere,a=(i.center[0]-n[0])*r[0]+(i.center[1]-n[1])*r[1]+(i.center[2]-n[2])*r[2];if(!Number.isFinite(a))return;let o=this._items.pushNew();o.object=e,o.distance=a,o.near=a-i.radius,o.far=a+i.radius}sort(){this._items.sort((e,t)=>e.distance-t.distance)}forEachInDepthRange(e,t,n){if(t===1)for(let t=0;t<this._items.length;++t){let r=this._items.data[t];r.far<e.near||r.near>e.far||n(r.object,r.near,r.far)}else for(let t=this._items.length-1;t>=0;--t){let r=this._items.data[t];r.far<e.near||r.near>e.far||n(r.object,r.near,r.far)}}}class x{constructor(){this._geometries=[],this._near=[],this._far=[],this._nearCandidates=[],this._farCandidates=[],this._looseRange=new d(0,0)}compute(t,n,i){this._reset();let{viewMatrix:a}=t;n.forEach(e=>{e.forEachGeometry(e=>{if(!e.visible||i===0&&!e.castShadows)return;let t=e.boundingSphere,n=r(t.center,a),o=n-t.radius,s=n+t.radius;this._geometries.push(e),this._near.push(-s),this._far.push(-o)})});let o=new d;if(this._geometries.length===0)return o;for(let e=0;e<this._geometries.length;++e)this._near[e]>o.far&&(o.far=this._near[e]),this._near[e]>2&&this._far[e]<o.near&&(o.near=this._far[e]);let s=this._looseRange;s.near=Math.max(o.near*.5,2),s.far=o.far*2;let c=0,l=0;for(let e=0;e<this._geometries.length;++e)this._near[e]<o.near&&(this._near[e]>=s.near?o.near=this._near[e]:this._nearCandidates[c++]=e),this._far[e]>o.far&&(this._far[e]<=s.far?o.far=this._far[e]:this._farCandidates[l++]=e);if(this._nearCandidates.length===0&&this._farCandidates.length===0)return o;this._nearCandidates.sort((e,t)=>this._near[e]<this._near[t]?-1:+(this._near[e]>this._near[t])),this._farCandidates.sort((e,t)=>this._far[e]<this._far[t]?1:this._far[e]>this._far[t]?-1:0);for(let n=0;n<this._nearCandidates.length;++n){let r=this._nearCandidates[n];if(this._near[r]<o.near){let n=this._geometries[r],{boundingInfo:i}=n,a=n.type===0?n.shaderTransformation:e(O,n.localOrigin.vec3);this._includeNearBoundingInfoRec(t,i,a,o)}}for(let n=0;n<this._farCandidates.length;++n){let r=this._farCandidates[n];if(this._far[r]>o.far){let n=this._geometries[r],{boundingInfo:i}=n,a=n.type===0?n.shaderTransformation:e(O,n.localOrigin.vec3);this._includeFarBoundingInfoRec(t,i,a,o)}}return this._reset(),o}_reset(){this._geometries.length=0,this._near.length=0,this._far.length=0,this._nearCandidates.length=0,this._farCandidates.length=0}_isOutsideSidePlanes(e,t){let{center:n,radius:r}=e;return t[0][0]*n[0]+t[0][1]*n[1]+t[0][2]*n[2]+t[0][3]>r||t[1][0]*n[0]+t[1][1]*n[1]+t[1][2]*n[2]+t[1][3]>r||t[2][0]*n[0]+t[2][1]*n[1]+t[2][2]*n[2]+t[2][3]>r||t[3][0]*n[0]+t[3][1]*n[1]+t[3][2]*n[2]+t[3][3]>r}_includeNearBoundingInfoRec(e,t,n,a){if(t==null)return;i(D.center,t.sphere.center,n),D.radius=t.sphere.radius*u(n);let{frustum:o}=e;if(this._isOutsideSidePlanes(D,o))return;let s=D.radius,{viewMatrix:c}=e,l=r(D.center,c),d=l-s,f=l+s;if(!(-d<2)&&!(-f>=a.near)){if(-f>this._looseRange.near)a.near=-f;else{if(s>100){let r=t.children;if(r!==void 0){for(let t of r)this._includeNearBoundingInfoRec(e,t,n,a);return}}M.unionDepthRangeWithAABB(a,e.viewProjectionMatrix,n,t.box)}}}_includeFarBoundingInfoRec(e,t,n,a){if(t==null)return;i(D.center,t.sphere.center,n),D.radius=t.sphere.radius*u(n);let{frustum:o}=e;if(this._isOutsideSidePlanes(D,o))return;let{viewMatrix:s,viewProjectionMatrix:c}=e,l=r(D.center,s)-D.radius;if(!(-l<=a.far)){if(-l<this._looseRange.far)a.far=-l;else{if(D.radius>100){let r=t.children;if(r!==void 0){for(let t of r)this._includeFarBoundingInfoRec(e,t,n,a);return}}M.unionDepthRangeWithAABB(a,c,n,t.box)}}}}class S{constructor(){this._modelViewProj=n(),this._clipPosition=[o(),o(),o(),o(),o(),o(),o(),o()]}unionDepthRangeWithAABB(e,n,r,i){let a=this._modelViewProj;t(a,n,r);let o=!1;for(let e=0;e<8;++e){let t=this._clipPosition[e],n=e===0||e===3||e===4||e===7?i[0]:i[3],r=e===0||e===1||e===4||e===5?i[1]:i[4],o=e<4?i[2]:i[5];t[0]=a[0]*n+a[4]*r+a[8]*o+a[12],t[1]=a[1]*n+a[5]*r+a[9]*o+a[13],t[2]=a[2]*n+a[6]*r+a[10]*o+a[14],t[3]=a[3]*n+a[7]*r+a[11]*o+a[15]}for(let t=0;t<12;++t){let n=C(this._clipPosition[E[t][0]],this._clipPosition[E[t][1]],this._clipPosition[E[t][2]]),r=!0;for(let e=0;e<n.length;++e)if(n[e][3]>=2){r=!1;break}if(!r){o=!0;for(let t=0;t<n.length;++t){let r=n[t][3];Number.isFinite(r)&&(e.near=Math.min(r,e.near),e.far=Math.max(r,e.far))}}}return o}}function C(e,t,n){let r=[e,t,n];for(let e=0;e<4;++e){let t=r;r=[];for(let n=0;n<t.length;++n){let i=t[n],a=t[(n+1)%t.length];w(a,e)?(w(i,e)||r.push(T(i,a,e)),r.push(a)):w(i,e)&&r.push(T(i,a,e))}}return r}function w(e,t){if(t===0)return e[0]>=-e[3];if(t===1)return e[1]>=-e[3];if(t===2)return e[0]<=e[3];if(t===3)return e[1]<=e[3];f(!1)}function T(e,t,n){let r=0;return n===0?r=(-e[3]-e[0])/(t[0]-e[0]+t[3]-e[3]):n===1?r=(-e[3]-e[1])/(t[1]-e[1]+t[3]-e[3]):n===2?r=(e[3]-e[0])/(t[0]-e[0]-t[3]+e[3]):n===3&&(r=(e[3]-e[1])/(t[1]-e[1]-t[3]+e[3])),a(o(),e,t,r)}const E=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],D=new l,O=n(),k=new d,A=new b,j=new x,M=new S;export{p as depthRangeFromScene};
2
+ import{fromTranslation as e,multiply as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4Z as r,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{lerp as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import s from"../../../../core/PooledArray.js";import{intersectsSphere as c}from"../../../../geometry/support/frustumPlanes.js";import{Sphere as l}from"../../../../geometry/support/sphere.js";import{maxScale as u}from"../../support/mathUtils.js";import{DepthRange as d}from"./DepthRange.js";import{assert as f}from"./Util.js";function p(e,t,n,r){let i=0;if(!t.some(e=>e.material?(i+=e.numGeometries,i>=1e4):!1))return M.compute(e,t,r);let a=new d;return n.forEach(t=>a.union(h(e,t))),a}function m(e,n,r,i){let a=t(k,n.viewMatrix,r),o=(a[2]*(i[0]+i[3])+a[6]*(i[1]+i[4])+a[10]*(i[2]+i[5]))*.5+a[14],s=(Math.abs(a[2])*(i[3]-i[0])+Math.abs(a[6])*(i[4]-i[1])+Math.abs(a[10])*(i[5]-i[2]))*.5;-o-s>=e.near&&-o+s<=e.far||N.unionDepthRangeWithAABB(e,n.viewProjectionMatrix,r,i)}function h(e,t){if(!t.visible)return;let n=new d,r=t.getSpatialQueryAccelerator();return r?g(n,e,r):_(n,e,t.objects),n}function g(e,t,n){let{eye:r,viewForward:i,frustum:a}=t,o=e=>e.visible,s=n.objectCount;if(s<500)A.set(t.near,Math.min(e.near,t.far)),n.forEachInDepthRange(r,i,1,A,(n,r)=>{v(e,t,n),A.far=e.near,r.setRange(A)},a,o),A.set(Math.max(e.far,t.near),t.far),n.forEachInDepthRange(r,i,-1,A,(n,r)=>{v(e,t,n),A.near=e.far,r.setRange(A)},a,o);else{let r=Math.max(Math.min(s,500),Math.ceil(s*.1)),c=n.findClosest(i,1,a,o,r),l=n.findClosest(i,-1,a,o,r);c&&l&&(b(e,t,c.boundingVolumeWorldSpace.sphere),b(e,t,l.boundingVolumeWorldSpace.sphere))}}function _(e,t,n){j.clear(),n.forEach(e=>{e.visible&&e.geometries.length!==0&&j.add(e,t)}),j.empty||(j.sort(),A.set(t.near,Math.min(e.near,t.far)),j.forEachInDepthRange(A,1,(n,r)=>{r<e.near&&v(e,t,n)}),A.set(Math.max(e.far,t.near),t.far),j.forEachInDepthRange(A,-1,(t,n,r)=>{e.far=Math.max(e.far,r)}))}function v(n,r,i){if(!i.visible||!c(r.frustum,i.boundingVolumeWorldSpace.sphere))return;let a=i.transformation,o=k;i.geometries.forEach(i=>{i.type===0?t(o,a,i.transformation):e(o,i.localOrigin.vec3);let s=u(o);y(n,r,i.boundingInfo,o,s)})}function y(e,t,n,r,a){if(n==null)return;i(O.center,n.sphere.center,r);let{eye:o,viewForward:s}=t,l=s[0]*(O.center[0]-o[0])+s[1]*(O.center[1]-o[1])+s[2]*(O.center[2]-o[2]);if(O.radius=n.sphere.radius*a,!(l-O.radius>e.near&&l+O.radius<e.far)&&c(t.frustum,O)){if(n.sphere.radius>100&&n.children)for(let i of n.children)y(e,t,i,r,a);else N.unionDepthRangeWithAABB(e,t.viewProjectionMatrix,r,n.box)}}function b(e,t,n){let r=t.eye,i=t.viewForward,a=(n.center[0]-r[0])*i[0]+(n.center[1]-r[1])*i[1]+(n.center[2]-r[2])*i[2];e.near=Math.min(e.near,a-n.radius),e.far=Math.max(e.far,a+n.radius)}class x{constructor(){this._items=new s({allocator:e=>e||{object:null,distance:0,near:0,far:0},deallocator:e=>(e.object=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return this._items.length===0}clear(){this._items.clear()}add(e,t){let n=t.eye,r=t.viewForward,i=e.boundingVolumeWorldSpace.sphere,a=(i.center[0]-n[0])*r[0]+(i.center[1]-n[1])*r[1]+(i.center[2]-n[2])*r[2];if(!Number.isFinite(a))return;let o=this._items.pushNew();o.object=e,o.distance=a,o.near=a-i.radius,o.far=a+i.radius}sort(){this._items.sort((e,t)=>e.distance-t.distance)}forEachInDepthRange(e,t,n){if(t===1)for(let t=0;t<this._items.length;++t){let r=this._items.data[t];r.far<e.near||r.near>e.far||n(r.object,r.near,r.far)}else for(let t=this._items.length-1;t>=0;--t){let r=this._items.data[t];r.far<e.near||r.near>e.far||n(r.object,r.near,r.far)}}}class S{constructor(){this._geometries=[],this._near=[],this._far=[],this._nearCandidates=[],this._farCandidates=[],this._looseRange=new d(0,0)}compute(t,n,i){this._reset();let{viewMatrix:a}=t;n.forEach(e=>{e.forEachGeometry(e=>{if(!e.visible||i===0&&!e.castShadows)return;let t=e.boundingSphere,n=r(t.center,a),o=n-t.radius,s=n+t.radius;this._geometries.push(e),this._near.push(-s),this._far.push(-o)})});let o=new d;if(this._geometries.length===0)return o;for(let e=0;e<this._geometries.length;++e)this._near[e]>o.far&&(o.far=this._near[e]),this._near[e]>2&&this._far[e]<o.near&&(o.near=this._far[e]);let s=this._looseRange;s.near=Math.max(o.near*.5,2),s.far=o.far*2;let c=0,l=0;for(let e=0;e<this._geometries.length;++e)this._near[e]<o.near&&(this._near[e]>=s.near?o.near=this._near[e]:this._nearCandidates[c++]=e),this._far[e]>o.far&&(this._far[e]<=s.far?o.far=this._far[e]:this._farCandidates[l++]=e);if(this._nearCandidates.length===0&&this._farCandidates.length===0)return o;this._nearCandidates.sort((e,t)=>this._near[e]<this._near[t]?-1:+(this._near[e]>this._near[t])),this._farCandidates.sort((e,t)=>this._far[e]<this._far[t]?1:this._far[e]>this._far[t]?-1:0);for(let n=0;n<this._nearCandidates.length;++n){let r=this._nearCandidates[n];if(this._near[r]<o.near){let n=this._geometries[r],{boundingInfo:i}=n,a=n.type===0?n.shaderTransformation:e(k,n.localOrigin.vec3);this._includeNearBoundingInfoRec(t,i,a,o)}}for(let n=0;n<this._farCandidates.length;++n){let r=this._farCandidates[n];if(this._far[r]>o.far){let n=this._geometries[r],{boundingInfo:i}=n,a=n.type===0?n.shaderTransformation:e(k,n.localOrigin.vec3);this._includeFarBoundingInfoRec(t,i,a,o)}}return this._reset(),o}_reset(){this._geometries.length=0,this._near.length=0,this._far.length=0,this._nearCandidates.length=0,this._farCandidates.length=0}_isOutsideSidePlanes(e,t){let{center:n,radius:r}=e;return t[0][0]*n[0]+t[0][1]*n[1]+t[0][2]*n[2]+t[0][3]>r||t[1][0]*n[0]+t[1][1]*n[1]+t[1][2]*n[2]+t[1][3]>r||t[2][0]*n[0]+t[2][1]*n[1]+t[2][2]*n[2]+t[2][3]>r||t[3][0]*n[0]+t[3][1]*n[1]+t[3][2]*n[2]+t[3][3]>r}_includeNearBoundingInfoRec(e,t,n,a){if(t==null)return;i(O.center,t.sphere.center,n),O.radius=t.sphere.radius*u(n);let{frustum:o}=e;if(this._isOutsideSidePlanes(O,o))return;let s=O.radius,{viewMatrix:c}=e,l=r(O.center,c),d=l-s,f=l+s;if(!(-d<2)&&!(-f>=a.near)){if(-f>this._looseRange.near)a.near=-f;else{if(s>100){let r=t.children;if(r!==void 0){for(let t of r)this._includeNearBoundingInfoRec(e,t,n,a);return}}N.unionDepthRangeWithAABB(a,e.viewProjectionMatrix,n,t.box)}}}_includeFarBoundingInfoRec(e,t,n,a){if(t==null)return;i(O.center,t.sphere.center,n),O.radius=t.sphere.radius*u(n);let{frustum:o}=e;if(this._isOutsideSidePlanes(O,o))return;let{viewMatrix:s,viewProjectionMatrix:c}=e,l=r(O.center,s)-O.radius;if(!(-l<=a.far)){if(-l<this._looseRange.far)a.far=-l;else{if(O.radius>100){let r=t.children;if(r!==void 0){for(let t of r)this._includeFarBoundingInfoRec(e,t,n,a);return}}N.unionDepthRangeWithAABB(a,c,n,t.box)}}}}class C{constructor(){this._modelViewProj=n(),this._clipPosition=[o(),o(),o(),o(),o(),o(),o(),o()]}unionDepthRangeWithAABB(e,n,r,i){let a=this._modelViewProj;t(a,n,r);let o=!1;for(let e=0;e<8;++e){let t=this._clipPosition[e],n=e===0||e===3||e===4||e===7?i[0]:i[3],r=e===0||e===1||e===4||e===5?i[1]:i[4],o=e<4?i[2]:i[5];t[0]=a[0]*n+a[4]*r+a[8]*o+a[12],t[1]=a[1]*n+a[5]*r+a[9]*o+a[13],t[2]=a[2]*n+a[6]*r+a[10]*o+a[14],t[3]=a[3]*n+a[7]*r+a[11]*o+a[15]}for(let t=0;t<12;++t){let n=w(this._clipPosition[D[t][0]],this._clipPosition[D[t][1]],this._clipPosition[D[t][2]]),r=!0;for(let e=0;e<n.length;++e)if(n[e][3]>=2){r=!1;break}if(!r){o=!0;for(let t=0;t<n.length;++t){let r=n[t][3];Number.isFinite(r)&&(e.near=Math.min(r,e.near),e.far=Math.max(r,e.far))}}}return o}}function w(e,t,n){let r=[e,t,n];for(let e=0;e<4;++e){let t=r;r=[];for(let n=0;n<t.length;++n){let i=t[n],a=t[(n+1)%t.length];T(a,e)?(T(i,e)||r.push(E(i,a,e)),r.push(a)):T(i,e)&&r.push(E(i,a,e))}}return r}function T(e,t){if(t===0)return e[0]>=-e[3];if(t===1)return e[1]>=-e[3];if(t===2)return e[0]<=e[3];if(t===3)return e[1]<=e[3];f(!1)}function E(e,t,n){let r=0;return n===0?r=(-e[3]-e[0])/(t[0]-e[0]+t[3]-e[3]):n===1?r=(-e[3]-e[1])/(t[1]-e[1]+t[3]-e[3]):n===2?r=(e[3]-e[0])/(t[0]-e[0]-t[3]+e[3]):n===3&&(r=(e[3]-e[1])/(t[1]-e[1]-t[3]+e[3])),a(o(),e,t,r)}const D=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],O=new l,k=n(),A=new d,j=new x,M=new S,N=new C;export{p as depthRangeFromScene,m as unionDepthRangeWithAABB};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{isSome as r}from"../../../../../core/arrayUtils.js";import i from"../../../../../core/Error.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as o,dot as s,transformMat4 as c}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as u,freeze as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{someMap as f,getOrCreateMapValue as p}from"../../../../../core/MapUtils.js";import{destroyMaybe as m}from"../../../../../core/maybe.js";import{isAborted as h,throwIfAborted as g}from"../../../../../core/promiseUtils.js";import{defaultHighlightName as _}from"../../../../support/HighlightDefaults.js";import{TaskPriority as v,noBudget as y}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as b}from"../../../../webgl/Util.js";import{fromLayout as x}from"../../../../webgl/VertexAttributeLocations.js";import{glLayout as S}from"../../../support/buffer/glUtil.js";import{debugFlags as C}from"../../../support/debugFlags.js";import w from"../../../webgl/RenderCamera.js";import{isColor as T}from"../../core/shaderLibrary/ShaderOutput.js";import{getEmissions as E}from"../../effects/emissive/emissions.js";import{AsyncRenderPlugin as D}from"../../effects/RenderPlugin.js";import{colorMixModes as O}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as k}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as A}from"../../shaders/DefaultMaterialTechnique.js";import{DepthRange as j}from"../DepthRange.js";import{assert as M}from"../Util.js";import{InstanceData as N}from"./InstanceData.js";import{InstanceOctree as P}from"./InstanceOctree.js";import{LevelSelector as F}from"./LevelSelector.js";import{LodLevel as I}from"./LodLevel.js";import{getRenderInstanceDataLayout as L,RenderInstanceData as R}from"./RenderInstanceData.js";const z=e=>{let t=e.baseBoundingSphere.radius,n=e.levels.map(e=>e.minScreenSpaceRadius);return new F(t,n)};let B=class extends D{constructor(e,t){super(e),this.type=3,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=[],this._highlightRenderInstanceDatas=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new w,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>this._hasTransparentLevels()?this._produces(e):!1]]),this._instanceData=new N({shaderTransformation:e.shaderTransformation},e.symbol.materialParameters),this.addHandles(t.registerTask(v.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=L(this.symbol.materialParameters),this._glInstanceBufferLayout=S(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on(`instances-changed`,()=>this._requestUpdateCycle()),this._instanceData.events.on(`instance-transform-changed`,({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on(`instance-visibility-changed`,({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on(`instance-highlight-changed`,()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDatas.values()]}get _allRenderInstanceDataExceptHighlightShadow(){let e=[this._defaultRenderInstanceData];for(let t of this._highlightRenderInstanceDatas)t[0]!==_&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDatas.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get emissions(){return this._allRenderInstanceData.some(e=>e.some(({size:e})=>e>0))?E(this._levels):0}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){let e=this._instanceData.size,t=[];return this._levels.forEach((e,n)=>{let r=this._allRenderInstanceData[0][n].size+this._allRenderInstanceData[1][n].size,i=e.triangleCount;t.push({renderedInstances:r,renderedTriangles:r*i,trianglesPerInstance:i})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(){let{rctx:e}=this._context.renderContext;return this.symbol.levels.map(t=>new R(e,this._instanceBufferLayout))}async initializeRenderContext(e,t){this._context=e,this._defaultRenderInstanceData=this._createRenderInstanceDataArray();let n=await Promise.allSettled(this.symbol.levels.map(n=>I.create(e,n,t))),i=n.map(e=>e.status===`fulfilled`?e.value:null).filter(r);if(h(t)||i.length!==n.length){i.forEach(e=>e.destroy()),g(t);for(let e of n)if(e.status===`rejected`)throw e.reason}this._levels=i,this._levelSelector=z(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDatas.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){for(let e of this._levels)for(let t of e.components)if(t.material.produces.get(4)?.(0))return!0;return!1}hasHighlights(){return f(this._highlightRenderInstanceDatas,e=>e.some(e=>e.size>0))}_produces(e){return(e!==10||this.hasHighlights())&&(e!==6||this.hasHighlight(_))}prepareRender(e){if(!C.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){let t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&=(this.runTask(y),!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;let t=this._getInstanceDatas(e);if(!t)return null;let n=[],r=this.levels;for(let i of t)for(let t=0;t<r.length;t++)for(let a of r[t].components)n.push(this._beginComponent(e,i[t],a));return n}render(e,t){let n=this._getInstanceDatas(e);if(!n||t==null)return;let r=0,i=this.levels;for(let a of n)for(let n=0;n<i.length;n++)for(let o of i[n].components)this._renderComponent(e,t[r++],a[n],o,n);e.rctx.unbindBuffer(34962),e.rctx.bindVAO(null)}_getInstanceDatas(e){let{output:t,bind:n}=e,r=t===10,i=t===6,a=!r&&!i,o=t!==7;if(a)return o?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;let{_highlightRenderInstanceDatas:s}=this;if(o){if(r){let e=n.highlight?.name;if(!e)return null;let t=s.get(e);return t?[t]:null}let e=s.get(_);return i?e?[e]:null:Array.from(s.values())}return null}intersectRay(e,t,n,r){if(!this.baseMaterial.visible||this._octree==null)return;let i=l();o(i,r,n);let a=i=>{let a=this._setupIntersectableInstance(e,i);a&&(c(K,n,e.transform.inverse),c(q,r,e.transform.inverse),a.intersect(e,t,K,q,i,this.metadata,this._levels.length))};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(n,i,a)}*intersectScreenPolygon(e,t){if(!this.baseMaterial.visible||this._octree==null)return;let n=this.baseMaterial.parameters.verticalOffset?this._octree.values():this._octree.intersectingFrustumValues(t.broadPhaseFrustum,e=>!!(this._instanceData.getState(e)&4));for(let r of n)yield*this._intersectScreenPolygonInstance(e,t,r)}*_intersectScreenPolygonInstance(e,t,n){let r=this._setupIntersectableInstance(e,n);r&&(yield*r.intersectScreenPolygon(e,t,n,this.metadata,this._levels.length))}_setupIntersectableInstance(e,t){let n=this._instanceData.getState(t);if(!(n&4))return null;let r=this._instanceData.getLodLevel(t),i=this._levels.length;M(!!(n&18),`invalid instance state`),M(r>=0&&r<i,`invaid lod level`);let a=this._levels[r];return a==null?null:(this._instanceData.getCombinedModelTransform(t,G),e.transform.set(G),a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(this._octreeCached==null){let e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new P(e,this.baseBoundingSphere);for(let n=0;n<e.capacity;++n)t.get(n)&18&&this._octreeCached.addInstance(n)}return this._octreeCached}_invalidateOctree(){this._octreeCached=m(this._octreeCached),this._depthRange=null}queryDepthRange(e){let t=this._octree;return t==null?new j:(this._depthRange&&this._depthRangeCamera?.equals(e)||(this._depthRange=this._computeDepthRange(e,t),this._depthRangeCamera??=new w,this._depthRangeCamera.copyFrom(e)),new j(this._depthRange.near,this._depthRange.far))}_computeDepthRange(e,t){let n=e.viewForward,r=t.findClosest(n,1,e.frustum),i=t.findClosest(n,-1,e.frustum);if(r==null||i==null)return new j;let a=e.eye,c=this._instanceData.view;c.boundingSphere.getVec(r,W),o(W,W,a);let l=s(W,n)-W[3];c.boundingSphere.getVec(i,W),o(W,W,a);let u=s(W,n)+W[3];return new j(l,u)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get readyToRun(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){let{_enableLevelSelection:t,_camera:n,_levelSelector:r}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));let a=this._instanceData,o=a.view,s=a.size,c=a.capacity,l=this._instanceIndex,u=Math.ceil(c/500),{_highlightRenderInstanceDatas:d}=this;for(let f=0;f<s&&!e.done;++f){l===this._cycleStartIndex&&this._startUpdateCycle();let f=o.state.get(l),m=0;if(!(f&1)){l=(l+1)%c,s++;continue}let h=o.lodLevel.get(l);if(f&2&&this._defaultRenderInstanceData[h].freeTail(),f&16){let e=a.geHighlightOptionsPrev(l);if(e){let t=d.get(e);if(t)t[h].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),d.delete(e));else throw new i(`internal:lod-renderer`,`Internal error in lodRenderer`)}}if(f&32)a.freeInstance(l);else if(f&4){let e=0;if(t&&(o.modelOrigin.getVec(l,U),e=r.selectLevel(U,a.getCombinedMedianScaleFactor(l),n)),m=f&-83,e>=0){if(f&8){let t=a.getHighlightName(l);if(t){let n=p(d,t,()=>{let e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e});if(e>=n.length)throw new i(`internal:lod-renderer`,`LodRenderer internal error - missing lodLevel ${e}`);V(n[e],o,l)}m|=16}else V(this._defaultRenderInstanceData[e],o,l),m|=2}o.state.set(l,m),o.lodLevel.set(l,e)}else m=f&-83,o.state.set(l,m);let g=!!(f&18),_=!!(m&18);this._octreeCached!=null&&(!g&&_?(this._depthRange=null,this._octreeCached.addInstance(l)):g&&!_?(this._depthRange=null,this._octreeCached.removeInstance(l)):g&&_&&f&64&&(this._depthRange=null,this._octreeCached.removeInstance(l),this._octreeCached.addInstance(l)));let v=l;l=(l+1)%c,l%u===0&&e.madeProgress(),g!==_&&this.metadata.notifyGraphicVisibilityChanged(v),_&&f&64&&this.metadata.notifyGraphicGeometryChanged(v)}this._instanceIndex=l,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,n){return t.size===0?null:n.glMaterialLoader.load(e.rctx,e.bind.slot,e.output)?.beginSlot(e.bind)}_renderComponent(e,t,n,r,i){if(!t)return;let{bind:a,rctx:o}=e,s=o.bindTechnique(t,a,r.material.parameters,Y),c=this._glInstanceBufferLayout;C.ENABLE_OPTIMIZATIONS||s.assertCompatibleVertexAttributeLocations(r.vao,x(c)),o.bindVAO(r.vao),C.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&T(e.output)&&(s.setUniform4fv(`externalColor`,J[Math.min(i,J.length-1)]),s.setUniform1i(`symbolColorMixMode`,O.replace));let l=n.capacity,u=n.headIndex,d=n.tailIndex,f=n.firstIndex,p=(e,i)=>{b(o,s.locations,n.buffer,e),o.drawArraysInstanced(t.primitiveType,0,r.numVertices,i-e)};r.material.transparent&&f!=null?u>d?(M(f>=d&&f<=u,`invalid firstIndex`),p(f,u),p(d,f)):u<d&&(f<=u?(M(f>=0&&f<=u,`invalid firstIndex`),p(f,u),p(d,l),p(0,f)):(M(f>=d&&f<=l,`invalid firstIndex`),p(f,l),p(0,u),p(d,f))):u>d?p(d,u):u<d&&(p(0,u),p(d,l))}};e([t({constructOnly:!0})],B.prototype,`symbol`,void 0),e([t({constructOnly:!0})],B.prototype,`metadata`,void 0),e([t({constructOnly:!0})],B.prototype,`shaderTransformation`,void 0),e([t()],B.prototype,`_instanceData`,void 0),e([t()],B.prototype,`_cycleStartIndex`,void 0),e([t({readOnly:!0})],B.prototype,`_enableLevelSelection`,null),e([t()],B.prototype,`_updateCyclesWithStaticCamera`,void 0),e([t({readOnly:!0})],B.prototype,`readyToRun`,null),B=e([n(`esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer`)],B);function V(e,t,n){let r=e.allocateHead();H(t,n,e.view,r)}function H(e,t,n,r){k(e.modelOrigin,t,n.modelOriginHi,n.modelOriginLo,r),n.model.copyFrom(r,e.model,t),n.modelNormal.copyFrom(r,e.modelNormal,t),e.color&&n.color&&n.color.copyFrom(r,e.color,t),e.olidColor&&n.olidColor&&n.olidColor.copyFrom(r,e.olidColor,t),e.featureAttribute&&n.featureAttribute&&n.featureAttribute.copyFrom(r,e.featureAttribute,t)}const U=l(),W=u(),G=a(),K=l(),q=l(),J=[d(1,0,1,1),d(0,0,1,1),d(0,1,0,1),d(1,1,0,1),d(1,0,0,1)],Y=new A;export{B as LodRenderer};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{isSome as r}from"../../../../../core/arrayUtils.js";import i from"../../../../../core/Error.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as o,dot as s,transformMat4 as c}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as u,freeze as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{someMap as f,getOrCreateMapValue as p}from"../../../../../core/MapUtils.js";import{destroyMaybe as m}from"../../../../../core/maybe.js";import{isAborted as h,throwIfAborted as g}from"../../../../../core/promiseUtils.js";import{defaultHighlightName as _}from"../../../../support/HighlightDefaults.js";import{TaskPriority as v,noBudget as y}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as b}from"../../../../webgl/Util.js";import{fromLayout as x}from"../../../../webgl/VertexAttributeLocations.js";import{glLayout as S}from"../../../support/buffer/glUtil.js";import{debugFlags as C}from"../../../support/debugFlags.js";import w from"../../../webgl/RenderCamera.js";import{isColor as T}from"../../core/shaderLibrary/ShaderOutput.js";import{getEmissions as E}from"../../effects/emissive/emissions.js";import{AsyncRenderPlugin as D}from"../../effects/RenderPlugin.js";import{colorMixModes as O}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as k}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as A}from"../../shaders/DefaultMaterialTechnique.js";import{DepthRange as j}from"../DepthRange.js";import{assert as M}from"../Util.js";import{InstanceData as N}from"./InstanceData.js";import{InstanceOctree as P}from"./InstanceOctree.js";import{LevelSelector as F}from"./LevelSelector.js";import{LodLevel as I}from"./LodLevel.js";import{getRenderInstanceDataLayout as L,RenderInstanceData as R}from"./RenderInstanceData.js";const z=e=>{let t=e.baseBoundingSphere.radius,n=e.levels.map(e=>e.minScreenSpaceRadius);return new F(t,n)};let B=class extends D{constructor(e,t){super(e),this.type=3,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=[],this._highlightRenderInstanceDatas=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new w,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>this._hasTransparentLevels()?this._produces(e):!1]]),this._instanceData=new N({shaderTransformation:e.shaderTransformation},e.symbol.materialParameters),this.addHandles(t.registerTask(v.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=L(this.symbol.materialParameters),this._glInstanceBufferLayout=S(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on(`instances-changed`,()=>this._requestUpdateCycle()),this._instanceData.events.on(`instance-transform-changed`,({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on(`instance-visibility-changed`,({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on(`instance-highlight-changed`,()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDatas.values()]}get _allRenderInstanceDataExceptHighlightShadow(){let e=[this._defaultRenderInstanceData];for(let t of this._highlightRenderInstanceDatas)t[0]!==_&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDatas.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get emissions(){return this._allRenderInstanceData.some(e=>e.some(({size:e})=>e>0))?E(this._levels):0}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){let e=this._instanceData.size,t=[];return this._levels.forEach((e,n)=>{let r=this._allRenderInstanceData[0][n].size+this._allRenderInstanceData[1][n].size,i=e.triangleCount;t.push({renderedInstances:r,renderedTriangles:r*i,trianglesPerInstance:i})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(){let{rctx:e}=this._context.renderContext;return this.symbol.levels.map(t=>new R(e,this._instanceBufferLayout))}async initializeRenderContext(e,t){this._context=e,this._defaultRenderInstanceData=this._createRenderInstanceDataArray();let n=await Promise.allSettled(this.symbol.levels.map(n=>I.create(e,n,t))),i=n.map(e=>e.status===`fulfilled`?e.value:null).filter(r);if(h(t)||i.length!==n.length){i.forEach(e=>e.destroy()),g(t);for(let e of n)if(e.status===`rejected`)throw e.reason}this._levels=i,this._levelSelector=z(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDatas.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){for(let e of this._levels)for(let t of e.components)if(t.material.produces.get(4)?.(0))return!0;return!1}hasHighlights(){return f(this._highlightRenderInstanceDatas,e=>e.some(e=>e.size>0))}_produces(e){return(e!==10||this.hasHighlights())&&(e!==6||this.hasHighlight(_))}prepareRender(e){if(!C.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){let t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&=(this.runTask(y),!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;let t=this._getInstanceDatas(e);if(!t)return null;let n=[],r=this.levels;for(let i of t)for(let t=0;t<r.length;t++)for(let a of r[t].components)n.push(this._beginComponent(e,i[t],a));return n}render(e,t){let n=this._getInstanceDatas(e);if(!n||t==null)return;let r=0,i=this.levels;for(let a of n)for(let n=0;n<i.length;n++)for(let o of i[n].components)this._renderComponent(e,t[r++],a[n],o,n);e.rctx.unbindBuffer(34962),e.rctx.bindVAO(null)}_getInstanceDatas(e){let{output:t,bind:n}=e,r=t===10,i=t===6,a=!r&&!i,o=t!==7;if(a)return o?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;let{_highlightRenderInstanceDatas:s}=this;if(o){if(r){let e=n.highlight?.name;if(!e)return null;let t=s.get(e);return t?[t]:null}let e=s.get(_);return i?e?[e]:null:Array.from(s.values())}return null}intersectRay(e,t,n,r){if(!this.baseMaterial.visible||this._octree==null)return;let i=l();o(i,r,n);let a=i=>{let a=this._setupIntersectableInstance(e,i);a&&(c(K,n,e.transform.inverse),c(q,r,e.transform.inverse),a.intersect(e,t,K,q,i,this.metadata,this._levels.length))};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(n,i,a)}*intersectScreenPolygon(e,t){if(!this.baseMaterial.visible||this._octree==null)return;let n=this.baseMaterial.parameters.verticalOffset?this._octree.values():this._octree.intersectingFrustumValues(t.broadPhaseFrustum,e=>!!(this._instanceData.getState(e)&4));for(let r of n)yield*this._intersectScreenPolygonInstance(e,t,r)}*_intersectScreenPolygonInstance(e,t,n){let r=this._setupIntersectableInstance(e,n);r&&(yield*r.intersectScreenPolygon(e,t,n,this.metadata,this._levels.length))}_setupIntersectableInstance(e,t){let n=this._instanceData.getState(t);if(!(n&4))return null;let r=this._instanceData.getLodLevel(t),i=this._levels.length;M(!!(n&18),`invalid instance state`),M(r>=0&&r<i,`invaid lod level`);let a=this._levels[r];return a==null?null:(this._instanceData.getCombinedModelTransform(t,G),e.transform.set(G),a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(this._octreeCached==null){let e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new P(e,this.baseBoundingSphere);for(let n=0;n<e.capacity;++n)t.get(n)&18&&this._octreeCached.addInstance(n)}return this._octreeCached}_invalidateOctree(){this._octreeCached=m(this._octreeCached),this._depthRange=null}unionDepthRange(e,t){let n=this._octree;n!=null&&(this._depthRange&&this._depthRangeCamera?.equals(e)||(this._depthRange=this._computeDepthRange(e,n),this._depthRangeCamera??=new w,this._depthRangeCamera.copyFrom(e)),t.union(this._depthRange))}_computeDepthRange(e,t){let n=e.viewForward,r=t.findClosest(n,1,e.frustum),i=t.findClosest(n,-1,e.frustum);if(r==null||i==null)return new j;let a=e.eye,c=this._instanceData.view;c.boundingSphere.getVec(r,W),o(W,W,a);let l=s(W,n)-W[3];c.boundingSphere.getVec(i,W),o(W,W,a);let u=s(W,n)+W[3];return new j(l,u)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get readyToRun(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){let{_enableLevelSelection:t,_camera:n,_levelSelector:r}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));let a=this._instanceData,o=a.view,s=a.size,c=a.capacity,l=this._instanceIndex,u=Math.ceil(c/500),{_highlightRenderInstanceDatas:d}=this;for(let f=0;f<s&&!e.done;++f){l===this._cycleStartIndex&&this._startUpdateCycle();let f=o.state.get(l),m=0;if(!(f&1)){l=(l+1)%c,s++;continue}let h=o.lodLevel.get(l);if(f&2&&this._defaultRenderInstanceData[h].freeTail(),f&16){let e=a.geHighlightOptionsPrev(l);if(e){let t=d.get(e);if(t)t[h].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),d.delete(e));else throw new i(`internal:lod-renderer`,`Internal error in lodRenderer`)}}if(f&32)a.freeInstance(l);else if(f&4){let e=0;if(t&&(o.modelOrigin.getVec(l,U),e=r.selectLevel(U,a.getCombinedMedianScaleFactor(l),n)),m=f&-83,e>=0){if(f&8){let t=a.getHighlightName(l);if(t){let n=p(d,t,()=>{let e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e});if(e>=n.length)throw new i(`internal:lod-renderer`,`LodRenderer internal error - missing lodLevel ${e}`);V(n[e],o,l)}m|=16}else V(this._defaultRenderInstanceData[e],o,l),m|=2}o.state.set(l,m),o.lodLevel.set(l,e)}else m=f&-83,o.state.set(l,m);let g=!!(f&18),_=!!(m&18);this._octreeCached!=null&&(!g&&_?(this._depthRange=null,this._octreeCached.addInstance(l)):g&&!_?(this._depthRange=null,this._octreeCached.removeInstance(l)):g&&_&&f&64&&(this._depthRange=null,this._octreeCached.removeInstance(l),this._octreeCached.addInstance(l)));let v=l;l=(l+1)%c,l%u===0&&e.madeProgress(),g!==_&&this.metadata.notifyGraphicVisibilityChanged(v),_&&f&64&&this.metadata.notifyGraphicGeometryChanged(v)}this._instanceIndex=l,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,n){return t.size===0?null:n.glMaterialLoader.load(e.rctx,e.bind.slot,e.output)?.beginSlot(e.bind)}_renderComponent(e,t,n,r,i){if(!t)return;let{bind:a,rctx:o}=e,s=o.bindTechnique(t,a,r.material.parameters,Y),c=this._glInstanceBufferLayout;C.ENABLE_OPTIMIZATIONS||s.assertCompatibleVertexAttributeLocations(r.vao,x(c)),o.bindVAO(r.vao),C.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&T(e.output)&&(s.setUniform4fv(`externalColor`,J[Math.min(i,J.length-1)]),s.setUniform1i(`symbolColorMixMode`,O.replace));let l=n.capacity,u=n.headIndex,d=n.tailIndex,f=n.firstIndex,p=(e,i)=>{b(o,s.locations,n.buffer,e),o.drawArraysInstanced(t.primitiveType,0,r.numVertices,i-e)};r.material.transparent&&f!=null?u>d?(M(f>=d&&f<=u,`invalid firstIndex`),p(f,u),p(d,f)):u<d&&(f<=u?(M(f>=0&&f<=u,`invalid firstIndex`),p(f,u),p(d,l),p(0,f)):(M(f>=d&&f<=l,`invalid firstIndex`),p(f,l),p(0,u),p(d,f))):u>d?p(d,u):u<d&&(p(0,u),p(d,l))}};e([t({constructOnly:!0})],B.prototype,`symbol`,void 0),e([t({constructOnly:!0})],B.prototype,`metadata`,void 0),e([t({constructOnly:!0})],B.prototype,`shaderTransformation`,void 0),e([t()],B.prototype,`_instanceData`,void 0),e([t()],B.prototype,`_cycleStartIndex`,void 0),e([t({readOnly:!0})],B.prototype,`_enableLevelSelection`,null),e([t()],B.prototype,`_updateCyclesWithStaticCamera`,void 0),e([t({readOnly:!0})],B.prototype,`readyToRun`,null),B=e([n(`esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer`)],B);function V(e,t,n){let r=e.allocateHead();H(t,n,e.view,r)}function H(e,t,n,r){k(e.modelOrigin,t,n.modelOriginHi,n.modelOriginLo,r),n.model.copyFrom(r,e.model,t),n.modelNormal.copyFrom(r,e.modelNormal,t),e.color&&n.color&&n.color.copyFrom(r,e.color,t),e.olidColor&&n.olidColor&&n.olidColor.copyFrom(r,e.olidColor,t),e.featureAttribute&&n.featureAttribute&&n.featureAttribute.copyFrom(r,e.featureAttribute,t)}const U=l(),W=u(),G=a(),K=l(),q=l(),J=[d(1,0,1,1),d(0,0,1,1),d(0,1,0,1),d(1,1,0,1),d(1,0,0,1)],Y=new A;export{B as LodRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{BufferGeometryBaseInstance as e}from"../lib/BufferGeometryBaseInstance.js";import{Buffers as t}from"../lib/Buffers.js";import{baseLayout as n}from"../shaders/hudMaterialLayouts.js";function r(){return a??=i(),a}function i(){let r=n.createBuffer(4);return r.uv0.setValues(0,0,0),r.uv0.setValues(1,0,255),r.uv0.setValues(2,255,0),r.uv0.setValues(3,255,255),new e(new t(r))}let a=null;export{r as getHUDMaterialBufferBaseInstance};
2
+ import{BufferGeometryBaseInstance as e}from"../lib/BufferGeometryBaseInstance.js";import{Buffers as t}from"../lib/Buffers.js";import{baseLayout as n}from"../shaders/hudMaterialLayouts.js";function r(){return a??=i()}function i(){let r=n.createBuffer(4);return r.uv0.setValues(0,0,0),r.uv0.setValues(1,0,255),r.uv0.setValues(2,255,0),r.uv0.setValues(3,255,255),new e(new t(r))}let a=null;export{r as getHUDMaterialBufferBaseInstance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{BufferGeometryBaseInstance as e}from"../lib/BufferGeometryBaseInstance.js";import{Buffers as t}from"../lib/Buffers.js";import{baseLayout as n}from"../shaders/LineCalloutTechnique.js";function r(){return a??=i(),a}function i(){let r=n.createBuffer(4);return r.uv0.setValues(0,0,0),r.uv0.setValues(1,0,255),r.uv0.setValues(2,255,0),r.uv0.setValues(3,255,255),new e(new t(r))}let a=null;export{r as getLineCalloutMaterialBaseInstance};
2
+ import{BufferGeometryBaseInstance as e}from"../lib/BufferGeometryBaseInstance.js";import{Buffers as t}from"../lib/Buffers.js";import{baseLayout as n}from"../shaders/LineCalloutTechnique.js";function r(){return a??=i()}function i(){let r=n.createBuffer(4);return r.uv0.setValues(0,0,0),r.uv0.setValues(1,0,255),r.uv0.setValues(2,255,0),r.uv0.setValues(3,255,255),new e(new t(r))}let a=null;export{r as getLineCalloutMaterialBaseInstance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../core/Error.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../../webscene/support/AlphaCutoff.js";import"../../../webgl/ShaderBuilder.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/getLocalUp.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/shading/WaterColor.glsl.js";import"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";export{b as build}from"../../../../chunks/Water.glsl.js";
2
+ import"../../../../core/Error.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../../webscene/support/AlphaCutoff.js";import"../../../webgl/ShaderBuilder.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/Gamma.glsl.js";import"../core/shaderLibrary/shading/getLocalUp.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"./getWaterColor.glsl.js";export{b as build}from"../../../../chunks/Water.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../core/has.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{BufferViewVec3f as i}from"../../../../geometry/support/buffer/BufferView.js";import{is3DGeometry as a,isNormals as o,isShadowLike as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as c}from"../effects/geometry/olidUtils.js";import{createPositionReader as l}from"../lib/PositionReader.js";import{configureShadedMaterial as u}from"../shaders/ShadedMaterialConfiguration.js";import{PositionUvf32OlidLayout as d,PositionUvf32Layout as f}from"./DefaultLayouts.js";import{TriangleMaterialParameters as p,TriangleMaterial as m}from"./TriangleMaterial.js";import{WaterGLMaterial as h}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as g}from"./WaterTechniqueConfiguration.js";class _ extends m{constructor(e,t){super(e,v),this.visible=!0,this.produces=new Map([[2,e=>this._isMaterialPass(e)&&!this.transparent],[4,e=>this._isMaterialPass(e)&&this.transparent],[18,e=>this.parameters.draped&&a(e)],[19,e=>e===4]]),this._configuration=new g(t.spherical)}updateConfiguration(e){super.updateConfiguration(e),u(this._configuration,e,this.parameters),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=e.hasScreenSpaceReflections,this._configuration.cloudReflections=e.clouds.data!=null,this._configuration.draped=this.parameters.draped,this._configuration.drapedNormals=o(e.output)&&e.slot===19}update(e){return this.setParameters({timeElapsed:r(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(e){let t=Math.min(e.relativeElevation,e.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*t<y}get transparent(){return this.parameters.transparent}_isMaterialPass(e){return a(e)||this.parameters.castShadows&&!this.parameters.draped&&s(e)}createGLMaterial(e){return new h(e)}createBufferWriter(){return new x}createPrimitivePositionReader(e){let t=e.vertex.getField(`position`,i);return l(t.typedBuffer,e.index,t.typedBufferStride)}get test(){}}class v extends p{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=n(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.castShadows=!1,this.origin=t(),this.modelTransformation=null,this.shadingEnabled=!0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0}}const y=35e3;function b(){return c()?d:f}class x{constructor(){this.layout=b()}elementCount(){throw Error(`WaterMaterial only supports BufferGeometry`)}write(){throw Error(`WaterMaterial only supports BufferGeometry`)}rebaseBuffers(e,t){t?.buffer.copyFrom(e.vertex,0,t.offset)}}export{v as Parameters,_ as WaterMaterial,b as getWaterLayout};
2
+ import"../../../../core/has.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{BufferViewVec3f as i}from"../../../../geometry/support/buffer/BufferView.js";import{is3DGeometry as a,isNormals as o,isColor as s,isShadowLike as c}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import{createPositionReader as u}from"../lib/PositionReader.js";import{configureShadedMaterial as d}from"../shaders/ShadedMaterialConfiguration.js";import{PositionUvf32OlidLayout as f,PositionUvf32Layout as p}from"./DefaultLayouts.js";import{TriangleMaterialParameters as m,TriangleMaterial as h}from"./TriangleMaterial.js";import{WaterGLMaterial as g}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as _}from"./WaterTechniqueConfiguration.js";class v extends h{constructor(e,t){super(e,y),this.visible=!0,this.produces=new Map([[2,e=>this._isMaterialPass(e)&&!this.transparent],[4,e=>this._isMaterialPass(e)&&this.transparent],[18,e=>this.parameters.draped&&a(e)],[19,e=>e===4]]),this._configuration=new _(t.spherical)}updateConfiguration(e){super.updateConfiguration(e),d(this._configuration,e,this.parameters),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.draped=this.parameters.draped,this._configuration.drapedNormals=o(e.output)&&e.slot===19;let t=s(e.output);this._configuration.screenSpaceReflections=t&&e.hasScreenSpaceReflections,this._configuration.cloudReflections=t&&e.clouds.data!=null,this._configuration.emissionReflections=t&&this._configuration.screenSpaceReflections&&this._configuration.hasEmission&&e.reprojection.lastFrameEmission!=null}update(e){return this.setParameters({timeElapsed:r(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(e){let t=Math.min(e.relativeElevation,e.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*t<b}get transparent(){return this.parameters.transparent}_isMaterialPass(e){return a(e)||this.parameters.castShadows&&!this.parameters.draped&&c(e)}createGLMaterial(e){return new g(e)}createBufferWriter(){return new S}createPrimitivePositionReader(e){let t=e.vertex.getField(`position`,i);return u(t.typedBuffer,e.index,t.typedBufferStride)}get test(){}}class y extends m{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=n(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.castShadows=!1,this.origin=t(),this.modelTransformation=null,this.shadingEnabled=!0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0}}const b=35e3;function x(){return l()?f:p}class S{constructor(){this.layout=x()}elementCount(){throw Error(`WaterMaterial only supports BufferGeometry`)}write(){throw Error(`WaterMaterial only supports BufferGeometry`)}rebaseBuffers(e,t){t?.buffer.copyFrom(e.vertex,0,t.offset)}}export{y as Parameters,v as WaterMaterial,x as getWaterLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as n}from"./TriangleTechniqueConfiguration.js";class r extends n{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.drapedNormals=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1,this.receiveAmbientOcclusion=!1}}e([t()],r.prototype,`receiveGlobalIllumination`,void 0),e([t()],r.prototype,`receiveShadows`,void 0),e([t()],r.prototype,`hasShadowHighlights`,void 0),e([t()],r.prototype,`screenSpaceReflections`,void 0),e([t()],r.prototype,`cloudReflections`,void 0),e([t()],r.prototype,`draped`,void 0),e([t()],r.prototype,`drapedNormals`,void 0);export{r as WaterTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as n}from"./TriangleTechniqueConfiguration.js";class r extends n{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.emissionReflections=!1,this.draped=!1,this.drapedNormals=!1,this.textureCoordinateType=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1,this.receiveAmbientOcclusion=!1}get emissionSource(){return+!!this.hasEmission}}e([t()],r.prototype,`receiveGlobalIllumination`,void 0),e([t()],r.prototype,`receiveShadows`,void 0),e([t()],r.prototype,`hasShadowHighlights`,void 0),e([t()],r.prototype,`screenSpaceReflections`,void 0),e([t()],r.prototype,`cloudReflections`,void 0),e([t()],r.prototype,`emissionReflections`,void 0),e([t()],r.prototype,`draped`,void 0),e([t()],r.prototype,`drapedNormals`,void 0);export{r as WaterTechniqueConfiguration};
@@ -0,0 +1,89 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{lastFrameEmissionTexture as e,lastFrameColorTexture as t}from"../core/shaderLibrary/lastFrameUniforms.js";import{renderClouds as n}from"../core/shaderLibrary/renderClouds.glsl.js";import{FoamColor as r}from"../core/shaderLibrary/shading/FoamRendering.glsl.js";import{Gamma as i}from"../core/shaderLibrary/shading/Gamma.glsl.js";import{lightingSpecularStrength as a,lightingEnvironmentStrength as o}from"../core/shaderLibrary/shading/lightingUniforms.js";import{PhysicallyBasedRenderingWater as s}from"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{distanceFadeStart as c,distanceFadeEnd as l}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{ScreenSpaceRayMarching as u}from"../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{viewMatrix as d}from"../core/shaderLibrary/util/cameraUniforms.js";import{FloatBindUniform as f}from"../core/shaderModules/FloatBindUniform.js";import{glsl as p,If as m}from"../core/shaderModules/glsl.js";import{ToneMapping as h}from"../shaders/ToneMapping.glsl.js";function g(g,_){let v=g.fragment;_.emissionReflections&&v.uniforms.add(e).code.add(`vec3 waterEmission = vec3(0.0);`),v.include(s,_),v.include(i),v.include(r),_.cloudReflections&&g.include(n),_.screenSpaceReflections&&g.include(u,_),v.include(h),v.constants.add(`fresnelSky`,`vec3`,[.02,1,15]),v.constants.add(`fresnelMaterial`,`vec2`,[.02,.1]),v.constants.add(`roughness`,`float`,.015),v.constants.add(`foamIntensityExternal`,`float`,1.7),v.constants.add(`ssrIntensity`,`float`,.65),v.constants.add(`ssrHeightFadeStart`,`float`,c),v.constants.add(`ssrHeightFadeEnd`,`float`,l),v.constants.add(`waterDiffusion`,`float`,.92),v.constants.add(`waterSeaColorMod`,`float`,.8),v.constants.add(`correctionViewingPowerFactor`,`float`,.4),v.constants.add(`skyZenitColor`,`vec3`,[.52,.68,.9]),v.constants.add(`skyColor`,`vec3`,[.67,.79,.9]),v.constants.add(`cloudFresnelModifier`,`vec2`,[1.2,.01]),v.code.add(p`PBRShadingWater shadingInfo;
3
+ vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) {
4
+ float exponent = pow((1.0 - cosTheta), fresnelSky[2]);
5
+ return mix(zenit, horizon, exponent);
6
+ }`),v.uniforms.add(a,o).code.add(p`vec3 getWaterColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 viewPosition, vec3 position) {
7
+ float reflectionHit = 0.0;
8
+ float reflectionHitDiffused = 0.0;
9
+ vec3 seaWaterColor = linearizeGamma(color);
10
+ vec3 h = normalize(l + v);
11
+ shadingInfo.NdotV = clamp(dot(n, v), 0.001, 1.0);
12
+ shadingInfo.VdotN = clamp(dot(v, n), 0.001, 1.0);
13
+ shadingInfo.NdotH = clamp(dot(n, h), 0.0, 1.0);
14
+ shadingInfo.VdotH = clamp(dot(v, h), 0.0, 1.0);
15
+ shadingInfo.LdotH = clamp(dot(l, h), 0.0, 1.0);
16
+ float upDotV = max(dot(localUp,v), 0.0);
17
+ vec3 skyHorizon = linearizeGamma(skyColor);
18
+ vec3 skyZenit = linearizeGamma(skyZenitColor);
19
+ vec3 skyColor = getSkyGradientColor(upDotV, skyHorizon, skyZenit );
20
+ float upDotL = max(dot(localUp,l),0.0);
21
+ float daytimeMod = 0.1 + upDotL * 0.9;
22
+ skyColor *= daytimeMod;
23
+ float shadowModifier = clamp(shadow, 0.8, 1.0);
24
+ vec3 fresnelModifier = fresnelReflection(shadingInfo.VdotN, vec3(fresnelSky[0]), fresnelSky[1]);
25
+ vec3 reflSky = lightingEnvironmentStrength * fresnelModifier * skyColor * shadowModifier;
26
+ vec3 reflSea = seaWaterColor * mix(skyColor, upDotL * lightIntensity * LIGHT_NORMALIZATION, 2.0 / 3.0) * shadowModifier;
27
+ vec3 specular = vec3(0.0);
28
+ if(upDotV > 0.0 && upDotL > 0.0) {
29
+ vec3 specularSun = brdfSpecularWater(shadingInfo, roughness, vec3(fresnelMaterial[0]), fresnelMaterial[1]);
30
+ vec3 incidentLight = lightIntensity * LIGHT_NORMALIZATION * shadow;
31
+ float NdotL = clamp(dot(n, l), 0.0, 1.0);
32
+ specular = lightingSpecularStrength * NdotL * incidentLight * specularSun;
33
+ }
34
+ vec3 foam = vec3(0.0);
35
+ if(upDotV > 0.0) {
36
+ foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitColor, daytimeMod);
37
+ }
38
+ float correctionViewingFactor = pow(max(dot(v, localUp), 0.0), correctionViewingPowerFactor);
39
+ vec3 normalCorrectedClouds = mix(localUp, n, correctionViewingFactor);
40
+ vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`),_.cloudReflections&&v.code.add(p`vec3 rimLight = vec3(0.0);
41
+ vec4 clouds = renderClouds(reflectedWorld, position, rimLight);
42
+ vec3 colorWithRim = tonemapKhronosNeutral(clouds.rgb + rimLight);
43
+ vec3 colorWithoutRim = tonemapKhronosNeutral(clouds.rgb);
44
+ clouds.rgb += colorWithRim - colorWithoutRim;
45
+ clouds.a = 1.0 - clouds.a;
46
+ clouds = pow(clouds, vec4(GAMMA));
47
+ clouds *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0);`),_.screenSpaceReflections?v.uniforms.add(d,t,new f(`fadeFactorSSR`,e=>e.screenSpaceReflections.fadeFactor)).code.add(p`
48
+ // Convert the world position to view position
49
+ vec3 viewDir = normalize(viewPosition);
50
+ vec4 viewNormalVectorCoordinate = view * vec4(n, 0.0);
51
+ vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz);
52
+ vec4 viewUp = view * vec4(localUp, 0.0);
53
+
54
+ // at steeper viewing angles we use more of a vertex normal (in this case up) then the wave normal
55
+ // this removes some artifacts of normal mapping
56
+ vec3 viewNormalCorrectedSSR = mix(viewUp.xyz, viewNormal, correctionViewingFactor);
57
+
58
+ vec3 reflected = normalize(reflect(viewDir, viewNormalCorrectedSSR));
59
+
60
+ // perform screen space reflection to detect hit
61
+ vec3 hitCoordinate = screenSpaceIntersection(reflected, viewPosition, viewDir, viewUp.xyz, 0.0);
62
+ vec3 reflectedColor = vec3(0.0);
63
+
64
+ // if there is a hit with ssr find reflected color from the reprojected frame
65
+ if (hitCoordinate.z > 0.0) {
66
+ vec2 reprojectedCoordinate = reprojectionCoordinate(hitCoordinate);
67
+
68
+ // fade out if there if the hit is near end of Y axis
69
+ vec2 dCoords = smoothstep(0.3, 0.6, abs(vec2(0.5, 0.5) - hitCoordinate.xy));
70
+ float heightMod = smoothstep(ssrHeightFadeEnd, ssrHeightFadeStart, -viewPosition.z);
71
+ reflectionHit = clamp(1.0 - (1.3 * dCoords.y), 0.0, 1.0) * heightMod * fadeFactorSSR;
72
+ reflectionHitDiffused = waterDiffusion * reflectionHit;
73
+
74
+ reflectedColor = linearizeGamma(texture(lastFrameColorTexture, reprojectedCoordinate).xyz) *
75
+ reflectionHitDiffused * fresnelModifier.y * ssrIntensity;
76
+ ${m(_.emissionReflections,p`
77
+ // Emission history is already linear and float-blend scaled.
78
+ waterEmission = texture(lastFrameEmissionTexture, reprojectedCoordinate).rgb *
79
+ reflectionHitDiffused * fresnelModifier.y * ssrIntensity;
80
+ `)}
81
+ }
82
+ float seaColorMod = mix(waterSeaColorMod, waterSeaColorMod * 0.5, reflectionHitDiffused);
83
+ // combining reflected sky, reflected sea, specular highlight, clouds and SSR reflections.
84
+ vec3 waterRenderedColor = tonemapACES((1.0 - reflectionHitDiffused) * reflSky + reflectedColor +
85
+ reflSea * seaColorMod + specular + foam);
86
+ `):v.code.add(p`vec3 waterRenderedColor = tonemapACES(reflSky + reflSea * waterSeaColorMod + specular + foam);`),_.cloudReflections?_.screenSpaceReflections?v.code.add(p`return waterRenderedColor * (1.0 - (1.0 - reflectionHit) * clouds.a) + (1.0 - reflectionHit) * clouds.rgb;
87
+ }`):v.code.add(p`return waterRenderedColor * (1.0 - clouds.a) + clouds.rgb;
88
+ }`):v.code.add(p`return waterRenderedColor;
89
+ }`)}export{g as getWaterColor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{MemCachePool as e}from"../../../../../core/MemCachePool.js";class t{constructor(t,n,r){this._create=n,this._cache=new e(t,r)}dispose(){this._cache.destroy()}newBuffer(e){let t=e.toString(),n=this._cache.pop(t);return n||(n=this._create(e),n)}deleteBuffer(e){if(e==null)return;let t=e.sizeBytes.toString();this._cache.put(t,e)}}export{t as BufferCache};
2
+ import{MemCachePool as e}from"../../../../../core/MemCachePool.js";class t{constructor(t,n,r){this._create=n,this._cache=new e(t,r)}dispose(){this._cache.destroy()}newBuffer(e){let t=e.toString(),n=this._cache.pop(t);return n||=this._create(e)}deleteBuffer(e){if(e==null)return;let t=e.sizeBytes.toString();this._cache.put(t,e)}}export{t as BufferCache};
@@ -1,24 +1,22 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{getEmissions as e}from"../core/shaderLibrary/output/getEmissions.glsl.js";import{OutputHighlight as t}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{isColor as n,isOITColorAlpha as r,isOITFrontFace as i}from"../core/shaderLibrary/ShaderOutput.js";import{ColorConversion as a}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{emissionFilter as o}from"../core/shaderLibrary/util/emissionFilter.glsl.js";import{If as s,glsl as c}from"../core/shaderModules/glsl.js";import{alphaCutoff as l}from"./alphaCutoff.glsl.js";import{ditherNoise as u}from"./ditherNoise.glsl.js";import{floatBlendScale as d}from"./floatBlendScale.glsl.js";function f(f,p){f.include(t,p),f.include(e,p);let{fragment:m,outputs:h}=f;m.include(a);let{output:g,hasEmission:_,oitPremultipliedAlpha:v,emissionDimmingPass:y,renderOccluded:b}=p,x=g===11,S=r(g),C=i(g),w=n(g)&&!S,T=g!==0||b,E=0;(w||S)&&h.add(`fragColor`,`vec4`,E++),S&&h.add(`fragAlpha`,`float`,E++),_&&h.add(`fragEmission`,`vec4`,E++),m.include(a),m.include(l),m.include(d,p),m.include(u,p),y&&m.include(o),m.code.add(c`
2
+ import{getEmissions as e}from"../core/shaderLibrary/output/getEmissions.glsl.js";import{OutputHighlight as t}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{outputEmission as n}from"../core/shaderLibrary/outputEmission.glsl.js";import{isColor as r,isOITColorAlpha as i,isOITFrontFace as a}from"../core/shaderLibrary/ShaderOutput.js";import{ColorConversion as o}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{emissionFilter as s}from"../core/shaderLibrary/util/emissionFilter.glsl.js";import{If as c,glsl as l}from"../core/shaderModules/glsl.js";import{alphaCutoff as u}from"./alphaCutoff.glsl.js";import{ditherNoise as d}from"./ditherNoise.glsl.js";import{floatBlendScale as f}from"./floatBlendScale.glsl.js";function p(p,m){p.include(t,m),p.include(e,m);let{fragment:h,outputs:g}=p;h.include(o);let{output:_,hasEmission:v,oitPremultipliedAlpha:y,emissionDimmingPass:b,renderOccluded:x}=m,S=_===11,C=i(_),w=a(_),T=r(_)&&!C,E=_!==0||x,D=0;(T||C)&&g.add(`fragColor`,`vec4`,D++),C&&g.add(`fragAlpha`,`float`,D++),v&&g.add(`fragEmission`,`vec4`,D++),h.include(o),h.include(u),h.include(f,m),h.include(d,m),p.include(n,m),b&&h.include(s),h.code.add(l`
3
3
  void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor, float snow) {
4
- ${s(x,`finalColor.a = 1.0;`)}
5
- ${s(T,`if (finalColor.a < alphaCutoff) discard;`)}
4
+ ${c(S,`finalColor.a = 1.0;`)}
5
+ ${c(E,`if (finalColor.a < alphaCutoff) discard;`)}
6
6
 
7
- ${s(S,`float noise = ditherNoise(finalColor);
8
- fragColor = ${s(v,`finalColor`,`premultiplyAlpha(finalColor)`)};
7
+ ${c(C,`float noise = ditherNoise(finalColor);
8
+ fragColor = ${c(y,`finalColor`,`premultiplyAlpha(finalColor)`)};
9
9
  fragColor.rgb = fragColor.rgb * floatBlendOutputScale + noise;
10
10
  fragAlpha = finalColor.a * floatBlendOutputScale + noise;
11
11
  `)}
12
- ${s(C&&v,`finalColor.rgb /= finalColor.a;`)}
13
- ${s(w,`fragColor = finalColor;`)}
14
- ${s(_,y?`fragEmission = vec4(emissionFilter(premultiplyAlpha(finalColor).rgb, finalColor.a), 0.0);`:c`
15
- fragEmission = mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);
16
- float emissionNoise = ditherNoise(fragEmission);
17
- fragEmission.rgb = fragEmission.rgb * floatBlendOutputScale + emissionNoise;
18
- fragEmission.a = finalColor.a;
12
+ ${c(w&&y,`finalColor.rgb /= finalColor.a;`)}
13
+ ${c(T,`fragColor = finalColor;`)}
14
+ ${c(v,b?`fragEmission = vec4(emissionFilter(premultiplyAlpha(finalColor).rgb, finalColor.a), 0.0);`:l`
15
+ outputEmission(vec4(mix(finalColor.a * getEmissions(emissiveSymbolColor).rgb, vec3(0.0), snow),
16
+ finalColor.a));
19
17
  fragEmission = premultiplyAlpha(fragEmission);
20
18
  `)}
21
19
  calculateOcclusionAndOutputHighlight();
22
- ${s(x,`outputObjectAndLayerIdColor();`)}
20
+ ${c(S,`outputObjectAndLayerIdColor();`)}
23
21
  }
24
- `)}export{f as outputColorHighlightOLID};
22
+ `)}export{p as outputColorHighlightOLID};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../webgl/ShaderBuilder.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexTangent.glsl.js";import"../core/shaderLibrary/bindUniforms.js";import"../core/shaderLibrary/clampShadowPosition.glsl.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/forwardLocalUp.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/terrain/Overlay.glsl.js";import"../core/shaderLibrary/terrain/TerrainTexture.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"./alphaCutoff.glsl.js";import"./OutputColorHighlightOLID.glsl.js";export{T as TerrainPassParameters,b as build}from"../../../../chunks/Terrain.glsl.js";
2
+ import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../webgl/ShaderBuilder.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexTangent.glsl.js";import"../core/shaderLibrary/bindUniforms.js";import"../core/shaderLibrary/clampShadowPosition.glsl.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/forwardLocalUp.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/terrain/Overlay.glsl.js";import"../core/shaderLibrary/terrain/TerrainTexture.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"./alphaCutoff.glsl.js";import"./OutputColorHighlightOLID.glsl.js";export{T as TerrainPassParameters,b as build}from"../../../../chunks/Terrain.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as n}from"../materials/DefaultTechniqueConfiguration.js";class r extends n{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.tileBorders=!1,this.normalType=1,this.textureCoordinateType=1,this.emissionSource=0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1,this.oitPremultipliedAlpha=!0,this.snowCover=!1}get overlayEnabled(){return this.overlayMode!==0}get hasWater(){return this.output!==11}}e([t({count:3})],r.prototype,`overlayMode`,void 0),e([t({count:3})],r.prototype,`tileBlendInput`,void 0),e([t({count:4})],r.prototype,`transparencyMode`,void 0),e([t({count:8})],r.prototype,`pbrMode`,void 0),e([t()],r.prototype,`receiveShadows`,void 0),e([t()],r.prototype,`hasShadowHighlights`,void 0),e([t()],r.prototype,`textureFadingEnabled`,void 0),e([t()],r.prototype,`renderOccluded`,void 0),e([t()],r.prototype,`screenSpaceReflections`,void 0),e([t()],r.prototype,`cloudReflections`,void 0),e([t()],r.prototype,`receiveAmbientOcclusion`,void 0),e([t()],r.prototype,`receiveGlobalIllumination`,void 0),e([t()],r.prototype,`tileBorders`,void 0);export{r as TerrainTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as n}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as r}from"../materials/DefaultTechniqueConfiguration.js";class i extends r{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.emissionReflections=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.tileBorders=!1,this.normalType=1,this.textureCoordinateType=1,this.emissionSource=0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1,this.oitPremultipliedAlpha=!0,this.snowCover=!1}get overlayEnabled(){return this.overlayMode!==0}get hasWater(){return this.overlayMode===2&&t(this.output)}get hasWaterOverlay(){return this.overlayMode===2}}e([n({count:3})],i.prototype,`overlayMode`,void 0),e([n({count:3})],i.prototype,`tileBlendInput`,void 0),e([n({count:4})],i.prototype,`transparencyMode`,void 0),e([n({count:8})],i.prototype,`pbrMode`,void 0),e([n()],i.prototype,`receiveShadows`,void 0),e([n()],i.prototype,`hasShadowHighlights`,void 0),e([n()],i.prototype,`textureFadingEnabled`,void 0),e([n()],i.prototype,`renderOccluded`,void 0),e([n()],i.prototype,`screenSpaceReflections`,void 0),e([n()],i.prototype,`cloudReflections`,void 0),e([n()],i.prototype,`emissionReflections`,void 0),e([n()],i.prototype,`receiveAmbientOcclusion`,void 0),e([n()],i.prototype,`receiveGlobalIllumination`,void 0),e([n()],i.prototype,`tileBorders`,void 0);export{i as TerrainTechniqueConfiguration};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import"../../../../core/mathUtils.js";import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../../geometry/support/aaBoundingBox.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderModules/Float2DrawUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float3DrawUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{b as UPCPointRendererDrawParameters,U as UPCPointRendererPassParameters,c as build,g as getMaxPointSizeScreenspace}from"../../../../chunks/UPCPointRenderer.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as n}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{stencilBaseAllZeros as i,stencilWriteMaskOn as a}from"../lib/StencilUtils.js";import{a as o}from"../../../../chunks/UPCPointRenderer.glsl.js";import{DataType as s}from"../../../webgl/enums.js";import{makePipelineState as c,defaultColorWrite as l,defaultDepthWrite as u}from"../../../webgl/renderState.js";import{VertexElementDescriptor as d}from"../../../webgl/VertexElementDescriptor.js";let f=class extends r{constructor(e,t){super(e,t,h),this.shader=new n(o,()=>import(`./UPCPointRenderer.glsl.js`))}initializePipeline(e){return c({depthTest:{func:513},depthWrite:u,colorWrite:l,stencilWrite:e.hasOccludees?a:null,stencilTest:e.hasOccludees?i:null})}};f=e([t(`esri.views.3d.webgl-engine.shaders.UPCPointRendererTechnique`)],f);const p=[new d(`position`,3,s.FLOAT,0,12)],m=[new d(`color`,2,s.FLOAT,0,8)],h=p.concat(m);export{f as UPCPointRendererTechnique,m as colorsLayout,p as positionsLayout};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as n}from"../materials/DefaultTechniqueConfiguration.js";class r extends n{constructor(){super(...arguments),this.drawScreenSize=!0,this.useFixedSizes=!0,this.hasOccludees=!1,this.clippingEnabled=!1,this.hasContinuousColorTexture=!1,this.hasDiscreteColorTexture=!1,this.draped=!1}}e([t()],r.prototype,`drawScreenSize`,void 0),e([t()],r.prototype,`useFixedSizes`,void 0),e([t()],r.prototype,`hasOccludees`,void 0),e([t()],r.prototype,`clippingEnabled`,void 0),e([t()],r.prototype,`hasContinuousColorTexture`,void 0),e([t()],r.prototype,`hasDiscreteColorTexture`,void 0);export{r as UPCPointRendererTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import r from"../core/ArrayPool.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";const o={widthBreakpoint:{getValue(e){let t=e.viewSize[0],n=e.breakpoints,r=this.values;return t<=n.xsmall?r.xsmall:t<=n.small?r.small:t<=n.medium?r.medium:t<=n.large?r.large:r.xlarge},values:{xsmall:`xsmall`,small:`small`,medium:`medium`,large:`large`,xlarge:`xlarge`},valueToClassName:{xsmall:`esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge`,small:`esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge`,medium:`esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge`,large:`esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge`,xlarge:`esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large`}},heightBreakpoint:{getValue(e){let t=e.viewSize[1],n=e.breakpoints,r=this.values;return t<=n.xsmall?r.xsmall:t<=n.small?r.small:t<=n.medium?r.medium:t<=n.large?r.large:r.xlarge},values:{xsmall:`xsmall`,small:`small`,medium:`medium`,large:`large`,xlarge:`xlarge`},valueToClassName:{xsmall:`esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge`,small:`esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge`,medium:`esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge`,large:`esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge`,xlarge:`esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large`}},orientation:{getValue(e){let t=e.viewSize,n=t[0],r=t[1],i=this.values;return r>=n?i.portrait:i.landscape},values:{portrait:`portrait`,landscape:`landscape`},valueToClassName:{portrait:`esri-view-orientation-portrait`,landscape:`esri-view-orientation-landscape`}}},s={xsmall:544,small:768,medium:992,large:1200};function c(e){let t=e;return t&&t.xsmall<t.small&&t.small<t.medium&&t.medium<t.large}function l(e,t){return t?o[e].valueToClassName[t].split(` `):[]}const u=u=>{let d=u,f=class extends d{constructor(...e){super(...e),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=s}initialize(){this.addHandles(i(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),a))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(e){let t=this._get(`breakpoints`);if(e!==t){if(!c(e)){let t=JSON.stringify(s,null,2);console.warn(`provided breakpoints are not valid, using defaults:`+t),e=s}this._set(`breakpoints`,{...e})}}_updateClassNames(){if(!this.container)return;let e=r.acquire(),t=r.acquire(),n=!1,i;for(i in o){let r=this[i],a=o[i].getValue({viewSize:this.size,breakpoints:this.breakpoints});r!==a&&(n=!0,this[i]=a,l(i,r).forEach(e=>t.push(e)),l(i,a).forEach(t=>e.push(t)))}n&&(this._applyClassNameChanges(e,t),r.release(e),r.release(t))}_applyClassNameChanges(e,t){let n=this.container;n&&(n.classList.remove(...t),n.classList.add(...e))}_removeActiveClassNames(){let e=this.container;if(!e)return;let t;for(t in o)l(t,this[t]).forEach(t=>e.classList.remove(t))}};return e([t()],f.prototype,`breakpoints`,null),e([t()],f.prototype,`orientation`,void 0),e([t()],f.prototype,`widthBreakpoint`,void 0),e([t()],f.prototype,`heightBreakpoint`,void 0),f=e([n(`esri.views.BreakpointsOwner`)],f),f};export{u as BreakpointsOwner};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import r from"../core/ArrayPool.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";const o={widthBreakpoint:{getValue(e){let t=e.viewSize[0],n=e.breakpoints,r=this.values;return t<=n.xsmall?r.xsmall:t<=n.small?r.small:t<=n.medium?r.medium:t<=n.large?r.large:r.xlarge},values:{xsmall:`xsmall`,small:`small`,medium:`medium`,large:`large`,xlarge:`xlarge`},valueToClassName:{xsmall:`esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge`,small:`esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge`,medium:`esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge`,large:`esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge`,xlarge:`esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large`}},heightBreakpoint:{getValue(e){let t=e.viewSize[1],n=e.breakpoints,r=this.values;return t<=n.xsmall?r.xsmall:t<=n.small?r.small:t<=n.medium?r.medium:t<=n.large?r.large:r.xlarge},values:{xsmall:`xsmall`,small:`small`,medium:`medium`,large:`large`,xlarge:`xlarge`},valueToClassName:{xsmall:`esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge`,small:`esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge`,medium:`esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge`,large:`esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge`,xlarge:`esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large`}},orientation:{getValue(e){let t=e.viewSize,n=t[0],r=t[1],i=this.values;return r>=n?i.portrait:i.landscape},values:{portrait:`portrait`,landscape:`landscape`},valueToClassName:{portrait:`esri-view-orientation-portrait`,landscape:`esri-view-orientation-landscape`}}},s={xsmall:544,small:768,medium:992,large:1200};function c(e){let t=e;return t&&t.xsmall<t.small&&t.small<t.medium&&t.medium<t.large}function l(e,t){return t?o[e].valueToClassName[t].split(` `):[]}const u=u=>{let d=u,f=class extends d{constructor(...e){super(...e),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=s}initialize(){this.addHandles(i(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),a))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(e){let t=this._get(`breakpoints`);if(e!==t){if(!c(e)){let t=JSON.stringify(s,null,2);console.warn(`provided breakpoints are not valid, using defaults:`+t),e=s}this._set(`breakpoints`,{...e})}}_updateClassNames(){if(!this.container)return;let e=r.acquire(),t=r.acquire(),n=!1,i;for(i in o){let r=this[i],a=o[i].getValue({viewSize:this.size,breakpoints:this.breakpoints});r!==a&&(n=!0,this[i]=a,l(i,r).forEach(e=>t.push(e)),l(i,a).forEach(t=>e.push(t)))}n&&(this._applyClassNameChanges(e,t),r.release(e),r.release(t))}_applyClassNameChanges(e,t){let n=this.container;n&&(n.classList.remove(...t),n.classList.add(...e))}_removeActiveClassNames(){let e=this.container;if(!e)return;let t;for(t in o)l(t,this[t]).forEach(t=>e.classList.remove(t))}};return e([t()],f.prototype,`breakpoints`,null),e([t()],f.prototype,`orientation`,void 0),e([t()],f.prototype,`widthBreakpoint`,void 0),e([t()],f.prototype,`heightBreakpoint`,void 0),f=e([n(`esri.views.BreakpointsOwner`)],f)};export{u as BreakpointsOwner};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{byId as r,reparent as i}from"../core/domUtils.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import s from"../core/Logger.js";import{destroyMaybe as c,removeMaybe as l}from"../core/maybe.js";import{watch as u,initial as d,syncAndInitial as f}from"../core/reactiveUtils.js";import{addFrameTask as p}from"../core/scheduling.js";import{Attribution as m}from"./Attribution.js";import h from"./overlay/FocusRegionOverlayItem.js";import g from"./overlay/ViewOverlay.js";const _=[0,0];function v(e){let t=(e.ownerDocument||window.document).defaultView,n=e.getBoundingClientRect();return _[0]=n.left+(t?.pageXOffset??0),_[1]=n.top+(t?.pageYOffset??0),_}function y(e){e&&(e.textContent=``,e.parentNode&&e.parentNode.removeChild(e))}const b=process.env.NODE_ENV===`test`,x=b?0:16,S=b?0:750,C=b?0:512,w={left:0,top:0,right:0,bottom:0},T={toggle:`KeyO`,resizeLarger:`ArrowUp`,resizeSmaller:`ArrowDown`,select:new Set([`Enter`,`Space`])},E=_=>{let b=_,E=class extends b{constructor(...e){super(...e),this._freqInfo={freq:x,time:S},this._overlayRenderTaskHandle=null,this._focusRegionOverlayItem=new h,this.aria={},this.attributionMode=null,this.height=0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([u(()=>[this.focusRegionVisible,this.overlay,this.ready],()=>this._syncFocusRegionOverlayItemVisibility(this.focusRegionVisible&&this.ready),{initial:!0}),u(()=>this.cursor,e=>{let{surface:t}=this;t&&t.setAttribute(`data-cursor`,e)}),u(()=>this.navigating,e=>{let{surface:t}=this;t&&t.setAttribute(`data-navigating`,e.toString())}),u(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0}),u(()=>{let{left:e,top:t,right:n,bottom:r}=this.padding??w;return[this.width,this.height,e,t,n,r]},([e,t,n,r,i,a])=>{let{_focusRegionOverlayItem:o}=this;o.backgroundHeight=t,o.backgroundWidth=e,o.padding={left:n,top:r,right:i,bottom:a},o.updateBoxSize()})])}initialize(){let e=this;this.addHandles([u(()=>this.ui,(e,t)=>this._handleUIChange(e,t),d),e.on(`focus`,()=>this.notifyChange(`focused`)),e.on(`blur`,()=>this.notifyChange(`focused`)),e.on(`key-down`,t=>{let{shiftKey:n,altKey:r,code:i,defaultPrevented:a}=t.native,{toggle:o,resizeLarger:s,resizeSmaller:c,select:l}=T,u=this.focusRegionVisible&&n&&r&&(i===s||i===c);if(!t.repeat||u){if(!a&&n&&r&&i===o&&this.focusRegionShortcutEnabled)this._toggleFocusRegion(),t.preventDefault();else if(!a&&u){let{_focusRegionOverlayItem:e}=this;e.resizeBoxSize(i===s?50:-50),t.preventDefault(),t.native.stopPropagation(),t.stopPropagation()}else!a&&this.focusRegionVisible&&l.has(i)&&this._selectFocusRegion(t,e)}})])}destroy(){this.destroyed||(this.focusRegionVisible=!1,this._syncFocusRegionOverlayItemVisibility(!1),this.ui?.destroy(),this.container=null)}get attributionHeight(){return this._attribution?.height??0}get container(){return this._get(`container`)??null}set container(e){let t=this._get(`container`),n=r(e);if(!n&&typeof e==`string`&&s.getLogger(this).error(`#container`,`element with id '${e}' not found`),t===n)return;if(this._stopMeasuring(),this.removeHandles(`container`),t&&(t.classList.remove(`esri-view`),this._overlayRenderTaskHandle&&=(this._overlayRenderTaskHandle.remove(),null),this.overlay&&(this.overlay.destroy(),this._set(`overlay`,null)),this._attribution=c(this._attribution),this.root&&(y(this.root),this._set(`root`,null)),this.userContent&&(i(this.userContent,t),y(this.userContent),this._set(`userContent`,null))),!n){this._set(`width`,0),this._set(`height`,0),this._set(`position`,null),this._set(`suspended`,!0),this._set(`surface`,null),this._set(`container`,null);return}n.classList.add(`esri-view`);let a=document.createElement(`div`);a.className=`esri-view-user-storage`,i(n,a),n.appendChild(a),this._set(`userContent`,a);let o=document.createElement(`div`);o.className=`esri-view-root`,n.insertBefore(o,n.firstChild),this._set(`root`,o);let h=document.createElement(`div`);h.className=`esri-view-surface`,h.setAttribute(`role`,`application`),h.tabIndex=0,o.appendChild(h),this._set(`surface`,h);let _=new g;o.appendChild(_.surface),this._set(`overlay`,_),this._syncFocusRegionOverlayItemVisibility(!1),this.addHandles(u(()=>_.needsRender,e=>{this._overlayRenderTaskHandle=e&&!this._overlayRenderTaskHandle?p({render:()=>this.overlay?.render()}):l(this._overlayRenderTaskHandle)},d),`container`),this.addHandles([u(()=>({visible:this.attributionVisible,items:this.attributionItems,mode:this.attributionMode}),({visible:e,items:t,mode:n})=>{e?(this._attribution||=new m({attributionItems:this.attributionItems,mode:this.attributionMode}),this._attribution.appendBefore(o,this.ui?.container??null),this._attribution.attributionItems=t,this._attribution.mode=n):this._attribution=c(this._attribution)},f)],`container`),this.forceDOMReadyCycle(),this._set(`container`,n),this._startMeasuring()}get focused(){let e=document.activeElement===this.surface;return document.hasFocus()&&e}get focusRegion(){return this.focusRegionVisible?this._focusRegionOverlayItem.getScreenRect():null}get size(){return[this.width,this.height]}get ui(){return this._get(`ui`)}set ui(e){let t=this._get(`ui`);t!==e&&t?.destroy(),this._set(`ui`,e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,n){let r=this.position;return e-=r?r[0]:0,t-=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}containerToPage(e,t,n){let r=this.position;return e+=r?r[0]:0,t+=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}_updateAria(){let{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_selectFocusRegion(e,t){let n=this._makeFocusRegionSelectEvent(e);t.emit(`focus-region-select`,n),e.preventDefault()}_makeFocusRegionSelectEvent(e){let t={type:`focus-region-select`,native:e.native,defaultPrevented:!1,preventDefault:()=>{t.defaultPrevented=!0},stopPropagation:()=>{e.stopPropagation()}};return t}_toggleFocusRegion(){this.focusRegionVisible=!this.focusRegionVisible}_updateFocusRegionOverlayItem(){let{_focusRegionOverlayItem:e}=this;e.backgroundHeight=this.height,e.backgroundWidth=this.width,e.padding=this.padding??w,e.updateBoxSize()}_syncFocusRegionOverlayItemVisibility(e){let{_focusRegionOverlayItem:t,overlay:n}=this,r=e;t.visible=r,n&&(n.removeItem(t),r&&(this._updateFocusRegionOverlayItem(),n.addItem(t)))}_handleUIChange(e,t){this.removeHandles(`ui`),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(u(()=>this.root,t=>{if(!t)e.container=null;else{let n=document.createElement(`div`);t.insertBefore(n,this._attribution?.surface??null),e.container=n}},d),`ui`)),this._set(`ui`,e)}_stopMeasuring(){this.removeHandles(`measuring`),this._get(`resizing`)&&this._set(`resizing`,!1)}_startMeasuring(){let e=this._freqInfo;e.freq=x,e.time=S;let t=p({prepare:e=>{let n=this._measure(),r=this._freqInfo;r.time+=e.deltaTime,n&&(r.freq=x,this._get(`resizing`)||this._set(`resizing`,!0)),r.time<r.freq||(r.time=0,r.freq=this._position()||n?x:Math.min(S,r.freq*2),!n&&r.freq>=C&&(t.pause(),this._get(`resizing`)&&this._set(`resizing`,!1)))}}),n=new ResizeObserver(n=>{e.freq=x,e.time=S,t.resume()});this.container!=null&&n.observe(this.container);let r=o(()=>n.disconnect());this.addHandles([a(window,`resize`,()=>{e.freq=x,e.time=S,t.resume()}),r,t],`measuring`),this._measure(),this._position()}_measure(){let e=this.container,t=e?e.clientWidth:0,n=e?e.clientHeight:0;if(t===0||n===0)return this.suspended||this._set(`suspended`,!0),!1;let r=this.width,i=this.height;return t===r&&n===i?(this.suspended&&this._set(`suspended`,!1),!1):(this._set(`width`,t),this._set(`height`,n),this.suspended&&this._set(`suspended`,!1),this.emit(`resize`,{oldWidth:r,oldHeight:i,width:t,height:n}),!0)}_position(){let e=this.container,t=this.position,n=e&&v(e);return n&&(!t||n[0]!==t[0]||n[1]!==t[1])?(this._set(`position`,[n[0],n[1]]),!0):!1}forceDOMReadyCycle(){}};return e([t()],E.prototype,`_attribution`,void 0),e([t()],E.prototype,`aria`,void 0),e([t()],E.prototype,`attributionHeight`,null),e([t()],E.prototype,`attributionMode`,void 0),e([t()],E.prototype,`container`,null),e([t({readOnly:!0})],E.prototype,`focused`,null),e([t({readOnly:!0})],E.prototype,`height`,void 0),e([t()],E.prototype,`focusRegionVisible`,void 0),e([t()],E.prototype,`focusRegionShortcutEnabled`,void 0),e([t()],E.prototype,`focusRegion`,null),e([t()],E.prototype,`messagesCommon`,void 0),e([t({type:g})],E.prototype,`overlay`,void 0),e([t({readOnly:!0})],E.prototype,`position`,void 0),e([t({readOnly:!0})],E.prototype,`resizing`,void 0),e([t({readOnly:!0})],E.prototype,`root`,void 0),e([t({value:null,readOnly:!0})],E.prototype,`size`,null),e([t({readOnly:!0})],E.prototype,`surface`,void 0),e([t({readOnly:!0})],E.prototype,`suspended`,void 0),e([t({nonNullable:!0})],E.prototype,`ui`,null),e([t({readOnly:!0})],E.prototype,`userContent`,void 0),e([t({readOnly:!0})],E.prototype,`width`,void 0),e([t()],E.prototype,`widthBreakpoint`,void 0),E=e([n(`esri.views.DOMContainer`)],E),E};export{E as DOMContainer};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{byId as r,reparent as i}from"../core/domUtils.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import s from"../core/Logger.js";import{destroyMaybe as c,removeMaybe as l}from"../core/maybe.js";import{watch as u,initial as d,syncAndInitial as f}from"../core/reactiveUtils.js";import{addFrameTask as p}from"../core/scheduling.js";import{Attribution as m}from"./Attribution.js";import h from"./overlay/FocusRegionOverlayItem.js";import g from"./overlay/ViewOverlay.js";const _=[0,0];function v(e){let t=(e.ownerDocument||window.document).defaultView,n=e.getBoundingClientRect();return _[0]=n.left+(t?.pageXOffset??0),_[1]=n.top+(t?.pageYOffset??0),_}function y(e){e&&(e.textContent=``,e.parentNode&&e.parentNode.removeChild(e))}const b=process.env.NODE_ENV===`test`,x=b?0:16,S=b?0:750,C=b?0:512,w={left:0,top:0,right:0,bottom:0},T={toggle:`KeyO`,resizeLarger:`ArrowUp`,resizeSmaller:`ArrowDown`,select:new Set([`Enter`,`Space`])},E=_=>{let b=_,E=class extends b{constructor(...e){super(...e),this._freqInfo={freq:x,time:S},this._overlayRenderTaskHandle=null,this._focusRegionOverlayItem=new h,this.aria={},this.attributionMode=null,this.height=0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([u(()=>[this.focusRegionVisible,this.overlay,this.ready],()=>this._syncFocusRegionOverlayItemVisibility(this.focusRegionVisible&&this.ready),{initial:!0}),u(()=>this.cursor,e=>{let{surface:t}=this;t&&t.setAttribute(`data-cursor`,e)}),u(()=>this.navigating,e=>{let{surface:t}=this;t&&t.setAttribute(`data-navigating`,e.toString())}),u(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0}),u(()=>{let{left:e,top:t,right:n,bottom:r}=this.padding??w;return[this.width,this.height,e,t,n,r]},([e,t,n,r,i,a])=>{let{_focusRegionOverlayItem:o}=this;o.backgroundHeight=t,o.backgroundWidth=e,o.padding={left:n,top:r,right:i,bottom:a},o.updateBoxSize()})])}initialize(){let e=this;this.addHandles([u(()=>this.ui,(e,t)=>this._handleUIChange(e,t),d),e.on(`focus`,()=>this.notifyChange(`focused`)),e.on(`blur`,()=>this.notifyChange(`focused`)),e.on(`key-down`,t=>{let{shiftKey:n,altKey:r,code:i,defaultPrevented:a}=t.native,{toggle:o,resizeLarger:s,resizeSmaller:c,select:l}=T,u=this.focusRegionVisible&&n&&r&&(i===s||i===c);if(!t.repeat||u){if(!a&&n&&r&&i===o&&this.focusRegionShortcutEnabled)this._toggleFocusRegion(),t.preventDefault();else if(!a&&u){let{_focusRegionOverlayItem:e}=this;e.resizeBoxSize(i===s?50:-50),t.preventDefault(),t.native.stopPropagation(),t.stopPropagation()}else!a&&this.focusRegionVisible&&l.has(i)&&this._selectFocusRegion(t,e)}})])}destroy(){this.destroyed||(this.focusRegionVisible=!1,this._syncFocusRegionOverlayItemVisibility(!1),this.ui?.destroy(),this.container=null)}get attributionHeight(){return this._attribution?.height??0}get container(){return this._get(`container`)??null}set container(e){let t=this._get(`container`),n=r(e);if(!n&&typeof e==`string`&&s.getLogger(this).error(`#container`,`element with id '${e}' not found`),t===n)return;if(this._stopMeasuring(),this.removeHandles(`container`),t&&(t.classList.remove(`esri-view`),this._overlayRenderTaskHandle&&=(this._overlayRenderTaskHandle.remove(),null),this.overlay&&(this.overlay.destroy(),this._set(`overlay`,null)),this._attribution=c(this._attribution),this.root&&(y(this.root),this._set(`root`,null)),this.userContent&&(i(this.userContent,t),y(this.userContent),this._set(`userContent`,null))),!n){this._set(`width`,0),this._set(`height`,0),this._set(`position`,null),this._set(`suspended`,!0),this._set(`surface`,null),this._set(`container`,null);return}n.classList.add(`esri-view`);let a=document.createElement(`div`);a.className=`esri-view-user-storage`,i(n,a),n.appendChild(a),this._set(`userContent`,a);let o=document.createElement(`div`);o.className=`esri-view-root`,n.insertBefore(o,n.firstChild),this._set(`root`,o);let h=document.createElement(`div`);h.className=`esri-view-surface`,h.setAttribute(`role`,`application`),h.tabIndex=0,o.appendChild(h),this._set(`surface`,h);let _=new g;o.appendChild(_.surface),this._set(`overlay`,_),this._syncFocusRegionOverlayItemVisibility(!1),this.addHandles(u(()=>_.needsRender,e=>{this._overlayRenderTaskHandle=e&&!this._overlayRenderTaskHandle?p({render:()=>this.overlay?.render()}):l(this._overlayRenderTaskHandle)},d),`container`),this.addHandles([u(()=>({visible:this.attributionVisible,items:this.attributionItems,mode:this.attributionMode}),({visible:e,items:t,mode:n})=>{e?(this._attribution||=new m({attributionItems:this.attributionItems,mode:this.attributionMode}),this._attribution.appendBefore(o,this.ui?.container??null),this._attribution.attributionItems=t,this._attribution.mode=n):this._attribution=c(this._attribution)},f)],`container`),this.forceDOMReadyCycle(),this._set(`container`,n),this._startMeasuring()}get focused(){let e=document.activeElement===this.surface;return document.hasFocus()&&e}get focusRegion(){return this.focusRegionVisible?this._focusRegionOverlayItem.getScreenRect():null}get size(){return[this.width,this.height]}get ui(){return this._get(`ui`)}set ui(e){let t=this._get(`ui`);t!==e&&t?.destroy(),this._set(`ui`,e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,n){let r=this.position;return e-=r?r[0]:0,t-=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}containerToPage(e,t,n){let r=this.position;return e+=r?r[0]:0,t+=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}_updateAria(){let{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_selectFocusRegion(e,t){let n=this._makeFocusRegionSelectEvent(e);t.emit(`focus-region-select`,n),e.preventDefault()}_makeFocusRegionSelectEvent(e){let t={type:`focus-region-select`,native:e.native,defaultPrevented:!1,preventDefault:()=>{t.defaultPrevented=!0},stopPropagation:()=>{e.stopPropagation()}};return t}_toggleFocusRegion(){this.focusRegionVisible=!this.focusRegionVisible}_updateFocusRegionOverlayItem(){let{_focusRegionOverlayItem:e}=this;e.backgroundHeight=this.height,e.backgroundWidth=this.width,e.padding=this.padding??w,e.updateBoxSize()}_syncFocusRegionOverlayItemVisibility(e){let{_focusRegionOverlayItem:t,overlay:n}=this,r=e;t.visible=r,n&&(n.removeItem(t),r&&(this._updateFocusRegionOverlayItem(),n.addItem(t)))}_handleUIChange(e,t){this.removeHandles(`ui`),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(u(()=>this.root,t=>{if(!t)e.container=null;else{let n=document.createElement(`div`);t.insertBefore(n,this._attribution?.surface??null),e.container=n}},d),`ui`)),this._set(`ui`,e)}_stopMeasuring(){this.removeHandles(`measuring`),this._get(`resizing`)&&this._set(`resizing`,!1)}_startMeasuring(){let e=this._freqInfo;e.freq=x,e.time=S;let t=p({prepare:e=>{let n=this._measure(),r=this._freqInfo;r.time+=e.deltaTime,n&&(r.freq=x,this._get(`resizing`)||this._set(`resizing`,!0)),r.time<r.freq||(r.time=0,r.freq=this._position()||n?x:Math.min(S,r.freq*2),!n&&r.freq>=C&&(t.pause(),this._get(`resizing`)&&this._set(`resizing`,!1)))}}),n=new ResizeObserver(n=>{e.freq=x,e.time=S,t.resume()});this.container!=null&&n.observe(this.container);let r=o(()=>n.disconnect());this.addHandles([a(window,`resize`,()=>{e.freq=x,e.time=S,t.resume()}),r,t],`measuring`),this._measure(),this._position()}_measure(){let e=this.container,t=e?e.clientWidth:0,n=e?e.clientHeight:0;if(t===0||n===0)return this.suspended||this._set(`suspended`,!0),!1;let r=this.width,i=this.height;return t===r&&n===i?(this.suspended&&this._set(`suspended`,!1),!1):(this._set(`width`,t),this._set(`height`,n),this.suspended&&this._set(`suspended`,!1),this.emit(`resize`,{oldWidth:r,oldHeight:i,width:t,height:n}),!0)}_position(){let e=this.container,t=this.position,n=e&&v(e);return n&&(!t||n[0]!==t[0]||n[1]!==t[1])?(this._set(`position`,[n[0],n[1]]),!0):!1}forceDOMReadyCycle(){}};return e([t()],E.prototype,`_attribution`,void 0),e([t()],E.prototype,`aria`,void 0),e([t()],E.prototype,`attributionHeight`,null),e([t()],E.prototype,`attributionMode`,void 0),e([t()],E.prototype,`container`,null),e([t({readOnly:!0})],E.prototype,`focused`,null),e([t({readOnly:!0})],E.prototype,`height`,void 0),e([t()],E.prototype,`focusRegionVisible`,void 0),e([t()],E.prototype,`focusRegionShortcutEnabled`,void 0),e([t()],E.prototype,`focusRegion`,null),e([t()],E.prototype,`messagesCommon`,void 0),e([t({type:g})],E.prototype,`overlay`,void 0),e([t({readOnly:!0})],E.prototype,`position`,void 0),e([t({readOnly:!0})],E.prototype,`resizing`,void 0),e([t({readOnly:!0})],E.prototype,`root`,void 0),e([t({value:null,readOnly:!0})],E.prototype,`size`,null),e([t({readOnly:!0})],E.prototype,`surface`,void 0),e([t({readOnly:!0})],E.prototype,`suspended`,void 0),e([t({nonNullable:!0})],E.prototype,`ui`,null),e([t({readOnly:!0})],E.prototype,`userContent`,void 0),e([t({readOnly:!0})],E.prototype,`width`,void 0),e([t()],E.prototype,`widthBreakpoint`,void 0),E=e([n(`esri.views.DOMContainer`)],E)};export{E as DOMContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{createTask as r}from"../core/asyncUtils.js";import i from"../core/Error.js";import{generatorFlat as a,generatorFromPromises as o}from"../core/generatorUtils.js";import has from"../core/has.js";import s from"../core/Logger.js";import{allSettledValues as c,throwIfAborted as l,wrapAbortWithTimeout as u}from"../core/promiseUtils.js";import{watch as d,syncAndInitial as f,whenOnce as p}from"../core/reactiveUtils.js";import{ViewEventPriorities as m}from"./input/InputManager.js";import{addPopup as h,openPopupWithViewClick as g,isPopup as _,isPopupElement as v,openPopupWithOptions as y,closePopup as b}from"./popupAdapter.js";const x=x=>{let w=x,T=class extends w{constructor(...e){super(...e),this._popupSetupTask=null,this.popupEnabled=!0,this.popup={}}initialize(){this.addHandles([d(()=>[this.ui,this.popup,this.popupElement],([e,t,n],r)=>{let[i,a,o]=r??[];h(this,[e,t,n],[i,a,o])},f),this.on(`click`,e=>{!this.popup||!this.popupEnabled||e.pointerType===`mouse`&&e.button!==0||e.native.ctrlKey||e.native.metaKey||g(this,e).catch(()=>{})},m.WIDGET)]),p(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>import(`../widgets/Popup.js`))}destroy(){this.destroyed||this.closePopup()}get popup(){return this._get(`popup`)}set popup(e){this._set(`popup`,e)}async openPopup(e){if(_(this.popup))return this.popup.open(e);if(this.popupElement&&v(this.popupElement)){if(e){let{fetchFeatures:t,title:n,...r}=e;delete e.fetchFeatures,Object.assign(this.popupElement,r),n!==void 0&&(this.popupElement.heading=n)}this.popupElement.open=!0}try{if(await this.setupPopup(),!this.popup){s.getLogger(this).error(new i(`view:null-popup`,`Popup is null and can't be opened`));return}y(this,e)}catch{}}closePopup(){this._popupSetupTask?.abort(),b(this.popup,this.popupElement)}fetchPopupFeatures(e,t){let n=this.when().then(()=>this._getPopupHits(e,t)).then(n=>(t?.hitTestResolver?.resolve(),this._popupHitsToFeatureStream(e,n.hits,t)),e=>{throw t?.hitTestResolver?.reject(e),e});return n.catch(()=>void 0),(async function*(){yield*await n})()}async fetchPopupFeaturesLegacy(e,t){await this.when();let n=await this._getPopupHits(e,t),r=this._popupHitsToFeatures(e,n.hits,t);return{pendingFeatures:r,allGraphicsPromise:c(r).then(e=>e.filter(e=>!!e).flat()),location:n.location}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!_(this.popup))return this._popupSetupTask=r(async e=>{if(!(this.popupEnabled&&v(this.popupElement))){if(this.dependencies.popup&&typeof this.dependencies.popup==`function`)await this.dependencies.popup(),l(e),customElements.get(`arcgis-popup`)||s.getLogger(this).error(new i(`view:undefined-popup-element`,"`arcgis-popup` custom element is undefined and can't be opened")),this.popupElement=document.createElement(`arcgis-popup`);else{let{default:t}=await import(`../widgets/Popup.js`);if(l(e),!this.popup||_(this.popup))return;let n=this.popup;if(`open`in n||`close`in n){let{open:e,close:r,...i}=n;this.popup=new t({...i})}else this.popup=new t(n)}}}),this._popupSetupTask.promise}async*_popupHitsToFeatureStream(e,t,n){let r=this._popupHitsToFeatures(e,t,n);yield*a(o(r,n),n)}_popupHitsToFeatures(e,t,n){let r=[],i=[],a=!1,o=u(n,has(`popup-view-fetch-timeout`)??C),s=e=>{let t=new S(e);return i.push(t),r.push(t.promise),t},c=e=>{let t=i.at(-1);return t&&t.layerView===e&&!a?t:s(e)};for(let n of t)`graphic`in n?(c(n.layerView).graphics.push(n.graphic),a=!1):(r.push(n.layerView.fetchPopupFeaturesAtTarget(e,n.geometry,o)),a=!0);return i.forEach(e=>e.resolve(o)),r}async _getPopupHits(e,t){let{hits:n,location:r}=await this.popupHitTest(e);l(t);let i=[];for(let e of n)if(`graphic`in e){if(this._isValidPopupGraphic(e.graphic,t)){let t=this._isFeaturePatchingLayerView(e.layerView)?e.layerView:void 0;i.push({graphic:e.graphic,layerView:t})}}else this._isValidPopupLocationLayerView(e.layerView)&&i.push({geometry:e.geometry,layerView:e.layerView});return{hits:i,location:r}}_isValidPopupGraphic(e,t){return e&&!!e.getEffectivePopupTemplate(t?.defaultPopupTemplateEnabled)}_isFeaturePatchingLayerView(e){return!e||(!(`layer`in e)||!e.suspended)&&`patchFeaturesForPopup`in e}_isValidPopupLocationLayerView(e){return!e||(!(`layer`in e)||!e.suspended)&&`fetchPopupFeaturesAtTarget`in e}};return e([t()],T.prototype,`popup`,null),e([t()],T.prototype,`popupElement`,void 0),e([t()],T.prototype,`popupEnabled`,void 0),T=e([n(`esri.views.PopupView`)],T),T};class S{constructor(e){this.layerView=e,this._resolver=Promise.withResolvers(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(e){let{layerView:t,graphics:n,_resolver:r}=this;if(!t)return r.resolve(n),r.promise;let i;return t.patchFeaturesForPopup(n,e).catch(e=>(i=e,null)).then(e=>{e?r.resolve(e):r.reject(i)}),r.promise}}const C=5e3;export{x as PopupView};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{createTask as r}from"../core/asyncUtils.js";import i from"../core/Error.js";import{generatorFlat as a,generatorFromPromises as o}from"../core/generatorUtils.js";import has from"../core/has.js";import s from"../core/Logger.js";import{allSettledValues as c,throwIfAborted as l,wrapAbortWithTimeout as u}from"../core/promiseUtils.js";import{watch as d,syncAndInitial as f,whenOnce as p}from"../core/reactiveUtils.js";import{ViewEventPriorities as m}from"./input/InputManager.js";import{addPopup as h,openPopupWithViewClick as g,isPopup as _,isPopupElement as v,openPopupWithOptions as y,closePopup as b}from"./popupAdapter.js";const x=x=>{let w=x,T=class extends w{constructor(...e){super(...e),this._popupSetupTask=null,this.popupEnabled=!0,this.popup={}}initialize(){this.addHandles([d(()=>[this.ui,this.popup,this.popupElement],([e,t,n],r)=>{let[i,a,o]=r??[];h(this,[e,t,n],[i,a,o])},f),this.on(`click`,e=>{!this.popup||!this.popupEnabled||e.pointerType===`mouse`&&e.button!==0||e.native.ctrlKey||e.native.metaKey||g(this,e).catch(()=>{})},m.WIDGET)]),p(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>import(`../widgets/Popup.js`))}destroy(){this.destroyed||this.closePopup()}get popup(){return this._get(`popup`)}set popup(e){this._set(`popup`,e)}async openPopup(e){if(_(this.popup))return this.popup.open(e);if(this.popupElement&&v(this.popupElement)){if(e){let{fetchFeatures:t,title:n,...r}=e;delete e.fetchFeatures,Object.assign(this.popupElement,r),n!==void 0&&(this.popupElement.heading=n)}this.popupElement.open=!0}try{if(await this.setupPopup(),!this.popup){s.getLogger(this).error(new i(`view:null-popup`,`Popup is null and can't be opened`));return}y(this,e)}catch{}}closePopup(){this._popupSetupTask?.abort(),b(this.popup,this.popupElement)}fetchPopupFeatures(e,t){let n=this.when().then(()=>this._getPopupHits(e,t)).then(n=>(t?.hitTestResolver?.resolve(),this._popupHitsToFeatureStream(e,n.hits,t)),e=>{throw t?.hitTestResolver?.reject(e),e});return n.catch(()=>void 0),(async function*(){yield*await n})()}async fetchPopupFeaturesLegacy(e,t){await this.when();let n=await this._getPopupHits(e,t),r=this._popupHitsToFeatures(e,n.hits,t);return{pendingFeatures:r,allGraphicsPromise:c(r).then(e=>e.filter(e=>!!e).flat()),location:n.location}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!_(this.popup))return this._popupSetupTask=r(async e=>{if(!(this.popupEnabled&&v(this.popupElement))){if(this.dependencies.popup&&typeof this.dependencies.popup==`function`)await this.dependencies.popup(),l(e),customElements.get(`arcgis-popup`)||s.getLogger(this).error(new i(`view:undefined-popup-element`,"`arcgis-popup` custom element is undefined and can't be opened")),this.popupElement=document.createElement(`arcgis-popup`);else{let{default:t}=await import(`../widgets/Popup.js`);if(l(e),!this.popup||_(this.popup))return;let n=this.popup;if(`open`in n||`close`in n){let{open:e,close:r,...i}=n;this.popup=new t({...i})}else this.popup=new t(n)}}}),this._popupSetupTask.promise}async*_popupHitsToFeatureStream(e,t,n){let r=this._popupHitsToFeatures(e,t,n);yield*a(o(r,n),n)}_popupHitsToFeatures(e,t,n){let r=[],i=[],a=!1,o=u(n,has(`popup-view-fetch-timeout`)??C),s=e=>{let t=new S(e);return i.push(t),r.push(t.promise),t},c=e=>{let t=i.at(-1);return t&&t.layerView===e&&!a?t:s(e)};for(let n of t)`graphic`in n?(c(n.layerView).graphics.push(n.graphic),a=!1):(r.push(n.layerView.fetchPopupFeaturesAtTarget(e,n.geometry,o)),a=!0);return i.forEach(e=>e.resolve(o)),r}async _getPopupHits(e,t){let{hits:n,location:r}=await this.popupHitTest(e);l(t);let i=[];for(let e of n)if(`graphic`in e){if(this._isValidPopupGraphic(e.graphic,t)){let t=this._isFeaturePatchingLayerView(e.layerView)?e.layerView:void 0;i.push({graphic:e.graphic,layerView:t})}}else this._isValidPopupLocationLayerView(e.layerView)&&i.push({geometry:e.geometry,layerView:e.layerView});return{hits:i,location:r}}_isValidPopupGraphic(e,t){return e&&!!e.getEffectivePopupTemplate(t?.defaultPopupTemplateEnabled)}_isFeaturePatchingLayerView(e){return!e||(!(`layer`in e)||!e.suspended)&&`patchFeaturesForPopup`in e}_isValidPopupLocationLayerView(e){return!e||(!(`layer`in e)||!e.suspended)&&`fetchPopupFeaturesAtTarget`in e}};return e([t()],T.prototype,`popup`,null),e([t()],T.prototype,`popupElement`,void 0),e([t()],T.prototype,`popupEnabled`,void 0),T=e([n(`esri.views.PopupView`)],T)};class S{constructor(e){this.layerView=e,this._resolver=Promise.withResolvers(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(e){let{layerView:t,graphics:n,_resolver:r}=this;if(!t)return r.resolve(n),r.promise;let i;return t.patchFeaturesForPopup(n,e).catch(e=>(i=e,null)).then(e=>{e?r.resolve(e):r.reject(i)}),r.promise}}const C=5e3;export{x as PopupView};
package/views/View.d.ts CHANGED
@@ -17,9 +17,10 @@ import type SelectionManager from "./SelectionManager.js";
17
17
  import type HighlightOptions from "./support/HighlightOptions.js";
18
18
  import type Theme from "./Theme.js";
19
19
  import type { ReadonlyArrayOrCollection, ReadonlyCollection } from "../core/Collection.js";
20
+ import type { ResourceHandle } from "../core/Handles.js";
20
21
  import type { ScreenRect } from "../core/types.js";
21
22
  import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
22
- import type { SceneViewEventTypes, PersistableComponent } from "./types.js";
23
+ import type { PersistableComponent, SceneViewEventTypes, ViewHighlightOptions } from "./types.js";
23
24
  import type { ViewPadding } from "./ui/types.js";
24
25
  import type { EventedMixin } from "../core/Evented.js";
25
26
  import type { EsriPromise } from "../core/Promise.js";
@@ -816,6 +817,31 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
816
817
  * @see [WebScene.destroy()](https://developers.arcgis.com/javascript/latest/references/core/WebScene/#destroy)
817
818
  */
818
819
  destroy(): void;
820
+ /**
821
+ * Highlights graphics from one or more layers in the view.
822
+ *
823
+ * If a layer view is still being created, the highlight is applied when it is ready.
824
+ * Graphics that the view cannot highlight are skipped.
825
+ *
826
+ * @param graphics - A graphic or an array of graphics to highlight.
827
+ * @param options - The named highlight style to use from the view's [highlights](https://developers.arcgis.com/javascript/latest/references/core/views/View/#highlights) collection.
828
+ * @returns A handle whose `remove()` method clears active highlights and cancels pending highlights created by this call.
829
+ * @since 6.0
830
+ * @example
831
+ * ```js
832
+ * await view.when();
833
+ * let highlight;
834
+ *
835
+ * view.on("click", async (event) => {
836
+ * const { results } = await view.hitTest(event, { include: featureLayer });
837
+ * const graphics = results.map(({ graphic }) => graphic);
838
+ *
839
+ * highlight?.remove();
840
+ * highlight = graphics.length ? view.highlight(graphics, { name: "temporary" }) : undefined;
841
+ * });
842
+ * ```
843
+ */
844
+ highlight(graphics: Graphic | Graphic[], options?: ViewHighlightOptions): ResourceHandle;
819
845
  /**
820
846
  * Registers a component with the view so that it can participate in web document persistence.
821
847
  *