@arcgis/core 5.2.0-next.86 → 5.2.0-next.88

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 (691) hide show
  1. package/arcade/Dictionary.js +1 -1
  2. package/arcade/Feature.js +1 -1
  3. package/arcade/ImmutablePointArray.js +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/containerUtils.js +1 -1
  8. package/arcade/debug.js +1 -1
  9. package/arcade/deepClone.js +1 -1
  10. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  11. package/arcade/featureset/support/FeatureSet.js +1 -1
  12. package/arcade/functions/centroid.js +1 -1
  13. package/arcade/functions/date.js +1 -1
  14. package/arcade/functions/feature.js +1 -1
  15. package/arcade/functions/featuresetbase.js +1 -1
  16. package/arcade/functions/featuresetgeom.js +1 -1
  17. package/arcade/functions/featuresetstats.js +1 -1
  18. package/arcade/functions/featuresetstring.js +1 -1
  19. package/arcade/functions/fieldStats.js +1 -1
  20. package/arcade/functions/geomasync.js +1 -1
  21. package/arcade/functions/geometry.js +1 -1
  22. package/arcade/functions/geomsync.js +1 -1
  23. package/arcade/functions/knowledgegraph.js +1 -1
  24. package/arcade/functions/maths.js +1 -1
  25. package/arcade/functions/stats.js +1 -1
  26. package/arcade/functions/string.js +1 -1
  27. package/arcade/functions/track.js +1 -1
  28. package/arcade/geometry/adapters/accessor.js +2 -0
  29. package/arcade/geometry/adapters/dehydrated.js +2 -0
  30. package/arcade/geometry/adapters/gx.js +2 -0
  31. package/arcade/geometry/adapters/json.js +2 -0
  32. package/arcade/geometry/adapters/optimized.js +2 -0
  33. package/arcade/geometry/adapters/tuple.js +2 -0
  34. package/arcade/geometry/adapters/utils.js +2 -0
  35. package/arcade/geometry/arrayOfPointsConversions.js +2 -0
  36. package/arcade/geometry/constructors.js +1 -1
  37. package/arcade/geometry/functions.js +1 -1
  38. package/arcade/geometry/isSelfIntersecting.js +2 -0
  39. package/arcade/geometry/nearestCoordinate.js +2 -0
  40. package/arcade/geometry/nearestVertex.js +1 -1
  41. package/arcade/geometry/operators.js +1 -1
  42. package/arcade/geometry/operatorsWorker.js +1 -1
  43. package/arcade/geometry/rotate.js +1 -1
  44. package/arcade/geometry.js +2 -0
  45. package/arcade/languageUtils.js +1 -1
  46. package/arcade.js +1 -1
  47. package/arcgisGlobal.d.ts +1 -0
  48. package/assets/esri/core/workers/RemoteClient.js +1 -1
  49. package/assets/esri/core/workers/chunks/{0b8c9657975388f1e4c8.js → 00181785a180e934bf7c.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{01e648b258efa6408070.js → 0336f4f8498a22347720.js} +1 -1
  51. package/assets/esri/core/workers/chunks/0439d4f4dfd6e78be97e.js +1 -0
  52. package/assets/esri/core/workers/chunks/05393b23ab24126d4236.js +1 -0
  53. package/assets/esri/core/workers/chunks/08263c07d92c48806834.js +1 -0
  54. package/assets/esri/core/workers/chunks/09e01fd1c199be0c8e03.js +1 -0
  55. package/assets/esri/core/workers/chunks/{12d6d73ca1fa55640a4f.js → 0b4a7209b99227a842ad.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{073224c6ac77dc9e97af.js → 0b7860a3f18d252b774a.js} +1 -1
  57. package/assets/esri/core/workers/chunks/0d95f72e1c07ab867d21.js +1 -0
  58. package/assets/esri/core/workers/chunks/0dbbac7a2378728571a7.js +1 -0
  59. package/assets/esri/core/workers/chunks/0f15468ffefd3e9a17b8.js +29 -0
  60. package/assets/esri/core/workers/chunks/{3aeb934ebdab1d8c4608.js → 12a3b55195ce3244259d.js} +1 -1
  61. package/assets/esri/core/workers/chunks/13e92f6a9573a2818fb7.js +1 -0
  62. package/assets/esri/core/workers/chunks/19aa4072764937743bd8.js +1 -0
  63. package/assets/esri/core/workers/chunks/19e93d4d37018e3ee849.js +1 -0
  64. package/assets/esri/core/workers/chunks/{911f3a1b8dd4bc5c9782.js → 1bf5c0a4bc5a960a3fa2.js} +1 -1
  65. package/assets/esri/core/workers/chunks/1c378d489c5402888f76.js +1 -0
  66. package/assets/esri/core/workers/chunks/1d1e8d8b1fcf2d9f3dfc.js +1 -0
  67. package/assets/esri/core/workers/chunks/{e5c8f9fef88ca33624e9.js → 1e087fb13b7b0a5d6fec.js} +1 -1
  68. package/assets/esri/core/workers/chunks/1e192ac0533a5c0b5a7a.js +1 -0
  69. package/assets/esri/core/workers/chunks/1f9d6180a96d557838e9.js +1 -0
  70. package/assets/esri/core/workers/chunks/1fe077f57a087c0e9119.js +1 -0
  71. package/assets/esri/core/workers/chunks/212222b64039d436b9a6.js +1 -0
  72. package/assets/esri/core/workers/chunks/22c94f9a69b2157f8dbd.js +1 -0
  73. package/assets/esri/core/workers/chunks/25a2e02677a74834c8b5.js +1 -0
  74. package/assets/esri/core/workers/chunks/26ecc841396e5e719b6a.js +1 -0
  75. package/assets/esri/core/workers/chunks/{fcf7299e2ee904ab9882.js → 2724900f7992a79fc442.js} +1 -1
  76. package/assets/esri/core/workers/chunks/27c0bed59626c7f64125.js +1 -0
  77. package/assets/esri/core/workers/chunks/2bc3e7f394386fa75447.js +1 -0
  78. package/assets/esri/core/workers/chunks/2c9783e3b44986e86797.js +1 -0
  79. package/assets/esri/core/workers/chunks/2ceb07b125c84b51f02a.js +1 -0
  80. package/assets/esri/core/workers/chunks/2cf2f2842c19be84ab4d.js +1 -0
  81. package/assets/esri/core/workers/chunks/2d07d5a9ec67c39ef10c.js +1 -0
  82. package/assets/esri/core/workers/chunks/{a7c715648a07ed70b122.js → 2ec44ebc48beeba11201.js} +1 -1
  83. package/assets/esri/core/workers/chunks/2f2d699b072472fa710e.js +1 -0
  84. package/assets/esri/core/workers/chunks/2f3bbc1f7d4abbbeec2f.js +1 -0
  85. package/assets/esri/core/workers/chunks/304a36e862947fdb05c0.js +1 -0
  86. package/assets/esri/core/workers/chunks/30af0f7c4cfa541c9efd.js +1 -0
  87. package/assets/esri/core/workers/chunks/32f11b4aeae1ef00e466.js +1 -0
  88. package/assets/esri/core/workers/chunks/35d3e60d15294f268992.js +1 -0
  89. package/assets/esri/core/workers/chunks/37a2be4380796f14fe4e.js +1 -0
  90. package/assets/esri/core/workers/chunks/37adb55d9f83faad1712.js +1 -0
  91. package/assets/esri/core/workers/chunks/3869dca884d7ca6488f5.js +1 -0
  92. package/assets/esri/core/workers/chunks/3a9c6f58a1a065c14017.js +1 -0
  93. package/assets/esri/core/workers/chunks/3b552afffaa78bf4fe18.js +1 -0
  94. package/assets/esri/core/workers/chunks/{fe06cc2f90b2d551e4c1.js → 3bbd2d4a19c3b7ad82e4.js} +1 -1
  95. package/assets/esri/core/workers/chunks/3de07326da4c47cd2aab.js +1 -0
  96. package/assets/esri/core/workers/chunks/3f5234120d3a14186c1c.js +1 -0
  97. package/assets/esri/core/workers/chunks/414093fa4957d17bf551.js +1 -0
  98. package/assets/esri/core/workers/chunks/{dbd6bbd3e834ff9d220e.js → 41cf6163758d28fb1968.js} +1 -1
  99. package/assets/esri/core/workers/chunks/466bb1b69aabaeabad6a.js +1 -0
  100. package/assets/esri/core/workers/chunks/47e60b2acec18ef37b6c.js +1 -0
  101. package/assets/esri/core/workers/chunks/4849849fc8330d05a8e6.js +1 -0
  102. package/assets/esri/core/workers/chunks/497c5a9c95e9a89ac217.js +1 -0
  103. package/assets/esri/core/workers/chunks/49d36e54644dc2966128.js +1 -0
  104. package/assets/esri/core/workers/chunks/4aefe6fd4d725a107758.js +1 -0
  105. package/assets/esri/core/workers/chunks/4b6f433022a6822706cb.js +1 -0
  106. package/assets/esri/core/workers/chunks/4d4ebb4e4d83c1123b63.js +1 -0
  107. package/assets/esri/core/workers/chunks/4ee99e654dad6f09abee.js +1 -0
  108. package/assets/esri/core/workers/chunks/4f0804429d8989aa4c51.js +1 -0
  109. package/assets/esri/core/workers/chunks/50525b617ef78086d3c7.js +1 -0
  110. package/assets/esri/core/workers/chunks/5235b9c21ac4156c2375.js +1 -0
  111. package/assets/esri/core/workers/chunks/52422500ca3d6cf2e596.js +1 -0
  112. package/assets/esri/core/workers/chunks/527b87fddf33bb5d519e.js +1 -0
  113. package/assets/esri/core/workers/chunks/55572cefc752b755cf0a.js +1 -0
  114. package/assets/esri/core/workers/chunks/{a4bae2396fae48b57047.js → 595edbc1e9bba47d5676.js} +1 -1
  115. package/assets/esri/core/workers/chunks/59cf23cc8f91b5bea31a.js +1 -0
  116. package/assets/esri/core/workers/chunks/5af16937904c06fb06f6.js +1 -0
  117. package/assets/esri/core/workers/chunks/5d7a5aa608ed6192b016.js +1 -0
  118. package/assets/esri/core/workers/chunks/5d9c92c4e60a4696fdad.js +1 -0
  119. package/assets/esri/core/workers/chunks/5ed7bc9e6cb7cdee92e2.js +1 -0
  120. package/assets/esri/core/workers/chunks/{272c8ccdbd3dcc14e99b.js → 5ed89c862eee1345e3af.js} +1 -1
  121. package/assets/esri/core/workers/chunks/5fbd7d8d8896a224fff3.js +1 -0
  122. package/assets/esri/core/workers/chunks/64ce2d060ae7cdd412cf.js +1 -0
  123. package/assets/esri/core/workers/chunks/65f4ca7201e7267bfc81.js +1 -0
  124. package/assets/esri/core/workers/chunks/67efdd296007a809586c.js +1 -0
  125. package/assets/esri/core/workers/chunks/691434d4c6a38e63d819.js +1 -0
  126. package/assets/esri/core/workers/chunks/{ba67aaa08e4f11e1140a.js → 696cb3bf167327d5b0b9.js} +1 -1
  127. package/assets/esri/core/workers/chunks/69700ed16727ed0c4e3a.js +1 -0
  128. package/assets/esri/core/workers/chunks/6a2d890640b2cd6c5ccb.js +1 -0
  129. package/assets/esri/core/workers/chunks/6a4f007f87d9f2a6fbc4.js +1 -0
  130. package/assets/esri/core/workers/chunks/{7343a44a2382a1d68497.js → 6b9dbf43c0659e55c539.js} +1 -1
  131. package/assets/esri/core/workers/chunks/6de5c6af62776e1b9776.js +1 -0
  132. package/assets/esri/core/workers/chunks/70dc25f721c0ac5f3660.js +1 -0
  133. package/assets/esri/core/workers/chunks/71308dca3fd05687e7bd.js +1 -0
  134. package/assets/esri/core/workers/chunks/75bddfe2be64379db8fd.js +1 -0
  135. package/assets/esri/core/workers/chunks/78085f804969c9282700.js +1 -0
  136. package/assets/esri/core/workers/chunks/7aa9b61ca9b66f30449f.js +1 -0
  137. package/assets/esri/core/workers/chunks/7c1f989ee3d13dfe7ebd.js +1 -0
  138. package/assets/esri/core/workers/chunks/7c56446184abcd14678b.js +1 -0
  139. package/assets/esri/core/workers/chunks/7ce9c84f90e9dd1deb38.js +1 -0
  140. package/assets/esri/core/workers/chunks/7f55a150e4da02786311.js +1 -0
  141. package/assets/esri/core/workers/chunks/7fc3231768ce79e375ae.js +1 -0
  142. package/assets/esri/core/workers/chunks/7febb434f2de2436435f.js +1 -0
  143. package/assets/esri/core/workers/chunks/847b02d188ece9b563ad.js +1 -0
  144. package/assets/esri/core/workers/chunks/903c7bd079888f65fef1.js +1 -0
  145. package/assets/esri/core/workers/chunks/{bdafd4f03585351cecc3.js → 909a85cb6e0e9a3c8567.js} +1 -1
  146. package/assets/esri/core/workers/chunks/9226205850e35b7fc610.js +1 -0
  147. package/assets/esri/core/workers/chunks/922c24b9bb68f4201b03.js +1 -0
  148. package/assets/esri/core/workers/chunks/9407db0584c730591161.js +1 -0
  149. package/assets/esri/core/workers/chunks/9474c913e53f69679197.js +1 -0
  150. package/assets/esri/core/workers/chunks/94ddfe165ac25aef8229.js +1 -0
  151. package/assets/esri/core/workers/chunks/{75a2c43311f5f9058f62.js → 94f62ff81cc6fb83e73f.js} +1 -1
  152. package/assets/esri/core/workers/chunks/95ccac3734ac70387b03.js +1 -0
  153. package/assets/esri/core/workers/chunks/97c7dfd29ad4c2966cb4.js +1 -0
  154. package/assets/esri/core/workers/chunks/{1354b8442c2c501238f1.js → 986c5024f22bbfc49aba.js} +1 -1
  155. package/assets/esri/core/workers/chunks/9b81bd62a2c72f592db1.js +1 -0
  156. package/assets/esri/core/workers/chunks/{62596065747abce1964d.js → 9b8e33985310f281f084.js} +1 -1
  157. package/assets/esri/core/workers/chunks/9c7fc1c97125ea2a7b7e.js +1 -0
  158. package/assets/esri/core/workers/chunks/9e2b3754a76e0dd4a94a.js +1 -0
  159. package/assets/esri/core/workers/chunks/9eb3e6800f5034f1593f.js +1 -0
  160. package/assets/esri/core/workers/chunks/a0300fac6a06e7d89a52.js +1 -0
  161. package/assets/esri/core/workers/chunks/a03e7333e3328036f478.js +1 -0
  162. package/assets/esri/core/workers/chunks/a0565137027c83108953.js +1 -0
  163. package/assets/esri/core/workers/chunks/a3b403f8acb90af19adb.js +1 -0
  164. package/assets/esri/core/workers/chunks/a4596f028758649da099.js +1 -0
  165. package/assets/esri/core/workers/chunks/a46ac0be9aabc4cfedc7.js +1 -0
  166. package/assets/esri/core/workers/chunks/a4a22149077c7780481c.js +1 -0
  167. package/assets/esri/core/workers/chunks/a6ab627e965fe7e5bd52.js +1 -0
  168. package/assets/esri/core/workers/chunks/a7954ad55a241af9064f.js +1 -0
  169. package/assets/esri/core/workers/chunks/a8b878c12cb1a6ea012b.js +1 -0
  170. package/assets/esri/core/workers/chunks/{ec0803cfa5051c4d300d.js → aa0ef4493a7e9bed159f.js} +1 -1
  171. package/assets/esri/core/workers/chunks/aa8ab28e0c1ae3b55ac0.js +1 -0
  172. package/assets/esri/core/workers/chunks/ab9927a32350063cb5f0.js +1 -0
  173. package/assets/esri/core/workers/chunks/adc2620cbe735532004d.js +1 -0
  174. package/assets/esri/core/workers/chunks/add834f867900a7091d2.js +1 -0
  175. package/assets/esri/core/workers/chunks/{bbf4c2ee4d56bb0f1a81.js → afa6b74d9ca9ed0154af.js} +1 -1
  176. package/assets/esri/core/workers/chunks/b0e25ccb5a1e57a82628.js +1 -0
  177. package/assets/esri/core/workers/chunks/b17a9853250ab626d58d.js +1 -0
  178. package/assets/esri/core/workers/chunks/b19cff0e43fab2632660.js +1 -0
  179. package/assets/esri/core/workers/chunks/b2e2234fdf8e05bc3312.js +1 -0
  180. package/assets/esri/core/workers/chunks/b6063d1755def00d4889.js +1 -0
  181. package/assets/esri/core/workers/chunks/{7c3d46201b11a45f79d0.js → b6f67302d0d5d57add66.js} +74 -107
  182. package/assets/esri/core/workers/chunks/bb56ab53c5a10c9518a6.js +1 -0
  183. package/assets/esri/core/workers/chunks/bd2602195e265f8fdb15.js +1 -0
  184. package/assets/esri/core/workers/chunks/{f762f0f6c83748d8e328.js → bee411f08e2a9499f8f5.js} +1 -1
  185. package/assets/esri/core/workers/chunks/bf357afbabaa8dec4d75.js +1 -0
  186. package/assets/esri/core/workers/chunks/bf7875fda48b15271a10.js +1 -0
  187. package/assets/esri/core/workers/chunks/bfa59005a9b191d18546.js +1 -0
  188. package/assets/esri/core/workers/chunks/bfb8fc6b940bd5510e29.js +1 -0
  189. package/assets/esri/core/workers/chunks/{b311658b8a223efe35d6.js → c0e073a77484b0dfd383.js} +1 -1
  190. package/assets/esri/core/workers/chunks/c13aa45ccd5efb662f88.js +1 -0
  191. package/assets/esri/core/workers/chunks/c176df477bbbbc9c6922.js +1 -0
  192. package/assets/esri/core/workers/chunks/c35553d07ad169910742.js +1 -0
  193. package/assets/esri/core/workers/chunks/c4f582dec07895d3bb93.js +1 -0
  194. package/assets/esri/core/workers/chunks/c4fef90cf08bbe4f0bb5.js +1 -0
  195. package/assets/esri/core/workers/chunks/c5c2fed38e0ccf84f1fa.js +1 -0
  196. package/assets/esri/core/workers/chunks/c80277a313205853a857.js +1 -0
  197. package/assets/esri/core/workers/chunks/c91042f8bf886056a29c.js +1 -0
  198. package/assets/esri/core/workers/chunks/ca204c110438f7315790.js +1 -0
  199. package/assets/esri/core/workers/chunks/ca36d85a47179d95f2fc.js +1 -0
  200. package/assets/esri/core/workers/chunks/cb6fb04fe5c8d90d4196.js +1 -0
  201. package/assets/esri/core/workers/chunks/ccaeabc3be07f3c96f50.js +1 -0
  202. package/assets/esri/core/workers/chunks/{85f459297b0214141d43.js → cd02a6078443b8f63927.js} +1 -1
  203. package/assets/esri/core/workers/chunks/{e64ccdb8328eb6514e59.js → cd8b3c2fc27c239f9954.js} +1 -1
  204. package/assets/esri/core/workers/chunks/{3a36c132ceddef3d15c8.js → cdbcc4cd9145dd93db49.js} +1 -1
  205. package/assets/esri/core/workers/chunks/{e90feee1756a2209f93f.js → ce9fe1a89b474f9e7ee7.js} +1 -1
  206. package/assets/esri/core/workers/chunks/d04a01dc1b4947478264.js +1 -0
  207. package/assets/esri/core/workers/chunks/d0cf9ff48f051adbd455.js +1 -0
  208. package/assets/esri/core/workers/chunks/d119671a32a050517cca.js +1 -0
  209. package/assets/esri/core/workers/chunks/d26be8313526ecea9c68.js +1 -0
  210. package/assets/esri/core/workers/chunks/d270b49c037085503016.js +1 -0
  211. package/assets/esri/core/workers/chunks/{f5eee6e548bb24b5a003.js → d30a7fc8dab4ebb8893b.js} +1 -1
  212. package/assets/esri/core/workers/chunks/d344c3fd9f6b113bbcd7.js +1 -0
  213. package/assets/esri/core/workers/chunks/d36bbda9b7261534568f.js +1 -0
  214. package/assets/esri/core/workers/chunks/d4b0012ae1d3b8a9ba01.js +1 -0
  215. package/assets/esri/core/workers/chunks/d6b87134e0d120c68d2f.js +1 -0
  216. package/assets/esri/core/workers/chunks/d6f7aa280f1bd201d4ef.js +1 -0
  217. package/assets/esri/core/workers/chunks/da9aacdb0b4a04f42fb8.js +1 -0
  218. package/assets/esri/core/workers/chunks/daf7b647bd960d8bad56.js +1 -0
  219. package/assets/esri/core/workers/chunks/{10ac92dcd3738ec23dfb.js → db04c1bad40d068306ba.js} +1 -1
  220. package/assets/esri/core/workers/chunks/{3427f0c026301bcf7272.js → db180f8d25471cfa48af.js} +1 -1
  221. package/assets/esri/core/workers/chunks/db4c9a9103e979292948.js +1 -0
  222. package/assets/esri/core/workers/chunks/dceaa6b68eee090073b1.js +1 -0
  223. package/assets/esri/core/workers/chunks/ddf284648a73b6993737.js +1 -0
  224. package/assets/esri/core/workers/chunks/dfbe0efe453587ec5eb2.js +1 -0
  225. package/assets/esri/core/workers/chunks/e1682e94cc714197ebb4.js +1 -0
  226. package/assets/esri/core/workers/chunks/e2576c37cf13dc421f69.js +1 -0
  227. package/assets/esri/core/workers/chunks/e32a14770e036fce79d9.js +1 -0
  228. package/assets/esri/core/workers/chunks/e370a3337b3c90240e73.js +1 -0
  229. package/assets/esri/core/workers/chunks/e39bccc000c768120a32.js +1 -0
  230. package/assets/esri/core/workers/chunks/e40e08029325f43452d0.js +1 -0
  231. package/assets/esri/core/workers/chunks/{0d7d54e74b5639a0be6e.js → e707534a700a2de687ca.js} +1 -1
  232. package/assets/esri/core/workers/chunks/e823c9ccb7bc348d8824.js +1 -0
  233. package/assets/esri/core/workers/chunks/e88eee4c2fc4229c2a8b.js +1 -0
  234. package/assets/esri/core/workers/chunks/e9f29019aa78f07ace66.js +1 -0
  235. package/assets/esri/core/workers/chunks/ea75c23c44452f45a949.js +1 -0
  236. package/assets/esri/core/workers/chunks/ea91c57a0b31f3f65ee5.js +1 -0
  237. package/assets/esri/core/workers/chunks/eacf216dcd6397c7bd7f.js +1 -0
  238. package/assets/esri/core/workers/chunks/ee77999df3785468b2b6.js +1 -0
  239. package/assets/esri/core/workers/chunks/ef851a2cff76fd211c07.js +1 -0
  240. package/assets/esri/core/workers/chunks/eff359210893239ecec3.js +1 -0
  241. package/assets/esri/core/workers/chunks/f106cc7f559856f69b9f.js +1 -0
  242. package/assets/esri/core/workers/chunks/f210cd8afb86b6eaf7a2.js +1 -0
  243. package/assets/esri/core/workers/chunks/f247f3c5148fa0237a7c.js +1 -0
  244. package/assets/esri/core/workers/chunks/f250a7aa571889c5ad4b.js +1 -0
  245. package/assets/esri/core/workers/chunks/{a26dc2647a15b830390e.js → f253875feb11883deb84.js} +1 -1
  246. package/assets/esri/core/workers/chunks/f31330d628d7e741bf5b.js +1 -0
  247. package/assets/esri/core/workers/chunks/f3d57c5b9dffd12e45b4.js +1 -0
  248. package/assets/esri/core/workers/chunks/f43ae1c2f89e1c4396cc.js +1 -0
  249. package/assets/esri/core/workers/chunks/f60ed579981913d44675.js +1 -0
  250. package/assets/esri/core/workers/chunks/{147d1e7e2852a4197e5f.js → f665fb4c5633e0a459d8.js} +1 -1
  251. package/assets/esri/core/workers/chunks/f66e597e524b26e61cd3.js +1 -0
  252. package/assets/esri/core/workers/chunks/{bec140a69cfdb0519680.js → f74c7cbe4bd12f73ae90.js} +1 -1
  253. package/assets/esri/core/workers/chunks/{e6f6b38eda34708d61c5.js → f7f2102b16d201e5f531.js} +1 -1
  254. package/assets/esri/core/workers/chunks/f82ae237452b97cfc024.js +1 -0
  255. package/assets/esri/core/workers/chunks/f8f7b86bbd62106bc3d4.js +1 -0
  256. package/assets/esri/core/workers/chunks/f9a4387f850d85c44ca5.js +1 -0
  257. package/assets/esri/core/workers/chunks/fbc7576ed12964059da6.js +1 -0
  258. package/assets/esri/core/workers/chunks/fc4a5996fc03f6c32030.js +1 -0
  259. package/assets/esri/core/workers/chunks/fdd0e6d9927d3c43b0d3.js +1 -0
  260. package/assets/esri/core/workers/chunks/fddcb8be714ad18ad0c8.js +1 -0
  261. package/assets/esri/core/workers/chunks/{baa46edd87e97f922128.js → ffe749d790320dddfa74.js} +1 -1
  262. package/assets/esri/themes/base/widgets/_BuildingDisciplinesTree.scss +1 -1
  263. package/assets/esri/themes/base/widgets/_Daylight.scss +2 -2
  264. package/assets/esri/themes/base/widgets/_Editor.scss +1 -1
  265. package/assets/esri/themes/base/widgets/_Sketch.scss +1 -1
  266. package/assets/esri/themes/base/widgets/_SketchTooltipControls.scss +1 -1
  267. package/assets/esri/themes/base/widgets/_Slider.scss +1 -1
  268. package/assets/esri/themes/base/widgets/_SnappingControls.scss +1 -1
  269. package/assets/esri/themes/base/widgets/_TimezonePicker.scss +1 -1
  270. package/chunks/Bufferer-CclWhXVb.js +1 -1
  271. package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
  272. package/chunks/EmissionComposite.glsl.js +2 -2
  273. package/chunks/Envelope.js +1 -1
  274. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  275. package/chunks/GeodeticUtils.js +1 -1
  276. package/chunks/GeographicTransformation.js +1 -1
  277. package/chunks/Geometry.js +1 -1
  278. package/chunks/GlobalIllumination.glsl.js +69 -102
  279. package/chunks/GlowComposite.glsl.js +9 -7
  280. package/chunks/MultiPathImpl.js +1 -1
  281. package/chunks/OperatorCentroid2D.js +1 -1
  282. package/chunks/OperatorContains.js +2 -0
  283. package/chunks/OperatorCrosses.js +1 -1
  284. package/chunks/OperatorCut.js +1 -1
  285. package/chunks/OperatorDisjoint.js +2 -0
  286. package/chunks/OperatorDistance.js +2 -0
  287. package/chunks/OperatorEquals.js +2 -0
  288. package/chunks/OperatorGeodesicBuffer.js +1 -1
  289. package/chunks/OperatorGeodeticArea.js +1 -1
  290. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  291. package/chunks/OperatorGeodeticLength.js +1 -1
  292. package/chunks/OperatorGraphicBuffer.js +1 -1
  293. package/chunks/OperatorIntegrate.js +1 -1
  294. package/chunks/OperatorIntersects.js +1 -1
  295. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  296. package/chunks/OperatorOverlaps.js +1 -1
  297. package/chunks/OperatorProximity.js +1 -1
  298. package/chunks/OperatorProximityGeodesic.js +1 -1
  299. package/chunks/OperatorRelate.js +2 -0
  300. package/chunks/OperatorShapePreservingLength.js +1 -1
  301. package/chunks/OperatorShapePreservingProject.js +1 -1
  302. package/chunks/OperatorSimplifyOGC.js +1 -1
  303. package/chunks/OperatorTouches.js +1 -1
  304. package/chunks/OperatorWithin.js +1 -1
  305. package/chunks/Point2D.js +1 -1
  306. package/chunks/ProjectionTransformation.js +1 -1
  307. package/chunks/RibbonLine.glsl.js +202 -141
  308. package/chunks/SideCalculator2D-DX0718xq.js +1 -1
  309. package/chunks/UnitFactory.js +1 -1
  310. package/chunks/aiServices.js +1 -1
  311. package/chunks/array.js +1 -1
  312. package/chunks/languageUtils.js +1 -1
  313. package/config.js +1 -1
  314. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  315. package/core/sql/TimeOnly.js +1 -1
  316. package/core/units.js +1 -1
  317. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  318. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  319. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  320. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  321. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  322. package/form/elements/inputs/inputUtils.js +1 -1
  323. package/geometry/operators/areaOperator.js +1 -1
  324. package/geometry/operators/bufferOperator.js +1 -1
  325. package/geometry/operators/centroidOperator.js +1 -1
  326. package/geometry/operators/clipOperator.js +1 -1
  327. package/geometry/operators/containsOperator.js +1 -1
  328. package/geometry/operators/convexHullOperator.js +1 -1
  329. package/geometry/operators/crossesOperator.js +1 -1
  330. package/geometry/operators/cutOperator.js +1 -1
  331. package/geometry/operators/densifyOperator.js +1 -1
  332. package/geometry/operators/differenceOperator.js +1 -1
  333. package/geometry/operators/disjointOperator.js +1 -1
  334. package/geometry/operators/distanceOperator.js +1 -1
  335. package/geometry/operators/equalsOperator.js +1 -1
  336. package/geometry/operators/generalizeOperator.js +1 -1
  337. package/geometry/operators/geodesicBufferOperator.js +1 -1
  338. package/geometry/operators/geodeticAreaOperator.js +1 -1
  339. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  340. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  341. package/geometry/operators/geodeticLengthOperator.js +1 -1
  342. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  343. package/geometry/operators/gx/operatorBuffer.js +1 -1
  344. package/geometry/operators/gx/operatorDifference.js +1 -1
  345. package/geometry/operators/gx/operatorIntersection.js +1 -1
  346. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  347. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  348. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  349. package/geometry/operators/gx/operatorSimplify.js +1 -1
  350. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  351. package/geometry/operators/gx/operatorUnion.js +1 -1
  352. package/geometry/operators/intersectionOperator.js +1 -1
  353. package/geometry/operators/intersectsOperator.js +1 -1
  354. package/geometry/operators/json/containsOperator.js +1 -1
  355. package/geometry/operators/json/crossesOperator.js +1 -1
  356. package/geometry/operators/json/disjointOperator.js +1 -1
  357. package/geometry/operators/json/intersectsOperator.js +1 -1
  358. package/geometry/operators/json/overlapsOperator.js +1 -1
  359. package/geometry/operators/json/touchesOperator.js +1 -1
  360. package/geometry/operators/json/unionOperator.js +1 -1
  361. package/geometry/operators/json/withinOperator.js +1 -1
  362. package/geometry/operators/labelPointOperator.js +1 -1
  363. package/geometry/operators/lengthOperator.js +1 -1
  364. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  365. package/geometry/operators/offsetOperator.js +1 -1
  366. package/geometry/operators/overlapsOperator.js +1 -1
  367. package/geometry/operators/projectOperator.d.ts +1 -1
  368. package/geometry/operators/proximityOperator.js +1 -1
  369. package/geometry/operators/relateOperator.js +1 -1
  370. package/geometry/operators/reshapeOperator.js +1 -1
  371. package/geometry/operators/shapePreservingProjectOperator.d.ts +15 -1
  372. package/geometry/operators/simplifyOGCOperator.js +1 -1
  373. package/geometry/operators/simplifyOperator.js +1 -1
  374. package/geometry/operators/support/GeographicTransformation.d.ts +4 -3
  375. package/geometry/operators/support/GeographicTransformationStep.d.ts +2 -1
  376. package/geometry/operators/support/apiConverter.js +1 -1
  377. package/geometry/operators/support/geographicTransformationUtils.d.ts +22 -15
  378. package/geometry/operators/support/jsonConverter.js +1 -1
  379. package/geometry/operators/support/projectionTransformation.js +1 -1
  380. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  381. package/geometry/operators/touchesOperator.js +1 -1
  382. package/geometry/operators/types.d.ts +2 -1
  383. package/geometry/operators/unionOperator.js +1 -1
  384. package/geometry/operators/withinOperator.js +1 -1
  385. package/geometry/support/convexPolyhedron.js +2 -0
  386. package/geometry/support/curves/circleUtils.js +1 -1
  387. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  388. package/geometry/support/frustum.js +1 -1
  389. package/geometry/support/webMercatorUtils.js +1 -1
  390. package/kernel.js +1 -1
  391. package/layers/LinkChartLayer.js +1 -1
  392. package/layers/VectorTileLayer.js +1 -1
  393. package/layers/graphics/hydratedFeatures.js +1 -1
  394. package/layers/mixins/DataSeriesLayer.js +1 -1
  395. package/layers/support/csvUtils.js +1 -1
  396. package/layers/support/fieldUtils.js +1 -1
  397. package/layers/support/mediaUtils.js +1 -1
  398. package/layers/video/VideoController.js +1 -1
  399. package/package.json +4 -4
  400. package/popup/FeatureContentCollection.js +1 -1
  401. package/support/ArcadeExpression.js +1 -1
  402. package/support/actions/ActionBase.d.ts +1 -1
  403. package/support/arcadeUtils.js +1 -1
  404. package/support/loadArcade.js +1 -1
  405. package/support/revision.js +1 -1
  406. package/support/tests/serviceMockDependencies.js +1 -1
  407. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  408. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
  409. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  410. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  411. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
  412. package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
  413. package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
  414. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  415. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  416. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
  417. package/views/3d/input/SceneInputManager.js +1 -1
  418. package/views/3d/input/handlers/RopePullNavigation.js +2 -0
  419. package/views/3d/layers/TiledLayerView3D.js +1 -1
  420. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  421. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  422. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  423. package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
  424. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  425. package/views/3d/layers/i3s/I3SNode.js +1 -1
  426. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  427. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  428. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  429. package/views/3d/state/controllers/RopePullController.js +2 -0
  430. package/views/3d/state/utils/navigationUtils.js +1 -1
  431. package/views/3d/state/utils/ropePullUtils.js +2 -0
  432. package/views/3d/support/ElevationAgnosticVisibility.js +2 -0
  433. package/views/3d/support/engineContent/line.js +1 -1
  434. package/views/3d/support/sphericalTileUtils.js +2 -0
  435. package/views/3d/terrain/PlanarPatch.js +1 -1
  436. package/views/3d/terrain/SphericalPatch.js +1 -1
  437. package/views/3d/terrain/Tile.js +1 -1
  438. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatCovariance.glsl.js +9 -3
  439. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +5 -8
  440. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  441. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  442. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  443. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  444. package/views/3d/webgl-engine/lib/Material.js +1 -1
  445. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  446. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  447. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  448. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  449. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  450. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  451. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  452. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  453. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  454. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  455. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  456. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +39 -51
  457. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  458. package/views/SelectionManager.js +1 -1
  459. package/views/draw/DrawTool.js +1 -1
  460. package/views/draw/support/createUtils.js +1 -1
  461. package/views/popupAdapter.js +1 -1
  462. package/views/support/GeometryWorker.js +1 -1
  463. package/views/support/selectionUtils.js +1 -1
  464. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  465. package/widgets/BatchAttributeForm/expressions/ArcadeExecutorProvider.js +1 -1
  466. package/widgets/BatchAttributeForm/templates/FieldElementTemplate.js +1 -1
  467. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  468. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  469. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  470. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  471. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  472. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  473. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  474. package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
  475. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  476. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  477. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  478. package/widgets/support/SelectionList/selectionListUtils.d.ts +58 -0
  479. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  480. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  481. package/arcade/kernel.js +0 -2
  482. package/assets/esri/core/workers/chunks/01b7babaefe6500fd6eb.js +0 -1
  483. package/assets/esri/core/workers/chunks/05acc17cb66fa6c08845.js +0 -1
  484. package/assets/esri/core/workers/chunks/06e109e92de7fa0956e3.js +0 -1
  485. package/assets/esri/core/workers/chunks/0775d1e3034d5e7ef7bc.js +0 -1
  486. package/assets/esri/core/workers/chunks/09a0a1e794ddff65aa08.js +0 -1
  487. package/assets/esri/core/workers/chunks/0e57d33bd202d0972207.js +0 -1
  488. package/assets/esri/core/workers/chunks/11224af8b037ccbf252c.js +0 -1
  489. package/assets/esri/core/workers/chunks/151bac9e519a3b821baf.js +0 -1
  490. package/assets/esri/core/workers/chunks/156f85ac1885464f0072.js +0 -1
  491. package/assets/esri/core/workers/chunks/17a10916114754f1f216.js +0 -1
  492. package/assets/esri/core/workers/chunks/180eebd8b7badc2840c9.js +0 -1
  493. package/assets/esri/core/workers/chunks/19cb8963d5ec2246357b.js +0 -1
  494. package/assets/esri/core/workers/chunks/19d4ecee1c161ac0f33c.js +0 -1
  495. package/assets/esri/core/workers/chunks/19ece9f5313f53384cac.js +0 -1
  496. package/assets/esri/core/workers/chunks/1b4e050a3884fc6fa6cf.js +0 -1
  497. package/assets/esri/core/workers/chunks/1d770e8f0fe57d937daa.js +0 -1
  498. package/assets/esri/core/workers/chunks/1dd22b8df6a52277c64b.js +0 -1
  499. package/assets/esri/core/workers/chunks/1ede298ab815e9ad625c.js +0 -1
  500. package/assets/esri/core/workers/chunks/208bc524bd1e0d3aab79.js +0 -1
  501. package/assets/esri/core/workers/chunks/20a4ae83542c7d39cf0f.js +0 -1
  502. package/assets/esri/core/workers/chunks/21071ab3d7b2771406ae.js +0 -1
  503. package/assets/esri/core/workers/chunks/21bfa89363104f041101.js +0 -1
  504. package/assets/esri/core/workers/chunks/21d0a4d6639d32278f11.js +0 -1
  505. package/assets/esri/core/workers/chunks/22a75fdc6ba60213a870.js +0 -1
  506. package/assets/esri/core/workers/chunks/22e004ed97e06536ecef.js +0 -1
  507. package/assets/esri/core/workers/chunks/23942712a3f6290e0fdb.js +0 -1
  508. package/assets/esri/core/workers/chunks/242287de82586d42f0a4.js +0 -1
  509. package/assets/esri/core/workers/chunks/25cb5086eaa412f6820b.js +0 -1
  510. package/assets/esri/core/workers/chunks/26c8ed0aef59ed6d5267.js +0 -1
  511. package/assets/esri/core/workers/chunks/2742d62fceaf0736aef0.js +0 -1
  512. package/assets/esri/core/workers/chunks/276eba546dc8774076ee.js +0 -1
  513. package/assets/esri/core/workers/chunks/28e02b213da9e682d3dc.js +0 -29
  514. package/assets/esri/core/workers/chunks/2d8195231cb16247f198.js +0 -1
  515. package/assets/esri/core/workers/chunks/2db1227ecd421728630d.js +0 -1
  516. package/assets/esri/core/workers/chunks/2ddc9c9ff6ec243d85e2.js +0 -1
  517. package/assets/esri/core/workers/chunks/2e712154ebb895d96ba1.js +0 -1
  518. package/assets/esri/core/workers/chunks/2f2df51d4976ae65edae.js +0 -1
  519. package/assets/esri/core/workers/chunks/2f652b330a9978a68e83.js +0 -1
  520. package/assets/esri/core/workers/chunks/32d31fd4cffdf5a80acb.js +0 -1
  521. package/assets/esri/core/workers/chunks/33aaa5a49e396a0aca47.js +0 -1
  522. package/assets/esri/core/workers/chunks/33d6ca59eeb88e739c81.js +0 -1
  523. package/assets/esri/core/workers/chunks/35622088727e120c93b9.js +0 -1
  524. package/assets/esri/core/workers/chunks/3714cc26f446c4d9cc2c.js +0 -1
  525. package/assets/esri/core/workers/chunks/3722d40d161d60370936.js +0 -1
  526. package/assets/esri/core/workers/chunks/3ac4cfeb1af12a9dc27d.js +0 -1
  527. package/assets/esri/core/workers/chunks/3bf37fd3280f4891c76b.js +0 -1
  528. package/assets/esri/core/workers/chunks/3cecf627827f5d9213a9.js +0 -1
  529. package/assets/esri/core/workers/chunks/3d18a10a1ecfabe92db3.js +0 -1
  530. package/assets/esri/core/workers/chunks/3da39efc5f68f15c105f.js +0 -1
  531. package/assets/esri/core/workers/chunks/3fbd4c7e25440c4713f2.js +0 -1
  532. package/assets/esri/core/workers/chunks/407dba2be21255eb47fc.js +0 -1
  533. package/assets/esri/core/workers/chunks/40ec85b7813a396ee490.js +0 -1
  534. package/assets/esri/core/workers/chunks/44b1a4e8a65221ad3808.js +0 -1
  535. package/assets/esri/core/workers/chunks/49e37f653b81f9e4f7cc.js +0 -1
  536. package/assets/esri/core/workers/chunks/4b4221a869b3f0d517fa.js +0 -1
  537. package/assets/esri/core/workers/chunks/4b86bcde5992eb752ab0.js +0 -1
  538. package/assets/esri/core/workers/chunks/4b9095e2bd060efd47c4.js +0 -1
  539. package/assets/esri/core/workers/chunks/4ec306e5c11808b96e07.js +0 -1
  540. package/assets/esri/core/workers/chunks/5084de4d0d4961b63ab7.js +0 -1
  541. package/assets/esri/core/workers/chunks/51a8a47aac1d8d22ba9d.js +0 -1
  542. package/assets/esri/core/workers/chunks/5324e4feb78203204c0c.js +0 -1
  543. package/assets/esri/core/workers/chunks/58d10928959ae1e2e8d9.js +0 -1
  544. package/assets/esri/core/workers/chunks/5903dceb172897e5675b.js +0 -1
  545. package/assets/esri/core/workers/chunks/597a8e3d9e458298fdd3.js +0 -1
  546. package/assets/esri/core/workers/chunks/5a006ff759fad9fc25cb.js +0 -1
  547. package/assets/esri/core/workers/chunks/5e5a05abcb41915802f6.js +0 -1
  548. package/assets/esri/core/workers/chunks/60be6de19c5659091d8f.js +0 -1
  549. package/assets/esri/core/workers/chunks/61a38237e163b39520e5.js +0 -1
  550. package/assets/esri/core/workers/chunks/61fcdba6f2097378dce5.js +0 -1
  551. package/assets/esri/core/workers/chunks/62f37d1075390a177ae9.js +0 -1
  552. package/assets/esri/core/workers/chunks/65eff0ae773505495f21.js +0 -1
  553. package/assets/esri/core/workers/chunks/67452ba9e87962b9e01e.js +0 -1
  554. package/assets/esri/core/workers/chunks/68195277046861ed39a7.js +0 -1
  555. package/assets/esri/core/workers/chunks/6a2a4da3a1cd64ff576f.js +0 -1
  556. package/assets/esri/core/workers/chunks/6af1680771fd8ae8c7dc.js +0 -1
  557. package/assets/esri/core/workers/chunks/6c367de583e0e657ca3a.js +0 -1
  558. package/assets/esri/core/workers/chunks/6d2021a0f0c9a3c6a0e6.js +0 -1
  559. package/assets/esri/core/workers/chunks/6db4a4f9a9ce7cc738d0.js +0 -1
  560. package/assets/esri/core/workers/chunks/724260e36efea90585f4.js +0 -1
  561. package/assets/esri/core/workers/chunks/73cb944b87ffce33bb49.js +0 -1
  562. package/assets/esri/core/workers/chunks/74ae1222787389d5fcaa.js +0 -1
  563. package/assets/esri/core/workers/chunks/74bfaa98da6c5d375f05.js +0 -1
  564. package/assets/esri/core/workers/chunks/7a68a16f7fea712b9fd6.js +0 -1
  565. package/assets/esri/core/workers/chunks/7d8e59ad438fb34b476d.js +0 -1
  566. package/assets/esri/core/workers/chunks/7eb94fc75926bc739233.js +0 -1
  567. package/assets/esri/core/workers/chunks/80795118467fb31ea4ed.js +0 -1
  568. package/assets/esri/core/workers/chunks/852649460d664b0a1a1d.js +0 -1
  569. package/assets/esri/core/workers/chunks/85c538bf1209f0da1f8e.js +0 -1
  570. package/assets/esri/core/workers/chunks/86de2d1f13915ab7a51d.js +0 -1
  571. package/assets/esri/core/workers/chunks/8db3fd97e8eccd3ba1db.js +0 -1
  572. package/assets/esri/core/workers/chunks/8e225dd0319672103561.js +0 -1
  573. package/assets/esri/core/workers/chunks/8e79a84e224d05204e7d.js +0 -1
  574. package/assets/esri/core/workers/chunks/8e9aff66a2d4e2cc102b.js +0 -1
  575. package/assets/esri/core/workers/chunks/917318f8e186f466dc52.js +0 -1
  576. package/assets/esri/core/workers/chunks/9267f6a65c2245696eac.js +0 -1
  577. package/assets/esri/core/workers/chunks/958e161634b5bfd50625.js +0 -1
  578. package/assets/esri/core/workers/chunks/99881d0a6c2490a16268.js +0 -1
  579. package/assets/esri/core/workers/chunks/99980c944acb8ff88d6a.js +0 -1
  580. package/assets/esri/core/workers/chunks/9b5e890fb0ab29f3a3f1.js +0 -1
  581. package/assets/esri/core/workers/chunks/9c227785f4454d3966ea.js +0 -1
  582. package/assets/esri/core/workers/chunks/9d61d9136f3d00aab530.js +0 -1
  583. package/assets/esri/core/workers/chunks/9df2685583393a87df2d.js +0 -1
  584. package/assets/esri/core/workers/chunks/9e840a71906c4deef776.js +0 -1
  585. package/assets/esri/core/workers/chunks/a03f4605bde69bfb6d41.js +0 -1
  586. package/assets/esri/core/workers/chunks/a0da026a06de379b8f39.js +0 -1
  587. package/assets/esri/core/workers/chunks/a327843cee2057ee76c0.js +0 -1
  588. package/assets/esri/core/workers/chunks/a557347fb313df6fcc79.js +0 -1
  589. package/assets/esri/core/workers/chunks/a8da0728a12fc46dca23.js +0 -1
  590. package/assets/esri/core/workers/chunks/a9ea28e0f22cfe3ccf92.js +0 -1
  591. package/assets/esri/core/workers/chunks/aae92f23b38ae22dd8bf.js +0 -1
  592. package/assets/esri/core/workers/chunks/ad29b77843a7d93d9f8a.js +0 -1
  593. package/assets/esri/core/workers/chunks/ad3714da9c90d7471385.js +0 -1
  594. package/assets/esri/core/workers/chunks/b015b8c7a073dbc4a3ad.js +0 -1
  595. package/assets/esri/core/workers/chunks/b047f9e9ba26037657ed.js +0 -1
  596. package/assets/esri/core/workers/chunks/b1323800119bd5c1759b.js +0 -1
  597. package/assets/esri/core/workers/chunks/b18c35f25da18a3219d7.js +0 -1
  598. package/assets/esri/core/workers/chunks/b1f68ee65cce457d7b5b.js +0 -1
  599. package/assets/esri/core/workers/chunks/b2d6fd436981c890152f.js +0 -1
  600. package/assets/esri/core/workers/chunks/b4b4fe06364bea9b0750.js +0 -1
  601. package/assets/esri/core/workers/chunks/b661aae7e3ce955a783e.js +0 -1
  602. package/assets/esri/core/workers/chunks/b66ebe53bd879aa9de57.js +0 -1
  603. package/assets/esri/core/workers/chunks/b812f817c465c64e8c63.js +0 -1
  604. package/assets/esri/core/workers/chunks/b8ca80134abfcc692244.js +0 -1
  605. package/assets/esri/core/workers/chunks/b94b36581842749863f0.js +0 -1
  606. package/assets/esri/core/workers/chunks/bbdf10d76d852072c878.js +0 -1
  607. package/assets/esri/core/workers/chunks/bbeb61d9302323bae9fb.js +0 -1
  608. package/assets/esri/core/workers/chunks/bbfd2b4af8e498b61af9.js +0 -1
  609. package/assets/esri/core/workers/chunks/bc6e488f5fbd50f9f3d0.js +0 -1
  610. package/assets/esri/core/workers/chunks/bddd5aa7a14cd45ff91c.js +0 -1
  611. package/assets/esri/core/workers/chunks/be31c2cb97f664a54306.js +0 -1
  612. package/assets/esri/core/workers/chunks/be4319827db91aa71bf5.js +0 -1
  613. package/assets/esri/core/workers/chunks/bef32acf368b4d5aba37.js +0 -1
  614. package/assets/esri/core/workers/chunks/c1568bcd3f04014152e1.js +0 -1
  615. package/assets/esri/core/workers/chunks/c229325f41f10fe7f732.js +0 -1
  616. package/assets/esri/core/workers/chunks/c229a4eedda468c914a9.js +0 -1
  617. package/assets/esri/core/workers/chunks/c308d8f419ba63c583e6.js +0 -1
  618. package/assets/esri/core/workers/chunks/c6ef0636073e28350c91.js +0 -1
  619. package/assets/esri/core/workers/chunks/c71368cd64f240da1743.js +0 -1
  620. package/assets/esri/core/workers/chunks/ca6652c6304ad0e37e8f.js +0 -1
  621. package/assets/esri/core/workers/chunks/cb2f27e5d465124b9868.js +0 -1
  622. package/assets/esri/core/workers/chunks/cee2f7f3b3f84688e49d.js +0 -1
  623. package/assets/esri/core/workers/chunks/d0942860a53b02371e94.js +0 -1
  624. package/assets/esri/core/workers/chunks/d09491b340af3b779505.js +0 -1
  625. package/assets/esri/core/workers/chunks/d13eeff678972a245d5d.js +0 -1
  626. package/assets/esri/core/workers/chunks/d3d7b4cd28a0dc2720d4.js +0 -1
  627. package/assets/esri/core/workers/chunks/d3ea7ac6fe71c95faa75.js +0 -1
  628. package/assets/esri/core/workers/chunks/d41e4498aaf4970f48b0.js +0 -1
  629. package/assets/esri/core/workers/chunks/d4d2a0d882fef463e7bc.js +0 -1
  630. package/assets/esri/core/workers/chunks/d7c8725ffb175cec5f8a.js +0 -1
  631. package/assets/esri/core/workers/chunks/d96fa373dcb621c2a869.js +0 -1
  632. package/assets/esri/core/workers/chunks/da233362b06b6db375f1.js +0 -1
  633. package/assets/esri/core/workers/chunks/da45d9576b8d66131623.js +0 -1
  634. package/assets/esri/core/workers/chunks/dbc8f15a6be835f4897d.js +0 -1
  635. package/assets/esri/core/workers/chunks/e00d0036974aaec7d876.js +0 -1
  636. package/assets/esri/core/workers/chunks/e0c75ae3a211a8da10f7.js +0 -1
  637. package/assets/esri/core/workers/chunks/e557043f90c051e93925.js +0 -1
  638. package/assets/esri/core/workers/chunks/e5cbed6f19c743915c8e.js +0 -1
  639. package/assets/esri/core/workers/chunks/e5ecd93bd32e99bc99d1.js +0 -1
  640. package/assets/esri/core/workers/chunks/e76662562e03eef52ba4.js +0 -1
  641. package/assets/esri/core/workers/chunks/eb8c4f194bb66a27d418.js +0 -1
  642. package/assets/esri/core/workers/chunks/ebd8c77df5df63bd3efe.js +0 -1
  643. package/assets/esri/core/workers/chunks/ed5e9718c4dcad1156f7.js +0 -1
  644. package/assets/esri/core/workers/chunks/f14347f5d63f5d102617.js +0 -1
  645. package/assets/esri/core/workers/chunks/f1d0208c6b09c1c4b248.js +0 -1
  646. package/assets/esri/core/workers/chunks/f3680b71d496839de72c.js +0 -1
  647. package/assets/esri/core/workers/chunks/f3c0280b6c87f2383a60.js +0 -1
  648. package/assets/esri/core/workers/chunks/f42c4dcb8f413ca1c6fd.js +0 -1
  649. package/assets/esri/core/workers/chunks/f5773321487ec248fa3b.js +0 -1
  650. package/assets/esri/core/workers/chunks/f76911f71540b058a881.js +0 -1
  651. package/assets/esri/core/workers/chunks/fa29b5064d6626cfc019.js +0 -1
  652. package/assets/esri/core/workers/chunks/fa882d0f4a9826533421.js +0 -1
  653. package/assets/esri/core/workers/chunks/fb2d43608006f588e3cb.js +0 -1
  654. package/assets/esri/core/workers/chunks/fc1aeea22f8c9d63864a.js +0 -1
  655. package/assets/esri/core/workers/chunks/fc3c03cfa3d6bf3b37dc.js +0 -1
  656. package/assets/esri/core/workers/chunks/ff07d351553deb70b889.js +0 -1
  657. package/assets/esri/core/workers/chunks/ffee66699f5d26569baf.js +0 -1
  658. package/chunks/OperatorDefinitions.js +0 -2
  659. package/chunks/areaOperator.js +0 -2
  660. package/chunks/bufferOperator.js +0 -2
  661. package/chunks/centroidOperator.js +0 -2
  662. package/chunks/clipOperator.js +0 -2
  663. package/chunks/containsOperator.js +0 -2
  664. package/chunks/convexHullOperator.js +0 -2
  665. package/chunks/crossesOperator.js +0 -2
  666. package/chunks/cutOperator.js +0 -2
  667. package/chunks/densifyOperator.js +0 -2
  668. package/chunks/differenceOperator.js +0 -2
  669. package/chunks/disjointOperator.js +0 -2
  670. package/chunks/distanceOperator.js +0 -2
  671. package/chunks/equalsOperator.js +0 -2
  672. package/chunks/generalizeOperator.js +0 -2
  673. package/chunks/geodesicBufferOperator.js +0 -2
  674. package/chunks/geodeticAreaOperator.js +0 -2
  675. package/chunks/geodeticDensifyOperator.js +0 -2
  676. package/chunks/geodeticDistanceOperator.js +0 -2
  677. package/chunks/geodeticLengthOperator.js +0 -2
  678. package/chunks/intersectionOperator.js +0 -2
  679. package/chunks/intersectsOperator.js +0 -2
  680. package/chunks/labelPointOperator.js +0 -2
  681. package/chunks/lengthOperator.js +0 -2
  682. package/chunks/multiPartToSinglePartOperator.js +0 -2
  683. package/chunks/offsetOperator.js +0 -2
  684. package/chunks/overlapsOperator.js +0 -2
  685. package/chunks/proximityOperator.js +0 -2
  686. package/chunks/relateOperator.js +0 -2
  687. package/chunks/simplifyOperator.js +0 -2
  688. package/chunks/symmetricDifferenceOperator.js +0 -2
  689. package/chunks/touchesOperator.js +0 -2
  690. package/chunks/unionOperator.js +0 -2
  691. package/chunks/withinOperator.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as t}from"../../../../core/mathUtils.js";import{normalize as r,copy as n,set as e,dist as s,sub as o,dot as i,scaleAndAdd as u,cross as c,add as f,scale as a,len as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as m,freeze as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as _}from"../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBuffer as g}from"../../../../geometry/projection/projectBuffer.js";import{projectVec3Array as b}from"../../../../geometry/projection/projectVec3Array.js";import{fromValues as S,signedDistance as M}from"../../../../geometry/support/plane.js";import{Frustum as F}from"../../state/Frustum.js";class R{constructor(t,r){this._renderCoordsHelper=t,this.opaqueGround=r,this._cache=new Map,this._cameraForward=l(),this._cameraEye=l(),this._cameraFovY=55*Math.PI/180,this._frustumBoundingSphereCenter=l(),this._frustumBoundingSphereRadius=0,this._frustum=new F(t),this._renderSR=t.spatialReference;const n=_(this._renderSR);this._renderSREllipsoidRadius=d(n).radius}setup(t){this._aboveGround=t.aboveGround,this._frustum.update(t),r(this._cameraForward,t.viewForward),n(this._cameraEye,t.eye),this._cameraFovY=t.fovY,this._updateFrustumBoundingSphere()}done(){this._cache.clear()}compute(t){if(this._cache.has(t.id))return this._cache.get(t.id);const r=this._isVisibleInFrustum(t);return this._cache.set(t.id,r),r}_isVisibleInFrustum(t){return 2===this._renderCoordsHelper.viewingMode?this._isTileVisibleInFrustumLocal(t):this._isTileVisibleInFrustumGlobal(t)}_updateFrustumBoundingSphere(){const t=this._frustum.boundingSphere;n(this._frustumBoundingSphereCenter,t.center),this._frustumBoundingSphereRadius=t.radius+xt}_isTileVisibleInFrustumLocal(t){const r=t.spatialReference,n=t.extent,c=this._renderSR;if(!n)return!0;if(E[0]=n[0],E[1]=n[1],E[2]=0,E[3]=n[2],E[4]=n[3],E[5]=0,!g(E,r,0,E,c,0))return!1;e(P[0],E[0],E[1],0),e(P[1],E[3],E[1],0),e(P[2],E[3],E[4],0),e(P[3],E[0],E[4],0),e(T,.5*(E[0]+E[3]),.5*(E[1]+E[4]),.5*(E[2]+E[5]));const f=vt,a=.5*s(P[0],P[2]),h=this._frustum,l=this._frustumBoundingSphereRadius,m=this._frustumBoundingSphereCenter,p=z;o(p,m,T);const d=i(f,p),_=W;u(_,T,f,d);if(s(_,m)>a+l)return!1;const b=this._cameraForward,S=i(b,vt),M=this._cameraFovY,F=this._cameraEye;if(Math.abs(S)<Math.abs(Math.cos(.5*M))){let t=!0;const r=e(jt,b[0],b[1],0),n=i(F,r);for(let e=0;e<4;++e){const s=P[e];if(i(s,r)-n>0){t=!1;break}}if(t)return!1}{const t=P[0],r=P[2];if(t[0]<=F[0]&&F[0]<=r[0]&&t[1]<=F[1]&&F[1]<=r[1])return!0}const R=C,v=this.opaqueGround&&this._aboveGround,j=this.opaqueGround&&!this._aboveGround,G=Math.min(j?_t:1/0,d+l),B=Math.max(v?-_t:-1/0,d-l);for(let e=0;e<4;++e)u(R[e],P[e],f,G),u(R[e+4],P[e],f,B);if(q(h.planes,R,8))return!1;if(w(h.planes,R,8))return!0;for(let e=0;e<4;++e){const t=R[e],r=R[e+4];if(Gt(h.planes,t,r))return!0;const n=R[(e+1)%4];if(Gt(h.planes,t,n))return!0;const s=R[4+(e+1)%4];if(Gt(h.planes,r,s))return!0}if(qt[0][3]=+P[0][0],qt[1][3]=-P[2][0],qt[2][3]=+P[0][1],qt[3][3]=-P[2][1],qt[4][3]=+B,qt[5][3]=-G,w(qt,h.points))return!0;for(let e=0;e<4;++e){const t=F,r=h.points[e+4];if(Bt(qt,t,r))return!0;const n=h.points[4+(e+1)%4];if(Bt(qt,r,n))return!0}return!1}_isTileVisibleInFrustumGlobal(n){if(n.level<x)return!0;const l=n.spatialReference,m=n.extent;if(!m||!l)return!0;const p=this.opaqueGround&&this._aboveGround,d=this.opaqueGround&&!this._aboveGround,_=P,g=.5*(m[0]+m[2]);if(e(_[0],m[0],m[1],0),e(_[1],m[2],m[1],0),e(_[2],m[2],m[3],0),e(_[3],m[0],m[3],0),e(_[4],g,m[1],0),e(_[5],g,m[3],0),!b(_,l,0,_,this._renderSR,0,6))return!1;const S=_[0][2]>0,F=_[3][2]<0,R=S||F,B=this._renderSREllipsoidRadius;if(R){const t=k;v(t,wt,_[0]);const r=U;if(v(r,wt,_[1]),S){const n=Y,e=_[4],s=H;v(s,e,wt),v(n,s,e);const o=_[0];c(o,t,n),G(o,B);const i=_[1];c(i,r,n),G(i,B)}else if(F){const n=Y,e=_[5],s=H;v(s,e,wt),v(n,e,s);const o=_[3];c(o,n,t),G(o,B);const i=_[2];c(i,n,r),G(i,B)}}const y=T,w=o(O,_[3],_[0]);r(w,w);const I=f(Q,_[0],_[3]);a(I,I,.5);const C=-i(I,w),E=f(X,_[0],_[1]);a(E,E,.5);const W=f(Z,_[2],_[3]);a(W,W,.5);const z=o($,W,E);r(z,z);const st=-(C+i(w,E))/i(w,z);u(y,E,z,st),G(y,B);const lt=this._frustumBoundingSphereRadius,mt=this._frustumBoundingSphereCenter,pt=this._frustum,vt=pt.planes,jt=L;r(jt,y);const Gt=i(_[0],jt)/h(_[0]),Bt=Math.sqrt(1-Gt*Gt),yt=pt.origin,qt=pt.points;let xt=!1;if(p){xt=!0;const t=r(gt,yt);for(let n=0;n<4;++n){const e=qt[4+n],s=o(St,e,yt);r(s,s);const u=c(Mt,t,s);r(u,u);const f=c(Ft,s,u);r(f,f);if(i(yt,f)>B){xt=!1;break}}if(xt){if(i(yt,jt)<B*Gt-_t)return!1}if(i(t,jt)<-Bt)return!1;{const t=r(bt,pt.direction);if(i(t,jt)>Rt)return!1}}if(Bt>.9)return!0;let It=!1;const Vt=i(jt,mt),Ct=h(mt);if(Ct<=lt&&!vt.some(t=>M(t,D)>0)){if(!p)return!0;It=!0}if(!It&&Vt<=0){if(-Vt>lt)return!1}if(!It&&Ct>lt){const r=t(Vt/Ct,-1,1),n=Math.sqrt(1-r*r),e=t(lt/Ct,0,1);if(n*Math.sqrt(1-e*e)-e*r>Bt)return!1}if(!xt){if(_.some(t=>pt.intersectsPoint(t)))return!0;if(pt.intersectsPoint(y))return!0}const Et=J;o(Et,mt,D);const Pt=i(Et,jt),Tt=A;a(Tt,jt,Pt);const Yt=s(Tt,mt),kt=l.isWGS84,Ut=n.lij,Ht=kt&&Ut[2]===2**Ut[0]-1,Lt=kt&&0===Ut[2],At=Lt?ft:Ht?ut:ot,Wt=Lt?at:Ht?ct:it;if(!It){const t=_,r=ht,n=tt,e=rt,s=D;for(const o of At){const u=t[o];if(j(n,t[(o+1)%4],u),j(e,s,u),v(r,e,n),i(r,jt)>0&&a(r,r,-1),V(r,qt,1))return!1}}let zt=null;if(!p&&Pt<1.01*lt){const t=2.5*lt;if(Yt>Gt*t+lt)return!1;const r=N,n=t/Gt;for(let e=0;e<4;++e)a(r[e],_[e],n/B);e(r[4],0,0,0),zt=r}else{const t=(d?B+_t:Pt+lt)/Gt,r=p?B-_t:(Pt-lt)/Gt,n=K;for(let e=0;e<4;++e){const s=_[e];a(n[e],s,r/B),a(n[e+4],s,t/B)}zt=n}if(q(vt,zt,zt.length))return!1;const Dt=pt.lines,Jt=nt,Kt=et;for(const t of Dt){r(Kt,t.direction);for(const t of Wt){const n=zt[t];if(r(Jt,n),dt(Kt,Jt,zt,qt))return!1;const e=(t+1)%4;if(p){const t=zt[e];if(o(Jt,t,n),r(Jt,Jt),dt(Kt,Jt,zt,qt))return!1}if(d){const n=zt[4+t],s=zt[4+e];if(o(Jt,s,n),r(Jt,Jt),dt(Kt,Jt,zt,qt))return!1}}}return!0}}function v(t,n,e){return c(t,n,e),r(t,t),t}function j(t,n,e){return o(t,n,e),r(t,t),t}function G(t,r){return a(t,t,r/h(t)),t}const B=[0,1,2,3,5];function y(t,r,n){for(let e=0;e<n;++e)if(M(t,r[e])<=0)return!1;return!0}function q(t,r,n){for(const e of B)if(y(t[e],r,n))return!0;return!1}function w(t,r,n=r.length){for(let e=0;e<n;++e){const n=r[e];let s=!0;for(const r of t){if(M(r,n)>0){s=!1;break}}if(s)return!0}return!1}const x=2,I=4;function V(t,r,n){for(const e of r)if(i(e,t)<n)return!1;return!0}const C=[l(),l(),l(),l(),l(),l(),l(),l()],E=[0,0,0,0,0,0],P=[l(),l(),l(),l(),l(),l()],T=l(),Y=l(),k=l(),U=l(),H=l(),L=l(),A=l(),W=l(),z=l(),D=p(0,0,0),J=l(),K=[l(),l(),l(),l(),l(),l(),l(),l()],N=[l(),l(),l(),l(),l()],O=l(),Q=l(),X=l(),Z=l(),$=l(),tt=l(),rt=l(),nt=l(),et=l(),st=l(),ot=[0,1,2,3],it=[0,1,2,3],ut=[0,1,3],ct=[0,1,3],ft=[1,2,3],at=[1,2,3],ht=l();function lt(t,r,n){let e=1/0,s=-1/0;for(const o of n){const t=i(r,o);e=Math.min(e,t),s=Math.max(s,t)}t[0]=e,t[1]=s}function mt(t,r,n,e){let s=1/0,o=-1/0;for(const u of e){const e=i(n,u);if(s=Math.min(s,e),o=Math.max(o,e),s<=r&&o>=t)return!1}return!0}const pt=[0,0];function dt(t,r,n,e){const s=n.length,o=e.length;if(0===s||0===o)return!0;const i=st;v(i,t,r);const u=o<s,c=u?n:e,f=pt;return lt(f,i,u?e:n),mt(f[0],f[1],i,c)}const _t=430,gt=l(),bt=l(),St=l(),Mt=l(),Ft=l(),Rt=Math.cos(.25*Math.PI),vt=m(0,0,1),jt=l();function Gt(t,r,n){const e={t0:0,t1:1};for(const s of B){if(!yt(t[s],r,n,e))return!1}return e.t0<e.t1}function Bt(t,r,n){const e={t0:0,t1:1};for(const s of t){if(!yt(s,r,n,e))return!1}return e.t0<e.t1}function yt(t,r,n,e){let{t0:s,t1:o}=e;const i=M(t,r),u=M(t,n);if(i>=0&&u>=0)return!1;if(i<0&&u>=0){const t=-i/(u-i);if(t<s)return!1;t<o&&(o=t)}else if(i>=0&&u<0){const t=i/(i-u);if(t>o)return!1;t>s&&(s=t)}return e.t0=s,e.t1=o,!0}const qt=[S(-1,0,0,1),S(1,0,0,-1),S(0,-1,0,1),S(0,1,0,-1),S(0,0,-1,1),S(0,0,1,-1)],wt=p(0,0,1),xt=1;export{R as FeatureTileVisibility3D,w as isAnyVertexInPolyhedron,q as isConvexHullOutsideOfFrustum,I as maxLODLevelDelta,x as minTileLOD};
2
+ import{normalize as t,copy as r,set as e,dist as o,sub as s,dot as i,scaleAndAdd as n,scale as c,cross as u,len as a,direction as f,crossAndNormalize as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h,fromValues as m,freeze as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as _}from"../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBuffer as b}from"../../../../geometry/projection/projectBuffer.js";import{projectVec3Array as g}from"../../../../geometry/projection/projectVec3Array.js";import{isAnyVertexInPolyhedron as j,edgeIntersectsPolyhedron as v}from"../../../../geometry/support/convexPolyhedron.js";import{isConvexHullOutsideOfFrustum as M,edgeIntersectsFrustum as y}from"../../../../geometry/support/frustum.js";import{fromValues as F,signedDistance as G}from"../../../../geometry/support/plane.js";import{Frustum as R}from"../../state/Frustum.js";import{sphereIntersectsInfiniteRadialConeConservative as x}from"../../support/ElevationAgnosticVisibility.js";import{correctSphericalTileCornersForLatitude as V,computeSmallestSphericalTileCone as w,getSphericalTilePole as I}from"../../support/sphericalTileUtils.js";class S{constructor(t,r){this._renderCoordsHelper=t,this.opaqueGround=r,this._cache=new Map,this._cameraForward=h(),this._cameraEye=h(),this._cameraFovY=55*Math.PI/180,this._frustum=new R(t),this._renderSR=t.spatialReference;const e=_(this._renderSR);this._renderSREllipsoidRadius=d(e).radius}setup(e){this._aboveGround=e.aboveGround,this._frustum.update(e),t(this._cameraForward,e.viewForward),r(this._cameraEye,e.eye),this._cameraFovY=e.fovY}done(){this._cache.clear()}compute(t){if(this._cache.has(t.id))return this._cache.get(t.id);const r=this._isVisibleInFrustum(t);return this._cache.set(t.id,r),r}_isVisibleInFrustum(t){return 2===this._renderCoordsHelper.viewingMode?this._isTileVisibleInFrustumLocal(t):this._isTileVisibleInFrustumGlobal(t)}_isTileVisibleInFrustumLocal(t){const r=t.spatialReference,c=t.extent,u=this._renderSR;if(!c)return!0;if(Y[0]=c[0],Y[1]=c[1],Y[2]=0,Y[3]=c[2],Y[4]=c[3],Y[5]=0,!b(Y,r,0,Y,u,0))return!1;e(U[0],Y[0],Y[1],0),e(U[1],Y[3],Y[1],0),e(U[2],Y[3],Y[4],0),e(U[3],Y[0],Y[4],0),e(k,.5*(Y[0]+Y[3]),.5*(Y[1]+Y[4]),.5*(Y[2]+Y[5]));const a=dt,f=.5*o(U[0],U[2]),l=this._frustum,{center:h,radius:m}=l.boundingSphere,p=m+gt,d=L;s(d,h,k);const _=i(a,d),g=H;n(g,k,a,_);if(o(g,h)>f+p)return!1;const F=this._cameraForward,G=i(F,dt),R=this._cameraFovY,x=this._cameraEye;if(Math.abs(G)<Math.abs(Math.cos(.5*R))){let t=!0;const r=e(_t,F[0],F[1],0),o=i(x,r);for(let e=0;e<4;++e){const s=U[e];if(i(s,r)-o>0){t=!1;break}}if(t)return!1}{const t=U[0],r=U[2];if(t[0]<=x[0]&&x[0]<=r[0]&&t[1]<=x[1]&&x[1]<=r[1])return!0}const V=T,w=this.opaqueGround&&this._aboveGround,I=this.opaqueGround&&!this._aboveGround,S=Math.min(I?ut:1/0,_+p),E=Math.max(w?-ut:-1/0,_-p);for(let e=0;e<4;++e)n(V[e],U[e],a,S),n(V[e+4],U[e],a,E);if(M(l.planes,V,8))return!1;if(j(l.planes,V,8))return!0;for(let e=0;e<4;++e){const t=V[e],r=V[e+4];if(y(l.planes,t,r))return!0;const o=V[(e+1)%4];if(y(l.planes,t,o))return!0;const s=V[4+(e+1)%4];if(y(l.planes,r,s))return!0}if(bt[0][3]=+U[0][0],bt[1][3]=-U[2][0],bt[2][3]=+U[0][1],bt[3][3]=-U[2][1],bt[4][3]=+E,bt[5][3]=-S,j(bt,l.points))return!0;for(let e=0;e<4;++e){const t=x,r=l.points[e+4];if(v(bt,t,r))return!0;const o=l.points[4+(e+1)%4];if(v(bt,r,o))return!0}return!1}_isTileVisibleInFrustumGlobal(r){if(r.level<E)return!0;const n=r.spatialReference,h=r.extent;if(!h||!n)return!0;const m=this.opaqueGround&&this._aboveGround,p=this.opaqueGround&&!this._aboveGround,d=U,_=.5*(h[0]+h[2]);if(e(d[0],h[0],h[1],0),e(d[1],h[2],h[1],0),e(d[2],h[2],h[3],0),e(d[3],h[0],h[3],0),e(d[4],_,h[1],0),e(d[5],_,h[3],0),!g(d,n,0,d,this._renderSR,0,6))return!1;const b=this._renderSREllipsoidRadius;V(d,b);const j=k,v=this._frustum,{center:y,radius:F}=v.boundingSphere,R=F+gt,S=v.planes,q=A,T=w(d[0],d[1],d[2],d[3],q);c(j,q,b);const Y=Math.sqrt(1-T*T),H=v.origin,L=v.points;let W=!1;if(m){W=!0;const r=t(at,H);for(let e=0;e<4;++e){const o=L[4+e],n=s(lt,o,H);t(n,n);const c=u(ht,r,n);t(c,c);const a=u(mt,n,c);t(a,a);if(i(H,a)>b){W=!1;break}}if(W){if(i(H,q)<b*Y-ut)return!1}if(i(r,q)<-T)return!1;{const r=t(ft,v.direction);if(i(r,q)>pt)return!1}}if(T>.9)return!0;let st=!1;if(a(y)<=R&&!S.some(t=>G(t,B)>0)){if(!m)return!0;st=!0}if(!st&&!x(q,T,y,R))return!1;if(!W){if(d.some(t=>v.intersectsPoint(t)))return!0;if(v.intersectsPoint(j))return!0}const it=z;s(it,y,B);const nt=i(it,q),dt=C;c(dt,q,nt);const _t=o(dt,y),bt=I(r.lij,n),jt=1===bt||3===bt,vt=2===bt||3===bt,Mt=vt?rt:jt?$:X,yt=vt?et:jt?tt:Z;if(!st){const t=d,r=ot,e=K,o=N,s=B;for(const n of Mt){const u=t[n],a=t[(n+1)%4];if(f(e,a,u),f(o,s,u),l(r,o,e),i(r,q)>0&&c(r,r,-1),P(r,L,1))return!1}}let Ft=null;if(!m&&nt<1.01*R){const t=2.5*R;if(_t>Y*t+R)return!1;const r=J,o=t/Y;for(let e=0;e<4;++e)c(r[e],d[e],o/b);e(r[4],0,0,0),Ft=r}else{const t=(p?b+ut:nt+R)/Y,r=m?b-ut:(nt-R)/Y,e=D;for(let o=0;o<4;++o){const s=d[o];c(e[o],s,r/b),c(e[o+4],s,t/b)}Ft=e}if(M(v.planes,Ft,Ft.length))return!1;const Gt=v.lines,Rt=O,xt=Q;for(const e of Gt){t(xt,e.direction);for(const r of yt){const e=Ft[r];if(t(Rt,e),ct(xt,Rt,Ft,L))return!1;const o=(r+1)%4;if(m){const r=Ft[o];if(s(Rt,r,e),t(Rt,Rt),ct(xt,Rt,Ft,L))return!1}if(p){const e=Ft[4+r],i=Ft[4+o];if(s(Rt,i,e),t(Rt,Rt),ct(xt,Rt,Ft,L))return!1}}}return!0}}const E=2,q=4;function P(t,r,e){for(const o of r)if(i(o,t)<e)return!1;return!0}const T=[h(),h(),h(),h(),h(),h(),h(),h()],Y=[0,0,0,0,0,0],U=[h(),h(),h(),h(),h(),h()],k=h(),A=h(),C=h(),H=h(),L=h(),B=p(0,0,0),z=h(),D=[h(),h(),h(),h(),h(),h(),h(),h()],J=[h(),h(),h(),h(),h()],K=h(),N=h(),O=h(),Q=h(),W=h(),X=[0,1,2,3],Z=[0,1,2,3],$=[0,1,3],tt=[0,1,3],rt=[1,2,3],et=[1,2,3],ot=h();function st(t,r,e){let o=1/0,s=-1/0;for(const n of e){const t=i(r,n);o=Math.min(o,t),s=Math.max(s,t)}t[0]=o,t[1]=s}function it(t,r,e,o){let s=1/0,n=-1/0;for(const c of o){const o=i(e,c);if(s=Math.min(s,o),n=Math.max(n,o),s<=r&&n>=t)return!1}return!0}const nt=[0,0];function ct(t,r,e,o){const s=e.length,i=o.length;if(0===s||0===i)return!0;const n=W;l(n,t,r);const c=i<s,u=c?e:o,a=nt;return st(a,n,c?o:e),it(a[0],a[1],n,u)}const ut=430,at=h(),ft=h(),lt=h(),ht=h(),mt=h(),pt=Math.cos(.25*Math.PI),dt=m(0,0,1),_t=h(),bt=[F(-1,0,0,1),F(1,0,0,-1),F(0,-1,0,1),F(0,1,0,-1),F(0,0,-1,1),F(0,0,1,-1)],gt=1;export{S as FeatureTileVisibility3D,q as maxLODLevelDelta,E as minTileLOD};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../../../../core/arrayUtils.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{estimateFixedArrayMemory as a,estimateNumberMemory as s,estimateAttributesMemory as o}from"../../../../core/memoryEstimations.js";import{EsriPromise as n}from"../../../../core/Promise.js";import{initial as l,sync as d,watch as p}from"../../../../core/reactiveUtils.js";import{pt2px as u}from"../../../../core/screenUtils.js";import{property as h,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{projectPointToVector as _}from"../../../../geometry/projection/projectPointToVector.js";import{getContinuousIndexArray as g}from"../../../../geometry/support/Indices.js";import{getResolutionForScale as f}from"../../../../geometry/support/scaleUtils.js";import{getObjectId as F}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromPoint as R}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as v}from"../../../../layers/graphics/OptimizedFeature.js";import b from"../../../../layers/graphics/data/FeatureStore.js";import{isNumericField as w}from"../../../../layers/support/fieldUtils.js";import{generateGradient as S}from"../../../../renderers/support/heatmapUtils.js";import{DisplayFeatureLimit as P}from"../graphics/DisplayFeatureLimit.js";import{GraphicsCorePerformanceInfo as j}from"../graphics/GraphicsCorePerformanceInfo.js";import{FeatureVisibilityFilter as G}from"./FeatureVisibilityFilter.js";import{emptyHighlightHandle as V}from"./highlightUtils.js";import{Attribute as x}from"../../webgl-engine/lib/Attribute.js";import{DrapedHeatmapRenderer as M}from"../../webgl-engine/lib/DrapedHeatmapRenderer.js";import{Geometry as T}from"../../webgl-engine/lib/Geometry.js";import{GeometryBaseInstance as I}from"../../webgl-engine/lib/GeometryBaseInstance.js";import{RenderGeometry as N}from"../../webgl-engine/lib/RenderGeometry.js";import{HeatmapDensityMaterial as A}from"../../webgl-engine/materials/HeatmapDensityMaterial.js";import{scaleBoundsPredicate as H,isScaleRangeActive as U}from"../../../support/layerViewUtils.js";import{PixelType as L}from"../../../webgl/enums.js";import{loadHeatmapTextureConfiguration as O,fallBackHeatmapConfiguration as C}from"../../../webgl/heatmapTextureUtils.js";const D=112;let E=class extends n{constructor(e){super(e),this.type="heatmap",this.preferredUpdatePolicy=0,this.dataExtent=null,this.drapeSourceType=1,this._renderGeometries=new Map,this._fieldTotal=0,this._drapeSourceRenderer=null,this._dataType=L.HALF_FLOAT,this._pixelFormat=6408,this._baseInstance=new I([]),this._updatingHandles=new y}initialize(){let e;try{e=O(this._renderView.renderingContext,i.getLogger(this))}catch(m){this.addResolvingPromise(Promise.reject(m)),e=C}const{dataType:t,samplingMode:a,pixelFormat:s,internalFormat:o}=e;this._featureStore=new b({geometryType:"esriGeometryPoint",hasZ:this.hasZ,hasM:this.hasM}),this._dataType=t,this._pixelFormat=s;const n=t!==L.FLOAT,u=this.view.overlayManager,h={...this._rendererParameters,stage:this.view.stage,dataType:t,samplingMode:a,pixelFormat:s,internalFormat:o,rendererContext:u.renderer,drapeSource:this};this._drapeSourceRenderer=new M(h),u.registerDrapeSource(this,this._drapeSourceRenderer),this._material=new A({usesHalfFloats:n}),this._materialWithField=new A({usesHalfFloats:n,isAttributeDriven:!0}),this._filterVisibility=new G({context:{configuration:this.owner,featureStore:this.featureStore,getFeatureCount:()=>this._loadedPointGraphics.length,setAllFeaturesVisibility:e=>this._setAllFeaturesVisibility(e),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:e=>this._updateFeatureVisibilities(e)}}),this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,e=>this._onLoadedFeaturesChange(e),l),this._updatingHandles.addWhen(()=>this._materialParameters,e=>this._forEachMaterial(t=>t.setParameters(e)),l),this._updatingHandles.add(()=>this._rendererParameters,e=>this._drapeSourceRenderer.set(e)),this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},d),this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:e,numeric:t})=>{if(null!=e&&t){let t=0;this._featureStore.forEach(r=>t+=r.attributes[e]??0),this._fieldTotal=t}else this._fieldTotal=this._featureStore.numFeatures},l),this.addHandles([p(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:e,field:t})=>{e&&!t&&i.getLogger(this).warn(`Heatmap renderer field '${e}' for layer '${this.layer.title??this.layer.id}' not found`)}),p(()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:e,numeric:t})=>{null==e||t||i.getLogger(this).warn(`Heatmap renderer field '${e.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),r(()=>this.view.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear(),this._material=null,this._materialWithField=null,this._featureStore.clear(),this._featureStore=null,this._updatingHandles.destroy(),this._baseInstance=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){const e=this.owner?.view?.quality??1,t=this.owner?.view?.qualitySettings,r=t?Math.ceil(t.graphics3D.maxTotalNumberOfFeatures*e):0;return new P(r*6,r)}get hasZ(){return"hasZ"in this.layer&&!0===this.layer.hasZ}get hasM(){return"hasM"in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange,{scale:r}=this.view;return!H(r,e??0,t??0)}get usedMemory(){const e=this.usedMemoryPerFeature*this._featureStore.numFeatures,t=6403===this._pixelFormat?1:4,r=this._dataType===L.FLOAT?4:2,i=Math.ceil((this._overlayRenderer?.overlays[0]?.resolution??0)*this._densityMapPixelRatio)??0;return i*i*t*r+e+W}get usedMemoryPerFeature(){const e=this._loadedPointGraphics.find(()=>!0);if(null==e)return 0;const t=o(e);return a([0,0],s)+(this._heatmapRendererFieldIsNumeric?s:0)+t}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return new j(this._renderGeometries.size,this._visibleFeatures,0,0)}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.overlayManager.renderer}get _overlaySpatialReference(){return this.view.overlayManager.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){const e=this._heatmapRenderer;if(null==e)return null;const{minDensity:t,maxDensity:r}=e;return{minDensity:t,maxDensity:r,fieldTotal:this._fieldTotal}}get _radiusParameter(){const e=this._heatmapRenderer;return e?{searchRadius:u(this._clampSearchRadius(e.radius))}:null}get _resolutionForScaleParameter(){const e=this._heatmapRenderer;if(!e)return null;const{referenceScale:t}=e;return{resolutionForScale:0===t?0:f(t,this.view.spatialReference)}}get _colorRampParameter(){const e=this._heatmapRenderer;return e?{colorRampData:S(e.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){return this.owner?.view?.qualitySettings.heatmap.pixelRatio??1}get _renderView(){return this.view.stage.renderView}get _featuresArePoints(){return"point"===this.layer.geometryType}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){const e=this.layer.renderer;return"heatmap"===e?.type?e:null}get _heatmapRendererFieldName(){return this._heatmapRenderer?.field}get _heatmapRendererField(){const e=this._heatmapRendererFieldName;return null!=e?this.layer.fieldsIndex.get(e):null}get _heatmapRendererFieldIsNumeric(){const e=this._heatmapRendererField;return null!=e&&w(e)}get _isScaleRangeActive(){const{layer:e}=this;if(!("effectiveScaleRange"in e))return!1;const{minScale:t,maxScale:r}=e.effectiveScaleRange;return U(t,r)}get _visibleFeatures(){return this._renderGeometries.values().reduce((e,{visible:t})=>e+(t?1:0),0)}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlightByGraphics(){return V}highlightByObjectIds(){return V}maskOccludee(){return r()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(e){if(!this._featuresArePoints)return;const{objectIdField:r}=this.layer;this._featureStore.removeManyById(e.removed.map(e=>F(e,r))),this._featureStore.addMany(e.added.map(e=>{const{attributes:t,centroid:i,geometry:a}=e,s=new v(R(a),t,i?R(i):null,F(e,r));return s.displayId=e.uid,s}));const i=e.added,a=e.removed;this._fieldTotal+=this._computeFieldTotalChange(i,a);const s=a.map(({uid:e})=>{const t=this._renderGeometries.get(e);return this._renderGeometries.delete(e),t}).filter(t),o=i.map(e=>{const t=this._pointGraphicToRenderGeometry(e);return this._renderGeometries.set(e.uid,t),t});s.length>0&&this._drapeSourceRenderer.removeGeometries(s,2),o.length>0&&this._drapeSourceRenderer.addGeometries(o,0),(o.length>0||s.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;const e=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:e,removed:e})}_pointGraphicToRenderGeometry(e){const t=this._heatmapRendererFieldName,r=null!=t?this._materialWithField:this._material,i=c();_(e.geometry,i,this._overlaySpatialReference);const a=g(1),s=[["position",new x([i[0],i[1]],a,2)]],o=this._heatmapRendererFieldIsNumeric;null!=t&&s.push(["featureAttribute",new x([o?e.attributes[t]??0:0],a,1)]);const n=new N(new T(r,s,null,1,void 0,this._baseInstance),{layerViewUid:this.owner.layerViewUid,graphicUid:e.uid});return n.visible=this.filterVisibility.defaultVisibility,n}_forEachMaterial(e){e(this._material),e(this._materialWithField)}_computeFieldTotalChange(e,t){if(null==this._heatmapRendererFieldName||!this._heatmapRendererFieldIsNumeric)return e.length-t.length;const r=this._heatmapRendererFieldName,i=(e,t)=>e+(t.attributes[r]??0);return e.reduce(i,0)-t.reduce(i,0)}_clampSearchRadius(e){return e>D&&i.getLogger(this).warnOnce(`SceneView supports a maximum radius of ${D} pt for HeatmapRenderer.`),Math.min(e,D)}_updateFeatureVisibilities(e){const t=[];this._featureStore.forEach(({objectId:r,displayId:i})=>{const a=e(r),s=this._renderGeometries.get(i);s&&s.visible!==a&&(t.push(s),s.visible=a)}),this._drapeSourceRenderer.modifyGeometries(t,1)}_setAllFeaturesVisibility(e){const t=[];for(const r of this._renderGeometries.values())r.visible!==e&&(t.push(r),r.visible=e);this._drapeSourceRenderer.modifyGeometries(t,1)}get test(){}};e([h()],E.prototype,"type",void 0),e([h({constructOnly:!0})],E.prototype,"owner",void 0),e([h()],E.prototype,"layer",null),e([h()],E.prototype,"featureStore",null),e([h()],E.prototype,"updating",null),e([h()],E.prototype,"updatingRemaining",null),e([h()],E.prototype,"suspendInfo",null),e([h()],E.prototype,"legendEnabled",null),e([h()],E.prototype,"filterVisibility",null),e([h()],E.prototype,"displayFeatureLimit",null),e([h()],E.prototype,"preferredUpdatePolicy",void 0),e([h()],E.prototype,"hasZ",null),e([h()],E.prototype,"hasM",null),e([h()],E.prototype,"dataExtent",void 0),e([h()],E.prototype,"view",null),e([h()],E.prototype,"fullOpacity",null),e([h()],E.prototype,"updatePolicy",null),e([h()],E.prototype,"drapeSourceType",void 0),e([h()],E.prototype,"scaleVisibilitySuspended",null),e([h()],E.prototype,"renderer",null),e([h()],E.prototype,"_featureStore",void 0),e([h()],E.prototype,"_filterVisibility",void 0),e([h()],E.prototype,"_overlayRenderer",null),e([h()],E.prototype,"_overlaySpatialReference",null),e([h()],E.prototype,"_rendererParameters",null),e([h()],E.prototype,"_materialParameters",null),e([h()],E.prototype,"_densityParameters",null),e([h()],E.prototype,"_radiusParameter",null),e([h()],E.prototype,"_resolutionForScaleParameter",null),e([h()],E.prototype,"_colorRampParameter",null),e([h()],E.prototype,"_pixelRatioParameter",null),e([h()],E.prototype,"_densityMapPixelRatio",null),e([h()],E.prototype,"_renderGeometries",void 0),e([h()],E.prototype,"_material",void 0),e([h()],E.prototype,"_materialWithField",void 0),e([h()],E.prototype,"_renderView",null),e([h()],E.prototype,"_featuresArePoints",null),e([h()],E.prototype,"_loadedPointGraphics",null),e([h()],E.prototype,"_heatmapRenderer",null),e([h()],E.prototype,"_heatmapRendererFieldName",null),e([h()],E.prototype,"_heatmapRendererField",null),e([h()],E.prototype,"_heatmapRendererFieldIsNumeric",null),e([h()],E.prototype,"_fieldTotal",void 0),e([h()],E.prototype,"_drapeSourceRenderer",void 0),e([h()],E.prototype,"_isScaleRangeActive",null),E=e([m("esri.views.3d.layers.support.HeatmapFeatureProcessor")],E);const W=a([0,0,0,0,0,0,0,0],s);export{E as HeatmapFeatureProcessor,D as maxRadiusPt};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../../../core/arrayUtils.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{estimateFixedArrayMemory as a,estimateNumberMemory as s,estimateAttributesMemory as o}from"../../../../core/memoryEstimations.js";import{EsriPromise as n}from"../../../../core/Promise.js";import{initial as l,sync as d,watch as p}from"../../../../core/reactiveUtils.js";import{pt2px as u}from"../../../../core/screenUtils.js";import{property as h,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{projectPointToVector as _}from"../../../../geometry/projection/projectPointToVector.js";import{getContinuousIndexArray as g}from"../../../../geometry/support/Indices.js";import{getResolutionForScale as f}from"../../../../geometry/support/scaleUtils.js";import{getObjectId as F}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromPoint as R}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as v}from"../../../../layers/graphics/OptimizedFeature.js";import b from"../../../../layers/graphics/data/FeatureStore.js";import{isNumericField as w}from"../../../../layers/support/fieldUtils.js";import{generateGradient as S}from"../../../../renderers/support/heatmapUtils.js";import{DisplayFeatureLimit as P}from"../graphics/DisplayFeatureLimit.js";import{GraphicsCorePerformanceInfo as j}from"../graphics/GraphicsCorePerformanceInfo.js";import{FeatureVisibilityFilter as G}from"./FeatureVisibilityFilter.js";import{emptyHighlightHandle as V}from"./highlightUtils.js";import{Attribute as x}from"../../webgl-engine/lib/Attribute.js";import{DrapedHeatmapRenderer as M}from"../../webgl-engine/lib/DrapedHeatmapRenderer.js";import{Geometry as T}from"../../webgl-engine/lib/Geometry.js";import{GeometryBaseInstance as I}from"../../webgl-engine/lib/GeometryBaseInstance.js";import{RenderGeometry as N}from"../../webgl-engine/lib/RenderGeometry.js";import{HeatmapDensityMaterial as A}from"../../webgl-engine/materials/HeatmapDensityMaterial.js";import{scaleBoundsPredicate as H,isScaleRangeActive as U}from"../../../support/layerViewUtils.js";import{PixelType as L}from"../../../webgl/enums.js";import{loadHeatmapTextureConfiguration as O,fallBackHeatmapConfiguration as C}from"../../../webgl/heatmapTextureUtils.js";const D=112;let E=class extends n{constructor(e){super(e),this.type="heatmap",this.preferredUpdatePolicy=0,this.dataExtent=null,this.drapeSourceType=1,this._renderGeometries=new Map,this._fieldTotal=0,this._drapeSourceRenderer=null,this._dataType=L.HALF_FLOAT,this._pixelFormat=6408,this._baseInstance=new I([]),this._updatingHandles=new y}initialize(){let e;try{e=O(this._renderView.renderingContext,i.getLogger(this))}catch(m){this.addResolvingPromise(Promise.reject(m)),e=C}const{dataType:t,samplingMode:a,pixelFormat:s,internalFormat:o}=e;this._featureStore=new b({geometryType:"esriGeometryPoint",hasZ:this.hasZ,hasM:this.hasM}),this._dataType=t,this._pixelFormat=s;const n=t!==L.FLOAT,u=this.view.overlayManager,h={...this._rendererParameters,stage:this.view.stage,dataType:t,samplingMode:a,pixelFormat:s,internalFormat:o,rendererContext:u.renderer,drapeSource:this};this._drapeSourceRenderer=new M(h),u.registerDrapeSource(this,this._drapeSourceRenderer),this._material=new A({usesHalfFloats:n}),this._materialWithField=new A({usesHalfFloats:n,isAttributeDriven:!0}),this._filterVisibility=new G({context:{configuration:this.owner,featureStore:this.featureStore,getFeatureCount:()=>this._loadedPointGraphics.length,setAllFeaturesVisibility:e=>this._setAllFeaturesVisibility(e),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:e=>this._updateFeatureVisibilities(e)}}),this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,e=>this._onLoadedFeaturesChange(e),l),this._updatingHandles.addWhen(()=>this._materialParameters,e=>this._forEachMaterial(t=>t.setParameters(e)),l),this._updatingHandles.add(()=>this._rendererParameters,e=>this._drapeSourceRenderer.set(e)),this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},d),this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:e,numeric:t})=>{if(null!=e&&t){let t=0;this._featureStore.forEach(r=>t+=r.attributes[e]??0),this._fieldTotal=t}else this._fieldTotal=this._featureStore.numFeatures},l),this.addHandles([p(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:e,field:t})=>{e&&!t&&i.getLogger(this).warn(`Heatmap renderer field '${e}' for layer '${this.layer.title??this.layer.id}' not found`)}),p(()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:e,numeric:t})=>{null==e||t||i.getLogger(this).warn(`Heatmap renderer field '${e.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),r(()=>this.view.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear(),this._material=null,this._materialWithField=null,this._featureStore.clear(),this._featureStore=null,this._updatingHandles.destroy(),this._baseInstance=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){const e=this.owner?.view?.quality??1,t=this.owner?.view?.qualitySettings,r=t?Math.ceil(t.graphics3D.maxTotalNumberOfFeatures*e):0;return new P(r*6,r)}get hasZ(){return"hasZ"in this.layer&&!0===this.layer.hasZ}get hasM(){return"hasM"in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange,{scale:r}=this.view;return!H(r,e??0,t??0)}get usedMemory(){const e=this.usedMemoryPerFeature*this._featureStore.numFeatures,t=6403===this._pixelFormat?1:4,r=this._dataType===L.FLOAT?4:2,i=Math.ceil((this._overlayRenderer?.overlays[0]?.resolution??0)*this._densityMapPixelRatio)??0;return i*i*t*r+e+W}get usedMemoryPerFeature(){const e=this._loadedPointGraphics.find(()=>!0);if(null==e)return 0;const t=o(e);return a([0,0],s)+(this._heatmapRendererFieldIsNumeric?s:0)+t}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return new j(this._renderGeometries.size,this._visibleFeatures,0,0)}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.overlayManager.renderer}get _overlaySpatialReference(){return this.view.overlayManager.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){const e=this._heatmapRenderer;if(null==e)return null;const{minDensity:t,maxDensity:r}=e;return{minDensity:t,maxDensity:r,fieldTotal:this._fieldTotal}}get _radiusParameter(){const e=this._heatmapRenderer;return e?{searchRadius:u(this._clampSearchRadius(e.radius))}:null}get _resolutionForScaleParameter(){const e=this._heatmapRenderer;if(!e)return null;const{referenceScale:t}=e;return{resolutionForScale:0===t?0:f(t,this.view.spatialReference)}}get _colorRampParameter(){const e=this._heatmapRenderer;return e?{colorRampData:S(e.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){return this.owner?.view?.qualitySettings.heatmap.pixelRatio??1}get _renderView(){return this.view.stage.renderView}get _featuresArePoints(){return"point"===this.layer.geometryType}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){const e=this.layer.renderer;return"heatmap"===e?.type?e:null}get _heatmapRendererFieldName(){return this._heatmapRenderer?.field}get _heatmapRendererField(){const e=this._heatmapRendererFieldName;return null!=e?this.layer.fieldsIndex.get(e):null}get _heatmapRendererFieldIsNumeric(){const e=this._heatmapRendererField;return null!=e&&w(e)}get _isScaleRangeActive(){const{layer:e}=this;if(!("effectiveScaleRange"in e))return!1;const{minScale:t,maxScale:r}=e.effectiveScaleRange;return U(t,r)}get _visibleFeatures(){return this._renderGeometries.values().reduce((e,{visible:t})=>e+(t?1:0),0)}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlightByGraphics(){return V}highlightByObjectIds(){return V}maskOccludee(){return r()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(e){if(!this._featuresArePoints)return;const{objectIdField:r}=this.layer;this._featureStore.removeManyById(e.removed.map(e=>F(e,r))),this._featureStore.addMany(e.added.map(e=>{const{attributes:t,centroid:i,geometry:a}=e,s=new v(R(a),t,i?R(i):null,F(e,r));return s.displayId=e.uid,s}));const i=e.added,a=e.removed;this._fieldTotal+=this._computeFieldTotalChange(i,a);const s=a.map(({uid:e})=>{const t=this._renderGeometries.get(e);return this._renderGeometries.delete(e),t}).filter(t),o=i.map(e=>{const t=this._pointGraphicToRenderGeometry(e);return this._renderGeometries.set(e.uid,t),t});s.length>0&&this._drapeSourceRenderer.removeGeometries(s,2),o.length>0&&this._drapeSourceRenderer.addGeometries(o,0),(o.length>0||s.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;const e=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:e,removed:e})}_pointGraphicToRenderGeometry(e){const t=this._heatmapRendererFieldName,r=null!=t?this._materialWithField:this._material,i=c();_(e.geometry,i,this._overlaySpatialReference);const a=g(1),s=[["position",new x([i[0],i[1]],a,2)]],o=this._heatmapRendererFieldIsNumeric;null!=t&&s.push(["featureAttribute",new x([o?e.attributes[t]??0:0],a,1)]);const n=new N(new T(r,s,null,void 0,this._baseInstance),{layerViewUid:this.owner.layerViewUid,graphicUid:e.uid});return n.visible=this.filterVisibility.defaultVisibility,n}_forEachMaterial(e){e(this._material),e(this._materialWithField)}_computeFieldTotalChange(e,t){if(null==this._heatmapRendererFieldName||!this._heatmapRendererFieldIsNumeric)return e.length-t.length;const r=this._heatmapRendererFieldName,i=(e,t)=>e+(t.attributes[r]??0);return e.reduce(i,0)-t.reduce(i,0)}_clampSearchRadius(e){return e>D&&i.getLogger(this).warnOnce(`SceneView supports a maximum radius of ${D} pt for HeatmapRenderer.`),Math.min(e,D)}_updateFeatureVisibilities(e){const t=[];this._featureStore.forEach(({objectId:r,displayId:i})=>{const a=e(r),s=this._renderGeometries.get(i);s&&s.visible!==a&&(t.push(s),s.visible=a)}),this._drapeSourceRenderer.modifyGeometries(t,1)}_setAllFeaturesVisibility(e){const t=[];for(const r of this._renderGeometries.values())r.visible!==e&&(t.push(r),r.visible=e);this._drapeSourceRenderer.modifyGeometries(t,1)}get test(){}};e([h()],E.prototype,"type",void 0),e([h({constructOnly:!0})],E.prototype,"owner",void 0),e([h()],E.prototype,"layer",null),e([h()],E.prototype,"featureStore",null),e([h()],E.prototype,"updating",null),e([h()],E.prototype,"updatingRemaining",null),e([h()],E.prototype,"suspendInfo",null),e([h()],E.prototype,"legendEnabled",null),e([h()],E.prototype,"filterVisibility",null),e([h()],E.prototype,"displayFeatureLimit",null),e([h()],E.prototype,"preferredUpdatePolicy",void 0),e([h()],E.prototype,"hasZ",null),e([h()],E.prototype,"hasM",null),e([h()],E.prototype,"dataExtent",void 0),e([h()],E.prototype,"view",null),e([h()],E.prototype,"fullOpacity",null),e([h()],E.prototype,"updatePolicy",null),e([h()],E.prototype,"drapeSourceType",void 0),e([h()],E.prototype,"scaleVisibilitySuspended",null),e([h()],E.prototype,"renderer",null),e([h()],E.prototype,"_featureStore",void 0),e([h()],E.prototype,"_filterVisibility",void 0),e([h()],E.prototype,"_overlayRenderer",null),e([h()],E.prototype,"_overlaySpatialReference",null),e([h()],E.prototype,"_rendererParameters",null),e([h()],E.prototype,"_materialParameters",null),e([h()],E.prototype,"_densityParameters",null),e([h()],E.prototype,"_radiusParameter",null),e([h()],E.prototype,"_resolutionForScaleParameter",null),e([h()],E.prototype,"_colorRampParameter",null),e([h()],E.prototype,"_pixelRatioParameter",null),e([h()],E.prototype,"_densityMapPixelRatio",null),e([h()],E.prototype,"_renderGeometries",void 0),e([h()],E.prototype,"_material",void 0),e([h()],E.prototype,"_materialWithField",void 0),e([h()],E.prototype,"_renderView",null),e([h()],E.prototype,"_featuresArePoints",null),e([h()],E.prototype,"_loadedPointGraphics",null),e([h()],E.prototype,"_heatmapRenderer",null),e([h()],E.prototype,"_heatmapRendererFieldName",null),e([h()],E.prototype,"_heatmapRendererField",null),e([h()],E.prototype,"_heatmapRendererFieldIsNumeric",null),e([h()],E.prototype,"_fieldTotal",void 0),e([h()],E.prototype,"_drapeSourceRenderer",void 0),e([h()],E.prototype,"_isScaleRangeActive",null),E=e([m("esri.views.3d.layers.support.HeatmapFeatureProcessor")],E);const W=a([0,0,0,0,0,0,0,0],s);export{E as HeatmapFeatureProcessor,D as maxRadiusPt};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{copy as o,distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as n,dot as a,crossAndNormalize as h,scale as l,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as m,fromPositionAndNormal as d}from"../../../../geometry/support/plane.js";import{Sphere as u}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as P,applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as C}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as f}from"./InteractiveController.js";import{ropePullMaxElevation as v,findSphereHorizonY as S,computeHorizonPaddingLimits as z,findPlaneHorizonY as w,findGlobalModeRopePullGrabLocation as b,findLocalModeRopePullGrabLocation as j,ropePullYSpeedMultiplier as y,ropePullXSpeedMultiplier as R}from"../utils/ropePullUtils.js";import T from"../../webgl/RenderCamera.js";let H=class extends f{constructor(t){super(t),this._validState=!0,this._adjustedScenePoint=c(),this._referenceSphere=new u,this._referencePlane=m(),this._tmp3d=c(),this._screenPointArray=i(),this._forwardRopeComponent=c(),this._sidewaysRopeComponent=c(),this._ropeTranslation=c(),this._beginScreenPoint=i(),this._screenPickPoint=i(),this._horizonY=null,this._horizonPadding=null,this._ropeBeginScreenPoint=i(),this._ropeScreenHeight=1,this._ropePlane=m(),this._ropePullOverHorizonVelocityAdjustment=1,this._pointerCount=0,this._beginCamera=new T,this._constraintOptions=new C(15,0,0,this._beginCamera)}get isGlobalMode(){return 1===this.view.state.viewingMode}begin(t){this.running&&(this._pointerCount=t.pointers.size,e(t.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),o(this._beginScreenPoint,this._screenPickPoint),this.startCamera.relativeElevation>v?this._validState=!1:(this._initClampValues(),this._prepareRopePullMode(),this._beginCamera.copyFrom(this.startCamera)))}update(t){this.running&&this._validState&&(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(t),this.commitCamera())}end(t){return t.pointers.size===this._pointerCount&&this.update(t),this.finishController(),null}_initClampValues(){this.isGlobalMode?this._globalInitClampValues():this._localInitClampValues()}_globalInitClampValues(){this._referenceSphere.radius=_(this.view.spatialReference).radius,this._horizonY=S(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=null!=this._horizonY?z(this.startCamera,this._horizonY):null}_localInitClampValues(){const t=c();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=c();n(i,this.startCamera.eye,t,-this.startCamera.relativeElevation),d(i,t,this._referencePlane),this._horizonY=w(this.startCamera,this._referencePlane),this._horizonPadding=z(this.startCamera,this._horizonY)}_prepareRopePullMode(){if(!this._horizonY||!this._horizonPadding)return;this._ropeBeginScreenPoint=this._screenPickPoint,this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio;if(!(this.isGlobalMode?b({view:this.view,originalScreenPoint:this._ropeBeginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outRopeTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint}):j({view:this.view,originalScreenPoint:this._ropeBeginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outRopeTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint})))return void(this._validState=!1);const t=c();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=this.startCamera.viewRight,e=a(this._ropeTranslation,i),r=h(c(),t,i),o=a(this._ropeTranslation,r);l(this._forwardRopeComponent,r,o),l(this._sidewaysRopeComponent,i,e),d(this._adjustedScenePoint,t,this._ropePlane);const s=this._ropeScreenHeight-this._beginScreenPoint[1],n=this._ropeScreenHeight-this._horizonPadding[0];this._ropePullOverHorizonVelocityAdjustment=Math.max(s/n,1)}_panningRopePull(t){if(!this._horizonY||!this._horizonPadding)return;const i=e(t.center,this._screenPointArray),r=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,o=(this._ropeScreenHeight-i[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),a=1-o,h=(i[0]-r)/(this._beginScreenPoint[0]-r),c=a*y*this._ropePullOverHorizonVelocityAdjustment,_=(a*R+o*((1-h)*R))*this._ropePullOverHorizonVelocityAdjustment;l(this._ropeTranslation,this._forwardRopeComponent,c),n(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,_),this.currentCamera.eye=p(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=p(this._tmp3d,this.startCamera.center,this._ropeTranslation),this._constraintOptions.interactionType=6,this._constraintOptions.interactionFactor=P(s(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this._ropeTranslation,g(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}};H=t([r("esri.views.3d.state.controllers.RopePullController")],H);export{H as RopePullController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as u,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as h,length as M,dot as g,subtract as d,normalize as y,squaredDistance as b,copy as x,transformMat4 as j,add as v,distance as w,cross as P,scale as I,lerp as z,set as T,crossAndNormalize as S,scaleAndAdd as R}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as q,create as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as H,axis as F,fromPoints as U,wrapAxisAngle as E}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as G,vectorCoordinates as k}from"../../../../geometry/support/coordinateSystem.js";import{create as C,fromNormalAndOffset as O,intersectRay as W,projectVector as B,fromPositionAndNormal as D,distance as J,projectPoint as K}from"../../../../geometry/support/plane.js";import{create as L}from"../../../../geometry/support/ray.js";import{Sphere as N}from"../../../../geometry/support/sphere.js";import{sm4d as Q,sv3d as V}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as X,fromScreen as Y}from"../../support/geometryUtils/ray.js";import{intersectScreen as Z}from"../../support/geometryUtils/sphere.js";import $ from"../../webgl/RenderCamera.js";import{Intersector as _}from"../../webgl-engine/lib/Intersector.js";import{terrainId as tt}from"../../webgl-engine/lib/verticalOffsetUtils.js";const et=30,nt=[1,3e8],rt=8,ot=[200,1508e5],it=5,at=50,st=5,ct=10,lt=80,ut=90,mt=1e-6,pt={exclude:new Set([tt])};function ft(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function ht(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function Mt(t,e,n){const r=a(Q.get(),n[3],F(n));null==r||s(r,u)||(d(ke,t.eye,e),j(ke,ke,r),t.eye=v(ke,ke,e),d(ke,t.center,e),j(ke,ke,r),t.center=v(ke,ke,e),t.up=j(ke,t.up,r))}function gt(t,e,n,r){return W(t,Y(e,n,Je),r)}function dt(t,e,n,r){return W(t,X(e,n,Je),r)}function yt(t,e,n,r){const o=V.get();let i=1-n;d(o,e,t.eye);const a=M(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<mt||(I(o,o,i),t.eye=v(ke,t.eye,o),t.center=z(ke,t.center,e,i))}function bt(t,e,n){e.getScreenCenter(xt),Z(t,e,xt,ke)&&(e.center=ke);const r=e.distance,o=r*n;if(Math.abs(r-o)<mt)return;const i=I(V.get(),e.viewForward,o);e.eye=d(ke,e.center,i)}const xt=i();function jt(t,e){T(e,0,0,0);for(const n of t)v(e,e,n);I(e,e,1/t.length)}function vt(t,e,n,r){return Math.sin(t/M(e))*(n+r.radius)}function wt(t,e,n,r){return vt(Math.PI/2,e,n,r)+(t-Math.PI/2)}const Pt={Elevation:3e4,Angle:e(16)},It=e(80);function zt(t,e,n,r,o,i){const a=t.sceneIntersectionHelper,s=new _(t.state.viewingMode);s.options.selectionMode=!0,s.options.store=0,s.options.hud=!1,s.options.normalRequired=!0;let c=null;const l=A(),u=new N;let m=!0,p=!0;const{eye:f}=e;a.intersectIntersectorScreen(n,s,i);const g=s.results.min;return g.getIntersectionPoint(l)&&!h(f,l)&&ve(f,l,r)?(c=q(g.normal),u.radius=M(l)):(p=!1,e.aboveGround&&0!==o?u.radius=Math.max(M(e.center),.9*r):u.radius=M(e.eye)-e.relativeElevation,1===o?qt(u,e,n,l):m=Z(u,e,n,l)),{sphere:u,scenePickPoint:m?l:null,hasGeometryIntersection:p,intersectorType:g.intersector,normal:c}}function Tt(t,e,n,r){const o=t.relativeElevation;if(o>Pt.Elevation&&"global"===r)return 1;X(t,e,Ke);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,ke);return-i*g(a,Ke.direction)<Math.sin(Pt.Angle)*M(Ke.direction)?0:1}function St(t,e,n){d(Rt,n,e),t.eye=d(ke,t.eye,Rt),t.center=d(ke,t.center,Rt)}const Rt=A();function qt(t,e,n,r){const o=X(e,n,Je);return null!=o&&(t.closestPointOnSilhouette(o,At),t.intersectRay(o,r)?!(b(At,o.origin)<b(r,o.origin))||(x(r,At),!1):(d(Ht,e.eye,e.center),y(Ht,Ht),O(Ht,-g(y(Ht,Ht),At),Ft),W(Ft,o,r),!1))}const At=A(),Ht=A(),Ft=C(),Ut=A(),Et=A(),Gt=i();function kt(t,e){return B(e,t.viewForward,Ut),v(Et,t.eye,Ut),t.projectToScreen(Et,Gt),Gt[1]}const Ct=A(),Ot=C(),Wt=A(),Bt=A(),Dt=A(),Jt=A(),Kt=A(),Lt=A(),Nt=A(),Qt=A(),Vt=A(),Xt=A(),Yt=i(),Zt=L();function $t(t,e,n){const r=t.eye;if(w(e.center,r)<e.radius)return y(Kt,r),P(Lt,Kt,t.viewRight),v(Et,r,Lt),t.projectToScreen(Et,Yt),Yt[1];const o=t.up;X(t,n,Zt);const i=e.radius;if(S(Ct,o,Zt.direction),D(r,Ct,Ot),J(Ot,e.center)>i)return null;K(Ot,e.center,Wt);const a=w(e.center,Wt),s=Math.sqrt(i**2-a**2);d(Bt,r,Wt),y(Dt,Bt),S(Jt,Ct,Dt);const c=g(Bt,Dt),l=g(Bt,Jt),u=Math.sqrt(c**2+l**2),m=s**2/u**2,p=s/u**2*Math.sqrt(u**2-s**2),f=m*c,h=p*-l,M=m*l,b=p*c,x=f-h,j=M+b,z=M-b;v(Nt,Wt,R(Nt,I(Nt,Dt,f+h),Jt,j)),v(Qt,Wt,R(Qt,I(Qt,Dt,x),Jt,z)),d(Vt,Nt,r),y(Vt,Vt),d(Xt,Qt,r),y(Xt,Xt);return g(t.viewForward,Vt)>=g(t.viewForward,Xt)?t.projectToScreen(Nt,Yt):t.projectToScreen(Qt,Yt),Yt[1]}function _t(t,e,n){return e?t>n:t<n}const te=.05,ee=12;function ne(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(ee,te*r)}function re(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+ne(t,e))}function oe(t,e){return Math.max(0,e-ne(t,e))}function ie(i,a,s,c,l,u){let m=0;if(P(We,i,a),d(Ce,i,a),M(i)<=l||!c.aboveGround){P(s,Ce,c.eye);const p=g(i,a)/(M(i)*M(a));if(p<.9999)m=r(p);else{const t=M(P(A(),i,a))/(M(i)*M(a));m=o(t)}const f=Math.cos(n(t.normalize(e(u)),0,It));m=-m-Math.max(0,M(a)-l)/(f*l)}else d(ae,c.eye,c.center),P(s,Ce,ae),m=-M(Ce)/l;return y(s,s),I(s,s,M(We)),m}const ae=A();function se(o,i,a,s){let c,l;const u=Math.cos(n(t.normalize(e(s)),0,It));return c=i>a?-(i-a)/(u*a):i<-a?Math.PI-(i+a)/(u*a):r(i/a),l=o>a?-(o-a)/(u*a):o<-a?Math.PI-(o+a)/(u*a):r(o/a),(l-c)*a}function ce(t,e,n,r,o,i,a,s,c,l){const u=se(t[2],e[2],i.radius,s),m=c?se(t[0],e[0],i.radius,180):e[0]-t[0],f=Math.sin(a)*m-Math.cos(a)*u,h=Math.cos(a)*m+Math.sin(a)*u;y(ke,o);const M=c?f/Math.sqrt(Math.abs(i.radius**2-g(n,ke)**2)):f/i.radius,d=h/Math.sqrt(Math.abs(i.radius**2-g(n,r)**2));p(l,M,d)}function le(t,e,n,r,o,i,a,s,c,l){P(We,t,e),G(i.up,i.eye,ze,Te,Se),G([0,0,1],i.eye,we,Pe,Ie),x(n,Pe),x(r,we),y(n,n),I(n,n,M(We)),k(t,y(Te,Te),y(Se,Se),y(ze,ze),Re),k(e,Te,Se,ze,qe),ce(Re,qe,t,we,Pe,a,s,c,l,o)}function ue(t,e,n,r,o,i,s){a(Fe,o,r),a(Ue,s,i),l(Ee,Fe,Ue),d(e,t,n),j(e,e,Ee),v(e,e,n)}function me(t,e,n,r,o,i){a(Fe,r,n),a(Ue,i,o),l(Ee,Fe,Ue),d(ke,t.eye,e),j(ke,ke,Ee),t.eye=v(ke,ke,e),d(ke,t.center,e),j(ke,ke,Ee),t.center=v(ke,ke,e),d(ke,t.up,e),j(ke,ke,Ee),t.up=v(ke,ke,e)}const pe={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let fe=!1;function he(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-pe.Angle||Math.abs(r)<pe.Angle,s=(Math.abs(t[2])<n*pe.Pole||Math.abs(e)>n)&&i;return a&&s?!fe&&o<pe.Tilt-pe.TiltHysteresisMargin?fe=!0:fe&&o>pe.Tilt+pe.TiltHysteresisMargin&&(fe=!1):fe=!1,fe}function Me(t,e,n,r,o,i){if(i)U(n,r,He),Mt(e,t.center,He);else{const i=ie(n,r,Be,e,t.radius,o);Mt(e,t.center,E(Be,i))}}function ge(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let l,u;x(Ge,r),Oe.copyFrom(e);for(let m=0;m<s&&b(n,Ge)>c&&(l=b(n,Ge),le(n,Ge,Pe,we,Ae,Oe,t,o,i,a),me(Oe,t.center,we,Ae[1],Pe,Ae[0]),ue(Ge,Ge,t.center,we,Ae[1],Pe,Ae[0]),u=b(n,Ge),u<l||0===m);m++)e.copyFrom(Oe)}function de(n,r,o,i,a,s,c){he(o,g(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?ge(n,r,o,i,-t.normalize(e(a)),s,c):Me(n,r,o,i,s,c)}function ye(t,e,n,r,o,i){const{eye:a}=t;G([0,0,1],a,we,Pe,Ie);const s=e.translation[0]*n.pan,l="zoom"===o.mode?0:e.translation[1]*n.pan,u=Math.max(Math.sqrt(Math.abs(1-g(t.center,we)**2/M(t.center)**2)),.5),m=(Math.sin(i)*l+Math.cos(i)*s)/u,p=-Math.cos(i)*l+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,we),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,p,Pe),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function be(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=P(V.get(),a,i),l=e.translation[0]*n.pan;switch(0!==l&&(c(r.pan.matrix,r.pan.matrix,-l,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function xe(n,r,o,i,a,s,c,l,u){he(n.center,g(n.up,n.center),M(n.center),-t.normalize(e(s)),c,r.aboveGround)?ye(r,o,i,l,u,-t.normalize(e(a))):be(r,o,i,l,u)}function je(t,e,n=1/0){const r=Math.abs(g(t,e));return Math.min(n,1/r)}function ve(t,e,n){const r=w(t,e),o=M(t);return r<Math.max(o,n)}const we=A(),Pe=A(),Ie=A(),ze=A(),Te=A(),Se=A(),Re=A(),qe=A(),Ae=f(),He=H(),Fe=m(),Ue=m(),Ee=m(),Ge=A(),ke=A(),Ce=A();let Oe=new $;const We=A(),Be=A();function De(){Oe=new $}const Je={origin:A(),direction:A()},Ke={origin:A(),direction:A()};export{It as TiltThresholdPanningSpeed,Pt as VerticalPanTresholds,St as applyPanPlanar,Me as applyPanSphericalDirectRotation,ge as applyPanSphericalPreserveHeading,Mt as applyRotation,me as applyRotationWithTwoAxes,bt as applyZoomOnSphere,yt as applyZoomToPoint,jt as centroid,De as cleanupNavigationUtils,oe as computeHorizonDownLimitScreenY,ne as computeHorizonPadding,re as computeHorizonUpLimitScreenY,mt as distanceComparisonTolerance,pt as excludeTerrain,kt as findPlaneHorizonY,$t as findSphereHorizonY,je as getTiltScaleFactor,Tt as inferNavigationMode,gt as intersectPlaneFromScreenPoint,dt as intersectPlaneFromScreenPointAtEye,ve as isHitOnSamePlanetSide,se as lengthFromPoints,it as maxPanDistanceModifier,st as maxRotatePivotDistanceModifier,et as maxZoomPivotDistanceModifier,rt as maxZoomStepDistanceModifier,at as minPinchAndPanCameraHeight,ct as minRotatePivotDistance,ft as normalizeCoordinate,ht as normalizeRotationDelta,wt as offSurfaceTiltToEyeTiltGlobal,vt as onSurfaceTiltToEyeTiltGlobal,xe as panMotionToRotationMatrix,de as panToPosition,zt as pickPointAndInitSphere,lt as pivotSearchAreaSize,pe as preservingHeadingThresholds,te as relativeHorizonPanPadding,ut as rotatePivotSearchAreaSize,ue as rotatePointAroundTwoAxes,ie as rotationAngleAndAxisDirectRotation,le as rotationAnglesAndAxesHeadingPreserving,ce as rotationAnglesHeadingPreserving,_t as shouldClampScreenY,he as shouldPreserveHeading,qt as sphereOrPlanePointFromScreenPoint,nt as zoomPivotDistanceClamp,ot as zoomStepDistanceClamp};
2
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as s,exactEquals as a,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as h,length as M,dot as g,subtract as y,normalize as d,squaredDistance as b,copy as x,transformMat4 as j,add as v,distance as P,cross as w,scale as I,lerp as z,set as A}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as T,create as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as S,axis as U,fromPoints as q,wrapAxisAngle as E}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as G,vectorCoordinates as H}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as C,intersectRay as F}from"../../../../geometry/support/plane.js";import{Sphere as O}from"../../../../geometry/support/sphere.js";import{sm4d as W,sv3d as B}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as D,fromScreen as J}from"../../support/geometryUtils/ray.js";import{intersectScreen as K}from"../../support/geometryUtils/sphere.js";import L from"../../webgl/RenderCamera.js";import{Intersector as N}from"../../webgl-engine/lib/Intersector.js";import{terrainId as Q}from"../../webgl-engine/lib/verticalOffsetUtils.js";const V=30,X=[1,3e8],Y=8,Z=[200,1508e5],$=5,_=50,tt=5,et=10,nt=80,ot=90,rt=1e-6,it={exclude:new Set([Q])};function st(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function at(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ct(t,e,n){const o=s(W.get(),n[3],U(n));null==o||a(o,m)||(y(ie,t.eye,e),j(ie,ie,o),t.eye=v(ie,ie,e),y(ie,t.center,e),j(ie,ie,o),t.center=v(ie,ie,e),t.up=j(ie,t.up,o))}function lt(t,e,n,o){return F(t,J(e,n,ue),o)}function mt(t,e,n,o){return F(t,D(e,n,ue),o)}function ut(t,e,n,o){const r=B.get();let i=1-n;y(r,e,t.eye);const s=M(r);let a=s*(1-i);i>=0&&a<o&&(a=o,i=-(a-s)/s),Math.abs(s-a)<rt||(I(r,r,i),t.eye=v(ie,t.eye,r),t.center=z(ie,t.center,e,i))}function pt(t,e,n){e.getScreenCenter(ft),K(t,e,ft,ie)&&(e.center=ie);const o=e.distance,r=o*n;if(Math.abs(o-r)<rt)return;const i=I(B.get(),e.viewForward,r);e.eye=y(ie,e.center,i)}const ft=i();function ht(t,e){A(e,0,0,0);for(const n of t)v(e,e,n);I(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/M(e))*(n+o.radius)}function gt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}const yt={Elevation:3e4,Angle:e(16)},dt=e(80);function bt(t,e,n,o,r,i){const s=t.sceneIntersectionHelper,a=new N(t.state.viewingMode);a.options.selectionMode=!0,a.options.store=0,a.options.hud=!1,a.options.normalRequired=!0;let c=null;const l=R(),m=new O;let u=!0,p=!0;const{eye:f}=e;s.intersectIntersectorScreen(n,a,i);const g=a.results.min;return g.getIntersectionPoint(l)&&!h(f,l)&&Kt(f,l,o)?(c=T(g.normal),m.radius=M(l)):(p=!1,e.aboveGround&&0!==r?m.radius=Math.max(M(e.center),.9*o):m.radius=M(e.eye)-e.relativeElevation,1===r?Pt(m,e,n,l):u=K(m,e,n,l)),{sphere:m,scenePickPoint:u?l:null,hasGeometryIntersection:p,intersectorType:g.intersector,normal:c}}function xt(t,e,n,o){const r=t.relativeElevation;if(r>yt.Elevation&&"global"===o)return 1;D(t,e,pe);const i=Math.sign(r),s=n.worldUpAtPosition(t.eye,ie);return-i*g(s,pe.direction)<Math.sin(yt.Angle)*M(pe.direction)?0:1}function jt(t,e,n){y(vt,n,e),t.eye=y(ie,t.eye,vt),t.center=y(ie,t.center,vt)}const vt=R();function Pt(t,e,n,o){const r=D(e,n,ue);return null!=r&&(t.closestPointOnSilhouette(r,wt),t.intersectRay(r,o)?!(b(wt,r.origin)<b(o,r.origin))||(x(o,wt),!1):(y(It,e.eye,e.center),d(It,It),C(It,-g(d(It,It),wt),zt),F(zt,r,o),!1))}const wt=R(),It=R(),zt=k();function At(i,s,a,c,l,m){let u=0;if(w(ce,i,s),y(se,i,s),M(i)<=l||!c.aboveGround){w(a,se,c.eye);const p=g(i,s)/(M(i)*M(s));if(p<.9999)u=o(p);else{const t=M(w(R(),i,s))/(M(i)*M(s));u=r(t)}const f=Math.cos(n(t.normalize(e(m)),0,dt));u=-u-Math.max(0,M(s)-l)/(f*l)}else y(Tt,c.eye,c.center),w(a,se,Tt),u=-M(se)/l;return d(a,a),I(a,a,M(ce)),u}const Tt=R();function Rt(r,i,s,a){let c,l;const m=Math.cos(n(t.normalize(e(a)),0,dt));return c=i>s?-(i-s)/(m*s):i<-s?Math.PI-(i+s)/(m*s):o(i/s),l=r>s?-(r-s)/(m*s):r<-s?Math.PI-(r+s)/(m*s):o(r/s),(l-c)*s}function St(t,e,n,o,r,i,s,a,c,l){const m=Rt(t[2],e[2],i.radius,a),u=c?Rt(t[0],e[0],i.radius,180):e[0]-t[0],f=Math.sin(s)*u-Math.cos(s)*m,h=Math.cos(s)*u+Math.sin(s)*m;d(ie,r);const M=c?f/Math.sqrt(Math.abs(i.radius**2-g(n,ie)**2)):f/i.radius,y=h/Math.sqrt(Math.abs(i.radius**2-g(n,o)**2));p(l,M,y)}function Ut(t,e,n,o,r,i,s,a,c,l){w(ce,t,e),G(i.up,i.eye,Vt,Xt,Yt),G([0,0,1],i.eye,Lt,Nt,Qt),x(n,Nt),x(o,Lt),d(n,n),I(n,n,M(ce)),H(t,d(Xt,Xt),d(Yt,Yt),d(Vt,Vt),Zt),H(e,Xt,Yt,Vt,$t),St(Zt,$t,t,Lt,Nt,s,a,c,l,r)}function qt(t,e,n,o,r,i,a){s(ee,r,o),s(ne,a,i),l(oe,ee,ne),y(e,t,n),j(e,e,oe),v(e,e,n)}function Et(t,e,n,o,r,i){s(ee,o,n),s(ne,i,r),l(oe,ee,ne),y(ie,t.eye,e),j(ie,ie,oe),t.eye=v(ie,ie,e),y(ie,t.center,e),j(ie,ie,oe),t.center=v(ie,ie,e),y(ie,t.up,e),j(ie,ie,oe),t.up=v(ie,ie,e)}const Gt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let Ht=!1;function kt(t,e,n,o,r,i){const s=Math.abs(o)>Math.PI-Gt.Angle||Math.abs(o)<Gt.Angle,a=(Math.abs(t[2])<n*Gt.Pole||Math.abs(e)>n)&&i;return s&&a?!Ht&&r<Gt.Tilt-Gt.TiltHysteresisMargin?Ht=!0:Ht&&r>Gt.Tilt+Gt.TiltHysteresisMargin&&(Ht=!1):Ht=!1,Ht}function Ct(t,e,n,o,r,i){if(i)q(n,o,te),ct(e,t.center,te);else{const i=At(n,o,le,e,t.radius,r);ct(e,t.center,E(le,i))}}function Ft(t,e,n,o,r,i,s){const a=s?20:1,c=1e-12;let l,m;x(re,o),ae.copyFrom(e);for(let u=0;u<a&&b(n,re)>c&&(l=b(n,re),Ut(n,re,Nt,Lt,_t,ae,t,r,i,s),Et(ae,t.center,Lt,_t[1],Nt,_t[0]),qt(re,re,t.center,Lt,_t[1],Nt,_t[0]),m=b(n,re),m<l||0===u);u++)e.copyFrom(ae)}function Ot(n,o,r,i,s,a,c){kt(r,g(o.up,r),n.radius,-t.normalize(e(s)),a,o.aboveGround)?Ft(n,o,r,i,-t.normalize(e(s)),a,c):Ct(n,o,r,i,a,c)}function Wt(t,e,n,o,r,i){const{eye:s}=t;G([0,0,1],s,Lt,Nt,Qt);const a=e.translation[0]*n.pan,l="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-g(t.center,Lt)**2/M(t.center)**2)),.5),u=(Math.sin(i)*l+Math.cos(i)*a)/m,p=-Math.cos(i)*l+Math.sin(i)*a;switch(c(o.pan.matrix,o.pan.matrix,u,Lt),o.pan.enabled=!0,r.mode){case"pan":c(o.pan.matrix,o.pan.matrix,p,Nt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(t,e,n,o,r){const{eye:i,viewRight:s}=t,a=w(B.get(),s,i),l=e.translation[0]*n.pan;switch(0!==l&&(c(o.pan.matrix,o.pan.matrix,-l,a),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(o.pan.matrix,o.pan.matrix,t,s),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Dt(n,o,r,i,s,a,c,l,m){kt(n.center,g(n.up,n.center),M(n.center),-t.normalize(e(a)),c,o.aboveGround)?Wt(o,r,i,l,m,-t.normalize(e(s))):Bt(o,r,i,l,m)}function Jt(t,e,n=1/0){const o=Math.abs(g(t,e));return Math.min(n,1/o)}function Kt(t,e,n){const o=P(t,e),r=M(t);return o<Math.max(r,n)}const Lt=R(),Nt=R(),Qt=R(),Vt=R(),Xt=R(),Yt=R(),Zt=R(),$t=R(),_t=f(),te=S(),ee=u(),ne=u(),oe=u(),re=R(),ie=R(),se=R();let ae=new L;const ce=R(),le=R();function me(){ae=new L}const ue={origin:R(),direction:R()},pe={origin:R(),direction:R()};export{dt as TiltThresholdPanningSpeed,yt as VerticalPanTresholds,jt as applyPanPlanar,Ct as applyPanSphericalDirectRotation,Ft as applyPanSphericalPreserveHeading,ct as applyRotation,Et as applyRotationWithTwoAxes,pt as applyZoomOnSphere,ut as applyZoomToPoint,ht as centroid,me as cleanupNavigationUtils,rt as distanceComparisonTolerance,it as excludeTerrain,Jt as getTiltScaleFactor,xt as inferNavigationMode,lt as intersectPlaneFromScreenPoint,mt as intersectPlaneFromScreenPointAtEye,Kt as isHitOnSamePlanetSide,Rt as lengthFromPoints,$ as maxPanDistanceModifier,tt as maxRotatePivotDistanceModifier,V as maxZoomPivotDistanceModifier,Y as maxZoomStepDistanceModifier,_ as minPinchAndPanCameraHeight,et as minRotatePivotDistance,st as normalizeCoordinate,at as normalizeRotationDelta,gt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,Dt as panMotionToRotationMatrix,Ot as panToPosition,bt as pickPointAndInitSphere,nt as pivotSearchAreaSize,Gt as preservingHeadingThresholds,ot as rotatePivotSearchAreaSize,qt as rotatePointAroundTwoAxes,At as rotationAngleAndAxisDirectRotation,Ut as rotationAnglesAndAxesHeadingPreserving,St as rotationAnglesHeadingPreserving,kt as shouldPreserveHeading,Pt as sphereOrPlanePointFromScreenPoint,X as zoomPivotDistanceClamp,Z as zoomStepDistanceClamp};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{distance as t,normalize as n,cross as o,add as r,crossAndNormalize as i,subtract as s,dot as a,scaleAndAdd as c,scale as u,copy as l,length as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../../../geometry/ellipsoidUtils.js";import{create as f,fromPositionAndNormal as h,distance as S,projectPoint as g,projectVector as j}from"../../../../geometry/support/plane.js";import{create as P}from"../../../../geometry/support/ray.js";import{Sphere as w}from"../../../../geometry/support/sphere.js";import{getVoxelWasm as v}from"../../layers/VoxelWasm.js";import{pickPointAndInitSphere as y,sphereOrPlanePointFromScreenPoint as I,intersectPlaneFromScreenPoint as b}from"./navigationUtils.js";import{fromScreenAtEye as z}from"../../support/geometryUtils/ray.js";import{Intersector as M}from"../../webgl-engine/lib/Intersector.js";const k=90,x=1.5,R=x,A=x,T=1e4,F=.1,G=12,q=p(),O=p(),H=e(),N=p(),U=f(),Y=p(),C=p(),D=p(),V=p(),E=p(),L=p(),W=p(),_=p(),B=p(),J=p(),K=e(),Q=P(),X=new w,Z=p(),$=f(),ee=p();function te(e,t){return j(t,e.viewForward,q),r(O,e.eye,q),e.projectToScreen(O,H),H[1]}function ne(e,l,m){const p=e.eye;if(t(l.center,p)<l.radius)return n(E,p),o(L,E,e.viewRight),r(O,p,L),e.projectToScreen(O,K),K[1];const d=e.up;z(e,m,Q);const f=l.radius;if(i(N,d,Q.direction),h(p,N,U),S(U,l.center)>f)return null;g(U,l.center,Y);const j=t(l.center,Y),P=Math.sqrt(f**2-j**2);s(C,p,Y),n(D,C),i(V,N,D);const w=a(C,D),v=a(C,V),y=Math.sqrt(w**2+v**2),I=P**2/y**2,b=P/y**2*Math.sqrt(y**2-P**2),M=I*w,k=b*-v,x=I*v,R=b*w,A=M-k,T=x+R,F=x-R;r(W,Y,c(W,u(W,D,M+k),V,T)),r(_,Y,c(_,u(_,D,A),V,F)),s(B,W,p),n(B,B),s(J,_,p),n(J,J);return a(e.viewForward,B)>=a(e.viewForward,J)?e.projectToScreen(W,K):e.projectToScreen(_,K),K[1]}function oe(e,t,n=!0){return n?e<t:e<=t}function re(e,t,n=!0){return n?e>t:e>=t}function ie(e,t,n){return t?e>n:e<n}function se(e,t){const n=e.fullHeight/e.pixelRatio,o=Math.max(t,n-t);return Math.max(G,F*o)}function ae(e,t){return[ce(e,t),ue(e,t)]}function ce(e,t){const n=e.fullHeight/e.pixelRatio;return Math.min(n,t+se(e,t))}function ue(e,t){return Math.max(0,t-se(e,t))}function le(e,t,n){const o={translation:e,location:t};return n&&(o.normal=n),o}function me(e){const{view:o,originalScreenPoint:r,horizonY:i,horizonPadding:s,outRopeTranslation:a,outGrabLocation:c,outGrabNormal:u,intersectionOptions:m,depthSearchSize:p}=e,f=o.state.camera,h=le(a,c,u);X.radius=d(o.spatialReference).radius;const S=y(o,f,r,X.radius,1,m);if(null==S.scenePickPoint)return!1;const g=S.hasGeometryIntersection;l(Z,S.scenePickPoint),l(h.location,Z);const j=S.sphere;h.normal&&S.normal&&l(h.normal,S.normal);const P=fe(r,i,s,g),w=t(Z,f.eye);if(P.wasAdjusted){Se({view:o,screenAdjustment:P,intersector:he(o),fallbackCheck:(e,t,o)=>{const r=I(j,f,e,t);return r&&o&&n(o,t),r},output:h,intersectionOptions:m})}return je({view:o,screenPoint:P.adjustedScreenPoint,camera:f,initialRopeDistance:w,depthSearchSize:p??k,output:h}),!0}function pe(e){const{view:o,originalScreenPoint:r,horizonY:i,horizonPadding:s,outRopeTranslation:a,outGrabLocation:u,outGrabNormal:m,intersectionOptions:p,depthSearchSize:d}=e,f=o.sceneIntersectionHelper,S=o.state.camera,g=he(o),j=le(a,u,m);f.intersectIntersectorScreen(r,g,p);const P=g.results.min.getIntersectionPoint(Z),w=P?t(Z,S.eye):Number.POSITIVE_INFINITY;P&&(l(j.location,Z),j.normal&&l(j.normal,g.results.min.normal)),o.renderCoordsHelper.worldUpAtPosition(S.eye,E),c(ee,S.eye,E,-S.relativeElevation),h(ee,E,$);const v=fe(r,i,s,P);if(v.wasAdjusted){Se({view:o,screenAdjustment:v,intersector:g,fallbackCheck:(e,t,o)=>{const r=b($,S,e,t);return r&&o&&n(o,E),r},output:j,intersectionOptions:p})}return je({view:o,screenPoint:v.adjustedScreenPoint,camera:S,initialRopeDistance:w,depthSearchSize:d??k,output:j}),!0}function de(e,t,n,o){return!o&&oe(e,t)||o&&ie(e,!1,n[0])?n[0]:!o&&re(e,t,!1)?n[1]:null}function fe(t,n,o,r){const i=de(t[1],n,o,r);return{originalScreenPoint:t,adjustedScreenPoint:e(t[0],i??t[1]),horizonY:n,horizonPadding:o,wasAdjusted:null!==i}}function he(e){const t=new M(e.state.viewingMode);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function Se(e){const{view:t,screenAdjustment:n,fallbackCheck:o,intersector:r,output:i,intersectionOptions:s}=e,a=t.sceneIntersectionHelper;a.intersectIntersectorScreen(n.adjustedScreenPoint,r,{...s,requiresGroundFeedback:!0});let c=r.results.min.getIntersectionPoint(i.location);if(c)return void(i.normal&&l(i.normal,r.results.min.normal));const u=ge(n);a.intersectIntersectorScreen(u,r,{...s,requiresGroundFeedback:!0}),c=r.results.min.getIntersectionPoint(i.location),c?i.normal&&l(i.normal,r.results.min.normal):(c=o(n.adjustedScreenPoint,i.location,i.normal),c||o(u,i.location,i.normal))}function ge(t){const{originalScreenPoint:n,adjustedScreenPoint:o,horizonY:r,horizonPadding:i}=t,s=re(o[1],r)?Math.min(i[1],n[1]):Math.max(i[0],n[1]);return e(o[0],s)}function je(e){const{view:t,screenPoint:o,camera:i,initialRopeDistance:a,depthSearchSize:c,output:l}=e,p=c>0?t.stage.renderView.getMinimalDepthForArea(v(t),o[0],o[1],i,c):null;s(l.translation,l.location,i.eye);let d=Math.min(m(l.translation),a);p&&p<=d&&(d=p),n(l.translation,l.translation),u(l.translation,l.translation,d),r(l.location,l.translation,i.eye)}export{se as computeHorizonPadding,ae as computeHorizonPaddingLimits,me as findGlobalModeRopePullGrabLocation,pe as findLocalModeRopePullGrabLocation,te as findPlaneHorizonY,ne as findSphereHorizonY,oe as isAboveHorizon,re as isBelowHorizon,T as ropePullMaxElevation,A as ropePullXSpeedMultiplier,R as ropePullYSpeedMultiplier,ie as shouldClampScreenY};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{clamp as t}from"../../../core/mathUtils.js";import{length as r,dot as o}from"../../../core/libs/gl-matrix-2/math/vec3.js";function n(t,r,o,n){const c=o[0]-t[0],s=o[1]-t[1],i=r+n;return c*c+s*s<=i*i}function c(t,r,o,n,c){for(const s of c){const c=s[0],i=s[1],e=s[2],f=e>0?o:n;if(c*t[0]+i*t[1]+e*f+s[3]-Math.hypot(c,i)*r>0)return!1}return!0}function s(n,c,s,i){const e=r(s);if(e<=i)return!0;const f=o(n,s);if(f<=0)return-f<=i;const u=t(f/e,-1,1),m=Math.sqrt(1-u*u),a=t(i/e,0,1);return m*Math.sqrt(1-a*a)-a*u<=c}export{c as finiteVerticalCylinderIntersectsFrustumConservative,s as sphereIntersectsInfiniteRadialConeConservative,n as sphereIntersectsInfiniteVerticalCylinderConservative};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as t,dist as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ONES as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as s}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as c}from"../../layers/graphics/olidUtils.js";import{Attribute as p}from"../../webgl-engine/lib/Attribute.js";import{Geometry as f}from"../../webgl-engine/lib/Geometry.js";function m(t,e,r=null){const o=[],n=e.mapPositions,i=h(e,o),a=i.data,u=i.indices.length,s=l(u);return g(e,o,s),w(e,o,s),b(e,o,s),y(e,o,i.indices,s),d(e,o,i.indices,s),D(e,o),F(e,o,i.indices,s),j(e,o,a),null!=r&&c(o,r,s),new f(t,o,n,2)}function h(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:o}=t,n=r.length/3,i=n>2&&A(r)&&o,a=n-(i?1:0),u=new Array(2*(a-1)),s=i?r.slice(0,-3):r;let l=0;for(let p=0;p<a-1;p++)u[l++]=p,u[l++]=p+1;const c=new p(s,u,3,i);return e.push(["position",c]),c}function g(t,e,r){if(null!=t.attributeData.colorFeature)return;const n=t.attributeData.color;e.push(["color",new p(n??o,r,4)])}function b(t,e,r){t.attributeData.normal&&e.push(["normal",new p(t.attributeData.normal,r,3)])}function y(t,e,r,o){const n=t.attributeData.colorFeature;null!=n&&("number"==typeof n?e.push(["colorFeatureAttribute",new p([n],o,1,!0)]):e.push(["colorFeatureAttribute",new p(n,r,1,!0)]))}function w(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new p([t.attributeData.size??1],r,1,!0)])}function d(t,e,r,o){const n=t.attributeData.sizeFeature;null!=n&&("number"==typeof n?e.push(["sizeFeatureAttribute",new p([n],o,1,!0)]):e.push(["sizeFeatureAttribute",new p(n,r,1,!0)]))}function D(t,e){const{attributeData:{position:r,timeStamps:o}}=t;if(!o)return;const n=r.length/3,i=new Array(2*(n-1));let a=0;for(let u=0;u<n-1;u++)i[a++]=u,i[a++]=u+1;e.push(["timeStamps",new p(o,i,S,!0)])}function F(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&("number"==typeof n?e.push(["opacityFeatureAttribute",new p([n],o,1,!0)]):e.push(["opacityFeatureAttribute",new p(n,r,1,!0)]))}function j(r,o,s){if(null==r.overlayInfo||1!==r.overlayInfo.renderCoordsHelper.viewingMode||!r.overlayInfo.spatialReference.isGeographic)return;const l=a(s.length),c=n(r.overlayInfo.spatialReference);for(let t=0;t<l.length;t+=3)i(s,t,l,t,c);const f=s.length/3,m=u(f+1);let h=v,g=z,b=0,y=0;t(h,l[y++],l[y++]),y++,m[0]=0;for(let n=1;n<f+1;++n)n===f&&(y=0),t(g,l[y++],l[y++]),y++,b+=e(h,g),m[n]=b,[h,g]=[g,h];o.push(["distanceToStart",new p(m,o[0][1].indices,1,!0)])}function A(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const v=r(),z=r(),S=4;function E(t,e,r,o,n){if(null==t||0===t.length)return[];const i=[];return t.forEach((t,u)=>{const s=t.length,l=a(3*s);t.forEach((t,e)=>{l[3*e]=t[0],l[3*e+1]=t[1],l[3*e+2]=t[2]});const c={attributeData:{position:l,normal:e,colorFeature:r?.[u],opacityFeature:o?.[u],sizeFeature:n?.[u]},removeDuplicateStartEnd:!1};i.push(c)}),i}function I(t,e,r,o,n,i){if(null==t||0===t.length)return[];const a=E(t,e,o,n,i);return t.forEach((t,e)=>{const o=r?.[e],n=null!=o?G(o.timeStamps,o.stage):void 0;a[e].attributeData.timeStamps=n}),a}function x(t,e=0,r=.01){const o=s(t.length);o[0]=0;for(let i=1;i<t.length;i++){const e=t[i-1],r=t[i],n=Math.sqrt((r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2);o[i]=o[i-1]+n}const n=o.map(t=>t*r);if(0!==e&&e<n.length){const t=n[e];for(let e=0;e<n.length;e++)n[e]-=t}return n}function G(t,e){const r=s(t.length*S),o=t[0],n=t[t.length-1];for(let i=0;i<t.length;i++)r[i*S]=t[i],r[i*S+1]=o,r[i*S+2]=n,r[i*S+3]=e+.5;return r}export{I as animatedLineStripsToParameters,m as createGeometry,x as getLinearTimeStamps,E as lineStripsToParameters,S as numTimeStampValuesPerVertex,G as timeStampsToAttribute};
2
+ import{set as t,dist as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ONES as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as s}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as c}from"../../layers/graphics/olidUtils.js";import{Attribute as p}from"../../webgl-engine/lib/Attribute.js";import{Geometry as f}from"../../webgl-engine/lib/Geometry.js";function m(t,e,r=null){const o=[],n=e.mapPositions,i=h(e,o),a=i.data,u=i.indices.length,s=l(u);return g(e,o,s),w(e,o,s),b(e,o,s),y(e,o,i.indices,s),d(e,o,i.indices,s),D(e,o),F(e,o,i.indices,s),j(e,o,a),null!=r&&c(o,r,s),new f(t,o,n)}function h(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:o}=t,n=r.length/3,i=n>2&&A(r)&&o,a=n-(i?1:0),u=new Array(2*(a-1)),s=i?r.slice(0,-3):r;let l=0;for(let p=0;p<a-1;p++)u[l++]=p,u[l++]=p+1;const c=new p(s,u,3,i);return e.push(["position",c]),c}function g(t,e,r){if(null!=t.attributeData.colorFeature)return;const n=t.attributeData.color;e.push(["color",new p(n??o,r,4)])}function b(t,e,r){t.attributeData.normal&&e.push(["normal",new p(t.attributeData.normal,r,3)])}function y(t,e,r,o){const n=t.attributeData.colorFeature;null!=n&&("number"==typeof n?e.push(["colorFeatureAttribute",new p([n],o,1,!0)]):e.push(["colorFeatureAttribute",new p(n,r,1,!0)]))}function w(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new p([t.attributeData.size??1],r,1,!0)])}function d(t,e,r,o){const n=t.attributeData.sizeFeature;null!=n&&("number"==typeof n?e.push(["sizeFeatureAttribute",new p([n],o,1,!0)]):e.push(["sizeFeatureAttribute",new p(n,r,1,!0)]))}function D(t,e){const{attributeData:{position:r,timeStamps:o}}=t;if(!o)return;const n=r.length/3,i=new Array(2*(n-1));let a=0;for(let u=0;u<n-1;u++)i[a++]=u,i[a++]=u+1;e.push(["timeStamps",new p(o,i,S,!0)])}function F(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&("number"==typeof n?e.push(["opacityFeatureAttribute",new p([n],o,1,!0)]):e.push(["opacityFeatureAttribute",new p(n,r,1,!0)]))}function j(r,o,s){if(null==r.overlayInfo||1!==r.overlayInfo.renderCoordsHelper.viewingMode||!r.overlayInfo.spatialReference.isGeographic)return;const l=a(s.length),c=n(r.overlayInfo.spatialReference);for(let t=0;t<l.length;t+=3)i(s,t,l,t,c);const f=s.length/3,m=u(f+1);let h=v,g=z,b=0,y=0;t(h,l[y++],l[y++]),y++,m[0]=0;for(let n=1;n<f+1;++n)n===f&&(y=0),t(g,l[y++],l[y++]),y++,b+=e(h,g),m[n]=b,[h,g]=[g,h];o.push(["distanceToStart",new p(m,o[0][1].indices,1,!0)])}function A(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const v=r(),z=r(),S=4;function E(t,e,r,o,n){if(null==t||0===t.length)return[];const i=[];return t.forEach((t,u)=>{const s=t.length,l=a(3*s);t.forEach((t,e)=>{l[3*e]=t[0],l[3*e+1]=t[1],l[3*e+2]=t[2]});const c={attributeData:{position:l,normal:e,colorFeature:r?.[u],opacityFeature:o?.[u],sizeFeature:n?.[u]},removeDuplicateStartEnd:!1};i.push(c)}),i}function I(t,e,r,o,n,i){if(null==t||0===t.length)return[];const a=E(t,e,o,n,i);return t.forEach((t,e)=>{const o=r?.[e],n=null!=o?G(o.timeStamps,o.stage):void 0;a[e].attributeData.timeStamps=n}),a}function x(t,e=0,r=.01){const o=s(t.length);o[0]=0;for(let i=1;i<t.length;i++){const e=t[i-1],r=t[i],n=Math.sqrt((r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2);o[i]=o[i-1]+n}const n=o.map(t=>t*r);if(0!==e&&e<n.length){const t=n[e];for(let e=0;e<n.length;e++)n[e]-=t}return n}function G(t,e){const r=s(t.length*S),o=t[0],n=t[t.length-1];for(let i=0;i<t.length;i++)r[i*S]=t[i],r[i*S+1]=o,r[i*S+2]=n,r[i*S+3]=e+.5;return r}export{I as animatedLineStripsToParameters,m as createGeometry,x as getLinearTimeStamps,E as lineStripsToParameters,S as numTimeStampValuesPerVertex,G as timeStampsToAttribute};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{crossAndNormalize as t,cross as o,scaleTo as n,add as r,sub as c,len as s,dot as e,negate as i,normalize as f}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{freeze as m,create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";function u(t,o){if(!o.isWGS84&&!o.isWebMercator)return 0;const n=t[0],r=t[1],c=r===2**n-1;return 0===r?c?3:1:c?2:0}function l(r,c){const s=r[0][2]>0,e=r[3][2]<0;if(!s&&!e)return;const i=j;t(i,x,r[0]);const f=v;if(t(f,x,r[1]),s){const s=N,e=r[4],m=S;t(m,e,x),t(s,m,e);const a=r[0];o(a,i,s),n(a,c);const u=r[1];o(u,f,s),n(u,c)}else{const s=N,e=r[5],m=S;t(m,e,x),t(s,e,m);const a=r[3];o(a,s,i),n(a,c);const u=r[2];o(u,s,f),n(u,c)}}function b(t,n,m,a,u){r(h,t,n),r(p,m,a),o(M,h,p),c(g,a,t),o(u,M,g),s(u)<=Number.EPSILON&&(r(u,t,n),r(u,u,m),r(u,u,a)),e(u,h)<0&&i(u,u),f(u,u);const l=e(u,t)/s(t);return Math.sqrt(Math.max(0,1-l*l))}const x=m(0,0,1),h=a(),p=a(),M=a(),g=a(),j=a(),v=a(),N=a(),S=a();export{b as computeSmallestSphericalTileCone,l as correctSphericalTileCornersForLatitude,u as getSphericalTilePole};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fromValues as e,create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import r from"../../../geometry/SpatialReference.js";import{projectVectorToVector as i}from"../../../geometry/projection/projectVectorToVector.js";import{wrap as o}from"../../../geometry/support/aaBoundingBox.js";import{create as s}from"../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as n}from"../../../geometry/support/spatialReferenceUtils.js";import{createPlanarGlobePatch as a,updateEdgesAndCornersPlanar as u,updateEdgeElevationsAndResolutionsPlanar as l}from"./PatchGeometryFactory.js";import{Tile as h}from"./Tile.js";import{intersectAabbInvDirBefore as d}from"../webgl-engine/lib/RayIntersections.js";class m extends h{constructor(e,t,r,i,o){super(),this._horizontalScaleFactor=1,this._extentInRenderSR=s(),this._baseUsedMemory=900,this._subtreeGeometryElevationBoundMin=0,this._subtreeGeometryElevationBoundMax=0,this.init(e,t,r,i,o)}init(t,o,s,a,u){super.init(t,o,s,a,u);const l=u.view.renderSpatialReference,h=u.spatialReference,d=null!=l&&n(l)&&null!=h&&h.isGeographic?this.ellipsoid.radius*Math.PI/180:1;this._horizontalScaleFactor=d;const{isWebMercatorOnPlateCarree:m}=u,c=this._extentInRenderSR,p=this.extent;if(m){const t=e(p[0],p[1],0);i(t,r.WebMercator,t,r.PlateCarree);const o=e(p[2],p[3],0);i(o,r.WebMercator,o,r.PlateCarree),c[0]=t[0],c[1]=t[1],c[2]=o[0],c[3]=o[1]}else for(let e=0;e<4;++e)c[e]=p[e]*d;this.centerAtSeaLevel[0]=.5*(c[0]+c[2]),this.centerAtSeaLevel[1]=.5*(c[1]+c[3]),this.centerAtSeaLevel[2]=0,this._edgeLen=Math.max(c[2]-c[0],c[3]-c[1]),this._edgeLen2=this._edgeLen*this._edgeLen,this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();const e=this._extentInRenderSR,t=.5*(e[2]-e[0]),r=.5*(e[3]-e[1]),i=Math.sqrt(t*t+r*r),o=.5*(this.elevationBoundsMax-this.elevationBoundsMin),s=Math.max(i,o);this._center[1].radius=s}_calculateFrustumVisibility(e){const t=this._aabb(),r=t[0],i=t[1],o=t[2],s=t[3],n=t[4],a=t[5];let u=!0;for(let l=0;l<6;l++){const t=e[l],h=t[0],d=t[1],m=t[2],c=t[3];if(h*(h>0?r:s)+d*(d>0?i:n)+m*(m>0?o:a)+c>=0)return 2;u=u&&h*(h<0?r:s)+d*(d<0?i:n)+m*(m<0?o:a)+c<=0}return u?0:1}_aabb(){const e=this._extentInRenderSR;return o(e[0],e[1],Math.min(this.elevationBoundsMin,this._subtreeGeometryElevationBoundMin),e[2],e[3],Math.max(this.elevationBoundsMax,this._subtreeGeometryElevationBoundMax))}intersectsRay(e,t,r,i){return c[0]=1/t[0],c[1]=1/t[1],c[2]=1/t[2],d(this._aabb(),e,c,r,i)}createGeometry(){a(this.renderData),this._updateSubtreeGeometryElevationsBounds(),this.setMemoryDirty()}_updateSubtreeGeometryElevationsBounds(){const e=this._subtreeGeometryElevationBoundMin,t=this._subtreeGeometryElevationBoundMax,r=this.renderData;let i=e,o=t;if(r){const e=r.geometry.boundingBox;i=e[2],o=e[5]}else if(!this.leaf){i=1/0,o=-1/0;for(const e of this.children){const t=e;i=Math.min(i,t._subtreeGeometryElevationBoundMin),o=Math.max(o,t._subtreeGeometryElevationBoundMax)}}if(i!==this._subtreeGeometryElevationBoundMin||o!==this._subtreeGeometryElevationBoundMax){this._subtreeGeometryElevationBoundMin=i,this._subtreeGeometryElevationBoundMax=o,this.updateVisibility();const e=this.parent;e?._updateSubtreeGeometryElevationsBounds()}}get minimumVerticesPerSide(){return this.level<9?3:2}updateEdgeElevations(){u(this.renderData),this._updateSubtreeGeometryElevationsBounds()}updateEdgeElevationsAndResolutions(){l(this.renderData),this._updateSubtreeGeometryElevationsBounds()}get horizontalScale(){return this._horizontalScaleFactor}}const c=t();export{m as PlanarPatch};
2
+ import{fromValues as e,create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/SpatialReference.js";import{projectVectorToVector as r}from"../../../geometry/projection/projectVectorToVector.js";import{wrap as s}from"../../../geometry/support/aaBoundingBox.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as n}from"../../../geometry/support/spatialReferenceUtils.js";import{sphereIntersectsInfiniteVerticalCylinderConservative as a}from"../support/ElevationAgnosticVisibility.js";import{createPlanarGlobePatch as u,updateEdgesAndCornersPlanar as l,updateEdgeElevationsAndResolutionsPlanar as h}from"./PatchGeometryFactory.js";import{Tile as d}from"./Tile.js";import{intersectAabbInvDirBefore as c}from"../webgl-engine/lib/RayIntersections.js";class m extends d{constructor(e,t,i,r,s){super(),this._horizontalScaleFactor=1,this._extentInRenderSR=o(),this._baseRadius=0,this._baseUsedMemory=900,this._subtreeGeometryElevationBoundMin=0,this._subtreeGeometryElevationBoundMax=0,this.init(e,t,i,r,s)}init(t,s,o,a,u){super.init(t,s,o,a,u);const l=u.view.renderSpatialReference,h=u.spatialReference,d=null!=l&&n(l)&&null!=h&&h.isGeographic?this.ellipsoid.radius*Math.PI/180:1;this._horizontalScaleFactor=d;const{isWebMercatorOnPlateCarree:c}=u,m=this._extentInRenderSR,p=this.extent;if(c){const t=e(p[0],p[1],0);r(t,i.WebMercator,t,i.PlateCarree);const s=e(p[2],p[3],0);r(s,i.WebMercator,s,i.PlateCarree),m[0]=t[0],m[1]=t[1],m[2]=s[0],m[3]=s[1]}else for(let e=0;e<4;++e)m[e]=p[e]*d;this.centerAtSeaLevel[0]=.5*(m[0]+m[2]),this.centerAtSeaLevel[1]=.5*(m[1]+m[3]),this.centerAtSeaLevel[2]=0,this._edgeLen=Math.max(m[2]-m[0],m[3]-m[1]),this._edgeLen2=this._edgeLen*this._edgeLen,this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();const e=this._extentInRenderSR,t=.5*(e[2]-e[0]),i=.5*(e[3]-e[1]),r=Math.sqrt(t*t+i*i);this._baseRadius=r;const s=.5*(this.elevationBoundsMax-this.elevationBoundsMin),o=Math.max(r,s);this._center[1].radius=o}_calculateTileFrustumVisibility(e,t){if(null!=t&&!a(this.centerAtSeaLevel,this._baseRadius,t.center,t.radius))return 2;const i=this._aabb(),r=e,s=i[0],o=i[1],n=i[2],u=i[3],l=i[4],h=i[5];let d=!0;for(let a=0;a<6;a++){const e=r[a],t=e[0],i=e[1],c=e[2],m=e[3];if(t*(t>0?s:u)+i*(i>0?o:l)+c*(c>0?n:h)+m>=0)return 2;d=d&&t*(t<0?s:u)+i*(i<0?o:l)+c*(c<0?n:h)+m<=0}return d?0:1}_aabb(){const e=this._extentInRenderSR;return s(e[0],e[1],Math.min(this.elevationBoundsMin,this._subtreeGeometryElevationBoundMin),e[2],e[3],Math.max(this.elevationBoundsMax,this._subtreeGeometryElevationBoundMax))}intersectsRay(e,t,i,r){return p[0]=1/t[0],p[1]=1/t[1],p[2]=1/t[2],c(this._aabb(),e,p,i,r)}createGeometry(){u(this.renderData),this._updateSubtreeGeometryElevationsBounds(),this.setMemoryDirty()}_updateSubtreeGeometryElevationsBounds(){const e=this._subtreeGeometryElevationBoundMin,t=this._subtreeGeometryElevationBoundMax,i=this.renderData;let r=e,s=t;if(i){const e=i.geometry.boundingBox;r=e[2],s=e[5]}else if(!this.leaf){r=1/0,s=-1/0;for(const e of this.children){const t=e;r=Math.min(r,t._subtreeGeometryElevationBoundMin),s=Math.max(s,t._subtreeGeometryElevationBoundMax)}}if(r!==this._subtreeGeometryElevationBoundMin||s!==this._subtreeGeometryElevationBoundMax){this._subtreeGeometryElevationBoundMin=r,this._subtreeGeometryElevationBoundMax=s,this.updateVisibility();const e=this.parent;e?._updateSubtreeGeometryElevationsBounds()}}get minimumVerticesPerSide(){return this.level<9?3:2}updateEdgeElevations(){l(this.renderData),this._updateSubtreeGeometryElevationsBounds()}updateEdgeElevationsAndResolutions(){h(this.renderData),this._updateSubtreeGeometryElevationsBounds()}get horizontalScale(){return this._horizontalScaleFactor}}const p=t();export{m as PlanarPatch};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{lerp as t}from"../../../core/mathUtils.js";import{normalize as e,set as i,add as s,scale as n,len as o,cross as r,dot as l,dist as a,sub as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lonLatToSphericalPCPF as d}from"../../../geometry/projection/lonLatToSphericalPCPF.js";import{newDoubleArray as p}from"../../../geometry/support/DoubleArray.js";import{intersectsSphere as f,numPlanes as m}from"../../../geometry/support/frustum.js";import{Sphere as g}from"../../../geometry/support/sphere.js";import{createSphericalGlobePatch as x,updateEdgesAndCornersSpherical as $,updateEdgeElevationsAndResolutionsSpherical as v}from"./PatchGeometryFactory.js";import{enableTerrainInternalChecks as M,internalAssert as _,almostEquals as b}from"./terrainUtils.js";import{Tile as j}from"./Tile.js";import{compareTilesByLij as y}from"./tileUtils.js";class B extends j{constructor(t,e,i,s,n){super(),this._convexHull=new Array(24),this._boundingSphere=new g,this._baseUsedMemory=1816,this.init(t,e,i,s,n)}init(i,s,n,o,r){super.init(i,s,n,o,r);const l=this.ellipsoid.radius,a=this.extentInRadians[0],h=this.extentInRadians[1],u=this.extentInRadians[2],c=this.extentInRadians[3],p=t(h,c,.5),f=t(a,u,.5),m=0===i?0:Math.min(Math.abs(h),Math.abs(c));this._edgeLen=(u-a)*Math.cos(m)*l,this._edgeLen2=this._edgeLen*this._edgeLen,this._curvatureHeight=l-Math.sqrt(l*l-this._edgeLen2/4),d(this.centerAtSeaLevel,f,p,this.ellipsoid.radius),e(this.up,this.centerAtSeaLevel),this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateBoundingVolumes();const t=this._center;if(0===this.lij[0])t[1].center=u,i(t[0],0,0,0),i(t[2],0,0,0),t[1].radius=this.ellipsoid.radius+this.elevationBoundsMax;else{this._updateCenter();const e=t[1],i=this.convexHull;let s=0;const n=e.center;for(let t=0;t<8;++t)s=Math.max(s,V(n,i,3*t));t[1].radius=Math.sqrt(s)}}_calculateFrustumVisibility(t){if(!f(t,this._boundingSphere))return 2;if(this.lij[0]<10)return 1;const e=this.convexHull,i=this.surface.view.state.camera.near;let s=!0;for(let n=0;n<m;n++){const o=4===n,r=t[n],l=r[0],a=r[1],h=r[2],u=r[3]-(o?i:0);let c=!1;for(let t=0;t<8;++t){const i=3*t;if(l*e[i]+a*e[i+1]+h*e[i+2]+u<0){if(c=!0,!s)break}else s=!1}if(!c)return 2}return s?0:1}computeElevationBounds(){super.computeElevationBounds(),this._updateBoundingVolumes()}createGeometry(){x(this.renderData,this._getPatchType()),this._updateBoundingVolumes(),this.setMemoryDirty()}_updateBoundingVolumes(){this._updateConvexHull(),this._updateBoundingSphere(),M&&this._checkBVs()}_updateBoundingSphere(){const t=this._boundingSphere,e=this.elevationBoundsMin,i=this.elevationBoundsMax,r=this.ellipsoid.radius,l=i;if(0===this.level)t.center=u,t.radius=r+l;else{const l=this.extentInRadians,a=.5*(l[0]+l[2]),h=l[1],u=l[3];T(I,a,h,r),T(C,a,u,r),s(t.center,I,C);const c=r+.5*(e+i);n(t.center,t.center,c/o(t.center));const d=this.convexHull;let p=0;const f=(t,e)=>{const i=t[0]-d[3*e],s=t[1]-d[3*e+1],n=t[2]-d[3*e+2];return Math.sqrt(i*i+s*s+n*n)};for(let e=0;e<8;++e){const i=f(t.center,e);p=Math.max(p,i)}const m=p;t.radius=m+2}}_updateConvexHull(){const t=this.extentInRadians,i=this.ellipsoid.radius;if(0===this.level)return;const a=this.elevationBoundsMin,u=this.elevationBoundsMax,d=this._getPatchType(),p=this.surface.isWebMercator,f=p&&1===d,m=p&&2===d,g=m||f,x=Math.PI/2,$=t[0],v=t[2],M=m?-x:t[1],j=f?x:t[3],y=.5*($+v),B=a,S=i+(g?Math.min(0,B-1):B),V=(t,e,i)=>T(t,e,i,S),R=c(),I=c(),C=c(),L=c();V(R,$,M),V(I,$,j),V(C,v,j),V(L,v,M);const P=(t,e)=>{for(let i=0;i<3;++i)this._convexHull[3*e+i]=t[i]};P(R,0),P(I,1),P(C,2),P(L,3);const F=u,A=i+(g?Math.max(0,F+1):F),k=c(),w=c(),D=c();T(w,y,j,S),T(D,y,M,S),s(k,w,D),e(k,k);const E=c(),U=c(),q=(t,i)=>{h(U,t,i),e(U,U);const o=-l(t,E)/l(U,E);_(o>=0),n(U,U,o),s(t,t,U)};if(2**this.lij[0]>2*this.lij[1]){const t=D,i=c();r(i,H,t),e(i,i),r(E,t,i),e(E,E),_(b(l(E,t)/o(t),0)),q(R,I),q(L,C),P(R,0),P(L,3)}else if(2**this.lij[0]!==2*this.lij[1]){const t=w,i=c();r(i,H,t),e(i,i),r(E,i,t),e(E,E),q(I,R),q(C,L),P(I,1),P(C,2)}const N=(t,e)=>{const i=A/l(e,k);for(let s=0;s<3;++s)this._convexHull[3*t+s]=e[s]*i};N(4,R),N(5,I),N(6,C),N(7,L)}_getPatchType(){const t=this.lij[1],e=0===t,i=t===(1<<this.level)-1;return e?i?3:1:i?2:0}intersectsRay(t,e,i,s){const n=this._boundingSphere,o=n.radius+i,r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],l=n.center[0]-t[0],a=n.center[1]-t[1],h=n.center[2]-t[2],u=(l*e[0]+a*e[1]+h*e[2])/r,c=e[0]*u-l,d=e[1]*u-a,p=e[2]*u-h;return c*c+d*d+p*p<o*o}get minimumVerticesPerSide(){return this.level<S.length?S[this.level]+1:2}updateEdgeElevations(){$(this.renderData),this._updateBoundingVolumes()}updateEdgeElevationsAndResolutions(){v(this.renderData),this._updateBoundingVolumes()}_checkBVs(){if(!M)return;if(this.level<=2)return;const t=this._boundingSphere,i=t.radius,n=t.center,u=c(),d=this.ellipsoid.radius,f=this.elevationBoundsMin,m=this.elevationBoundsMax,g=d+f,x=1,$=0,v=this._center[1];v.center;const j=v.radius,B=this.convexHull,S=(t,e)=>{for(let i=0;i<3;++i)t[i]=B[3*e+i]};{const t=c(),i=c(),s=c(),n=c(),o=c(),a=(a,u,c,d)=>{S(i,a),S(s,u),S(n,c),h(i,i,s),h(n,n,s),r(t,i,n),e(t,t);const p=l(t,s);S(o,d);const f=l(t,o),m=Math.abs(f-p);_(b(m,0),`Non coplanar ${a},${u},${c},${d} diff = ${m}`)};a(0,1,2,3),a(4,5,6,7),a(0,1,4,5),a(1,2,5,6),a(2,3,6,7),a(3,0,7,4)}const V=p(24),H=(t,e,i)=>{const s=4*t;for(let n=0;n<3;++n)V[s+n]=e[n];V[s+3]=i},I=c(),C=c(),L=c(),P=c(),F=(t,i,s,n)=>{S(I,i),S(C,s),S(L,n),h(I,I,C),e(I,I),h(L,L,C),e(L,L),r(P,I,L),e(P,P);const o=l(P,C);H(t,P,o)};F(0,0,1,2),F(1,1,0,4),F(2,1,5,2),F(3,3,2,6),F(4,4,0,3),F(5,4,6,5);const A=(t,e,i,s)=>{const n=4*t;return V[n]*e+V[n+1]*i+V[n+2]*s-V[n+3]},k=(t,e,i,s)=>A(t,e,i,s)>=-1,w=(t,e)=>k(t,e[0],e[1],e[2]),D=2**this.lij[0]>2*this.lij[1],E=(t,e,s)=>Math.sqrt(R(t,e,s,n[0],n[1],n[2]))<i,U=t=>E(t[0],t[1],t[2]),q=(t,e)=>E(t[e],t[e+1],t[e+2]),N=this.extentInRadians,G=.5*(N[0]+N[2]),z=N[1],O=N[3],W=c(),J=c();T(W,G,O,g),T(J,G,z,g);const K=D?"Upper":"Lower";let Q=!0;for(let e=0;e<6;++e){for(let t=0;t<8;++t){const i=3*t,s=k(e,B[i],B[i+1],B[i+2]);Q&&=s,_(s,`Tile[${this.lij}] Convex hull point ${t} outside of plane ${e}`)}_(w(e,J),`Tile[${this.lij}] (${K}) bottom mid outside of plane ${e}`),_(w(e,W),`Tile[${this.lij}] (${K}) top mid outside of plane ${e}`)}_(Q,"Not all convex hull points are inside convex hull polyhedron"),_(U(J),`Tile[${this.lij}] (${K}) bottom mid outside of bounding sphere`),_(U(W),`Tile[${this.lij}] (${K}) top mid outside of bounding sphere`);for(let e=0;e<8;++e){const t=q(B,3*e);_(t,`Tile[${this.lij}] Convex hull point ${e} outside of bounding sphere`)}for(let e=0;e<6;++e)for(let t=0;t<8;++t){const i=3*t;k(e,B[i],B[i+1],B[i+2])||console.error(`Tile[${this.lij}] Convex hull point ${t} outside of plane ${e}`)}const{extentInRadians:X}=this,Y=Math.max(X[2]-X[0],X[3]-X[1]),Z=Math.round(Y*d),{renderData:tt}=this;if(!tt)return;const{geometry:et,geometryState:it,localOrigin:st}=tt,nt=et.vertexAttributes?.position;if(!nt)return;const ot=c(),rt=et.numVerticesPerSide-2,{indices:lt,indexCount:at,edgeVerticesStartIndex:ht,poleVerticesStartIndex:ut}=et;if(!lt)return;const ct=new Set;for(let e=0;e<at;++e){const t=lt[e];if(ct.has(t))continue;ct.add(t);const r=t<ut,l=t>=ht;let h=!1,c=-1;if(l){let e=ht;for(let i=0;i<4;++i){const s=it.edgeResolutions[i];if(t===e||t===e+s-1){h=!0;break}if(e+=s,t<e){c=i;break}}}const p=l?it.edgePeerNeighbors[c]:null,g=l&&p&&y(this,p)>0;nt.getVec(t,u),s(ot,u,st);const v=o(ot)-d;let M=0,_=!1;const b=f-v,B=v-m,S=b>x,V=B>x,R=S||V,T=()=>{const e=r?"internal":l&&!h?"edge":h?"corner":"pole";return`Tile[${this.lij}].vertex[${t}]:${e}`+(S?"(below)":V?"(above)":"")+(g?"(Neighbor)":"")},H=a(ot,n);if(H>=i+$){const t=H-i;R||(console.error(`${T()} is out of the bounding sphere by ${t.toFixed(0)} / ${i.toFixed(0)}[tol=${$}] h=${v.toFixed(0)} / [${f.toFixed(0)}..${m.toFixed(0)}] (${(t/i).toFixed(0)})`),_=!0)}for(let e=0;e<6;++e)if(!k(e,ot[0],ot[1],ot[2])){const s=A(e,ot[0],ot[1],ot[2]),n=t%rt,o=(t-n)/rt;0===e&&b||5===e&&B||(console.error(`${T()} (${n},${o})|${rt}] is out of the bounding trapezoid plane ${e} h=${Math.round(v)} / [${Math.round(f)}..${Math.round(m)}] dist=${Math.round(s)} radii = ${Math.round(i)}/${Math.round(j)}} : maxL = ${Z}`),++M)}if(_||M>0)break}}get convexHull(){return this._convexHull}}const S=[128,64,64,32,16,8,8,4];function V(t,e,i){return R(t[0],t[1],t[2],e[i],e[i+1],e[i+2])}function R(t,e,i,s,n,o){const r=s-t,l=n-e,a=o-i;return r*r+l*l+a*a}const T=(t,e,i,s)=>{const n=Math.cos(e),o=Math.sin(e),r=Math.cos(i),l=Math.sin(i);t[0]=s*r*n,t[1]=s*r*o,t[2]=s*l},H=[0,0,1],I=c(),C=c();export{B as SphericalPatch};
2
+ import{lerp as t}from"../../../core/mathUtils.js";import{normalize as e,set as i,add as n,scale as s,len as o,dist as r,dot as l,sub as a,cross as u}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h,ZEROS as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lonLatToSphericalPCPF as d}from"../../../geometry/projection/lonLatToSphericalPCPF.js";import{newDoubleArray as p}from"../../../geometry/support/DoubleArray.js";import{intersectsSphere as f,numPlanes as m}from"../../../geometry/support/frustum.js";import{Sphere as g}from"../../../geometry/support/sphere.js";import{sphereIntersectsInfiniteRadialConeConservative as x}from"../support/ElevationAgnosticVisibility.js";import{correctSphericalTileCornersForLatitude as $,computeSmallestSphericalTileCone as v,getSphericalTilePole as _}from"../support/sphericalTileUtils.js";import{createSphericalGlobePatch as b,updateEdgesAndCornersSpherical as M,updateEdgeElevationsAndResolutionsSpherical as j}from"./PatchGeometryFactory.js";import{enableTerrainInternalChecks as y,internalAssert as B,almostEquals as S}from"./terrainUtils.js";import{Tile as C}from"./Tile.js";import{compareTilesByLij as T}from"./tileUtils.js";class A extends C{constructor(t,e,i,n,s){super(),this._convexHull=new Array(24),this._boundingConeAxis=h(),this._boundingConeHalfAngleSin=1,this._boundingSphere=new g,this._baseUsedMemory=1816,this.init(t,e,i,n,s)}init(i,n,s,o,r){super.init(i,n,s,o,r);const l=this.ellipsoid.radius,a=this.extentInRadians[0],u=this.extentInRadians[1],h=this.extentInRadians[2],c=this.extentInRadians[3],p=t(u,c,.5),f=t(a,h,.5),m=0===i?0:Math.min(Math.abs(u),Math.abs(c));this._edgeLen=(h-a)*Math.cos(m)*l,this._edgeLen2=this._edgeLen*this._edgeLen,this._curvatureHeight=l-Math.sqrt(l*l-this._edgeLen2/4),d(this.centerAtSeaLevel,f,p,this.ellipsoid.radius),e(this.up,this.centerAtSeaLevel),this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateBoundingVolumes();const t=this._center;if(0===this.lij[0])t[1].center=c,i(t[0],0,0,0),i(t[2],0,0,0),t[1].radius=this.ellipsoid.radius+this.elevationBoundsMax;else{this._updateCenter();const e=t[1],i=this.convexHull;let n=0;const s=e.center;for(let t=0;t<8;++t)n=Math.max(n,V(s,i,3*t));t[1].radius=Math.sqrt(n)}}_calculateTileFrustumVisibility(t,e){if(!f(t,this._boundingSphere))return 2;if(this.lij[0]<10)return 1;if(null!=e&&0===this._getPatchType()&&!x(this._boundingConeAxis,this._boundingConeHalfAngleSin,e.center,e.radius))return 2;const i=this.convexHull,n=this.surface.view.state.camera.near;let s=!0;for(let o=0;o<m;o++){const e=4===o,r=t[o],l=r[0],a=r[1],u=r[2],h=r[3]-(e?n:0);let c=!1;for(let t=0;t<8;++t){const e=3*t;if(l*i[e]+a*i[e+1]+u*i[e+2]+h<0){if(c=!0,!s)break}else s=!1}if(!c)return 2}return s?0:1}computeElevationBounds(){super.computeElevationBounds(),this._updateBoundingVolumes()}createGeometry(){b(this.renderData,this._getPatchType()),this._updateBoundingVolumes(),this.setMemoryDirty()}_updateBoundingVolumes(){this._updateConvexHull(),this._updateBoundingSphere(),y&&this._checkBVs()}_updateBoundingSphere(){const t=this._boundingSphere,e=this.elevationBoundsMin,i=this.elevationBoundsMax,r=this.ellipsoid.radius,l=i;if(0===this.level)t.center=c,t.radius=r+l;else{const l=this.extentInRadians,a=.5*(l[0]+l[2]),u=l[1],h=l[3];I(L,a,u,r),I(F,a,h,r),n(t.center,L,F);const c=r+.5*(e+i);s(t.center,t.center,c/o(t.center));const d=this.convexHull;let p=0;const f=(t,e)=>{const i=t[0]-d[3*e],n=t[1]-d[3*e+1],s=t[2]-d[3*e+2];return Math.sqrt(i*i+n*n+s*s)};for(let e=0;e<8;++e){const i=f(t.center,e);p=Math.max(p,i)}const m=p;t.radius=m+2}}_updateConvexHull(){const t=this.extentInRadians,i=this.ellipsoid.radius;if(0===this.level)return;const s=this.elevationBoundsMin,o=this.elevationBoundsMax,r=this._getPatchType(),a=this.surface.isWebMercator,u=a&&1===r,c=a&&2===r,d=c||u,p=Math.PI/2,f=t[0],m=t[2],g=c?-p:t[1],x=u?p:t[3],_=.5*(f+m),b=s,M=i+(d?Math.min(0,b-1):b),j=(t,e,i)=>I(t,e,i,M),y=h(),B=h(),S=h(),C=h();j(y,f,g),j(B,f,x),j(S,m,x),j(C,m,g);const T=(t,e)=>{for(let i=0;i<3;++i)this._convexHull[3*e+i]=t[i]};T(y,0),T(B,1),T(S,2),T(C,3);const A=o,H=i+(d?Math.max(0,A+1):A),V=h(),R=h(),L=h();I(R,_,x,M),I(L,_,g,M),n(V,R,L),e(V,V);const F=P;F[0]=y,F[1]=C,F[2]=S,F[3]=B,F[4]=L,F[5]=R,$(F,M),this._boundingConeHalfAngleSin=v(y,C,S,B,this._boundingConeAxis),T(y,0),T(B,1),T(S,2),T(C,3);const E=(t,e)=>{const i=H/l(e,V);for(let n=0;n<3;++n)this._convexHull[3*t+n]=e[n]*i};E(4,y),E(5,B),E(6,S),E(7,C)}_getPatchType(){const t=_(this.lij,this.spatialReference),e=2===t||3===t;return 1===t||3===t?e?3:1:e?2:0}intersectsRay(t,e,i,n){const s=this._boundingSphere,o=s.radius+i,r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],l=s.center[0]-t[0],a=s.center[1]-t[1],u=s.center[2]-t[2],h=(l*e[0]+a*e[1]+u*e[2])/r,c=e[0]*h-l,d=e[1]*h-a,p=e[2]*h-u;return c*c+d*d+p*p<o*o}get minimumVerticesPerSide(){return this.level<H.length?H[this.level]+1:2}updateEdgeElevations(){M(this.renderData),this._updateBoundingVolumes()}updateEdgeElevationsAndResolutions(){j(this.renderData),this._updateBoundingVolumes()}_checkBVs(){if(!y)return;if(this.level<=2)return;const t=this._boundingSphere,i=t.radius,s=t.center,c=h(),d=this.ellipsoid.radius,f=this.elevationBoundsMin,m=this.elevationBoundsMax,g=d+f,x=1,$=0,v=this._center[1];v.center;const _=v.radius,b=this.convexHull,M=(t,e)=>{for(let i=0;i<3;++i)t[i]=b[3*e+i]};{const t=h(),i=h(),n=h(),s=h(),o=h(),r=(r,h,c,d)=>{M(i,r),M(n,h),M(s,c),a(i,i,n),a(s,s,n),u(t,i,s),e(t,t);const p=l(t,n);M(o,d);const f=l(t,o),m=Math.abs(f-p);B(S(m,0),`Non coplanar ${r},${h},${c},${d} diff = ${m}`)};r(0,1,2,3),r(4,5,6,7),r(0,1,4,5),r(1,2,5,6),r(2,3,6,7),r(3,0,7,4)}const j=p(24),C=(t,e,i)=>{const n=4*t;for(let s=0;s<3;++s)j[n+s]=e[s];j[n+3]=i},A=h(),H=h(),V=h(),P=h(),L=(t,i,n,s)=>{M(A,i),M(H,n),M(V,s),a(A,A,H),e(A,A),a(V,V,H),e(V,V),u(P,A,V),e(P,P);const o=l(P,H);C(t,P,o)};L(0,0,1,2),L(1,1,0,4),L(2,1,5,2),L(3,3,2,6),L(4,4,0,3),L(5,4,6,5);const F=(t,e,i,n)=>{const s=4*t;return j[s]*e+j[s+1]*i+j[s+2]*n-j[s+3]},E=(t,e,i,n)=>F(t,e,i,n)>=-1,k=(t,e)=>E(t,e[0],e[1],e[2]),w=2**this.lij[0]>2*this.lij[1],D=(t,e,n)=>Math.sqrt(R(t,e,n,s[0],s[1],s[2]))<i,U=t=>D(t[0],t[1],t[2]),q=(t,e)=>D(t[e],t[e+1],t[e+2]),N=this.extentInRadians,G=.5*(N[0]+N[2]),z=N[1],O=N[3],W=h(),J=h();I(W,G,O,g),I(J,G,z,g);const K=w?"Upper":"Lower";let Q=!0;for(let e=0;e<6;++e){for(let t=0;t<8;++t){const i=3*t,n=E(e,b[i],b[i+1],b[i+2]);Q&&=n,B(n,`Tile[${this.lij}] Convex hull point ${t} outside of plane ${e}`)}B(k(e,J),`Tile[${this.lij}] (${K}) bottom mid outside of plane ${e}`),B(k(e,W),`Tile[${this.lij}] (${K}) top mid outside of plane ${e}`)}B(Q,"Not all convex hull points are inside convex hull polyhedron"),B(U(J),`Tile[${this.lij}] (${K}) bottom mid outside of bounding sphere`),B(U(W),`Tile[${this.lij}] (${K}) top mid outside of bounding sphere`);for(let e=0;e<8;++e){const t=q(b,3*e);B(t,`Tile[${this.lij}] Convex hull point ${e} outside of bounding sphere`)}for(let e=0;e<6;++e)for(let t=0;t<8;++t){const i=3*t;E(e,b[i],b[i+1],b[i+2])||console.error(`Tile[${this.lij}] Convex hull point ${t} outside of plane ${e}`)}const{extentInRadians:X}=this,Y=Math.max(X[2]-X[0],X[3]-X[1]),Z=Math.round(Y*d),{renderData:tt}=this;if(!tt)return;const{geometry:et,geometryState:it,localOrigin:nt}=tt,st=et.vertexAttributes?.position;if(!st)return;const ot=h(),rt=et.numVerticesPerSide-2,{indices:lt,indexCount:at,edgeVerticesStartIndex:ut,poleVerticesStartIndex:ht}=et;if(!lt)return;const ct=new Set;for(let e=0;e<at;++e){const t=lt[e];if(ct.has(t))continue;ct.add(t);const l=t<ht,a=t>=ut;let u=!1,h=-1;if(a){let e=ut;for(let i=0;i<4;++i){const n=it.edgeResolutions[i];if(t===e||t===e+n-1){u=!0;break}if(e+=n,t<e){h=i;break}}}const p=a?it.edgePeerNeighbors[h]:null,g=a&&p&&T(this,p)>0;st.getVec(t,c),n(ot,c,nt);const v=o(ot)-d;let b=0,M=!1;const j=f-v,y=v-m,B=j>x,S=y>x,C=B||S,A=()=>{const e=l?"internal":a&&!u?"edge":u?"corner":"pole";return`Tile[${this.lij}].vertex[${t}]:${e}`+(B?"(below)":S?"(above)":"")+(g?"(Neighbor)":"")},H=r(ot,s);if(H>=i+$){const t=H-i;C||(console.error(`${A()} is out of the bounding sphere by ${t.toFixed(0)} / ${i.toFixed(0)}[tol=${$}] h=${v.toFixed(0)} / [${f.toFixed(0)}..${m.toFixed(0)}] (${(t/i).toFixed(0)})`),M=!0)}for(let e=0;e<6;++e)if(!E(e,ot[0],ot[1],ot[2])){const n=F(e,ot[0],ot[1],ot[2]),s=t%rt,o=(t-s)/rt;0===e&&j||5===e&&y||(console.error(`${A()} (${s},${o})|${rt}] is out of the bounding trapezoid plane ${e} h=${Math.round(v)} / [${Math.round(f)}..${Math.round(m)}] dist=${Math.round(n)} radii = ${Math.round(i)}/${Math.round(_)}} : maxL = ${Z}`),++b)}if(M||b>0)break}}get convexHull(){return this._convexHull}}const H=[128,64,64,32,16,8,8,4];function V(t,e,i){return R(t[0],t[1],t[2],e[i],e[i+1],e[i+2])}function R(t,e,i,n,s,o){const r=n-t,l=s-e,a=o-i;return r*r+l*l+a*a}const I=(t,e,i,n)=>{const s=Math.cos(e),o=Math.sin(e),r=Math.cos(i),l=Math.sin(i);t[0]=n*r*s,t[1]=n*r*o,t[2]=n*l},P=[null,null,null,null,null,null],L=h(),F=h();export{A as SphericalPatch};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{toConst as e}from"../../../core/compilerUtils.js";import"../../../core/has.js";import{clamp as t}from"../../../core/mathUtils.js";import{abortMaybe as i}from"../../../core/maybe.js";import s from"../../../core/ObjectPool.js";import{subtract as n,squaredLength as r,dot as a,scale as l,add as o,length as h,copy as u}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,unitZ as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import{create as p,equals as f,rectangleContainsRectangleCyclicalAware as _,rectanglesIntersectCyclicalAware as m,width as y,height as v}from"../../../geometry/support/aaBoundingRect.js";import{Sphere as M}from"../../../geometry/support/sphere.js";import{isGroupLayer as A}from"../../../layers/support/layerUtils.js";import{isLayerViewWithFlowRenderer as x}from"../support/flowUtils.js";import{ElevationBounds as D}from"./ElevationBounds.js";import{ElevationTileAgent as b,isElevationTileAgent as L}from"./ElevationTileAgent.js";import{LayerClasses as S}from"./LayerClass.js";import{MapDataCacheItem as j}from"./MapDataCacheItem.js";import{MapTileAgent as I,isMapTileAgent as U}from"./MapTileAgent.js";import{maxPatchTesselation as T}from"./TerrainConst.js";import{isVectorTile as C,isTileTexture as B,isRasterTile as w,isCreateBitmapResult as E}from"./TerrainData.js";import{weakAssert as P,isBlendableLayerView as R,oppositeCorner as q,internalAssert as V,enableTerrainInternalChecks as O,neighborEdgeIndices as N,oppositeEdge as G,neighborCornerIndices as k,almostEquals as F,enableWaterproofTests as z,isNorth as W,isSouth as J,isWest as $,isEast as H,isWestCorner as X,isNorthCorner as Y}from"./terrainUtils.js";import{tileAgentDone as Q}from"./TileAgent.js";import{TilePerLayerInfo as K}from"./TilePerLayerInfo.js";import{fallsWithinLayerView as Z}from"./tileUtils.js";const ee=.1;class te{constructor(){this._lij=[0,0,0],this._children=[null,null,null,null],this._pendingUpdates=0,this._dirty=!0,this._previouslyRendered=!1,this._lastElevationSourceUpdateRequestSignature=null,this.extent=p(),this._elevationBoundsMin=NaN,this._elevationBoundsMax=0,this.layerInfo=[[],[]],this.extentInRadians=p(),this.centerAtSeaLevel=d(),this._center=[d(),new M,d()],this.up=c(),this._withinClippingArea=!0,this._intersectsClippingArea=!0,this._maxTesselation=0,this._usedMemory=0,this._rasterTileMemory=0,this._vectorTileMemory=0,this._mapDataRefCount=0,this.screenDepth=0,this.renderOrder=0,this._edgeLen=0,this._edgeLen2=0,this._curvatureHeight=0,this.onCompressionFinished=()=>{this.setPendingUpdate(16),this.setMemoryDirty()},this.extentMidX=0,this.extentMidY=0,this.distanceToPOI=-1,this._lastPOI=d(),this.maxLevelDeltaNeighborCount=0,this.unmergableChildCount=0}get lij(){return this._lij}get spatialReference(){return this._surface.spatialReference??this._surface.tilingScheme.spatialReference}get isDisposed(){return null==this._surface}get elevationLevelDelta(){return this._surface.getElevationLevelDelta(this.level)}_setPendingUpdateForDescendants(){const e=this._children;if(e[0])for(const t of e)t.renderData&&(t.setPendingUpdate(16),t.setMemoryDirty()),t._setPendingUpdateForDescendants()}static prune(){ne.prune(0),re.prune(0),K.prune()}get _cached(){return!this.leaf&&this._mapDataRefCount<=0}get withinClippingArea(){return this._withinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBoundsMin(){return this._elevationBoundsMin}get elevationBoundsMax(){return this._elevationBoundsMax}get level(){return this._lij[0]}get key(){return`${this._lij[0]}/${this._lij[1]}/${this._lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[1].radius}get visible(){return this._dirty&&this.computeVisibility(),this._visible}get frustumVisibility(){return this._dirty&&this.computeVisibility(),this._frustumVisibility}checkVisibility(e){if(this._dirty)return null;const t=this._calculateVisibility(e);if(this._frustumVisibility!==t||this._visible!==(2!==t&&this._intersectsClippingArea))throw new Error(`Assertion failed: waterproof.visibility-cache-mismatch: Tile[${this.lij}]`);return t}computeVisibility(){this._dirty=!1;const e=this.parent?.frustumVisibility??1;this._frustumVisibility=this._calculateVisibility(e);const t=2!==this._frustumVisibility&&this._intersectsClippingArea;t!==this._visible&&(this._visible=t,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setDirty(),this.updateAgentSuspension())}_calculateVisibility(e){const t=this.parent;return 0===e?0:null!=t&&2===e&&this._elevationBoundsMin>=t._elevationBoundsMin&&this._elevationBoundsMax<=t._elevationBoundsMax?2:this._calculateFrustumVisibility(this.surface.frustum)}get _loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const e=!!this.renderData;return e!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=e,this._surface.renderer.setDirty()),e}init(e,t,i,s,n){this._lij[0]=e,this._lij[1]=t,this._lij[2]=i,this.ellipsoid=g(n.tilingScheme.spatialReference),n.tilingScheme.getExtent(e,t,i,this.extent),n.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians),this.extentMidX=.5*(this.extent[0]+this.extent[2]),this.extentMidY=.5*(this.extent[1]+this.extent[3]),this._withinClippingArea=!0,this._intersectsClippingArea=!0,this._clippingArea=null,this._mapDataRefCount=0,n.upsampleMapCache.pop(this.key),this._edgeLen=0,this._edgeLen2=0,this._center[1].radius=0,this.elevationLevel=e,this._lastElevationSourceUpdateRequestSignature=null,s&&!Number.isNaN(s.elevationBoundsMin)?(this._elevationBoundsMin=s.elevationBoundsMin,this._elevationBoundsMax=s.elevationBoundsMax):(this._elevationBoundsMin=0,this._elevationBoundsMax=0),this._pendingUpdates=0,this.renderData=null,this.screenDepth=0,this._visible=!1,this._previouslyRendered=!1,this._parent=s,this.clearChildren(),this._surface=n,this.updateVisibility(),this.maxLevelDeltaNeighborCount=0,this.unmergableChildCount=0;for(const r of S){const e=n.numLayers(r),t=this.layerInfo[r];for(const i of t)i.release();t.length=e;for(let i=0;i<e;i++)t[i]=K.acquire(this._surface.upsampleInfoPool),0===r&&this.findElevationBoundsForLayer(i,-1)}this.computeElevationBounds(),this._maxTesselation=Math.min(n.tilingScheme.pixelSize,T)}dispose(){P(!this.renderData,"tile.renderData was not unloaded"),this._surface?.upsampleMapCache.pop(this.key),this.layerInfo.forEach(e=>{e.forEach(e=>e.release()),e.length=0}),this._surface=this._parent=null,this.clearChildren(),this.setMemoryDirty()}refMapData(){++this._mapDataRefCount,this._cached||this._surface.upsampleMapCache.pop(this.key)}unrefMapData(){--this._mapDataRefCount,this._cached&&this.cachedMemory>0&&this._surface.upsampleMapCache.put(this.key,new j(e(this)))}setMemoryDirty(){this._usedMemory=0}get usedMemory(){return this._ensureUsedMemory()+(this._cached?0:this.mapDataMemory)}get cachedMemory(){return this._ensureUsedMemory(),null==this._surface?this.usedMemory:this._cached?this.mapDataMemory:0}get mapDataMemory(){return this._rasterTileMemory+this._vectorTileMemory}get _cpuImageMemorySize(){const e=4,t=this._surface.tilingScheme.pixelSize;return t*t*e}_ensureUsedMemory(){if(this._usedMemory>0)return this._vectorTileMemory=this.layerInfo[1].reduce((e,{data:t})=>e+(C(t)?t.usedMemoryPerReference:0),0),this._usedMemory;this._usedMemory=this._baseUsedMemory,this._rasterTileMemory=0,this._vectorTileMemory=0;for(const{data:e}of this.layerInfo[1])C(e)?this._vectorTileMemory+=e.usedMemoryPerReference:this._rasterTileMemory+=this.getTerrainDataMemory(e);for(const e of this.layerInfo[0])this._usedMemory+=e.data?this._cpuImageMemorySize:0;return this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._rasterTileMemory+=this.renderData.texture?.usedMemory??0),this._cached&&this._surface.upsampleMapCache.updateSize(this.key),this._usedMemory}getUsedMemoryForLayer(e,t){const i=this.layerInfo[e][t];return i?.data?1===e?this._cached?0:this.getTerrainDataMemory(i.data):0===e?this._cpuImageMemorySize:0:0}getTerrainDataMemory(e){return B(e)?e.texture.usedMemory:w(e)?e.memoryUsage:C(e)?e.usedMemoryPerReference:E(e)?this._cpuImageMemorySize:0}updateScreenDepth(e){const[t,i,s]=this._center[1].center,n=e,r=n[2]*t+n[6]*i+n[10]*s+n[14];this.screenDepth=r<0?0:r/(n[3]*t+n[7]*i+n[11]*s+n[15])}shouldSplit(e,t,i){if(!this.visible)return 0;if(e.frustum&&(!this._intersectsClippingArea||2===this._calculateFrustumVisibility(e.frustum)))return 0;const s=this.level;n(ce,this._center[1].center,t);let u=r(ce),d=ce,c=this._center[1].center;n(ge,this._center[0],t);const g=r(ge);g<u&&(u=g,d=ge,c=this._center[0]),n(pe,this._center[2],t);const p=r(pe);if(p<u&&(u=p,d=pe,c=this._center[2]),this._edgeLen2>u&&s<e.maxLod)return 1;const f=Math.sqrt(u),_=e.fovX*f*2,m=this._edgeLen/_,y=()=>{if(s<e.maxLod)return this.elevationLevel=s,0;const t=s+Math.ceil(-Math.log2(e.relativeWidthLimit/m));return t!==this.elevationLevel?(this.elevationLevel=t,2):0},v=null!=i?i-s:1/0;if(v<=.5)return y();const M=a(this.up,ce),A=this._elevationBoundsMax-this._elevationBoundsMin,x=A/this.edgeLen;if(e.aboveGround&&M>0&&x<.001){if(M/f-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-x>0)return y()}const D=null!=i?3-Math.min(v,2):1;if(m*D<e.relativeWidthLimit||s>=e.maxLod)return y();if(s<7)return 1;l(fe,this.up,M),n(fe,fe,d);const b=r(fe);if(b<=this.radius*this.radius)return 1;l(fe,fe,this.radius/Math.sqrt(b)),o(fe,fe,c),n(fe,t,fe);const L=Math.min(1,(Math.abs(a(fe,this.up))+.5*A+this._curvatureHeight)/h(fe)),S=ee/e.angledSplitBias,j=e.fovY*f*2;return L*(this._edgeLen/j*D)<S*e.relativeHeightLimit?y():1}needsElevationSourceUpdate(){const e=this.renderData?.geometryState.samplerDataSourceLevels;if(null==e)return!1;const t=Math.max(this.elevationLevel-this.elevationLevelDelta,0);return e.some(e=>e>t)&&this._lastElevationSourceUpdateRequestSignature!==this._elevationSourceUpdateRequestSignature(e)}markElevationSourceUpdateRequested(){const e=this.renderData?.geometryState.samplerDataSourceLevels;this._lastElevationSourceUpdateRequestSignature=null!=e?this._elevationSourceUpdateRequestSignature(e):null}_elevationSourceUpdateRequestSignature(e){return`${Math.max(this.elevationLevel-this.elevationLevelDelta,0)}:${e.join(",")}`}createChildren(){const e=this._children,t=this.lij[0]+1,i=2*this.lij[1],s=2*this.lij[2];return e[0]=this.surface.createTile(t,i,s,this),e[1]=this.surface.createTile(t,i,s+1,this),e[2]=this.surface.createTile(t,i+1,s,this),e[3]=this.surface.createTile(t,i+1,s+1,this),e}clearChildren(){this._children[0]=this._children[1]=this._children[2]=this._children[3]=null}get loaded(){return this.renderData?.hasGeometry??!1}get hasGeometryState(){return null!=this.renderData?.geometryState}load(){this.refMapData();for(const e of S)this._createOrUpdateAgents(0,e);this.surface.renderer.loadTile(this)}unload(){this.renderData&&this.unrefMapData(),this.surface.renderer.unloadTile(this);for(const e of S){const t=this.layerInfo[e];for(const e of t)e.loadingAgent&&e.loadingAgent!==Q&&(se(e.loadingAgent),e.loadingAgent=null),e.pendingUpdates=0}this.resetPendingUpdate(8),this.resetPendingUpdate(16),this.resetPendingUpdate(32)}unloadMapData(){const e=this.layerInfo[1];for(const t of e)t.loadingAgent&&t.loadingAgent!==Q&&(se(t.loadingAgent),t.loadingAgent=null),t.pendingUpdates=0,t.invalidateSourceData();this.renderData?.releaseTexture(),this.setMemoryDirty()}updateClippingStatus(e){if(f(e,this._clippingArea))return!1;const t=this._intersectsClippingArea,i=this._withinClippingArea;null!=e?(this._intersectsClippingArea=this.intersectsExtent(e),this._withinClippingArea=this._isWithinExtent(e)):(this._intersectsClippingArea=!0,this._withinClippingArea=!0),this._clippingArea=e,this.updateVisibility();const s=i&&this._withinClippingArea,n=!(i||t||this._withinClippingArea||this._intersectsClippingArea);return!this.renderData||s||n||this.setPendingUpdate(8),!0}updateVisibility(){this._dirty=!0,this._surface.setTileTreeDirty(!1)}getLayerInfo(e,t){return this.layerInfo[t][e]}hasLayerData(e,t){const i=this.layerInfo[t][e];return!(!i?.data||i.dataInvalidated)}get updating(){if(this.hasPendingUpdates)return!0;for(const e of S){const t=this.layerInfo[e];for(const e of t)if(e.loadingAgent&&e.loadingAgent!==Q&&e.loadingAgent.updating)return!0}return!1}_isSuspended(e){return!!this.hasPendingUpdate(1)||0!==e&&!this._loadable}get hasPendingUpdates(){return 0!==this._pendingUpdates}hasPendingUpdate(e){return(this._pendingUpdates&e)===e}setPendingUpdate(e){const t=this._pendingUpdates;return this._pendingUpdates|=e,1===e||4===e?this._surface.setTileTreeDirty(!0):this._surface.requestUpdate(),t!==this._pendingUpdates}resetPendingUpdate(e){return!!this.hasPendingUpdate(e)&&(this._pendingUpdates&=~e,!0)}requestLayerData(e,t,s){const n=this.layerInfo[t][e];if(n.waitingAgents.has(s))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),s.tile.lij.toString(),t,e),!0;if(n.waitingAgents.push(s),n.data&&!n.dataInvalidated){console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),s.tile.lij.toString(),t,e);const i=C(n.data);return s.dataArrived(this,i),!0}if(n.requestPromise)return!0;i(n.requestAbort),n.requestAbort=new AbortController;const r=this._surface.requestTileData(this,e,t,{signal:n.requestAbort.signal});if(!r)return n.requestAbort=null,!1;const a=()=>{n.requestPromise===r&&(n.requestPromise=null,n.requestAbort=null)};return n.requestPromise=r,r.then(a,a),!0}get leaf(){return null==this._children[0]}hasLij(e){return this._lij[0]===e[0]&&this._lij[1]===e[1]&&this._lij[2]===e[2]}findByLij(e){if(this.hasLij(e))return this;const t=this._children;if(!t[0])return null;return t[0].findByLij(e)||t[1].findByLij(e)||t[2].findByLij(e)||t[3].findByLij(e)}distanceToSquared(e){return r(n(fe,this._center[1].center,e))}containsPoint(e){const t=this.extent;return e[0]>=t[0]&&e[1]>=t[1]&&e[0]<=t[2]&&e[1]<=t[3]}containsPointXY(e,t){const i=this.extent;return e>=i[0]&&t>=i[1]&&e<=i[2]&&t<=i[3]}unrequestLayerData(e,t,i){const s=this.layerInfo[t][e],n=s.waitingAgents,r=null!=n.removeUnordered(i);P(r,"agent has not requested this piece of map data"),n.length<1&&(s.abortRequest(),this.setMemoryDirty())}dataArrived(e,t,i){const s=C(i),n=this.layerInfo[t][e];n.data=i,n.dataInvalidated=!1,n.waitingAgents.forAll(e=>e.dataArrived(this,s)),n.waitingAgents.clear(),this.setMemoryDirty()}dataMissing(e,t){const i=this.layerInfo[t][e];i.dataMissing=!0,i.waitingAgents.forAll(e=>e.dataMissing()),i.waitingAgents.clear(),this.setMemoryDirty()}updateRenderData(e,t,i){switch(i&&this.forEachLoadedNeighbor(i=>i.updateRenderData(e,t)),e){case 1:return this._updateTexture(t);case 0:return this._updateGeometry()}}_updateTexture(e){this.renderData&&(this.resetPendingUpdate(0===e?16:32),this.setPendingUpdate(0===e?32:16))}_updateGeometry(){this.setPendingUpdate(8);for(const e of this.layerInfo[0])e.pendingUpdates|=8}invalidateLayerData(e,t){this.layerInfo[t][e].invalidateSourceData()}computeElevationBounds(){const e=this._elevationBoundsMin,t=this._elevationBoundsMax;let i=1/0,s=-1/0;const n=this.layerInfo[0];let r=!0;for(const a of n)null!=a.elevationBounds&&(i=Math.min(i,a.elevationBounds.minElevation),s=Math.max(s,a.elevationBounds.maxElevation),a.elevationBounds.hasNoDataValues||(r=!1));r&&(i=Math.min(i,0),s=Math.max(s,0)),e===i&&t===s||(this._elevationBoundsMin=i,this._elevationBoundsMax=s,this.updateRadiusAndCenter(),this._surface.setTileTreeDirty(!1))}_updateCenter(){const e=this._elevationBoundsMin,t=this._elevationBoundsMax,i=.5*(e+t),s=this._center;l(fe,this.up,i),o(s[1].center,this.centerAtSeaLevel,fe),l(fe,this.up,e),o(s[0],this.centerAtSeaLevel,fe),l(fe,this.up,t),o(s[2],this.centerAtSeaLevel,fe)}findElevationBoundsForLayer(e,t){const i=this.layerInfo[0][e],s=this.elevationLevelDelta,n=Math.max(this.elevationLevel-s,0),r=i.elevationBounds;if(null!=r&&r.level>t&&r.level<=n)return;const a=this._surface.layerViewByIndex(e,0);if(!Z(this,a))return;const l=ae;let o=!1;const h=i.data;if(h&&h.level<=n){const e=i.data;l.minElevation=e.samplerData.data.minValue,l.maxElevation=e.samplerData.data.maxValue,l.hasNoDataValues=e.samplerData.data.hasNoDataValues,l.level=this.level,o=!0}else{let t,i,r=0;for(let a=this._parent;a&&(!i||r<s)&&(r=this.elevationLevel-a.level,t=i||t,i=a.layerInfo[0][e].data,!(!i&&t&&a.level<=n));a=a.parent);i=i||t,i&&(i.computeMinMaxValue(this._lij[0],this._lij[1],this._lij[2],l),l.minElevation!==1/0&&(l.level=i.level,o=!0))}o&&(null==i.elevationBounds&&(i.elevationBounds=new D),i.elevationBounds.copyFrom(l))}modifyLayers(e,t,i){const s=this.layerInfo[i];for(const a of s)a.loadingAgent&&a.loadingAgent!==Q&&(se(a.loadingAgent),a.loadingAgent=null),a.waitingAgents.clear();for(let a=0;a<s.length;++a)void 0===e[a]&&s[a].release();const n=new Array(...s),r=t.length;s.length=r;for(let a=0;a<r;a++){const e=t[a];s[a]=e>-1?n[e]:K.acquire(this._surface.upsampleInfoPool)}this.setMemoryDirty()}restartAgents(e){this.renderData&&(this._createOrUpdateAgents(0,e),this.updateRenderData(e,0))}updateAgents(e){if(this.renderData){const t=this.layerInfo[e];for(const e of t)e.loadingAgent===Q&&(e.loadingAgent=null);this._createOrUpdateAgents(0,e)}}updateAgentSuspension(){for(const e of S){const t=this._isSuspended(e);for(const i of this.layerInfo[e])i.loadingAgent&&i.loadingAgent!==Q&&(i.loadingAgent.setSuspension(t),i.loadingAgent===Q&&this.updateRenderData(e,0))}}removeLayerAgent(e,t){const i=this.layerInfo[t][e];i.loadingAgent&&i.loadingAgent!==Q&&i.loadingAgent.dispose(),i.loadingAgent=null}agentDone(e,t){const i=this.layerInfo[t][e];i.loadingAgent=Q,i.data||null!=i.upsampleInfo||this._createOrUpdateAgents(e+1,t)}_hasBlendableAncestor(e){return"normal"!==e.blendMode||A(e.parent)&&this._hasBlendableAncestor(e.parent)}_hasBlendModes(e,t,i){for(let s=e;s<t;++s){const e=this._surface.layerViewByIndex(s,i);if(R(e)&&"normal"!==e?.layer?.blendMode||A(e?.layer?.parent)&&this._hasBlendableAncestor(e?.layer?.parent))return!0}return!1}_createOrUpdateAgents(e,t){const i=this.layerInfo[t];if(0===i.length)return;const s=this._isSuspended(t);let n=!1;for(let r=e;r<i.length;++r){const a=i[r],l=this._surface.layerViewByIndex(r,t);let o=!1;n&&!x(l)||(a.loadingAgent?Z(this,l)?(a.loadingAgent!==Q&&a.loadingAgent.setSuspension(s),a.loadingAgent!==Q&&(o=a.loadingAgent.update())):a.dispose():Z(this,l)&&(a.loadingAgent=ie(this,r,t,s),o=a.loadingAgent.startLoading(),o?a.loadingAgent===Q&&this.setPendingUpdate(8):(se(a.loadingAgent),a.loadingAgent=Q)),a.loadingAgent===Q&&this.updateRenderData(t,0),!l.destroyed&&!this._hasBlendModes(e,i.length,t)&&o&&l.isOpaque&&(n||=!0))}}_isWithinExtent(e){const t=this.extent;return t[0]>=e[0]&&e[2]>=t[2]&&t[1]>=e[1]&&e[3]>=t[3]}intersectsExtent(e){const t=this.extent;return t[2]>=e[0]&&e[2]>=t[0]&&t[3]>=e[1]&&e[3]>=t[1]}getElevationVerticesPerSide(e){const i=this.elevationLevel-this.level,s=Math.max(this.level-e,this.elevationLevelDelta-i),n=t(1+(this._maxTesselation>>s),2,this._maxTesselation+1),r=this.minimumVerticesPerSide;return Math.max(n,r)}_findLIJ(e,t){if(!e)return null;const{rootTiles:i}=this.surface;if(null!=i)for(const s of i)if(le(s,e)){let i=s,n=e[0]-i.level-1;for(;n>=0&&!i.leaf&&!t(i);){const t=e[1]>>n&1,s=e[2]>>n&1;i=i.children[2*t+s],n--}return t(i)?i:null}return null}findNeighborTile(e,t){const i=this._lij,s=this._getNeighborLIJ(i,e);return s?oe(i,s)?t(this)?this:null:this._findLIJ(s,t):null}findCorner(e,t){const i=1===e?1:7===e?0:5===e?2:3;let s=this;for(;s.children[0]&&(!t||!t(s));)s=s.children[i];return s}findNeighborCornerTileExact(e,t){return this.findNeighborTile(e,e=>t(e)||e.level===this.level)?.findCorner(q(e),t)||null}forAllSubtreeOnSide(e,t){const i=0===e?[0,1]:1===e?[1]:2===e?[1,3]:3===e?[3]:4===e?[2,3]:5===e?[2]:6===e?[0,2]:[0],s=e=>{const n=e.children;!t(e)&&n[0]&&i.forEach(e=>s(n[e]))};s(this)}getNeighborEdgeStartVertexIndex(e,t){if(!t)return 0;const i=this.level-t.level;if(V(!O||i>=0),0===i)return 0;const s=2**i,n=!(1&~e),r=n?0:1,a=t.lij[r+1]*s,l=this._lij[r+1],o=l-a,h=n?s-1-o:o;return O&&(V(a<=l&&l<a+s),V(0<=h&&h<s)),h}forEachLoadedNeighbor(e){const t=this.level,i=e=>e.level===t||e.loaded;N.forEach(t=>{const s=this.findNeighborTile(t,i);null!=s&&s!==this&&s.forAllSubtreeOnSide(G(t),i=>!!i.loaded&&(e(i,t),!0))}),k.forEach(t=>{const s=this.findNeighborTile(t,i)?.findCorner(q(t),e=>e.loaded);V(!s||he(this,s,t)),s?.loaded&&e(s,t)})}_getNeighborLIJ(e,t){const i=W(t)?-1:J(t)?1:0,s=$(t)?-1:H(t)?1:0,n=[e[0],e[1]+i,e[2]+s];return n[1]<0?null:this.surface.isGlobal?this._wrapLIJ(n):n[2]<0?null:n}_wrapLIJ(e){return!e||e[1]<0||e[1]>=2**e[0]?null:this.surface.wrapEastWest(e)}isEdgeNeighbor(e,t){if(null==e)return!1;if(0===this.level&&0===e.level){if(this._eastEnd&&e._westEnd&&2===t)return!0;if(this._westEnd&&e._eastEnd&&6===t)return!0}const i=Math.max(1e-6*(this.extent[2]-this.extent[0]),1);switch(t){case 0:return F(this.extent[3],e.extent[1],i);case 4:return F(this.extent[1],e.extent[3],i);case 2:return F(this.extent[2],e.extent[0],i)||F(this.extent[2],-e.extent[0],i);case 6:return F(this.extent[0],e.extent[2],i)||F(this.extent[0],-e.extent[2],i)}}get _eastEnd(){return this._lij[2]===this.surface.lijEastEnd(this.level)-1}get _westEnd(){return 0===this._lij[2]}checkGeometryWaterproofness(){z&&(V(this.loaded),this.renderData?.checkGeometryWaterproofness())}shouldHaveNeighbor(e){const t=this.extent,{rootTilesExtent:i}=this._surface,s=.25*(t[2]-t[0]);if(W(e)&&t[3]+s>=i[3])return!1;if(J(e)&&t[1]-s<=i[1])return!1;const n=this.surface.isGlobal;return!(!n&&$(e)&&t[0]-s<=i[0])&&!(!n&&H(e)&&t[2]+s>=i[2])}updateDistanceToPOI(e){const t=this._lastPOI;if(this.distanceToPOI>=0&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2])return;u(this._lastPOI,e);const i=this._center[1].center,s=e[0]-i[0],n=e[1]-i[1],r=e[2]-i[2];this.distanceToPOI=s*s+n*n+r*r}updateOverlayParameters(e){const{renderData:t}=this;if(!t)return;const{overlays:i,longitudeCyclical:s}=e,n=t.overlay;if(0===i.length)this._clearTileOverlayData(0,n),this._clearTileOverlayData(1,n);else{const[e,t]=i,r=this.extent;_(e.extent,r,s)||m(r,e.extent,s)||m(r,t.extent,s)?(this._setOverlayData(i,s,r,0,n),this._setOverlayData(i,s,r,1,n)):(this._clearTileOverlayData(0,n),this._clearTileOverlayData(1,n))}}_setOverlayData(e,t,i,s,n){const r=e[s].extent,a=y(r),l=v(r);let o=i[0];if(t){o=t.minimalMonotonic(r[0],o);const e=t.minimalMonotonic(r[0],i[2]);o>e&&(o=e-(i[2]-i[0]))}if(0===a||0===l)return void n.setOffsetAndScale(s,0,0,1,1);const h=y(i)/a,u=v(i)/l,d=(o-r[0])/a,c=(i[1]-r[1])/l;n.setOffsetAndScale(s,d,c,h,u)}_clearTileOverlayData(e,t){t.setOffsetAndScale(e,-1,-1,-1,-1)}}function ie(e,t,i,s){const n=0===i?re.acquire():ne.acquire();return n.init(e,t,i,s),n}function se(e){e.dispose(),L(e)?re.release(e):U(e)&&ne.release(e)}const ne=new s(()=>new I),re=new s(()=>new b),ae=new D;function le(e,t){const i=e.lij,s=t[0]-i[0];return!(s<0)&&(t[1]>>s===i[1]&&t[2]>>s===i[2])}function oe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function he(e,t,i){return null!=e&&null!=t&&t!==e&&(e.level>=t.level?ue(e,t,i):ue(t,e,q(i)))}function ue(e,t,i){V(e.level>=t.level);const s=X(i),n=Y(i),r=e.extent,a=t.extent,l=[s?r[0]:r[2],n?r[3]:r[1]],o=[s?a[2]:a[0],n?a[1]:a[3]],h=1e-5*(r[2]-r[0]),u=F(l[0],o[0],h)||e.surface.isGlobal&&F(l[0],-o[0],h),d=F(l[1],o[1],h);if(u&&d)return!0;if(e.level===t.level)return V(!1),!1;if(!u&&!d)return V(!1),!1;const c=u?de(a[1],a[3],r[1],r[3],h):de(a[0],a[2],r[0],r[2],h);return V(c),c}function de(e,t,i,s,n){return e-n<=i&&i<=s&&s<=t+n}const ce=d(),ge=d(),pe=d(),fe=d();export{te as Tile,he as isCornerNeighbor,oe as lijEquals};
2
+ import{toConst as e}from"../../../core/compilerUtils.js";import"../../../core/has.js";import{clamp as t}from"../../../core/mathUtils.js";import{abortMaybe as i}from"../../../core/maybe.js";import s from"../../../core/ObjectPool.js";import{subtract as n,squaredLength as r,dot as a,scale as l,add as o,length as h,copy as u}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,unitZ as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import{create as p,equals as f,rectangleContainsRectangleCyclicalAware as _,rectanglesIntersectCyclicalAware as m,width as y,height as v}from"../../../geometry/support/aaBoundingRect.js";import{Sphere as M}from"../../../geometry/support/sphere.js";import{isGroupLayer as A}from"../../../layers/support/layerUtils.js";import{isLayerViewWithFlowRenderer as x}from"../support/flowUtils.js";import{ElevationBounds as D}from"./ElevationBounds.js";import{ElevationTileAgent as b,isElevationTileAgent as L}from"./ElevationTileAgent.js";import{LayerClasses as S}from"./LayerClass.js";import{MapDataCacheItem as j}from"./MapDataCacheItem.js";import{MapTileAgent as T,isMapTileAgent as I}from"./MapTileAgent.js";import{maxPatchTesselation as U}from"./TerrainConst.js";import{isVectorTile as B,isTileTexture as C,isRasterTile as w,isCreateBitmapResult as E}from"./TerrainData.js";import{weakAssert as P,isBlendableLayerView as R,oppositeCorner as q,internalAssert as O,enableTerrainInternalChecks as V,neighborEdgeIndices as N,oppositeEdge as G,neighborCornerIndices as k,almostEquals as F,enableWaterproofTests as z,isNorth as W,isSouth as J,isWest as $,isEast as H,isWestCorner as X,isNorthCorner as Y}from"./terrainUtils.js";import{tileAgentDone as Q}from"./TileAgent.js";import{TilePerLayerInfo as K}from"./TilePerLayerInfo.js";import{fallsWithinLayerView as Z}from"./tileUtils.js";const ee=.1;class te{constructor(){this._lij=[0,0,0],this._children=[null,null,null,null],this._pendingUpdates=0,this._dirty=!0,this._previouslyRendered=!1,this._lastElevationSourceUpdateRequestSignature=null,this.extent=p(),this._elevationBoundsMin=NaN,this._elevationBoundsMax=0,this.layerInfo=[[],[]],this.extentInRadians=p(),this.centerAtSeaLevel=d(),this._center=[d(),new M,d()],this.up=c(),this._withinClippingArea=!0,this._intersectsClippingArea=!0,this._maxTesselation=0,this._usedMemory=0,this._rasterTileMemory=0,this._vectorTileMemory=0,this._mapDataRefCount=0,this.screenDepth=0,this.renderOrder=0,this._edgeLen=0,this._edgeLen2=0,this._curvatureHeight=0,this.onCompressionFinished=()=>{this.setPendingUpdate(16),this.setMemoryDirty()},this.extentMidX=0,this.extentMidY=0,this.distanceToPOI=-1,this._lastPOI=d(),this.maxLevelDeltaNeighborCount=0,this.unmergableChildCount=0}get lij(){return this._lij}get spatialReference(){return this._surface.spatialReference??this._surface.tilingScheme.spatialReference}get isDisposed(){return null==this._surface}get elevationLevelDelta(){return this._surface.getElevationLevelDelta(this.level)}_setPendingUpdateForDescendants(){const e=this._children;if(e[0])for(const t of e)t.renderData&&(t.setPendingUpdate(16),t.setMemoryDirty()),t._setPendingUpdateForDescendants()}static prune(){ne.prune(0),re.prune(0),K.prune()}get _cached(){return!this.leaf&&this._mapDataRefCount<=0}get withinClippingArea(){return this._withinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBoundsMin(){return this._elevationBoundsMin}get elevationBoundsMax(){return this._elevationBoundsMax}get level(){return this._lij[0]}get key(){return`${this._lij[0]}/${this._lij[1]}/${this._lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[1].radius}get visible(){return this._dirty&&this.computeVisibility(),this._visible}get frustumVisibility(){return this._dirty&&this.computeVisibility(),this._frustumVisibility}checkVisibility(e){if(this._dirty)return null;const t=this._calculateVisibility(e);if(this._frustumVisibility!==t||this._visible!==(2!==t&&this._intersectsClippingArea))throw new Error(`Assertion failed: waterproof.visibility-cache-mismatch: Tile[${this.lij}]`);return t}computeVisibility(){this._dirty=!1;const e=this.parent?.frustumVisibility??1;this._frustumVisibility=this._calculateVisibility(e);const t=2!==this._frustumVisibility&&this._intersectsClippingArea;t!==this._visible&&(this._visible=t,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setDirty(),this.updateAgentSuspension())}_calculateVisibility(e){const t=this.parent;return 0===e?0:null!=t&&2===e&&this._elevationBoundsMin>=t._elevationBoundsMin&&this._elevationBoundsMax<=t._elevationBoundsMax?2:this._calculateTileFrustumVisibility(this.surface.frustum,this._surface.view.frustum.boundingSphere)}get _loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const e=!!this.renderData;return e!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=e,this._surface.renderer.setDirty()),e}init(e,t,i,s,n){this._lij[0]=e,this._lij[1]=t,this._lij[2]=i,this.ellipsoid=g(n.tilingScheme.spatialReference),n.tilingScheme.getExtent(e,t,i,this.extent),n.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians),this.extentMidX=.5*(this.extent[0]+this.extent[2]),this.extentMidY=.5*(this.extent[1]+this.extent[3]),this._withinClippingArea=!0,this._intersectsClippingArea=!0,this._clippingArea=null,this._mapDataRefCount=0,n.upsampleMapCache.pop(this.key),this._edgeLen=0,this._edgeLen2=0,this._center[1].radius=0,this.elevationLevel=e,this._lastElevationSourceUpdateRequestSignature=null,s&&!Number.isNaN(s.elevationBoundsMin)?(this._elevationBoundsMin=s.elevationBoundsMin,this._elevationBoundsMax=s.elevationBoundsMax):(this._elevationBoundsMin=0,this._elevationBoundsMax=0),this._pendingUpdates=0,this.renderData=null,this.screenDepth=0,this._visible=!1,this._previouslyRendered=!1,this._parent=s,this.clearChildren(),this._surface=n,this.updateVisibility(),this.maxLevelDeltaNeighborCount=0,this.unmergableChildCount=0;for(const r of S){const e=n.numLayers(r),t=this.layerInfo[r];for(const i of t)i.release();t.length=e;for(let i=0;i<e;i++)t[i]=K.acquire(this._surface.upsampleInfoPool),0===r&&this.findElevationBoundsForLayer(i,-1)}this.computeElevationBounds(),this._maxTesselation=Math.min(n.tilingScheme.pixelSize,U)}dispose(){P(!this.renderData,"tile.renderData was not unloaded"),this._surface?.upsampleMapCache.pop(this.key),this.layerInfo.forEach(e=>{e.forEach(e=>e.release()),e.length=0}),this._surface=this._parent=null,this.clearChildren(),this.setMemoryDirty()}refMapData(){++this._mapDataRefCount,this._cached||this._surface.upsampleMapCache.pop(this.key)}unrefMapData(){--this._mapDataRefCount,this._cached&&this.cachedMemory>0&&this._surface.upsampleMapCache.put(this.key,new j(e(this)))}setMemoryDirty(){this._usedMemory=0}get usedMemory(){return this._ensureUsedMemory()+(this._cached?0:this.mapDataMemory)}get cachedMemory(){return this._ensureUsedMemory(),null==this._surface?this.usedMemory:this._cached?this.mapDataMemory:0}get mapDataMemory(){return this._rasterTileMemory+this._vectorTileMemory}get _cpuImageMemorySize(){const e=4,t=this._surface.tilingScheme.pixelSize;return t*t*e}_ensureUsedMemory(){if(this._usedMemory>0)return this._vectorTileMemory=this.layerInfo[1].reduce((e,{data:t})=>e+(B(t)?t.usedMemoryPerReference:0),0),this._usedMemory;this._usedMemory=this._baseUsedMemory,this._rasterTileMemory=0,this._vectorTileMemory=0;for(const{data:e}of this.layerInfo[1])B(e)?this._vectorTileMemory+=e.usedMemoryPerReference:this._rasterTileMemory+=this.getTerrainDataMemory(e);for(const e of this.layerInfo[0])this._usedMemory+=e.data?this._cpuImageMemorySize:0;return this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._rasterTileMemory+=this.renderData.texture?.usedMemory??0),this._cached&&this._surface.upsampleMapCache.updateSize(this.key),this._usedMemory}getUsedMemoryForLayer(e,t){const i=this.layerInfo[e][t];return i?.data?1===e?this._cached?0:this.getTerrainDataMemory(i.data):0===e?this._cpuImageMemorySize:0:0}getTerrainDataMemory(e){return C(e)?e.texture.usedMemory:w(e)?e.memoryUsage:B(e)?e.usedMemoryPerReference:E(e)?this._cpuImageMemorySize:0}updateScreenDepth(e){const[t,i,s]=this._center[1].center,n=e,r=n[2]*t+n[6]*i+n[10]*s+n[14];this.screenDepth=r<0?0:r/(n[3]*t+n[7]*i+n[11]*s+n[15])}shouldSplit(e,t,i){if(!this.visible)return 0;if(e.frustum&&(!this._intersectsClippingArea||2===this._calculateTileFrustumVisibility(e.frustum)))return 0;const s=this.level;n(ce,this._center[1].center,t);const u=r(ce),d=this._closestCenterOnElevationRange(t,ge),c=n(pe,d,t),g=Math.min(u,r(c));if(this._edgeLen2>g&&s<e.maxLod)return 1;const p=Math.sqrt(g),f=e.fovX*p*2,_=this._edgeLen/f,m=()=>{if(s<e.maxLod)return this.elevationLevel=s,0;const t=s+Math.ceil(-Math.log2(e.relativeWidthLimit/_));return t!==this.elevationLevel?(this.elevationLevel=t,2):0},y=null!=i?i-s:1/0;if(y<=.5)return m();const v=a(this.up,ce),M=this._elevationBoundsMax-this._elevationBoundsMin,A=M/this.edgeLen;if(e.aboveGround&&v>0&&A<.001){if(v/p-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-A>0)return m()}const x=null!=i?3-Math.min(y,2):1;if(_*x<e.relativeWidthLimit||s>=e.maxLod)return m();if(s<7)return 1;l(fe,this.up,v),n(fe,fe,c);const D=r(fe);if(D<=this.radius*this.radius)return 1;l(fe,fe,this.radius/Math.sqrt(D)),o(fe,fe,d),n(fe,t,fe);const b=Math.min(1,(Math.abs(a(fe,this.up))+.5*M+this._curvatureHeight)/h(fe)),L=ee/e.angledSplitBias,S=e.fovY*p*2;return b*(this._edgeLen/S*x)<L*e.relativeHeightLimit?m():1}needsElevationSourceUpdate(){const e=this.renderData?.geometryState.samplerDataSourceLevels;if(null==e)return!1;const t=Math.max(this.elevationLevel-this.elevationLevelDelta,0);return e.some(e=>e>t)&&this._lastElevationSourceUpdateRequestSignature!==this._elevationSourceUpdateRequestSignature(e)}markElevationSourceUpdateRequested(){const e=this.renderData?.geometryState.samplerDataSourceLevels;this._lastElevationSourceUpdateRequestSignature=null!=e?this._elevationSourceUpdateRequestSignature(e):null}_elevationSourceUpdateRequestSignature(e){return`${Math.max(this.elevationLevel-this.elevationLevelDelta,0)}:${e.join(",")}`}createChildren(){const e=this._children,t=this.lij[0]+1,i=2*this.lij[1],s=2*this.lij[2];return e[0]=this.surface.createTile(t,i,s,this),e[1]=this.surface.createTile(t,i,s+1,this),e[2]=this.surface.createTile(t,i+1,s,this),e[3]=this.surface.createTile(t,i+1,s+1,this),e}clearChildren(){this._children[0]=this._children[1]=this._children[2]=this._children[3]=null}get loaded(){return this.renderData?.hasGeometry??!1}get hasGeometryState(){return null!=this.renderData?.geometryState}load(){this.refMapData();for(const e of S)this._createOrUpdateAgents(0,e);this.surface.renderer.loadTile(this)}unload(){this.renderData&&this.unrefMapData(),this.surface.renderer.unloadTile(this);for(const e of S){const t=this.layerInfo[e];for(const e of t)e.loadingAgent&&e.loadingAgent!==Q&&(se(e.loadingAgent),e.loadingAgent=null),e.pendingUpdates=0}this.resetPendingUpdate(8),this.resetPendingUpdate(16),this.resetPendingUpdate(32)}unloadMapData(){const e=this.layerInfo[1];for(const t of e)t.loadingAgent&&t.loadingAgent!==Q&&(se(t.loadingAgent),t.loadingAgent=null),t.pendingUpdates=0,t.invalidateSourceData();this.renderData?.releaseTexture(),this.setMemoryDirty()}updateClippingStatus(e){if(f(e,this._clippingArea))return!1;const t=this._intersectsClippingArea,i=this._withinClippingArea;null!=e?(this._intersectsClippingArea=this.intersectsExtent(e),this._withinClippingArea=this._isWithinExtent(e)):(this._intersectsClippingArea=!0,this._withinClippingArea=!0),this._clippingArea=e,this.updateVisibility();const s=i&&this._withinClippingArea,n=!(i||t||this._withinClippingArea||this._intersectsClippingArea);return!this.renderData||s||n||this.setPendingUpdate(8),!0}updateVisibility(){this._dirty=!0,this._surface.setTileTreeDirty(!1)}getLayerInfo(e,t){return this.layerInfo[t][e]}hasLayerData(e,t){const i=this.layerInfo[t][e];return!(!i?.data||i.dataInvalidated)}get updating(){if(this.hasPendingUpdates)return!0;for(const e of S){const t=this.layerInfo[e];for(const e of t)if(e.loadingAgent&&e.loadingAgent!==Q&&e.loadingAgent.updating)return!0}return!1}_isSuspended(e){return!!this.hasPendingUpdate(1)||0!==e&&!this._loadable}get hasPendingUpdates(){return 0!==this._pendingUpdates}hasPendingUpdate(e){return(this._pendingUpdates&e)===e}setPendingUpdate(e){const t=this._pendingUpdates;return this._pendingUpdates|=e,1===e||4===e?this._surface.setTileTreeDirty(!0):this._surface.requestUpdate(),t!==this._pendingUpdates}resetPendingUpdate(e){return!!this.hasPendingUpdate(e)&&(this._pendingUpdates&=~e,!0)}requestLayerData(e,t,s){const n=this.layerInfo[t][e];if(n.waitingAgents.has(s))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),s.tile.lij.toString(),t,e),!0;if(n.waitingAgents.push(s),n.data&&!n.dataInvalidated){console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),s.tile.lij.toString(),t,e);const i=B(n.data);return s.dataArrived(this,i),!0}if(n.requestPromise)return!0;i(n.requestAbort),n.requestAbort=new AbortController;const r=this._surface.requestTileData(this,e,t,{signal:n.requestAbort.signal});if(!r)return n.requestAbort=null,!1;const a=()=>{n.requestPromise===r&&(n.requestPromise=null,n.requestAbort=null)};return n.requestPromise=r,r.then(a,a),!0}get leaf(){return null==this._children[0]}hasLij(e){return this._lij[0]===e[0]&&this._lij[1]===e[1]&&this._lij[2]===e[2]}findByLij(e){if(this.hasLij(e))return this;const t=this._children;if(!t[0])return null;return t[0].findByLij(e)||t[1].findByLij(e)||t[2].findByLij(e)||t[3].findByLij(e)}distanceToSquared(e){return r(n(fe,this._center[1].center,e))}containsPoint(e){const t=this.extent;return e[0]>=t[0]&&e[1]>=t[1]&&e[0]<=t[2]&&e[1]<=t[3]}containsPointXY(e,t){const i=this.extent;return e>=i[0]&&t>=i[1]&&e<=i[2]&&t<=i[3]}unrequestLayerData(e,t,i){const s=this.layerInfo[t][e],n=s.waitingAgents,r=null!=n.removeUnordered(i);P(r,"agent has not requested this piece of map data"),n.length<1&&(s.abortRequest(),this.setMemoryDirty())}dataArrived(e,t,i){const s=B(i),n=this.layerInfo[t][e];n.data=i,n.dataInvalidated=!1,n.waitingAgents.forAll(e=>e.dataArrived(this,s)),n.waitingAgents.clear(),this.setMemoryDirty()}dataMissing(e,t){const i=this.layerInfo[t][e];i.dataMissing=!0,i.waitingAgents.forAll(e=>e.dataMissing()),i.waitingAgents.clear(),this.setMemoryDirty()}updateRenderData(e,t,i){switch(i&&this.forEachLoadedNeighbor(i=>i.updateRenderData(e,t)),e){case 1:return this._updateTexture(t);case 0:return this._updateGeometry()}}_updateTexture(e){this.renderData&&(this.resetPendingUpdate(0===e?16:32),this.setPendingUpdate(0===e?32:16))}_updateGeometry(){this.setPendingUpdate(8);for(const e of this.layerInfo[0])e.pendingUpdates|=8}invalidateLayerData(e,t){this.layerInfo[t][e].invalidateSourceData()}computeElevationBounds(){const e=this._elevationBoundsMin,t=this._elevationBoundsMax;let i=1/0,s=-1/0;const n=this.layerInfo[0];let r=!0;for(const a of n)null!=a.elevationBounds&&(i=Math.min(i,a.elevationBounds.minElevation),s=Math.max(s,a.elevationBounds.maxElevation),a.elevationBounds.hasNoDataValues||(r=!1));r&&(i=Math.min(i,0),s=Math.max(s,0)),e===i&&t===s||(this._elevationBoundsMin=i,this._elevationBoundsMax=s,this.updateRadiusAndCenter(),this._surface.setTileTreeDirty(!1))}_updateCenter(){const e=this._elevationBoundsMin,t=this._elevationBoundsMax,i=.5*(e+t),s=this._center;l(fe,this.up,i),o(s[1].center,this.centerAtSeaLevel,fe),l(fe,this.up,e),o(s[0],this.centerAtSeaLevel,fe),l(fe,this.up,t),o(s[2],this.centerAtSeaLevel,fe)}_closestCenterOnElevationRange(e,t){if(1===this._surface.viewingMode){if(0===this.level)return u(t,this._center[1].center);const i=a(this.up,e),s=Math.max(this.ellipsoid.radius+this._elevationBoundsMin,Math.min(this.ellipsoid.radius+this._elevationBoundsMax,i));return l(t,this.up,s)}const i=Math.max(this._elevationBoundsMin,Math.min(this._elevationBoundsMax,e[2]));return t[0]=this.centerAtSeaLevel[0],t[1]=this.centerAtSeaLevel[1],t[2]=i,t}findElevationBoundsForLayer(e,t){const i=this.layerInfo[0][e],s=this.elevationLevelDelta,n=Math.max(this.elevationLevel-s,0),r=i.elevationBounds;if(null!=r&&r.level>t&&r.level<=n)return;const a=this._surface.layerViewByIndex(e,0);if(!Z(this,a))return;const l=ae;let o=!1;const h=i.data;if(h&&h.level<=n){const e=i.data;l.minElevation=e.samplerData.data.minValue,l.maxElevation=e.samplerData.data.maxValue,l.hasNoDataValues=e.samplerData.data.hasNoDataValues,l.level=this.level,o=!0}else{let t,i,r=0;for(let a=this._parent;a&&(!i||r<s)&&(r=this.elevationLevel-a.level,t=i||t,i=a.layerInfo[0][e].data,!(!i&&t&&a.level<=n));a=a.parent);i=i||t,i&&(i.computeMinMaxValue(this._lij[0],this._lij[1],this._lij[2],l),l.minElevation!==1/0&&(l.level=i.level,o=!0))}o&&(null==i.elevationBounds&&(i.elevationBounds=new D),i.elevationBounds.copyFrom(l))}modifyLayers(e,t,i){const s=this.layerInfo[i];for(const a of s)a.loadingAgent&&a.loadingAgent!==Q&&(se(a.loadingAgent),a.loadingAgent=null),a.waitingAgents.clear();for(let a=0;a<s.length;++a)void 0===e[a]&&s[a].release();const n=new Array(...s),r=t.length;s.length=r;for(let a=0;a<r;a++){const e=t[a];s[a]=e>-1?n[e]:K.acquire(this._surface.upsampleInfoPool)}this.setMemoryDirty()}restartAgents(e){this.renderData&&(this._createOrUpdateAgents(0,e),this.updateRenderData(e,0))}updateAgents(e){if(this.renderData){const t=this.layerInfo[e];for(const e of t)e.loadingAgent===Q&&(e.loadingAgent=null);this._createOrUpdateAgents(0,e)}}updateAgentSuspension(){for(const e of S){const t=this._isSuspended(e);for(const i of this.layerInfo[e])i.loadingAgent&&i.loadingAgent!==Q&&(i.loadingAgent.setSuspension(t),i.loadingAgent===Q&&this.updateRenderData(e,0))}}removeLayerAgent(e,t){const i=this.layerInfo[t][e];i.loadingAgent&&i.loadingAgent!==Q&&i.loadingAgent.dispose(),i.loadingAgent=null}agentDone(e,t){const i=this.layerInfo[t][e];i.loadingAgent=Q,i.data||null!=i.upsampleInfo||this._createOrUpdateAgents(e+1,t)}_hasBlendableAncestor(e){return"normal"!==e.blendMode||A(e.parent)&&this._hasBlendableAncestor(e.parent)}_hasBlendModes(e,t,i){for(let s=e;s<t;++s){const e=this._surface.layerViewByIndex(s,i);if(R(e)&&"normal"!==e?.layer?.blendMode||A(e?.layer?.parent)&&this._hasBlendableAncestor(e?.layer?.parent))return!0}return!1}_createOrUpdateAgents(e,t){const i=this.layerInfo[t];if(0===i.length)return;const s=this._isSuspended(t);let n=!1;for(let r=e;r<i.length;++r){const a=i[r],l=this._surface.layerViewByIndex(r,t);let o=!1;n&&!x(l)||(a.loadingAgent?Z(this,l)?(a.loadingAgent!==Q&&a.loadingAgent.setSuspension(s),a.loadingAgent!==Q&&(o=a.loadingAgent.update())):a.dispose():Z(this,l)&&(a.loadingAgent=ie(this,r,t,s),o=a.loadingAgent.startLoading(),o?a.loadingAgent===Q&&this.setPendingUpdate(8):(se(a.loadingAgent),a.loadingAgent=Q)),a.loadingAgent===Q&&this.updateRenderData(t,0),!l.destroyed&&!this._hasBlendModes(e,i.length,t)&&o&&l.isOpaque&&(n||=!0))}}_isWithinExtent(e){const t=this.extent;return t[0]>=e[0]&&e[2]>=t[2]&&t[1]>=e[1]&&e[3]>=t[3]}intersectsExtent(e){const t=this.extent;return t[2]>=e[0]&&e[2]>=t[0]&&t[3]>=e[1]&&e[3]>=t[1]}getElevationVerticesPerSide(e){const i=this.elevationLevel-this.level,s=Math.max(this.level-e,this.elevationLevelDelta-i),n=t(1+(this._maxTesselation>>s),2,this._maxTesselation+1),r=this.minimumVerticesPerSide;return Math.max(n,r)}_findLIJ(e,t){if(!e)return null;const{rootTiles:i}=this.surface;if(null!=i)for(const s of i)if(le(s,e)){let i=s,n=e[0]-i.level-1;for(;n>=0&&!i.leaf&&!t(i);){const t=e[1]>>n&1,s=e[2]>>n&1;i=i.children[2*t+s],n--}return t(i)?i:null}return null}findNeighborTile(e,t){const i=this._lij,s=this._getNeighborLIJ(i,e);return s?oe(i,s)?t(this)?this:null:this._findLIJ(s,t):null}findCorner(e,t){const i=1===e?1:7===e?0:5===e?2:3;let s=this;for(;s.children[0]&&(!t||!t(s));)s=s.children[i];return s}findNeighborCornerTileExact(e,t){return this.findNeighborTile(e,e=>t(e)||e.level===this.level)?.findCorner(q(e),t)||null}forAllSubtreeOnSide(e,t){const i=0===e?[0,1]:1===e?[1]:2===e?[1,3]:3===e?[3]:4===e?[2,3]:5===e?[2]:6===e?[0,2]:[0],s=e=>{const n=e.children;!t(e)&&n[0]&&i.forEach(e=>s(n[e]))};s(this)}getNeighborEdgeStartVertexIndex(e,t){if(!t)return 0;const i=this.level-t.level;if(O(!V||i>=0),0===i)return 0;const s=2**i,n=!(1&~e),r=n?0:1,a=t.lij[r+1]*s,l=this._lij[r+1],o=l-a,h=n?s-1-o:o;return V&&(O(a<=l&&l<a+s),O(0<=h&&h<s)),h}forEachLoadedNeighbor(e){const t=this.level,i=e=>e.level===t||e.loaded;N.forEach(t=>{const s=this.findNeighborTile(t,i);null!=s&&s!==this&&s.forAllSubtreeOnSide(G(t),i=>!!i.loaded&&(e(i,t),!0))}),k.forEach(t=>{const s=this.findNeighborTile(t,i)?.findCorner(q(t),e=>e.loaded);O(!s||he(this,s,t)),s?.loaded&&e(s,t)})}_getNeighborLIJ(e,t){const i=W(t)?-1:J(t)?1:0,s=$(t)?-1:H(t)?1:0,n=[e[0],e[1]+i,e[2]+s];return n[1]<0?null:this.surface.isGlobal?this._wrapLIJ(n):n[2]<0?null:n}_wrapLIJ(e){return!e||e[1]<0||e[1]>=2**e[0]?null:this.surface.wrapEastWest(e)}isEdgeNeighbor(e,t){if(null==e)return!1;if(0===this.level&&0===e.level){if(this._eastEnd&&e._westEnd&&2===t)return!0;if(this._westEnd&&e._eastEnd&&6===t)return!0}const i=Math.max(1e-6*(this.extent[2]-this.extent[0]),1);switch(t){case 0:return F(this.extent[3],e.extent[1],i);case 4:return F(this.extent[1],e.extent[3],i);case 2:return F(this.extent[2],e.extent[0],i)||F(this.extent[2],-e.extent[0],i);case 6:return F(this.extent[0],e.extent[2],i)||F(this.extent[0],-e.extent[2],i)}}get _eastEnd(){return this._lij[2]===this.surface.lijEastEnd(this.level)-1}get _westEnd(){return 0===this._lij[2]}checkGeometryWaterproofness(){z&&(O(this.loaded),this.renderData?.checkGeometryWaterproofness())}shouldHaveNeighbor(e){const t=this.extent,{rootTilesExtent:i}=this._surface,s=.25*(t[2]-t[0]);if(W(e)&&t[3]+s>=i[3])return!1;if(J(e)&&t[1]-s<=i[1])return!1;const n=this.surface.isGlobal;return!(!n&&$(e)&&t[0]-s<=i[0])&&!(!n&&H(e)&&t[2]+s>=i[2])}updateDistanceToPOI(e){const t=this._lastPOI;if(this.distanceToPOI>=0&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2])return;u(this._lastPOI,e);const i=this._center[1].center,s=e[0]-i[0],n=e[1]-i[1],r=e[2]-i[2];this.distanceToPOI=s*s+n*n+r*r}updateOverlayParameters(e){const{renderData:t}=this;if(!t)return;const{overlays:i,longitudeCyclical:s}=e,n=t.overlay;if(0===i.length)this._clearTileOverlayData(0,n),this._clearTileOverlayData(1,n);else{const[e,t]=i,r=this.extent;_(e.extent,r,s)||m(r,e.extent,s)||m(r,t.extent,s)?(this._setOverlayData(i,s,r,0,n),this._setOverlayData(i,s,r,1,n)):(this._clearTileOverlayData(0,n),this._clearTileOverlayData(1,n))}}_setOverlayData(e,t,i,s,n){const r=e[s].extent,a=y(r),l=v(r);let o=i[0];if(t){o=t.minimalMonotonic(r[0],o);const e=t.minimalMonotonic(r[0],i[2]);o>e&&(o=e-(i[2]-i[0]))}if(0===a||0===l)return void n.setOffsetAndScale(s,0,0,1,1);const h=y(i)/a,u=v(i)/l,d=(o-r[0])/a,c=(i[1]-r[1])/l;n.setOffsetAndScale(s,d,c,h,u)}_clearTileOverlayData(e,t){t.setOffsetAndScale(e,-1,-1,-1,-1)}}function ie(e,t,i,s){const n=0===i?re.acquire():ne.acquire();return n.init(e,t,i,s),n}function se(e){e.dispose(),L(e)?re.release(e):I(e)&&ne.release(e)}const ne=new s(()=>new T),re=new s(()=>new b),ae=new D;function le(e,t){const i=e.lij,s=t[0]-i[0];return!(s<0)&&(t[1]>>s===i[1]&&t[2]>>s===i[2])}function oe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function he(e,t,i){return null!=e&&null!=t&&t!==e&&(e.level>=t.level?ue(e,t,i):ue(t,e,q(i)))}function ue(e,t,i){O(e.level>=t.level);const s=X(i),n=Y(i),r=e.extent,a=t.extent,l=[s?r[0]:r[2],n?r[3]:r[1]],o=[s?a[2]:a[0],n?a[1]:a[3]],h=1e-5*(r[2]-r[0]),u=F(l[0],o[0],h)||e.surface.isGlobal&&F(l[0],-o[0],h),d=F(l[1],o[1],h);if(u&&d)return!0;if(e.level===t.level)return O(!1),!1;if(!u&&!d)return O(!1),!1;const c=u?de(a[1],a[3],r[1],r[3],h):de(a[0],a[2],r[0],r[2],h);return O(c),c}function de(e,t,i,s,n){return e-n<=i&&i<=s&&s<=t+n}const ce=d(),ge=d(),pe=d(),fe=d();export{te as Tile,he as isCornerNeighbor,oe as lijEquals};
@@ -40,9 +40,15 @@ cov3D[2], cov3D[4], cov3D[5]
40
40
  mat3 covariance2D = transpose(covarianceProjection) * transpose(covariance3D) * covarianceProjection;
