@arcgis/core 4.34.0-next.99 → 4.34.0

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 (632) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  2. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  3. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/00c77f03dd511c6dbff2.js +1 -0
  6. package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → 0461ac6ddd44f8da2eec.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0f735b0dec173142f3b6.js +2 -0
  8. package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
  9. package/assets/esri/core/workers/chunks/{f5d89b48f62fba78fd10.js → 151defe707bceb3a56a4.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 1847e8ac559085949f6d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/1ae3d331da5baa8e4b6a.js +1 -0
  12. package/assets/esri/core/workers/chunks/1d807057327ba90ab770.js +1 -0
  13. package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
  14. package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{2c72e185b780bbbb1c9f.js → 21f1e12d4e703b59c31c.js} +1 -1
  16. package/assets/esri/core/workers/chunks/2248c3040e2f9a8b5cbc.js +1 -0
  17. package/assets/esri/core/workers/chunks/292403693cba4562a02d.js +1 -0
  18. package/assets/esri/core/workers/chunks/297b11752f9c251cd7be.js +1 -0
  19. package/assets/esri/core/workers/chunks/2d834d33b73a55a98ba8.js +1 -0
  20. package/assets/esri/core/workers/chunks/2dce02d199a9625abbd9.js +1 -0
  21. package/assets/esri/core/workers/chunks/{5d3998e15df273a89078.js → 37897186bfbfa1319ff5.js} +1 -1
  22. package/assets/esri/core/workers/chunks/378bed624605fe8f62b1.js +1 -0
  23. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  24. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  25. package/assets/esri/core/workers/chunks/4470a3fff217f2bfeec5.js +1 -0
  26. package/assets/esri/core/workers/chunks/44e40484acb577039c82.js +1 -0
  27. package/assets/esri/core/workers/chunks/{8f3503b2fb6cd38757b9.js → 458e87902abc24b375da.js} +1 -1
  28. package/assets/esri/core/workers/chunks/4a38b1402cd48ced5d0f.js +1 -0
  29. package/assets/esri/core/workers/chunks/4b7c99f9a716a929178d.js +1 -0
  30. package/assets/esri/core/workers/chunks/524293f92791c55f6e2c.js +1 -0
  31. package/assets/esri/core/workers/chunks/594761a526629f9aa165.js +1 -0
  32. package/assets/esri/core/workers/chunks/5e60542f80bdacb6e7af.js +1 -0
  33. package/assets/esri/core/workers/chunks/616e3d1947eda575a25a.js +1 -0
  34. package/assets/esri/core/workers/chunks/{86b978a48b539e9fc5b8.js → 618ccc5d922f40fb6597.js} +1 -1
  35. package/assets/esri/core/workers/chunks/6c96997ca5ea1affa7af.js +1 -0
  36. package/assets/esri/core/workers/chunks/6d5f36fdd6ff081f30e8.js +1 -0
  37. package/assets/esri/core/workers/chunks/7010d1eb303a13c72f81.js +1 -0
  38. package/assets/esri/core/workers/chunks/740e6d2831dcb01ee96a.js +1 -0
  39. package/assets/esri/core/workers/chunks/75535e2e487ed2616acf.js +1 -0
  40. package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
  41. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
  42. package/assets/esri/core/workers/chunks/{40b81d1c2d53cf598b8e.js → 7786fc1b3779df832e0a.js} +1 -1
  43. package/assets/esri/core/workers/chunks/7a5c276652e7edf42e73.js +1 -0
  44. package/assets/esri/core/workers/chunks/{c941d15190fc08523d0d.js → 7a9a0fcf78a1863c5dea.js} +1 -1
  45. package/assets/esri/core/workers/chunks/80d2182dac1a49cfd923.js +1 -0
  46. package/assets/esri/core/workers/chunks/81501abaabf10e9bef1b.js +1 -0
  47. package/assets/esri/core/workers/chunks/{e032f3d2ee19790f8c79.js → 881df4fd1dc594576457.js} +1 -1
  48. package/assets/esri/core/workers/chunks/8862e6ceabc990ca0031.js +1 -0
  49. package/assets/esri/core/workers/chunks/8cf2669900bb45cb094a.js +1 -0
  50. package/assets/esri/core/workers/chunks/8ec6ad6d76b4755a4cf6.js +1 -0
  51. package/assets/esri/core/workers/chunks/9786e854ae9f40975cee.js +1 -0
  52. package/assets/esri/core/workers/chunks/98739414c107ad78e4d8.js +1 -0
  53. package/assets/esri/core/workers/chunks/98ccd88bdb9cb96a7610.js +1 -0
  54. package/assets/esri/core/workers/chunks/9dc6eeaac94aff385cf9.js +1 -0
  55. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  56. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
  57. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
  58. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  59. package/assets/esri/core/workers/chunks/af0f82f7efa6e983eca5.js +1 -0
  60. package/assets/esri/core/workers/chunks/b113d4f6a014863aaf66.js +1 -0
  61. package/assets/esri/core/workers/chunks/{773d76253588bcf14eaa.js → bd02e9d6c7ba491dd35f.js} +1 -1
  62. package/assets/esri/core/workers/chunks/be1b8e5ff2b1be26845a.js +1 -0
  63. package/assets/esri/core/workers/chunks/{142c45ad68eecaf3fc7c.js → bf9b2949894cc2a1e6b3.js} +1 -1
  64. package/assets/esri/core/workers/chunks/c91ce5fcdd4d0a6514d3.js +1 -0
  65. package/assets/esri/core/workers/chunks/{ad3e18c4c65aa2cd1ceb.js → cd3b843ffd4010038c74.js} +1 -1
  66. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  67. package/assets/esri/core/workers/chunks/d0767001601412f17ada.js +1 -0
  68. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → d391bfbaf0e790cd10d6.js} +2 -2
  69. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
  70. package/assets/esri/core/workers/chunks/d5fa879de92da4441771.js +1 -0
  71. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  72. package/assets/esri/core/workers/chunks/d9aee7ee4ab75b446ef1.js +1 -0
  73. package/assets/esri/core/workers/chunks/{9027f22a04ac2076ff0e.js → dd37db3f2d1072e250d9.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{dfc37c2ce51e6a34fd87.js → dec0ed841f9ff1ceff43.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  76. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  77. package/assets/esri/core/workers/chunks/e97bffa614ad89105f38.js +1 -0
  78. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  79. package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
  80. package/assets/esri/core/workers/chunks/f06d185e7defc4272ae7.js +1 -0
  81. package/assets/esri/core/workers/chunks/f18fdfcb3d5d7851e6fc.js +1 -0
  82. package/assets/esri/core/workers/chunks/f2f3ce7a0f3e394d27c4.js +1 -0
  83. package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → f619ab4a3ff3036641a9.js} +1 -1
  84. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  85. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  86. package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fa6e59e72c6e1fa79cf8.js} +1 -1
  87. package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
  88. package/assets/esri/core/workers/chunks/{4a2bf3c8da24abd8b9e2.js → fd410a56286f9b8a5903.js} +1 -1
  89. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  90. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  91. package/assets/esri/themes/base/widgets/_Editor.scss +36 -2
  92. package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -1
  93. package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -0
  94. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
  95. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
  96. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
  97. package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
  98. package/assets/esri/themes/dark/main.css +1 -1
  99. package/assets/esri/themes/light/main.css +1 -1
  100. package/assets/esri/themes/light/view.css +1 -1
  101. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ar.json +1 -1
  102. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bg.json +1 -1
  103. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bs.json +1 -1
  104. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ca.json +1 -1
  105. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_cs.json +1 -1
  106. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_da.json +1 -1
  107. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_de.json +1 -1
  108. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_el.json +1 -1
  109. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_es.json +1 -1
  110. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_et.json +1 -1
  111. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fi.json +1 -1
  112. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fr.json +1 -1
  113. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_he.json +1 -1
  114. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hr.json +1 -1
  115. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hu.json +1 -1
  116. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_id.json +1 -1
  117. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_it.json +1 -1
  118. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ja.json +1 -1
  119. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ko.json +1 -1
  120. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lt.json +1 -1
  121. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lv.json +1 -1
  122. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_nl.json +1 -1
  123. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_no.json +1 -1
  124. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pl.json +1 -1
  125. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-BR.json +1 -1
  126. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-PT.json +1 -1
  127. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ro.json +1 -1
  128. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ru.json +1 -1
  129. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sk.json +1 -1
  130. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sl.json +1 -1
  131. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sr.json +1 -1
  132. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sv.json +1 -1
  133. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_th.json +1 -1
  134. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_tr.json +1 -1
  135. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_uk.json +1 -1
  136. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_vi.json +1 -1
  137. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-CN.json +1 -1
  138. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-HK.json +1 -1
  139. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-TW.json +1 -1
  140. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  141. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  179. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  180. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  181. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  182. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  183. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  184. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  185. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  186. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  187. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  188. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  189. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  190. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  191. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  192. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  193. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  194. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  195. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  196. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  197. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  198. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  199. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  200. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  201. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  202. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  203. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  204. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  205. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  206. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  207. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  208. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  209. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  210. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  211. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  218. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  219. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  220. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  221. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  222. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  223. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  224. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  225. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  226. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  227. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  228. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  229. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  230. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  231. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  232. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  233. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  234. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  235. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  236. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  237. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  238. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  239. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  240. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  241. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  242. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  243. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  244. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  245. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  246. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  247. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  248. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  249. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  250. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  251. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  252. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  253. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  254. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  255. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  256. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  257. package/chunks/GlowComposition.glsl.js +46 -46
  258. package/chunks/MultiPathImpl.js +1 -1
  259. package/chunks/Point2D.js +1 -1
  260. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  261. package/chunks/UnitFactory.js +1 -1
  262. package/chunks/bundle.js +1 -1
  263. package/config.js +1 -1
  264. package/copyright.txt +0 -60
  265. package/core/has.js +1 -1
  266. package/core/sanitizerUtils.js +1 -1
  267. package/core/workers/workerFactory.js +1 -1
  268. package/editing/fieldUtils.js +5 -0
  269. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  270. package/editing/templateUtils.js +1 -1
  271. package/form/FormTemplate.js +1 -1
  272. package/form/elements/Element.js +1 -1
  273. package/form/elements/FieldElement.js +1 -1
  274. package/form/elements/GroupElement.js +1 -1
  275. package/geometry/operators/gx/operatorOffset.js +1 -1
  276. package/geometry/operators/support/jsonConverter.js +1 -1
  277. package/graphic/graphicOriginUtils.js +1 -1
  278. package/interfaces.d.ts +2055 -253
  279. package/intl/date.js +1 -1
  280. package/intl.d.ts +2 -0
  281. package/intl.js +1 -1
  282. package/kernel.js +1 -1
  283. package/layers/FeatureLayer.js +1 -1
  284. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  285. package/layers/OrientedImageryLayer.js +1 -1
  286. package/layers/ParquetLayer.js +1 -1
  287. package/layers/PointCloudLayer.js +1 -1
  288. package/layers/SceneLayer.js +1 -1
  289. package/layers/VideoLayer.js +1 -1
  290. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  291. package/layers/graphics/data/QueryEngineResult.js +1 -1
  292. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  293. package/layers/graphics/sources/ParquetSource.js +1 -1
  294. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  295. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  296. package/layers/knowledgeGraph/layerUtils.js +1 -1
  297. package/layers/mixins/ImageryTileMixin.js +1 -1
  298. package/layers/mixins/SceneService.js +1 -1
  299. package/layers/ogc/ogcFeatureUtils.js +1 -1
  300. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  301. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  302. package/layers/support/NumberFieldFormat.js +1 -1
  303. package/layers/support/TitleCreator.js +1 -1
  304. package/layers/support/fieldConfigUtils.js +1 -1
  305. package/layers/support/fieldFormatUtils.js +1 -1
  306. package/layers/support/fieldUtils.js +1 -1
  307. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  308. package/layers/support/rasterFieldUtils.js +1 -1
  309. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  310. package/layers/video/VideoController.js +1 -1
  311. package/libs/parquet/parquet.js +1 -1
  312. package/networks/CircuitManager.d.ts +4 -0
  313. package/networks/UnitIdentifierManager.d.ts +4 -0
  314. package/networks/support/Circuit.d.ts +4 -0
  315. package/networks/support/CircuitLocation.d.ts +4 -0
  316. package/networks/support/CircuitPath.d.ts +4 -0
  317. package/networks/support/CircuitPathConnectivityElement.d.ts +4 -0
  318. package/networks/support/CircuitSection.d.ts +4 -0
  319. package/networks/support/Subcircuit.d.ts +4 -0
  320. package/package.json +5 -5
  321. package/popup/FieldInfo.js +1 -1
  322. package/portal/Portal.js +1 -1
  323. package/portal/schemas/definitions.js +1 -1
  324. package/renderers/support/RasterSymbolizer.js +1 -1
  325. package/rest/knowledgeGraphService.d.ts +1 -0
  326. package/rest/networks/circuits/support/CircuitTraceResult.d.ts +4 -0
  327. package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +4 -0
  328. package/rest/networks/support/TelecomNetworkElement.d.ts +4 -0
  329. package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +4 -0
  330. package/rest/print.js +1 -1
  331. package/rest/versionManagement/getVersionInfos.js +1 -1
  332. package/smartMapping/renderers/size.js +1 -1
  333. package/smartMapping/statistics/histogram.js +1 -1
  334. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  335. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  336. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  337. package/smartMapping/support/adapters/support/utils.js +1 -1
  338. package/smartMapping/support/utils.js +1 -1
  339. package/support/basemapDefinitions.js +1 -1
  340. package/support/popupUtils.js +1 -1
  341. package/support/revision.js +1 -1
  342. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  343. package/symbols/cim/cimAnalyzer.js +1 -1
  344. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  345. package/symbols/support/symbolUtils.js +1 -1
  346. package/symbols/support/utils.js +1 -1
  347. package/undoredo/support/ServiceVersionInfo.js +1 -1
  348. package/undoredo/support/Services.js +1 -1
  349. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  350. package/views/2d/engine/Bitmap.js +1 -1
  351. package/views/2d/engine/flow/dataUtils.js +1 -1
  352. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  353. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
  354. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  355. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  356. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  357. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  358. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  359. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  360. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  361. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  362. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  363. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  364. package/views/2d/layers/features/Processor.js +1 -1
  365. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  366. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  367. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  368. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  369. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  370. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  371. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  372. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  373. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  374. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  375. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  376. package/views/2d/layers/features/schema/ExceedsLimitCache.js +5 -0
  377. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  378. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  379. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  380. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  381. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  382. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  383. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  384. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  385. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  386. package/views/2d/layers/features/sources/strategies/constants.js +5 -0
  387. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  388. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  389. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  390. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  391. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +1 -1
  392. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  393. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  394. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  395. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  396. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  397. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
  398. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  399. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  400. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  401. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  402. package/views/3d/layers/FlowSubView3D.js +1 -1
  403. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  404. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  405. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  406. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  407. package/views/3d/layers/TiledLayerView3D.js +1 -1
  408. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  409. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  410. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  411. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  412. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  413. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  414. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  415. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  416. package/views/3d/layers/support/FeatureTile.js +1 -1
  417. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  418. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  419. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  420. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  421. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  422. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  423. package/views/3d/state/controllers/RotateController.js +1 -1
  424. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  425. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  426. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  427. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  428. package/views/3d/state/utils/navigationUtils.js +1 -1
  429. package/views/3d/support/DisplayQualityProfile.js +1 -1
  430. package/views/3d/support/QualitySettings.js +1 -1
  431. package/views/3d/support/engineContent/line.js +1 -1
  432. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  433. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  434. package/views/3d/support/flow/FlowWorker.js +1 -1
  435. package/views/3d/support/flow/FlowWorkerHandle.js +1 -1
  436. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  437. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  438. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  439. package/views/3d/support/flow/constants.js +1 -1
  440. package/views/3d/support/flow/geometryUtils.js +1 -1
  441. package/views/3d/support/flow/loadUtils.js +1 -1
  442. package/views/3d/support/hitTest.js +1 -1
  443. package/views/3d/support/popupHitTest.js +1 -1
  444. package/views/3d/terrain/OverlayRenderer.js +1 -1
  445. package/views/3d/terrain/TerrainSurface.js +1 -1
  446. package/views/3d/terrain/TileAgent.js +1 -1
  447. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  448. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  449. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  450. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  451. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  452. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  453. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  454. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  455. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  456. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  457. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +10 -4
  458. package/views/SceneView.js +1 -1
  459. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  460. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  461. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  462. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  463. package/views/analysis/ElevationProfile/constants.js +1 -1
  464. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  465. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  466. package/views/analysis/ElevationProfile/types.d.ts +5 -0
  467. package/views/analysis/ElevationProfile/types.js +5 -0
  468. package/views/draw/support/Reshape.js +1 -1
  469. package/views/interactive/dragEventPipeline.js +1 -1
  470. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  471. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  472. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  473. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  474. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  475. package/views/layers/FeatureLayerView.js +1 -1
  476. package/views/support/PromiseQueue.js +1 -1
  477. package/views/support/Scheduler.js +1 -1
  478. package/views/support/TextureCompressionWorker.js +1 -1
  479. package/views/webgl/Texture.js +1 -1
  480. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  481. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  482. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  483. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  484. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  485. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  486. package/widgets/BatchAttributeForm.js +1 -1
  487. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  488. package/widgets/CoordinateConversion.js +1 -1
  489. package/widgets/Directions/css.js +1 -1
  490. package/widgets/Directions.js +1 -1
  491. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  492. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  493. package/widgets/Editor/EditorViewModel.js +1 -1
  494. package/widgets/Editor/Edits.js +1 -1
  495. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
  496. package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
  497. package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
  498. package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
  499. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  500. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  501. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  502. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  503. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  504. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  505. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  506. package/widgets/Editor/UpdateWorkflow.js +1 -1
  507. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  508. package/widgets/Editor/VisibleElements.js +1 -1
  509. package/widgets/Editor/Workflow.js +1 -1
  510. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  511. package/widgets/Editor/components/FeatureList.js +1 -1
  512. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  513. package/widgets/Editor/components/Notices.js +1 -1
  514. package/widgets/Editor/components/PanelContent.js +1 -1
  515. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  516. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  517. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
  518. package/widgets/Editor/css.js +1 -1
  519. package/widgets/Editor/support/EditorItem.js +1 -1
  520. package/widgets/Editor/support/SketchController.js +1 -1
  521. package/widgets/Editor/support/errors.js +5 -0
  522. package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
  523. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  524. package/widgets/Editor/workflowUtils.js +1 -1
  525. package/widgets/Editor.js +1 -1
  526. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  527. package/widgets/Feature/FeatureFields.js +1 -1
  528. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  529. package/widgets/Feature/FeatureMedia.js +1 -1
  530. package/widgets/Feature/FeatureViewModel.js +1 -1
  531. package/widgets/Feature/support/featureUtils.js +1 -1
  532. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  533. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  534. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  535. package/widgets/FeatureForm/FieldInput.js +1 -1
  536. package/widgets/FeatureForm/InputBase.js +1 -1
  537. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  538. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  539. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  540. package/widgets/FeatureTable/FieldColumn.js +1 -1
  541. package/widgets/FeatureTable/Grid/Column.js +1 -1
  542. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  543. package/widgets/Legend/LegendViewModel.js +1 -1
  544. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  545. package/widgets/Legend/support/utils.js +1 -1
  546. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  547. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  548. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  549. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  550. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  551. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  552. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  553. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  554. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  555. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  556. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  557. package/widgets/OrientedImageryViewer.js +1 -1
  558. package/widgets/PanoramicVideoViewer.js +1 -1
  559. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  560. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  561. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  562. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  563. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  564. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  565. package/widgets/Print.js +1 -1
  566. package/widgets/Search/LayerSearchSource.js +1 -1
  567. package/widgets/Sketch/SketchViewModel.js +1 -1
  568. package/widgets/Sketch.js +1 -1
  569. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  570. package/widgets/UtilityNetworkTrace.js +1 -1
  571. package/widgets/support/ColorPicker.js +1 -1
  572. package/widgets/support/FilterCondition.js +1 -1
  573. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  574. package/widgets/support/SelectionList/LayerItem.js +1 -1
  575. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  576. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  577. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  578. package/widgets/support/SelectionList.js +1 -1
  579. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  580. package/widgets/support/iconUtils.js +1 -1
  581. package/widgets/support/jsxWidgetSupport.js +1 -1
  582. package/assets/esri/core/workers/chunks/02bc183e30e3392bb76d.js +0 -1
  583. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  584. package/assets/esri/core/workers/chunks/14ace5dc4b8984212a57.js +0 -1
  585. package/assets/esri/core/workers/chunks/1762ff76350065750c75.js +0 -1
  586. package/assets/esri/core/workers/chunks/1b85967d1178956ee36b.js +0 -1
  587. package/assets/esri/core/workers/chunks/1fd459234917a51b6ae1.js +0 -1
  588. package/assets/esri/core/workers/chunks/22bb877b85ae250d7819.js +0 -1
  589. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  590. package/assets/esri/core/workers/chunks/24b97ba933324aea6a07.js +0 -1
  591. package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +0 -1
  592. package/assets/esri/core/workers/chunks/2795a2817ebe3298c350.js +0 -1
  593. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  594. package/assets/esri/core/workers/chunks/3b65d6a78fbffca37fbd.js +0 -1
  595. package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
  596. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  597. package/assets/esri/core/workers/chunks/48646f3d95a3f2b17e78.js +0 -1
  598. package/assets/esri/core/workers/chunks/50a5caa96c111dda5c60.js +0 -1
  599. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  600. package/assets/esri/core/workers/chunks/5a527a47285a5995cff9.js +0 -1
  601. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
  602. package/assets/esri/core/workers/chunks/5cb92abb1f0f38bd0eab.js +0 -1
  603. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  604. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
  605. package/assets/esri/core/workers/chunks/630efe10c871425b6a95.js +0 -1
  606. package/assets/esri/core/workers/chunks/65111858957f43eacd8c.js +0 -1
  607. package/assets/esri/core/workers/chunks/6f4bd0ee85e7e5a74340.js +0 -1
  608. package/assets/esri/core/workers/chunks/701a1835684cf815bcb7.js +0 -1
  609. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  610. package/assets/esri/core/workers/chunks/7633537dc0c65d655baf.js +0 -1
  611. package/assets/esri/core/workers/chunks/78b35a19332e58c8c279.js +0 -1
  612. package/assets/esri/core/workers/chunks/7fa324900c147ba51019.js +0 -1
  613. package/assets/esri/core/workers/chunks/83ab8c8bc9e6990114a8.js +0 -1
  614. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
  615. package/assets/esri/core/workers/chunks/a19063456ce21b471b69.js +0 -1
  616. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
  617. package/assets/esri/core/workers/chunks/ae8c387d59be87457567.js +0 -1
  618. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
  619. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
  620. package/assets/esri/core/workers/chunks/b54202dcab8df080e991.js +0 -1
  621. package/assets/esri/core/workers/chunks/ba212ba895ccf573eedf.js +0 -1
  622. package/assets/esri/core/workers/chunks/bcff6178e9d16b1b6191.js +0 -1
  623. package/assets/esri/core/workers/chunks/cf13625a033f9903655f.js +0 -1
  624. package/assets/esri/core/workers/chunks/deb2854bb7d082a26f52.js +0 -1
  625. package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
  626. package/assets/esri/core/workers/chunks/eb1a7bb8b14e651bc241.js +0 -1
  627. package/assets/esri/core/workers/chunks/ed5f5852983bf3070fe6.js +0 -1
  628. package/assets/esri/core/workers/chunks/f09242e97196ad177c10.js +0 -1
  629. package/assets/esri/core/workers/chunks/f154336b4af011cd0c56.js +0 -1
  630. package/assets/esri/core/workers/chunks/f1be3a177328a169128f.js +0 -1
  631. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
  632. package/assets/esri/core/workers/chunks/f7a9d2da07196a0989ae.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import i from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import{RasterJobHandlerMixin as a}from"../../../layers/mixins/RasterJobHandlerMixin.js";import{reducerFn as n}from"../../../layers/orientedImagery/transformations/utils.js";import{pixelAngleThreshold as l,defaultImageSphereSize as m}from"../constants.js";import h from"./ClosestMap.js";import c from"./PanoramicTileNode.js";let p=class extends(a(t)){constructor(e){super(e),this._maximumPyramidLevel=-1,this._pixelAngleToLevelMap=new h,this._tileMap=new Map,this.raster=null,this._fetchRawTile=async(e,t,i,r)=>{await this._initJobHandler();const{pyramidBlockWidth:s,pyramidBlockHeight:a}=this.storageInfo,{minCol:n,maxCol:l,minRow:m,maxRow:h}=this.storageInfo.blockBoundary[e],c=l-n+1,p=h-m+1,f=i*this.imageSize[0]/c,d=t*this.imageSize[1]/p,g=Math.min((i+1)*this.imageSize[0]/c,this.imageSize[0]),u=Math.min((t+1)*this.imageSize[1]/p,this.imageSize[1]),x=g-f,w=u-d,y=new o({xmin:f-.5,ymin:.5-u,xmax:g-.5,ymax:.5-d,spatialReference:this.raster.rasterInfo.spatialReference}),{pixelBlock:_}=await this.raster.fetchPixels(y,s??x,a??w,r);return _},this.getLevelTiles=e=>{const t=[],{minCol:i,maxCol:r,minRow:s,maxRow:o}=this.storageInfo.blockBoundary[e];for(let a=s;a<=o;a++)for(let s=i;s<=r;s++){const i=this._tileMap.get(`${e}/${a}/${s}`);i&&t.push(i)}return t.length?t:null},this.getLevelWithPixelAngle=e=>this._pixelAngleToLevelMap.get(e)??0,this.getLowResolutionTiles=()=>{const e=this.maximumPyramidLevel;return e<0?null:this.getLevelTiles(e)},this.getTiles=(e,t,i,r,s)=>{const o=[],a=(t+180)%360-180,{minCol:l,maxCol:m,minRow:h,maxRow:c}=this.storageInfo.blockBoundary[e],p=a-r/2,f=a+r/2,d=i-s/2,g=i+s/2;for(let u=h;u<=c;u++)for(let t=l;t<=m;t++){const i=this._tileMap.get(`${e}/${u}/${t}`);if(!i)continue;const{yaw:r,pitch:s,horizontalFieldOfView:a,verticalFieldOfView:l}=i,m=n(a/2,l/2).map(([e,t])=>[r+e,s+t]);for(const e of m)if(p<=e[0]&&e[0]<=f&&d<=e[1]&&e[1]<=g){o.push(i);break}}return o}}initialize(){this._processLevels()}destroy(){this.raster.rasterJobHandler=null,this.raster=null,this._shutdownJobHandler(),this._tileMap.clear(),this._pixelAngleToLevelMap.clear()}async _initJobHandler(){this._rasterJobHandler||(await super._initJobHandler(),this.raster.rasterJobHandler=this._rasterJobHandler)}_processLevels(){const{blockBoundary:e,tileInfo:t}=this.storageInfo,r=e?.length;if(!r)throw new i("panoramic-viewer:missing-pyramid-resolutions","TIFF/MRF must have pyramid resolutions defined",{rasterId:this.raster.rasterId});this._tileMap.clear();for(let i=0;i<r;i++){const{maxCol:r,maxRow:s,minCol:o,minRow:a}=e[i],n=180/(s-a+1),h=360/(r-o+1),p=h/t.size[0];if(p>l)break;this._pixelAngleToLevelMap.set(p,i);for(let e=a;e<=s;e++){const t=180-(e+.5)*n;for(let s=o;s<=r;s++){const r=(s+.5)*h-180;this._tileMap.set(`${i}/${e}/${s}`,new c(i,e,s,h,n,r,t,m/2,this._fetchRawTile))}}this._maximumPyramidLevel=i}}get rasterInfo(){return this.raster.rasterInfo}get storageInfo(){return this.rasterInfo.storageInfo}get imageSize(){const{width:e,height:t}=this.rasterInfo;return[e,t]}get maximumPyramidLevel(){return this._maximumPyramidLevel}};e([r()],p.prototype,"raster",void 0),p=e([s("esri.widgets.PanoramicViewer.support.PanoramicTilePyramid")],p);const f=p;export{f as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import i from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import{RasterJobHandlerMixin as a}from"../../../layers/mixins/RasterJobHandlerMixin.js";import{pixelAngleThreshold as l,defaultImageSphereSize as n}from"../constants.js";import m from"./ClosestMap.js";import h from"./getVisibleTiles.js";import c from"./PanoramicTileNode.js";let p=class extends(a(t)){constructor(e){super(e),this._maximumPyramidLevel=-1,this._pixelAngleToLevelMap=new m,this._tileMap=new Map,this.raster=null,this._fetchRawTile=async(e,t,i,r)=>{await this._initJobHandler();const{pyramidBlockWidth:s,pyramidBlockHeight:a}=this.storageInfo,{minCol:l,maxCol:n,minRow:m,maxRow:h}=this.storageInfo.blockBoundary[e],c=n-l+1,p=h-m+1,g=i*this.imageSize[0]/c,d=t*this.imageSize[1]/p,f=Math.min((i+1)*this.imageSize[0]/c,this.imageSize[0]),u=Math.min((t+1)*this.imageSize[1]/p,this.imageSize[1]),x=f-g,w=u-d,y=new o({xmin:g-.5,ymin:.5-u,xmax:f-.5,ymax:.5-d,spatialReference:this.raster.rasterInfo.spatialReference}),{pixelBlock:_}=await this.raster.fetchPixels(y,s??x,a??w,r);return _},this.getLevelTiles=e=>{const t=[],{minCol:i,maxCol:r,minRow:s,maxRow:o}=this.storageInfo.blockBoundary[e];for(let a=s;a<=o;a++)for(let s=i;s<=r;s++){const i=this._tileMap.get(`${e}/${a}/${s}`);i&&t.push(i)}return t.length?t:null},this.getLevelWithPixelAngle=e=>this._pixelAngleToLevelMap.get(e)??0,this.getLowResolutionTiles=()=>{const e=this.maximumPyramidLevel;return e<0?null:this.getLevelTiles(e)},this.getTiles=(e,t,i,r,s)=>{const{minCol:o,minRow:a,maxCol:l,maxRow:n}=this.storageInfo.blockBoundary[e];return h(e,[o,a],[l,n],this._tileMap,t,i,r,s)}}initialize(){this._processLevels()}destroy(){this.raster.rasterJobHandler=null,this.raster=null,this._shutdownJobHandler(),this._tileMap.clear(),this._pixelAngleToLevelMap.clear()}async _initJobHandler(){this._rasterJobHandler||(await super._initJobHandler(),this.raster.rasterJobHandler=this._rasterJobHandler)}_processLevels(){const{blockBoundary:e,tileInfo:t}=this.storageInfo,r=e?.length;if(!r)throw new i("panoramic-viewer:missing-pyramid-resolutions","TIFF/MRF must have pyramid resolutions defined",{rasterId:this.raster.rasterId});this._tileMap.clear();for(let i=0;i<r;i++){const{maxCol:r,maxRow:s,minCol:o,minRow:a}=e[i],m=180/(s-a+1),h=360/(r-o+1),p=h/t.size[0];if(p>l)break;this._pixelAngleToLevelMap.set(p,i);for(let e=a;e<=s;e++){const t=180-(e+.5)*m;for(let s=o;s<=r;s++){const r=(s+.5)*h-180;this._tileMap.set(`${i}/${e}/${s}`,new c(i,e,s,h,m,r,t,n/2,this._fetchRawTile))}}this._maximumPyramidLevel=i}}get rasterInfo(){return this.raster.rasterInfo}get storageInfo(){return this.rasterInfo.storageInfo}get imageSize(){const{width:e,height:t}=this.rasterInfo;return[e,t]}get maximumPyramidLevel(){return this._maximumPyramidLevel}};e([r()],p.prototype,"raster",void 0),p=e([s("esri.widgets.PanoramicViewer.support.PanoramicTilePyramid")],p);const g=p;export{g as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ function n(n){return((n+180)%360+360)%360-180}function t(n){return Math.max(-90,Math.min(90,n))}function o(o,a,i,M){const l=Math.min(Math.max(i,0),360),r=Math.min(Math.max(M,0),180),u=l/2,f=r/2,c=a-90,e=t(c-f),s=t(c+f),x=s>=90||e<=-90||l>=360,h=n(o);return{latMin:e,latMax:s,lonMin:n(h-u),lonMax:n(h+u),fullLongitude:x,hfov:l,vfov:r}}function a(n,t,o,a){if(Math.abs(t-n)>=360||Math.abs(a-o)>=360)return!0;function i(n,t){return n<=t?[[n,t]]:[[n,180],[-180,t]]}const M=i(n,t),l=i(o,a);for(const r of M)for(const n of l)if(!(r[1]<=n[0]||r[0]>=n[1]))return!0;return!1}function i(n,t,o,a){return!(t<=o||n>=a)}function M(t,o,a,i){const M=360/a,l=180/i,r=t*M-180,u=r+M,f=90-o*l,c=f-l;return{lonMinRaw:r,lonMaxRaw:u,lonMin:n(r),lonMax:n(u),latMin:c,latMax:f}}function l(n,[t,l],[r,u],f,c,e,s,x){const{latMin:h,latMax:m,lonMin:d,lonMax:g,fullLongitude:v}=o(c,e,s,x),$=r-t+1,b=u-l+1,p=[];for(let o=t;o<=r;o++){const{lonMin:t,lonMax:r}=M(o,l,$,b);if(v||a(d,g,t,r))for(let a=l;a<=u;a++){const{latMin:t,latMax:l}=M(o,a,$,b);if(!i(h,m,t,l))continue;const r=`${n}/${a}/${o}`,u=f.get(r);u&&p.push(u)}}return p}export{l as default};
package/widgets/Print.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import{deprecateWidget as t}from"../core/deprecate.js";import{JSONMap as a}from"../core/jsonMap.js";import i from"../core/Logger.js";import{watch as l,on as o,whenOnce as n}from"../core/reactiveUtils.js";import{unitName as s}from"../core/unitFormatUtils.js";import{addProxy as r,hasSameOrigin as c}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{ensureInteger as d}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import u from"../geometry/SpatialReference.js";import{isValid as h}from"../geometry/support/spatialReferenceUtils.js";import{reArcGISOnlineDomain as b}from"../portal/support/urlUtils.js";import{findToken as _}from"../rest/utils.js";import{formatJsonMap as v}from"../rest/support/fileFormat.js";import g from"./Widget.js";import f from"./Print/PrintViewModel.js";import{loadCalciteComponents as y}from"./support/componentsUtils.js";import{globalCss as T}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{legacyIcon as k}from"./support/legacyIcon.js";import{isRTL as x,isActivationKey as C}from"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{tsx as I,tsxFragment as O}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{formatNumber as $}from"../intl/number.js";const E="map-only",L="esri-print",M={base:L,headerTitle:`${L}__header-title`,layoutTabList:`${L}__layout-tab-list`,layoutTab:`${L}__layout-tab`,layoutSection:`${L}__layout-section`,mapOnlySection:`${L}__map-only-section`,panelItemsCentered:`${L}__panel-items--centered`,loader:`${L}__loader`,swapButton:`${L}__swap-button`,printButton:`${L}__export-button`,printButtonSection:`${L}__export-button-section`,printButtonSectionDivider:`${L}__export-button-section--divider`,templateSelectContainer:`${L}__template-select-container`,templateSelectIcon:`${L}__template-select-icon`,templateSelectError:`${L}__template-select-error`,templateSelectArrow:`${L}__template-select-arrow`,formSectionContainer:`${L}__form-section-container`,advancedOptionsSection:`${L}__advanced-options-section`,advancedOptionsContainer:`${L}__advanced-options-container`,browseTemplateButtonContainer:`${L}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${L}__browse-template-button-container-filter`,exportedFilesContainer:`${L}__export-panel-container`,exportedFilesTitle:`${L}__export-title`,exportedFile:`${L}__exported-file`,exportedFileLinkTitle:`${L}__exported-file-link-title`,exportedFileLinkDescription:`${L}__exported-file-link-description`,exportedFilesEmpty:`${L}__exported-files-empty`,printWidgetContainer:`${L}__container`,content:`${L}__content`,panelContainer:`${L}__panel-container`,scaleInfoContainer:`${L}__scale-info-container`,scaleInputContainer:`${L}__scale-input-container`,scaleInput:`${L}__scale-input`,sizeContainer:`${L}__size-container`,panelError:`${L}__panel--error`,exportedFileLoader:`${L}__exported-file--loader`,exportSection:`${L}__export-section`,exportSectionCentered:`${L}__export-section--centered`,templateButtonContainer:`${L}__template-button-container`,templateDoneButton:`${L}__template-done-button`,templateSelectFlowItemContainer:`${L}__template-select-flow-item-container`,templateSelectFlowItemContent:`${L}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${L}__template-select-flow-item-list-heading`,srLabel:`${L}__sr-label`,invalidWkidText:`${L}__invalid-wkid-text`};function F(e){return!isNaN(e)&&e>0&&Number.isFinite(e)}function P(e){return e?.toLowerCase()===E}function A(e){const{state:t,extension:a}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return a?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const R=new a({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),B=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let N=class extends g{constructor(e,a){super(e,a),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab="layoutTab",this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new f,this._onInput=e=>{"layoutTab"===this._selectedTab?this.templateOptions.title=e.currentTarget.value:"mapOnlyTab"===this._selectedTab&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const a=_(this.viewModel.effectivePrintServiceUrl),i=t.url,l=document.createElement("a");if(l.target="_blank",l.href=i,l.rel="noreferrer",l.download=t.formattedName??"",!a)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(i);o.searchParams.set("token",a),l.href=o.href,l.click(),l.href=i},t(i.getLogger(this),"Print","arcgis-print",{version:"4.33"}),this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([l(()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=v.apiValues;this._formats=e.format.choiceList.map(e=>{const a=t.find(t=>new RegExp(`\\b${t}\\b`,"i").test(e))??e;return{value:a,label:e===a?e.toUpperCase():e}}).sort((e,t)=>e.label.localeCompare(t.label))}const t=this._formats.some(({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format));if(e.format.defaultValue&&!t){const t=this._formats.find(({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue))?.value;return void(t&&(this.templateOptions.format=t))}}),l(()=>[this.templateOptions.id,this.viewModel.loaded],()=>{const{layout:e}=this.templateOptions;this._selectedTab=P(e)?"mapOnlyTab":"layoutTab","layoutTab"===this._selectedTab&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))}),l(()=>this.templateOptions.dpi,e=>{e<=0&&(this.templateOptions.dpi=1)}),l(()=>this.viewModel.view?.scale,e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}),o(()=>this.viewModel,"submit",e=>this.emit("submit",e)),o(()=>this.viewModel,"complete",e=>this.emit("complete",e))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const a=setTimeout(()=>{this._awaitingServerResponse=!0,this.scheduleRender()},500);this.viewModel.load().then(()=>{clearTimeout(a),this._awaitingServerResponse=!1})}loadDependencies(){return y({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),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"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get saveExportEnabled(){return this.viewModel.saveExportEnabled}set saveExportEnabled(e){this.viewModel.saveExportEnabled=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:a,view:i}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:c,layout:p,layoutItem:m,legendEnabled:b,northArrowEnabled:_,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:y}=t,C="ready"!==a.state||this._awaitingServerResponse||!(p||m),S=this._renderTitleOrFileNameSection(),O=I("div",{class:M.formSectionContainer},I("calcite-label",null,e.fileFormatTitle,I("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map(({value:e,label:t},a)=>I("calcite-combobox-item",{key:`file-format-${a}`,selected:e===this.templateOptions.format,textLabel:t,value:e}))))),$=I("calcite-label",{layout:"inline"},I("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),E=I("div",null,I("div",{class:M.formSectionContainer},I("calcite-label",null,e.template,I("calcite-block",{class:M.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},I("calcite-icon",{class:M.templateSelectIcon,icon:(this._selectedTemplate?.layout?B.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?I("calcite-icon",{class:M.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,I("calcite-icon",{class:M.templateSelectArrow,icon:x()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),$),L=I("div",{class:M.formSectionContainer},I("calcite-label",null,e.dpi,I("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._updateNumberInputValue}))),F=I("div",{class:M.formSectionContainer},I("calcite-label",null,I("div",{class:M.srLabel},e.outSpatialReference,I("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),I("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:a.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=d(e.value);a.outSpatialReference=Number.isNaN(t)||null==t?null:new u({wkid:t}),this._isValidSpatialReference=!a.outSpatialReference||h(a.outSpatialReference)}}),this._isValidSpatialReference?null:I("div",{class:M.invalidWkidText,key:`out-sr-${a.outSpatialReference?.wkid}`},e.invalidWkid))),P=I("div",{class:this.classes(M.scaleInfoContainer,M.formSectionContainer)},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),I("div",{class:M.scaleInputContainer},I("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:M.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),I("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),A=I("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:M.advancedOptionsContainer,key:"advanced-section-for-layout"},P,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?I("div",{class:M.formSectionContainer,key:"author-info"},I("calcite-label",null,e.author,I("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?I("div",{class:M.formSectionContainer,key:"copyright-text"},I("calcite-label",null,e.copyright,I("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,L,F,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?I("div",{class:M.formSectionContainer,key:"legend-info"},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:!!b,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?I("div",{class:M.formSectionContainer,key:"north-arrow"},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:!!_,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?I("div",{class:M.formSectionContainer,key:"scale-bar"},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),R=I("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:M.advancedOptionsContainer},P,L,F,I("div",{class:M.formSectionContainer},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),N=this.exportedLinks.toArray(),V=this._renderExportedLinkItems(N),j={[M.exportSectionCentered]:!N.length},D="layoutTab"===this._selectedTab?I("section",{"aria-labelledby":`${this.id}__layoutTab`,class:M.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},I("div",{class:M.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?S:null,E,"layoutTab"===this._selectedTab?O:null,I("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(M.panelContainer,M.advancedOptionsSection),collapsible:!0,disabled:!(p||m?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},A))):"mapOnlyTab"===this._selectedTab?I("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:M.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},I("div",{class:M.panelContainer},S,O,I("div",null,I("div",{class:this.classes(M.sizeContainer,M.formSectionContainer)},I("calcite-label",null,e.width,I("calcite-input-number",{bind:this,"data-input-name":"width",value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue})),I("calcite-label",null,e.height,I("calcite-input-number",{bind:this,"data-input-name":"height",value:`${c}`,onCalciteInputNumberInput:this._updateNumberInputValue})),I("button",{"aria-label":e.swap,bind:this,class:this.classes(T.widgetButton,M.swapButton,k.swap),onclick:this._switchInput,type:"button"})),$),I("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(M.panelContainer,M.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},R))):I("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(M.exportSection,j),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},I("div",{class:M.panelContainer},I("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:M.exportedFilesContainer},0===N.length?I("div",{class:M.exportedFilesEmpty},I("calcite-icon",{icon:"file",scale:"l"}),I("div",null,I(w,{class:M.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),I("div",null,e.exportHint))):V))),U="2d"!==i?.type,H=I("div",{class:M.panelError},i?U?e.sceneViewError:e.serviceError:e.noViewError),z=N.some(({state:e})=>"pending"===e),W=I("div",{class:M.content,key:"panel"},I("div",null,I("ul",{bind:this,class:M.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},I("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"layoutTab"===this._selectedTab}`,class:M.layoutTab,"data-tab-id":"layoutTab",id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),I("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"mapOnlyTab"===this._selectedTab}`,class:M.layoutTab,"data-tab-id":"mapOnlyTab",id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),I("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"exportTab"===this._selectedTab}`,class:M.layoutTab,"data-tab-id":"exportTab",id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},z?I("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),D),"exportTab"!==this._selectedTab?I("div",{class:this.classes(M.printButtonSection,!this.saveExportHidden&&this.portal?M.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,I("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(M.printButton),disabled:C||!(p||m?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),q=I("calcite-flow",{key:"root-flow"},I("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},I("div",{class:M.printWidgetContainer},this.headerVisible?I("header",{class:M.headerTitle},e.export):null,this.error||U||!i?H:W)),this._renderChooseTemplateFlowItem()),K="initializing"===a.state,G=K?this._renderLoader():q,J={[M.panelItemsCentered]:K};return I("div",{bind:this,class:this.classes(M.base,T.widget,T.panel,J)},G)}_getPageSizeLabel(e){if(!e)return;const t=e.layoutTemplateInfo;if(!t)return;const a=R.fromJSON(t.pageUnits.toLowerCase());return`${$(t.pageSize[0])} × ${$(t.pageSize[1])} ${s(this.messagesUnits,a,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:a,layout:i,layoutItem:l,type:o}=e;if("print-service-template"===o&&this.messages[i])return this.messages[i];const n=a??i??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:t,layoutItem:a})=>!P(t)&&!!a?.id&&e.includes(a.id)):[]}_getDefaultTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:t,layoutItem:a})=>!(P(t)||a?.id&&e.includes(a.id))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter(({layout:e})=>!P(e))}_renderLayoutTemplates(e,t=!1,a=!1){return t&&e.sort((e,t)=>(e.label??"")>(t.label??"")?1:-1),e.map(e=>I("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},I("calcite-icon",{icon:(e.layout?B.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?I("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?I("calcite-icon",{class:M.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,a?I("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=b.test(this.portal?.url),a=this.viewModel.browseTemplates.toArray(),i=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=a.length+i.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?I("calcite-button",{appearance:"outline",class:n?M.browseTemplateButtonContainerFilter:M.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return I("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},I("div",{class:M.templateSelectFlowItemContainer},I("div",{class:M.templateSelectFlowItemContent},n?null:s,I("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,a.length?I("div",{key:"my-templates"},I("div",{class:M.templateSelectFlowItemListHeading},e.myTemplates,t?I("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a,!0,!0)):null,i.length?I("div",{key:"org-templates"},I("div",{class:M.templateSelectFlowItemListHeading},e.organizationTemplates,t?I("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i)):null,a.length||i.length?l.length?I("div",{key:"default-templates"},I("div",{class:M.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),a.length||i.length?o.length?I("div",{key:"service-templates"},I("div",{class:M.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),I("div",{class:M.templateButtonContainer},I("calcite-button",{class:M.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?I("div",{class:M.formSectionContainer,key:"custom-text-elements"},e.map((e,t)=>{const[a,i]=Object.entries(e)[0];return"date"===a?null:I("calcite-label",{key:`custom-text-elements-${a}-${t}`},a,I("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":a,value:i??"",onCalciteInputInput:this._updateInputValue}))})):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:a,fileNamePlaceHolder:i}=this.messages,l="layoutTab"===this._selectedTab?e:t,o="layoutTab"===this._selectedTab?a:i,n="layoutTab"===this._selectedTab?this.templateOptions.title:this.templateOptions.fileName;return I("div",{class:M.formSectionContainer,key:l},I("calcite-label",null,l,I("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&"layoutTab"===this._selectedTab||"mapOnlyTab"===t&&"mapOnlyTab"===this._selectedTab||"exportTab"===t&&"exportTab"===this._selectedTab)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[M.loader]:this._awaitingServerResponse};return I("div",{class:this.classes(e),key:"loader"})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,a){e.find(e=>{const[a]=Object.entries(e)[0];return a===t})[t]=a}_updateInputValue(e){const t=e.currentTarget,a=t.getAttribute("data-input-name"),i=!!t["data-input-custom"],{templateOptions:l}=this;i?this._updateCustomTextElementValue(l.customTextElements,a,t.value):l[a]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,a=t.getAttribute("data-input-name"),{templateOptions:i}=this,l=Number(t.value);if(!F(l)){const e=i[a];return void(t.value=`${e}`)}i[a]=l}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t="layoutTab"===this._selectedTab?e.title:e.fileName,{promise:a}=this.viewModel.export(t||this.messages.untitled);this._selectedTab="exportTab",a.then(()=>this.scheduleRender())}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:a}=e,i=a-t;i>0&&(e.scrollTop=i)}_toggleInputValue(e){const t=e.target,a=t.getAttribute("data-option-name");this.templateOptions[a]=t.checked,"scaleEnabled"===a&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,a=e.formattedName??"",{state:i}=e,l=this.saveAsButtonCallback&&"error"!==i&&this._isFormatAllowedForSaving(e.extension);return"pending"!==i&&l?I("calcite-popover",{autoClose:!0,key:`${a}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${a}-popover-button`,scale:"s"},I("calcite-list",{label:""},e.portalItem?I("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const a=document.createElement("a");a.target="_blank",a.href=t.itemPageUrl,a.rel="noreferrer",a.click()}},I("calcite-icon",{icon:"launch2",key:`${a}-launch-icon`,scale:"s",slot:"content-start"})):I("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(n(()=>e.portalItem).then(e=>{e.itemPageUrl&&this.scheduleRender()}),await this.saveAsButtonCallback(e))}},I("calcite-icon",{icon:"save",key:`${a}-save-icon`,scale:"s",slot:"content-start"})),I("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},I("calcite-icon",{icon:"trash",key:`${a}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e,t){const a=this.messages,{url:i,state:l}=e,o=e.formattedName??"";let n=i||null;n&&(n=r(n));const s=c(n,location.href);return I("div",{class:M.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},I("div",null,I("div",{class:M.exportedFileLinkTitle},o),I("div",{class:M.exportedFileLinkDescription},"pending"===l?a.generatingExport:t||(s?a.ready:a.linkReady))),"ready"===l?I("calcite-icon",{"aria-label":`${o}. ${a.linkReady}`,icon:s?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?I("calcite-loader",{class:M.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):I("calcite-icon",{icon:A(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e,t){const{state:a}=e,i=e.formattedName??"",l=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a?I("calcite-action",{"aria-label":`${t}`,icon:l?"ellipsis":"x",id:l?`${i}-popover-button`:void 0,key:l?`${i}-saveAs-action`:`${i}-action`,onclick:l?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:`${t}`}):null}_renderExportedLinkItem(e){const t=this.messages,{error:a,state:i}=e,l=e.formattedName??"";let o;switch(i){case"pending":o=t.pending;break;case"ready":o=t.ready;break;case"error":o=t.errorMessage}const n="error"===i?"print-task:cim-symbol-unsupported"===a?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return I(O,null,I("calcite-list-item",{"aria-label":o,key:l,title:n},this._renderExportedLinkItemContent(e,n),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e,n)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return I("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,"mapOnlyTab"===this._selectedTab)this.viewModel.applyTemplate(E);else if("layoutTab"===this._selectedTab){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,a=e.target.getAttribute("data-tab-id");if(C(t))return this._toggleTab(a),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(a){case"layoutTab":this._toggleTab("ArrowLeft"===t?"exportTab":"mapOnlyTab");break;case"mapOnlyTab":this._toggleTab("ArrowLeft"===t?"layoutTab":"exportTab");break;case"exportTab":this._toggleTab("ArrowLeft"===t?"mapOnlyTab":"layoutTab")}e.preventDefault(),e.stopPropagation()}}};e([p()],N.prototype,"_showTemplates",void 0),e([p()],N.prototype,"_isValidSpatialReference",void 0),e([p()],N.prototype,"allowedFormats",null),e([p()],N.prototype,"allowedFormatsForSaving",void 0),e([p()],N.prototype,"allowedLayouts",null),e([p()],N.prototype,"browseTemplateButtonOnClick",void 0),e([p()],N.prototype,"error",null),e([p()],N.prototype,"exportedLinks",null),e([p()],N.prototype,"extraParameters",null),e([p()],N.prototype,"headerVisible",void 0),e([p()],N.prototype,"headingLevel",void 0),e([p()],N.prototype,"icon",null),e([p()],N.prototype,"includeDefaultTemplates",null),e([p()],N.prototype,"includeOrganizationTemplates",void 0),e([p()],N.prototype,"label",null),e([p(),S("esri/widgets/Print/t9n/Print")],N.prototype,"messages",void 0),e([p(),S("esri/t9n/common")],N.prototype,"messagesCommon",void 0),e([p(),S("esri/core/t9n/Units")],N.prototype,"messagesUnits",void 0),e([p({type:u})],N.prototype,"outSpatialReference",null),e([p()],N.prototype,"portal",null),e([p()],N.prototype,"saveExportEnabled",null),e([p()],N.prototype,"saveExportHidden",void 0),e([p()],N.prototype,"showPrintAreaEnabled",null),e([p()],N.prototype,"printServiceUrl",null),e([p()],N.prototype,"saveAsButtonCallback",void 0),e([p()],N.prototype,"templateCustomTextElements",null),e([p()],N.prototype,"templateOptions",null),e([p()],N.prototype,"view",null),e([p({type:f})],N.prototype,"viewModel",void 0),N=e([m("esri.widgets.Print")],N);const V=N;export{V as default};
5
+ import{__decorate as e}from"tslib";import"../intl.js";import{deprecateWidget as t}from"../core/deprecate.js";import{JSONMap as i}from"../core/jsonMap.js";import a from"../core/Logger.js";import{watch as l,on as o,whenOnce as n}from"../core/reactiveUtils.js";import{unitName as s}from"../core/unitFormatUtils.js";import{addProxy as r,hasSameOrigin as c}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{ensureInteger as d}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import u from"../geometry/SpatialReference.js";import{isValid as h}from"../geometry/support/spatialReferenceUtils.js";import{reArcGISOnlineDomain as b}from"../portal/support/urlUtils.js";import{findToken as _}from"../rest/utils.js";import{formatJsonMap as v}from"../rest/support/fileFormat.js";import g from"./Widget.js";import f from"./Print/PrintViewModel.js";import{loadCalciteComponents as y}from"./support/componentsUtils.js";import{globalCss as T}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{legacyIcon as x}from"./support/legacyIcon.js";import{isRTL as k,isActivationKey as C}from"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{tsx as I,tsxFragment as O}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{formatNumber as E}from"../intl/number.js";const L="map-only",$="esri-print",M={base:$,headerTitle:`${$}__header-title`,layoutTabList:`${$}__layout-tab-list`,layoutTab:`${$}__layout-tab`,layoutSection:`${$}__layout-section`,mapOnlySection:`${$}__map-only-section`,panelItemsCentered:`${$}__panel-items--centered`,loader:`${$}__loader`,swapButton:`${$}__swap-button`,printButton:`${$}__export-button`,printButtonSection:`${$}__export-button-section`,printButtonSectionDivider:`${$}__export-button-section--divider`,templateSelectContainer:`${$}__template-select-container`,templateSelectIcon:`${$}__template-select-icon`,templateSelectError:`${$}__template-select-error`,templateSelectArrow:`${$}__template-select-arrow`,formSectionContainer:`${$}__form-section-container`,advancedOptionsSection:`${$}__advanced-options-section`,advancedOptionsContainer:`${$}__advanced-options-container`,browseTemplateButtonContainer:`${$}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${$}__browse-template-button-container-filter`,exportedFilesContainer:`${$}__export-panel-container`,exportedFilesTitle:`${$}__export-title`,exportedFile:`${$}__exported-file`,exportedFileLinkTitle:`${$}__exported-file-link-title`,exportedFileLinkDescription:`${$}__exported-file-link-description`,exportedFilesEmpty:`${$}__exported-files-empty`,printWidgetContainer:`${$}__container`,content:`${$}__content`,panelContainer:`${$}__panel-container`,scaleInfoContainer:`${$}__scale-info-container`,scaleInputContainer:`${$}__scale-input-container`,scaleInput:`${$}__scale-input`,sizeContainer:`${$}__size-container`,panelError:`${$}__panel--error`,exportedFileLoader:`${$}__exported-file--loader`,exportSection:`${$}__export-section`,exportSectionCentered:`${$}__export-section--centered`,templateButtonContainer:`${$}__template-button-container`,templateDoneButton:`${$}__template-done-button`,templateSelectFlowItemContainer:`${$}__template-select-flow-item-container`,templateSelectFlowItemContent:`${$}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${$}__template-select-flow-item-list-heading`,srLabel:`${$}__sr-label`,invalidWkidText:`${$}__invalid-wkid-text`};function F(e){return!isNaN(e)&&e>0&&Number.isFinite(e)}function P(e){return e?.toLowerCase()===L}function A(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const R=new i({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),B=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let N=class extends g{constructor(e,i){super(e,i),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab="layoutTab",this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new f,this._onInput=e=>{"layoutTab"===this._selectedTab?this.templateOptions.title=e.currentTarget.value:"mapOnlyTab"===this._selectedTab&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=_(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},t(a.getLogger(this),"Print","arcgis-print",{version:"4.33"}),this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([l(()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=v.apiValues;this._formats=e.format.choiceList.map(e=>{const i=t.find(t=>new RegExp(`\\b${t}\\b`,"i").test(e))??e;return{value:i,label:e===i?e.toUpperCase():e}}).sort((e,t)=>e.label.localeCompare(t.label))}const t=this._formats.some(({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format));if(e.format.defaultValue&&!t){const t=this._formats.find(({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue))?.value;return void(t&&(this.templateOptions.format=t))}}),l(()=>[this.templateOptions.id,this.viewModel.loaded],()=>{const{layout:e}=this.templateOptions;this._selectedTab=P(e)?"mapOnlyTab":"layoutTab","layoutTab"===this._selectedTab&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))}),l(()=>this.templateOptions.dpi,e=>{e<=0&&(this.templateOptions.dpi=1)}),l(()=>this.viewModel.view?.scale,e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}),o(()=>this.viewModel,"submit",e=>this.emit("submit",e)),o(()=>this.viewModel,"complete",e=>this.emit("complete",e))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout(()=>{this._awaitingServerResponse=!0,this.scheduleRender()},500);this.viewModel.load().then(()=>{clearTimeout(i),this._awaitingServerResponse=!1})}loadDependencies(){return y({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),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"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get saveExportEnabled(){return this.viewModel.saveExportEnabled}set saveExportEnabled(e){this.viewModel.saveExportEnabled=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:c,layout:p,layoutItem:m,legendEnabled:b,northArrowEnabled:_,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:y}=t,C="ready"!==i.state||this._awaitingServerResponse||!(p||m),S=this._renderTitleOrFileNameSection(),O=I("div",{class:M.formSectionContainer},I("calcite-label",null,e.fileFormatTitle,I("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map(({value:e,label:t},i)=>I("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e}))))),E=I("calcite-label",{layout:"inline"},I("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),L=I("div",null,I("div",{class:M.formSectionContainer},I("calcite-label",null,e.template,I("calcite-block",{class:M.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",label:e.template,loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},I("calcite-icon",{class:M.templateSelectIcon,icon:(this._selectedTemplate?.layout?B.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?I("calcite-icon",{class:M.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,I("calcite-icon",{class:M.templateSelectArrow,icon:k()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),E),$=I("div",{class:M.formSectionContainer},I("calcite-label",null,e.dpi,I("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._updateNumberInputValue}))),F=I("div",{class:M.formSectionContainer},I("calcite-label",null,I("div",{class:M.srLabel},e.outSpatialReference,I("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),I("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=d(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new u({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||h(i.outSpatialReference)}}),this._isValidSpatialReference?null:I("div",{class:M.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),P=I("div",{class:this.classes(M.scaleInfoContainer,M.formSectionContainer)},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),I("div",{class:M.scaleInputContainer},I("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:M.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),I("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),A=I("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:M.advancedOptionsContainer,key:"advanced-section-for-layout"},P,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?I("div",{class:M.formSectionContainer,key:"author-info"},I("calcite-label",null,e.author,I("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?I("div",{class:M.formSectionContainer,key:"copyright-text"},I("calcite-label",null,e.copyright,I("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,$,F,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?I("div",{class:M.formSectionContainer,key:"legend-info"},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:!!b,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?I("div",{class:M.formSectionContainer,key:"north-arrow"},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:!!_,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?I("div",{class:M.formSectionContainer,key:"scale-bar"},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),R=I("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:M.advancedOptionsContainer},P,$,F,I("div",{class:M.formSectionContainer},I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),N=this.exportedLinks.toArray(),V=this._renderExportedLinkItems(N),j={[M.exportSectionCentered]:!N.length},D="layoutTab"===this._selectedTab?I("section",{"aria-labelledby":`${this.id}__layoutTab`,class:M.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},I("div",{class:M.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?S:null,L,"layoutTab"===this._selectedTab?O:null,I("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(M.panelContainer,M.advancedOptionsSection),collapsible:!0,disabled:!(p||m?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},A))):"mapOnlyTab"===this._selectedTab?I("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:M.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},I("div",{class:M.panelContainer},S,O,I("div",null,I("div",{class:this.classes(M.sizeContainer,M.formSectionContainer)},I("calcite-label",null,e.width,I("calcite-input-number",{bind:this,"data-input-name":"width",value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue})),I("calcite-label",null,e.height,I("calcite-input-number",{bind:this,"data-input-name":"height",value:`${c}`,onCalciteInputNumberInput:this._updateNumberInputValue})),I("button",{"aria-label":e.swap,bind:this,class:this.classes(T.widgetButton,M.swapButton,x.swap),onclick:this._switchInput,type:"button"})),E),I("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(M.panelContainer,M.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},R))):I("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(M.exportSection,j),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},I("div",{class:M.panelContainer},I("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:M.exportedFilesContainer},0===N.length?I("div",{class:M.exportedFilesEmpty},I("calcite-icon",{icon:"file",scale:"l"}),I("div",null,I(w,{class:M.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),I("div",null,e.exportHint))):V))),U="2d"!==a?.type,H=I("div",{class:M.panelError},a?U?e.sceneViewError:e.serviceError:e.noViewError),z=N.some(({state:e})=>"pending"===e),W=I("div",{class:M.content,key:"panel"},I("div",null,I("ul",{bind:this,class:M.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},I("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"layoutTab"===this._selectedTab}`,class:M.layoutTab,"data-tab-id":"layoutTab",id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),I("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"mapOnlyTab"===this._selectedTab}`,class:M.layoutTab,"data-tab-id":"mapOnlyTab",id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),I("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"exportTab"===this._selectedTab}`,class:M.layoutTab,"data-tab-id":"exportTab",id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},z?I("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),D),"exportTab"!==this._selectedTab?I("div",{class:this.classes(M.printButtonSection,!this.saveExportHidden&&this.portal?M.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?I("calcite-label",{layout:"inline"},I("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,I("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(M.printButton),disabled:C||!(p||m?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),q=I("calcite-flow",{key:"root-flow"},I("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},I("div",{class:M.printWidgetContainer},this.headerVisible?I("header",{class:M.headerTitle},e.export):null,this.error||U||!a?H:W)),this._renderChooseTemplateFlowItem()),K="initializing"===i.state,G=K?this._renderLoader():q,J={[M.panelItemsCentered]:K};return I("div",{bind:this,class:this.classes(M.base,T.widget,T.panel,J)},G)}_getPageSizeLabel(e){if(!e)return;const t=e.layoutTemplateInfo;if(!t)return;const i=R.fromJSON(t.pageUnits.toLowerCase());return`${E(t.pageSize[0])} × ${E(t.pageSize[1])} ${s(this.messagesUnits,i,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l,type:o}=e;if("print-service-template"===o&&this.messages[a])return this.messages[a];const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:t,layoutItem:i})=>!P(t)&&!!i?.id&&e.includes(i.id)):[]}_getDefaultTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:t,layoutItem:i})=>!(P(t)||i?.id&&e.includes(i.id))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter(({layout:e})=>!P(e))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort((e,t)=>(e.label??"")>(t.label??"")?1:-1),e.map(e=>I("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},I("calcite-icon",{icon:(e.layout?B.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?I("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?I("calcite-icon",{class:M.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?I("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=b.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?I("calcite-button",{appearance:"outline",class:n?M.browseTemplateButtonContainerFilter:M.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return I("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},I("div",{class:M.templateSelectFlowItemContainer},I("div",{class:M.templateSelectFlowItemContent},n?null:s,I("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?I("div",{key:"my-templates"},I("div",{class:M.templateSelectFlowItemListHeading},e.myTemplates,t?I("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?I("div",{key:"org-templates"},I("div",{class:M.templateSelectFlowItemListHeading},e.organizationTemplates,t?I("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?I("div",{key:"default-templates"},I("div",{class:M.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?I("div",{key:"service-templates"},I("div",{class:M.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),I("div",{class:M.templateButtonContainer},I("calcite-button",{class:M.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?I("div",{class:M.formSectionContainer,key:"custom-text-elements"},e.map((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:I("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,I("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))})):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l="layoutTab"===this._selectedTab?e:t,o="layoutTab"===this._selectedTab?i:a,n="layoutTab"===this._selectedTab?this.templateOptions.title:this.templateOptions.fileName;return I("div",{class:M.formSectionContainer,key:l},I("calcite-label",null,l,I("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&"layoutTab"===this._selectedTab||"mapOnlyTab"===t&&"mapOnlyTab"===this._selectedTab||"exportTab"===t&&"exportTab"===this._selectedTab)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[M.loader]:this._awaitingServerResponse};return I("div",{class:this.classes(e),key:"loader"})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find(e=>{const[i]=Object.entries(e)[0];return i===t})[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(!F(l)){const e=a[i];return void(t.value=`${e}`)}a[i]=l}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t="layoutTab"===this._selectedTab?e.title:e.fileName,{promise:i}=this.viewModel.export(t||this.messages.untitled);this._selectedTab="exportTab",i.then(()=>this.scheduleRender())}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,l=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&l?I("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s"},I("calcite-list",{label:""},e.portalItem?I("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},I("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):I("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(n(()=>e.portalItem).then(e=>{e.itemPageUrl&&this.scheduleRender()}),await this.saveAsButtonCallback(e))}},I("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),I("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},I("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e){const t=this.messages,{url:i,state:a,error:l}=e,o=e.formattedName??"";let n=i||null;n&&(n=r(n));const s=c(n,location.href),p="error"===a?"print-task:cim-symbol-unsupported"===l?.name?t.exportWebMapCIMError:t.exportWebMapError:null;return I("div",{class:M.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},I("div",null,I("div",{class:M.exportedFileLinkTitle},o),I("div",{class:M.exportedFileLinkDescription},"pending"===a?t.generatingExport:p||(s?t.ready:t.linkReady))),"ready"===a?I("calcite-icon",{"aria-label":`${o}. ${t.linkReady}`,icon:s?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?I("calcite-loader",{class:M.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):I("calcite-icon",{icon:A(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e){const{state:t}=e,i=e.formattedName??"",a=this.saveAsButtonCallback&&"error"!==t&&this._isFormatAllowedForSaving(e.extension);return"pending"!==t?I("calcite-action",{icon:a?"ellipsis":"x",id:a?`${i}-popover-button`:void 0,key:a?`${i}-saveAs-action`:`${i}-action`,onclick:a?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:a?this.messagesCommon.options:this.messagesCommon.remove}):null}_renderExportedLinkItem(e){const t=e.formattedName??"";return I(O,null,I("calcite-list-item",{key:t,label:t},this._renderExportedLinkItemContent(e),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return I("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList,selectionMode:"none"},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,"mapOnlyTab"===this._selectedTab)this.viewModel.applyTemplate(L);else if("layoutTab"===this._selectedTab){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(C(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case"layoutTab":this._toggleTab("ArrowLeft"===t?"exportTab":"mapOnlyTab");break;case"mapOnlyTab":this._toggleTab("ArrowLeft"===t?"layoutTab":"exportTab");break;case"exportTab":this._toggleTab("ArrowLeft"===t?"mapOnlyTab":"layoutTab")}e.preventDefault(),e.stopPropagation()}}};e([p()],N.prototype,"_showTemplates",void 0),e([p()],N.prototype,"_isValidSpatialReference",void 0),e([p()],N.prototype,"allowedFormats",null),e([p()],N.prototype,"allowedFormatsForSaving",void 0),e([p()],N.prototype,"allowedLayouts",null),e([p()],N.prototype,"browseTemplateButtonOnClick",void 0),e([p()],N.prototype,"error",null),e([p()],N.prototype,"exportedLinks",null),e([p()],N.prototype,"extraParameters",null),e([p()],N.prototype,"headerVisible",void 0),e([p()],N.prototype,"headingLevel",void 0),e([p()],N.prototype,"icon",null),e([p()],N.prototype,"includeDefaultTemplates",null),e([p()],N.prototype,"includeOrganizationTemplates",void 0),e([p()],N.prototype,"label",null),e([p(),S("esri/widgets/Print/t9n/Print")],N.prototype,"messages",void 0),e([p(),S("esri/t9n/common")],N.prototype,"messagesCommon",void 0),e([p(),S("esri/core/t9n/Units")],N.prototype,"messagesUnits",void 0),e([p({type:u})],N.prototype,"outSpatialReference",null),e([p()],N.prototype,"portal",null),e([p()],N.prototype,"saveExportEnabled",null),e([p()],N.prototype,"saveExportHidden",void 0),e([p()],N.prototype,"showPrintAreaEnabled",null),e([p()],N.prototype,"printServiceUrl",null),e([p()],N.prototype,"saveAsButtonCallback",void 0),e([p()],N.prototype,"templateCustomTextElements",null),e([p()],N.prototype,"templateOptions",null),e([p()],N.prototype,"view",null),e([p({type:f})],N.prototype,"viewModel",void 0),N=e([m("esri.widgets.Print")],N);const V=N;export{V as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{clone as t}from"../../core/lang.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import r from"./SearchSource.js";import{getResults as l,getSuggestions as a}from"./support/layerSearchUtils.js";var o;let h=o=class extends r{constructor(e){super(e),this.displayField=null,this.exactMatch=null,this.orderByFields=null,this.searchFields=null,this.searchTemplate=null,this.suggestionTemplate=null,this.getResults=(e,t)=>l({source:this,...e},t),this.getSuggestions=(e,t)=>a({source:this,...e},t)}set layer(e){this._set("layer",e),e&&e.load().catch(()=>{})}get name(){return this._getLayerTitle()??""}set name(e){this._overrideIfSome("name",e)}clone(){return new o({autoNavigate:this.autoNavigate,filter:this.filter,maxResults:this.maxResults,maxSuggestions:this.maxSuggestions,minSuggestCharacters:this.minSuggestCharacters,outFields:this.outFields?t(this.outFields):null,placeholder:this.placeholder,popupEnabled:this.popupEnabled,prefix:this.prefix,resultGraphicEnabled:this.resultGraphicEnabled,resultSymbol:this.resultSymbol?this.resultSymbol.clone():null,suggestionsEnabled:this.suggestionsEnabled,suffix:this.suffix,withinViewEnabled:this.withinViewEnabled,displayField:this.displayField,exactMatch:this.exactMatch,layer:this.layer,searchFields:this.searchFields?t(this.searchFields):null,suggestionTemplate:this.suggestionTemplate,zoomScale:this.zoomScale})}_getFirstStringField(){return this.layer.fieldsIndex?.fields.find(e=>"string"===e.type)?.name??""}_getDisplayField(){return this.displayField||this.layer.displayField||this._getFirstStringField()}_getSearchFieldsString(){const{layer:e,searchFields:t}=this;if(!e.loaded)return"";return`: ${(t||[this._getDisplayField()]).map(t=>{const s=e.getField(t);return s?.alias||t}).join(", ")}`}_getLayerTitle(){const{layer:e}=this;if(!e)return;const{title:t}=e;return t?`${t}${this._getSearchFieldsString()}`:void 0}};e([s({json:{read:{source:"field.name"},write:{target:"field.name"}}})],h.prototype,"displayField",void 0),e([s({json:{read:{source:"field.exactMatch"},write:{target:"field.exactMatch"}}})],h.prototype,"exactMatch",void 0),e([s({value:null})],h.prototype,"layer",null),e([s()],h.prototype,"name",null),e([s({type:[String],json:{write:!0}})],h.prototype,"orderByFields",void 0),e([s()],h.prototype,"searchFields",void 0),e([s()],h.prototype,"searchTemplate",void 0),e([s()],h.prototype,"suggestionTemplate",void 0),h=o=e([i("esri.widgets.Search.LayerSearchSource")],h);const n=h;export{n as default};
5
+ import{__decorate as e}from"tslib";import{clone as t}from"../../core/lang.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{supportsFieldConfiguration as r}from"../../layers/support/layerUtils.js";import l from"./SearchSource.js";import{getResults as a,getSuggestions as o}from"./support/layerSearchUtils.js";var h;let n=h=class extends l{constructor(e){super(e),this.displayField=null,this.exactMatch=null,this.orderByFields=null,this.searchFields=null,this.searchTemplate=null,this.suggestionTemplate=null,this.getResults=(e,t)=>a({source:this,...e},t),this.getSuggestions=(e,t)=>o({source:this,...e},t)}set layer(e){this._set("layer",e),e&&e.load().catch(()=>{})}get name(){return this._getLayerTitle()??""}set name(e){this._overrideIfSome("name",e)}clone(){return new h({autoNavigate:this.autoNavigate,filter:this.filter,maxResults:this.maxResults,maxSuggestions:this.maxSuggestions,minSuggestCharacters:this.minSuggestCharacters,outFields:this.outFields?t(this.outFields):null,placeholder:this.placeholder,popupEnabled:this.popupEnabled,prefix:this.prefix,resultGraphicEnabled:this.resultGraphicEnabled,resultSymbol:this.resultSymbol?this.resultSymbol.clone():null,suggestionsEnabled:this.suggestionsEnabled,suffix:this.suffix,withinViewEnabled:this.withinViewEnabled,displayField:this.displayField,exactMatch:this.exactMatch,layer:this.layer,searchFields:this.searchFields?t(this.searchFields):null,suggestionTemplate:this.suggestionTemplate,zoomScale:this.zoomScale})}_getFirstStringField(){return this.layer.fieldsIndex?.fields.find(e=>"string"===e.type)?.name??""}_getDisplayField(){return this.displayField||this.layer.displayField||this._getFirstStringField()}_getSearchFieldsString(){const{layer:e,searchFields:t}=this;if(!e.loaded)return"";const s=t||[this._getDisplayField()],i=r(e);return`: ${s.map(t=>{const s=e.getField(t);return(i?e.getFieldAlias(t):s?.alias)||t}).join(", ")}`}_getLayerTitle(){const{layer:e}=this;if(!e)return;const{title:t}=e;return t?`${t}${this._getSearchFieldsString()}`:void 0}};e([s({json:{read:{source:"field.name"},write:{target:"field.name"}}})],n.prototype,"displayField",void 0),e([s({json:{read:{source:"field.exactMatch"},write:{target:"field.exactMatch"}}})],n.prototype,"exactMatch",void 0),e([s({value:null})],n.prototype,"layer",null),e([s()],n.prototype,"name",null),e([s({type:[String],json:{write:!0}})],n.prototype,"orderByFields",void 0),e([s()],n.prototype,"searchFields",void 0),e([s()],n.prototype,"searchTemplate",void 0),e([s()],n.prototype,"suggestionTemplate",void 0),n=h=e([i("esri.widgets.Search.LayerSearchSource")],n);const d=n;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as i}from"../../core/Evented.js";import{drainHandles as r}from"../../core/handleUtils.js";import"../../core/has.js";import s from"../../core/Logger.js";import{destroyMaybe as n,abortMaybe as p}from"../../core/maybe.js";import{createAbortError as l,whenOrAbort as h,ignoreAbortErrors as c}from"../../core/promiseUtils.js";import{watch as d,syncAndInitial as u,on as m,when as y,whenOnce as g}from"../../core/reactiveUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as b}from"../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as w,isLoaded as G,load as O,project as T}from"../../geometry/projectionUtils.js";import{geometryToCoordinates as S}from"../../geometry/support/coordsUtils.js";import{equals as E}from"../../geometry/support/spatialReferenceUtils.js";import A from"../../layers/GraphicsLayer.js";import{isIntegratedMeshLayer as M}from"../../layers/support/layerUtils.js";import k from"../../symbols/FillSymbol3DLayer.js";import C from"../../symbols/MeshSymbol3D.js";import H from"../../symbols/SimpleFillSymbol.js";import j from"../../symbols/SimpleLineSymbol.js";import U from"../../symbols/SimpleMarkerSymbol.js";import D from"../../symbols/TextSymbol.js";import{symbolTypes as I}from"../../symbols/support/typeUtils.js";import{isSupportedObjectResultMessage as R}from"../../views/3d/interactive/editingTools/isSupportedObjectUtils.js";import{isSupportedObject as x}from"../../views/3d/interactive/editingTools/move/isSupportedObject.js";import{isSupportedObject as P}from"../../views/3d/interactive/editingTools/reshape/isSupportedObject.js";import{isSupportedGraphic as L}from"../../views/3d/interactive/editingTools/transform/isSupportedGraphic.js";import{addUniqueLayer as F}from"../../views/draw/support/layerUtils.js";import{ViewEventPriorities as V}from"../../views/input/InputManager.js";import{sketchKeys as K}from"../../views/interactive/keybindings.js";import W from"../../views/interactive/sketch/SketchLabelOptions.js";import Z from"../../views/interactive/sketch/SketchOptions.js";import q from"../../views/interactive/sketch/SketchTooltipOptions.js";import N from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as z}from"../../views/interactive/snapping/SnappingManager.js";import B from"../../views/interactive/snapping/SnappingOptions.js";import{setupSnappingToggleHandles as $}from"../../views/interactive/snapping/snappingUtils.js";import{loadAutomaticAreaMeasurementUtils as Y}from"../../views/support/automaticAreaMeasurementUtils.js";import{loadAutomaticLengthMeasurementUtils as J}from"../../views/support/automaticLengthMeasurementUtils.js";import{defaultHighlightName as Q}from"../../views/support/HighlightDefaults.js";import{findFirstGraphicHit as X}from"../../views/support/hitTestSelectUtils.js";import{createScreenPointFromEvent as ee}from"../../views/support/screenUtils.js";import te from"./adapters/layer/GraphicsLayerAdapter.js";import oe from"./adapters/layer/MapNotesLayerAdapter.js";import{CreateOperationHandle as ae,UpdateOperationHandle as ie}from"./support/OperationHandle.js";import{getModeFromCreateOptions as re,getDrawToolGeometryTypeFromCreateTool as se,graphicsHaveTooFewVerticesForBox as ne}from"./support/sketchUtils.js";const pe={defaultZ:0},le={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move"},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0,name:Q},tool:"transform"},he=Symbol(),ce=Symbol();let de=class extends i{constructor(e){super(e),this._defaultSnappingManager=null,this._internalGraphicsLayer=new A({listMode:"hide",internal:!0,title:"SVM Internal"}),this._operationHandle=null,this._updatingHandles=new _,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.layer=null,this.pointSymbol=new U({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new H({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new j({color:[130,130,130,1],width:2}),this.meshSymbol=new C({symbolLayers:new o([new k])}),this.textSymbol=new D({text:"text"}),this.updateGraphics=new o,this.updateOnGraphicClick=!0,this.creationMode="single",this.vertexSymbol=new U({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.sketchOptions=new Z,this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._sketchContinuationFlag=!1,this._onLayerAdapterChange=async()=>{const{_layerAdapter:e}=this;if(this.removeHandles(ce),!e)return;const o=[e.onGraphicsChange(e=>this._onLayerGraphicsChangeCallback(e)),d(()=>e.elevationInfo,e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer.elevationInfo=e)},u)].filter(t);this.addHandles(o,ce)},this._originalPopupEnabled=null,this.defaultCreateOptions=pe,this.defaultUpdateOptions=le,this.snappingOptions=e?.snappingManager?.options??e?.snappingOptions??new B}initialize(){this.addHandles([m(()=>this.view?.map?.layers,"change",e=>{this.layer&&e.removed.includes(this.layer)&&this.cancel()}),d(()=>this._layerAdapter,()=>this._onLayerAdapterChange(),u),d(()=>this.view,e=>{this._defaultSnappingManager=n(this._defaultSnappingManager),e&&(this.snappingManager||(this._defaultSnappingManager=new z({view:e,options:this.snappingOptions})),"2d"===e.type?import("../../views/2d/interactive/editingTools.js"):"3d"===e.type&&(import("../../views/3d/interactive/editingTools.js"),import("../../views/3d/layers/GraphicsLayerView3D.js")))},u),d(()=>this.view?.spatialReference,(e,t)=>{e&&t&&!e.equals(t)&&this.cancel()})]),$(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this._defaultSnappingManager=n(this._defaultSnappingManager),this._set("snappingManager",null),this._set("view",null),this._updatingHandles.destroy(),this.emit("destroy")}get _layerAdapter(){const{layer:e}=this;switch(e?.type){case"graphics":return new te(e);case"map-notes":return new oe(e);default:return null}}get activeTool(){return this._operationHandle?.tool??null}get activeCreateToolDrawMode(){return"create"===this._operationHandle?.type&&this._operationHandle.activeComponent&&"mode"in this._operationHandle.activeComponent?this._operationHandle.activeComponent.mode:null}get activeTooltip(){const{activeComponent:e,destroyed:t}=this,o=!t&&e&&"tooltip"in e?e.tooltip:null;return o?.visible?o:null}get activeComponent(){return this._operationHandle?.activeComponent??null}get createGraphic(){return null==this.activeComponent||"draw-3d"!==this.activeComponent.type&&"draw-2d"!==this.activeComponent.type?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...pe,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{...le,...e,reshapeOptions:{...le.reshapeOptions,...e?.reshapeOptions},highlightOptions:{...le.highlightOptions,...e?.highlightOptions}})}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get snappingOptions(){return this.snappingManager?.options??this._get("snappingOptions")}set snappingOptions(e){null!=this._defaultSnappingManager&&(this._defaultSnappingManager.options=e),this._set("snappingOptions",e)}get snappingManager(){return this._isOverridden("snappingManager")&&this._get("snappingManager"),this._defaultSnappingManager}set snappingManager(e){if(e)this._isOverridden("snappingManager")||(this._defaultSnappingManager=n(this._defaultSnappingManager)),this._override("snappingManager",e);else{const{view:e}=this;!this._defaultSnappingManager&&e&&(this._defaultSnappingManager=new z({options:this.snappingOptions,view:e})),this._clearOverride("snappingManager")}}get state(){const e=!(!this.view?.ready||!this.layer),t=this._operationHandle;return e&&t?"active":e?"ready":"disabled"}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get updating(){return!(!this._updatingHandles.updating&&!this.snappingManager?.updating)}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}get view(){return this._get("view")}set view(e){const t=this._get("view");if(t){const{container:e,map:o}=t;e&&this._clearCursor(),o?.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const o="view-ready";this.removeHandles(o),e&&this.addHandles(y(()=>e.ready,t=>{this.removeHandles(this._viewHandlesKey),t&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)},u),o),this._set("view",e)}addGraphic(e){this._layerAdapter?.add(e)}addGraphics(e){this._layerAdapter?.addMany(e)}hasGraphic(e){return!!this._layerAdapter?.has(e)}removeGraphic(e){this._layerAdapter?.remove(e)}removeGraphics(e){this._layerAdapter?.removeMany(e)}removeAllGraphics(){this._layerAdapter?.removeAll()}cancel(){this._moduleLoaderAbortController=p(this._moduleLoaderAbortController),this._viewReadyAbortController=p(this._viewReadyAbortController),this._sketchContinuationFlag=!0,this._operationHandle&&this._operationHandle.cancel()}complete(){this._operationHandle?.complete()}delete(){const{state:e,updateGraphics:t}=this;if("active"===e&&t.length){const{activeTool:e}=this,o=t.toArray();this.removeGraphics(o),this.cancel(),this._emitDeleteEvent({graphics:o,tool:e})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const e=this.updateGraphics.map(e=>e.clone()).toArray();return this.addGraphics(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,t){this.cancel(),await this._waitViewReady();const{view:o,layer:a}=this;if(!o||"disabled"===this.state)throw a||this._logMissingLayer(),l();if(null!=o.activeTool&&(o.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");F(o,this._internalGraphicsLayer);const i=await this._updatingHandles.addPromise(this._setupCreateOperation(e,t));if(null==i||this.destroyed)return void o.map?.remove(this._internalGraphicsLayer);const r=()=>{if(i===this._operationHandle){const o=this.createGraphic,a=this._operationHandle.cancelled;if(this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),this.view?.map?.remove(this._internalGraphicsLayer),i.cancelled||null==o||this.addGraphic(o),this._sketchContinuationFlag=!1,this.emit("create",{graphic:o,state:a?"cancel":"complete",tool:e,toolEventInfo:null,type:"create"}),a||this._sketchContinuationFlag)return;const{creationMode:r}=this;if("continuous"===r){if(t?.geometryToPlace)return;this._updatingHandles.addPromise(c(this.create(e,t)))}else"update"===r&&o&&this._updatingHandles.addPromise(c(this.update([o])))}};i.on("complete",r),this._operationHandle=i,o.ready&&o.focus()}async place(e,t){return await e.load(),this.create("mesh",{mode:"click",hasZ:e.hasZ,geometryToPlace:e,...t})}async update(e,t){this.cancel(),await this._waitViewReady();const{layer:o,view:a,state:i}=this;if(!a||"disabled"===i)throw o||this._logMissingLayer(),l();null!=a.activeTool&&(a.activeTool=null);const r=Array.isArray(e)?e:[e];if(null==e||!r?.length)return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(r.some(e=>this.hasGraphic(e)?null==e.geometry&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0):(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0)))return;const s=await this._updatingHandles.addPromise(this._setupUpdateOperation(r,t));this.destroyed||null==s||Ge(s)||(F(a,this._internalGraphicsLayer),this._setUpdateOperationHandle(s,t),this.emit("update",{graphics:r,state:"start",aborted:!1,tool:s.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const t=this.view;if(t){e=Array.isArray(e)?e:[e];for(const o of e)null==o.geometry||"mesh"===o.geometry.type||E(o.geometry.spatialReference,t.spatialReference)||(w(o.geometry.spatialReference,t.spatialReference)||G()||await O(),o.geometry=T(o.geometry,t.spatialReference))}else this._logMissingView()}undo(){this.canUndo()&&this._operationHandle?.undo()}redo(){this.canRedo()&&this._operationHandle?.redo()}canUndo(){return!!this._operationHandle?.canUndo()}canRedo(){return!!this._operationHandle?.canRedo()}toggleUpdateTool(){this._operationHandle?.toggleTool()}async _getFirstHit(e){const t=this.view;if(!t)return this._logMissingView(),null;if("2d"===t.type){const o=[];t.map.allLayers.forEach(e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)});const a=await t.hitTest(e,{exclude:o});return X(a.results)}const o=[t.map.ground];t.map.allLayers.forEach(e=>{M(e)&&o.push(e)});const a=await t.hitTest(e,{exclude:o});if(a.results.length>0){const e=a.results[0];if(null!=e&&"graphic"===e.type&&e.graphic&&(!a.ground.mapPoint||t.map.ground.opacity<1||a.ground.distance-(e.distance??0)>-Math.min(3*a.ground.distance,"global"===t.viewingMode?b(t.renderCoordsHelper.spatialReference).radius/t.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return e}return null}_generateViewHandles(e){return[e.on("immediate-click",async e=>{const t="active"===this.state&&"create"===this._operationHandle?.type;"disabled"!==this.state&&!t&&this.updateOnGraphicClick&&await this._updatingHandles.addPromise(this._handleImmediateClick(e))},V.WIDGET)]}async _handleImmediateClick(e){const t=await e.defer(()=>this._getFirstHit(ee(e)));let o=null;if(null!=t){const a=t.graphic;this.updateGraphics.includes(a)||this.hasGraphic(a)?(e.stopPropagation(),o=a):"2d"!==this.view?.type||this._isComponentGraphic(a)||"active"!==this.state||this.cancel()}else"active"===this.state&&this.cancel();null==o||this.updateGraphics.includes(o)||await this.update([o],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}})}async _setupCreateOperation(e,t){const o=this.view;if(!o)return this._logMissingView(),null;const a={hasZ:"3d"===o.type,...this.defaultCreateOptions,...t},i=await this._setupDrawGraphicTool(e,o,a);return null==i?null:(o.tools.add(i),o.activeTool=i,this._setupCreateOperationHandle(i,e))}async _setupDrawGraphicTool(e,t,o){if("multipoint"===e&&"3d"===t.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!t)return this._logMissingView(),null;const{cursor:a,defaultZ:i,hasZ:r,geometryToPlace:s,graphicProperties:n,mode:p,preserveAspectRatio:l}=o,h=re(p,e),c=se(e),d=o?.optionsPerTool?.has(e)?o.optionsPerTool.get(e):{},u=d?.preserveAspectRatio??l??"rectangle"!==e,m={centered:"rectangle"!==e&&!("circle"===e&&!u),cursor:a,defaultZ:i,forceUniformSize:u,graphicProperties:{...n,attributes:{...n?.attributes}},geometryToPlace:s,geometryType:c,mode:h,graphicSymbol:this._getGraphicSymbolFromTool(e),hasZ:r,snappingManager:this.snappingManager,snapToScene:!1,view:t,...d};return"2d"===t.type?this._makeDrawGraphicTool2D(m):this._makeDrawGraphicTool3D(m)}async _makeDrawGraphicTool2D(e){const[t,o,a]=await Promise.all([this._requireModule(import("../../views/2d/interactive/editingTools.js")),Y(),J()]);return Ge(t)||this.destroyed?null:new t.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:ye(e.geometryType)?this.activeFillSymbol:null,sketchOptions:this.sketchOptions,automaticAreaMeasurementUtils:o,automaticLengthMeasurementUtils:a})}async _makeDrawGraphicTool3D(e){const[t,o,a]=await Promise.all([this._requireModule(import("../../views/3d/interactive/editingTools.js")),Y(),J()]);return Ge(t)||this.destroyed?null:new t.module.DrawGraphicTool3D({...e,elevationInfo:this._layerAdapter?.elevationInfo,snapToScene:!0,sketchOptions:this.sketchOptions,automaticAreaMeasurementUtils:o,automaticLengthMeasurementUtils:a})}_setupCreateOperationHandle(e,t){const o=this.view;if(!o)return this._logMissingView(),null;let a=null;const i=e.forceUniformSize,s=e.centered,n=[o.on("key-down",t=>{if(t.key===K.pan)t.stopPropagation(),t.repeat||(e.enabled=!1);else if(t.key===K.complete)t.stopPropagation(),e.completeCreateOperation();else if(t.key!==K.vertexAdd||t.repeat)t.key===K.undo?(t.stopPropagation(),p.undo()):t.key===K.redo?(t.stopPropagation(),p.redo()):t.key!==K.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType||t.repeat?t.key===K.center&&(t.repeat||(e.centered=!s,t.stopPropagation())):(e.forceUniformSize=!i,t.stopPropagation());else{const o=e.drawOperation.geometryType;"polyline"!==o&&"polygon"!==o&&"multipoint"!==o||(t.stopPropagation(),e.drawOperation.commitStagedVertex())}},V.WIDGET),o.on("key-up",t=>{t.key===K.pan?e.enabled=!0:t.key!==K.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType?t.key===K.center&&(e.centered=s,t.stopPropagation()):(e.forceUniformSize=i,t.stopPropagation())},V.WIDGET),e.on("vertex-add",t=>{switch(a=null==a?"start":"active",t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:a,tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("cursor-update",t=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})}),e.on("vertex-remove",t=>{switch(t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("complete",e=>{this._set("createGraphic",e.graphic),a="complete",e.aborted?p&&p.cancel():p&&p.complete()}),d(()=>this._getGraphicSymbolFromTool(t),t=>{e.graphicSymbol=t})],p=new ae({activeComponent:e,type:"create",onEnd:()=>{r(n),o.tools?.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return p}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":case"freehandPolyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":case"freehandPolygon":return this.polygonSymbol;case"mesh":return this.meshSymbol;case"text":return this.textSymbol}}async _setupUpdateOperation(e,t){const{view:o}=this;if(!o)return this._logMissingView(),null;const a={...this.defaultUpdateOptions,...t,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...t?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...t?.highlightOptions}};let i=a.tool??le.tool;if(this.removeGraphics(e),this.addGraphics(e),"3d"===o.type){if(0===e.length)return null;switch(i){case"move":return this._setupMove3DOperation(e,a,o,i);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupReshape3DOperation(e[0],a,o);case"transform":return this._setupGraphicTransform3DOperation(e,a,o)}}switch(i){case"move":return this._setupMove2DOperation(e,a,o);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupTransformOrReshape2DOperation(e,i,a,o);case"transform":return ne(e)&&(i="reshape"),this._setupTransformOrReshape2DOperation(e,i,a,o)}}async _setupMove3DOperation(e,t,o,a,i=!1){const[s,n]=await Promise.all([this._requireModule(import("../../views/3d/interactive/editingTools.js")),J()]);if(Ge(s))return s;const{ManipulatedObject3DGraphic:p,MoveTool3D:l}=s.module,h=new Map,c=()=>{h.forEach(e=>e.destroy()),h.clear()};for(const r of e){const e=new p({view:o,graphic:r}),t=x(e);if(0!==t)return c(),this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${R(t)}).`),null;h.set(r,e)}const d=new l({view:o,enableZ:t.enableZ,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,autoLengthMeasurementUtils:n});o.tools.add(d),d.objects.addMany(Array.from(h.values())),i||this.updateGraphics.addMany(e);const u=[],m=new ie({activeComponent:d,tool:a,type:"update",onEnd:()=>{r(u),we(o,d),c()},undo:()=>{_e(this.view,d),ge(m,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a})},redo:()=>{ve(m,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a})},addToSelection:e=>{this.updateGraphics.push(e);const t=new p({view:o,graphic:e});h.set(e,t),d.objects.push(t),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);if(m.history.undo.forEach(e=>e.updates.splice(t,1)),m.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0===this.updateGraphics.length)return void m.complete();const o=h.get(e);o&&(d.objects.remove(o),o.destroy(),h.delete(e))},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;if("transform"!==a)return;const e=this.updateGraphics.at(0),i=await this._setupReshape3DOperation(e,t,o,!0);i&&!Ge(i)&&(m.onEnd(),m.destroy(),this._setUpdateOperationHandle(i,t))}});return u.push(...this._getHandlesForComponent(m,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(m,e,t),V.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(m,e)},V.WIDGET)),m}_setupGraphicTransform3DOperation(e,t,o,a=!1){if(1===e.length&&0===L(e[0])){const i=e[0],r=i.geometry;if(null!=r&&("point"===r.type||"mesh"===r.type))return this._setupPointTransform3DOperation(i,t,o);if(null!=r&&("polygon"===r.type||"polyline"===r.type))return this._setupPolyTransform3DOperation(i,t,o,a)}return this._setupMove3DOperation(e,t,o,"transform",a)}async _setupPointTransform3DOperation(e,t,o){const a="transform",{enableRotation:i,enableScaling:s,enableZ:n}=t,p=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Ge(p))return p;const{TransformTool3D:l,ManipulatedObject3DGraphic:h}=p.module,c=new h({graphic:e,view:o}),d=new l({object:c,view:o,enableRotation:i,enableScaling:s,enableZ:n,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(d),this.updateGraphics.add(e);const u=[],m=new ie({activeComponent:d,tool:a,type:"update",onEnd:()=>{r(u),we(o,d),c.destroy()},undo:()=>{_e(this.view,d),ge(m,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a})},redo:()=>{ve(m,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),m.onEnd(),m.destroy();const a=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);Ge(a)||this._setUpdateOperationHandle(a,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),m.complete()},toggleTool:()=>{}});return u.push(...this._getHandlesForComponent(m,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(m,e,t),V.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(m,e)},V.WIDGET)),m}async _setupPolyTransform3DOperation(e,t,o,a=!1){const i="transform",{enableRotation:s,enableScaling:n,enableZ:p,preserveAspectRatio:l}=t,[h,c]=await Promise.all([this._requireModule(import("../../views/3d/interactive/editingTools.js")),J()]);if(Ge(h))return h;const{ManipulatedObject3DGraphic:d,ExtentTransformTool:u}=h.module,m=this.view?.inputManager?.isModifierKeyDown(K.constraint),y=new d({view:o,graphic:e}),g=new u({object:y,view:o,enableRotation:s,enableScaling:n,enableZ:p,preserveAspectRatio:!!l!=!!m,sketchOptions:this.sketchOptions,automaticLengthMeasurementUtils:c});o.tools.add(g),a||this.updateGraphics.add(e);const v=[],f=new ie({activeComponent:g,tool:i,type:"update",onEnd:()=>{r(v),we(o,g),y.destroy()},canUndo:()=>!g.destroyed&&g.canUndo,undo:()=>{g.destroyed||(g.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i}))},canRedo:()=>!g.destroyed&&g.canRedo,redo:()=>{g.destroyed||(g.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),f.onEnd(),f.destroy();const a=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);Ge(a)||this._setUpdateOperationHandle(a,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),f.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;const a=await this._setupReshape3DOperation(e,t,o,!0);a&&!Ge(a)&&(f.onEnd(),f.destroy(),this._setUpdateOperationHandle(a,t))}});return v.push(...this._getHandlesForComponent(f,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(f,e,t),V.WIDGET),o.on("key-down",e=>this._getCommonUpdateOperationKeyDownHandlers(f,e),V.WIDGET),o.on("key-down",e=>{e.key!==K.constraint||e.repeat||(g.preserveAspectRatio=!g.preserveAspectRatio,e.stopPropagation())},V.WIDGET),o.on("key-up",e=>{e.key===K.constraint&&(g.preserveAspectRatio=!g.preserveAspectRatio,e.stopPropagation())},V.WIDGET)),f}async _setupMove2DOperation(e,t,o){const a="move";this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const i=await this._getGraphicMover(e,t,o);if(Ge(i))return i;const s=new ie({activeComponent:i,tool:a,type:"update",onEnd:()=>{this._clearCursor(),r(l),r(p),i.destroy(),this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const e=this.updateGraphics.toArray();ge(s,e),s.refreshComponent(),this._emitUndoEvent({graphics:e,tool:a})},redo:()=>{const e=this.updateGraphics.toArray();ve(s,e),s.refreshComponent(),this._emitRedoEvent({graphics:e,tool:a})},addToSelection:async e=>{await this._updatingHandles.addPromise(this._updateSpatialReference(e)),this.updateGraphics.push(e),i.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);s.history.undo.forEach(e=>e.updates.splice(t,1)),s.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?i.graphics=o:s.complete()}});let n=!1;const p=[o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(s,e,t),V.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(s,e),e.key!==K.constraint||e.repeat||(n=!0,i.enableMoveAllGraphics=!i.enableMoveAllGraphics)},V.WIDGET),o.on("key-up",e=>{e.key===K.constraint&&n&&(n=!1,i.enableMoveAllGraphics=!i.enableMoveAllGraphics)},V.WIDGET)],l=this._getHandlesForComponent(s,t);return s}async _setupReshape3DOperation(e,t,o,a=!1){const i="reshape",[s,n,p]=await Promise.all([this._requireModule(import("../../views/3d/interactive/editingTools.js")),Y(),J()]);if(Ge(s))return s;const{ManipulatedObject3DGraphic:l,ReshapeTool3D:h}=s.module,c=new l({view:o,graphic:e}),d=P(c);if(0!==d)return c.destroy(),this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${R(d)}).`),null;const u=t.reshapeOptions,m=new h({view:o,object:c,enableZVertex:t.enableZ&&"move"===u?.vertexOperation,enableZShape:t.enableZ&&"move"===u?.shapeOperation,enableMoveObject:"move"===u?.shapeOperation||"move-xy"===u?.shapeOperation,enableMidpoints:"split"===u?.edgeOperation,enableEdgeOffset:"offset"===u?.edgeOperation,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,automaticAreaMeasurementUtils:n,automaticLengthMeasurementUtils:p});o.tools.add(m),a||this.updateGraphics.add(c.graphic);const y=[],g=new ie({activeComponent:m,tool:i,type:"update",onEnd:()=>{r(y),we(o,m),c.destroy()},canUndo:()=>!m.destroyed&&m.canUndo,undo:()=>{m.destroyed||(m.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i}))},canRedo:()=>!m.destroyed&&m.canRedo,redo:()=>{m.destroyed||(m.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),g.onEnd(),g.destroy();const a=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);Ge(a)||this._setUpdateOperationHandle(a,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),g.complete()},toggleTool:async()=>{if(!1===t.toggleToolOnClick)return;g.onEnd(),g.destroy();const e=await this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),t,o,!0);Ge(e)||this._setUpdateOperationHandle(e,t)}});return y.push(...this._getHandlesForComponent(g,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(g,e,t),V.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(g,e)},V.WIDGET)),g}async _setupTransformOrReshape2DOperation(e,t,o,a){this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const i="transform"===t?await this._getBox(e,o,a):await this._getReshape(e,o,a);if(Ge(i))return i;const s=new ie({activeComponent:i,type:"update",onEnd:()=>{r(p),r(n),s.activeComponent&&!s.activeComponent.destroyed&&s.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{ge(s,this.updateGraphics.toArray()),s.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:s.tool})},redo:()=>{ve(s,this.updateGraphics.toArray()),s.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:s.tool})},addToSelection:async e=>{let t=s.activeComponent;if("reshape"===t?.type){const t=[...this.updateGraphics,e];this.updateGraphics.removeAll(),s.onEnd(),s.destroy();const i=await this._setupTransformOrReshape2DOperation(t,"transform",o,a);if(Ge(i))return;this._setUpdateOperationHandle(i,o)}else this.updateGraphics.add(e),t.graphics=this.updateGraphics.toArray(),t.refresh(),s.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);s.history.undo.forEach(e=>e.updates.splice(t,1)),s.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();0===o.length?s.complete():ne(o)?s.toggleTool():s.activeComponent.graphics=o,this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(this.updateGraphics.length>1)return;const e=this.updateGraphics.at(0),t=e.geometry;if(null!=t&&("reshape"===s.tool&&"point"===t.type||"transform"===s.tool&&"extent"===t.type))return;let i=null;"transform"===s.tool?i=await this._getReshape([e],o,a):"reshape"===s.tool&&(i=await this._getBox([e],o,a)),Ge(i)||(s.activeComponent?.destroy(),s.activeComponent=i,s.activeComponent&&(r(p),p=this._getHandlesForComponent(s,o)))}}),n=[a.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(s,e,o),V.WIDGET),a.on("key-down",e=>{if(this._getCommonUpdateOperationKeyDownHandlers(s,e),e.key===K.constraint&&!e.repeat&&s){const e=s.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}},V.WIDGET),a.on("key-up",e=>{if(e.key===K.constraint&&s){const e=s.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}},V.WIDGET)];let p=this._getHandlesForComponent(s,o);return s}async _getGraphicMover(e,t,o){const{enableMoveAllGraphics:a,highlightOptions:i}=t,r=await this._requireModule(import("../../views/draw/support/GraphicMover.js"));return Ge(r)?r:new r.module.default({enableMoveAllGraphics:a,highlightName:i?.name,highlightsEnabled:!!i?.enabled,indicatorsEnabled:!1,graphics:e,view:o,callbacks:{onGraphicMoveStart:({dx:e,dy:t,graphic:o})=>{this._displayCursor("grabbing"),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-start"},type:"update"})},onGraphicMove:({dx:e,dy:t,graphic:o})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move"},type:"update"}),onGraphicMoveStop:({dx:e,dy:t,graphic:o})=>{this._displayCursor("pointer"),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayCursor("move"),onGraphicPointerOut:()=>this._clearCursor()}})}async _getBox(e,t,o){const{enableRotation:a,enableScaling:i,highlightOptions:r,preserveAspectRatio:s}=t,[n,p]=await Promise.all([this._requireModule(import("../../views/draw/support/Box.js")),J()]);if(Ge(n))return n;const l=this.view?.inputManager?.isModifierKeyDown(K.constraint);return new n.module.default({graphics:e,enableRotation:a,enableScaling:i,highlightName:r?.name,highlightsEnabled:!!r?.enabled,preserveAspectRatio:!!s!=!!l,layer:this._internalGraphicsLayer,view:o,sketchOptions:this.sketchOptions,automaticLengthMeasurementUtils:p,callbacks:{onMoveStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMove:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMoveStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScale:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotate:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"})}})}async _getReshape(e,t,o){const{highlightOptions:a,reshapeOptions:i}=t,r="split"===i?.edgeOperation,s="move"===i?.shapeOperation,[n,p,l]=await Promise.all([this._requireModule(import("../../views/draw/support/Reshape.js")),Y(),J()]);return Ge(n)?n:new n.module.default({enableMidpoints:r,enableMovement:s,graphic:e[0],highlightName:a?.name,highlightsEnabled:!!a?.enabled,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,automaticAreaMeasurementUtils:p,automaticLengthMeasurementUtils:l,view:o,callbacks:{onReshapeStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshape:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshapeStop:({mover:e,type:t})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e,type:t},type:"update"}),onMoveStart:({dx:e,dy:t,mover:o,type:a})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:a},type:"update"}),onMove:({dx:e,dy:t,mover:o,type:a})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:a},type:"update"}),onMoveStop:({dx:e,dy:t,mover:o,type:a})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:a},type:"update"}),onVertexAdd:({added:e,type:t,vertices:o})=>{const a=e.map(e=>S(e.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:a,vertices:o,type:t},type:"update"})},onVertexRemove:({removed:e,type:t,vertices:o})=>{const a=e.map(e=>S(e.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:a,vertices:o,type:t},type:"update"})}}})}_getHandlesForComponent(e,t){const o=e.activeComponent;if(!o)return[];switch(o.type){case"graphic-mover":return[o.on("graphic-click",({graphic:o,viewEvent:a})=>{a.native?.shiftKey&&t.multipleSelectionEnabled&&(a.stopPropagation(),e.removeFromSelection(o))}),o.on("graphic-move-start",t=>e.addToHistory(be(t.allGraphics)))];case"box":return[o.on("graphic-click",o=>this._onTransformOrReshape2DGraphicClick(e,t,o)),o.on("move-start",t=>e.addToHistory(be(t.graphics))),o.on("rotate-start",t=>e.addToHistory(be(t.graphics))),o.on("scale-start",t=>e.addToHistory(be(t.graphics)))];case"reshape":return[o.on("graphic-click",o=>this._onTransformOrReshape2DGraphicClick(e,t,o)),o.on("move-start",t=>e.addToHistory(be([t.mover]))),o.on("reshape-start",t=>e.addToHistory(be([t.graphic]))),o.on("vertex-add",t=>e.addToHistory(be([t.oldGraphic]))),o.on("vertex-remove",t=>e.addToHistory(be([t.oldGraphic])))];case"move-3d":return[o.events.on("record-undo",({updates:t})=>{e.addToHistory({updates:t})}),o.events.on("move-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-start"},type:"update"})}),o.events.on("move",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e.dx,dy:e.dy,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move"},type:"update"})}),o.events.on("move-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-stop"},type:"update"})}),o.events.on("immediate-click",o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()})];case"transform-3d":return[o.events.on("record-undo",({updates:t})=>{e.addToHistory({updates:t})}),o.events.on("translate-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-start"},type:"update"})}),o.events.on("translate-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-stop"},type:"update"})}),o.events.on("rotate-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-start"},type:"update"})}),o.events.on("rotate-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-stop"},type:"update"})}),o.events.on("scale-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-start"},type:"update"})}),o.events.on("scale-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-stop"},type:"update"})}),o.events.on("translate",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move"},type:"update"})}),o.events.on("rotate",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate"},type:"update"})}),o.events.on("scale",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale"},type:"update"})}),o.events.on("immediate-click",o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()})];case"reshape-3d":return[o.events.on("reshape",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})}),o.events.on("move",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})}),o.events.on("vertex-add",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})}),o.events.on("vertex-remove",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})}),o.events.on("immediate-click",o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()})]}}_onTransformOrReshape2DGraphicClick(e,t,o){const{graphic:a,viewEvent:i}=o;return i.native?.shiftKey&&this.hasGraphic(a)?(i.stopPropagation(),e.removeFromSelection(a)):t.toggleToolOnClick?(i.stopPropagation(),e.toggleTool()):void 0}_setUpdateOperationHandle(e,t){this._operationHandle=e;const o=this.view?.map;this._disablePopup(t);const a=()=>{if(e===this._operationHandle){const a=this.updateGraphics.toArray(),i=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),o&&o.remove(this._internalGraphicsLayer),this._restorePopup(t),this.emit("update",{graphics:a,state:"complete",aborted:e.cancelled,tool:i,toolEventInfo:null,type:"update"})}};e.on("complete",a)}async _getCommonUpdateOperationClickHandlers(e,t,o){const a=ee(t),i=await t.defer(()=>this._getFirstHit(a));if(null==i)return void e.complete();if(t.native.shiftKey&&this._toggleSelection([i.graphic],e,o))return void t.stopPropagation();this.updateGraphics.includes(i.graphic)?t.stopPropagation():e.complete()}_toggleSelection(e,t,o){const a=!!o.multipleSelectionEnabled;return e.some(e=>null!=e&&(!(!a||!this.hasGraphic(e))&&(this.updateGraphics.includes(e)?t.removeFromSelection(e):t.addToSelection(e),!0)))}_getCommonUpdateOperationKeyDownHandlers(e,t){if(!e)return;const o=t.key;o===K.undo&&e.canUndo()?(t.stopPropagation(),e.undo()):o===K.redo&&e.canRedo()?(t.stopPropagation(),e.redo()):o===K.cancel?(t.stopPropagation(),e.cancel()):this.allowDeleteKey&&K.delete.includes(o)&&this._onDeleteKey(t)}_onDeleteKey(e){if(!this._operationHandle||"update"!==this._operationHandle.type)return;const t=this.activeComponent,o=this.updateGraphics.toArray();null!=t&&("reshape"!==t.type||1===o.length&&"point"===o[0].geometry?.type)&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=n(this._internalGraphicsLayer))}_isComponentGraphic(e){const{activeComponent:t}=this;return!(!e||null==t)&&(e.attributes?.esriSketchTool||"draw-2d"===t.type&&t.graphic===e||("box"===t.type||"reshape"===t.type)&&t.isUIGraphic(e))}_clearCursor(){this.removeHandles(he)}_displayCursor(e){this.removeHandles(he),this.view?.container&&null!=e&&this.addHandles(this.view.acquireCursor(e,"high"),he)}_logError(e,t,o){s.getLogger(this).error(new a(e,t,o))}async _requireModule(e){const t=new AbortController;this._moduleLoaderAbortController=t;const o=await e;return this._moduleLoaderAbortController!==t||t.signal.aborted?{requireError:"aborted"}:{module:o}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}_onLayerGraphicsChangeCallback(e){if(null!=this._operationHandle){const{updateGraphics:t}=this;for(const o of e.removed)if(t.includes(o)){if(!(t.length>1)){this._operationHandle.cancel();break}this._operationHandle.removeFromSelection(o)}}}get test(){}wait(){return g(()=>!this.updating)}_disablePopupEnabled(e){return"3d"!==this.view?.type||this.updateOnGraphicClick||(e?.toggleToolOnClick??!1)}_disablePopup(e){this._disablePopupEnabled(e)&&this.view&&null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._disablePopupEnabled(e)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(p(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await h(g(()=>e?.ready),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",me("view"))}_logMissingLayer(){this._logError(ue,me("layer"))}};e([v()],de.prototype,"_defaultSnappingManager",void 0),e([v()],de.prototype,"_layerAdapter",null),e([v()],de.prototype,"_operationHandle",void 0),e([v({readOnly:!0})],de.prototype,"_updatingHandles",void 0),e([v({readOnly:!0})],de.prototype,"activeTool",null),e([v({readOnly:!0})],de.prototype,"activeCreateToolDrawMode",null),e([v()],de.prototype,"activeTooltip",null),e([v({types:I})],de.prototype,"activeFillSymbol",void 0),e([v()],de.prototype,"activeLineSymbol",void 0),e([v()],de.prototype,"activeVertexSymbol",void 0),e([v()],de.prototype,"allowDeleteKey",void 0),e([v({readOnly:!0})],de.prototype,"createGraphic",null),e([v()],de.prototype,"defaultCreateOptions",null),e([v()],de.prototype,"defaultUpdateOptions",null),e([v({type:W,nonNullable:!0})],de.prototype,"labelOptions",null),e([v()],de.prototype,"layer",void 0),e([v({types:I})],de.prototype,"pointSymbol",void 0),e([v({types:I})],de.prototype,"polygonSymbol",void 0),e([v({types:I})],de.prototype,"polylineSymbol",void 0),e([v()],de.prototype,"meshSymbol",void 0),e([v()],de.prototype,"textSymbol",void 0),e([v({type:B,nonNullable:!0})],de.prototype,"snappingOptions",null),e([v()],de.prototype,"snappingManager",null),e([v({readOnly:!0})],de.prototype,"state",null),e([v({type:q,nonNullable:!0})],de.prototype,"tooltipOptions",null),e([v({readOnly:!0})],de.prototype,"updateGraphics",void 0),e([v()],de.prototype,"updateOnGraphicClick",void 0),e([v()],de.prototype,"updating",null),e([v()],de.prototype,"creationMode",void 0),e([v({type:N,nonNullable:!0})],de.prototype,"valueOptions",null),e([v({types:I})],de.prototype,"vertexSymbol",void 0),e([v({value:null})],de.prototype,"view",null),e([v({constructOnly:!0,type:Z})],de.prototype,"sketchOptions",void 0),de=e([f("esri.widgets.Sketch.SketchViewModel")],de);const ue="sketch:missing-property",me=e=>`Property '${e}' is missing on SketchViewModel.`;function ye(e){return"polygon"===e||"rectangle"===e||"circle"===e}function ge(e,t){fe("undo",e.history.undo,e.history.redo,t)}function ve(e,t){fe("redo",e.history.redo,e.history.undo,t)}function fe(e,t,o,a){const i=t.pop();if(!i)return;const r=i.updates,s=[];a.forEach((t,o)=>{const a=r[o];null!=a&&("geometry"in a&&null!=a.geometry&&(s.push({geometry:t.geometry}),t.geometry=a.geometry),"symbol"in a&&null!=a.symbol&&(s.push({symbol:t.symbol}),t.symbol=a.symbol),"undo"in a&&(s.push(a),a[e](t)))}),o.push({updates:s})}function _e(e,t){null!=e&&t.hasGrabbedManipulators&&(e.activeTool=null)}function be(e){return{updates:e.map(({geometry:e})=>"mesh"===e?.type?{geometry:e.cloneShallow()}:{geometry:e})}}function we(e,t){e.tools?.remove(t),t.destroyed||t.destroy()}function Ge(e){return"requireError"in e&&"aborted"===e.requireError}export{de as default};
5
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as i}from"../../core/Evented.js";import{drainHandles as r}from"../../core/handleUtils.js";import"../../core/has.js";import s from"../../core/Logger.js";import{destroyMaybe as n,abortMaybe as p}from"../../core/maybe.js";import{createAbortError as l,whenOrAbort as h,ignoreAbortErrors as c}from"../../core/promiseUtils.js";import{watch as d,syncAndInitial as u,on as m,when as y,whenOnce as g}from"../../core/reactiveUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as b}from"../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as w,isLoaded as G,load as O,project as T}from"../../geometry/projectionUtils.js";import{geometryToCoordinates as S}from"../../geometry/support/coordsUtils.js";import{equals as E}from"../../geometry/support/spatialReferenceUtils.js";import A from"../../layers/GraphicsLayer.js";import{isIntegratedMeshLayer as M}from"../../layers/support/layerUtils.js";import C from"../../symbols/FillSymbol3DLayer.js";import k from"../../symbols/MeshSymbol3D.js";import H from"../../symbols/SimpleFillSymbol.js";import j from"../../symbols/SimpleLineSymbol.js";import U from"../../symbols/SimpleMarkerSymbol.js";import D from"../../symbols/TextSymbol.js";import{symbolTypes as I}from"../../symbols/support/typeUtils.js";import{isSupportedObjectResultMessage as R}from"../../views/3d/interactive/editingTools/isSupportedObjectUtils.js";import{isSupportedObject as x}from"../../views/3d/interactive/editingTools/move/isSupportedObject.js";import{isSupportedObject as P}from"../../views/3d/interactive/editingTools/reshape/isSupportedObject.js";import{isSupportedGraphic as L}from"../../views/3d/interactive/editingTools/transform/isSupportedGraphic.js";import{addUniqueLayer as F}from"../../views/draw/support/layerUtils.js";import{ViewEventPriorities as V}from"../../views/input/InputManager.js";import{sketchKeys as K}from"../../views/interactive/keybindings.js";import W from"../../views/interactive/sketch/SketchLabelOptions.js";import Z from"../../views/interactive/sketch/SketchOptions.js";import q from"../../views/interactive/sketch/SketchTooltipOptions.js";import N from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as z}from"../../views/interactive/snapping/SnappingManager.js";import B from"../../views/interactive/snapping/SnappingOptions.js";import{setupSnappingToggleHandles as $}from"../../views/interactive/snapping/snappingUtils.js";import{loadAutomaticAreaMeasurementUtils as Y}from"../../views/support/automaticAreaMeasurementUtils.js";import{loadAutomaticLengthMeasurementUtils as J}from"../../views/support/automaticLengthMeasurementUtils.js";import{defaultHighlightName as Q}from"../../views/support/HighlightDefaults.js";import{findFirstGraphicHit as X}from"../../views/support/hitTestSelectUtils.js";import{createScreenPointFromEvent as ee}from"../../views/support/screenUtils.js";import te from"./adapters/layer/GraphicsLayerAdapter.js";import oe from"./adapters/layer/MapNotesLayerAdapter.js";import{CreateOperationHandle as ae,UpdateOperationHandle as ie}from"./support/OperationHandle.js";import{getModeFromCreateOptions as re,getDrawToolGeometryTypeFromCreateTool as se,graphicsHaveTooFewVerticesForBox as ne}from"./support/sketchUtils.js";const pe={defaultZ:0},le={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move"},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0,name:Q},tool:"transform"},he=Symbol(),ce=Symbol();let de=class extends i{constructor(e){super(e),this._defaultSnappingManager=null,this._internalGraphicsLayer=new A({listMode:"hide",internal:!0,title:"SVM Internal"}),this._operationHandle=null,this._updatingHandles=new _,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.layer=null,this.pointSymbol=new U({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new H({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new j({color:[130,130,130,1],width:2}),this.meshSymbol=new k({symbolLayers:new o([new C])}),this.textSymbol=new D({text:"text"}),this.updateGraphics=new o,this.updateOnGraphicClick=!0,this.creationMode="single",this.vertexSymbol=new U({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.sketchOptions=new Z,this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._sketchContinuationFlag=!1,this._onLayerAdapterChange=async()=>{const{_layerAdapter:e}=this;if(this.removeHandles(ce),!e)return;const o=[e.onGraphicsChange(e=>this._onLayerGraphicsChangeCallback(e)),d(()=>e.elevationInfo,e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer.elevationInfo=e)},u)].filter(t);this.addHandles(o,ce)},this._originalPopupEnabled=null,this.defaultCreateOptions=pe,this.defaultUpdateOptions=le,this.snappingOptions=e?.snappingManager?.options??e?.snappingOptions??new B}initialize(){this.addHandles([m(()=>this.view?.map?.layers,"change",e=>{this.layer&&e.removed.includes(this.layer)&&this.cancel()}),d(()=>this._layerAdapter,()=>this._onLayerAdapterChange(),u),d(()=>this.view,e=>{this._defaultSnappingManager=n(this._defaultSnappingManager),e&&(this.snappingManager||(this._defaultSnappingManager=new z({view:e,options:this.snappingOptions})),"2d"===e.type?import("../../views/2d/interactive/editingTools.js"):"3d"===e.type&&(import("../../views/3d/interactive/editingTools.js"),import("../../views/3d/layers/GraphicsLayerView3D.js")))},u),d(()=>this.view?.spatialReference,(e,t)=>{e&&t&&!e.equals(t)&&this.cancel()})]),$(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this._defaultSnappingManager=n(this._defaultSnappingManager),this._set("snappingManager",null),this._set("view",null),this._updatingHandles.destroy(),this.emit("destroy")}get _layerAdapter(){const{layer:e}=this;switch(e?.type){case"graphics":return new te(e);case"map-notes":return new oe(e);default:return null}}get activeTool(){return this._operationHandle?.tool??null}get activeCreateToolDrawMode(){return"create"===this._operationHandle?.type&&this._operationHandle.activeComponent&&"mode"in this._operationHandle.activeComponent?this._operationHandle.activeComponent.mode:null}get activeTooltip(){const{activeComponent:e,destroyed:t}=this,o=!t&&e&&"tooltip"in e?e.tooltip:null;return o?.visible?o:null}get activeComponent(){return this._operationHandle?.activeComponent??null}get createGraphic(){return null==this.activeComponent||"draw-3d"!==this.activeComponent.type&&"draw-2d"!==this.activeComponent.type?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...pe,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{...le,...e,reshapeOptions:{...le.reshapeOptions,...e?.reshapeOptions},highlightOptions:{...le.highlightOptions,...e?.highlightOptions}})}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get snappingOptions(){return this.snappingManager?.options??this._get("snappingOptions")}set snappingOptions(e){null!=this._defaultSnappingManager&&(this._defaultSnappingManager.options=e),this._set("snappingOptions",e)}get snappingManager(){return this._isOverridden("snappingManager")&&this._get("snappingManager"),this._defaultSnappingManager}set snappingManager(e){if(e)this._isOverridden("snappingManager")||(this._defaultSnappingManager=n(this._defaultSnappingManager)),this._override("snappingManager",e);else{const{view:e}=this;!this._defaultSnappingManager&&e&&(this._defaultSnappingManager=new z({options:this.snappingOptions,view:e})),this._clearOverride("snappingManager")}}get state(){const e=!(!this.view?.ready||!this.layer),t=this._operationHandle;return e&&t?"active":e?"ready":"disabled"}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get updating(){return!(!this._updatingHandles.updating&&!this.snappingManager?.updating)}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}get view(){return this._get("view")}set view(e){const t=this._get("view");if(t){const{container:e,map:o}=t;e&&this._clearCursor(),o?.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const o="view-ready";this.removeHandles(o),e&&this.addHandles(y(()=>e.ready,t=>{this.removeHandles(this._viewHandlesKey),t&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)},u),o),this._set("view",e)}addGraphic(e){this._layerAdapter?.add(e)}addGraphics(e){this._layerAdapter?.addMany(e)}hasGraphic(e){return!!this._layerAdapter?.has(e)}removeGraphic(e){this._layerAdapter?.remove(e)}removeGraphics(e){this._layerAdapter?.removeMany(e)}removeAllGraphics(){this._layerAdapter?.removeAll()}cancel(){this._moduleLoaderAbortController=p(this._moduleLoaderAbortController),this._viewReadyAbortController=p(this._viewReadyAbortController),this._sketchContinuationFlag=!0,this._operationHandle&&this._operationHandle.cancel()}complete(){this._operationHandle?.complete()}delete(){const{state:e,updateGraphics:t}=this;if("active"===e&&t.length){const{activeTool:e}=this,o=t.toArray();this.removeGraphics(o),this.cancel(),this._emitDeleteEvent({graphics:o,tool:e})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const e=this.updateGraphics.map(e=>e.clone()).toArray();return this.addGraphics(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,t){this.cancel(),await this._waitViewReady();const{view:o,layer:a}=this;if(!o||"disabled"===this.state)throw a||this._logMissingLayer(),l();if(null!=o.activeTool&&(o.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");F(o,this._internalGraphicsLayer);const i=await this._updatingHandles.addPromise(this._setupCreateOperation(e,t));if(null==i||this.destroyed)return void o.map?.remove(this._internalGraphicsLayer);const r=()=>{if(i===this._operationHandle){const o=this.createGraphic,a=this._operationHandle.cancelled;if(this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),this.view?.map?.remove(this._internalGraphicsLayer),i.cancelled||null==o||this.addGraphic(o),this._sketchContinuationFlag=!1,this.emit("create",{graphic:o,state:a?"cancel":"complete",tool:e,toolEventInfo:null,type:"create"}),a||this._sketchContinuationFlag)return;const{creationMode:r}=this;if("continuous"===r){if(t?.geometryToPlace)return;this._updatingHandles.addPromise(c(this.create(e,t)))}else"update"===r&&o&&this._updatingHandles.addPromise(c(this.update([o])))}};i.on("complete",r),this._operationHandle=i,o.ready&&o.focus()}async place(e,t){return await e.load(),this.create("mesh",{mode:"click",hasZ:e.hasZ,geometryToPlace:e,...t})}async update(e,t){this.cancel(),await this._waitViewReady();const{layer:o,view:a,state:i}=this;if(!a||"disabled"===i)throw o||this._logMissingLayer(),l();null!=a.activeTool&&(a.activeTool=null);const r=Array.isArray(e)?e:[e];if(null==e||!r?.length)return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(r.some(e=>this.hasGraphic(e)?null==e.geometry&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0):(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0)))return;const s=await this._updatingHandles.addPromise(this._setupUpdateOperation(r,t));this.destroyed||null==s||Ge(s)||(F(a,this._internalGraphicsLayer),this._setUpdateOperationHandle(s,t),this.emit("update",{graphics:r,state:"start",aborted:!1,tool:s.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const t=this.view;if(t){e=Array.isArray(e)?e:[e];for(const o of e)null==o.geometry||"mesh"===o.geometry.type||E(o.geometry.spatialReference,t.spatialReference)||(w(o.geometry.spatialReference,t.spatialReference)||G()||await O(),o.geometry=T(o.geometry,t.spatialReference))}else this._logMissingView()}undo(){this.canUndo()&&this._operationHandle?.undo()}redo(){this.canRedo()&&this._operationHandle?.redo()}canUndo(){return!!this._operationHandle?.canUndo()}canRedo(){return!!this._operationHandle?.canRedo()}toggleUpdateTool(){this._operationHandle?.toggleTool()}async _getFirstHit(e){const t=this.view;if(!t)return this._logMissingView(),null;if("2d"===t.type){const o=[];t.map.allLayers.forEach(e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)});const a=await t.hitTest(e,{exclude:o});return X(a.results)}const o=[t.map.ground];t.map.allLayers.forEach(e=>{M(e)&&o.push(e)});const a=await t.hitTest(e,{exclude:o});if(a.results.length>0){const e=a.results[0];if(null!=e&&"graphic"===e.type&&e.graphic&&(!a.ground.mapPoint||t.map.ground.opacity<1||a.ground.distance-(e.distance??0)>-Math.min(3*a.ground.distance,"global"===t.viewingMode?b(t.renderCoordsHelper.spatialReference).radius/t.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return e}return null}_generateViewHandles(e){return[e.on("immediate-click",async e=>{const t="active"===this.state&&"create"===this._operationHandle?.type;"disabled"!==this.state&&!t&&this.updateOnGraphicClick&&await this._updatingHandles.addPromise(this._handleImmediateClick(e))},V.WIDGET)]}async _handleImmediateClick(e){const t=await e.defer(()=>this._getFirstHit(ee(e)));let o=null;if(null!=t){const a=t.graphic;this.updateGraphics.includes(a)||this.hasGraphic(a)?(e.stopPropagation(),o=a):"2d"!==this.view?.type||this._isComponentGraphic(a)||"active"!==this.state||this.cancel()}else"active"===this.state&&this.cancel();null==o||this.updateGraphics.includes(o)||await this.update([o],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}})}async _setupCreateOperation(e,t){const o=this.view;if(!o)return this._logMissingView(),null;const a={hasZ:"3d"===o.type,...this.defaultCreateOptions,...t},i=await this._setupDrawGraphicTool(e,o,a);return null==i?null:(o.tools.add(i),o.activeTool=i,this._setupCreateOperationHandle(i,e))}async _setupDrawGraphicTool(e,t,o){if("multipoint"===e&&"3d"===t.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!t)return this._logMissingView(),null;const{cursor:a,defaultZ:i,hasZ:r,geometryToPlace:s,graphicProperties:n,mode:p,preserveAspectRatio:l}=o,h=re(p,e),c=se(e),d=o?.optionsPerTool?.has(e)?o.optionsPerTool.get(e):{},u=d?.preserveAspectRatio??l??"rectangle"!==e,m={centered:"rectangle"!==e&&!("circle"===e&&!u),cursor:a,defaultZ:i,forceUniformSize:u,graphicProperties:{...n,attributes:{...n?.attributes}},geometryToPlace:s,geometryType:c,mode:h,graphicSymbol:this._getGraphicSymbolFromTool(e),hasZ:r,snappingManager:this.snappingManager,snapToScene:!1,view:t,...d};return"2d"===t.type?this._makeDrawGraphicTool2D(m):this._makeDrawGraphicTool3D(m)}async _makeDrawGraphicTool2D(e){const[t,o,a]=await Promise.all([this._requireModule(import("../../views/2d/interactive/editingTools.js")),Y(),J()]);return Ge(t)||this.destroyed?null:new t.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:ye(e.geometryType)?this.activeFillSymbol:null,sketchOptions:this.sketchOptions,automaticAreaMeasurementUtils:o,automaticLengthMeasurementUtils:a})}async _makeDrawGraphicTool3D(e){const[t,o,a]=await Promise.all([this._requireModule(import("../../views/3d/interactive/editingTools.js")),Y(),J()]);return Ge(t)||this.destroyed?null:new t.module.DrawGraphicTool3D({...e,elevationInfo:this._layerAdapter?.elevationInfo,snapToScene:!0,sketchOptions:this.sketchOptions,automaticAreaMeasurementUtils:o,automaticLengthMeasurementUtils:a})}_setupCreateOperationHandle(e,t){const o=this.view;if(!o)return this._logMissingView(),null;let a=null;const i=e.forceUniformSize,s=e.centered,n=[o.on("key-down",t=>{if(t.key===K.pan)t.stopPropagation(),t.repeat||(e.enabled=!1);else if(t.key===K.complete)t.stopPropagation(),e.completeCreateOperation();else if(t.key!==K.vertexAdd||t.repeat)t.key===K.undo?(t.stopPropagation(),p.undo()):t.key===K.redo?(t.stopPropagation(),p.redo()):t.key!==K.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType||t.repeat?t.key===K.center&&(t.repeat||(e.centered=!s,t.stopPropagation())):(e.forceUniformSize=!i,t.stopPropagation());else{const o=e.drawOperation.geometryType;"polyline"!==o&&"polygon"!==o&&"multipoint"!==o||(t.stopPropagation(),e.drawOperation.commitStagedVertex())}},V.WIDGET),o.on("key-up",t=>{t.key===K.pan?e.enabled=!0:t.key!==K.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType?t.key===K.center&&(e.centered=s,t.stopPropagation()):(e.forceUniformSize=i,t.stopPropagation())},V.WIDGET),e.on("vertex-add",t=>{switch(a=null==a?"start":"active",t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:a,tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("cursor-update",t=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})}),e.on("vertex-remove",t=>{switch(t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("complete",e=>{this._set("createGraphic",e.graphic),a="complete",e.aborted?p&&p.cancel():p&&p.complete()}),d(()=>this._getGraphicSymbolFromTool(t),t=>{e.graphicSymbol=t})],p=new ae({activeComponent:e,type:"create",onEnd:()=>{r(n),o.tools?.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return p}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":case"freehandPolyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":case"freehandPolygon":return this.polygonSymbol;case"mesh":return this.meshSymbol;case"text":return this.textSymbol}}async _setupUpdateOperation(e,t){const{view:o}=this;if(!o)return this._logMissingView(),null;const a={...this.defaultUpdateOptions,...t,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...t?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...t?.highlightOptions}};let i=a.tool??le.tool;if(this.removeGraphics(e),this.addGraphics(e),"3d"===o.type){if(0===e.length)return null;switch(i){case"move":return this._setupMove3DOperation(e,a,o,i);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupReshape3DOperation(e[0],a,o);case"transform":return this._setupGraphicTransform3DOperation(e,a,o)}}switch(i){case"move":return this._setupMove2DOperation(e,a,o);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupTransformOrReshape2DOperation(e,i,a,o);case"transform":return ne(e)&&(i="reshape"),this._setupTransformOrReshape2DOperation(e,i,a,o)}}async _setupMove3DOperation(e,t,o,a,i=!1){const[s,n]=await Promise.all([this._requireModule(import("../../views/3d/interactive/editingTools.js")),J()]);if(Ge(s))return s;const{ManipulatedObject3DGraphic:p,MoveTool3D:l}=s.module,h=new Map,c=()=>{h.forEach(e=>e.destroy()),h.clear()};for(const r of e){const e=new p({view:o,graphic:r}),t=x(e);if(0!==t)return c(),this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${R(t)}).`),null;h.set(r,e)}const d=new l({view:o,enableZ:t.enableZ,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,autoLengthMeasurementUtils:n});o.tools.add(d),d.objects.addMany(Array.from(h.values())),i||this.updateGraphics.addMany(e);const u=[],m=new ie({activeComponent:d,tool:a,type:"update",onEnd:()=>{r(u),we(o,d),c()},undo:()=>{_e(this.view,d),ge(m,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a})},redo:()=>{ve(m,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a})},addToSelection:e=>{this.updateGraphics.push(e);const t=new p({view:o,graphic:e});h.set(e,t),d.objects.push(t),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);if(m.history.undo.forEach(e=>e.updates.splice(t,1)),m.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0===this.updateGraphics.length)return void m.complete();const o=h.get(e);o&&(d.objects.remove(o),o.destroy(),h.delete(e))},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;if("transform"!==a)return;const e=this.updateGraphics.at(0),i=await this._setupReshape3DOperation(e,t,o,!0);i&&!Ge(i)&&(m.onEnd(),m.destroy(),this._setUpdateOperationHandle(i,t))}});return u.push(...this._getHandlesForComponent(m,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(m,e,t),V.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(m,e)},V.WIDGET)),m}_setupGraphicTransform3DOperation(e,t,o,a=!1){if(1===e.length&&0===L(e[0])){const i=e[0],r=i.geometry;if(null!=r&&("point"===r.type||"mesh"===r.type))return this._setupPointTransform3DOperation(i,t,o);if(null!=r&&("polygon"===r.type||"polyline"===r.type))return this._setupPolyTransform3DOperation(i,t,o,a)}return this._setupMove3DOperation(e,t,o,"transform",a)}async _setupPointTransform3DOperation(e,t,o){const a="transform",{enableRotation:i,enableScaling:s,enableZ:n}=t,p=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Ge(p))return p;const{TransformTool3D:l,ManipulatedObject3DGraphic:h}=p.module,c=new h({graphic:e,view:o}),d=new l({object:c,view:o,enableRotation:i,enableScaling:s,enableZ:n,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(d),this.updateGraphics.add(e);const u=[],m=new ie({activeComponent:d,tool:a,type:"update",onEnd:()=>{r(u),we(o,d),c.destroy()},undo:()=>{_e(this.view,d),ge(m,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a})},redo:()=>{ve(m,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),m.onEnd(),m.destroy();const a=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);Ge(a)||this._setUpdateOperationHandle(a,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),m.complete()},toggleTool:()=>{}});return u.push(...this._getHandlesForComponent(m,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(m,e,t),V.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(m,e)},V.WIDGET)),m}async _setupPolyTransform3DOperation(e,t,o,a=!1){const i="transform",{enableRotation:s,enableScaling:n,enableZ:p,preserveAspectRatio:l}=t,[h,c]=await Promise.all([this._requireModule(import("../../views/3d/interactive/editingTools.js")),J()]);if(Ge(h))return h;const{ManipulatedObject3DGraphic:d,ExtentTransformTool:u}=h.module,m=this.view?.inputManager?.isModifierKeyDown(K.constraint),y=new d({view:o,graphic:e}),g=new u({object:y,view:o,enableRotation:s,enableScaling:n,enableZ:p,preserveAspectRatio:!!l!=!!m,sketchOptions:this.sketchOptions,automaticLengthMeasurementUtils:c});o.tools.add(g),a||this.updateGraphics.add(e);const v=[],f=new ie({activeComponent:g,tool:i,type:"update",onEnd:()=>{r(v),we(o,g),y.destroy()},canUndo:()=>!g.destroyed&&g.canUndo,undo:()=>{g.destroyed||(g.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i}))},canRedo:()=>!g.destroyed&&g.canRedo,redo:()=>{g.destroyed||(g.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),f.onEnd(),f.destroy();const a=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);Ge(a)||this._setUpdateOperationHandle(a,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),f.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;const a=await this._setupReshape3DOperation(e,t,o,!0);a&&!Ge(a)&&(f.onEnd(),f.destroy(),this._setUpdateOperationHandle(a,t))}});return v.push(...this._getHandlesForComponent(f,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(f,e,t),V.WIDGET),o.on("key-down",e=>this._getCommonUpdateOperationKeyDownHandlers(f,e),V.WIDGET),o.on("key-down",e=>{e.key!==K.constraint||e.repeat||(g.preserveAspectRatio=!g.preserveAspectRatio,e.stopPropagation())},V.WIDGET),o.on("key-up",e=>{e.key===K.constraint&&(g.preserveAspectRatio=!g.preserveAspectRatio,e.stopPropagation())},V.WIDGET)),f}async _setupMove2DOperation(e,t,o){const a="move";this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const i=await this._getGraphicMover(e,t,o);if(Ge(i))return i;const s=new ie({activeComponent:i,tool:a,type:"update",onEnd:()=>{this._clearCursor(),r(l),r(p),i.destroy(),this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const e=this.updateGraphics.toArray();ge(s,e),s.refreshComponent(),this._emitUndoEvent({graphics:e,tool:a})},redo:()=>{const e=this.updateGraphics.toArray();ve(s,e),s.refreshComponent(),this._emitRedoEvent({graphics:e,tool:a})},addToSelection:async e=>{await this._updatingHandles.addPromise(this._updateSpatialReference(e)),this.updateGraphics.push(e),i.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);s.history.undo.forEach(e=>e.updates.splice(t,1)),s.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?i.graphics=o:s.complete()}});let n=!1;const p=[o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(s,e,t),V.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(s,e),e.key!==K.constraint||e.repeat||(n=!0,i.enableMoveAllGraphics=!i.enableMoveAllGraphics)},V.WIDGET),o.on("key-up",e=>{e.key===K.constraint&&n&&(n=!1,i.enableMoveAllGraphics=!i.enableMoveAllGraphics)},V.WIDGET)],l=this._getHandlesForComponent(s,t);return s}async _setupReshape3DOperation(e,t,o,a=!1){const i="reshape",[s,n,p]=await Promise.all([this._requireModule(import("../../views/3d/interactive/editingTools.js")),Y(),J()]);if(Ge(s))return s;const{ManipulatedObject3DGraphic:l,ReshapeTool3D:h}=s.module,c=new l({view:o,graphic:e}),d=P(c);if(0!==d)return c.destroy(),this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${R(d)}).`),null;const u=t.reshapeOptions,m=new h({view:o,object:c,enableZVertex:t.enableZ&&"move"===u?.vertexOperation,enableZShape:t.enableZ&&"move"===u?.shapeOperation,enableMoveObject:"move"===u?.shapeOperation||"move-xy"===u?.shapeOperation,enableMidpoints:"split"===u?.edgeOperation,enableEdgeOffset:"offset"===u?.edgeOperation,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,automaticAreaMeasurementUtils:n,automaticLengthMeasurementUtils:p});o.tools.add(m),a||this.updateGraphics.add(c.graphic);const y=[],g=new ie({activeComponent:m,tool:i,type:"update",onEnd:()=>{r(y),we(o,m),c.destroy()},canUndo:()=>!m.destroyed&&m.canUndo,undo:()=>{m.destroyed||(m.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i}))},canRedo:()=>!m.destroyed&&m.canRedo,redo:()=>{m.destroyed||(m.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),g.onEnd(),g.destroy();const a=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);Ge(a)||this._setUpdateOperationHandle(a,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),g.complete()},toggleTool:async()=>{if(!1===t.toggleToolOnClick)return;g.onEnd(),g.destroy();const e=await this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),t,o,!0);Ge(e)||this._setUpdateOperationHandle(e,t)}});return y.push(...this._getHandlesForComponent(g,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(g,e,t),V.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(g,e)},V.WIDGET)),g}async _setupTransformOrReshape2DOperation(e,t,o,a){this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const i="transform"===t?await this._getBox(e,o,a):await this._getReshape(e,o,a);if(Ge(i))return i;const s=new ie({activeComponent:i,type:"update",onEnd:()=>{r(p),r(n),s.activeComponent&&!s.activeComponent.destroyed&&s.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{ge(s,this.updateGraphics.toArray()),s.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:s.tool})},redo:()=>{ve(s,this.updateGraphics.toArray()),s.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:s.tool})},addToSelection:async e=>{let t=s.activeComponent;if("reshape"===t?.type){const t=[...this.updateGraphics,e];this.updateGraphics.removeAll(),s.onEnd(),s.destroy();const i=await this._setupTransformOrReshape2DOperation(t,"transform",o,a);if(Ge(i))return;this._setUpdateOperationHandle(i,o)}else this.updateGraphics.add(e),t.graphics=this.updateGraphics.toArray(),t.refresh(),s.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);s.history.undo.forEach(e=>e.updates.splice(t,1)),s.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();0===o.length?s.complete():ne(o)?s.toggleTool():s.activeComponent.graphics=o,this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(this.updateGraphics.length>1)return;const e=this.updateGraphics.at(0),t=e.geometry;if(null!=t&&("reshape"===s.tool&&"point"===t.type||"transform"===s.tool&&"extent"===t.type))return;let i=null;"transform"===s.tool?i=await this._getReshape([e],o,a):"reshape"===s.tool&&(i=await this._getBox([e],o,a)),Ge(i)||(s.activeComponent?.destroy(),s.activeComponent=i,s.activeComponent&&(r(p),p=this._getHandlesForComponent(s,o)))}}),n=[a.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(s,e,o),V.WIDGET),a.on("key-down",e=>{if(this._getCommonUpdateOperationKeyDownHandlers(s,e),e.key===K.constraint&&!e.repeat&&s){const e=s.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}},V.WIDGET),a.on("key-up",e=>{if(e.key===K.constraint&&s){const e=s.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}},V.WIDGET)];let p=this._getHandlesForComponent(s,o);return s}async _getGraphicMover(e,t,o){const{enableMoveAllGraphics:a,highlightOptions:i}=t,r=await this._requireModule(import("../../views/draw/support/GraphicMover.js"));return Ge(r)?r:new r.module.default({enableMoveAllGraphics:a,highlightName:i?.name,highlightsEnabled:!!i?.enabled,indicatorsEnabled:!1,graphics:e,view:o,callbacks:{onGraphicMoveStart:({dx:e,dy:t,graphic:o})=>{this._displayCursor("grabbing"),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-start"},type:"update"})},onGraphicMove:({dx:e,dy:t,graphic:o})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move"},type:"update"}),onGraphicMoveStop:({dx:e,dy:t,graphic:o})=>{this._displayCursor("pointer"),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayCursor("move"),onGraphicPointerOut:()=>this._clearCursor()}})}async _getBox(e,t,o){const{enableRotation:a,enableScaling:i,highlightOptions:r,preserveAspectRatio:s}=t,[n,p]=await Promise.all([this._requireModule(import("../../views/draw/support/Box.js")),J()]);if(Ge(n))return n;const l=this.view?.inputManager?.isModifierKeyDown(K.constraint);return new n.module.default({graphics:e,enableRotation:a,enableScaling:i,highlightName:r?.name,highlightsEnabled:!!r?.enabled,preserveAspectRatio:!!s!=!!l,layer:this._internalGraphicsLayer,view:o,sketchOptions:this.sketchOptions,automaticLengthMeasurementUtils:p,callbacks:{onMoveStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMove:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMoveStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScale:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotate:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"})}})}async _getReshape(e,t,o){const{highlightOptions:a,reshapeOptions:i}=t,r="split"===i?.edgeOperation,s="move"===i?.shapeOperation,n=!!i?.enableCreateCurveFromStraightEdge,[p,l,h]=await Promise.all([this._requireModule(import("../../views/draw/support/Reshape.js")),Y(),J()]);return Ge(p)?p:new p.module.default({enableMidpoints:r,enableMovement:s,enableCurveOnMidpoint:n,graphic:e[0],highlightName:a?.name,highlightsEnabled:!!a?.enabled,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,automaticAreaMeasurementUtils:l,automaticLengthMeasurementUtils:h,view:o,callbacks:{onReshapeStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshape:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshapeStop:({mover:e,type:t})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e,type:t},type:"update"}),onMoveStart:({dx:e,dy:t,mover:o,type:a})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:a},type:"update"}),onMove:({dx:e,dy:t,mover:o,type:a})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:a},type:"update"}),onMoveStop:({dx:e,dy:t,mover:o,type:a})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:a},type:"update"}),onVertexAdd:({added:e,type:t,vertices:o})=>{const a=e.map(e=>S(e.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:a,vertices:o,type:t},type:"update"})},onVertexRemove:({removed:e,type:t,vertices:o})=>{const a=e.map(e=>S(e.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:a,vertices:o,type:t},type:"update"})}}})}_getHandlesForComponent(e,t){const o=e.activeComponent;if(!o)return[];switch(o.type){case"graphic-mover":return[o.on("graphic-click",({graphic:o,viewEvent:a})=>{a.native?.shiftKey&&t.multipleSelectionEnabled&&(a.stopPropagation(),e.removeFromSelection(o))}),o.on("graphic-move-start",t=>e.addToHistory(be(t.allGraphics)))];case"box":return[o.on("graphic-click",o=>this._onTransformOrReshape2DGraphicClick(e,t,o)),o.on("move-start",t=>e.addToHistory(be(t.graphics))),o.on("rotate-start",t=>e.addToHistory(be(t.graphics))),o.on("scale-start",t=>e.addToHistory(be(t.graphics)))];case"reshape":return[o.on("graphic-click",o=>this._onTransformOrReshape2DGraphicClick(e,t,o)),o.on("move-start",t=>e.addToHistory(be([t.mover]))),o.on("reshape-start",t=>e.addToHistory(be([t.graphic]))),o.on("vertex-add",t=>e.addToHistory(be([t.oldGraphic]))),o.on("vertex-remove",t=>e.addToHistory(be([t.oldGraphic])))];case"move-3d":return[o.events.on("record-undo",({updates:t})=>{e.addToHistory({updates:t})}),o.events.on("move-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-start"},type:"update"})}),o.events.on("move",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e.dx,dy:e.dy,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move"},type:"update"})}),o.events.on("move-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-stop"},type:"update"})}),o.events.on("immediate-click",o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()})];case"transform-3d":return[o.events.on("record-undo",({updates:t})=>{e.addToHistory({updates:t})}),o.events.on("translate-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-start"},type:"update"})}),o.events.on("translate-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-stop"},type:"update"})}),o.events.on("rotate-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-start"},type:"update"})}),o.events.on("rotate-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-stop"},type:"update"})}),o.events.on("scale-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-start"},type:"update"})}),o.events.on("scale-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-stop"},type:"update"})}),o.events.on("translate",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move"},type:"update"})}),o.events.on("rotate",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate"},type:"update"})}),o.events.on("scale",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale"},type:"update"})}),o.events.on("immediate-click",o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()})];case"reshape-3d":return[o.events.on("reshape",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})}),o.events.on("move",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})}),o.events.on("vertex-add",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})}),o.events.on("vertex-remove",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})}),o.events.on("immediate-click",o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()})]}}_onTransformOrReshape2DGraphicClick(e,t,o){const{graphic:a,viewEvent:i}=o;return i.native?.shiftKey&&this.hasGraphic(a)?(i.stopPropagation(),e.removeFromSelection(a)):t.toggleToolOnClick?(i.stopPropagation(),e.toggleTool()):void 0}_setUpdateOperationHandle(e,t){this._operationHandle=e;const o=this.view?.map;this._disablePopup(t);const a=()=>{if(e===this._operationHandle){const a=this.updateGraphics.toArray(),i=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),o&&o.remove(this._internalGraphicsLayer),this._restorePopup(t),this.emit("update",{graphics:a,state:"complete",aborted:e.cancelled,tool:i,toolEventInfo:null,type:"update"})}};e.on("complete",a)}async _getCommonUpdateOperationClickHandlers(e,t,o){const a=ee(t),i=await t.defer(()=>this._getFirstHit(a));if(null==i)return void e.complete();if(t.native.shiftKey&&this._toggleSelection([i.graphic],e,o))return void t.stopPropagation();this.updateGraphics.includes(i.graphic)?t.stopPropagation():e.complete()}_toggleSelection(e,t,o){const a=!!o.multipleSelectionEnabled;return e.some(e=>null!=e&&(!(!a||!this.hasGraphic(e))&&(this.updateGraphics.includes(e)?t.removeFromSelection(e):t.addToSelection(e),!0)))}_getCommonUpdateOperationKeyDownHandlers(e,t){if(!e)return;const o=t.key;o===K.undo&&e.canUndo()?(t.stopPropagation(),e.undo()):o===K.redo&&e.canRedo()?(t.stopPropagation(),e.redo()):o===K.cancel?(t.stopPropagation(),e.cancel()):this.allowDeleteKey&&K.delete.includes(o)&&this._onDeleteKey(t)}_onDeleteKey(e){if(!this._operationHandle||"update"!==this._operationHandle.type)return;const t=this.activeComponent,o=this.updateGraphics.toArray();null!=t&&("reshape"!==t.type||1===o.length&&"point"===o[0].geometry?.type)&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=n(this._internalGraphicsLayer))}_isComponentGraphic(e){const{activeComponent:t}=this;return!(!e||null==t)&&(e.attributes?.esriSketchTool||"draw-2d"===t.type&&t.graphic===e||("box"===t.type||"reshape"===t.type)&&t.isUIGraphic(e))}_clearCursor(){this.removeHandles(he)}_displayCursor(e){this.removeHandles(he),this.view?.container&&null!=e&&this.addHandles(this.view.acquireCursor(e,"high"),he)}_logError(e,t,o){s.getLogger(this).error(new a(e,t,o))}async _requireModule(e){const t=new AbortController;this._moduleLoaderAbortController=t;const o=await e;return this._moduleLoaderAbortController!==t||t.signal.aborted?{requireError:"aborted"}:{module:o}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}_onLayerGraphicsChangeCallback(e){if(null!=this._operationHandle){const{updateGraphics:t}=this;for(const o of e.removed)if(t.includes(o)){if(!(t.length>1)){this._operationHandle.cancel();break}this._operationHandle.removeFromSelection(o)}}}get test(){}wait(){return g(()=>!this.updating)}_disablePopupEnabled(e){return"3d"!==this.view?.type||this.updateOnGraphicClick||(e?.toggleToolOnClick??!1)}_disablePopup(e){this._disablePopupEnabled(e)&&this.view&&null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._disablePopupEnabled(e)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(p(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await h(g(()=>e?.ready),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",me("view"))}_logMissingLayer(){this._logError(ue,me("layer"))}};e([v()],de.prototype,"_defaultSnappingManager",void 0),e([v()],de.prototype,"_layerAdapter",null),e([v()],de.prototype,"_operationHandle",void 0),e([v({readOnly:!0})],de.prototype,"_updatingHandles",void 0),e([v({readOnly:!0})],de.prototype,"activeTool",null),e([v({readOnly:!0})],de.prototype,"activeCreateToolDrawMode",null),e([v()],de.prototype,"activeTooltip",null),e([v({types:I})],de.prototype,"activeFillSymbol",void 0),e([v()],de.prototype,"activeLineSymbol",void 0),e([v()],de.prototype,"activeVertexSymbol",void 0),e([v()],de.prototype,"allowDeleteKey",void 0),e([v({readOnly:!0})],de.prototype,"createGraphic",null),e([v()],de.prototype,"defaultCreateOptions",null),e([v()],de.prototype,"defaultUpdateOptions",null),e([v({type:W,nonNullable:!0})],de.prototype,"labelOptions",null),e([v()],de.prototype,"layer",void 0),e([v({types:I})],de.prototype,"pointSymbol",void 0),e([v({types:I})],de.prototype,"polygonSymbol",void 0),e([v({types:I})],de.prototype,"polylineSymbol",void 0),e([v()],de.prototype,"meshSymbol",void 0),e([v()],de.prototype,"textSymbol",void 0),e([v({type:B,nonNullable:!0})],de.prototype,"snappingOptions",null),e([v()],de.prototype,"snappingManager",null),e([v({readOnly:!0})],de.prototype,"state",null),e([v({type:q,nonNullable:!0})],de.prototype,"tooltipOptions",null),e([v({readOnly:!0})],de.prototype,"updateGraphics",void 0),e([v()],de.prototype,"updateOnGraphicClick",void 0),e([v()],de.prototype,"updating",null),e([v()],de.prototype,"creationMode",void 0),e([v({type:N,nonNullable:!0})],de.prototype,"valueOptions",null),e([v({types:I})],de.prototype,"vertexSymbol",void 0),e([v({value:null})],de.prototype,"view",null),e([v({constructOnly:!0,type:Z})],de.prototype,"sketchOptions",void 0),de=e([f("esri.widgets.Sketch.SketchViewModel")],de);const ue="sketch:missing-property",me=e=>`Property '${e}' is missing on SketchViewModel.`;function ye(e){return"polygon"===e||"rectangle"===e||"circle"===e}function ge(e,t){fe("undo",e.history.undo,e.history.redo,t)}function ve(e,t){fe("redo",e.history.redo,e.history.undo,t)}function fe(e,t,o,a){const i=t.pop();if(!i)return;const r=i.updates,s=[];a.forEach((t,o)=>{const a=r[o];null!=a&&("geometry"in a&&null!=a.geometry&&(s.push({geometry:t.geometry}),t.geometry=a.geometry),"symbol"in a&&null!=a.symbol&&(s.push({symbol:t.symbol}),t.symbol=a.symbol),"undo"in a&&(s.push(a),a[e](t)))}),o.push({updates:s})}function _e(e,t){null!=e&&t.hasGrabbedManipulators&&(e.activeTool=null)}function be(e){return{updates:e.map(({geometry:e})=>"mesh"===e?.type?{geometry:e.cloneShallow()}:{geometry:e})}}function we(e,t){e.tools?.remove(t),t.destroyed||t.destroy()}function Ge(e){return"requireError"in e&&"aborted"===e.requireError}export{de as default};