@arcgis/core 5.2.0-next.94 → 5.2.0-next.96

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 (604) hide show
  1. package/applications/WebEditor/geometryUtils.d.ts +1 -1
  2. package/arcade/arcadeAsyncRuntime.js +1 -1
  3. package/arcade/arcadeCompiler.js +1 -1
  4. package/arcade/arcadeRuntime.js +1 -1
  5. package/arcade/containerUtils.js +1 -1
  6. package/arcade/functions/track.js +1 -1
  7. package/arcgisGlobal.d.ts +2 -0
  8. package/assets/components/assets/icon/aiAgent16.json +1 -0
  9. package/assets/components/assets/icon/aiAgent24.json +1 -0
  10. package/assets/components/assets/icon/aiAgent32.json +1 -0
  11. package/assets/components/assets/icon/aiAgents16.json +1 -0
  12. package/assets/components/assets/icon/aiAgents24.json +1 -0
  13. package/assets/components/assets/icon/aiAgents32.json +1 -0
  14. package/assets/components/assets/icon/explodeGeometry16.json +1 -0
  15. package/assets/components/assets/icon/explodeGeometry24.json +1 -0
  16. package/assets/components/assets/icon/explodeGeometry32.json +1 -0
  17. package/assets/components/assets/icon/integration16.json +1 -0
  18. package/assets/components/assets/icon/integration24.json +1 -0
  19. package/assets/components/assets/icon/integration32.json +1 -0
  20. package/assets/components/assets/icon/spatiotemporalCatalog16.json +1 -0
  21. package/assets/components/assets/icon/spatiotemporalCatalog24.json +1 -0
  22. package/assets/components/assets/icon/spatiotemporalCatalog32.json +1 -0
  23. package/assets/components/assets/input-time-zone/t9n/messages.de.json +1 -1
  24. package/assets/esri/core/workers/RemoteClient.js +1 -1
  25. package/assets/esri/core/workers/chunks/000f91a18c22377f8525.js +1 -0
  26. package/assets/esri/core/workers/chunks/{c4a0d3149947a1d2c484.js → 006146ad6d4a5cbf1a1f.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{bd1a7e95a797e1ed4a7b.js → 013c17e07756fa465845.js} +1 -1
  28. package/assets/esri/core/workers/chunks/014eaccf2c2d357981f0.js +1 -0
  29. package/assets/esri/core/workers/chunks/{f253875feb11883deb84.js → 04d4cd66485b622403d0.js} +1 -1
  30. package/assets/esri/core/workers/chunks/05eb064f9b543890ae24.js +1 -0
  31. package/assets/esri/core/workers/chunks/05fbd1f373cfa3724f0c.js +1 -0
  32. package/assets/esri/core/workers/chunks/0809a55a2f9be07cc5a9.js +1 -0
  33. package/assets/esri/core/workers/chunks/0930738f43ce09b2ed2d.js +1 -0
  34. package/assets/esri/core/workers/chunks/{691434d4c6a38e63d819.js → 0a242e76bc293b0ad04b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/0a4092578dc7578bcf76.js +1 -0
  36. package/assets/esri/core/workers/chunks/0e11bee9b56a7f51b012.js +1 -0
  37. package/assets/esri/core/workers/chunks/0e65869a5dd5a3917da7.js +1 -0
  38. package/assets/esri/core/workers/chunks/0ffb5a1275d07dcd9115.js +1 -0
  39. package/assets/esri/core/workers/chunks/{e370a3337b3c90240e73.js → 105da965fc90604eb6bf.js} +1 -1
  40. package/assets/esri/core/workers/chunks/1082bb0858585bd4fa21.js +2 -0
  41. package/assets/esri/core/workers/chunks/10c13c36c42c5ac41d12.js +1 -0
  42. package/assets/esri/core/workers/chunks/{5235b9c21ac4156c2375.js → 10f4c5533f50c3693318.js} +1 -1
  43. package/assets/esri/core/workers/chunks/1201bb22a2bfd7d7ecba.js +1 -0
  44. package/assets/esri/core/workers/chunks/16f55c5d642a23c2547e.js +1 -0
  45. package/assets/esri/core/workers/chunks/{09e01fd1c199be0c8e03.js → 16ffbe484f6cd4736f79.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{1bf967c68d0c795d3fb4.js → 19a4907fc93ae8b817e9.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{f74c7cbe4bd12f73ae90.js → 19d7339f20f3008c4893.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{9226205850e35b7fc610.js → 1a9f17781e0a3bc5106f.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{bf7875fda48b15271a10.js → 1bef7097fe5e402539ea.js} +1 -1
  50. package/assets/esri/core/workers/chunks/1d7f633f158062eb3f64.js +1 -0
  51. package/assets/esri/core/workers/chunks/{fa377112ef3b78f6ed18.js → 1de1cc0ed0f169a58aff.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{0549e2badf511e27aa54.js → 1e3b07cf0e608431a277.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{8a87e1a89a0d8c6203a7.js → 20feca2fdd304b3e9664.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{4c73c2f4331351e2a50c.js → 22ff018342860249b3eb.js} +1 -1
  55. package/assets/esri/core/workers/chunks/248df6fda489a9de5852.js +1 -0
  56. package/assets/esri/core/workers/chunks/2524e2385f61a6898411.js +1 -0
  57. package/assets/esri/core/workers/chunks/279b16727d4b515eca44.js +1 -0
  58. package/assets/esri/core/workers/chunks/2b10d6597af3eeec5396.js +1 -0
  59. package/assets/esri/core/workers/chunks/2bd4b536e329112591c4.js +1 -0
  60. package/assets/esri/core/workers/chunks/2c01477b69c38f691e19.js +1 -0
  61. package/assets/esri/core/workers/chunks/2e2349387a2b9903f13c.js +2 -0
  62. package/assets/esri/core/workers/chunks/{e594b6db9caee1f7b9fc.js → 32aa1529e84b839d051d.js} +1 -1
  63. package/assets/esri/core/workers/chunks/33041e50ea02d99480b0.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5d7a5aa608ed6192b016.js → 349982635e921e838030.js} +1 -1
  65. package/assets/esri/core/workers/chunks/35d0a7597473d46866de.js +1 -0
  66. package/assets/esri/core/workers/chunks/374d726fdd0a9848cea5.js +1 -0
  67. package/assets/esri/core/workers/chunks/379f5ca5372d834af497.js +1 -0
  68. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
  69. package/assets/esri/core/workers/chunks/{05393b23ab24126d4236.js → 38bc5d09ae07f486d457.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{d270b49c037085503016.js → 3a9435569ba460ff7e3d.js} +1 -1
  71. package/assets/esri/core/workers/chunks/3bafa01ca01a67d09432.js +1 -0
  72. package/assets/esri/core/workers/chunks/3c7901ea007c9615ba54.js +1 -0
  73. package/assets/esri/core/workers/chunks/4047208f9559e06d7102.js +1 -0
  74. package/assets/esri/core/workers/chunks/4049e9b86c8e27a7ff12.js +1 -0
  75. package/assets/esri/core/workers/chunks/411bbdecba340df11d95.js +2 -0
  76. package/assets/esri/core/workers/chunks/42b5533f94ebcdc4befe.js +1 -0
  77. package/assets/esri/core/workers/chunks/44ca13c874b5aa0ed5a0.js +1 -0
  78. package/assets/esri/core/workers/chunks/{e488e5c62cb375c87a39.js → 471027e4280bd51167b0.js} +1 -1
  79. package/assets/esri/core/workers/chunks/4717831effb1ac6d5f5d.js +1 -0
  80. package/assets/esri/core/workers/chunks/{a89dbef8155d7c4354da.js → 476535cfb06ced74d611.js} +2 -2
  81. package/assets/esri/core/workers/chunks/486f1277fe834c0fc4c1.js +1 -0
  82. package/assets/esri/core/workers/chunks/48ade66f1685a1aaffba.js +1 -0
  83. package/assets/esri/core/workers/chunks/4c088c26d5d546c95c90.js +1 -0
  84. package/assets/esri/core/workers/chunks/4d13c1a04788e5222678.js +1 -0
  85. package/assets/esri/core/workers/chunks/{a46ac0be9aabc4cfedc7.js → 4d7f6c92041d52cc8732.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{595edbc1e9bba47d5676.js → 4f89da01b67b66a92c01.js} +1 -1
  87. package/assets/esri/core/workers/chunks/507bbcde2b39321b50a4.js +1 -0
  88. package/assets/esri/core/workers/chunks/{9b8e33985310f281f084.js → 56a5b65961e722f5cae9.js} +1 -1
  89. package/assets/esri/core/workers/chunks/5830deda121e4c95d199.js +1 -0
  90. package/assets/esri/core/workers/chunks/{19e93d4d37018e3ee849.js → 58a52adc42fbe5cd12c6.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{b0e25ccb5a1e57a82628.js → 58b93f13316196d2e97d.js} +1 -1
  92. package/assets/esri/core/workers/chunks/58f98bd89b644cfdafae.js +1 -0
  93. package/assets/esri/core/workers/chunks/5a8658e4ef5163e8ab3b.js +1 -0
  94. package/assets/esri/core/workers/chunks/5aa3e1e9c701c7fef6e4.js +1 -0
  95. package/assets/esri/core/workers/chunks/5bb8d9d887dd4211afd2.js +1 -0
  96. package/assets/esri/core/workers/chunks/5d7625eb9997cd0dff09.js +1 -0
  97. package/assets/esri/core/workers/chunks/5e56a004b4407b8066eb.js +1 -0
  98. package/assets/esri/core/workers/chunks/5efc66be4576c6f67064.js +1 -0
  99. package/assets/esri/core/workers/chunks/60b1af54e7fc20fd9588.js +1 -0
  100. package/assets/esri/core/workers/chunks/6134a2c6983792787184.js +1 -0
  101. package/assets/esri/core/workers/chunks/6319413b89e23f671487.js +1 -0
  102. package/assets/esri/core/workers/chunks/{e50adcfb392adfb3f79c.js → 633454b27c34f9ec7940.js} +1 -1
  103. package/assets/esri/core/workers/chunks/63c43ebf46964c283b4d.js +1 -0
  104. package/assets/esri/core/workers/chunks/65d3638ded62c5606ae3.js +1 -0
  105. package/assets/esri/core/workers/chunks/{aa0ef4493a7e9bed159f.js → 662f4b39ec44c68e0733.js} +1 -1
  106. package/assets/esri/core/workers/chunks/680bef5e8237cc3bdd84.js +1 -0
  107. package/assets/esri/core/workers/chunks/6835f959952f70972fce.js +1 -0
  108. package/assets/esri/core/workers/chunks/{ddf284648a73b6993737.js → 68d823697c298122ee08.js} +1 -1
  109. package/assets/esri/core/workers/chunks/6aaefd61505027267c9b.js +1 -0
  110. package/assets/esri/core/workers/chunks/6ceb17eada151230abf7.js +1 -0
  111. package/assets/esri/core/workers/chunks/6df29716f75696434807.js +1 -0
  112. package/assets/esri/core/workers/chunks/6e804bd6bb4b0ee44fa9.js +1 -0
  113. package/assets/esri/core/workers/chunks/{ee77999df3785468b2b6.js → 6f6e8b7e6e2c856e4ed1.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{8ea28a4b1afe8bb2d313.js → 7091bbdc36f1f03f14b3.js} +1 -1
  115. package/assets/esri/core/workers/chunks/7608de0d942b4c16b2f6.js +1 -0
  116. package/assets/esri/core/workers/chunks/{4b6f433022a6822706cb.js → 762817d30474c15142b4.js} +1 -1
  117. package/assets/esri/core/workers/chunks/762e9a15b2638475a2b4.js +1 -0
  118. package/assets/esri/core/workers/chunks/79088d5c9c2e6a780929.js +1 -0
  119. package/assets/esri/core/workers/chunks/7bb3411a86cdd736d555.js +1 -0
  120. package/assets/esri/core/workers/chunks/{f3d57c5b9dffd12e45b4.js → 7c3a89c12ea32a071ad4.js} +1 -1
  121. package/assets/esri/core/workers/chunks/7c67596c0792282afdfc.js +1 -0
  122. package/assets/esri/core/workers/chunks/7cef6e5f39137e74bbc3.js +1 -0
  123. package/assets/esri/core/workers/chunks/7efc51324cfc8e08c756.js +1 -0
  124. package/assets/esri/core/workers/chunks/{87e0ceb1a64ab08e679a.js → 7fd54fa2f91cdab44ab3.js} +1 -1
  125. package/assets/esri/core/workers/chunks/822a5020afbca21df7f7.js +1 -0
  126. package/assets/esri/core/workers/chunks/8599d2f2eb0fbb4a8bf5.js +1 -0
  127. package/assets/esri/core/workers/chunks/862f7090ba4a56c07093.js +1 -0
  128. package/assets/esri/core/workers/chunks/{97c7dfd29ad4c2966cb4.js → 88252899a5291ad29710.js} +1 -1
  129. package/assets/esri/core/workers/chunks/8837fbcc0d484659b79c.js +1 -0
  130. package/assets/esri/core/workers/chunks/8dcc7749de3391710864.js +1 -0
  131. package/assets/esri/core/workers/chunks/900dad076347443b3ad9.js +1 -0
  132. package/assets/esri/core/workers/chunks/{f8f7b86bbd62106bc3d4.js → 925f83be3c1eb4b5c6af.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{a4a22149077c7780481c.js → 9378ce457b02717304e6.js} +1 -1
  134. package/assets/esri/core/workers/chunks/93a7cf23f73b23fc7802.js +1 -0
  135. package/assets/esri/core/workers/chunks/93c1d1e7c0935242071e.js +1 -0
  136. package/assets/esri/core/workers/chunks/{fddcb8be714ad18ad0c8.js → 970b33947bf61fccd461.js} +1 -1
  137. package/assets/esri/core/workers/chunks/97aaff86e06380a68df8.js +1 -0
  138. package/assets/esri/core/workers/chunks/9bc7df2b8ae0ed443d13.js +1 -0
  139. package/assets/esri/core/workers/chunks/9cc14a41d4a90f6d626e.js +1 -0
  140. package/assets/esri/core/workers/chunks/9e514a58b1165e273202.js +1 -0
  141. package/assets/esri/core/workers/chunks/9fe1db0762ab3326eab4.js +1 -0
  142. package/assets/esri/core/workers/chunks/{a5bb19d2b7d7db22222b.js → a10188c4d1904965898a.js} +1 -1
  143. package/assets/esri/core/workers/chunks/a2288d44cba34d947613.js +1 -0
  144. package/assets/esri/core/workers/chunks/a26916de4c105859621e.js +1 -0
  145. package/assets/esri/core/workers/chunks/a322afbb48898ce35851.js +1 -0
  146. package/assets/esri/core/workers/chunks/a34cadd486e7fcc79063.js +1 -0
  147. package/assets/esri/core/workers/chunks/{cefb70d633c220cbedf9.js → a4dc1a80ed6604d71722.js} +1 -1
  148. package/assets/esri/core/workers/chunks/{20f6e681ccd8bf884b77.js → a72983c3621810d4b1af.js} +1 -1
  149. package/assets/esri/core/workers/chunks/a8e9aa5461c71c88e2e5.js +1 -0
  150. package/assets/esri/core/workers/chunks/{32f11b4aeae1ef00e466.js → a8f70cece5ce2b095cdd.js} +1 -1
  151. package/assets/esri/core/workers/chunks/ab332bd411d6c7d4190c.js +1 -0
  152. package/assets/esri/core/workers/chunks/{777f2fdf1f4b9f243893.js → ab3a6ce7bc2a27b92469.js} +1 -1
  153. package/assets/esri/core/workers/chunks/{15f4f7e34e14e3cf52e6.js → abd2f8fae6b918fbdd6d.js} +1 -1
  154. package/assets/esri/core/workers/chunks/{b13d2da33ec07e9d41ff.js → b0da2b089a89d643df1e.js} +1 -1
  155. package/assets/esri/core/workers/chunks/{65f4ca7201e7267bfc81.js → b5fcf4165ac72654742d.js} +1 -1
  156. package/assets/esri/core/workers/chunks/b82b523b6837ed1f28d3.js +2 -0
  157. package/assets/esri/core/workers/chunks/{527b87fddf33bb5d519e.js → ba77a8892cb23c7a297d.js} +1 -1
  158. package/assets/esri/core/workers/chunks/bb8089929ded0613d8e7.js +1 -0
  159. package/assets/esri/core/workers/chunks/bc7ca87d3bfe8a4aec81.js +1 -0
  160. package/assets/esri/core/workers/chunks/bc9b96a539f28afcb8cb.js +1 -0
  161. package/assets/esri/core/workers/chunks/{2d07d5a9ec67c39ef10c.js → bd4f29d2681e5596591a.js} +1 -1
  162. package/assets/esri/core/workers/chunks/bf9eba555aebca2c132b.js +1 -0
  163. package/assets/esri/core/workers/chunks/{903c7bd079888f65fef1.js → c3fbd81bb5820e48038f.js} +1 -1
  164. package/assets/esri/core/workers/chunks/c9df18e9ff7367a004b6.js +1 -0
  165. package/assets/esri/core/workers/chunks/ca8061e0a6d78d646ebf.js +1 -0
  166. package/assets/esri/core/workers/chunks/cc73ac8404615dc392d2.js +1 -0
  167. package/assets/esri/core/workers/chunks/{e823c9ccb7bc348d8824.js → ccb26860518dce6d01c0.js} +1 -1
  168. package/assets/esri/core/workers/chunks/cded34b161fcc790e672.js +1 -0
  169. package/assets/esri/core/workers/chunks/{1bf5c0a4bc5a960a3fa2.js → d1d4979e9dcabe5e4619.js} +1 -1
  170. package/assets/esri/core/workers/chunks/d2865c604849ce79183f.js +1 -0
  171. package/assets/esri/core/workers/chunks/{9b81bd62a2c72f592db1.js → d826f6d32b4c5885276a.js} +1 -1
  172. package/assets/esri/core/workers/chunks/d92540d3ffc4af980dd8.js +1 -0
  173. package/assets/esri/core/workers/chunks/dc7853795439ae77ace9.js +1 -0
  174. package/assets/esri/core/workers/chunks/dd55737fba0a8fe68101.js +1684 -0
  175. package/assets/esri/core/workers/chunks/dd8d19eb6b8e955c8067.js +1 -0
  176. package/assets/esri/core/workers/chunks/dda269a088275c823b40.js +1 -0
  177. package/assets/esri/core/workers/chunks/{97e41500fc2d24a88938.js → de95dee8db92cf8f796f.js} +1 -1
  178. package/assets/esri/core/workers/chunks/e1c8767143f9f9d1f049.js +1 -0
  179. package/assets/esri/core/workers/chunks/e5b6fa57cc4028fbd401.js +1 -0
  180. package/assets/esri/core/workers/chunks/{2cf2f2842c19be84ab4d.js → e6cb31c727f799c1297c.js} +1 -1
  181. package/assets/esri/core/workers/chunks/e7fdad0c07beb3614b60.js +1 -0
  182. package/assets/esri/core/workers/chunks/e934ef66d130c212c05b.js +1 -0
  183. package/assets/esri/core/workers/chunks/{7c56446184abcd14678b.js → ea77654c8964cc39b9a6.js} +1 -1
  184. package/assets/esri/core/workers/chunks/eb167f9f6132a6348d2e.js +1 -0
  185. package/assets/esri/core/workers/chunks/ed5ac1efd3cba49be756.js +1 -0
  186. package/assets/esri/core/workers/chunks/ef24fd6c0322e5de9fdf.js +2 -0
  187. package/assets/esri/core/workers/chunks/f219ba010c480bb75684.js +1 -0
  188. package/assets/esri/core/workers/chunks/f331c24247d132589859.js +1 -0
  189. package/assets/esri/core/workers/chunks/fbf2d90240d36f8b423f.js +1 -0
  190. package/assets/esri/core/workers/chunks/{4ee99e654dad6f09abee.js → fc042b9936686785c39e.js} +1 -1
  191. package/assets/esri/core/workers/chunks/fc1658eae7b312502fab.js +1 -0
  192. package/assets/esri/core/workers/chunks/{1ab8307ba9981124f669.js → fd4d124c5bf810d9e352.js} +1 -1
  193. package/assets/esri/core/workers/chunks/ffa35ecc681ec1c4739a.js +1 -0
  194. package/assets/esri/core/workers/chunks/ffca0b2333e760b66d3a.js +1 -0
  195. package/chunks/{GlowBlur.glsl.js → BlurEmission.glsl.js} +1 -1
  196. package/chunks/EmissionComposite.glsl.js +3 -3
  197. package/chunks/Fog.glsl.js +5 -3
  198. package/chunks/RibbonLine.glsl.js +52 -52
  199. package/config.js +1 -1
  200. package/core/timeUtils.d.ts +62 -0
  201. package/core/timeUtils.js +1 -1
  202. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  203. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  204. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  205. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  206. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  207. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  208. package/geometry/Polygon.js +1 -1
  209. package/geometry/geometryEngine.d.ts +36 -36
  210. package/geometry/operators/affineTransformOperator.d.ts +30 -1
  211. package/geometry/operators/affineTransformOperator.js +1 -1
  212. package/geometry/operators/alphaShapeOperator.d.ts +49 -5
  213. package/geometry/operators/alphaShapeOperator.js +1 -1
  214. package/geometry/operators/areaOperator.d.ts +28 -4
  215. package/geometry/operators/areaOperator.js +1 -1
  216. package/geometry/operators/autoCompleteOperator.d.ts +25 -2
  217. package/geometry/operators/autoCompleteOperator.js +1 -1
  218. package/geometry/operators/boundaryOperator.d.ts +40 -2
  219. package/geometry/operators/boundaryOperator.js +1 -1
  220. package/geometry/operators/bufferOperator.d.ts +51 -6
  221. package/geometry/operators/bufferOperator.js +1 -1
  222. package/geometry/operators/centroidOperator.d.ts +23 -2
  223. package/geometry/operators/centroidOperator.js +1 -1
  224. package/geometry/operators/clipOperator.d.ts +34 -2
  225. package/geometry/operators/clipOperator.js +1 -1
  226. package/geometry/operators/containsOperator.d.ts +32 -2
  227. package/geometry/operators/containsOperator.js +1 -1
  228. package/geometry/operators/convexHullOperator.d.ts +47 -4
  229. package/geometry/operators/convexHullOperator.js +1 -1
  230. package/geometry/operators/crossesOperator.d.ts +35 -2
  231. package/geometry/operators/crossesOperator.js +1 -1
  232. package/geometry/operators/cutOperator.d.ts +23 -2
  233. package/geometry/operators/cutOperator.js +1 -1
  234. package/geometry/operators/densifyOperator.d.ts +61 -6
  235. package/geometry/operators/densifyOperator.js +1 -1
  236. package/geometry/operators/differenceOperator.d.ts +34 -2
  237. package/geometry/operators/differenceOperator.js +1 -1
  238. package/geometry/operators/disjointOperator.d.ts +33 -2
  239. package/geometry/operators/disjointOperator.js +1 -1
  240. package/geometry/operators/distanceOperator.d.ts +29 -4
  241. package/geometry/operators/distanceOperator.js +1 -1
  242. package/geometry/operators/equalsOperator.d.ts +32 -2
  243. package/geometry/operators/equalsOperator.js +1 -1
  244. package/geometry/operators/extendOperator.d.ts +29 -3
  245. package/geometry/operators/extendOperator.js +1 -1
  246. package/geometry/operators/generalizeOperator.d.ts +46 -5
  247. package/geometry/operators/generalizeOperator.js +1 -1
  248. package/geometry/operators/geodesicBufferOperator.d.ts +71 -7
  249. package/geometry/operators/geodesicBufferOperator.js +1 -1
  250. package/geometry/operators/geodesicProximityOperator.d.ts +106 -14
  251. package/geometry/operators/geodesicProximityOperator.js +1 -1
  252. package/geometry/operators/geodeticAreaOperator.d.ts +51 -5
  253. package/geometry/operators/geodeticAreaOperator.js +1 -1
  254. package/geometry/operators/geodeticDensifyOperator.d.ts +65 -6
  255. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  256. package/geometry/operators/geodeticDistanceOperator.d.ts +52 -5
  257. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  258. package/geometry/operators/geodeticLengthOperator.d.ts +51 -5
  259. package/geometry/operators/geodeticLengthOperator.js +1 -1
  260. package/geometry/operators/geodeticUtilsOperator.d.ts +79 -9
  261. package/geometry/operators/geodeticUtilsOperator.js +1 -1
  262. package/geometry/operators/graphicBufferOperator.d.ts +47 -4
  263. package/geometry/operators/graphicBufferOperator.js +1 -1
  264. package/geometry/operators/integrateOperator.d.ts +24 -2
  265. package/geometry/operators/integrateOperator.js +1 -1
  266. package/geometry/operators/intersectionOperator.d.ts +88 -3
  267. package/geometry/operators/intersectionOperator.js +1 -1
  268. package/geometry/operators/intersectsOperator.d.ts +32 -2
  269. package/geometry/operators/intersectsOperator.js +1 -1
  270. package/geometry/operators/isNearOperator.d.ts +31 -4
  271. package/geometry/operators/isNearOperator.js +1 -1
  272. package/geometry/operators/json/bufferOperator.js +1 -1
  273. package/geometry/operators/json/containsOperator.js +1 -1
  274. package/geometry/operators/json/convexHullOperator.js +1 -1
  275. package/geometry/operators/json/crossesOperator.js +1 -1
  276. package/geometry/operators/json/disjointOperator.js +1 -1
  277. package/geometry/operators/json/generalizeOperator.js +1 -1
  278. package/geometry/operators/json/geodesicBufferOperator.js +1 -1
  279. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  280. package/geometry/operators/json/intersectionOperator.js +1 -1
  281. package/geometry/operators/json/intersectsOperator.js +1 -1
  282. package/geometry/operators/json/lengthOperator.js +1 -1
  283. package/geometry/operators/json/offsetOperator.js +1 -1
  284. package/geometry/operators/json/overlapsOperator.js +1 -1
  285. package/geometry/operators/json/projectOperator.js +1 -1
  286. package/geometry/operators/json/simplifyOperator.js +1 -1
  287. package/geometry/operators/json/simplifyOperatorOGC.js +1 -1
  288. package/geometry/operators/json/touchesOperator.js +1 -1
  289. package/geometry/operators/json/unionOperator.js +1 -1
  290. package/geometry/operators/json/withinOperator.js +1 -1
  291. package/geometry/operators/labelPointOperator.d.ts +32 -2
  292. package/geometry/operators/labelPointOperator.js +1 -1
  293. package/geometry/operators/lengthOperator.d.ts +28 -4
  294. package/geometry/operators/lengthOperator.js +1 -1
  295. package/geometry/operators/linesToPolygonsOperator.d.ts +23 -2
  296. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  297. package/geometry/operators/locateBetweenOperator.d.ts +28 -2
  298. package/geometry/operators/locateBetweenOperator.js +1 -1
  299. package/geometry/operators/minimumBoundingCircleOperator.d.ts +38 -4
  300. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  301. package/geometry/operators/multiPartToSinglePartOperator.d.ts +33 -4
  302. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  303. package/geometry/operators/offsetOperator.d.ts +50 -5
  304. package/geometry/operators/offsetOperator.js +1 -1
  305. package/geometry/operators/overlapsOperator.d.ts +33 -2
  306. package/geometry/operators/overlapsOperator.js +1 -1
  307. package/geometry/operators/polygonOverlayOperator.d.ts +31 -5
  308. package/geometry/operators/polygonOverlayOperator.js +1 -1
  309. package/geometry/operators/polygonSlicerOperator.d.ts +72 -10
  310. package/geometry/operators/polygonSlicerOperator.js +1 -1
  311. package/geometry/operators/projectOperator.d.ts +63 -3
  312. package/geometry/operators/projectOperator.js +1 -1
  313. package/geometry/operators/proximityOperator.d.ts +71 -9
  314. package/geometry/operators/proximityOperator.js +1 -1
  315. package/geometry/operators/relateOperator.d.ts +41 -2
  316. package/geometry/operators/relateOperator.js +1 -1
  317. package/geometry/operators/reshapeOperator.d.ts +28 -2
  318. package/geometry/operators/reshapeOperator.js +1 -1
  319. package/geometry/operators/shapePreservingProjectOperator.d.ts +64 -6
  320. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  321. package/geometry/operators/simplifyOGCOperator.d.ts +72 -6
  322. package/geometry/operators/simplifyOGCOperator.js +1 -1
  323. package/geometry/operators/simplifyOperator.d.ts +72 -4
  324. package/geometry/operators/simplifyOperator.js +1 -1
  325. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  326. package/geometry/operators/support/Transformation.d.ts +17 -11
  327. package/geometry/operators/support/jsonConverter.js +1 -1
  328. package/geometry/operators/symmetricDifferenceOperator.d.ts +33 -2
  329. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  330. package/geometry/operators/touchesOperator.d.ts +32 -2
  331. package/geometry/operators/touchesOperator.js +1 -1
  332. package/geometry/operators/types.d.ts +4 -1
  333. package/geometry/operators/unionOperator.d.ts +33 -2
  334. package/geometry/operators/unionOperator.js +1 -1
  335. package/geometry/operators/withinOperator.d.ts +32 -2
  336. package/geometry/operators/withinOperator.js +1 -1
  337. package/geometry/projectionUtils.js +1 -1
  338. package/geometry/support/geometryUtils.js +1 -1
  339. package/geometry/support/normalizeUtils.d.ts +5 -3
  340. package/geometry/support/normalizeUtils.js +1 -1
  341. package/interfaces.d.ts +202 -202
  342. package/kernel.js +1 -1
  343. package/layers/AnnotationFeatureLayer.d.ts +0 -1
  344. package/layers/graphics/data/QueryEngineResult.js +1 -1
  345. package/layers/graphics/data/queryUtils.js +1 -1
  346. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  347. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  348. package/layers/mixins/ArcGISImageService.js +1 -1
  349. package/layers/mixins/TiledImagery.js +1 -1
  350. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  351. package/layers/raster/datasets/FunctionRaster.js +1 -1
  352. package/layers/raster/datasets/pixelReader.js +1 -1
  353. package/layers/raster/functions/clipUtils.js +1 -1
  354. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  355. package/layers/support/Sublayer.js +1 -1
  356. package/layers/video/videoUtils.js +1 -1
  357. package/package.json +4 -4
  358. package/popup/FeatureContentCollection.d.ts +3 -3
  359. package/popup/FeatureContentCollection.js +1 -1
  360. package/rest/imageService/fetchRasterInfo.js +1 -1
  361. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  362. package/support/revision.js +1 -1
  363. package/support/tests/serviceMockDependencies.js +1 -1
  364. package/support/tests/setupServiceMocksMesh.js +1 -1
  365. package/symbols/cim/CIMEffects.js +1 -1
  366. package/symbols/cim/effects/EffectBuffer.js +1 -1
  367. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  368. package/symbols/cim/effects/EffectDonut.js +1 -1
  369. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  370. package/symbols/cim/effects/EffectOffset.js +1 -1
  371. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  372. package/symbols/cim/types.d.ts +2 -1
  373. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  374. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
  375. package/views/2d/engine/webgl/Overlay.js +1 -1
  376. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  377. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  378. package/views/2d/layers/TileLayerView2D.js +1 -1
  379. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
  380. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  381. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
  382. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  383. package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
  384. package/views/3d/layers/I3SMeshView3D.js +1 -1
  385. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  386. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  387. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  388. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  389. package/views/3d/state/ViewStateManager.js +1 -1
  390. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  391. package/views/3d/webgl/RenderCamera.js +1 -1
  392. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +1 -5
  393. package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
  394. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  395. package/views/3d/webgl-engine/effects/fog/FogTechnique.js +1 -1
  396. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  397. package/views/3d/webgl-engine/effects/glow/{GlowBlur.glsl.js → BlurEmission.glsl.js} +1 -1
  398. package/views/3d/webgl-engine/effects/glow/BlurEmission.js +2 -0
  399. package/views/3d/webgl-engine/effects/glow/BlurEmissionTechnique.js +2 -0
  400. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +37 -0
  401. package/views/3d/webgl-engine/lib/BufferGeometry.js +2 -0
  402. package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
  403. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  404. package/views/3d/webgl-engine/lib/EmissionCompositeTechnique.js +1 -1
  405. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  406. package/views/3d/webgl-engine/lib/GeometryBaseInstance.js +1 -1
  407. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  408. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  409. package/views/3d/webgl-engine/lib/rendererUtils.js +1 -1
  410. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  411. package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
  412. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  413. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  414. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  415. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  416. package/views/3d/webgl-engine/shaders/EmissiveTechniqueConfiguration.js +1 -1
  417. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  418. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  419. package/views/3d/webgl-engine/shaders/floatBlendScale.glsl.js +1 -1
  420. package/views/MapView.d.ts +3 -3
  421. package/views/SceneView.d.ts +1 -0
  422. package/views/SceneView.js +1 -1
  423. package/views/VideoView.js +1 -1
  424. package/views/View2D.d.ts +22 -22
  425. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  426. package/views/draw/DrawTool.js +1 -1
  427. package/views/draw/support/createUtils.js +1 -1
  428. package/views/layers/SceneLayerView.js +1 -1
  429. package/views/support/GeometryWorker.js +1 -1
  430. package/views/support/imageReprojection.js +1 -1
  431. package/views/video/VideoOperationalDataView.js +1 -1
  432. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  433. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  434. package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
  435. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  436. package/widgets/BatchAttributeForm/templates/FieldElementTemplate.js +1 -1
  437. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  438. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  439. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  440. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  441. package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
  442. package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
  443. package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
  444. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  445. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  446. package/widgets/Features/FeaturesViewModel.js +1 -1
  447. package/widgets/Features.js +1 -1
  448. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  449. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  450. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  451. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  452. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  453. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  454. package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
  455. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  456. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  457. package/widgets/Print.js +1 -1
  458. package/widgets/Search/SearchViewModel.js +1 -1
  459. package/widgets/Search/support/layerSearchUtils.js +1 -1
  460. package/widgets/Search/support/locatorUtils.js +1 -1
  461. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  462. package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +104 -0
  463. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  464. package/widgets/support/FilterBuilder.js +1 -1
  465. package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +145 -0
  466. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  467. package/widgets/support/FilterCondition/types.d.ts +20 -0
  468. package/widgets/support/ItemList.js +1 -1
  469. package/widgets/support/SelectionList/FeatureItem.d.ts +17 -68
  470. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  471. package/widgets/support/SelectionList/GroupLayerItem.d.ts +12 -50
  472. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  473. package/widgets/support/SelectionList/ItemBase.d.ts +14 -44
  474. package/widgets/support/SelectionList/ItemBase.js +1 -1
  475. package/widgets/support/SelectionList/LayerItem.d.ts +10 -56
  476. package/widgets/support/SelectionList/LayerItem.js +1 -1
  477. package/widgets/support/SelectionList/types.d.ts +4 -4
  478. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  479. package/assets/esri/core/workers/chunks/0336f4f8498a22347720.js +0 -1
  480. package/assets/esri/core/workers/chunks/090ea7a131f8f60203ed.js +0 -1
  481. package/assets/esri/core/workers/chunks/0b4a7209b99227a842ad.js +0 -1
  482. package/assets/esri/core/workers/chunks/0be98adfef79fc5036f0.js +0 -1
  483. package/assets/esri/core/workers/chunks/0d2e2d90a4e4a28e2c0c.js +0 -1
  484. package/assets/esri/core/workers/chunks/0d7763d39a5a8586a0ae.js +0 -1
  485. package/assets/esri/core/workers/chunks/0d95f72e1c07ab867d21.js +0 -1
  486. package/assets/esri/core/workers/chunks/0dbbac7a2378728571a7.js +0 -1
  487. package/assets/esri/core/workers/chunks/104d74bc36c28c519396.js +0 -1
  488. package/assets/esri/core/workers/chunks/1554feab934e8e1bcd28.js +0 -1
  489. package/assets/esri/core/workers/chunks/1670e9867efde4d7a6d6.js +0 -1
  490. package/assets/esri/core/workers/chunks/188c6ff5f4664827c254.js +0 -2
  491. package/assets/esri/core/workers/chunks/19ab024f6f732fd6c69b.js +0 -1
  492. package/assets/esri/core/workers/chunks/1e192ac0533a5c0b5a7a.js +0 -1
  493. package/assets/esri/core/workers/chunks/1fe077f57a087c0e9119.js +0 -1
  494. package/assets/esri/core/workers/chunks/20f7b5fe64a217cb3d3d.js +0 -1
  495. package/assets/esri/core/workers/chunks/212222b64039d436b9a6.js +0 -1
  496. package/assets/esri/core/workers/chunks/22c94f9a69b2157f8dbd.js +0 -1
  497. package/assets/esri/core/workers/chunks/24944b625ed8dcd904f0.js +0 -1
  498. package/assets/esri/core/workers/chunks/24c44541046576fee7e0.js +0 -2
  499. package/assets/esri/core/workers/chunks/2754ba5cc094028a7a3c.js +0 -1
  500. package/assets/esri/core/workers/chunks/2bc3e7f394386fa75447.js +0 -1
  501. package/assets/esri/core/workers/chunks/2ec44ebc48beeba11201.js +0 -1
  502. package/assets/esri/core/workers/chunks/30af0f7c4cfa541c9efd.js +0 -1
  503. package/assets/esri/core/workers/chunks/30d816bdeea00f6fa1ca.js +0 -1
  504. package/assets/esri/core/workers/chunks/349b0c7febc46267441d.js +0 -1684
  505. package/assets/esri/core/workers/chunks/35d46c2f658a8e92d913.js +0 -1
  506. package/assets/esri/core/workers/chunks/3869dca884d7ca6488f5.js +0 -1
  507. package/assets/esri/core/workers/chunks/3a65693964e3976d8035.js +0 -1
  508. package/assets/esri/core/workers/chunks/3f5234120d3a14186c1c.js +0 -1
  509. package/assets/esri/core/workers/chunks/45c1c90ac6c14657f3ff.js +0 -1
  510. package/assets/esri/core/workers/chunks/48726010778d6004e347.js +0 -2
  511. package/assets/esri/core/workers/chunks/4a40b894ec89b0a4f9bf.js +0 -1
  512. package/assets/esri/core/workers/chunks/5165d367328ac7badf47.js +0 -1
  513. package/assets/esri/core/workers/chunks/545bec045167c433af8f.js +0 -1
  514. package/assets/esri/core/workers/chunks/5782c0362a1799ceef41.js +0 -1
  515. package/assets/esri/core/workers/chunks/59598023c0aea62a6297.js +0 -1
  516. package/assets/esri/core/workers/chunks/59f0a2bd40b033ce77e4.js +0 -1
  517. package/assets/esri/core/workers/chunks/5aa23b0f4521ba9a07ad.js +0 -1
  518. package/assets/esri/core/workers/chunks/5af16937904c06fb06f6.js +0 -1
  519. package/assets/esri/core/workers/chunks/5bf2ce280ea35ea4c96b.js +0 -1
  520. package/assets/esri/core/workers/chunks/607acd9f615f87e14075.js +0 -1
  521. package/assets/esri/core/workers/chunks/62ee6c247f783acabb74.js +0 -1
  522. package/assets/esri/core/workers/chunks/6564f17c4700dc8d9c0e.js +0 -2
  523. package/assets/esri/core/workers/chunks/6a2d890640b2cd6c5ccb.js +0 -1
  524. package/assets/esri/core/workers/chunks/6b84982dfaf084a61b93.js +0 -1
  525. package/assets/esri/core/workers/chunks/6b9dbf43c0659e55c539.js +0 -1
  526. package/assets/esri/core/workers/chunks/6cbc30b31f0bb39c73ca.js +0 -1
  527. package/assets/esri/core/workers/chunks/75b90fb05e4a2d32b7bb.js +0 -1
  528. package/assets/esri/core/workers/chunks/75bddfe2be64379db8fd.js +0 -1
  529. package/assets/esri/core/workers/chunks/76e7d3cde2da4bdd7820.js +0 -1
  530. package/assets/esri/core/workers/chunks/7cf903db44f3647c8fd4.js +0 -1
  531. package/assets/esri/core/workers/chunks/7e41cee4a0ae75e1490d.js +0 -1
  532. package/assets/esri/core/workers/chunks/7eae9053065d3d38e54e.js +0 -1
  533. package/assets/esri/core/workers/chunks/87e9f7e85221bc7e6709.js +0 -1
  534. package/assets/esri/core/workers/chunks/88f03352a4dc6184ea1f.js +0 -1
  535. package/assets/esri/core/workers/chunks/909ee7d2a0eec773037a.js +0 -1
  536. package/assets/esri/core/workers/chunks/91ac9328afff8a51bd96.js +0 -1
  537. package/assets/esri/core/workers/chunks/91de343844ac578e7c93.js +0 -1
  538. package/assets/esri/core/workers/chunks/9246e2468528650bdc7c.js +0 -1
  539. package/assets/esri/core/workers/chunks/94ddfe165ac25aef8229.js +0 -1
  540. package/assets/esri/core/workers/chunks/9509bef285929c52c244.js +0 -1
  541. package/assets/esri/core/workers/chunks/95a3f09751bff63f4fab.js +0 -1
  542. package/assets/esri/core/workers/chunks/98d614d6fc9de8ebaf94.js +0 -1
  543. package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +0 -1
  544. package/assets/esri/core/workers/chunks/99f627938dbf0152fc02.js +0 -1
  545. package/assets/esri/core/workers/chunks/9e2b3754a76e0dd4a94a.js +0 -1
  546. package/assets/esri/core/workers/chunks/a0565137027c83108953.js +0 -1
  547. package/assets/esri/core/workers/chunks/a0eb882a5a81d25b9153.js +0 -1
  548. package/assets/esri/core/workers/chunks/a785e827f0215a73103d.js +0 -1
  549. package/assets/esri/core/workers/chunks/abe7670db06b27c0c8c8.js +0 -1
  550. package/assets/esri/core/workers/chunks/b19cff0e43fab2632660.js +0 -1
  551. package/assets/esri/core/workers/chunks/b6af90be328ebda26b8d.js +0 -1
  552. package/assets/esri/core/workers/chunks/bd7d87d175ba933ab2ce.js +0 -1
  553. package/assets/esri/core/workers/chunks/bdfffa5f88b559a4b42d.js +0 -1
  554. package/assets/esri/core/workers/chunks/c30b6bbabd05e4976fba.js +0 -1
  555. package/assets/esri/core/workers/chunks/c352696478b48a2090d5.js +0 -1
  556. package/assets/esri/core/workers/chunks/c35553d07ad169910742.js +0 -1
  557. package/assets/esri/core/workers/chunks/c4fef90cf08bbe4f0bb5.js +0 -1
  558. package/assets/esri/core/workers/chunks/c5c2fed38e0ccf84f1fa.js +0 -1
  559. package/assets/esri/core/workers/chunks/c88bfa51d2a8a024fc24.js +0 -1
  560. package/assets/esri/core/workers/chunks/c91042f8bf886056a29c.js +0 -1
  561. package/assets/esri/core/workers/chunks/ca36d85a47179d95f2fc.js +0 -1
  562. package/assets/esri/core/workers/chunks/cd02a6078443b8f63927.js +0 -1
  563. package/assets/esri/core/workers/chunks/d0cf9ff48f051adbd455.js +0 -1
  564. package/assets/esri/core/workers/chunks/d1304d414b1fa725168a.js +0 -1
  565. package/assets/esri/core/workers/chunks/d24125a791247019e2ca.js +0 -1
  566. package/assets/esri/core/workers/chunks/d26be8313526ecea9c68.js +0 -1
  567. package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +0 -1
  568. package/assets/esri/core/workers/chunks/d44338bf5edafa3ca926.js +0 -1
  569. package/assets/esri/core/workers/chunks/d4b0012ae1d3b8a9ba01.js +0 -1
  570. package/assets/esri/core/workers/chunks/d58d6b55b2749a535eb3.js +0 -1
  571. package/assets/esri/core/workers/chunks/d7d5275d8b3c9430de1f.js +0 -1
  572. package/assets/esri/core/workers/chunks/da8a314800944706511b.js +0 -1
  573. package/assets/esri/core/workers/chunks/e018cbd97e6e0e4ca5c4.js +0 -1
  574. package/assets/esri/core/workers/chunks/e39bccc000c768120a32.js +0 -1
  575. package/assets/esri/core/workers/chunks/e4380706b629729f2212.js +0 -1
  576. package/assets/esri/core/workers/chunks/e90076ac1cf88a83a7f9.js +0 -1
  577. package/assets/esri/core/workers/chunks/ea1877ce00da3b585a30.js +0 -1
  578. package/assets/esri/core/workers/chunks/ea91c57a0b31f3f65ee5.js +0 -1
  579. package/assets/esri/core/workers/chunks/ec77222776f755dc372c.js +0 -1
  580. package/assets/esri/core/workers/chunks/ef851a2cff76fd211c07.js +0 -1
  581. package/assets/esri/core/workers/chunks/f3e53be08ab9dbdf17ae.js +0 -1
  582. package/assets/esri/core/workers/chunks/f53010adb70463b75bb9.js +0 -1
  583. package/assets/esri/core/workers/chunks/f5a058a0ce006bce2a2a.js +0 -1
  584. package/assets/esri/core/workers/chunks/f5f5b54cab722abe88e0.js +0 -1
  585. package/assets/esri/core/workers/chunks/f60ed579981913d44675.js +0 -1
  586. package/assets/esri/core/workers/chunks/f6f56f3e011dcef90bbb.js +0 -1
  587. package/assets/esri/core/workers/chunks/f83c3597e9332bd991eb.js +0 -1
  588. package/assets/esri/core/workers/chunks/f9a4387f850d85c44ca5.js +0 -1
  589. package/assets/esri/core/workers/chunks/fbc7576ed12964059da6.js +0 -1
  590. package/assets/esri/core/workers/chunks/fdd0e6d9927d3c43b0d3.js +0 -1
  591. package/assets/esri/core/workers/chunks/ff83d0337ac489ab08de.js +0 -2
  592. package/chunks/GlowComposite.glsl.js +0 -2
  593. package/geometry/operators/importUtils.js +0 -2
  594. package/views/3d/webgl-engine/effects/glow/Glow.js +0 -2
  595. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +0 -2
  596. package/views/3d/webgl-engine/effects/glow/GlowComposite.glsl.js +0 -2
  597. package/views/3d/webgl-engine/effects/glow/GlowCompositeTechnique.js +0 -2
  598. package/views/3d/webgl-engine/effects/glow/blurEmission.glsl.js +0 -38
  599. /package/assets/esri/core/workers/chunks/{188c6ff5f4664827c254.js.LICENSE.txt → 1082bb0858585bd4fa21.js.LICENSE.txt} +0 -0
  600. /package/assets/esri/core/workers/chunks/{24c44541046576fee7e0.js.LICENSE.txt → 2e2349387a2b9903f13c.js.LICENSE.txt} +0 -0
  601. /package/assets/esri/core/workers/chunks/{ff83d0337ac489ab08de.js.LICENSE.txt → 411bbdecba340df11d95.js.LICENSE.txt} +0 -0
  602. /package/assets/esri/core/workers/chunks/{a89dbef8155d7c4354da.js.LICENSE.txt → 476535cfb06ced74d611.js.LICENSE.txt} +0 -0
  603. /package/assets/esri/core/workers/chunks/{6564f17c4700dc8d9c0e.js.LICENSE.txt → b82b523b6837ed1f28d3.js.LICENSE.txt} +0 -0
  604. /package/assets/esri/core/workers/chunks/{48726010778d6004e347.js.LICENSE.txt → ef24fd6c0322e5de9fdf.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as r,onLocaleChange as i}from"../../intl.js";import{multiplyOpacity as s,getContrast as a}from"../../core/colorUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as n,initial as m}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialArea as p,formatMetricArea as c,formatImperialLength as u,formatMetricLength as h}from"../../core/unitFormatUtils.js";import{convertUnit as d,deriveLengthUnitFromAreaUnit as y}from"../../core/units.js";import{property as v,subclass as g}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{isSupported as _,geodesicDensify as w,geodesicLengths as b,geodesicAreas as L}from"../../geometry/geodesicUtils.js";import j from"../../geometry/Point.js";import S from"../../geometry/Polygon.js";import x from"../../geometry/Polyline.js";import{execute as A}from"../../geometry/operators/areaOperator.js";import{execute as G,load as M}from"../../geometry/operators/geodeticAreaOperator.js";import{execute as k,load as O}from"../../geometry/operators/geodeticDensifyOperator.js";import{execute as C,load as H}from"../../geometry/operators/geodeticLengthOperator.js";import{execute as R}from"../../geometry/operators/lengthOperator.js";import{execute as T}from"../../geometry/operators/simplifyOperator.js";import{polygonCentroidPoint as U}from"../../geometry/support/centroid.js";import q from"../../layers/GraphicsLayer.js";import z from"../../symbols/Font.js";import D from"../../symbols/SimpleFillSymbol.js";import P from"../../symbols/SimpleLineSymbol.js";import E from"../../symbols/SimpleMarkerSymbol.js";import V from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as F}from"../../views/2d/interactive/SnappingVisualizer2D.js";import W from"../../views/draw/Draw.js";import{createCoordinateHelper as I}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as B,screenToMap as J,dragManipulatedObject as N}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as K}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as Q}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as X}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as Y}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Z}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as $}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as ee}from"../../views/interactive/snapping/snappingUtils.js";const te=1e5;let re=class extends Q{constructor(e){super(e),this._measurementLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new f,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){r("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new W({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([i(async()=>{this.messages=await r("esri/core/t9n/Units")}),n(()=>[this.unit,this.messages],()=>{this._updateGraphics()},m),n(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),ee(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=o(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=o(this._measurementLayer),this._manipulatorLayer=o(this._manipulatorLayer),this._snappingLayer=o(this._snappingLayer),this._updatingHandles=o(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Z({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new Y(new X("point",I(!1,!1,this.view.spatialReference)),2),visualizer:new F(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new j({x:i,y:s,spatialReference:t}),o=ie(a,this.view,this._manipulatorLayer);this.manipulators.add(o);const n=Y.fromGeometry(a,2);n.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=B(o,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,o=this._updatingHandles,{snappingStep:m}=$({snappingContext:s,snappingManager:a,updatingHandles:o});t.next(J(this.view)).next(t=>{if("start"===t.action){const r=new j(t.mapStart);e.graphic.geometry=r,n.trySetGeometry(r)}return t}).next(...m).next(N({operations:n})).next(()=>{e.graphic.geometry=n.data.geometry})});this._vertices.push({manipulator:o,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new j({x:s,y:a,spatialReference:t}));const o=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==o||e!==o})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:r,fillGeometry:i,outlineGeometry:o}=e;this._set("measurement",r);const n=r?ne(this.messages,r,this.unit):null;if(this._set("measurementLabel",n),!i&&!o)return;let m,l,p;const{graphics:c}=this._measurementLayer,u=3===c.length,{effectiveTheme:h}=this.view;u?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new D({color:s(h.accentColor,.3),outline:null})}),l=new t({symbol:new P({color:h.accentColor,width:2})}),p=new t({symbol:new V({color:h.textColor,font:new z({size:14,family:"sans-serif"}),haloColor:s(a(h.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=i,l.geometry=o;const d=i?U(i):null,y=d?j.fromJSON(d):null;p.geometry=y,p.symbol.text=n?.area??""}};function ie(e,r,i){const a=8,o={style:"circle",color:s(r.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},n=new E({...o,size:a}),m=new E({...o,size:1.5*a}),l=new t({geometry:e,symbol:n});return new K({view:r,layer:i,graphic:l,focusedSymbol:m,consumesClicks:!1})}function se(e,t){if(2===e.length){const r=new x({paths:[e],spatialReference:t});let i;return i=t.isGeographic?_(t)?w(r,te):k(r,te,{unit:"meters"}):t.isWebMercator?k(r,te,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new x({paths:[e],spatialReference:t}),i=new S({rings:[e],spatialReference:t});let s,a,o=null,n=null;if(t.isGeographic)if(_(t)){if(o=w(r,te),n=w(i,te),n=T(n),!n)return null;s=b([r],"meters")[0],a=L([n],"square-meters")[0]}else{if(o=k(r,te,{unit:"meters"}),n=k(i,te,{unit:"meters"}),n=T(n),!n)return null;s=C(r,{unit:"meters"}),a=G(n,{unit:"square-meters"})}else if(t.isWebMercator){if(o=k(r,te,{unit:"meters"}),n=k(i,te,{unit:"meters"}),!n||!o)return null;if(n=T(n),!n)return null;s=C(r,{unit:"meters"}),a=G(n,{unit:"square-meters"})}else{if(o=r,n=T(i),!n)return null;s=R(r,{unit:"meters"}),a=A(n,{unit:"square-meters"})}return{measurement:{geometry:n,area:a,perimeter:s},fillGeometry:n,outlineGeometry:o}}function ae(e){return null!=e}async function oe(e){(e?.isGeographic&&!_(e)||e?.isWebMercator)&&await Promise.all([M(),O(),H()])}function ne(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=c(e,s,"square-meters");break;case"imperial":i.area=p(e,s,"square-meters");break;default:{const t=d(s,"square-meters",r);i.area=l(e,t,r);break}}const o=y(r);if(o)switch(o){case"metric":i.perimeter=h(e,a,"meters");break;case"imperial":i.perimeter=u(e,a,"meters");break;default:{const t=d(a,"meters",o);i.perimeter=l(e,t,o);break}}else i.perimeter="";return i}e([v()],re.prototype,"_drawActive",void 0),e([v({readOnly:!0})],re.prototype,"cursor",null),e([v({value:!0})],re.prototype,"editable",null),e([v({readOnly:!0})],re.prototype,"measurement",void 0),e([v({readOnly:!0})],re.prototype,"measurementLabel",void 0),e([v()],re.prototype,"messages",void 0),e([v({constructOnly:!0})],re.prototype,"snappingManager",void 0),e([v()],re.prototype,"unit",void 0),e([v()],re.prototype,"updating",null),e([v({constructOnly:!0})],re.prototype,"view",void 0),re=e([g("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],re);export{re as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,ne as createAreaMeasurementLabel,ae as isSupported,oe as loadGeometryOperators};
2
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as r,onLocaleChange as i}from"../../intl.js";import{multiplyOpacity as s,getContrast as a}from"../../core/colorUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as n,initial as m}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialArea as p,formatMetricArea as c,formatImperialLength as h,formatMetricLength as u}from"../../core/unitFormatUtils.js";import{convertUnit as y,deriveLengthUnitFromAreaUnit as d}from"../../core/units.js";import{property as v,subclass as g}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{isSupported as _,geodesicDensify as w,geodesicLengths as b,geodesicAreas as L}from"../../geometry/geodesicUtils.js";import j from"../../geometry/Point.js";import S from"../../geometry/Polygon.js";import A from"../../geometry/Polyline.js";import{areaExecute as G}from"../../geometry/operators/areaOperator.js";import{geodeticAreaExecute as x,geodeticAreaLoad as M}from"../../geometry/operators/geodeticAreaOperator.js";import{geodeticDensifyExecute as k,geodeticDensifyLoad as O}from"../../geometry/operators/geodeticDensifyOperator.js";import{geodeticLengthExecute as C,geodeticLengthLoad as H}from"../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as R}from"../../geometry/operators/lengthOperator.js";import{simplifyExecute as T}from"../../geometry/operators/simplifyOperator.js";import{polygonCentroidPoint as U}from"../../geometry/support/centroid.js";import q from"../../layers/GraphicsLayer.js";import z from"../../symbols/Font.js";import D from"../../symbols/SimpleFillSymbol.js";import P from"../../symbols/SimpleLineSymbol.js";import E from"../../symbols/SimpleMarkerSymbol.js";import V from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as F}from"../../views/2d/interactive/SnappingVisualizer2D.js";import W from"../../views/draw/Draw.js";import{createCoordinateHelper as I}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as B,screenToMap as J,dragManipulatedObject as N}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as K}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as Q}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as X}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as Y}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Z}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as $}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as ee}from"../../views/interactive/snapping/snappingUtils.js";const te=1e5;let re=class extends Q{constructor(e){super(e),this._measurementLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new f,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){r("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new W({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([i(async()=>{this.messages=await r("esri/core/t9n/Units")}),n(()=>[this.unit,this.messages],()=>{this._updateGraphics()},m),n(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),ee(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=o(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=o(this._measurementLayer),this._manipulatorLayer=o(this._manipulatorLayer),this._snappingLayer=o(this._snappingLayer),this._updatingHandles=o(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Z({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new Y(new X("point",I(!1,!1,this.view.spatialReference)),2),visualizer:new F(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new j({x:i,y:s,spatialReference:t}),o=ie(a,this.view,this._manipulatorLayer);this.manipulators.add(o);const n=Y.fromGeometry(a,2);n.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=B(o,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,o=this._updatingHandles,{snappingStep:m}=$({snappingContext:s,snappingManager:a,updatingHandles:o});t.next(J(this.view)).next(t=>{if("start"===t.action){const r=new j(t.mapStart);e.graphic.geometry=r,n.trySetGeometry(r)}return t}).next(...m).next(N({operations:n})).next(()=>{e.graphic.geometry=n.data.geometry})});this._vertices.push({manipulator:o,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new j({x:s,y:a,spatialReference:t}));const o=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==o||e!==o})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:r,fillGeometry:i,outlineGeometry:o}=e;this._set("measurement",r);const n=r?ne(this.messages,r,this.unit):null;if(this._set("measurementLabel",n),!i&&!o)return;let m,l,p;const{graphics:c}=this._measurementLayer,h=3===c.length,{effectiveTheme:u}=this.view;h?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new D({color:s(u.accentColor,.3),outline:null})}),l=new t({symbol:new P({color:u.accentColor,width:2})}),p=new t({symbol:new V({color:u.textColor,font:new z({size:14,family:"sans-serif"}),haloColor:s(a(u.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=i,l.geometry=o;const y=i?U(i):null,d=y?j.fromJSON(y):null;p.geometry=d,p.symbol.text=n?.area??""}};function ie(e,r,i){const a=8,o={style:"circle",color:s(r.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},n=new E({...o,size:a}),m=new E({...o,size:1.5*a}),l=new t({geometry:e,symbol:n});return new K({view:r,layer:i,graphic:l,focusedSymbol:m,consumesClicks:!1})}function se(e,t){if(2===e.length){const r=new A({paths:[e],spatialReference:t});let i;return i=t.isGeographic?_(t)?w(r,te):k(r,te,{unit:"meters"}):t.isWebMercator?k(r,te,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new A({paths:[e],spatialReference:t}),i=new S({rings:[e],spatialReference:t});let s,a,o=null,n=null;if(t.isGeographic)if(_(t)){if(o=w(r,te),n=w(i,te),n=T(n),!n)return null;s=b([r],"meters")[0],a=L([n],"square-meters")[0]}else{if(o=k(r,te,{unit:"meters"}),n=k(i,te,{unit:"meters"}),n=T(n),!n)return null;s=C(r,{unit:"meters"}),a=x(n,{unit:"square-meters"})}else if(t.isWebMercator){if(o=k(r,te,{unit:"meters"}),n=k(i,te,{unit:"meters"}),!n||!o)return null;if(n=T(n),!n)return null;s=C(r,{unit:"meters"}),a=x(n,{unit:"square-meters"})}else{if(o=r,n=T(i),!n)return null;s=R(r,{unit:"meters"}),a=G(n,{unit:"square-meters"})}return{measurement:{geometry:n,area:a,perimeter:s},fillGeometry:n,outlineGeometry:o}}function ae(e){return null!=e}async function oe(e){(e?.isGeographic&&!_(e)||e?.isWebMercator)&&await Promise.all([M(),O(),H()])}function ne(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=c(e,s,"square-meters");break;case"imperial":i.area=p(e,s,"square-meters");break;default:{const t=y(s,"square-meters",r);i.area=l(e,t,r);break}}const o=d(r);if(o)switch(o){case"metric":i.perimeter=u(e,a,"meters");break;case"imperial":i.perimeter=h(e,a,"meters");break;default:{const t=y(a,"meters",o);i.perimeter=l(e,t,o);break}}else i.perimeter="";return i}e([v()],re.prototype,"_drawActive",void 0),e([v({readOnly:!0})],re.prototype,"cursor",null),e([v({value:!0})],re.prototype,"editable",null),e([v({readOnly:!0})],re.prototype,"measurement",void 0),e([v({readOnly:!0})],re.prototype,"measurementLabel",void 0),e([v()],re.prototype,"messages",void 0),e([v({constructOnly:!0})],re.prototype,"snappingManager",void 0),e([v()],re.prototype,"unit",void 0),e([v()],re.prototype,"updating",null),e([v({constructOnly:!0})],re.prototype,"view",void 0),re=e([g("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],re);export{re as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,ne as createAreaMeasurementLabel,ae as isSupported,oe as loadGeometryOperators};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isSome as e,addMany as n,pushIfSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import o from"../../../core/Queue.js";import{addMany as i,last as r}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";class c{constructor({executorMap:e,fieldsIndex:n,preserveFieldValuesWhenHidden:t}){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.fieldsIndex=n,this.preserveFieldValuesWhenHidden=!0===t,this.elementTemplateMap=new Map;for(const s of e.keys())this.elementTemplateMap.set(s.elementId,s);this._buildDependencyGraph(e)}_buildDependencyGraph(e){const n=m(e,this.fieldsIndex),t={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...e.keys()].map(e=>[e.elementId,e])),executorMap:e,fieldElementTemplateMap:f(e),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:n,nodeStack:new o(r),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const[o,i]of e)if(null!=i)for(const e of Object.keys(i))switch(e){case"editableExpression":case"requiredExpression":case"valueExpression":case"visibilityExpression":{const n=i[e];if(null==n)break;s(this.arcadeExecutorUses,n,()=>[]).push({elementId:o.elementId,executorPurpose:e});break}case"textExpressions":{const n=i[e];if(!Array.isArray(n))break;n.forEach((e,n)=>{s(this.arcadeExecutorUses,e,()=>[]).push({elementId:o.elementId,executorPurpose:"textExpressions",textExpressionIndex:n})});break}}for(const s of this.arcadeExecutorUses.values())s.sort(e=>"editableExpression"===e.executorPurpose?-1:1);for(const s of n.values())-1===s.index&&d(s,t);this.dependencyGraphComponents=x(n),this.fieldReferencesMap=h(t),this.geometryReferences=y(t.geometryReferences,n),this.originalFeatureReferences=y(t.originalFeatureReferences,n),this.components=t.components}}class l{constructor(){this._executors=new Set,this._fieldsReferenced=new Set,this.adjacencyList=new Set}get executors(){return this._executors}get fieldsReferenced(){return this._fieldsReferenced}addExecutor(e){this._executors.add(e.executor),i(this._fieldsReferenced,e.fieldsUsedNormalized)}}function d(e,n){e.index=e.lowlink=n.nextIndex++,n.nodeStack.push(e);for(const t of p(e,n))-1===t.index?(d(t,n),e.lowlink=Math.min(e.lowlink,t.lowlink)):t.index<e.index&&n.nodeStack.contains(t)&&(e.lowlink=Math.min(e.lowlink,t.index)),n.nodeStack.contains(t)||null!=t.component&&e.incomingCrossLinkNeighbors.add(t.component);if(e.lowlink===e.index){const t=new l;for(n.components.push(t);E(n.nodeStack)>=e.index;){const e=n.nodeStack.pop();if(null!=e){e.component=t,t.addExecutor(e);for(const n of e.incomingCrossLinkNeighbors)n.adjacencyList.add(t)}}}}function p({executor:n,fieldsUsedNormalized:t},o){const r=new Set;for(const e of t){s(o.fieldReferencesMap,e,()=>new Set).add(n),i(r,u(e,o))}n.geometryUsed&&o.geometryReferences.add(n),n.variablesUsed.includes("$originalfeature")&&o.originalFeatureReferences.add(n);const c=o.arcadeExecutorUses.get(n)??[];for(const e of c)switch(e.executorPurpose){case"valueExpression":{const t=o.executorMap.get(o.elementTemplatesById.get(e.elementId));t?.editableExpression&&t.editableExpression!==n&&r.add(t.editableExpression);break}case"visibilityExpression":{const n=o.elementTemplatesById.get(e.elementId);if(o.shouldConsiderVisibility&&n&&a(n)){const e=n.group,t=e?o.executorMap.get(e):null;t?.visibilityExpression&&r.add(t.visibilityExpression)}break}}return Array.from(r).map(e=>o.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:n,fieldElementTemplateMap:s,shouldConsiderVisibility:o}){const i=[],r=s.get(e);if(null==r)return i;const a=n.get(r);if(null==a)return i;if(t(i,a.editableExpression),t(i,a.valueExpression),o){t(i,a.visibilityExpression);const{group:e}=r;if(null!=e){const s=n.get(e)?.visibilityExpression;t(i,s)}}return i}function f(e){const n=new Map;for(const t of e.keys())a(t)&&n.set(t.fieldName,t);return n}function m(t,s){const o=Array.from(t.values()).filter(e),i=new Set(o.flatMap(e=>{const{textExpressions:t,...s}=e,o=[];return t?.length&&n(o,t),n(o,Object.values(s)),o})),r=Array.from(i).filter(e).map(e=>({component:null,incomingCrossLinkNeighbors:new Set,executor:e,fieldsUsedNormalized:e.fieldsUsed.map(e=>s.normalizeFieldName(e)??e),index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function x(e){return new Map([...e.values()].map(({component:e,executor:n})=>[n,e]))}function h({fieldReferencesMap:e,nodeInfoMap:n}){const t=new Map;for(const[s,o]of e.entries())t.set(s,y(o,n));return t}function y(e,n){const t=new Set;for(const s of e){const e=n.get(s);e?.component&&t.add(e.component)}return t}function E(e){return e.peek()?.index??-1}export{c as ExpressionsModel,l as StronglyConnectedComponent,p as getDirectDependencies};
2
+ import{isSome as e,addMany as n,pushIfSome as s}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as t}from"../../../core/MapUtils.js";import o from"../../../core/Queue.js";import{addMany as i,last as r}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";class c{constructor({executorMap:e,fieldsIndex:n,preserveFieldValuesWhenHidden:s}){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.fieldsIndex=n,this.preserveFieldValuesWhenHidden=!0===s,this.elementTemplateMap=new Map;for(const t of e.keys())this.elementTemplateMap.set(t.elementId,t);this._buildDependencyGraph(e)}_buildDependencyGraph(e){const n=m(e,this.fieldsIndex),s={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...e.keys()].map(e=>[e.elementId,e])),executorMap:e,fieldElementTemplateMap:f(e),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:n,nodeStack:new o(r),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const[o,i]of e)if(null!=i)for(const e of Object.keys(i))switch(e){case"choiceExpression":case"editableExpression":case"requiredExpression":case"valueExpression":case"visibilityExpression":{const n=i[e];if(null==n)break;t(this.arcadeExecutorUses,n,()=>[]).push({elementId:o.elementId,executorPurpose:e});break}case"textExpressions":{const n=i[e];if(!Array.isArray(n))break;n.forEach((e,n)=>{t(this.arcadeExecutorUses,e,()=>[]).push({elementId:o.elementId,executorPurpose:"textExpressions",textExpressionIndex:n})});break}}for(const t of this.arcadeExecutorUses.values())t.sort(e=>"editableExpression"===e.executorPurpose?-1:1);for(const t of n.values())-1===t.index&&d(t,s);this.dependencyGraphComponents=x(n),this.fieldReferencesMap=h(s),this.geometryReferences=y(s.geometryReferences,n),this.originalFeatureReferences=y(s.originalFeatureReferences,n),this.components=s.components}}class l{constructor(){this._executors=new Set,this._fieldsReferenced=new Set,this.adjacencyList=new Set}get executors(){return this._executors}get fieldsReferenced(){return this._fieldsReferenced}addExecutor(e){this._executors.add(e.executor),i(this._fieldsReferenced,e.fieldsUsedNormalized)}}function d(e,n){e.index=e.lowlink=n.nextIndex++,n.nodeStack.push(e);for(const s of p(e,n))-1===s.index?(d(s,n),e.lowlink=Math.min(e.lowlink,s.lowlink)):s.index<e.index&&n.nodeStack.contains(s)&&(e.lowlink=Math.min(e.lowlink,s.index)),n.nodeStack.contains(s)||null!=s.component&&e.incomingCrossLinkNeighbors.add(s.component);if(e.lowlink===e.index){const s=new l;for(n.components.push(s);E(n.nodeStack)>=e.index;){const e=n.nodeStack.pop();if(null!=e){e.component=s,s.addExecutor(e);for(const n of e.incomingCrossLinkNeighbors)n.adjacencyList.add(s)}}}}function p({executor:n,fieldsUsedNormalized:s},o){const r=new Set;for(const e of s){t(o.fieldReferencesMap,e,()=>new Set).add(n),i(r,u(e,o))}n.geometryUsed&&o.geometryReferences.add(n),n.variablesUsed.includes("$originalfeature")&&o.originalFeatureReferences.add(n);const c=o.arcadeExecutorUses.get(n)??[];for(const e of c)switch(e.executorPurpose){case"valueExpression":{const s=o.executorMap.get(o.elementTemplatesById.get(e.elementId));s?.editableExpression&&s.editableExpression!==n&&r.add(s.editableExpression);break}case"visibilityExpression":{const n=o.elementTemplatesById.get(e.elementId);if(o.shouldConsiderVisibility&&n&&a(n)){const e=n.group,s=e?o.executorMap.get(e):null;s?.visibilityExpression&&r.add(s.visibilityExpression)}break}}return Array.from(r).map(e=>o.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:n,fieldElementTemplateMap:t,shouldConsiderVisibility:o}){const i=[],r=t.get(e);if(null==r)return i;const a=n.get(r);if(null==a)return i;if(s(i,a.editableExpression),s(i,a.valueExpression),o){s(i,a.visibilityExpression);const{group:e}=r;if(null!=e){const t=n.get(e)?.visibilityExpression;s(i,t)}}return i}function f(e){const n=new Map;for(const s of e.keys())a(s)&&n.set(s.fieldName,s);return n}function m(s,t){const o=Array.from(s.values()).filter(e),i=new Set(o.flatMap(e=>{const{textExpressions:s,...t}=e,o=[];return s?.length&&n(o,s),n(o,Object.values(t)),o})),r=Array.from(i).filter(e).map(e=>({component:null,incomingCrossLinkNeighbors:new Set,executor:e,fieldsUsedNormalized:e.fieldsUsed.map(e=>t.normalizeFieldName(e)??e),index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function x(e){return new Map([...e.values()].map(({component:e,executor:n})=>[n,e]))}function h({fieldReferencesMap:e,nodeInfoMap:n}){const s=new Map;for(const[t,o]of e.entries())s.set(t,y(o,n));return s}function y(e,n){const s=new Set;for(const t of e){const e=n.get(t);e?.component&&s.add(e.component)}return s}function E(e){return e.peek()?.index??-1}export{c as ExpressionsModel,l as StronglyConnectedComponent,p as getDirectDependencies};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{DateOnly as t}from"../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../core/sql/TimeOnly.js";async function n({element:e,expressionInfos:t,provider:r}){const n={};if(e.visibilityExpression){const i=t.get(e.visibilityExpression);n.visibilityExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("editableExpression"in e&&e.editableExpression){const i=t.get(e.editableExpression);n.editableExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("requiredExpression"in e&&e.requiredExpression){const i=t.get(e.requiredExpression);n.requiredExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("valueExpression"in e&&e.valueExpression){const i=t.get(e.valueExpression);n.valueExpression=i?await r.getArcadeExecutor(i.expression):void 0}return n}function i(e){return new Map(e?.map(e=>[e.name,e]))}function o(n,i,o,u){if(null===n)return null;switch(i.type){case"big-integer":case"integer":case"long":case"oid":case"small-integer":{const e=a(n,u);return null==e?null:Math.floor(e)}case"single":case"double":return a(n,u);case"global-id":case"guid":case"string":return u.toString(n);case"date":{const t=s(n,o,u);if(t)return t.getTime();const r=a(n,u);if(null!==r&&!Number.isNaN(r)&&Number.isInteger(r))return r;throw new e("unsupported-value-type",`Unable to convert value ${n} to a date`)}case"date-only":{if(u.isDateOnly(n))return n.toStorageFormat();const r=s(n,o,u);if(!r)throw new e("unsupported-value-type",`Unable to convert value ${n} to a date-only string`);return t.fromDateTime(r.toDateTime()).toStorageFormat()}case"time-only":{if(u.isTime(n))return n.toStorageString();if(u.isDate(n)){return r.fromDateTime(n.toDateTime()).toStorageString()}const t=r.fromString(u.toString(n));if(!t)throw new e("unsupported-value-type",`Unable to convert value ${n} to a time-only string`);return t.toStorageString()}case"timestamp-offset":{const t=s(n,o,u);if(!t)throw new e("unsupported-value-type",`Unable to convert value ${n} to a timestamp-offset string`);return t.toISOString(!1)}}throw new e("unsupported-value-type",`Unable to convert value ${n} to a value matching field type`)}function a(e,t){if(""===e)return null;const r=t.toNumber(e);return Number.isNaN(r)?null:r}function s(e,t,r){if(r.isDate(e))return e;if(r.isDateOnly(e))return e.toArcadeDate();const n=r.toString(e),i=r.toDate(n,t);return i&&/\d{4}-\d{2}-\d{2}/.test(n)?i:null}function u(e,t,r){const{editType:n,map:i,spatialReference:o,timeZone:a}=e,s=t.layer,u="scene"===s?.type&&null!=s.associatedLayer?s.associatedLayer:s;return{variables:{$originalfeature:t.original,$editcontext:{editType:n},$layer:u,$featureset:u,$datastore:u?.url,$feature:t.plainGraphic,$map:i},executeContext:{rawOutput:!0,spatialReference:o??void 0,timeZone:a,abortSignal:r}}}export{o as castArcadeValue,u as makeArcadeContext,n as makeExecutorSetForFormElement,i as makeExpressionInfosMap};
2
+ import e from"../../../core/Error.js";import{DateOnly as t}from"../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../core/sql/TimeOnly.js";import{isDynamicChoiceInput as i}from"../../../form/elements/inputs/inputUtils.js";import{isFieldElement as o}from"../../../form/support/formUtils.js";async function n({element:e,expressionInfos:t,provider:r}){const n={};if(e.visibilityExpression){const i=t.get(e.visibilityExpression);n.visibilityExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("editableExpression"in e&&e.editableExpression){const i=t.get(e.editableExpression);n.editableExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("requiredExpression"in e&&e.requiredExpression){const i=t.get(e.requiredExpression);n.requiredExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("valueExpression"in e&&e.valueExpression){const i=t.get(e.valueExpression);n.valueExpression=i?await r.getArcadeExecutor(i.expression):void 0}const s=o(e)?e.input:void 0;if(s&&i(s)&&s.choiceExpression){const e=t.get(s.choiceExpression);n.choiceExpression=e?await r.getArcadeExecutor(e.expression):void 0}return n}function s(e){return new Map(e?.map(e=>[e.name,e]))}function a(i,o,n,s){if(null===i)return null;switch(o.type){case"big-integer":case"integer":case"long":case"oid":case"small-integer":{const e=u(i,s);return null==e?null:Math.floor(e)}case"single":case"double":return u(i,s);case"global-id":case"guid":case"string":return s.toString(i);case"date":{const t=l(i,n,s);if(t)return t.getTime();const r=u(i,s);if(null!==r&&!Number.isNaN(r)&&Number.isInteger(r))return r;throw new e("unsupported-value-type",`Unable to convert value ${i} to a date`)}case"date-only":{if(s.isDateOnly(i))return i.toStorageFormat();const r=l(i,n,s);if(!r)throw new e("unsupported-value-type",`Unable to convert value ${i} to a date-only string`);return t.fromDateTime(r.toDateTime()).toStorageFormat()}case"time-only":{if(s.isTime(i))return i.toStorageString();if(s.isDate(i)){return r.fromDateTime(i.toDateTime()).toStorageString()}const t=r.fromString(s.toString(i));if(!t)throw new e("unsupported-value-type",`Unable to convert value ${i} to a time-only string`);return t.toStorageString()}case"timestamp-offset":{const t=l(i,n,s);if(!t)throw new e("unsupported-value-type",`Unable to convert value ${i} to a timestamp-offset string`);return t.toISOString(!1)}}throw new e("unsupported-value-type",`Unable to convert value ${i} to a value matching field type`)}function u(e,t){if(""===e)return null;const r=t.toNumber(e);return Number.isNaN(r)?null:r}function l(e,t,r){if(r.isDate(e))return e;if(r.isDateOnly(e))return e.toArcadeDate();const i=r.toString(e),o=r.toDate(i,t);return o&&/\d{4}-\d{2}-\d{2}/.test(i)?o:null}function c(e,t,r){const{editType:i,map:o,spatialReference:n,timeZone:s}=e,a=t.layer,u="scene"===a?.type&&null!=a.associatedLayer?a.associatedLayer:a;return{variables:{$originalfeature:t.original,$editcontext:{editType:i},$layer:u,$featureset:u,$datastore:u?.url,$feature:t.plainGraphic,$map:o},executeContext:{rawOutput:!0,spatialReference:n??void 0,timeZone:s,abortSignal:r}}}export{a as castArcadeValue,c as makeArcadeContext,n as makeExecutorSetForFormElement,s as makeExpressionInfosMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as o}from"../../../../core/asyncUtils.js";import s from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{abortMaybe as r}from"../../../../core/maybe.js";import{ignoreAbortErrors as n,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{makeArcadeContext as u,castArcadeValue as h}from"../../expressions/expressionUtils.js";let d=class extends t{constructor(e){super(e),this.filterValue="",this._choices=[],this._expressionTask=null,this._updatingHandles=new p}destroy(){r(this._expressionTask),this._updatingHandles.destroy()}get arcadeContextInfo(){return this.fieldInput.expressionsManager.arcadeContext}get choices(){return this._choices}get evaluating(){return this._updatingHandles.updating}get features(){return this.fieldInput.features}get filteredChoices(){const e=this.choices,t=this.filterValue.trim().toLocaleLowerCase();return t?e.filter((e,o)=>this._normalizedChoiceNames[o].includes(t)):e}get input(){return this.fieldInput.input}get _normalizedChoiceNames(){return this._choices.map(({name:e})=>e.toLocaleLowerCase())}async evaluateChoiceExpression(){this._expressionTask=r(this._expressionTask);const e=o(e=>this._evaluateChoiceExpression(e));this._expressionTask=e;try{return await n(this._updatingHandles.addPromise(e.promise))??this.choices}finally{this._expressionTask===e&&(this._expressionTask=null)}}async _evaluateChoiceExpression(e){const t=await(import("../../../../arcade/languageUtils.js"));a(e);const o=this.arcadeContextInfo,s=this.fieldInput.field,r=new Array(this.features.length),n=new Map;let c;this.features.forEach((t,s)=>{const a=this.fieldInput.template.getChoiceExpressionExecutorForLayer(t.layer);if(!a)return void(r[s]=[]);const l=u(o,t,e);c||(c=l.executeContext),i(n,a,()=>[]).push({index:s,variables:l.variables})});for(const[i,p]of n){const n=await i.executeAsyncBatch(p,({variables:e})=>e,c);a(e);for(let e=0;e<n.length;e++){const i=n[e];"rejected"!==i.status?r[p[e].index]=this._parseChoices(i.value,o,s,t):r[p[e].index]=[]}}const l=g(m(r));return this._choices=l,l}_parseChoices(e,t,o,s){if(!s.isDictionary(e))return y(this),[];const i=e.hasField("choices")?e.field("choices"):null,r=s.isImmutableArray(i)?i.toArray():Array.isArray(i)?i:[],n=[];for(const a of r){if(!s.isDictionary(a)||!a.hasField("name")||!a.hasField("code")){y(this);continue}const e=a.field("name"),i=a.field("code");if("string"!=typeof e||void 0===i||s.isVoid(i)||s.isFunctionParameter(i)){y(this);continue}const r=h(i,o,t.timeZone,s);null!=r&&n.push({name:e,code:r})}return n}};e([c()],d.prototype,"arcadeContextInfo",null),e([c()],d.prototype,"choices",null),e([c()],d.prototype,"evaluating",null),e([c()],d.prototype,"features",null),e([c({constructOnly:!0})],d.prototype,"fieldInput",void 0),e([c()],d.prototype,"filteredChoices",null),e([c()],d.prototype,"filterValue",void 0),e([c()],d.prototype,"input",null),e([c()],d.prototype,"_choices",void 0),e([c()],d.prototype,"_normalizedChoiceNames",null),d=e([l("esri.widgets.BatchAttributeForm.inputs.support.DynamicChoiceController")],d);const f=d;function m(e){const[t,...o]=e;if(!t)return[];let s=t;for(const r of o.sort((e,t)=>e.length-t.length)){if(!r.length)return[];const e=new Map;for(const{code:t,name:o}of r)i(e,t,()=>new Set).add(o);if(s=s.filter(({code:t,name:o})=>e.get(t)?.has(o)),!s.length)break}return s}function g(e){const t=new Set;return e.filter(({code:e})=>!t.has(e)&&(t.add(e),!0))}function y(e){s.getLogger(e).error("Value returned by choice expression does not conform to specification.")}export{f as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as s}from"../../../../core/asyncUtils.js";import o from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{abortMaybe as r}from"../../../../core/maybe.js";import{ignoreAbortErrors as n,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{makeArcadeContext as u,castArcadeValue as h}from"../../expressions/expressionUtils.js";let d=class extends t{constructor(e){super(e),this.filterValue="",this._choices=[],this._expressionTask=null,this._updatingHandles=new p}destroy(){r(this._expressionTask),this._updatingHandles.destroy()}get arcadeContextInfo(){return this.fieldInput.expressionsManager.arcadeContext}get choices(){return this._choices}get evaluating(){return this._updatingHandles.updating}get features(){return this.fieldInput.features}get filteredChoices(){const e=this.choices,t=this.filterValue.trim().toLocaleLowerCase();return t?e.filter((e,s)=>this._normalizedChoiceNames[s].includes(t)):e}get input(){return this.fieldInput.input}get _normalizedChoiceNames(){return this._choices.map(({name:e})=>e.toLocaleLowerCase())}async evaluateChoiceExpression(){this._expressionTask=r(this._expressionTask);const e=s(e=>this._evaluateChoiceExpression(e));this._expressionTask=e;try{return await n(this._updatingHandles.addPromise(e.promise))??this.choices}finally{this._expressionTask===e&&(this._expressionTask=null)}}async _evaluateChoiceExpression(e){const t=await(import("../../../../arcade/languageUtils.js"));a(e);const s=this.arcadeContextInfo,o=this.fieldInput.field,r=new Array(this.features.length),n=new Map;let c;this.features.forEach((t,o)=>{const a=this.fieldInput.template.getExpressionExecutorsForLayer(t.layer)?.choiceExpression;if(!a)return void(r[o]=[]);const l=u(s,t,e);c||(c=l.executeContext),i(n,a,()=>[]).push({index:o,variables:l.variables})});for(const[i,p]of n){const n=await i.executeAsyncBatch(p,({variables:e})=>e,c);a(e);for(let e=0;e<n.length;e++){const i=n[e];"rejected"!==i.status?r[p[e].index]=this._parseChoices(i.value,s,o,t):r[p[e].index]=[]}}const l=g(m(r));return this._choices=l,l}_parseChoices(e,t,s,o){if(!o.isDictionary(e))return y(this),[];const i=e.hasField("choices")?e.field("choices"):null,r=o.isImmutableArray(i)?i.toArray():Array.isArray(i)?i:[],n=[];for(const a of r){if(!o.isDictionary(a)||!a.hasField("name")||!a.hasField("code")){y(this);continue}const e=a.field("name"),i=a.field("code");if("string"!=typeof e||void 0===i||o.isVoid(i)||o.isFunctionParameter(i)){y(this);continue}const r=h(i,s,t.timeZone,o);null!=r&&n.push({name:e,code:r})}return n}};e([c()],d.prototype,"arcadeContextInfo",null),e([c()],d.prototype,"choices",null),e([c()],d.prototype,"evaluating",null),e([c()],d.prototype,"features",null),e([c({constructOnly:!0})],d.prototype,"fieldInput",void 0),e([c()],d.prototype,"filteredChoices",null),e([c()],d.prototype,"filterValue",void 0),e([c()],d.prototype,"input",null),e([c()],d.prototype,"_choices",void 0),e([c()],d.prototype,"_normalizedChoiceNames",null),d=e([l("esri.widgets.BatchAttributeForm.inputs.support.DynamicChoiceController")],d);const f=d;function m(e){const[t,...s]=e;if(!t)return[];let o=t;for(const r of s.sort((e,t)=>e.length-t.length)){if(!r.length)return[];const e=new Map;for(const{code:t,name:s}of r)i(e,t,()=>new Set).add(s);if(o=o.filter(({code:t,name:s})=>e.get(t)?.has(s)),!o.length)break}return o}function g(e){const t=new Set;return e.filter(({code:e})=>!t.has(e)&&(t.add(e),!0))}function y(e){o.getLogger(e).error("Value returned by choice expression does not conform to specification.")}export{f as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import o from"../../../core/ReactiveMap.js";import{property as t,subclass as r}from"../../../core/accessorSupport/decorators.js";import{ElementTemplateBase as s}from"./ElementTemplateBase.js";let i=class extends s{constructor(e){super(e),this.domain=null,this.group=null,this.hint=null,this.input=null,this.type="field",this._choiceExpressionExecutorsByLayer=new o}get fieldName(){return this.field.name}addLayer(e,o=null,t){super.addLayer(e,o),t&&this._choiceExpressionExecutorsByLayer.set(e,t)}foldIn(e){for(const o of e.layers)this.addLayer(o,e.getExpressionExecutorsForLayer(o),e.getChoiceExpressionExecutorForLayer(o)??void 0)}getChoiceExpressionExecutorForLayer(e){return this._choiceExpressionExecutorsByLayer.get(e)??null}get hasValueCalculations(){for(const e of this.layers){const o=this.getExpressionExecutorsForLayer(e);if(o?.valueExpression)return!0}return!1}};e([t({clonable:"reference"})],i.prototype,"domain",void 0),e([t({clonable:"reference",constructOnly:!0})],i.prototype,"field",void 0),e([t()],i.prototype,"fieldName",null),e([t({clonable:!1})],i.prototype,"group",void 0),e([t()],i.prototype,"hint",void 0),e([t()],i.prototype,"input",void 0),e([t()],i.prototype,"type",void 0),e([t({clonable:e=>new o(Array.from(e))})],i.prototype,"_choiceExpressionExecutorsByLayer",void 0),e([t()],i.prototype,"hasValueCalculations",null),i=e([r("esri.widgets.BatchAttributeForm.templates.FieldElementTemplate")],i);export{i as FieldElementTemplate};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import{ElementTemplateBase as r}from"./ElementTemplateBase.js";let l=class extends r{constructor(e){super(e),this.domain=null,this.group=null,this.hint=null,this.input=null,this.type="field"}get fieldName(){return this.field.name}get hasValueCalculations(){for(const e of this.layers){const t=this.getExpressionExecutorsForLayer(e);if(t?.valueExpression)return!0}return!1}};e([t({clonable:"reference"})],l.prototype,"domain",void 0),e([t({clonable:"reference",constructOnly:!0})],l.prototype,"field",void 0),e([t()],l.prototype,"fieldName",null),e([t({clonable:!1})],l.prototype,"group",void 0),e([t()],l.prototype,"hint",void 0),e([t()],l.prototype,"input",void 0),e([t()],l.prototype,"type",void 0),e([t()],l.prototype,"hasValueCalculations",null),l=e([o("esri.widgets.BatchAttributeForm.templates.FieldElementTemplate")],l);export{l as FieldElementTemplate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import{isSome as r}from"../../../../core/arrayUtils.js";import n from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{getEffectiveFieldAlias as i}from"../../../../editing/fieldUtils.js";import s from"../../../../form/ExpressionInfo.js";import a from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as m,isDynamicChoiceInput as l}from"../../../../form/elements/inputs/inputUtils.js";import p from"../../../../form/elements/inputs/attachments/AttachmentInput.js";import c from"../../../../form/elements/inputs/attachments/AudioInput.js";import d from"../../../../form/elements/inputs/attachments/DocumentInput.js";import f from"../../../../form/elements/inputs/attachments/ImageInput.js";import u from"../../../../form/elements/inputs/attachments/VideoInput.js";import{isAttachmentElement as x,isFieldElement as y,isGroupElement as h,isRelationshipElement as w,isTextElement as E,isUtilityNetworkAssociationsElement as T}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as I,isFieldVisibleByDefault as v}from"../../../../layers/support/fieldUtils.js";import{isNumber as b}from"../../../../support/guards.js";import{layerSupportsAttachments as j,getLayerTimeZone as g}from"../../batchAttributeFormUtils.js";import{makeExpressionInfosMap as P,makeExecutorSetForFormElement as A}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as Z}from"../AttachmentElementTemplate.js";import F from"../BatchFormTemplate.js";import{FieldElementTemplate as U}from"../FieldElementTemplate.js";import{GroupElementTemplate as C}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as L}from"../RelationshipElementTemplate.js";import{TextElementTemplate as B}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as H}from"../UtilityNetworkAssociationsElementTemplate.js";import{isGroupElementTemplate as N}from"./templateUtils.js";import{compileTextElementMarkdownToHTML as V}from"./textElementTemplateUtils.js";const R="expression/dea57012-47ca4b55a000-8df62742ed0c",S=e("form-attachment-filename-calculation"),W=()=>o.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function k(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?G(r,e,t):K(e,t)}async function K(e,{arcadeExecutorProvider:t,attachmentsEnabled:r,formTimeZone:n}){const o=new Set(I(e)),i={arcadeExecutorProvider:t,formTimeZone:n,layer:e},s=[];for(const m of e.fields)_(m,e,o)&&s.push(Y(m,i));const a=await Promise.all(s);return r&&await D(a,{arcadeExecutorProvider:t,expressionInfos:P(void 0),layer:e}),new F({elements:a,title:e.formTemplate?.title,preserveFieldValuesWhenHidden:!0})}function O(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type&&!1===r.editable&&!r.editableExpression)return!0}else if(O(r.elements??[]))return!0;return!1}async function D(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){if(!j(n))return;const o=await $(new a({displayFilename:!0,input:new p({attachmentAssociationType:"any",inputTypes:[new f,new d,new u,new c]})}),{arcadeExecutorProvider:t,expressionInfos:r,layer:n});e.push(o)}async function G(e,t,r){let n=null;O(e.elements??[])&&(n=new s({title:"",name:R,expression:"false"}));const o=P(n?[...e.expressionInfos??[],n]:e.expressionInfos),i={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new F(i);let m=!1;const{arcadeExecutorProvider:l,formTimeZone:p}=r;for(const s of a){const e=await q(s,{arcadeExecutorProvider:l,expressionInfos:o,layer:t,formTimeZone:p});if(e){if(i.elements.push(e),m)continue;"attachment"===e.type&&(m=!0),N(e)&&e.elements.some(e=>("attachment"===e.type&&(m=!0),m))}}return e.supportsAttachmentElements||!r.attachmentsEnabled||m||await D(i.elements,{arcadeExecutorProvider:l,expressionInfos:o,layer:t}),new F(i)}async function $(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){let i=null;if(e.filenameExpression)try{i=await t(e.filenameExpression,S)}catch(m){W().error("Failed to compile attachment filename expression",m)}const s=new Z({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:i,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),a=await A({element:e,expressionInfos:n,provider:r});return s.addLayer(o,a),s}async function q(e,t){return x(e)?$(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):y(e)?z(e,t):h(e)?J(e,t):w(e)?M(e,t):E(e)?Q(e,t):T(e)?X(e,t):null}async function z(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:a,domain:p,fieldName:c,hint:d,input:f,label:u}=e;if(null==c||!s.has(c))return W().warn(new n("batch-attribute-form:invalid-form-element-field",`Field element with label '${u}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=R),f&&m(f)&&f.otherChoice){const e=f.otherChoice.fieldName,t=s.get(e);t&&t.name!==e&&(f.otherChoice=f.otherChoice.clone(),f.otherChoice.fieldName=t.name)}const x=new U({description:a,domain:p,field:s.get(c),hint:d,input:f,formTimeZone:i,layerTimeZone:g(o),label:u}),y=await A({element:e,expressionInfos:r,provider:t});let h;if(f&&l(f)&&f.choiceExpression){const e=r.get(f.choiceExpression);h=e?await t.getArcadeExecutor(e.expression):void 0}return x.addLayer(o,y,h),x}async function J(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,m=[];for(const c of e.elements){const e=await q(c,t);e&&m.push(e)}const l=new C({description:i,elements:m,label:s,initialState:a??"expanded"}),p=await A({element:e,expressionInfos:n,provider:r});return l.addLayer(o,p),l}async function M(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:m,expressionInfos:l,layer:p,formTimeZone:c}=t,d=new L({description:r,...b(o)&&{displayCount:o},displayType:i,formTimeZone:c,label:n,layerTimeZone:g(p),orderByFields:s,relationshipId:a}),f=await A({element:e,expressionInfos:l,provider:m});return d.addLayer(p,f),d}async function Q(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{description:s,label:a,text:m,textFormat:l}=e,{fieldsIndex:p}=o,c=m&&"markdown"===l?await V(m):m,d=new B({compiledText:c,description:s,fieldsIndex:p,formTimeZone:i,label:a,layerTimeZone:g(o)}),f=await A({element:e,expressionInfos:n,provider:t}),{expressionParts:u}=d;if(u.length){const e=await Promise.all(u.map(e=>{const r=n.get(e)?.expression??e;return t.getArcadeExecutor(r)}));f.textExpressions=e.filter(r)}return d.addLayer(o,f),d}async function X(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,formTimeZone:a,layer:m}=t,l=new H({associationTypes:r,description:n,formTimeZone:a,label:o,layerTimeZone:g(m)}),p=await A({element:e,expressionInfos:s,provider:i});return l.addLayer(m,p),l}async function Y(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const o=i(e,r)||e.name,s=new U({field:e,formTimeZone:n,label:o,layerTimeZone:g(r)}),a={};return e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),s.addLayer(r,a),s}function _(e,t,r){return!r.has(e.name.toLowerCase())&&v(e,t)}export{k as createBatchFormTemplate,K as createBatchFormTemplateFromFields};
2
+ import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import{isSome as r}from"../../../../core/arrayUtils.js";import n from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{getEffectiveFieldAlias as i}from"../../../../editing/fieldUtils.js";import s from"../../../../form/ExpressionInfo.js";import a from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as m}from"../../../../form/elements/inputs/inputUtils.js";import l from"../../../../form/elements/inputs/attachments/AttachmentInput.js";import p from"../../../../form/elements/inputs/attachments/AudioInput.js";import c from"../../../../form/elements/inputs/attachments/DocumentInput.js";import d from"../../../../form/elements/inputs/attachments/ImageInput.js";import f from"../../../../form/elements/inputs/attachments/VideoInput.js";import{isAttachmentElement as u,isFieldElement as x,isGroupElement as y,isRelationshipElement as h,isTextElement as w,isUtilityNetworkAssociationsElement as E}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as T,isFieldVisibleByDefault as I}from"../../../../layers/support/fieldUtils.js";import{isNumber as v}from"../../../../support/guards.js";import{layerSupportsAttachments as b,getLayerTimeZone as j}from"../../batchAttributeFormUtils.js";import{makeExpressionInfosMap as P,makeExecutorSetForFormElement as g}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as Z}from"../AttachmentElementTemplate.js";import A from"../BatchFormTemplate.js";import{FieldElementTemplate as F}from"../FieldElementTemplate.js";import{GroupElementTemplate as U}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as C}from"../RelationshipElementTemplate.js";import{TextElementTemplate as L}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as B}from"../UtilityNetworkAssociationsElementTemplate.js";import{isGroupElementTemplate as H}from"./templateUtils.js";import{compileTextElementMarkdownToHTML as N}from"./textElementTemplateUtils.js";const V="expression/dea57012-47ca4b55a000-8df62742ed0c",R=e("form-attachment-filename-calculation"),S=()=>o.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function W(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?D(r,e,t):k(e,t)}async function k(e,{arcadeExecutorProvider:t,attachmentsEnabled:r,formTimeZone:n}){const o=new Set(T(e)),i={arcadeExecutorProvider:t,formTimeZone:n,layer:e},s=[];for(const m of e.fields)Y(m,e,o)&&s.push(X(m,i));const a=await Promise.all(s);return r&&await O(a,{arcadeExecutorProvider:t,expressionInfos:P(void 0),layer:e}),new A({elements:a,title:e.formTemplate?.title,preserveFieldValuesWhenHidden:!0})}function K(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type&&!1===r.editable&&!r.editableExpression)return!0}else if(K(r.elements??[]))return!0;return!1}async function O(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){if(!b(n))return;const o=await G(new a({displayFilename:!0,input:new l({attachmentAssociationType:"any",inputTypes:[new d,new c,new f,new p]})}),{arcadeExecutorProvider:t,expressionInfos:r,layer:n});e.push(o)}async function D(e,t,r){let n=null;K(e.elements??[])&&(n=new s({title:"",name:V,expression:"false"}));const o=P(n?[...e.expressionInfos??[],n]:e.expressionInfos),i={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new A(i);let m=!1;const{arcadeExecutorProvider:l,formTimeZone:p}=r;for(const s of a){const e=await $(s,{arcadeExecutorProvider:l,expressionInfos:o,layer:t,formTimeZone:p});if(e){if(i.elements.push(e),m)continue;"attachment"===e.type&&(m=!0),H(e)&&e.elements.some(e=>("attachment"===e.type&&(m=!0),m))}}return e.supportsAttachmentElements||!r.attachmentsEnabled||m||await O(i.elements,{arcadeExecutorProvider:l,expressionInfos:o,layer:t}),new A(i)}async function G(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){let i=null;if(e.filenameExpression)try{i=await t(e.filenameExpression,R)}catch(m){S().error("Failed to compile attachment filename expression",m)}const s=new Z({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:i,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),a=await g({element:e,expressionInfos:n,provider:r});return s.addLayer(o,a),s}async function $(e,t){return u(e)?G(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):x(e)?q(e,t):y(e)?z(e,t):h(e)?J(e,t):w(e)?M(e,t):E(e)?Q(e,t):null}async function q(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:a,domain:l,fieldName:p,hint:c,input:d,label:f}=e;if(null==p||!s.has(p))return S().warn(new n("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=V),d&&m(d)&&d.otherChoice){const e=d.otherChoice.fieldName,t=s.get(e);t&&t.name!==e&&(d.otherChoice=d.otherChoice.clone(),d.otherChoice.fieldName=t.name)}const u=new F({description:a,domain:l,field:s.get(p),hint:c,input:d,formTimeZone:i,layerTimeZone:j(o),label:f}),x=await g({element:e,expressionInfos:r,provider:t});return u.addLayer(o,x),u}async function z(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,m=[];for(const c of e.elements){const e=await $(c,t);e&&m.push(e)}const l=new U({description:i,elements:m,label:s,initialState:a??"expanded"}),p=await g({element:e,expressionInfos:n,provider:r});return l.addLayer(o,p),l}async function J(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:m,expressionInfos:l,layer:p,formTimeZone:c}=t,d=new C({description:r,...v(o)&&{displayCount:o},displayType:i,formTimeZone:c,label:n,layerTimeZone:j(p),orderByFields:s,relationshipId:a}),f=await g({element:e,expressionInfos:l,provider:m});return d.addLayer(p,f),d}async function M(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{description:s,label:a,text:m,textFormat:l}=e,{fieldsIndex:p}=o,c=m&&"markdown"===l?await N(m):m,d=new L({compiledText:c,description:s,fieldsIndex:p,formTimeZone:i,label:a,layerTimeZone:j(o)}),f=await g({element:e,expressionInfos:n,provider:t}),{expressionParts:u}=d;if(u.length){const e=await Promise.all(u.map(e=>{const r=n.get(e)?.expression??e;return t.getArcadeExecutor(r)}));f.textExpressions=e.filter(r)}return d.addLayer(o,f),d}async function Q(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,formTimeZone:a,layer:m}=t,l=new B({associationTypes:r,description:n,formTimeZone:a,label:o,layerTimeZone:j(m)}),p=await g({element:e,expressionInfos:s,provider:i});return l.addLayer(m,p),l}async function X(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const o=i(e,r)||e.name,s=new F({field:e,formTimeZone:n,label:o,layerTimeZone:j(r)}),a={};return e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),s.addLayer(r,a),s}function Y(e,t,r){return!r.has(e.name.toLowerCase())&&I(e,t)}export{W as createBatchFormTemplate,k as createBatchFormTemplateFromFields};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as i,onLocaleChange as r}from"../../intl.js";import{getContrast as s,multiplyOpacity as o}from"../../core/colorUtils.js";import{handlesGroup as n}from"../../core/handleUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as l,initial as p}from"../../core/reactiveUtils.js";import{formatDecimal as m,formatImperialLength as c,formatMetricLength as h}from"../../core/unitFormatUtils.js";import{convertUnit as u}from"../../core/units.js";import{property as d,subclass as y}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import{isSupported as g,geodesicLengths as _,geodesicDensify as f}from"../../geometry/geodesicUtils.js";import w from"../../geometry/Point.js";import L from"../../geometry/Polyline.js";import{execute as b,load as S}from"../../geometry/operators/geodeticDensifyOperator.js";import{execute as j,load as M}from"../../geometry/operators/geodeticLengthOperator.js";import{execute as x}from"../../geometry/operators/lengthOperator.js";import C from"../../layers/GraphicsLayer.js";import A from"../../symbols/CIMSymbol.js";import D from"../../symbols/Font.js";import G from"../../symbols/SimpleMarkerSymbol.js";import k from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as T}from"../../views/2d/interactive/SnappingVisualizer2D.js";import O from"../../views/draw/Draw.js";import{createCoordinateHelper as H}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as P,screenToMap as R,dragManipulatedObject as U}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as E}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as I}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as z}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as B}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as F}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as W}from"../../views/interactive/snapping/snappingUtils.js";const N=1e5;let q=class extends I{constructor(e){super(e),this._measurementLayer=new C({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool measurement layer"}),this._manipulatorLayer=new C({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool manipulator layer"}),this._snappingLayer=new C({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool snapping layer"}),this._updatingHandles=new v,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){i("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new O({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([r(async()=>{this.messages=await i("esri/core/t9n/Units")}),l(()=>[this.unit,this.messages],()=>{this._updatePolylines()},p),l(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),W(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=a(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=a(this._measurementLayer),this._manipulatorLayer=a(this._manipulatorLayer),this._snappingLayer=a(this._snappingLayer),this._updatingHandles=a(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}_getSnappingContext(e){return new F({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new B(new z("point",H(!1,!1,this.view.spatialReference)),2),visualizer:new T(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let l=this._vertices.length;l<e.length;l++){const[i,r]=e[l],s=new w({x:i,y:r,spatialReference:t}),o=J(s,this.view,this._manipulatorLayer);this.manipulators.add(o);const a=B.fromGeometry(s,2),p=[a.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[l].coord=[t.pos[0],t.pos[1]],this._updatePolylines())}),P(o,(e,t,i,r)=>{const s=this._getSnappingContext(r),{snappingManager:o}=this,n=this._updatingHandles,{snappingStep:l}=V({snappingContext:s,snappingManager:o,updatingHandles:n});t.next(R(this.view)).next(t=>{if("start"===t.action){const i=new w(t.mapStart);e.graphic.geometry=i,a.trySetGeometry(i)}return t}).next(...l).next(U({operations:a})).next(()=>{e.graphic.geometry=a.data.geometry})})];this._vertices.push({manipulator:o,coord:[i,r],handle:n(p)})}const i=this._vertices.length-1,r=this._vertices[i],[s,o]=e[i];r.coord[0]===s&&r.coord[1]===o||(r.coord=[s,o],r.manipulator.graphic.geometry=new w({x:s,y:o,spatialReference:t}));const a=this._drawActive?this._vertices[i].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==a||e!==a}),this._updatePolylines()}_updatePolylines(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=K(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:i,drawing:r,original:n}=e;this._set("measurement",i);const a=Y(this.messages,i,this.unit);let l,p;this._set("measurementLabel",a);const{graphics:m}=this._measurementLayer,c=2===m.length,{effectiveTheme:h}=this.view;c?(l=m.at(0),p=m.at(1)):(l=new t({symbol:new A({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[14,12],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",width:3.5,color:s(h.accentColor).toArray()},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:5,color:h.accentColor.toArray()}]}}})}),p=new t({symbol:new k({color:h.textColor,haloColor:o(s(h.textColor,160),.5),haloSize:2,font:new D({size:14,family:"sans-serif"})})}),m.removeAll(),m.addMany([l,p])),l.geometry=r,p.geometry=n.extent?.center,p.symbol.text=a}};function J(e,i,r){const s=o(i.effectiveTheme.accentColor,.5),n={type:"simple-line",width:0},a=8,l=new G({style:"circle",color:s,size:a,outline:n}),p=new G({style:"circle",color:s,size:1.5*a,outline:n}),m=new t({geometry:e,symbol:l});return new E({view:i,layer:r,graphic:m,focusedSymbol:p,consumesClicks:!1})}function K(e,t){const i=new L({paths:[e],spatialReference:t});let r,s;return t.isGeographic?g(t)?(r=_([i],"meters")[0],s=f(i,N)):(r=j(i,{unit:"meters"}),s=b(i,N,{unit:"meters"})):t.isWebMercator?(r=j(i,{unit:"meters"}),s=b(i,N,{unit:"meters"})):(r=x(i,{unit:"meters"}),s=i),{measurement:{geometry:s,length:r},original:i,drawing:s}}function Q(e){return null!=e}async function X(e){(e?.isGeographic&&!g(e)||e?.isWebMercator)&&await Promise.all([S(),M()])}function Y(e,t,i){if(!t||!e)return"";switch(i){case"metric":return h(e,t.length,"meters");case"imperial":return c(e,t.length,"meters");default:return m(e,u(t.length,"meters",i),i)}}e([d()],q.prototype,"_drawActive",void 0),e([d({readOnly:!0})],q.prototype,"cursor",null),e([d({value:!0})],q.prototype,"editable",null),e([d({readOnly:!0})],q.prototype,"measurement",void 0),e([d({readOnly:!0})],q.prototype,"measurementLabel",void 0),e([d()],q.prototype,"messages",void 0),e([d({constructOnly:!0})],q.prototype,"snappingManager",void 0),e([d()],q.prototype,"unit",void 0),e([d()],q.prototype,"updating",null),e([d({constructOnly:!0})],q.prototype,"view",void 0),q=e([y("esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DTool")],q);export{q as DistanceMeasurement2DTool,K as createDistanceMeasurementInfo2D,Y as createDistanceMeasurementLabel,Q as isSupported,X as loadGeometryOperators};
2
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as i,onLocaleChange as r}from"../../intl.js";import{getContrast as s,multiplyOpacity as o}from"../../core/colorUtils.js";import{handlesGroup as n}from"../../core/handleUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as l,initial as p}from"../../core/reactiveUtils.js";import{formatDecimal as m,formatImperialLength as c,formatMetricLength as h}from"../../core/unitFormatUtils.js";import{convertUnit as u}from"../../core/units.js";import{property as d,subclass as y}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import{isSupported as g,geodesicLengths as _,geodesicDensify as f}from"../../geometry/geodesicUtils.js";import w from"../../geometry/Point.js";import L from"../../geometry/Polyline.js";import{geodeticDensifyExecute as b,geodeticDensifyLoad as S}from"../../geometry/operators/geodeticDensifyOperator.js";import{geodeticLengthExecute as j,geodeticLengthLoad as M}from"../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as x}from"../../geometry/operators/lengthOperator.js";import C from"../../layers/GraphicsLayer.js";import A from"../../symbols/CIMSymbol.js";import D from"../../symbols/Font.js";import G from"../../symbols/SimpleMarkerSymbol.js";import k from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as T}from"../../views/2d/interactive/SnappingVisualizer2D.js";import O from"../../views/draw/Draw.js";import{createCoordinateHelper as H}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as P,screenToMap as R,dragManipulatedObject as U}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as E}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as I}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as z}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as B}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as F}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as W}from"../../views/interactive/snapping/snappingUtils.js";const N=1e5;let q=class extends I{constructor(e){super(e),this._measurementLayer=new C({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool measurement layer"}),this._manipulatorLayer=new C({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool manipulator layer"}),this._snappingLayer=new C({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool snapping layer"}),this._updatingHandles=new v,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){i("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new O({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([r(async()=>{this.messages=await i("esri/core/t9n/Units")}),l(()=>[this.unit,this.messages],()=>{this._updatePolylines()},p),l(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),W(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=a(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=a(this._measurementLayer),this._manipulatorLayer=a(this._manipulatorLayer),this._snappingLayer=a(this._snappingLayer),this._updatingHandles=a(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}_getSnappingContext(e){return new F({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new B(new z("point",H(!1,!1,this.view.spatialReference)),2),visualizer:new T(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let l=this._vertices.length;l<e.length;l++){const[i,r]=e[l],s=new w({x:i,y:r,spatialReference:t}),o=J(s,this.view,this._manipulatorLayer);this.manipulators.add(o);const a=B.fromGeometry(s,2),p=[a.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[l].coord=[t.pos[0],t.pos[1]],this._updatePolylines())}),P(o,(e,t,i,r)=>{const s=this._getSnappingContext(r),{snappingManager:o}=this,n=this._updatingHandles,{snappingStep:l}=V({snappingContext:s,snappingManager:o,updatingHandles:n});t.next(R(this.view)).next(t=>{if("start"===t.action){const i=new w(t.mapStart);e.graphic.geometry=i,a.trySetGeometry(i)}return t}).next(...l).next(U({operations:a})).next(()=>{e.graphic.geometry=a.data.geometry})})];this._vertices.push({manipulator:o,coord:[i,r],handle:n(p)})}const i=this._vertices.length-1,r=this._vertices[i],[s,o]=e[i];r.coord[0]===s&&r.coord[1]===o||(r.coord=[s,o],r.manipulator.graphic.geometry=new w({x:s,y:o,spatialReference:t}));const a=this._drawActive?this._vertices[i].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==a||e!==a}),this._updatePolylines()}_updatePolylines(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=K(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:i,drawing:r,original:n}=e;this._set("measurement",i);const a=Y(this.messages,i,this.unit);let l,p;this._set("measurementLabel",a);const{graphics:m}=this._measurementLayer,c=2===m.length,{effectiveTheme:h}=this.view;c?(l=m.at(0),p=m.at(1)):(l=new t({symbol:new A({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[14,12],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",width:3.5,color:s(h.accentColor).toArray()},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:5,color:h.accentColor.toArray()}]}}})}),p=new t({symbol:new k({color:h.textColor,haloColor:o(s(h.textColor,160),.5),haloSize:2,font:new D({size:14,family:"sans-serif"})})}),m.removeAll(),m.addMany([l,p])),l.geometry=r,p.geometry=n.extent?.center,p.symbol.text=a}};function J(e,i,r){const s=o(i.effectiveTheme.accentColor,.5),n={type:"simple-line",width:0},a=8,l=new G({style:"circle",color:s,size:a,outline:n}),p=new G({style:"circle",color:s,size:1.5*a,outline:n}),m=new t({geometry:e,symbol:l});return new E({view:i,layer:r,graphic:m,focusedSymbol:p,consumesClicks:!1})}function K(e,t){const i=new L({paths:[e],spatialReference:t});let r,s;return t.isGeographic?g(t)?(r=_([i],"meters")[0],s=f(i,N)):(r=j(i,{unit:"meters"}),s=b(i,N,{unit:"meters"})):t.isWebMercator?(r=j(i,{unit:"meters"}),s=b(i,N,{unit:"meters"})):(r=x(i,{unit:"meters"}),s=i),{measurement:{geometry:s,length:r},original:i,drawing:s}}function Q(e){return null!=e}async function X(e){(e?.isGeographic&&!g(e)||e?.isWebMercator)&&await Promise.all([S(),M()])}function Y(e,t,i){if(!t||!e)return"";switch(i){case"metric":return h(e,t.length,"meters");case"imperial":return c(e,t.length,"meters");default:return m(e,u(t.length,"meters",i),i)}}e([d()],q.prototype,"_drawActive",void 0),e([d({readOnly:!0})],q.prototype,"cursor",null),e([d({value:!0})],q.prototype,"editable",null),e([d({readOnly:!0})],q.prototype,"measurement",void 0),e([d({readOnly:!0})],q.prototype,"measurementLabel",void 0),e([d()],q.prototype,"messages",void 0),e([d({constructOnly:!0})],q.prototype,"snappingManager",void 0),e([d()],q.prototype,"unit",void 0),e([d()],q.prototype,"updating",null),e([d({constructOnly:!0})],q.prototype,"view",void 0),q=e([y("esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DTool")],q);export{q as DistanceMeasurement2DTool,K as createDistanceMeasurementInfo2D,Y as createDistanceMeasurementLabel,Q as isSupported,X as loadGeometryOperators};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";function r(e){return"multipoint"===e||"polygon"===e||"polyline"===e}async function t(){return{unionOperator:await(import("../../../geometry/operators/unionOperator.js"))}}async function o(r){const{unionOperator:o}=await t(),n=r.map(r=>{if(!r.geometry)throw new e("editing:invalid-argument","All features must have a geometry.");return r.geometry}),i=o.executeMany(n);if(!i)throw new e("editing:merge-failed","Failed to merge feature geometries.");return i}export{r as isMergeableGeometryType,o as mergeFeatures};
2
+ import e from"../../../core/Error.js";function t(e){return"multipoint"===e||"polygon"===e||"polyline"===e}async function r(){const{unionExecuteMany:e}=await(import("../../../geometry/operators/unionOperator.js"));return e}async function n(t){const n=(await r())(t.map(t=>{if(!t.geometry)throw new e("editing:invalid-argument","All features must have a geometry.");return t.geometry}));if(!n)throw new e("editing:merge-failed","Failed to merge feature geometries.");return n}export{t as isMergeableGeometryType,n as mergeFeatures};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{splitSegmentAtPoint as t}from"../../../editing/geometry/lineUtils.js";import n from"../../../geometry/Polyline.js";import{isCurvedGeometry as o,getEndpoint as r}from"../../../geometry/support/curves/curveUtils.js";import{createCoordinateHelper as i}from"../../../views/interactive/coordinateHelper.js";async function a(t,n){if("point"===t.type||"extent"===t.type||"mesh"===t.type)throw new e("editing:unsupported-split-geometry",`Cannot split geometry of type ${t.type}`);if("point"===n.type&&c(t))return await l(t,n);if("polyline"===n.type&&y(t))return s(t,n);if("polygon"===n.type&&u(t))return p(t,n);throw new e("editing:unsupported-split-geometry",`Geometry of type ${n.type} cannot be used to split geometry of type ${t.type}`)}async function l(a,l){const{apiConverter:p,arcadeMeasures:{pointToCoordinate:s},lengthOperator:c}=await f(),u=p.fromSpatialReference(a.spatialReference)?.getTolerance()??.001,y=s(a,l);if(null==y||null==y.distance||y.distance>u)return null;const d=s(a,y.coordinate);if(null==d||null==d.distanceAlong||null==d.partId||null==d.segmentId)throw new e("editing:split-by-point-failed","Failed to determine the split point on the polyline.");const m=d.coordinate.hasZ&&a.hasZ,g=i(m,a.hasM,a.spatialReference),h=o(a),w=h?a.curvePaths:a.paths,j=[],I=[];for(let e=0;e<w.length;e++){const n=w[e];if(e<d.partId)j.push(n);else if(e>d.partId)I.push(n);else{const e=[],o=[];for(let i=0;i<n.length;i++){const a=n[i];if(i<d.segmentId)e.push(a);else if(i>d.segmentId)o.push(a);else{const l=r(a),p=n.at(i+1),s=g.pointToArray(d.coordinate);if(i++,!p){e.push(a,s),o.push(s);continue}const[c,y]=t(l,p,s,m,u);e.push(...c),o.push(...y)}}e.length>0&&j.push(e),o.length>0&&I.push(o)}}const P=new n({[h?"curvePaths":"paths"]:j,spatialReference:a.spatialReference,hasZ:a.hasZ,hasM:a.hasM}),O=new n({[h?"curvePaths":"paths"]:I,spatialReference:a.spatialReference,hasZ:a.hasZ,hasM:a.hasM}),v=c.execute(P),F=c.execute(O),b=Math.max(v,F);if(0===b)return null;const x=b===v?P:O;return{remainingPart:x,newPart:0===Math.min(v,F)?null:x===P?O:P}}async function p(e,t){const{differenceOperator:n,intersectionOperator:o}=await d(),r=o.execute(e,t);if(!r)return null;const i=n.execute(e,t);return i?{newPart:r,remainingPart:i}:{newPart:null,remainingPart:r}}async function s(e,t){const{cutOperator:n}=await m(),o=n.execute(e,t);if(2!==o.length)return null;const r=o[0];return{newPart:o[1]??null,remainingPart:r}}function c(e){return"polyline"===e.type}function u(e){return"polygon"===e.type||"polyline"===e.type||"multipoint"===e.type}function y(e){return"polygon"===e.type||"polyline"===e.type}async function f(){const[e,t,n]=await Promise.all([import("../../../geometry/operators/support/apiConverter.js"),import("../../../arcade/functions/measures.js"),import("../../../geometry/operators/lengthOperator.js")]);return{apiConverter:e,lengthOperator:n,arcadeMeasures:t}}async function d(){const[e,t]=await Promise.all([import("../../../geometry/operators/differenceOperator.js"),import("../../../geometry/operators/intersectionOperator.js")]);return{differenceOperator:e,intersectionOperator:t}}async function m(){return{cutOperator:await(import("../../../geometry/operators/cutOperator.js"))}}function g(e){return"multipoint"===e||"polygon"===e||"polyline"===e}function h(t){if(!t)throw new e("editing:cannot-split-geometry","No geometry provided.");if(u(t)||y(t)||c(t))return t;throw new e("editing:cannot-split-geometry",`Cannot split geometry of type ${t.type}`)}function w(e,t){return"point"===t&&c(e)||"polyline"===t&&y(e)||"polygon"===t&&u(e)?t:j(e)}function j(e){return"polyline"===e.type?"point":"polyline"}function I(e){const t=e?.type;return"point"===t||"polyline"===t||"polygon"===t}function P(e,t){const{fieldsIndex:n}=t,o={...e};if("globalIdField"in t&&t.globalIdField){delete o[n.get(t.globalIdField)?.name??t.globalIdField]}if(t.objectIdField){delete o[n.get(t.objectIdField)?.name??t.objectIdField]}if("relationships"in t&&t.relationships)for(const r of t.relationships)if("one-to-one"===r.cardinality||"origin"===r.role&&"one-to-many"===r.cardinality){const e=n.get(r.keyField)?.name??r.keyField;null!=o[e]&&delete o[e]}return o}export{c as canSplitByPoint,h as ensureSplittableGeometry,w as getCompatibleSpitterGeometryType,j as getDefaultSplitterGeometryType,g as isSplittableGeometryType,I as isSplitterGeometry,P as makeNewFeatureAttributes,a as splitGeometry};
2
+ import e from"../../../core/Error.js";import{splitSegmentAtPoint as t}from"../../../editing/geometry/lineUtils.js";import n from"../../../geometry/Polyline.js";import{isCurvedGeometry as o,getEndpoint as r}from"../../../geometry/support/curves/curveUtils.js";import{createCoordinateHelper as i}from"../../../views/interactive/coordinateHelper.js";async function a(t,n){if("point"===t.type||"extent"===t.type||"mesh"===t.type)throw new e("editing:unsupported-split-geometry",`Cannot split geometry of type ${t.type}`);if("point"===n.type&&c(t))return await l(t,n);if("polyline"===n.type&&y(t))return s(t,n);if("polygon"===n.type&&u(t))return p(t,n);throw new e("editing:unsupported-split-geometry",`Geometry of type ${n.type} cannot be used to split geometry of type ${t.type}`)}async function l(a,l){const{apiConverter:{fromSpatialReference:p},arcadeMeasures:{pointToCoordinate:s},lengthOperator:{lengthExecute:c}}=await f(),u=p(a.spatialReference)?.getTolerance()??.001,y=s(a,l);if(null==y||null==y.distance||y.distance>u)return null;const d=s(a,y.coordinate);if(null==d||null==d.distanceAlong||null==d.partId||null==d.segmentId)throw new e("editing:split-by-point-failed","Failed to determine the split point on the polyline.");const g=d.coordinate.hasZ&&a.hasZ,m=i(g,a.hasM,a.spatialReference),h=o(a),w=h?a.curvePaths:a.paths,j=[],I=[];for(let e=0;e<w.length;e++){const n=w[e];if(e<d.partId)j.push(n);else if(e>d.partId)I.push(n);else{const e=[],o=[];for(let i=0;i<n.length;i++){const a=n[i];if(i<d.segmentId)e.push(a);else if(i>d.segmentId)o.push(a);else{const l=r(a),p=n.at(i+1),s=m.pointToArray(d.coordinate);if(i++,!p){e.push(a,s),o.push(s);continue}const[c,y]=t(l,p,s,g,u);e.push(...c),o.push(...y)}}e.length>0&&j.push(e),o.length>0&&I.push(o)}}const P=new n({[h?"curvePaths":"paths"]:j,spatialReference:a.spatialReference,hasZ:a.hasZ,hasM:a.hasM}),O=new n({[h?"curvePaths":"paths"]:I,spatialReference:a.spatialReference,hasZ:a.hasZ,hasM:a.hasM}),v=c(P),F=c(O),b=Math.max(v,F);if(0===b)return null;const M=b===v?P:O;return{remainingPart:M,newPart:0===Math.min(v,F)?null:M===P?O:P}}async function p(e,t){const{differenceOperator:{differenceExecute:n},intersectionOperator:{intersectionExecute:o}}=await d(),r=o(e,t);if(!r)return null;const i=n(e,t);return i?{newPart:r,remainingPart:i}:{newPart:null,remainingPart:r}}async function s(e,t){const{cutOperator:{cutExecute:n}}=await g(),o=n(e,t);if(2!==o.length)return null;const r=o[0];return{newPart:o[1]??null,remainingPart:r}}function c(e){return"polyline"===e.type}function u(e){return"polygon"===e.type||"polyline"===e.type||"multipoint"===e.type}function y(e){return"polygon"===e.type||"polyline"===e.type}async function f(){const[e,t,n]=await Promise.all([import("../../../geometry/operators/support/apiConverter.js"),import("../../../arcade/functions/measures.js"),import("../../../geometry/operators/lengthOperator.js")]);return{apiConverter:e,lengthOperator:n,arcadeMeasures:t}}async function d(){const[e,t]=await Promise.all([import("../../../geometry/operators/differenceOperator.js"),import("../../../geometry/operators/intersectionOperator.js")]);return{differenceOperator:e,intersectionOperator:t}}async function g(){return{cutOperator:await(import("../../../geometry/operators/cutOperator.js"))}}function m(e){return"multipoint"===e||"polygon"===e||"polyline"===e}function h(t){if(!t)throw new e("editing:cannot-split-geometry","No geometry provided.");if(u(t)||y(t)||c(t))return t;throw new e("editing:cannot-split-geometry",`Cannot split geometry of type ${t.type}`)}function w(e,t){return"point"===t&&c(e)||"polyline"===t&&y(e)||"polygon"===t&&u(e)?t:j(e)}function j(e){return"polyline"===e.type?"point":"polyline"}function I(e){const t=e?.type;return"point"===t||"polyline"===t||"polygon"===t}function P(e,t){const{fieldsIndex:n}=t,o={...e};if("globalIdField"in t&&t.globalIdField){delete o[n.get(t.globalIdField)?.name??t.globalIdField]}if(t.objectIdField){delete o[n.get(t.objectIdField)?.name??t.objectIdField]}if("relationships"in t&&t.relationships)for(const r of t.relationships)if("one-to-one"===r.cardinality||"origin"===r.role&&"one-to-many"===r.cardinality){const e=n.get(r.keyField)?.name??r.keyField;null!=o[e]&&delete o[e]}return o}export{c as canSplitByPoint,h as ensureSplittableGeometry,w as getCompatibleSpitterGeometryType,j as getDefaultSplitterGeometryType,m as isSplittableGeometryType,I as isSplitterGeometry,P as makeNewFeatureAttributes,a as splitGeometry};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as i}from"tslib";import t from"../../../core/Accessor.js";import{createTask as o}from"../../../core/asyncUtils.js";import{abortMaybe as e,destroyMaybe as s}from"../../../core/maybe.js";import{whenOrAbort as l}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as p}from"../../../core/accessorSupport/decorators.js";let m=class extends t{constructor(i){super(i),this._implementation=null,this._loadingTask=null}initialize(){this.addHandles(r(()=>({tool:this.tool,view:this.tool.viewModel.view,visible:this.tool.visible&&!!this.tool.viewModel.view?.ready}),({tool:i,view:t,visible:o})=>{null!=t&&o?this._show(t,i):this._hide()},a))}destroy(){this._hide()}get updating(){return!(this._loadingTask?.finished??1)||(this._implementation?.updating??!1)}_show(i,t){this._loadingTask=e(this._loadingTask),this._loadingTask=o(async o=>{if("2d"===i.type){const e=import("./ElevationProfileView2D.js"),s=(await l(e,o)).ElevationProfileView2D;this._implementation=new s(i,t)}else if("3d"===i.type){const e=import("./ElevationProfileView3D.js"),s=(await l(e,o)).ElevationProfileView3D;this._implementation=new s(i,t)}})}_hide(){this._loadingTask=e(this._loadingTask),this._implementation=s(this._implementation)}};i([n()],m.prototype,"tool",void 0),i([n()],m.prototype,"updating",null),i([n()],m.prototype,"_implementation",void 0),i([n()],m.prototype,"_loadingTask",void 0),m=i([p("esri.widgets.ElevationProfile.support.ElevationProfileView")],m);export{m as ElevationProfileView};
2
+ import{__decorate as i}from"tslib";import t from"../../../core/Accessor.js";import{createTask as o}from"../../../core/asyncUtils.js";import{abortMaybe as e,destroyMaybe as s}from"../../../core/maybe.js";import{whenOrAbort as l}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as p}from"../../../core/accessorSupport/decorators.js";let m=class extends t{constructor(i){super(i),this._implementation=null,this._loadingTask=null}initialize(){this.addHandles(r(()=>({tool:this.tool,view:this.tool.viewModel.view,visible:this.tool.visible&&!!this.tool.viewModel.view?.ready}),({tool:i,view:t,visible:o})=>{null!=t&&o?this._show(t,i):this._hide()},a))}destroy(){this._hide()}get updating(){return!(this._loadingTask?.finished??!0)||(this._implementation?.updating??!1)}_show(i,t){this._loadingTask=e(this._loadingTask),this._loadingTask=o(async o=>{if("2d"===i.type){const e=import("./ElevationProfileView2D.js"),s=(await l(e,o)).ElevationProfileView2D;this._implementation=new s(i,t)}else if("3d"===i.type){const e=import("./ElevationProfileView3D.js"),s=(await l(e,o)).ElevationProfileView3D;this._implementation=new s(i,t)}})}_hide(){this._loadingTask=e(this._loadingTask),this._implementation=s(this._implementation)}};i([n()],m.prototype,"tool",void 0),i([n()],m.prototype,"updating",null),i([n()],m.prototype,"_implementation",void 0),i([n()],m.prototype,"_loadingTask",void 0),m=i([p("esri.widgets.ElevationProfile.support.ElevationProfileView")],m);export{m as ElevationProfileView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createTask as i}from"../../../core/asyncUtils.js";import{abortMaybe as t,removeMaybe as h}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{highlightsSupported as e}from"../../../views/support/layerViewUtils.js";class r{get updating(){return!(this._highlightTask?.finished??1)}constructor(i){this._params=i,this._highlightTask=null,this._highlightHandle=null}destroy(){this.remove()}remove(){this._highlightTask=t(this._highlightTask),this._highlightHandle=h(this._highlightHandle)}update(t){if(this.remove(),null==t||!l(t))return;const h=t.layer;this._highlightTask=i(async i=>{const r=await this._params.view.whenLayerView(h);s(i);const l=e(r)?r:null;l&&(this._highlightHandle=l.highlight(t))})}}function l(i){return null!=i.geometry&&"polyline"===i.geometry.type}export{r as InputRepresentation2D};
2
+ import{createTask as i}from"../../../core/asyncUtils.js";import{abortMaybe as t,removeMaybe as h}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{highlightsSupported as e}from"../../../views/support/layerViewUtils.js";class r{get updating(){return!(this._highlightTask?.finished??!0)}constructor(i){this._params=i,this._highlightTask=null,this._highlightHandle=null}destroy(){this.remove()}remove(){this._highlightTask=t(this._highlightTask),this._highlightHandle=h(this._highlightHandle)}update(t){if(this.remove(),null==t||!l(t))return;const h=t.layer;this._highlightTask=i(async i=>{const r=await this._params.view.whenLayerView(h);s(i);const l=e(r)?r:null;l&&(this._highlightHandle=l.highlight(t))})}}function l(i){return null!=i.geometry&&"polyline"===i.geometry.type}export{r as InputRepresentation2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createTask as e}from"../../../core/asyncUtils.js";import{destroyHandle as i,handlesGroup as t}from"../../../core/handleUtils.js";import{abortMaybe as s,removeMaybe as l}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{watch as h}from"../../../core/reactiveUtils.js";import{getGraphicEffectiveElevationInfo as a}from"../../../support/elevationInfoUtils.js";import{Settings as n}from"../../../views/3d/interactive/editingTools/settings.js";import{OutlineVisualElement as o}from"../../../views/3d/interactive/visualElements/OutlineVisualElement.js";import{GraphicState as m}from"../../../views/3d/layers/graphics/GraphicState.js";import{highlightsSupported as g}from"../../../views/support/layerViewUtils.js";class c{get updating(){return!(this._highlightTask?.finished??1)}constructor(e){this._params=e,this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null,this._settings=new n({getTheme:()=>this._params.view.effectiveTheme})}destroy(){this.remove()}remove(){this._highlightTask=s(this._highlightTask),this._highlightHandle=l(this._highlightHandle),this._visualElementHandle=l(this._visualElementHandle)}showHighlight(i){if(this.remove(),null==i||!p(i))return;const t=i.layer;this._highlightTask=e(async e=>{const s=await this._params.view.whenLayerView(t);r(e),g(s)&&(this._highlightHandle=s.highlight(i))})}showReshaping(e){if(this.remove(),null==e)return;const s=this._params.view,l=new o({view:s,geometry:p(e)?e.geometry:null,attached:!1,elevationInfo:a(e),renderOccluded:8,isDecoration:!0}),r=new m({graphic:e}),n=[h(()=>r.isDraped,e=>{l.isDraped=e}),r.on("changed",()=>{l.geometry=p(e)?e.geometry:null}),s.trackGraphicState(r),s.maskOccludee(e),i(l)];this._settings.visualElements.lineObjects.outline.apply(l),l.attached=!0,this._visualElementHandle=t(n)}}function p(e){return null!=e.geometry&&"polyline"===e.geometry.type}export{c as InputRepresentation3D};
2
+ import{createTask as e}from"../../../core/asyncUtils.js";import{destroyHandle as i,handlesGroup as t}from"../../../core/handleUtils.js";import{abortMaybe as s,removeMaybe as l}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{watch as h}from"../../../core/reactiveUtils.js";import{getGraphicEffectiveElevationInfo as a}from"../../../support/elevationInfoUtils.js";import{Settings as n}from"../../../views/3d/interactive/editingTools/settings.js";import{OutlineVisualElement as o}from"../../../views/3d/interactive/visualElements/OutlineVisualElement.js";import{GraphicState as m}from"../../../views/3d/layers/graphics/GraphicState.js";import{highlightsSupported as g}from"../../../views/support/layerViewUtils.js";class c{get updating(){return!(this._highlightTask?.finished??!0)}constructor(e){this._params=e,this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null,this._settings=new n({getTheme:()=>this._params.view.effectiveTheme})}destroy(){this.remove()}remove(){this._highlightTask=s(this._highlightTask),this._highlightHandle=l(this._highlightHandle),this._visualElementHandle=l(this._visualElementHandle)}showHighlight(i){if(this.remove(),null==i||!p(i))return;const t=i.layer;this._highlightTask=e(async e=>{const s=await this._params.view.whenLayerView(t);r(e),g(s)&&(this._highlightHandle=s.highlight(i))})}showReshaping(e){if(this.remove(),null==e)return;const s=this._params.view,l=new o({view:s,geometry:p(e)?e.geometry:null,attached:!1,elevationInfo:a(e),renderOccluded:8,isDecoration:!0}),r=new m({graphic:e}),n=[h(()=>r.isDraped,e=>{l.isDraped=e}),r.on("changed",()=>{l.geometry=p(e)?e.geometry:null}),s.trackGraphicState(r),s.maskOccludee(e),i(l)];this._settings.visualElements.lineObjects.outline.apply(l),l.attached=!0,this._visualElementHandle=t(n)}}function p(e){return null!=e.geometry&&"polyline"===e.geometry.type}export{c as InputRepresentation3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/units.js";import{distance as s,lerp as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{lerp as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{geodesicLengths as i,isSupported as c,inverseGeodeticSolver as u,directGeodeticSolver as l}from"../../../geometry/geodesicUtils.js";import f from"../../../geometry/Polyline.js";import{initializeProjection as h,project as p}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{ProfileGenerationError as g}from"./ProfileGenerationError.js";async function w(e,t,s,o,a,c,u){let l,f,d;const w=e.spatialReference,j=w.isGeographic||w.isWebMercator;let v=0;if(!j){const{execute:t}=await(import("../../../geometry/operators/lengthOperator.js"));n(u),v=t(e,{unit:"meters"}),n(u)}const x=1/r(o);if(j){await h([{source:w,dest:o},{source:w,dest:m.WGS84}],u);const n=D(e);l=i([n],"meters")[0];const r=R(l,a);if(L(e,l,r)>c)throw new g("too-complex");const j=y(n,t,s);({densifiedPath:f,distances:d}=A(j,r,x)),f=p(f,o)}else{await h([{source:w,dest:o}],u),l=v;const r=R(l,a);if(L(e,l,r)>c)throw new g("too-complex");const i=y(e,t,s);({densifiedPath:f,distances:d}=S(i,r,x)),n(u),f=p(f,o)}return{densifiedPath:f,pathLength:l*x,distances:d}}function R(e,t){const n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function y(e,t,n){if(null==t)return x(e);const r=e.spatialReference,s=t.mode,o=d(t,r);let a=null;switch(n.type){case"2d":a=j(e,s,o);break;case"3d":a=v(e,s,o,n)}return null==a?x(e):new f({hasZ:!0,hasM:!1,spatialReference:r,paths:P(e.paths,a)})}function j({hasZ:e},t,n){return"absolute-height"===t?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function v({spatialReference:e,hasZ:t},n,r,{elevationProvider:s}){const o=(t,n,r,o)=>s?.getElevation(t,n,r,e,o)??0;switch(n){case"on-the-ground":return([e,t])=>[e,t,o(e,t,0,"ground")];case"absolute-height":return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case"relative-to-ground":return t?([e,t,n])=>[e,t,n+o(e,t,n,"ground")+r]:([e,t])=>[e,t,o(e,t,0,"ground")+r];case"relative-to-scene":return t?([e,t,n])=>[e,t,n+o(e,t,n,"scene")+r]:([e,t])=>[e,t,o(e,t,0,"scene")+r];default:return null}}function x(e){return e.hasZ?new f({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:P(e.paths,([e,t])=>[e,t])}):e}function P(e,t){const n=e.length,r=new Array(n);for(let s=0;s<n;++s){const n=e[s],o=n.length,a=new Array(n.length);r[s]=a;for(let e=0;e<o;++e)a[e]=t(n[e])}return r}function Z(e){return M(e)&&e.paths.length>0&&e.paths.every(e=>e.length>=2)}function M(e){return null!=e&&"polyline"===e.type}function b(t,n,s,o,a){const{spatialReference:i,hasZ:c}=t,u={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:i,metersPerSR:r(i)},l=[],h=[];let p=0;for(let r=0;r<t.paths.length;++r){const i=t.paths[r],c=new Array,f=new Array;let m=0;for(let t=1;t<i.length;++t){const r=i[t-1],l=i[t],h=o(u,r,l);let d;for(d=m;d<h.distance&&!e(d,h.distance);d+=n)c.push(a(h,d)),f.push((p+d)*s);m=d-h.distance,p+=h.distance,c.push(l),f.push(p*s)}l[r]=c,h[r]=f}return{densifiedPath:new f({spatialReference:i,hasZ:c,paths:l}),distances:h}}function S(e,t,n){const{hasZ:r}=e;return b(e,t,n,z,r?k:E)}function A(e,t,n){const{hasZ:r}=e;return b(e,t,n,U,r?W:G)}function U(e,t,n){return e.distance=0,u(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function z(e,t,n){return e.from=t,e.to=n,e.distance=s(n,t)*e.metersPerSR,e}function G({from:e,azimuth:t,spatialReference:n},r){return l([0,0],e,t,r,n)}function W({from:e,to:n,azimuth:r,distance:s,spatialReference:o},a){const i=a/s,c=[0,0,t(e[2],n[2],i)];return l(c,e,r,a,o),c}function E({from:e,to:t,distance:n},r){return o([0,0],e,t,r/n)}function k({from:e,to:t,distance:n},r){return a([0,0,0],e,t,r/n)}function D(e){return c(e.spatialReference)?e:p(e,m.WGS84)}function I(e){return e.paths.reduce((e,t)=>e+t.length,0)}function L(e,t,n){return I(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{I as countPoints,w as densifyPath,M as isPolyline,Z as isValidInputPath,y as toAbsoluteHeightElevation};
2
+ import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/units.js";import{distance as s,lerp as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{lerp as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{geodesicLengths as i,isSupported as c,inverseGeodeticSolver as l,directGeodeticSolver as u}from"../../../geometry/geodesicUtils.js";import f from"../../../geometry/Polyline.js";import{initializeProjection as h,project as p}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{ProfileGenerationError as g}from"./ProfileGenerationError.js";async function w(e,t,s,o,a,c,l){let u,f,d;const w=e.spatialReference,j=w.isGeographic||w.isWebMercator;let v=0;if(!j){const{lengthExecute:t}=await(import("../../../geometry/operators/lengthOperator.js"));n(l),v=t(e,{unit:"meters"}),n(l)}const x=1/r(o);if(j){await h([{source:w,dest:o},{source:w,dest:m.WGS84}],l);const n=D(e);u=i([n],"meters")[0];const r=R(u,a);if(L(e,u,r)>c)throw new g("too-complex");const j=y(n,t,s);({densifiedPath:f,distances:d}=A(j,r,x)),f=p(f,o)}else{await h([{source:w,dest:o}],l),u=v;const r=R(u,a);if(L(e,u,r)>c)throw new g("too-complex");const i=y(e,t,s);({densifiedPath:f,distances:d}=S(i,r,x)),n(l),f=p(f,o)}return{densifiedPath:f,pathLength:u*x,distances:d}}function R(e,t){const n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function y(e,t,n){if(null==t)return x(e);const r=e.spatialReference,s=t.mode,o=d(t,r);let a=null;switch(n.type){case"2d":a=j(e,s,o);break;case"3d":a=v(e,s,o,n)}return null==a?x(e):new f({hasZ:!0,hasM:!1,spatialReference:r,paths:P(e.paths,a)})}function j({hasZ:e},t,n){return"absolute-height"===t?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function v({spatialReference:e,hasZ:t},n,r,{elevationProvider:s}){const o=(t,n,r,o)=>s?.getElevation(t,n,r,e,o)??0;switch(n){case"on-the-ground":return([e,t])=>[e,t,o(e,t,0,"ground")];case"absolute-height":return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case"relative-to-ground":return t?([e,t,n])=>[e,t,n+o(e,t,n,"ground")+r]:([e,t])=>[e,t,o(e,t,0,"ground")+r];case"relative-to-scene":return t?([e,t,n])=>[e,t,n+o(e,t,n,"scene")+r]:([e,t])=>[e,t,o(e,t,0,"scene")+r];default:return null}}function x(e){return e.hasZ?new f({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:P(e.paths,([e,t])=>[e,t])}):e}function P(e,t){const n=e.length,r=new Array(n);for(let s=0;s<n;++s){const n=e[s],o=n.length,a=new Array(n.length);r[s]=a;for(let e=0;e<o;++e)a[e]=t(n[e])}return r}function Z(e){return M(e)&&e.paths.length>0&&e.paths.every(e=>e.length>=2)}function M(e){return null!=e&&"polyline"===e.type}function b(t,n,s,o,a){const{spatialReference:i,hasZ:c}=t,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:i,metersPerSR:r(i)},u=[],h=[];let p=0;for(let r=0;r<t.paths.length;++r){const i=t.paths[r],c=new Array,f=new Array;let m=0;for(let t=1;t<i.length;++t){const r=i[t-1],u=i[t],h=o(l,r,u);let d;for(d=m;d<h.distance&&!e(d,h.distance);d+=n)c.push(a(h,d)),f.push((p+d)*s);m=d-h.distance,p+=h.distance,c.push(u),f.push(p*s)}u[r]=c,h[r]=f}return{densifiedPath:new f({spatialReference:i,hasZ:c,paths:u}),distances:h}}function S(e,t,n){const{hasZ:r}=e;return b(e,t,n,z,r?k:W)}function A(e,t,n){const{hasZ:r}=e;return b(e,t,n,U,r?E:G)}function U(e,t,n){return e.distance=0,l(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function z(e,t,n){return e.from=t,e.to=n,e.distance=s(n,t)*e.metersPerSR,e}function G({from:e,azimuth:t,spatialReference:n},r){return u([0,0],e,t,r,n)}function E({from:e,to:n,azimuth:r,distance:s,spatialReference:o},a){const i=a/s,c=[0,0,t(e[2],n[2],i)];return u(c,e,r,a,o),c}function W({from:e,to:t,distance:n},r){return o([0,0],e,t,r/n)}function k({from:e,to:t,distance:n},r){return a([0,0,0],e,t,r/n)}function D(e){return c(e.spatialReference)?e:p(e,m.WGS84)}function I(e){return e.paths.reduce((e,t)=>e+t.length,0)}function L(e,t,n){return I(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{I as countPoints,w as densifyPath,M as isPolyline,Z as isValidInputPath,y as toAbsoluteHeightElevation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{watch as i,initial as r,on as s}from"../../../core/reactiveUtils.js";import{stripHTML as l}from"../../../core/string.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import{getGraphicLayer as n}from"../../../graphic/graphicOriginUtils.js";import{isSubtypeGroupLayer as d,isGroupLayer as c}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as u,temporaryHighlightName as p}from"../../../views/support/HighlightDefaults.js";import h from"../../Widget.js";import m from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as _}from"../../support/componentsUtils.js";import v from"../../support/FilterBuilder.js";import{globalCss as f}from"../../support/globalCss.js";import{Heading as g}from"../../support/Heading.js";import y from"../../support/SelectionToolbar.js";import{tsx as b,messageBundle as F}from"../../support/widget.js";import w from"../../support/SelectionToolbar/VisibleElements.js";const C="esri-feature-form-utility-network-association-layers",L={base:C,header:`${C}__header`,headingContent:`${C}__heading-content`,featureObserver:`${C}__feature-observer`,filterContainer:`${C}__filter-container`,filterOptionsContainer:`${C}__filter-options-container`,filterOptionsHeader:`${C}__filter-options-header`,listContainer:`${C}__list-container`,spatialSelectContainer:`${C}__spatial-select-container`,spatialSelectToolbar:`${C}__spatial-select-toolbar`,stickySpinnerContainer:`${C}__sticky-loading-container`,loadingContainer:`${C}__loading-container`};let T=class extends h{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new m,this.view=null,this._filterBuilder=new v,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._observerNode=null,this._selectionToolbar=new y({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new w({chip:!1,operationTypeControls:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([i(()=>this.viewModel,()=>this.reset()),i(()=>[this.viewModel.state,this._observerNode],()=>this._onObserverChange()),i(()=>this.selectedLayer,e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")})])}loadDependencies(){return _({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map(e=>e.feature)}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:i}=this.viewModel;return(i.length?i:t).map(e=>({label:e.label,graphic:e.feature,layer:n(e.feature)})).filter(t=>t.label?.toLowerCase().includes(e)??!1)}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,i=e*t;return this._filteredFeatureItems.toArray().slice(0,i)}render(){return b("div",{class:this.classes(L.base,f.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([i(()=>this.view,e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null},r),i(()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map(e=>e.visible),this.viewModel.map?.allLayers?.filter(e=>d(e)).toArray().flatMap(e=>e.sublayers.toArray()).map(e=>e.visible)],()=>this._updateToolbarSources()),s(()=>this._selectionToolbar,"before-activate",e=>this.emit("before-selection",e)),s(()=>this._selectionToolbar,"complete",this._onSelectionComplete)])}_updateToolbarSources(){const e=this.viewModel.layerItems.toArray().filter(e=>{const{parent:t}=e;return!(t&&(c(t)||d(t))&&!t.visible)&&e.visible});this._selectionToolbar.sources=e}_onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:i,state:r}=this.viewModel;e||i.length||1===t?"ready"===r&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:i,selectedLayer:r}=this.viewModel;if(r||!t.sources?.length)return null;const s=b("div",{class:L.spatialSelectToolbar},t.render()),l=b("calcite-button",{appearance:"transparent",disabled:!i.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return b("div",{class:L.spatialSelectContainer,key:"spatial-select-toolbar"},s,l)}_renderStickyLoading(){return"querying"===this.viewModel.state?b("div",{class:L.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return b("div",{class:L.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return b("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return b("div",{class:L.filterOptionsContainer},b("div",{class:L.filterOptionsHeader},b("span",null,this.messagesFilterBuilder.widgetLabel),b("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,i=e.filterLayers;return b("div",null,this._renderHeader({heading:t,placeholder:i,renderFilterOptions:!1,renderTotal:!1}),b("div",{class:L.listContainer},b("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:i}=this,{layerItems:r,tableItems:s}=t;return r.concat(s).map(e=>({label:e.title??i.untitled,layer:e})).filter(t=>t.label?.toLowerCase().includes(e)??!1).toArray().map(e=>this._renderLayerItem(e))}_renderLayerItem(e){const{label:t,layer:i}=e;return b("calcite-list-item",{key:`layer-item-${i.id}`,label:l(t),onCalciteListItemSelect:()=>{this.selectedLayer=i,this._filterBuilder.reset()}},b("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,i=t.featureSpatialItems.length>0,r=this.messagesFeatureForm.associations,s=i?void 0:e?.title||this.messagesCommon.untitled,l=r.filterFeatures;return b("div",null,this._renderHeader({heading:s,placeholder:l,renderFilterOptions:!i,renderTotal:!0}),b("div",{class:L.listContainer},b("calcite-list",{label:r.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map(e=>this._renderFeatureItem(e))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:i}=t,{label:r,graphic:s}=e,o=t.featureSpatialItems.length>0?()=>i?.update(s,u):void 0,a=t.featureSpatialItems.length>0?()=>i?.update(s,p):void 0;return b("calcite-list-item",{key:`feature-item-${s.uid}`,label:l(r),onCalciteListItemSelect:()=>{this.selectedFeature={feature:s,label:r}},onmouseenter:o,onmouseleave:a},b("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return b("div",{afterCreate:this._onObserverCreate,bind:this,class:L.featureObserver,key:"feature-observer"})}_renderHeader(e){return b("div",{class:L.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?b(g,{key:"title",level:this.headingLevel},b("div",{class:L.headingContent},b("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const i=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,r=i?this._layerFilterText:this._featureFilterText;return b("div",{class:L.filterContainer,key:"filter"},b("calcite-input",{icon:"search",placeholder:e,type:"search",value:r,onCalciteInputInput:e=>{i?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return b("calcite-action",{icon:"sliders",indicator:!!this._filterBuilder.whereClause,slot:"action",text:e,title:e,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible}})}_renderTotal(){const{messagesFeature:e,viewModel:i}=this,{featureCount:r,featureSpatialItems:s}=i,l=t(e.numberRecords,{number:s.length?s.length:r});return b("div",{key:"total"},l)}};e([o()],T.prototype,"filterOptionsVisible",null),e([o()],T.prototype,"headingLevel",void 0),e([o()],T.prototype,"isSelecting",null),e([o(),F("esri/t9n/common")],T.prototype,"messagesCommon",void 0),e([o(),F("esri/widgets/Editor/t9n/Editor")],T.prototype,"messagesEditor",void 0),e([o(),F("esri/widgets/Feature/t9n/Feature")],T.prototype,"messagesFeature",void 0),e([o(),F("esri/widgets/FeatureForm/t9n/FeatureForm")],T.prototype,"messagesFeatureForm",void 0),e([o(),F("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],T.prototype,"messagesFilterBuilder",void 0),e([o()],T.prototype,"selectedLayer",null),e([o({type:m})],T.prototype,"viewModel",void 0),e([o()],T.prototype,"selectedFeature",null),e([o()],T.prototype,"filterWhereClause",null),e([o()],T.prototype,"view",void 0),e([o()],T.prototype,"_filterBuilder",void 0),e([o()],T.prototype,"_featureFilterText",void 0),e([o()],T.prototype,"_layerFilterText",void 0),e([o()],T.prototype,"_observer",void 0),e([o()],T.prototype,"_featureSpatialGraphics",null),e([o()],T.prototype,"_filteredFeatureItems",null),e([o()],T.prototype,"_filteredFeatureItemsPage",null),e([o()],T.prototype,"_observerNode",void 0),T=e([a("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],T);const S=T;export{S as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{watch as i,initial as r,on as s}from"../../../core/reactiveUtils.js";import{stripHTML as l}from"../../../core/string.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import{getGraphicLayer as n}from"../../../graphic/graphicOriginUtils.js";import{isFeatureLayer as d,isSubtypeSublayer as c,isSubtypeGroupLayer as u,isGroupLayer as p}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as h,temporaryHighlightName as m}from"../../../views/support/HighlightDefaults.js";import _ from"../../Widget.js";import v from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as f}from"../../support/componentsUtils.js";import g from"../../support/FilterBuilder.js";import{globalCss as y}from"../../support/globalCss.js";import{Heading as b}from"../../support/Heading.js";import F from"../../support/SelectionToolbar.js";import{tsx as w,messageBundle as C}from"../../support/widget.js";import L from"../../support/SelectionToolbar/VisibleElements.js";const T="esri-feature-form-utility-network-association-layers",S={base:T,header:`${T}__header`,headingContent:`${T}__heading-content`,featureObserver:`${T}__feature-observer`,filterContainer:`${T}__filter-container`,filterOptionsContainer:`${T}__filter-options-container`,filterOptionsHeader:`${T}__filter-options-header`,listContainer:`${T}__list-container`,spatialSelectContainer:`${T}__spatial-select-container`,spatialSelectToolbar:`${T}__spatial-select-toolbar`,stickySpinnerContainer:`${T}__sticky-loading-container`,loadingContainer:`${T}__loading-container`};let M=class extends _{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new v,this.view=null,this._filterBuilder=new g,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._observerNode=null,this._selectionToolbar=new F({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new L({chip:!1,operationTypeControls:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([i(()=>this.viewModel,()=>this.reset()),i(()=>[this.viewModel.state,this._observerNode],()=>this._onObserverChange()),i(()=>this.selectedLayer,e=>{(d(e)||c(e))&&(this._filterBuilder.layer=e),e||(this.filterOptionsVisible=!1,this._featureFilterText="")})])}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map(e=>e.feature)}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:i}=this.viewModel;return(i.length?i:t).map(e=>({label:e.label,graphic:e.feature,layer:n(e.feature)})).filter(t=>t.label?.toLowerCase().includes(e)??!1)}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,i=e*t;return this._filteredFeatureItems.toArray().slice(0,i)}render(){return w("div",{class:this.classes(S.base,y.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([i(()=>this.view,e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null},r),i(()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map(e=>e.visible),this.viewModel.map?.allLayers?.filter(e=>u(e)).toArray().flatMap(e=>e.sublayers.toArray()).map(e=>e.visible)],()=>this._updateToolbarSources()),s(()=>this._selectionToolbar,"before-activate",e=>this.emit("before-selection",e)),s(()=>this._selectionToolbar,"complete",this._onSelectionComplete)])}_updateToolbarSources(){const e=this.viewModel.layerItems.toArray().filter(e=>{const{parent:t}=e;return!(t&&(p(t)||u(t))&&!t.visible)&&e.visible});this._selectionToolbar.sources=e}_onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:i,state:r}=this.viewModel;e||i.length||1===t?"ready"===r&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:i,selectedLayer:r}=this.viewModel;if(r||!t.sources?.length)return null;const s=w("div",{class:S.spatialSelectToolbar},t.render()),l=w("calcite-button",{appearance:"transparent",disabled:!i.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return w("div",{class:S.spatialSelectContainer,key:"spatial-select-toolbar"},s,l)}_renderStickyLoading(){return"querying"===this.viewModel.state?w("div",{class:S.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return w("div",{class:S.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return w("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return w("div",{class:S.filterOptionsContainer},w("div",{class:S.filterOptionsHeader},w("span",null,this.messagesFilterBuilder.widgetLabel),w("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,i=e.filterLayers;return w("div",null,this._renderHeader({heading:t,placeholder:i,renderFilterOptions:!1,renderTotal:!1}),w("div",{class:S.listContainer},w("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:i}=this,{layerItems:r,tableItems:s}=t;return r.concat(s).map(e=>({label:e.title??i.untitled,layer:e})).filter(t=>t.label?.toLowerCase().includes(e)??!1).toArray().map(e=>this._renderLayerItem(e))}_renderLayerItem(e){const{label:t,layer:i}=e;return w("calcite-list-item",{key:`layer-item-${i.id}`,label:l(t),onCalciteListItemSelect:()=>{this.selectedLayer=i,this._filterBuilder.reset()}},w("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,i=t.featureSpatialItems.length>0,r=this.messagesFeatureForm.associations,s=i?void 0:e?.title||this.messagesCommon.untitled,l=r.filterFeatures;return w("div",null,this._renderHeader({heading:s,placeholder:l,renderFilterOptions:!i,renderTotal:!0}),w("div",{class:S.listContainer},w("calcite-list",{label:r.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map(e=>this._renderFeatureItem(e))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:i}=t,{label:r,graphic:s}=e,o=t.featureSpatialItems.length>0?()=>i?.update(s,h):void 0,a=t.featureSpatialItems.length>0?()=>i?.update(s,m):void 0;return w("calcite-list-item",{key:`feature-item-${s.uid}`,label:l(r),onCalciteListItemSelect:()=>{this.selectedFeature={feature:s,label:r}},onmouseenter:o,onmouseleave:a},w("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return w("div",{afterCreate:this._onObserverCreate,bind:this,class:S.featureObserver,key:"feature-observer"})}_renderHeader(e){return w("div",{class:S.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?w(b,{key:"title",level:this.headingLevel},w("div",{class:S.headingContent},w("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const i=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,r=i?this._layerFilterText:this._featureFilterText;return w("div",{class:S.filterContainer,key:"filter"},w("calcite-input",{icon:"search",placeholder:e,type:"search",value:r,onCalciteInputInput:e=>{i?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return w("calcite-action",{icon:"sliders",indicator:!!this._filterBuilder.whereClause,slot:"action",text:e,title:e,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible}})}_renderTotal(){const{messagesFeature:e,viewModel:i}=this,{featureCount:r,featureSpatialItems:s}=i,l=t(e.numberRecords,{number:s.length?s.length:r});return w("div",{key:"total"},l)}};e([o()],M.prototype,"filterOptionsVisible",null),e([o()],M.prototype,"headingLevel",void 0),e([o()],M.prototype,"isSelecting",null),e([o(),C("esri/t9n/common")],M.prototype,"messagesCommon",void 0),e([o(),C("esri/widgets/Editor/t9n/Editor")],M.prototype,"messagesEditor",void 0),e([o(),C("esri/widgets/Feature/t9n/Feature")],M.prototype,"messagesFeature",void 0),e([o(),C("esri/widgets/FeatureForm/t9n/FeatureForm")],M.prototype,"messagesFeatureForm",void 0),e([o(),C("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],M.prototype,"messagesFilterBuilder",void 0),e([o()],M.prototype,"selectedLayer",null),e([o({type:v})],M.prototype,"viewModel",void 0),e([o()],M.prototype,"selectedFeature",null),e([o()],M.prototype,"filterWhereClause",null),e([o()],M.prototype,"view",void 0),e([o()],M.prototype,"_filterBuilder",void 0),e([o()],M.prototype,"_featureFilterText",void 0),e([o()],M.prototype,"_layerFilterText",void 0),e([o()],M.prototype,"_observer",void 0),e([o()],M.prototype,"_featureSpatialGraphics",null),e([o()],M.prototype,"_filteredFeatureItems",null),e([o()],M.prototype,"_filteredFeatureItemsPage",null),e([o()],M.prototype,"_observerNode",void 0),M=e([a("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],M);const I=M;export{I as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{isSome as i}from"../../core/arrayUtils.js";import{deprecatedModule as r}from"../../core/deprecate.js";import s from"../../core/Error.js";import{EventedAccessor as a}from"../../core/Evented.js";import o from"../../core/Logger.js";import{debounce as n,isAbortError as l}from"../../core/promiseUtils.js";import u from"../../core/ReactiveSet.js";import{watch as h,when as c,sync as p}from"../../core/reactiveUtils.js";import{property as d,subclass as g}from"../../core/accessorSupport/decorators.js";import m from"../../geometry/Point.js";import{initializeProjection as f,project as y}from"../../geometry/projectionUtils.js";import F from"../../geometry/SpatialReference.js";import{geographicToWebMercator as _}from"../../geometry/support/webMercatorUtils.js";import{fallbackObjectIDAttribute as w}from"../../layers/LayerConstants.js";import v from"../../symbols/SimpleFillSymbol.js";import{getDisplayedSymbol as C}from"../../symbols/support/symbolUtils.js";import{system as b}from"../../time/constants.js";import{highlightsSupported as P}from"../../views/support/layerViewUtils.js";import S from"../Feature/FeatureViewModel.js";import{ActionsCollection as L,zoomToFeature as M,zoomToClusteredFeatures as V,browseClusteredFeatures as A}from"../Popup/actions.js";import{triggerAction as E,isClusterFeature as j,getSelectedTarget as I,removeClusteredFeaturesForBrowsing as x,displayClusterExtent as R,browseAggregateFeatures as O}from"../Popup/actionUtils.js";import{AnchorElementViewModelMixin as T}from"../support/AnchorElementViewModel.js";import{GoTo as U}from"../support/GoTo.js";const B="location-scale-handle",H=()=>[M.clone()],G=()=>[V.clone(),A.clone()];let z=null;function D(e,t){return"building-scene"===e||"map-image"===e||"tile"===e||"imagery"===e||"2d"===t&&"imagery-tile"===e}let Z=class extends(U(T(a))){constructor(e){super(e),this._pendingPromises=new u,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._selectedClusterFeature=null,this._featureStreamVersion=0,this._activeFeatureStream=null,this.actions=new L,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureMenuTitle=null,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.initialDisplayMode="feature",this.streamingFeatures=!1,this.selectedClusterBoundaryFeature=new t({symbol:new v({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=n(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})}),e?.suppressDeprecationWarning||r(o.getLogger(this),"esri.widgets.Features.FeaturesViewModel",{version:"5.2",replacement:"Use the Features (Next) component or the @arcgis/core/popup/FeatureContentCollection module instead.",warnOnce:!0})}normalizeCtorArgs(e){const{suppressDeprecationWarning:t,...i}=e??{};return i}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),h(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),h(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e).catch(()=>{})),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),h(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>E({event:e,viewModel:this,view:this.view}).catch(()=>{})),c(()=>!this.waitingForResult,()=>this._waitingForResultChange(),p),h(()=>[this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureVMs()),h(()=>this.view?.scale,()=>this._viewScaleChange()),c(()=>!this.visible,()=>this.browseClusterEnabled=!1),h(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new L;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:r,includeDefaultActions:s,selectedFeature:a}=this,o=s?i.concat(t):t,n=a&&("function"==typeof a.getEffectivePopupTemplate&&a.getEffectivePopupTemplate(r)||a.popupTemplate),l=n?.actions,u=n?.overwriteActions?l:l?.concat(o)??o;return u?.filter(Boolean).forEach(t=>e.add(t)),e}get defaultActions(){const e=this._get("defaultActions")||new L;return e.removeAll(),e.addMany(j(this.selectedFeature)?G():H()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:r,selectedFeatureIndex:s}=this,a=r>0&&t.length>0,o=null!=this._activeFeatureStream&&t.length>0,n=a||o;"list"!==this.initialDisplayMode?n&&-1===s?this.selectedFeatureIndex=0:n&&-1!==s||(this.selectedFeatureIndex=t.length?0:-1):(!n||a&&i===r)&&(this.selectedFeatureIndex=-1)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){if(this._get("featureStream")===e)return;if(this._set("featureStream",e),this._cancelFeatureStream(),!e)return;this.promises=[];const t=this._featureStreamVersion;this._activeFeatureStream=e,this._queueFeatureStreamFetching(e,t),this._consumeFeatureStream(e,t).catch(()=>{})}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,r=e?.spatialReference?.isWGS84;r&&i&&(t=_(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._cancelFeatureStream(),this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach(e=>this._pendingPromises.add(e)),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get screenLocation(){return super.screenLocation}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??b}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.streamingFeatures||this.pendingPromisesCount>0)||0!==this.featureCount)}centerAtLocation(){const{view:e}=this,t=I(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:r}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:r}}).catch(e=>{l(e)||o.getLogger(this).error(e)}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this.set({featureStream:null,promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeaturesLegacy(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){this._cancelFeatureStream();const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&!t.featureStream&&this._setFetchFeaturesPromises(t.location).catch(()=>{});const r=["actionsMenuOpen","collapsed","shouldFocus"];for(const s of r)delete t[s];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}disableClusterBrowsing(){x(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?j(t)?(await R(this),await O(this)):o.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):o.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_setStreamingFeatures(e){this.streamingFeatures!==e&&this._set("streamingFeatures",e)}_getRoundRobinIndex(e,t){return(e+t)%t}_animationStateChange(e){this.zoomToLocation||(M.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(j(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureViewModels:s}=this;if(null==i)return;const a=((i-1)*r+t)%t,o=a+r;s.slice(a,o).forEach((t,i)=>{t&&(t.graphic??=e[a+i])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(!e||!r)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(r.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),j(e))return;return e.symbol=await C(e),this._selectedClusterFeature=e,void r.graphics.add(this._selectedClusterFeature)}const s=e.sourceLayer?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await C(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await(import("../../geometry/operators/labelPointOperator.js"));return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this.centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&(this.promises.length>0||this.featureStream)&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:r,spatialReference:s,map:a,timeZone:o,location:n}=this;if(j(t[0])||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const l=i.slice(),u=[];t.forEach((t,i)=>{if(!t)return;let h=null;if(l.some((e,i)=>(e&&e.graphic===t&&(h=e,l.splice(i,1)),!!h)),h)u[i]=h;else{const l=new S({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:n,map:a,view:r,timeZone:o,suppressDeprecationWarning:!0});u[i]=l}}),l.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",u)}async _getScreenPoint(e,t){const{spatialReference:i,view:r}=this;if(!r)return null;await(r?.when());const s=e?.spatialReference;return s&&i?(await f(s,i,null,t),r.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController?.abort(),this._centerAtLocationController=null}_cancelFeatureStream(){this._featureStreamVersion++,this._setStreamingFeatures(!1);const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}async _consumeFeatureStream(e,t){try{for await(const i of e){if(t!==this._featureStreamVersion)return;this._updateFeatures([i])}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._setStreamingFeatures(!1),this._waitingForResultChange())}}_queueFeatureStreamFetching(e,t){queueMicrotask(()=>{this._activeFeatureStream===e&&t===this._featureStreamVersion&&this._setStreamingFeatures(!0)})}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:r}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:r}),{signal:r,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const r=new AbortController,{signal:s}=r;this._fetchFeaturesController=r;const a=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:i});return a.catch(()=>{}).finally(()=>{this._fetchFeaturesController===r&&(this._fetchFeaturesController=null)}),a}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(B),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{l(e)||o.getLogger(this).error(e)})),c(()=>!this.visible,()=>{this.removeHandles(B)},{once:!0})],B);const{pendingFeatures:r}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:r}}async _locationUpdate(e,t){const{spatialReference:i}=this,r=this.selectedFeature?.geometry?.type,s=this.location??e;if(r&&"mesh"!==r&&i&&s&&this.selectedFeature){if("point"===r){const e=await(import("../../geometry/operators/labelPointOperator.js"));return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let r=e.geometry;const a=this._getHighlightLayer(e),o=e.getObjectId();if(!a||!this.view)return;if(o){const e=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!e||!("queryFeatures"in e))return;const s=e.createQuery();s.outSpatialReference=i,s.objectIds=[o],s.returnGeometry=!0;const{features:n}=await e.queryFeatures(s,t);r=n[0]?.geometry}if(!r||"mesh"===r.type)return;r=y(r,i),z||(z=await Promise.all([import("../../geometry/operators/intersectsOperator.js"),import("../../geometry/operators/proximityOperator.js")]));const[n,l]=z;if(!n.execute(r,s)){const t=l.getNearestCoordinate(r,s).coordinate??s;this.selectedFeature===e&&(this.location=t)}}catch(a){l(a)||o.getLogger(this).error(a)}}}_cancelLocationUpdate(){this._locationUpdateController?.abort(),this._locationUpdateController=null}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:"map-notes"===i?.type||"subtype-group"===i?.type?i:t??i}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(D(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,a=e.attributes;return a&&s&&a[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,visible:a}=this;if(!s||!r||!a)return;const o=this._getHighlightLayer(i);if(!o)return;const n=this._getHighlightLayerView(s,o);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&P(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,o,s.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=e.filter(e=>!t.includes(e));i?.length&&(this.features=t.concat(i))}};e([d()],Z.prototype,"_fetchFeaturesController",void 0),e([d({type:L})],Z.prototype,"actions",void 0),e([d({readOnly:!0})],Z.prototype,"active",null),e([d()],Z.prototype,"activeFeature",void 0),e([d({readOnly:!0})],Z.prototype,"allActions",null),e([d()],Z.prototype,"autoCloseEnabled",void 0),e([d()],Z.prototype,"browseClusterEnabled",void 0),e([d()],Z.prototype,"content",void 0),e([d({type:L,readOnly:!0})],Z.prototype,"defaultActions",null),e([d({type:Boolean})],Z.prototype,"defaultPopupTemplateEnabled",void 0),e([d({readOnly:!0})],Z.prototype,"featureCount",null),e([d()],Z.prototype,"featurePage",void 0),e([d({value:[]})],Z.prototype,"features",null),e([d()],Z.prototype,"featuresPerPage",void 0),e([d()],Z.prototype,"featureStream",null),e([d()],Z.prototype,"featureMenuOpen",void 0),e([d()],Z.prototype,"featureMenuTitle",void 0),e([d()],Z.prototype,"featureViewModelAbilities",void 0),e([d({readOnly:!0})],Z.prototype,"featureViewModels",void 0),e([d()],Z.prototype,"highlightEnabled",void 0),e([d()],Z.prototype,"includeDefaultActions",void 0),e([d()],Z.prototype,"initialDisplayMode",void 0),e([d({type:m})],Z.prototype,"location",null),e([d()],Z.prototype,"map",null),e([d({readOnly:!0})],Z.prototype,"streamingFeatures",void 0),e([d({readOnly:!0})],Z.prototype,"pendingPromisesCount",null),e([d({readOnly:!0})],Z.prototype,"promiseCount",null),e([d()],Z.prototype,"promises",null),e([d({readOnly:!0})],Z.prototype,"selectedClusterBoundaryFeature",void 0),e([d({value:null,readOnly:!0})],Z.prototype,"selectedFeature",null),e([d({value:-1})],Z.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],Z.prototype,"selectedFeatureViewModel",null),e([d({type:F})],Z.prototype,"spatialReference",null),e([d({readOnly:!0})],Z.prototype,"state",null),e([d()],Z.prototype,"timeZone",null),e([d()],Z.prototype,"title",void 0),e([d()],Z.prototype,"updateLocationEnabled",void 0),e([d()],Z.prototype,"view",void 0),e([d()],Z.prototype,"visible",void 0),e([d({readOnly:!0})],Z.prototype,"waitingForContents",null),e([d({readOnly:!0})],Z.prototype,"waitingForResult",null),e([d()],Z.prototype,"zoomFactor",void 0),e([d()],Z.prototype,"zoomToLocation",void 0),e([d()],Z.prototype,"centerAtLocation",null),Z=e([g("esri.widgets.Features.FeaturesViewModel")],Z);export{Z as default};
2
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{isSome as i}from"../../core/arrayUtils.js";import{deprecatedModule as r}from"../../core/deprecate.js";import s from"../../core/Error.js";import{EventedAccessor as a}from"../../core/Evented.js";import o from"../../core/Logger.js";import{debounce as n,isAbortError as l}from"../../core/promiseUtils.js";import u from"../../core/ReactiveSet.js";import{watch as h,when as c,sync as p}from"../../core/reactiveUtils.js";import{property as d,subclass as g}from"../../core/accessorSupport/decorators.js";import m from"../../geometry/Point.js";import{initializeProjection as f,project as y}from"../../geometry/projectionUtils.js";import F from"../../geometry/SpatialReference.js";import{geographicToWebMercator as _}from"../../geometry/support/webMercatorUtils.js";import{fallbackObjectIDAttribute as w}from"../../layers/LayerConstants.js";import v from"../../symbols/SimpleFillSymbol.js";import{getDisplayedSymbol as C}from"../../symbols/support/symbolUtils.js";import{system as b}from"../../time/constants.js";import{highlightsSupported as P}from"../../views/support/layerViewUtils.js";import S from"../Feature/FeatureViewModel.js";import{ActionsCollection as L,zoomToFeature as E,zoomToClusteredFeatures as M,browseClusteredFeatures as V}from"../Popup/actions.js";import{triggerAction as A,isClusterFeature as j,getSelectedTarget as x,removeClusteredFeaturesForBrowsing as I,displayClusterExtent as R,browseAggregateFeatures as O}from"../Popup/actionUtils.js";import{AnchorElementViewModelMixin as T}from"../support/AnchorElementViewModel.js";import{GoTo as U}from"../support/GoTo.js";const B="location-scale-handle",H=()=>[E.clone()],G=()=>[M.clone(),V.clone()];let z=null;function D(e,t){return"building-scene"===e||"map-image"===e||"tile"===e||"imagery"===e||"2d"===t&&"imagery-tile"===e}let Z=class extends(U(T(a))){constructor(e){super(e),this._pendingPromises=new u,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._selectedClusterFeature=null,this._featureStreamVersion=0,this._activeFeatureStream=null,this.actions=new L,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureMenuTitle=null,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.initialDisplayMode="feature",this.streamingFeatures=!1,this.selectedClusterBoundaryFeature=new t({symbol:new v({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=n(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})}),e?.suppressDeprecationWarning||r(o.getLogger(this),"esri.widgets.Features.FeaturesViewModel",{version:"5.2",replacement:"Use the Features (Next) component or the @arcgis/core/popup/FeatureContentCollection module instead.",warnOnce:!0})}normalizeCtorArgs(e){const{suppressDeprecationWarning:t,...i}=e??{};return i}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),h(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),h(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e).catch(()=>{})),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),h(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>A({event:e,viewModel:this,view:this.view}).catch(()=>{})),c(()=>!this.waitingForResult,()=>this._waitingForResultChange(),p),h(()=>[this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureVMs()),h(()=>this.view?.scale,()=>this._viewScaleChange()),c(()=>!this.visible,()=>this.browseClusterEnabled=!1),h(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new L;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:r,includeDefaultActions:s,selectedFeature:a}=this,o=s?i.concat(t):t,n=a&&("function"==typeof a.getEffectivePopupTemplate&&a.getEffectivePopupTemplate(r)||a.popupTemplate),l=n?.actions,u=n?.overwriteActions?l:l?.concat(o)??o;return u?.filter(Boolean).forEach(t=>e.add(t)),e}get defaultActions(){const e=this._get("defaultActions")||new L;return e.removeAll(),e.addMany(j(this.selectedFeature)?G():H()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:r,selectedFeatureIndex:s}=this,a=r>0&&t.length>0,o=null!=this._activeFeatureStream&&t.length>0,n=a||o;"list"!==this.initialDisplayMode?n&&-1===s?this.selectedFeatureIndex=0:n&&-1!==s||(this.selectedFeatureIndex=t.length?0:-1):(!n||a&&i===r)&&(this.selectedFeatureIndex=-1)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){if(this._get("featureStream")===e)return;if(this._set("featureStream",e),this._cancelFeatureStream(),!e)return;this.promises=[];const t=this._featureStreamVersion;this._activeFeatureStream=e,this._queueFeatureStreamFetching(e,t),this._consumeFeatureStream(e,t).catch(()=>{})}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,r=e?.spatialReference?.isWGS84;r&&i&&(t=_(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._cancelFeatureStream(),this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach(e=>this._pendingPromises.add(e)),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get screenLocation(){return super.screenLocation}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??b}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.streamingFeatures||this.pendingPromisesCount>0)||0!==this.featureCount)}centerAtLocation(){const{view:e}=this,t=x(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:r}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:r}}).catch(e=>{l(e)||o.getLogger(this).error(e)}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this.set({featureStream:null,promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeaturesLegacy(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){this._cancelFeatureStream();const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&!t.featureStream&&this._setFetchFeaturesPromises(t.location).catch(()=>{});const r=["actionsMenuOpen","collapsed","shouldFocus"];for(const s of r)delete t[s];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}disableClusterBrowsing(){I(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?j(t)?(await R(this),await O(this)):o.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):o.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_setStreamingFeatures(e){this.streamingFeatures!==e&&this._set("streamingFeatures",e)}_getRoundRobinIndex(e,t){return(e+t)%t}_animationStateChange(e){this.zoomToLocation||(E.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(j(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureViewModels:s}=this;if(null==i)return;const a=((i-1)*r+t)%t,o=a+r;s.slice(a,o).forEach((t,i)=>{t&&(t.graphic??=e[a+i])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(!e||!r)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(r.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),j(e))return;return e.symbol=await C(e),this._selectedClusterFeature=e,void r.graphics.add(this._selectedClusterFeature)}const s=e.sourceLayer?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await C(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this.centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&(this.promises.length>0||this.featureStream)&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:r,spatialReference:s,map:a,timeZone:o,location:n}=this;if(j(t[0])||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const l=i.slice(),u=[];t.forEach((t,i)=>{if(!t)return;let h=null;if(l.some((e,i)=>(e&&e.graphic===t&&(h=e,l.splice(i,1)),!!h)),h)u[i]=h;else{const l=new S({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:n,map:a,view:r,timeZone:o,suppressDeprecationWarning:!0});u[i]=l}}),l.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",u)}async _getScreenPoint(e,t){const{spatialReference:i,view:r}=this;if(!r)return null;await(r?.when());const s=e?.spatialReference;return s&&i?(await f(s,i,null,t),r.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController?.abort(),this._centerAtLocationController=null}_cancelFeatureStream(){this._featureStreamVersion++,this._setStreamingFeatures(!1);const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}async _consumeFeatureStream(e,t){try{for await(const i of e){if(t!==this._featureStreamVersion)return;this._updateFeatures([i])}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._setStreamingFeatures(!1),this._waitingForResultChange())}}_queueFeatureStreamFetching(e,t){queueMicrotask(()=>{this._activeFeatureStream===e&&t===this._featureStreamVersion&&this._setStreamingFeatures(!0)})}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:r}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:r}),{signal:r,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const r=new AbortController,{signal:s}=r;this._fetchFeaturesController=r;const a=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:i});return a.catch(()=>{}).finally(()=>{this._fetchFeaturesController===r&&(this._fetchFeaturesController=null)}),a}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(B),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{l(e)||o.getLogger(this).error(e)})),c(()=>!this.visible,()=>{this.removeHandles(B)},{once:!0})],B);const{pendingFeatures:r}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:r}}async _locationUpdate(e,t){const{spatialReference:i}=this,r=this.selectedFeature?.geometry?.type,s=this.location??e;if(r&&"mesh"!==r&&i&&s&&this.selectedFeature){if("point"===r){const{labelPointExecute:e}=await(import("../../geometry/operators/labelPointOperator.js"));return void(this.location=e(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let r=e.geometry;const a=this._getHighlightLayer(e),o=e.getObjectId();if(!a||!this.view)return;if(o){const e=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!e||!("queryFeatures"in e))return;const s=e.createQuery();s.outSpatialReference=i,s.objectIds=[o],s.returnGeometry=!0;const{features:n}=await e.queryFeatures(s,t);r=n[0]?.geometry}if(!r||"mesh"===r.type)return;r=y(r,i),z||(z=await Promise.all([import("../../geometry/operators/intersectsOperator.js"),import("../../geometry/operators/proximityOperator.js")]));const[{intersectsExecute:n},{proximityGetNearestCoordinate:l}]=z;if(!n(r,s)){const t=l(r,s).coordinate??s;this.selectedFeature===e&&(this.location=t)}}catch(a){l(a)||o.getLogger(this).error(a)}}}_cancelLocationUpdate(){this._locationUpdateController?.abort(),this._locationUpdateController=null}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:"map-notes"===i?.type||"subtype-group"===i?.type?i:t??i}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(D(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,a=e.attributes;return a&&s&&a[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,visible:a}=this;if(!s||!r||!a)return;const o=this._getHighlightLayer(i);if(!o)return;const n=this._getHighlightLayerView(s,o);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&P(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,o,s.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=e.filter(e=>!t.includes(e));i?.length&&(this.features=t.concat(i))}};e([d()],Z.prototype,"_fetchFeaturesController",void 0),e([d({type:L})],Z.prototype,"actions",void 0),e([d({readOnly:!0})],Z.prototype,"active",null),e([d()],Z.prototype,"activeFeature",void 0),e([d({readOnly:!0})],Z.prototype,"allActions",null),e([d()],Z.prototype,"autoCloseEnabled",void 0),e([d()],Z.prototype,"browseClusterEnabled",void 0),e([d()],Z.prototype,"content",void 0),e([d({type:L,readOnly:!0})],Z.prototype,"defaultActions",null),e([d({type:Boolean})],Z.prototype,"defaultPopupTemplateEnabled",void 0),e([d({readOnly:!0})],Z.prototype,"featureCount",null),e([d()],Z.prototype,"featurePage",void 0),e([d({value:[]})],Z.prototype,"features",null),e([d()],Z.prototype,"featuresPerPage",void 0),e([d()],Z.prototype,"featureStream",null),e([d()],Z.prototype,"featureMenuOpen",void 0),e([d()],Z.prototype,"featureMenuTitle",void 0),e([d()],Z.prototype,"featureViewModelAbilities",void 0),e([d({readOnly:!0})],Z.prototype,"featureViewModels",void 0),e([d()],Z.prototype,"highlightEnabled",void 0),e([d()],Z.prototype,"includeDefaultActions",void 0),e([d()],Z.prototype,"initialDisplayMode",void 0),e([d({type:m})],Z.prototype,"location",null),e([d()],Z.prototype,"map",null),e([d({readOnly:!0})],Z.prototype,"streamingFeatures",void 0),e([d({readOnly:!0})],Z.prototype,"pendingPromisesCount",null),e([d({readOnly:!0})],Z.prototype,"promiseCount",null),e([d()],Z.prototype,"promises",null),e([d({readOnly:!0})],Z.prototype,"selectedClusterBoundaryFeature",void 0),e([d({value:null,readOnly:!0})],Z.prototype,"selectedFeature",null),e([d({value:-1})],Z.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],Z.prototype,"selectedFeatureViewModel",null),e([d({type:F})],Z.prototype,"spatialReference",null),e([d({readOnly:!0})],Z.prototype,"state",null),e([d()],Z.prototype,"timeZone",null),e([d()],Z.prototype,"title",void 0),e([d()],Z.prototype,"updateLocationEnabled",void 0),e([d()],Z.prototype,"view",void 0),e([d()],Z.prototype,"visible",void 0),e([d({readOnly:!0})],Z.prototype,"waitingForContents",null),e([d({readOnly:!0})],Z.prototype,"waitingForResult",null),e([d()],Z.prototype,"zoomFactor",void 0),e([d()],Z.prototype,"zoomToLocation",void 0),e([d()],Z.prototype,"centerAtLocation",null),Z=e([g("esri.widgets.Features.FeaturesViewModel")],Z);export{Z as default};