41
41
  return vec3(covariance2D[0][0], covariance2D[0][1], covariance2D[1][1]);
42
42
  }
43
- void computePackedGaussianCovariance3D(uvec4 packedGaussian, out vec3 covarianceA, out vec3 covarianceB) {
44
- vec3 scale = unpackScale(packedGaussian);
43
+ void computePackedGaussianCovariance3D(
44
+ uvec4 packedGaussian,
45
+ out vec3 covarianceA,
46
+ out vec3 covarianceB,
47
+ out vec3 scale,
48
+ out mat3 rotation
49
+ ) {
50
+ scale = unpackScale(packedGaussian);
45
51
  vec4 quaternion = unpackQuaternion(packedGaussian);
46
- mat3 rotation = quaternionToRotationMatrix(quaternion);
52
+ rotation = quaternionToRotationMatrix(quaternion);
47
53
  computeCovariance3D(rotation, scale.xyz, covarianceA, covarianceB);
48
54
  }`)}export{c as GaussianSplatCovariance};
@@ -32,18 +32,15 @@ return normalize(vec2(covariance2D.y, majorEigenvalue - covariance2D.x));
32
32
  vec2 computeGaussianUnitQuadCorner(int vertexID) {
33
33
  return vec2((vertexID << 1) & 2, vertexID & 2) - 1.0;
34
34
  }
35
- vec2 computeGaussianQuadOffset(vec3 covariance2D, vec2 eigenvalues, vec2 axisLengths, int vertexID) {
35
+ vec2 computeGaussianQuadOffset(vec3 covariance2D, vec2 eigenvalues, vec2 axisLengths, vec2 corner) {
36
36
  vec2 majorAxisDirection = computeGaussianMajorAxisDirection(covariance2D, eigenvalues.x);
37
37
  vec2 majorAxis = axisLengths.x * majorAxisDirection;
38
38
  vec2 minorAxis = axisLengths.y * vec2(majorAxisDirection.y, -majorAxisDirection.x);
39
- vec2 corner = computeGaussianUnitQuadCorner(vertexID);
40
39
  return corner.x * majorAxis + corner.y * minorAxis;
41
40
  }
42
- vec3 computeGaussianConic(vec3 covariance2D, float determinant) {
43
- return vec3(covariance2D.z, -covariance2D.y, covariance2D.x) * (1.0 / determinant);
41
+ vec2 computeGaussianCanonicalCoordinates(vec2 corner, vec2 eigenvalues, vec2 axisLengths) {
42
+ return corner * axisLengths * inversesqrt(eigenvalues);
44
43
  }
45
- float evaluateGaussianExponent(vec3 conic, vec2 offsetFromCenter) {
46
- float x = offsetFromCenter.x;
47
- float y = offsetFromCenter.y;
48
- return -0.5 * dot(conic, vec3(x * x, 2.0 * x * y, y * y));
44
+ float evaluateGaussianExponent(vec2 canonicalCoordinates) {
45
+ return -0.5 * dot(canonicalCoordinates, canonicalCoordinates);
49
46
  }`)}export{a as GaussianSplatEvaluation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{removeUnordered as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{sort as t}from"../../../../core/heapSort.js";import{isPromiseLike as r,createAbortError as s}from"../../../../core/promiseUtils.js";import{signal as n}from"../../../../core/signal.js";import{getEmissions as o}from"./emissive/emissions.js";import{DepthRange as i}from"../lib/DepthRange.js";class h{constructor(e){this.context=e,this._renderPlugins=new Array,this._slots=new Array,this._version=n(0);for(let t=0;t<20;++t)this._slots[t]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,t){const n=()=>{if(t?.aborted)throw e.uninitializeRenderContext(),s();this._renderPlugins.push(e),e.produces.forEach((t,r)=>this._slots[r].push(e)),this.context.requestRender(),this._version.value++},o=e.initializeRenderContext(this.context,t);if(r(o))return o.then(n);n()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}sortTestsTransparentOrderedSlots(e){if("test"!==process.env.NODE_ENV)return;if(this._renderPlugins.some(e=>0!==e.testsTransparentRenderOrder))for(const r of e){const e=this._slots[r];t(e,0,e.length,(e,t)=>(e.testsTransparentRenderOrder??0)-(t.testsTransparentRenderOrder??0))}}prepareRender(){this._renderPlugins.forEach(e=>e.prepareRender?.(this.context.renderContext))}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(r=>t=r.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;const t=this.context.renderContext.bind.slot;for(const r of e)this.context.renderContext.bind.slot=r,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(const t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){const t=this.context.renderContext.bind.slot,r=this.context.renderContext.output;this._slots[t].forEach(s=>{const n=s.produces.get(t);if(!n?.(r)||s.isDecoration&&!this.context.renderContext.bind.decorations)return;const o=s.acquireTechniques(this.context.renderContext);o&&e(s,o)})}queryDepthRange(e){return this._renderPlugins.reduce((t,r)=>t.union(r.queryDepthRange?.(e)),new i)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(r=>{const s=r.produces.get(t);return!!s&&s(e)}))}hasHighlight(e){return d.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get emissions(){return o(this._renderPlugins)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const d=[2,4,18,12,13,14];export{h as RenderPluginManager};
2
+ import{removeUnordered as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{isPromiseLike as t,createAbortError as r}from"../../../../core/promiseUtils.js";import{signal as s}from"../../../../core/signal.js";import{getEmissions as n}from"./emissive/emissions.js";import{DepthRange as i}from"../lib/DepthRange.js";class o{constructor(e){this.context=e,this._renderPlugins=new Array,this._slots=new Array,this._version=s(0);for(let t=0;t<20;++t)this._slots[t]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,s){const n=()=>{if(s?.aborted)throw e.uninitializeRenderContext(),r();this._renderPlugins.push(e),e.produces.forEach((t,r)=>this._slots[r].push(e)),this.context.requestRender(),this._version.value++},i=e.initializeRenderContext(this.context,s);if(t(i))return i.then(n);n()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}sortTestsTransparentOrderedSlots(e){if("test"!==process.env.NODE_ENV)return;if(this._renderPlugins.some(e=>0!==e.testsTransparentRenderOrder))for(const t of e){this._slots[t].sort((e,t)=>(e.testsTransparentRenderOrder??0)-(t.testsTransparentRenderOrder??0))}}prepareRender(){this._renderPlugins.forEach(e=>e.prepareRender?.(this.context.renderContext))}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(r=>t=r.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;const t=this.context.renderContext.bind.slot;for(const r of e)this.context.renderContext.bind.slot=r,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(const t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){const t=this.context.renderContext.bind.slot,r=this.context.renderContext.output;this._slots[t].forEach(s=>{const n=s.produces.get(t);if(!n?.(r)||s.isDecoration&&!this.context.renderContext.bind.decorations)return;const i=s.acquireTechniques(this.context.renderContext);i&&e(s,i)})}queryDepthRange(e){return this._renderPlugins.reduce((t,r)=>t.union(r.queryDepthRange?.(e)),new i)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(r=>{const s=r.produces.get(t);return!!s&&s(e)}))}hasHighlight(e){return d.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get emissions(){return n(this._renderPlugins)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const d=[2,4,18,12,13,14];export{o as RenderPluginManager};