@arcgis/core 4.28.0-next.20230919 → 4.28.0-next.20230921

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 (412) hide show
  1. package/Color.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/arcade/ArcadeDate.js +1 -1
  4. package/arcade/executionError.js +1 -1
  5. package/arcade/featureset/support/errorsupport.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/06621efb2573fad23b45.js +1 -0
  8. package/assets/esri/core/workers/chunks/072b4e041b8630c513a0.js +1 -0
  9. package/assets/esri/core/workers/chunks/101f776316a85b708927.js +1 -0
  10. package/assets/esri/core/workers/chunks/107546ef77a45d31c7ac.js +1 -0
  11. package/assets/esri/core/workers/chunks/10fd951bd296b2beeeba.js +1 -0
  12. package/assets/esri/core/workers/chunks/114269dda1d296893908.js +1 -0
  13. package/assets/esri/core/workers/chunks/126df6237fc80608344e.js +1 -0
  14. package/assets/esri/core/workers/chunks/134524cf6b1ebf208338.js +1 -0
  15. package/assets/esri/core/workers/chunks/17a36704e63ca1b34c5d.js +1 -0
  16. package/assets/esri/core/workers/chunks/1c83f47d446f2bca1721.js +1 -0
  17. package/assets/esri/core/workers/chunks/{09d395a9786607294689.js → 1c8469fbde39d85ee622.js} +1 -1
  18. package/assets/esri/core/workers/chunks/1cbaba30f55f00f7498b.js +1 -0
  19. package/assets/esri/core/workers/chunks/21a9c8aa2a9e9990df41.js +1 -0
  20. package/assets/esri/core/workers/chunks/{506874f562ce11f8914a.js → 243a4eed107d363dfad8.js} +1 -1
  21. package/assets/esri/core/workers/chunks/24629402c647ef6b5f6b.js +1 -0
  22. package/assets/esri/core/workers/chunks/2a1c1be9c202462cf54d.js +1 -0
  23. package/assets/esri/core/workers/chunks/2bb69d76a13564e8e455.js +1 -0
  24. package/assets/esri/core/workers/chunks/2d0d03cbea83c868edba.js +1 -0
  25. package/assets/esri/core/workers/chunks/2e130cb2f1038055c07b.js +1 -0
  26. package/assets/esri/core/workers/chunks/32ba4eba730e9232d964.js +1 -0
  27. package/assets/esri/core/workers/chunks/{b428fcb53ecc82b49e66.js → 332689bf60d246485993.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3619e04cbb6691549014.js +1 -0
  29. package/assets/esri/core/workers/chunks/37116fb4c68cf3c3890a.js +1 -0
  30. package/assets/esri/core/workers/chunks/{3a7ad0d24264e2bc2e87.js → 3ca759f72d3bb29e9ea9.js} +22 -22
  31. package/assets/esri/core/workers/chunks/3dbfb4f370a874393822.js +1 -0
  32. package/assets/esri/core/workers/chunks/3f4e9b1663ec521bfe00.js +1 -0
  33. package/assets/esri/core/workers/chunks/406db5c90271a3a203d4.js +1 -0
  34. package/assets/esri/core/workers/chunks/4339ce8aaf87fabb80cc.js +1 -0
  35. package/assets/esri/core/workers/chunks/4369a6c1e0a82ab4db6a.js +1 -0
  36. package/assets/esri/core/workers/chunks/43ba2bacd0f7d19915f7.js +1 -0
  37. package/assets/esri/core/workers/chunks/44b8e75593b7df1843e1.js +1 -0
  38. package/assets/esri/core/workers/chunks/467a821d05df8ec0dc1c.js +1 -0
  39. package/assets/esri/core/workers/chunks/47be4c75dd6372b96fe4.js +1 -0
  40. package/assets/esri/core/workers/chunks/53097659f31750c03a6d.js +1 -0
  41. package/assets/esri/core/workers/chunks/{c1141056581af072aee9.js → 580039dd491854ca325c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/59c00d6fba0fd1c03d01.js +1 -0
  43. package/assets/esri/core/workers/chunks/5a5720caa64a46daadf9.js +1 -0
  44. package/assets/esri/core/workers/chunks/5edb99b58549cd66b394.js +1 -0
  45. package/assets/esri/core/workers/chunks/6203ddf6caad3d356327.js +1 -0
  46. package/assets/esri/core/workers/chunks/652749dc847fcb887234.js +1 -0
  47. package/assets/esri/core/workers/chunks/6c495077cc79e1898927.js +1 -0
  48. package/assets/esri/core/workers/chunks/{e5c3beebd507e1dda35f.js → 749fc49246093d693227.js} +1 -1
  49. package/assets/esri/core/workers/chunks/74d3ecb1a06d9f81e2c5.js +1 -0
  50. package/assets/esri/core/workers/chunks/77c15b1c2729c780f75a.js +1 -0
  51. package/assets/esri/core/workers/chunks/7ea33aa455c5143affb1.js +1 -0
  52. package/assets/esri/core/workers/chunks/7ed70c96fbfe00792e7c.js +1 -0
  53. package/assets/esri/core/workers/chunks/8ab832468300cc4feb5a.js +1 -0
  54. package/assets/esri/core/workers/chunks/90771b0de3e520a1df9a.js +1 -0
  55. package/assets/esri/core/workers/chunks/94188fe381239d48a975.js +1 -0
  56. package/assets/esri/core/workers/chunks/a277c980ba8704939688.js +1 -0
  57. package/assets/esri/core/workers/chunks/b1746c022fe6edaeda55.js +1 -0
  58. package/assets/esri/core/workers/chunks/b449d6bd5851187d419f.js +1 -0
  59. package/assets/esri/core/workers/chunks/bbc0dcd316c5598bc9ad.js +1 -0
  60. package/assets/esri/core/workers/chunks/bc1dc6383e60e7e61d50.js +1 -0
  61. package/assets/esri/core/workers/chunks/bc6323bdc98013da6fe5.js +1 -0
  62. package/assets/esri/core/workers/chunks/bde89b2684b6185992ef.js +1 -0
  63. package/assets/esri/core/workers/chunks/c4bb67150ccd01ea6014.js +1 -0
  64. package/assets/esri/core/workers/chunks/{727548fffd4e270617d3.js → c6ea5aac232d1eca04dd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c8438c2d9ac48afe4033.js +1 -0
  66. package/assets/esri/core/workers/chunks/c9dfb145f0c1d93e0fbd.js +1 -0
  67. package/assets/esri/core/workers/chunks/cad260881653567bc8f9.js +1 -0
  68. package/assets/esri/core/workers/chunks/cec607d0138351a4952e.js +1 -0
  69. package/assets/esri/core/workers/chunks/d24afa6d8fd0061d9f00.js +1 -0
  70. package/assets/esri/core/workers/chunks/{f147269d85adfb4588ed.js → d9061beaa43065316062.js} +1 -1
  71. package/assets/esri/core/workers/chunks/dd7508d4016715371e0c.js +1 -0
  72. package/assets/esri/core/workers/chunks/dff1c3c38dda2bd1a9d6.js +1 -0
  73. package/assets/esri/core/workers/chunks/e55f7fc7eff0074ce0fc.js +1 -0
  74. package/assets/esri/core/workers/chunks/eb01f4cdb9b918cc61e7.js +1 -0
  75. package/assets/esri/core/workers/chunks/ec8258c9dc1491e97fc8.js +1 -0
  76. package/assets/esri/core/workers/chunks/ed1fbc1bc8d50453e2f5.js +1 -0
  77. package/assets/esri/core/workers/chunks/eeac53da496de4cd4182.js +1 -0
  78. package/assets/esri/core/workers/chunks/eef27d305023034084a4.js +1 -0
  79. package/assets/esri/core/workers/chunks/f38c54ada9e7012a2960.js +1 -0
  80. package/assets/esri/core/workers/chunks/f508ccfde6425dabe9ac.js +1 -0
  81. package/assets/esri/core/workers/chunks/f5e0ff5292b9fd18fc92.js +1 -0
  82. package/assets/esri/core/workers/chunks/f5eb8b5021620be7538e.js +1 -0
  83. package/assets/esri/images/portal/onlinemedialayer16.png +0 -0
  84. package/assets/esri/themes/base/widgets/_FeatureForm.scss +2 -1
  85. package/assets/esri/themes/dark/main.css +1 -1
  86. package/assets/esri/themes/light/main.css +1 -1
  87. package/assets/esri/themes/light/view.css +1 -1
  88. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm.json +1 -1
  89. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
  90. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
  91. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
  92. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
  93. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
  94. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
  95. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
  96. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
  97. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_en.json +1 -1
  98. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
  99. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
  100. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
  101. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
  102. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
  103. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
  104. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
  105. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
  106. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
  107. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
  108. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
  109. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
  110. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
  111. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nb.json +1 -1
  112. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
  113. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
  114. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
  115. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
  116. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
  117. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
  118. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
  119. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
  120. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
  121. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
  122. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
  123. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
  124. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
  125. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
  126. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
  127. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
  128. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
  129. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace.json +1 -1
  130. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
  131. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
  132. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
  133. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
  134. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  135. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
  136. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
  137. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  138. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_en.json +1 -1
  139. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
  140. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
  141. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
  142. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  143. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
  144. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
  145. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
  146. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
  147. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
  148. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
  149. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
  150. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
  151. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  152. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
  153. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
  154. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
  155. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
  156. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
  157. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
  158. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
  159. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
  160. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
  161. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
  162. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
  163. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
  164. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
  165. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
  166. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
  167. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
  168. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
  169. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
  170. package/chunks/LaserlinePath.glsl.js +5 -1
  171. package/core/HandleOwner.js +1 -1
  172. package/core/MemCache.js +1 -1
  173. package/core/date.js +5 -0
  174. package/core/sql.js +1 -1
  175. package/core/string.js +1 -1
  176. package/interfaces.d.ts +60 -43
  177. package/intl/date.js +1 -1
  178. package/layers/GeoJSONLayer.js +1 -1
  179. package/layers/ImageryLayer.js +1 -1
  180. package/layers/VoxelWasmPerSceneView.js +1 -1
  181. package/layers/WFSLayer.js +1 -1
  182. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  183. package/layers/graphics/sources/MemorySource.js +1 -1
  184. package/layers/graphics/sources/WFSSource.js +1 -1
  185. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  186. package/layers/graphics/sources/csv/csv.js +1 -1
  187. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  188. package/layers/graphics/sources/geojson/geojson.js +1 -1
  189. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  190. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  191. package/{views/interactive/tooltip/tooltipInfoUnion.js → layers/graphics/sources/support/QueryEngineBuildLayer.js} +1 -0
  192. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  193. package/layers/mixins/SceneService.js +1 -1
  194. package/layers/ogc/wfsUtils.js +1 -1
  195. package/layers/save/utils.js +1 -1
  196. package/layers/support/editableLayers.js +1 -1
  197. package/layers/support/fieldUtils.js +1 -1
  198. package/layers/support/labelFormatUtils.js +1 -1
  199. package/layers/support/layersCreator.js +1 -1
  200. package/layers/support/rasterFunctionUtils.js +1 -1
  201. package/layers/support/rasterFunctions/creators/createBandIndexFunctions.js +1 -1
  202. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
  203. package/layers/support/rasterFunctions/creators/createLocalFunctions.js +1 -1
  204. package/networks/support/utils.js +1 -1
  205. package/package.json +1 -1
  206. package/portal/PortalItem.js +1 -1
  207. package/portal/support/layersLoader.js +1 -1
  208. package/rest/geometryService/cut.js +1 -1
  209. package/rest/query/operations/query.js +1 -1
  210. package/rest/versionManagement/deleteVersion.js +1 -1
  211. package/rest/versionManagement/gdbVersion/alterVersion.js +1 -1
  212. package/rest/versionManagement/gdbVersion/post.js +1 -1
  213. package/rest/versionManagement/gdbVersion/reconcile.js +1 -1
  214. package/rest/versionManagement/gdbVersion/serverVersionUtils.js +5 -0
  215. package/support/revision.js +1 -1
  216. package/time/timeZoneUtils.js +1 -1
  217. package/views/2d/engine/Stage.js +1 -1
  218. package/views/2d/engine/webgl/mesh/factories/WGLMeshFactory.js +1 -1
  219. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  220. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  221. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  222. package/views/2d/layers/features/sources/StreamSource.js +1 -1
  223. package/views/2d/layers/features/support/whereUtils.js +1 -1
  224. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  225. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  226. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  227. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  228. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  229. package/views/3d/environment/LocalAtmosphere.js +1 -1
  230. package/views/3d/externalRenderers/StageRenderer.js +1 -1
  231. package/views/3d/interactive/manipulatorUtils.js +1 -1
  232. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  233. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  234. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  235. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  236. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  237. package/views/3d/layers/MediaLayerView3D.js +1 -1
  238. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  239. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  240. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  241. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  242. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  243. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  244. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  245. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  246. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  247. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  248. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  249. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  250. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  251. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  252. package/views/3d/layers/support/patternUtils.js +1 -1
  253. package/views/3d/support/LaserLineRenderer.js +1 -1
  254. package/views/3d/support/StreamDataLoader.js +1 -1
  255. package/views/3d/support/dito.js +1 -1
  256. package/views/3d/support/engineContent/line.js +1 -1
  257. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  258. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  259. package/views/3d/terrain/OverlayRenderer.js +1 -1
  260. package/views/3d/terrain/TerrainRenderer.js +1 -1
  261. package/views/3d/terrain/TileRenderer.js +1 -1
  262. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  263. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  264. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  265. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  266. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +6 -6
  267. package/views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js +10 -12
  268. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl.js +8 -21
  269. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  270. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  271. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  272. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  273. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  274. package/views/3d/webgl-engine/lib/Attribute.js +1 -1
  275. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  276. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  277. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  278. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  279. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  280. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  281. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  282. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  283. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  284. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  285. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  286. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  287. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  288. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  289. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  290. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  291. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  292. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  293. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  294. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  295. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  296. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  297. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  298. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  299. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  300. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  301. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  302. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  303. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  304. package/views/View.js +1 -1
  305. package/views/draw/DrawGraphicTool.js +1 -1
  306. package/views/draw/support/HighlightHelper.js +1 -1
  307. package/views/draw/support/Reshape.js +1 -1
  308. package/views/draw/support/layerUtils.js +1 -1
  309. package/views/interactive/SegmentLabels.js +1 -1
  310. package/views/interactive/keybindings.js +1 -1
  311. package/views/interactive/tooltip/SketchTooltipInfo.js +1 -1
  312. package/views/interactive/tooltip/TooltipContentWithHelpMessage.js +1 -1
  313. package/views/interactive/tooltip/TooltipEditableField.js +1 -1
  314. package/views/interactive/tooltip/TranslateTooltipInfos.js +1 -1
  315. package/views/interactive/tooltip/content/Fields.js +5 -0
  316. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  317. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  318. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  319. package/views/layers/FeatureLayerView.js +1 -1
  320. package/views/webgl/FramebufferObject.js +1 -1
  321. package/webdoc/saveAPIKeyUtils.js +5 -0
  322. package/webdoc/webdocSaveUtils.js +1 -1
  323. package/widgets/BasemapGallery.js +1 -1
  324. package/widgets/BasemapLayerList.js +1 -1
  325. package/widgets/Bookmarks.js +1 -1
  326. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  327. package/widgets/Editor/EditorViewModel.js +1 -1
  328. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  329. package/widgets/Editor/UpdateWorkflow.js +1 -1
  330. package/widgets/Expand.js +1 -1
  331. package/widgets/Feature/FeatureRelationship.js +1 -1
  332. package/widgets/Feature/support/featureUtils.js +1 -1
  333. package/widgets/FeatureForm/EditableInput.js +1 -1
  334. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  335. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  336. package/widgets/FeatureForm.js +1 -1
  337. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  338. package/widgets/Fullscreen.js +1 -1
  339. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  340. package/widgets/Search.js +1 -1
  341. package/widgets/Swipe.js +1 -1
  342. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  343. package/widgets/UtilityNetworkTrace/support/ResultAreaHandler.js +1 -1
  344. package/widgets/UtilityNetworkTrace/support/UtilityHelper.js +1 -1
  345. package/widgets/UtilityNetworkTrace.js +1 -1
  346. package/widgets/support/SketchTooltipControls.js +1 -1
  347. package/widgets/support/globalCss.js +1 -1
  348. package/assets/esri/core/workers/chunks/0274b84548cb048562e4.js +0 -1
  349. package/assets/esri/core/workers/chunks/034accc7cab6c88a3b31.js +0 -1
  350. package/assets/esri/core/workers/chunks/0839b45999fcb556e460.js +0 -1
  351. package/assets/esri/core/workers/chunks/09589852b129bfb5624f.js +0 -1
  352. package/assets/esri/core/workers/chunks/132e9e6147304ffd128d.js +0 -1
  353. package/assets/esri/core/workers/chunks/1790ca4193d730f5f206.js +0 -1
  354. package/assets/esri/core/workers/chunks/1a449168d30a688e6128.js +0 -1
  355. package/assets/esri/core/workers/chunks/1c94624fd001c803a814.js +0 -1
  356. package/assets/esri/core/workers/chunks/25ab3bec45de900be36e.js +0 -1
  357. package/assets/esri/core/workers/chunks/273167b2dd46e58b8739.js +0 -1
  358. package/assets/esri/core/workers/chunks/2c5eb8aaad696fa16744.js +0 -1
  359. package/assets/esri/core/workers/chunks/353bad8530710a284592.js +0 -1
  360. package/assets/esri/core/workers/chunks/357d452b8522185cc433.js +0 -1
  361. package/assets/esri/core/workers/chunks/3c2be3d204e6bf87266a.js +0 -1
  362. package/assets/esri/core/workers/chunks/3c2c64832fb498bbaa83.js +0 -1
  363. package/assets/esri/core/workers/chunks/3c4d59018ce8502c65e7.js +0 -1
  364. package/assets/esri/core/workers/chunks/43eff89599f36d83924b.js +0 -1
  365. package/assets/esri/core/workers/chunks/4632ada4af99cab70a61.js +0 -1
  366. package/assets/esri/core/workers/chunks/481eab7879ed5d8a1f67.js +0 -1
  367. package/assets/esri/core/workers/chunks/4b3a5cc435435c81e6a5.js +0 -1
  368. package/assets/esri/core/workers/chunks/4f34fd8c2bb769541e9c.js +0 -1
  369. package/assets/esri/core/workers/chunks/4f5a0bc7411c0db33662.js +0 -1
  370. package/assets/esri/core/workers/chunks/56a4cea67cc579bf7547.js +0 -1
  371. package/assets/esri/core/workers/chunks/56afd89d08c874f620a1.js +0 -1
  372. package/assets/esri/core/workers/chunks/5b08d578521562b166e3.js +0 -1
  373. package/assets/esri/core/workers/chunks/5f938d6da9fd3f3edc74.js +0 -1
  374. package/assets/esri/core/workers/chunks/6108d72faf48a592c8ba.js +0 -1
  375. package/assets/esri/core/workers/chunks/656a8be4ce1bec721366.js +0 -1
  376. package/assets/esri/core/workers/chunks/7531ebc60e9ae61220e0.js +0 -1
  377. package/assets/esri/core/workers/chunks/77923afde29ae1ff10ca.js +0 -1
  378. package/assets/esri/core/workers/chunks/79683324be49aab79dd8.js +0 -1
  379. package/assets/esri/core/workers/chunks/7cdb4416afd5922cf5f3.js +0 -1
  380. package/assets/esri/core/workers/chunks/7e87bc83a0a2715e3016.js +0 -1
  381. package/assets/esri/core/workers/chunks/7f680cf24dd97d61bcd2.js +0 -1
  382. package/assets/esri/core/workers/chunks/7f797fed73cf7b48a686.js +0 -1
  383. package/assets/esri/core/workers/chunks/861609ebd3a77b787b0f.js +0 -1
  384. package/assets/esri/core/workers/chunks/869c3927f1e246cd1e42.js +0 -1
  385. package/assets/esri/core/workers/chunks/95371c0f5464f5daae9f.js +0 -1
  386. package/assets/esri/core/workers/chunks/962b99fd273709c726d3.js +0 -1
  387. package/assets/esri/core/workers/chunks/98fbcbb2115376d7ff62.js +0 -1
  388. package/assets/esri/core/workers/chunks/9abcd1d11bfd92f872ab.js +0 -1
  389. package/assets/esri/core/workers/chunks/9b54b5bdb6367c36f6e9.js +0 -1
  390. package/assets/esri/core/workers/chunks/9dab9f6c07ececa7f851.js +0 -1
  391. package/assets/esri/core/workers/chunks/9ff6ce486898713af7e2.js +0 -1
  392. package/assets/esri/core/workers/chunks/a98a435d4dbea73f7517.js +0 -1
  393. package/assets/esri/core/workers/chunks/b05bb6e784e5453696be.js +0 -1
  394. package/assets/esri/core/workers/chunks/b51d0ec283f61f638a48.js +0 -1
  395. package/assets/esri/core/workers/chunks/b5ee6c0c07fa50410370.js +0 -1
  396. package/assets/esri/core/workers/chunks/b9cf8f02974aeb3ce208.js +0 -1
  397. package/assets/esri/core/workers/chunks/bdf13091bd0e1ab0db7e.js +0 -1
  398. package/assets/esri/core/workers/chunks/bef1a1218a94ab6e2b51.js +0 -1
  399. package/assets/esri/core/workers/chunks/c22c2b15fe5f2c97a2ae.js +0 -1
  400. package/assets/esri/core/workers/chunks/c880d2f0ff06b3bf731f.js +0 -1
  401. package/assets/esri/core/workers/chunks/c88869d2a647c22dc3e6.js +0 -1
  402. package/assets/esri/core/workers/chunks/cc96be71fee49f07dcd4.js +0 -1
  403. package/assets/esri/core/workers/chunks/e4237360eef474d1f0ac.js +0 -1
  404. package/assets/esri/core/workers/chunks/e54ae2a4281dd58e0707.js +0 -1
  405. package/assets/esri/core/workers/chunks/e977e721f6f50e3c5f13.js +0 -1
  406. package/assets/esri/core/workers/chunks/ed31cf6688c0f7dac1f9.js +0 -1
  407. package/assets/esri/core/workers/chunks/f07a0ea10428adecea1a.js +0 -1
  408. package/assets/esri/core/workers/chunks/f1eab5c67ed808c18f86.js +0 -1
  409. package/assets/esri/core/workers/chunks/f2e7142a8db164940544.js +0 -1
  410. package/assets/esri/core/workers/chunks/f939b4166f76975f5da0.js +0 -1
  411. package/assets/esri/core/workers/chunks/ff4f4107a866e4a68386.js +0 -1
  412. package/layers/ogc/dateUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{findLayerView as e}from"./layerUtils.js";import{highlightsSupported as i}from"../../support/layerViewUtils.js";import{getHighlightKeyForFeature as l}from"../../../widgets/Feature/support/featureUtils.js";let a=class extends s{constructor(r){super(r),this.view=null}add(r){const s=Array.isArray(r)?r:[r];null!=r&&s&&s.length&&s.forEach((r=>this._highlight(r)))}remove(r){const s=Array.isArray(r)?r:[r];null!=r&&s&&s.length&&s.forEach((r=>this._unhighlight(r)))}removeAll(){this.removeAllHandles()}_highlight(r){const s=e(this.view,r.layer);i(s)&&this.addHandles(s.highlight(r),l(r))}_unhighlight(r){r&&this.removeHandles(l(r))}};r([o()],a.prototype,"view",void 0),a=r([t("esri.views.draw.support.HighlightHelper")],a);const h=a;export{h as default};
5
+ import{_ as r}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{findLayerView as e}from"./layerUtils.js";import{highlightsSupported as i}from"../../support/layerViewUtils.js";import{getHighlightKeyForFeature as a}from"../../../widgets/Feature/support/featureUtils.js";let h=class extends s{constructor(r){super(r),this.view=null}add(r){const s=!r||Array.isArray(r)?r:[r];s?.length&&s.forEach((r=>this._highlight(r)))}remove(r){const s=!r||Array.isArray(r)?r:[r];s&&s.length&&s.forEach((r=>this._unhighlight(r)))}removeAll(){this.removeAllHandles()}_highlight(r){const s=e(this.view,r.layer);i(s)&&this.addHandles(s.highlight(r),a(r))}_unhighlight(r){r&&this.removeHandles(a(r))}};r([o()],h.prototype,"view",void 0),h=r([t("esri.views.draw.support.HighlightHelper")],h);const l=h;export{l 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.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import r from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{destroyMaybe as a,abortMaybe as h}from"../../../core/maybe.js";import{zeroMeters as p}from"../../../core/quantityUtils.js";import{when as c,pausable as l,watch as d,syncAndInitial as m}from"../../../core/reactiveUtils.js";import{createScreenPoint as v}from"../../../core/screenUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{closeRingsAndFixWinding as g,geometryToCoordinates as u,getMidpoint as f}from"../../../geometry/support/coordsUtils.js";import x from"../../../layers/GraphicsLayer.js";import G from"../../../symbols/SimpleMarkerSymbol.js";import{ViewingMode as b}from"../../ViewingMode.js";import{SnappingVisualizer2D as V}from"../../2d/interactive/SnappingVisualizer2D.js";import{cloneMove as M}from"./drawUtils.js";import w from"./GraphicMover.js";import S from"./HighlightHelper.js";import{addUniqueLayer as E}from"./layerUtils.js";import{settings as k}from"./settings.js";import{ViewEventPriorities as I}from"../../input/InputManager.js";import{sketchKeys as O}from"../../interactive/keybindings.js";import{EditGeometryOperations as C}from"../../interactive/editGeometry/EditGeometryOperations.js";import j from"../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as T}from"../../interactive/snapping/SnappingContext.js";import{Tooltip as R}from"../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as H,TranslateVertexTooltipInfo as U}from"../../interactive/tooltip/TranslateTooltipInfos.js";import{autoArea2D as A}from"../../support/automaticAreaMeasurementUtils.js";import{autoDistanceBetweenPoints2D as L,autoLength2D as F}from"../../support/automaticLengthMeasurementUtils.js";import D from"../../../geometry/Polyline.js";import z from"../../../geometry/Point.js";class P{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-start"}}class q{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape"}}class K{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-stop"}}class N{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-start"}}class B{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move"}}class J{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-stop"}}class Q{constructor(e){this.added=e,this.type="vertex-select"}}class W{constructor(e){this.removed=e,this.type="vertex-deselect"}}class X{constructor(e,t,i,s){this.added=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-add"}}class Y{constructor(e,t,i,s){this.removed=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-remove"}}const Z=k.reshapeGraphics,$={vertices:{default:new G({style:"circle",size:Z.vertex.size,color:Z.vertex.color,outline:{color:Z.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:Z.vertex.hoverSize,color:Z.vertex.hoverColor,outline:{color:Z.vertex.hoverOutlineColor,width:1}}),selected:new G({style:"circle",size:Z.selected.size,color:Z.selected.color,outline:{color:Z.selected.outlineColor,width:1}})},midpoints:{default:new G({style:"circle",size:Z.midpoint.size,color:Z.midpoint.color,outline:{color:Z.midpoint.outlineColor,width:1}}),hover:new G({style:"circle",size:Z.midpoint.size,color:Z.midpoint.color,outline:{color:Z.midpoint.outlineColor,width:1}})}};let ee=class extends r.EventedAccessor{constructor(e){super(e),this._activeOperationInfo=null,this._editGeometryOperations=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingContext=null,this._snappingTask=null,this._stagedVertex=null,this._tooltip=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new s,this.midpointSymbol=new G({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.tooltipOptions=new j,this.type="reshape",this.vertexGraphics=new s,this.view=null}initialize(){const e=this.view;this._highlightHelper=new S({view:e}),this._setup(),this.addHandles([c((()=>e?.ready),(()=>{const{layer:e,view:t}=this;E(t,e),this.addHandles(t.on("key-down",(e=>this._keyDownHandler(e)),I.TOOL))}),{once:!0,initial:!0}),l((()=>this.graphic),(()=>this.refresh())),l((()=>this.layer),((e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()})),l((()=>this.enableMidpoints),(()=>this.refresh())),d((()=>this.tooltipOptions.enabled),(e=>{this._tooltip=e?new R({view:this.view}):a(this._tooltip)}),m)])}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._tooltip=a(this._tooltip)}set highlightsEnabled(e){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",e),this._setUpHighlights()}get state(){const e=this.view.ready,t=!(!this.graphic||!this.layer);return e&&t?"active":e?"ready":"disabled"}set symbols(e){const{midpoints:t=$.midpoints,vertices:i=$.vertices}=e||{};this._set("symbols",{midpoints:t,vertices:i})}isUIGraphic(e){const t=[];return this.graphic&&t.push(this.graphic),t.concat(this.vertexGraphics.items,this.midpointGraphics.items),t.length>0&&t.includes(e)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:e,layer:t}=this;if(!t||!e||null==e.geometry)return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&g(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(null==e||"mesh"===e.type||"extent"===e.type)return void this._logGeometryTypeError();const t="multipoint"===e.type?new D({paths:e.points,spatialReference:e.spatialReference}):e;this._editGeometryOperations=C.fromGeometry(t,b.Local)}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new x({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new T({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,visualizer:new V(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=a(this._editGeometryOperations),this._snappingTask=h(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._set("selectedVertices",[])}_removeMidpointGraphics(e){const t=e||this.layer;t&&t.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach((e=>e.destroy())),this.midpointGraphics.removeAll()}_removeVertexGraphics(e){const t=e||this.layer;t&&t.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach((e=>e.destroy())),this.vertexGraphics.removeAll()}_getCoordinatesForUI(e){const t=u(e.clone());if("polygon"===e.type)for(const i of t){const e=i[i.length-1];i[0][0]===e[0]&&i[0][1]===e[1]&&i.length>2&&i.pop()}return t}_setupGraphics(){const e=this.graphic.geometry;if(null!=e&&("polyline"===e.type||"polygon"===e.type)){const t=this._getCoordinatesForUI(e);this.enableMidpoints&&this._setUpMidpointGraphics(t),this.enableVertices&&this._setUpVertexGraphics(t)}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=this._createMidpointGraphics(e);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){this._removeVertexGraphics();const t=this._createVertexGraphics(e);this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}_createVertexGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:o}}=this,r=[];return e?.forEach(((e,n)=>{e.forEach(((e,a)=>{const[h,p]=e;r.push(new t({geometry:new z({x:h,y:p,spatialReference:o}),symbol:s?.vertices?.default,attributes:{...i,pathIndex:n,pointIndex:a}}))}))})),r}_createMidpointGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:o}}=this,r=[];return e?.forEach(((e,n)=>{e.forEach(((a,h)=>{const[p,c]=a,l=e[h+1]?h+1:0;if("polygon"===this.graphic.geometry?.type||0!==l){const[a,d]=e[l],[m,v]=f([p,c],[a,d]);r.push(new t({geometry:new z({x:m,y:v,spatialReference:o}),symbol:s.midpoints.default,attributes:{...i,pathIndex:n,pointIndexStart:h,pointIndexEnd:l}}))}}))})),r}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map((({geometry:e})=>({x:e.x,y:e.y})));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const o=t[i],r=t[e];o.x===r.x&&o.y===r.y&&s.push(e)}e[i].attributes.relatedGraphicIndices=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i).items;e&&r.push(t),this._mover=new w({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic;if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(t);this.refresh(),this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t))if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)this._removeVertices(t);else{e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,o=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const{dx:t,dy:i,graphic:s}=e;if(s===this.graphic){const{geometry:o}=s;return this._setUpOperation(e),this._emitMoveStartEvent(t,i),void(null!=o&&"point"===o.type&&this._onHandleMove(s,t,i,e,(()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(t,i)})))}if(!this.selectedVertices.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),t=this._createVertexFromMidpoint(s);this._emitVertexAddEvent([s],e,t)}this._addToSelection(s)}this._setUpOperation(e),this._emitReshapeStartEvent(s),this._onHandleMove(s,t,i,e,(()=>{this._updateTooltip(s,e.viewEvent),this._emitReshapeEvent(s)}))}_onGraphicMoveCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e;t.totalDx+=i,t.totalDy+=s;const{operationType:r}=t,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,e,(()=>{this._updateTooltip(o,e.viewEvent),this._emitReshapeEvent(o)}));else if("point"===n.type)this._onHandleMove(o,i,s,e,(()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}));else if("polyline"===n.type||"polygon"===n.type){const t=this._getCoordinatesForUI(n);this._updateVertexGraphicLocations(t),this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}}_onGraphicMoveStopCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e,{operationType:r}=t;t.totalDx+=i,t.totalDy+=s,this._onHandleMove(o,i,s,e,(()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o))),this._isMidpoint(o)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(e){const t=this.view.spatialReference;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes,[r,n]=e[s][o];i.geometry=new z({x:r,y:n,spatialReference:t})}this._updateMidpointGraphicLocations(e)}_updateMidpointGraphicLocations(e){for(const t of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:o}=t.attributes,[r,n]=e[i][s],[a,h]=e[i][o],[p,c]=f([r,n],[a,h]);t.geometry=new z({x:p,y:c,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:e}){return[e?.pathIndex||0,e?.pointIndex||0]}_getVertexFromEditGeometry(e){const[t,i]=this._getIndicesForVertexGraphic(e);return this._editGeometryOperations.data.components[t].vertices[i]}_onHandleMove(e,t,s,o,r){h(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=e.geometry,p="graphic-move-stop"===o.type;if(null!=this.snappingManager&&this.selectedVertices.length<2&&!p){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(e,new z(this._stagedVertex),t,s,p),r(),this._snappingTask=i((async i=>{const h=await o.snap({point:a,context:n,signal:i});h.valid&&(this._stagedVertex=h.apply(),this._syncGeometryAfterVertexMove(e,new z(this._stagedVertex),t,s,p),r())}))}else{const i=null!=this._stagedVertex?new z(this._stagedVertex):a;this._syncGeometryAfterVertexMove(e,i,t,s,p),r()}}async _syncGeometryAfterVertexMove(e,t,i,s,o=!1){const r=this._editGeometryOperations.data.geometry;if("point"===r.type)e.geometry=t;else if("mesh"===r.type)e.geometry=r.centerAt(t),e.notifyGeometryChanged();else{const{x:n,y:a}=t,[h,p]=this._getIndicesForVertexGraphic(e);let c=u(r);const l=c[h].length-1;c[h][p]=[n,a],"polygon"===r.type&&(0===p?c[h][l]=[n,a]:p===l&&(c[h][0]=[n,a])),this._isVertex(e)&&(c=this._moveRelatedCoordinates(c,e,n,a),c=this._moveSelectedHandleCoordinates(c,e,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(c)),this.graphic.geometry=r.clone();const d=this._getVertexFromEditGeometry(e),m=n-d.pos[0],v=a-d.pos[1];this._editGeometryOperations.moveVertices([d],m,v,0),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_moveRelatedCoordinates(e,t,i,s){const{relatedGraphicIndices:o}=t.attributes;for(const r of o){const o=this.vertexGraphics.at(r),{pathIndex:n,pointIndex:a}=o.attributes;e[n][a]=[i,s],o.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,o){for(const r of this.selectedVertices)if(r!==t){const{pathIndex:t,pointIndex:n,relatedGraphicIndices:a}=r.attributes,h=M(r.geometry,i,s,this.view),p=e[t].length-1;e[t][n]=[h.x,h.y],r.geometry=h,o&&(0===n?e[t][p]=[h.x,h.y]:n===p&&(e[t][0]=[h.x,h.y]));for(const i of a){const t=this.vertexGraphics.at(i),{pathIndex:s,pointIndex:o}=t.attributes;e[s][o]=[h.x,h.y],t.geometry=h}}return e}_onGraphicPointerOverCallback(e){const t=e.graphic,i=this._isVertex(t);i&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.hover),this._updateTooltip(i?t:null),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this.view.cursor="default",this._updateTooltip()}_createVertexFromMidpoint(e){const{_graphicAttributes:t,graphic:i}=this,s=i.geometry;if(null==s||"polygon"!==s.type&&"polyline"!==s.type)return[];const o=s.clone(),r=[],{pathIndex:n,pointIndexStart:a,pointIndexEnd:h}=e.attributes,{x:p,y:c}=e.geometry,l=0===h?a+1:h,d=u(o);return d[n].splice(l,0,[p,c]),e.attributes={...t,pathIndex:n,pointIndex:l,relatedGraphicIndices:[]},r.push({coordinates:d[n][l],componentIndex:n,vertexIndex:l}),this.graphic.geometry=o,r}_addToSelection(e){e instanceof t&&(e=[e]);for(const t of e)t.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(e)),this._emitSelectEvent(e)}_removeFromSelection(e,i){const{vertices:s}=this.symbols,o=i?s.hover:s.default;e instanceof t&&(e=[e]);for(const t of e)this.selectedVertices.splice(this.selectedVertices.indexOf(t),1),this._set("selectedVertices",this.selectedVertices),t.set("symbol",o);this._emitDeselectEvent(e)}_clearSelection(){if(this.selectedVertices.length){const e=this.selectedVertices;for(const t of this.selectedVertices)t.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(e)}}_keyDownHandler(e){O.delete.includes(e.key)&&!e.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(e){const i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return;if("polygon"===i.type&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;e instanceof t&&(e=[e]);const s=this.graphic.clone(),o=i.clone();let r=u(o);const n=[];e instanceof t&&(e=[e]);for(const t of e){const{x:e,y:i}=t.geometry;for(let t=0;t<r.length;t++){const s=r[t];for(let o=0;o<s.length;o++){const[a,h]=s[o];e===a&&i===h&&(n.push({coordinates:r[t][o],componentIndex:t,vertexIndex:o}),r[t].splice(Number(o),1))}}}if("polygon"===o.type)r=r.filter((e=>{if(e.length<2)return!1;const[t,i]=e[0],[s,o]=e[e.length-1];return(2!==e.length||t!==s||i!==o)&&(t===s&&i===o||e.push(e[0]),!0)})),o.rings=r;else{for(const e of r)1===e.length&&r.splice(r.indexOf(e),1);o.paths=r}this.graphic.geometry=o,this.refresh(),this._emitVertexRemoveEvent(e,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isSelected(e){return this._isVertex(e)&&this.selectedVertices.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){this.view.cursor=this._isMidpoint(e)?"copy":"move"}_updateTooltip(e,t){null!=this._tooltip&&(e?e===this.graphic?this._updateMoveGraphicTooltip(t):this._updateMoveVertexTooltip(t):this._tooltip.clear())}_updateMoveGraphicTooltip(e){const{_tooltip:t,tooltipOptions:i,view:s}=this;if(null==t)return;const o=new H({tooltipOptions:i});if(e){const{x:t,y:i}=e.origin,r=s.toMap(e),n=s.toMap(v(t,i)),a=L(n,r);o.distance=null!=a?a:p}t.info=o}_updateMoveVertexTooltip(e){const{_tooltip:t,graphic:{geometry:i},tooltipOptions:s,view:o}=this;if(null==t)return;const r=new U({tooltipOptions:s});if(null!=i&&("polygon"===i.type?r.area=A(i):"polyline"===i.type&&(r.totalLength=F(i))),e){const{x:t,y:i}=e.origin,s=o.toMap(e),n=o.toMap(v(t,i)),a=L(n,s);r.distance=null!=a?a:p}t.info=r}_emitMoveStartEvent(e,t){const i=new N(this.graphic,e,t);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(e,t){const i=new B(this.graphic,e,t);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const e=this._activeOperationInfo;if(!e)return;const{totalDx:t,totalDy:i}=e,s=new J(this.graphic,t,i);this.emit("move-stop",s),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(s)}_emitReshapeStartEvent(e){const t=new P(this.graphic,e,this.selectedVertices);this.emit("reshape-start",t),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(t)}_emitReshapeEvent(e){const t=new q(this.graphic,e,this.selectedVertices);this.emit("reshape",t),this.callbacks.onReshape&&this.callbacks.onReshape(t)}_emitReshapeStopEvent(e){const t=new K(this.graphic,e,this.selectedVertices);this.emit("reshape-stop",t),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(t)}_emitSelectEvent(e){const t=new Q(e);this.emit("select",t),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(t)}_emitDeselectEvent(e){const t=new W(e);this.emit("deselect",t),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(t)}_emitVertexAddEvent(e,t,i){const s=new X(e,this.graphic,t,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(e,t,i){const s=new Y(e,this.graphic,t,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};e([y()],ee.prototype,"_tooltip",void 0),e([y()],ee.prototype,"callbacks",void 0),e([y()],ee.prototype,"enableMidpoints",void 0),e([y()],ee.prototype,"enableMovement",void 0),e([y()],ee.prototype,"enableVertices",void 0),e([y()],ee.prototype,"graphic",void 0),e([y({value:!0})],ee.prototype,"highlightsEnabled",null),e([y()],ee.prototype,"layer",void 0),e([y({readOnly:!0})],ee.prototype,"midpointGraphics",void 0),e([y()],ee.prototype,"midpointSymbol",void 0),e([y({readOnly:!0})],ee.prototype,"selectedVertices",void 0),e([y()],ee.prototype,"snappingManager",void 0),e([y({readOnly:!0})],ee.prototype,"state",null),e([y({value:$})],ee.prototype,"symbols",null),e([y({type:j})],ee.prototype,"tooltipOptions",void 0),e([y({readOnly:!0})],ee.prototype,"type",void 0),e([y({readOnly:!0})],ee.prototype,"vertexGraphics",void 0),e([y()],ee.prototype,"view",void 0),ee=e([_("esri.views.draw.support.Reshape")],ee);const te=ee;export{te as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import r from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{destroyMaybe as a,abortMaybe as p}from"../../../core/maybe.js";import{zeroMeters as h}from"../../../core/quantityUtils.js";import{when as c,pausable as l,watch as d,syncAndInitial as m}from"../../../core/reactiveUtils.js";import{createScreenPoint as v}from"../../../core/screenUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{closeRingsAndFixWinding as g,geometryToCoordinates as u,getMidpoint as f}from"../../../geometry/support/coordsUtils.js";import x from"../../../layers/GraphicsLayer.js";import G from"../../../symbols/SimpleMarkerSymbol.js";import{ViewingMode as b}from"../../ViewingMode.js";import{SnappingVisualizer2D as V}from"../../2d/interactive/SnappingVisualizer2D.js";import{cloneMove as M}from"./drawUtils.js";import w from"./GraphicMover.js";import S from"./HighlightHelper.js";import{addUniqueLayer as E}from"./layerUtils.js";import{settings as k}from"./settings.js";import{ViewEventPriorities as I}from"../../input/InputManager.js";import{sketchKeys as O}from"../../interactive/keybindings.js";import{EditGeometryOperations as T}from"../../interactive/editGeometry/EditGeometryOperations.js";import C from"../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as j}from"../../interactive/snapping/SnappingContext.js";import{Tooltip as R}from"../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as H,TranslateVertexTooltipInfo as U}from"../../interactive/tooltip/TranslateTooltipInfos.js";import{autoArea2D as A}from"../../support/automaticAreaMeasurementUtils.js";import{autoDistanceBetweenPoints2D as L,autoLength2D as F}from"../../support/automaticLengthMeasurementUtils.js";import D from"../../../geometry/Polyline.js";import z from"../../../geometry/Point.js";class P{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-start"}}class q{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape"}}class K{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-stop"}}class N{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-start"}}class B{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move"}}class J{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-stop"}}class Q{constructor(e){this.added=e,this.type="vertex-select"}}class W{constructor(e){this.removed=e,this.type="vertex-deselect"}}class X{constructor(e,t,i,s){this.added=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-add"}}class Y{constructor(e,t,i,s){this.removed=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-remove"}}const Z=k.reshapeGraphics,$={vertices:{default:new G({style:"circle",size:Z.vertex.size,color:Z.vertex.color,outline:{color:Z.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:Z.vertex.hoverSize,color:Z.vertex.hoverColor,outline:{color:Z.vertex.hoverOutlineColor,width:1}}),selected:new G({style:"circle",size:Z.selected.size,color:Z.selected.color,outline:{color:Z.selected.outlineColor,width:1}})},midpoints:{default:new G({style:"circle",size:Z.midpoint.size,color:Z.midpoint.color,outline:{color:Z.midpoint.outlineColor,width:1}}),hover:new G({style:"circle",size:Z.midpoint.size,color:Z.midpoint.color,outline:{color:Z.midpoint.outlineColor,width:1}})}};let ee=class extends r.EventedAccessor{constructor(e){super(e),this._activeOperationInfo=null,this._editGeometryOperations=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingContext=null,this._snappingTask=null,this._stagedVertex=null,this._tooltip=null,this._translateGraphicTooltipInfo=null,this._translateVertexTooltipInfo=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new s,this.midpointSymbol=new G({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.tooltipOptions=new C,this.type="reshape",this.vertexGraphics=new s,this.view=null}initialize(){const e=this.view;this._highlightHelper=new S({view:e}),this._setup(),this.addHandles([c((()=>e?.ready),(()=>{const{layer:e,view:t}=this;E(t,e),this.addHandles(t.on("key-down",(e=>this._keyDownHandler(e)),I.TOOL))}),{once:!0,initial:!0}),l((()=>this.graphic),(()=>this.refresh())),l((()=>this.layer),((e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()})),l((()=>this.enableMidpoints),(()=>this.refresh())),d((()=>this.tooltipOptions.enabled),(e=>{this._tooltip=e?new R({view:this.view}):a(this._tooltip)}),m)])}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._tooltip=a(this._tooltip)}set highlightsEnabled(e){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",e),this._setUpHighlights()}get state(){const e=this.view.ready,t=!(!this.graphic||!this.layer);return e&&t?"active":e?"ready":"disabled"}set symbols(e){const{midpoints:t=$.midpoints,vertices:i=$.vertices}=e||{};this._set("symbols",{midpoints:t,vertices:i})}isUIGraphic(e){const t=[];return this.graphic&&t.push(this.graphic),t.concat(this.vertexGraphics.items,this.midpointGraphics.items),t.length>0&&t.includes(e)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:e,layer:t}=this;if(!t||!e||null==e.geometry)return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&g(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(null==e||"mesh"===e.type||"extent"===e.type)return void this._logGeometryTypeError();const t="multipoint"===e.type?new D({paths:e.points,spatialReference:e.spatialReference}):e;this._editGeometryOperations=T.fromGeometry(t,b.Local)}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new x({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new j({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,visualizer:new V(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=a(this._editGeometryOperations),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._set("selectedVertices",[])}_removeMidpointGraphics(e){const t=e||this.layer;t&&t.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach((e=>e.destroy())),this.midpointGraphics.removeAll()}_removeVertexGraphics(e){const t=e||this.layer;t&&t.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach((e=>e.destroy())),this.vertexGraphics.removeAll()}_getCoordinatesForUI(e){const t=u(e.clone());if("polygon"===e.type)for(const i of t){const e=i[i.length-1];i[0][0]===e[0]&&i[0][1]===e[1]&&i.length>2&&i.pop()}return t}_setupGraphics(){const e=this.graphic.geometry;if(null!=e&&("polyline"===e.type||"polygon"===e.type)){const t=this._getCoordinatesForUI(e);this.enableMidpoints&&this._setUpMidpointGraphics(t),this.enableVertices&&this._setUpVertexGraphics(t)}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=this._createMidpointGraphics(e);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){this._removeVertexGraphics();const t=this._createVertexGraphics(e);this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}_createVertexGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:o}}=this,r=[];return e?.forEach(((e,n)=>{e.forEach(((e,a)=>{const[p,h]=e;r.push(new t({geometry:new z({x:p,y:h,spatialReference:o}),symbol:s?.vertices?.default,attributes:{...i,pathIndex:n,pointIndex:a}}))}))})),r}_createMidpointGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:o}}=this,r=[];return e?.forEach(((e,n)=>{e.forEach(((a,p)=>{const[h,c]=a,l=e[p+1]?p+1:0;if("polygon"===this.graphic.geometry?.type||0!==l){const[a,d]=e[l],[m,v]=f([h,c],[a,d]);r.push(new t({geometry:new z({x:m,y:v,spatialReference:o}),symbol:s.midpoints.default,attributes:{...i,pathIndex:n,pointIndexStart:p,pointIndexEnd:l}}))}}))})),r}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map((({geometry:e})=>({x:e.x,y:e.y})));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const o=t[i],r=t[e];o.x===r.x&&o.y===r.y&&s.push(e)}e[i].attributes.relatedGraphicIndices=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i).items;e&&r.push(t),this._mover=new w({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic;if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(t);this.refresh(),this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t))if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)this._removeVertices(t);else{e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,o=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const{dx:t,dy:i,graphic:s}=e;if(s===this.graphic){const{geometry:o}=s;return this._setUpOperation(e),this._emitMoveStartEvent(t,i),void(null!=o&&"point"===o.type&&this._onHandleMove(s,t,i,e,(()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(t,i)})))}if(!this.selectedVertices.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),t=this._createVertexFromMidpoint(s);this._emitVertexAddEvent([s],e,t)}this._addToSelection(s)}this._setUpOperation(e),this._emitReshapeStartEvent(s),this._onHandleMove(s,t,i,e,(()=>{this._updateTooltip(s,e.viewEvent),this._emitReshapeEvent(s)}))}_onGraphicMoveCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e;t.totalDx+=i,t.totalDy+=s;const{operationType:r}=t,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,e,(()=>{this._updateTooltip(o,e.viewEvent),this._emitReshapeEvent(o)}));else if("point"===n.type)this._onHandleMove(o,i,s,e,(()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}));else if("polyline"===n.type||"polygon"===n.type){const t=this._getCoordinatesForUI(n);this._updateVertexGraphicLocations(t),this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}}_onGraphicMoveStopCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e,{operationType:r}=t;t.totalDx+=i,t.totalDy+=s,this._onHandleMove(o,i,s,e,(()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o))),this._isMidpoint(o)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(e){const t=this.view.spatialReference;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes,[r,n]=e[s][o];i.geometry=new z({x:r,y:n,spatialReference:t})}this._updateMidpointGraphicLocations(e)}_updateMidpointGraphicLocations(e){for(const t of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:o}=t.attributes,[r,n]=e[i][s],[a,p]=e[i][o],[h,c]=f([r,n],[a,p]);t.geometry=new z({x:h,y:c,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:e}){return[e?.pathIndex||0,e?.pointIndex||0]}_getVertexFromEditGeometry(e){const[t,i]=this._getIndicesForVertexGraphic(e);return this._editGeometryOperations.data.components[t].vertices[i]}_onHandleMove(e,t,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=e.geometry,h="graphic-move-stop"===o.type;if(null!=this.snappingManager&&this.selectedVertices.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(e,new z(this._stagedVertex),t,s,h),r(),this._snappingTask=i((async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(e,new z(this._stagedVertex),t,s,h),r())}))}else{const i=null!=this._stagedVertex?new z(this._stagedVertex):a;this._syncGeometryAfterVertexMove(e,i,t,s,h),r()}}async _syncGeometryAfterVertexMove(e,t,i,s,o=!1){const r=this._editGeometryOperations.data.geometry;if("point"===r.type)e.geometry=t;else if("mesh"===r.type)e.geometry=r.centerAt(t),e.notifyGeometryChanged();else{const{x:n,y:a}=t,[p,h]=this._getIndicesForVertexGraphic(e);let c=u(r);const l=c[p].length-1;c[p][h]=[n,a],"polygon"===r.type&&(0===h?c[p][l]=[n,a]:h===l&&(c[p][0]=[n,a])),this._isVertex(e)&&(c=this._moveRelatedCoordinates(c,e,n,a),c=this._moveSelectedHandleCoordinates(c,e,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(c)),this.graphic.geometry=r.clone();const d=this._getVertexFromEditGeometry(e),m=n-d.pos[0],v=a-d.pos[1];this._editGeometryOperations.moveVertices([d],m,v,0),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_moveRelatedCoordinates(e,t,i,s){const{relatedGraphicIndices:o}=t.attributes;for(const r of o){const o=this.vertexGraphics.at(r),{pathIndex:n,pointIndex:a}=o.attributes;e[n][a]=[i,s],o.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,o){for(const r of this.selectedVertices)if(r!==t){const{pathIndex:t,pointIndex:n,relatedGraphicIndices:a}=r.attributes,p=M(r.geometry,i,s,this.view),h=e[t].length-1;e[t][n]=[p.x,p.y],r.geometry=p,o&&(0===n?e[t][h]=[p.x,p.y]:n===h&&(e[t][0]=[p.x,p.y]));for(const i of a){const t=this.vertexGraphics.at(i),{pathIndex:s,pointIndex:o}=t.attributes;e[s][o]=[p.x,p.y],t.geometry=p}}return e}_onGraphicPointerOverCallback(e){const t=e.graphic,i=this._isVertex(t);i&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.hover),this._updateTooltip(i?t:null),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this.view.cursor="default",this._updateTooltip()}_createVertexFromMidpoint(e){const{_graphicAttributes:t,graphic:i}=this,s=i.geometry;if(null==s||"polygon"!==s.type&&"polyline"!==s.type)return[];const o=s.clone(),r=[],{pathIndex:n,pointIndexStart:a,pointIndexEnd:p}=e.attributes,{x:h,y:c}=e.geometry,l=0===p?a+1:p,d=u(o);return d[n].splice(l,0,[h,c]),e.attributes={...t,pathIndex:n,pointIndex:l,relatedGraphicIndices:[]},r.push({coordinates:d[n][l],componentIndex:n,vertexIndex:l}),this.graphic.geometry=o,r}_addToSelection(e){e instanceof t&&(e=[e]);for(const t of e)t.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(e)),this._emitSelectEvent(e)}_removeFromSelection(e,i){const{vertices:s}=this.symbols,o=i?s.hover:s.default;e instanceof t&&(e=[e]);for(const t of e)this.selectedVertices.splice(this.selectedVertices.indexOf(t),1),this._set("selectedVertices",this.selectedVertices),t.set("symbol",o);this._emitDeselectEvent(e)}_clearSelection(){if(this.selectedVertices.length){const e=this.selectedVertices;for(const t of this.selectedVertices)t.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(e)}}_keyDownHandler(e){O.delete.includes(e.key)&&!e.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(e){const i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return;if("polygon"===i.type&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;e instanceof t&&(e=[e]);const s=this.graphic.clone(),o=i.clone();let r=u(o);const n=[];e instanceof t&&(e=[e]);for(const t of e){const{x:e,y:i}=t.geometry;for(let t=0;t<r.length;t++){const s=r[t];for(let o=0;o<s.length;o++){const[a,p]=s[o];e===a&&i===p&&(n.push({coordinates:r[t][o],componentIndex:t,vertexIndex:o}),r[t].splice(Number(o),1))}}}if("polygon"===o.type)r=r.filter((e=>{if(e.length<2)return!1;const[t,i]=e[0],[s,o]=e[e.length-1];return(2!==e.length||t!==s||i!==o)&&(t===s&&i===o||e.push(e[0]),!0)})),o.rings=r;else{for(const e of r)1===e.length&&r.splice(r.indexOf(e),1);o.paths=r}this.graphic.geometry=o,this.refresh(),this._emitVertexRemoveEvent(e,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isSelected(e){return this._isVertex(e)&&this.selectedVertices.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){this.view.cursor=this._isMidpoint(e)?"copy":"move"}_updateTooltip(e,t){null!=this._tooltip&&(e?e===this.graphic?this._updateMoveGraphicTooltip(t):this._updateMoveVertexTooltip(t):this._tooltip.clear())}_updateMoveGraphicTooltip(e){const{_tooltip:t,tooltipOptions:i,view:s}=this;if(null==t)return;const o=this._translateGraphicTooltipInfo??=new H({tooltipOptions:i});if(o.clear(),o.tooltipOptions=i,e){const{x:t,y:i}=e.origin,r=s.toMap(e),n=s.toMap(v(t,i)),a=L(n,r);o.distance=null!=a?a:h}t.info=o}_updateMoveVertexTooltip(e){const{_tooltip:t,graphic:{geometry:i},tooltipOptions:s,view:o}=this;if(null==t)return;const r=this._translateVertexTooltipInfo??=new U({tooltipOptions:s});if(r.clear(),r.tooltipOptions=s,"polygon"===i?.type?r.area=A(i):"polyline"===i?.type&&(r.totalLength=F(i)),e){const{x:t,y:i}=e.origin,s=o.toMap(e),n=o.toMap(v(t,i)),a=L(n,s);r.distance=null!=a?a:h}t.info=r}_emitMoveStartEvent(e,t){const i=new N(this.graphic,e,t);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(e,t){const i=new B(this.graphic,e,t);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const e=this._activeOperationInfo;if(!e)return;const{totalDx:t,totalDy:i}=e,s=new J(this.graphic,t,i);this.emit("move-stop",s),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(s)}_emitReshapeStartEvent(e){const t=new P(this.graphic,e,this.selectedVertices);this.emit("reshape-start",t),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(t)}_emitReshapeEvent(e){const t=new q(this.graphic,e,this.selectedVertices);this.emit("reshape",t),this.callbacks.onReshape&&this.callbacks.onReshape(t)}_emitReshapeStopEvent(e){const t=new K(this.graphic,e,this.selectedVertices);this.emit("reshape-stop",t),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(t)}_emitSelectEvent(e){const t=new Q(e);this.emit("select",t),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(t)}_emitDeselectEvent(e){const t=new W(e);this.emit("deselect",t),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(t)}_emitVertexAddEvent(e,t,i){const s=new X(e,this.graphic,t,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(e,t,i){const s=new Y(e,this.graphic,t,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};e([y()],ee.prototype,"_tooltip",void 0),e([y()],ee.prototype,"_translateGraphicTooltipInfo",void 0),e([y()],ee.prototype,"_translateVertexTooltipInfo",void 0),e([y()],ee.prototype,"callbacks",void 0),e([y()],ee.prototype,"enableMidpoints",void 0),e([y()],ee.prototype,"enableMovement",void 0),e([y()],ee.prototype,"enableVertices",void 0),e([y()],ee.prototype,"graphic",void 0),e([y({value:!0})],ee.prototype,"highlightsEnabled",null),e([y()],ee.prototype,"layer",void 0),e([y({readOnly:!0})],ee.prototype,"midpointGraphics",void 0),e([y()],ee.prototype,"midpointSymbol",void 0),e([y({readOnly:!0})],ee.prototype,"selectedVertices",void 0),e([y()],ee.prototype,"snappingManager",void 0),e([y({readOnly:!0})],ee.prototype,"state",null),e([y({value:$})],ee.prototype,"symbols",null),e([y({type:C})],ee.prototype,"tooltipOptions",void 0),e([y({readOnly:!0})],ee.prototype,"type",void 0),e([y({readOnly:!0})],ee.prototype,"vertexGraphics",void 0),e([y()],ee.prototype,"view",void 0),ee=e([_("esri.views.draw.support.Reshape")],ee);const te=ee;export{te 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.28/esri/copyright.txt for details.
4
4
  */
5
- function r(r,e,n){if(!e||!r||!r.map)return;const{map:l}=r,s=l.layers.find((r=>r===e));s||l.add(e,n),s&&null!=n&&l.layers.reorder(s,n)}function e(r,e){return r.allLayerViews.find((r=>{const n=r.layer;return n===e||"sublayers"in n&&null!=n.sublayers&&n.sublayers.includes(e)}))}export{r as addUniqueLayer,e as findLayerView};
5
+ function e(e,r,n){if(!r||!e||!e.map)return;const{map:s}=e,l=s.layers.find((e=>e===r));l||s.add(r,n),l&&null!=n&&s.layers.reorder(l,n)}function r(e,r){const n="subtype-sublayer"===r?.type?r.parent:r;return e.allLayerViews.find((e=>{const r=e.layer;return r===n||"sublayers"in r&&null!=r.sublayers&&r.sublayers.includes(n)}))}export{e as addUniqueLayer,r as findLayerView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{multiplyOpacity as o,getContrast as r}from"../../core/colorUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import{formatLength as a}from"../../core/quantityFormatUtils.js";import{watch as l,on as c}from"../../core/reactiveUtils.js";import{createScreenPointArray as p}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{k as m,s as u,e as f,a as b,l as g,i as x}from"../../chunks/vec2.js";import{a as _}from"../../chunks/vec2f64.js";import{G as y}from"../../chunks/vec3.js";import{isClockwise as v}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as j}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as U}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as I}from"../../support/getDefaultUnitForView.js";import L from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as D}from"../support/automaticLengthMeasurementUtils.js";const w=3025,O={default:15,far:25};let S=class extends t{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const e=s((async e=>{const t=await j("esri/core/t9n/Units");n(e),this._messagesUnits=t}));this.addHandles([l((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((e=>c((()=>this.context?.editGeometryOperations),e,(()=>this._update())))),i((()=>e.abort()))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((e=>e.label.text))}}get _edgeDistancePixels(){return O[this.edgeDistance]}_update(){this._nextLabelIndex=0;const e=this.context;if(null==e)return void this._destroyUnusedLabels();const{components:t,geometry:s,coordinateHelper:o}=e.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const r=t.length;for(let i=0;i<r;++i){const n=[];if(t[i].iterateVertices((e=>{n.push(o.toXYZ(e.pos))})),0===i&&null!=this.stagedVertex&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const a=n[0],l=n[n.length-1];"polygon"===s.type&&n.length>2&&!y(a,l)&&n.push(a);const c=1===r&&!v(n);let p=k,h=P;this.toScreenPointArray(e,a,p);for(let t=1;t<n.length;++t){const s=n[t-1],o=n[t];this.toScreenPointArray(e,o,h),this._addLabel(e,s,p,o,h,c),[p,h]=[h,p]}}this._destroyUnusedLabels()}_addLabel(e,t,s,o,r,i){const{label:n}=this._getOrCreateLabel(e);if(!this.visible||m(s,r)<w)return void(n.visible=!1);const l=null!=e.graphicState?e.graphicState.isDraped?"on-the-ground":"absolute-height":U(e.editGeometryOperations.data.geometry,e.elevationInfo),{spatialReference:c}=e.editGeometryOperations.data,p=D(t,o,c,l),h=this._messagesUnits,d=I(e.view);n.text=null!=h&&null!=p?a(h,p,d):"",n.visible=!0;const _=r[0]-s[0],y=r[1]-s[1];i?u(C,-y,_):u(C,y,-_),f(C,C),b(C,C,this._edgeDistancePixels),g(V,s,r,.5),x(V,V,C),n.position=[V[0],V[1]],Math.abs(C[0])>Math.abs(C[1])?n.anchor=C[0]>0?"left":"right":n.anchor=-C[1]<0?"top":"bottom"}_getOrCreateLabel(e){if(this._labelInfos.length>this._nextLabelIndex)return this._labelInfos[this._nextLabelIndex++];const{textColor:t}=e.view.effectiveTheme,s=o(r(t),.6),i=new L({anchor:"center",fontSize:10,textColor:t,backgroundColor:s});e.view.overlay?.items.add(i);const n={label:i};return this._labelInfos.push(n),this._nextLabelIndex=this._labelInfos.length,n}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:e}){this.context?.view.overlay?.items.remove(e),e.destroy()}};e([h()],S.prototype,"context",void 0),e([h()],S.prototype,"stagedVertex",void 0),e([h()],S.prototype,"visible",void 0),e([h()],S.prototype,"edgeDistance",void 0),e([h()],S.prototype,"updating",null),e([h()],S.prototype,"_messagesUnits",void 0),e([h()],S.prototype,"_edgeDistancePixels",null),S=e([d("esri.views.interactive")],S);const C=_(),V=_(),k=p(),P=p();export{S as SegmentLabels};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import s from"../../core/Accessor.js";import{createTask as o}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i}from"../../core/colorUtils.js";import{makeHandle as n}from"../../core/handleUtils.js";import{throwIfAborted as l}from"../../core/promiseUtils.js";import{formatLength as a}from"../../core/quantityFormatUtils.js";import{watch as c,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as h}from"../../core/screenUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{k as u,s as b,e as f,a as g,l as x,i as _}from"../../chunks/vec2.js";import{a as y}from"../../chunks/vec2f64.js";import{G as v}from"../../chunks/vec3.js";import{isClockwise as j}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as I}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as U}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as L}from"../../support/getDefaultUnitForView.js";import C from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as k}from"../support/automaticLengthMeasurementUtils.js";const S=3025,D={default:15,far:25};let w=class extends s{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const t=o((async t=>{const e=await I("esri/core/t9n/Units");l(t),this._messagesUnits=e}));this.addHandles([c((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((t=>p((()=>this.context?.editGeometryOperations),t,(()=>this._update())))),n((()=>t.abort())),c((()=>this._colors),(t=>this._updateStyle(t)))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((t=>t.label.text))}}get _edgeDistancePixels(){return D[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t),.6)}}_update(){this._nextLabelIndex=0;const t=this.context;if(null==t)return void this._destroyUnusedLabels();const{components:e,geometry:s,coordinateHelper:o}=t.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const r=e.length;for(let i=0;i<r;++i){const n=[];if(e[i].iterateVertices((t=>{n.push(o.toXYZ(t.pos))})),0===i&&null!=this.stagedVertex&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const l=n[0],a=n[n.length-1];"polygon"===s.type&&n.length>2&&!v(l,a)&&n.push(l);const c=1===r&&!j(n);let p=P,h=G;this.toScreenPointArray(t,l,p);for(let e=1;e<n.length;++e){const s=n[e-1],o=n[e];this.toScreenPointArray(t,o,h),this._addLabel(t,s,p,o,h,c),[p,h]=[h,p]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||u(s,r)<S)return void(n.visible=!1);const l=null!=t.graphicState?t.graphicState.isDraped?"on-the-ground":"absolute-height":U(t.editGeometryOperations.data.geometry,t.elevationInfo),{spatialReference:c}=t.editGeometryOperations.data,p=k(e,o,c,l),h=this._messagesUnits,d=L(t.view);n.text=null!=h&&null!=p?a(h,p,d):"",n.visible=!0;const m=r[0]-s[0],y=r[1]-s[1];i?b(O,-y,m):b(O,y,-m),f(O,O),g(O,O,this._edgeDistancePixels),x(V,s,r,.5),_(V,V,O),n.position=[V[0],V[1]],Math.abs(O[0])>Math.abs(O[1])?n.anchor=O[0]>0?"left":"right":n.anchor=-O[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new C({anchor:"center",fontSize:10,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}};t([d()],w.prototype,"context",void 0),t([d()],w.prototype,"stagedVertex",void 0),t([d()],w.prototype,"visible",void 0),t([d()],w.prototype,"edgeDistance",void 0),t([d()],w.prototype,"updating",null),t([d()],w.prototype,"_messagesUnits",void 0),t([d()],w.prototype,"_edgeDistancePixels",null),t([d()],w.prototype,"_colors",null),w=t([m("esri.views.interactive")],w);const O=y(),V=y(),P=h(),G=h();export{w as SegmentLabels};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- const e={redo:"r",undo:"z",center:"Alt",constraint:"Shift",cancel:"Escape",delete:["Backspace","Delete"],complete:"Enter",vertexAdd:"f",pan:" "},t={toggle:"Control"},c={commit:"Enter",discard:"Escape",next:"Tab"};export{e as sketchKeys,t as snappingKeys,c as tooltipKeys};
5
+ const e={redo:"r",undo:"z",center:"Alt",constraint:"Shift",cancel:"Escape",delete:["Backspace","Delete"],complete:"Enter",vertexAdd:"f",pan:" "},t={toggle:"Control"},n={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"};export{e as sketchKeys,t as snappingKeys,n as tooltipKeys};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import o from"../../../core/Evented.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends o.EventedAccessor{constructor(e){super(e),this._mode="feedback",this.helpMessage=void 0,this.viewType=void 0}get mode(){return this._mode}get allFields(){return[]}enterInputMode(){this._mode="input",this.emit("focus")}exitInputMode(){this._mode="feedback"}unlockAllFields(){this.allFields.forEach((e=>e.unlock()))}};e([t()],r.prototype,"tooltipOptions",void 0),e([t()],r.prototype,"_mode",void 0),e([t()],r.prototype,"mode",null),e([t()],r.prototype,"helpMessage",void 0),e([t()],r.prototype,"viewType",void 0),e([t()],r.prototype,"allFields",null),r=e([s("esri.views.interactive.tooltip.SketchTooltipInfo")],r);export{r as SketchTooltipInfo};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import o from"../../../core/Evented.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";let s=class extends o.EventedAccessor{constructor(e){super(e),this._mode="feedback",this.helpMessage=void 0,this.viewType=void 0}get mode(){return this._mode}get allFields(){return[]}get editableFields(){return this.allFields.filter((e=>!e.readOnly))}enterInputMode(){this._mode="input",this.emit("focus")}exitInputMode(){this._mode="feedback"}unlockAllFields(){this.allFields.forEach((e=>e.unlock()))}};e([t()],s.prototype,"tooltipOptions",void 0),e([t()],s.prototype,"_mode",void 0),e([t()],s.prototype,"mode",null),e([t()],s.prototype,"helpMessage",void 0),e([t()],s.prototype,"viewType",void 0),e([t()],s.prototype,"allFields",null),e([t()],s.prototype,"editableFields",null),s=e([r("esri.views.interactive.tooltip.SketchTooltipInfo")],s);export{s as SketchTooltipInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{helpMessage as t,table as e,contentHeader as s,content as n,contentInputMode as o}from"./css.js";import{classes as l}from"../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../widgets/support/jsxFactory.js";function a({className:a,helpMessage:r,mode:c,onDiscard:p,onkeydown:d},...u){const m=u.filter((t=>!!t));return i("div",{class:l(a,n,"input"===c&&o),onkeydown:d},"input"===c?i("div",{key:"tooltip-content-header",class:s},i("calcite-button",{appearance:"transparent",iconFlipRtl:"both",iconStart:"chevron-left",kind:"neutral",onclick:p,scale:"s",tabIndex:-1})):null,m.length>0?i("div",{class:e},...m):null,r?i("div",{key:"help-message",class:t},r):null)}export{a as TooltipContentWithHelpMessage};
5
+ import{isSome as t}from"../../../core/arrayUtils.js";import{helpMessage as e,table as s,contentHeader as o,content as n,contentInputMode as l}from"./css.js";import{classes as r}from"../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../widgets/support/jsxFactory.js";function a({className:a,helpMessage:c,mode:p,onDiscard:d,onkeydown:m},...u){const f=u.flat().filter(t);return i("div",{class:r(a,n,"input"===p&&l),onkeydown:m},"input"===p?i("div",{key:"tooltip-content-header",class:o},i("calcite-button",{appearance:"transparent",iconFlipRtl:"both",iconStart:"chevron-left",kind:"neutral",onclick:d,scale:"s",tabIndex:-1})):null,f.length>0?i("div",{class:s},...f):null,c?i("div",{key:"help-message",class:e},c):null)}export{a as TooltipContentWithHelpMessage};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{tooltipKeys as n}from"../keybindings.js";import{base as o}from"./css.js";import s from"../../../widgets/Widget.js";import{loadCalciteComponents as l}from"../../../widgets/support/componentsUtils.js";import"../../../widgets/support/widgetUtils.js";import{tsx as u}from"../../../widgets/support/jsxFactory.js";const r=`${o}-editable-field`,a={base:r,inputMode:`${r}--input`,locked:`${r}--locked`,title:`${r}__title`,titleContent:`${r}__title__content`,value:`${r}__value`,valueContent:`${r}__value__content`,input:`${r}__input`,inputDisabled:`${r}__input--disabled`,inputReadOnly:`${r}__input--read-only`,inputSuffix:`${r}__input-suffix`,button:`${r}__button`};let c=class extends s{constructor(){super(...arguments),this._input=null,this._afterInputCreate=t=>{this._input=t},this._selectText=()=>{requestAnimationFrame((()=>{this._input?.select()}))},this._onKeyDown=t=>{t.key===n.discard&&this._discard()},this._onInputKeyDown=t=>{switch(t.key){case n.commit:return this._commit({type:"commit-and-exit",allowLockingCurrentValue:!0});case n.next:return t.stopPropagation(),this._commit({type:t.shiftKey?"commit-and-previous":"commit-and-next",allowLockingCurrentValue:!1})}},this._onInput=t=>{this.field.inputValue=t.target.value},this._onLockClick=()=>{const{field:t}=this;t.locked?t.unlock():this._lock()}}loadDependencies(){return l({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}render(){const{mode:t,field:e}=this,i="input"===t,{locked:n}=e;return u("div",{class:this.classes({[a.base]:!0,[a.inputMode]:"input"===t,[a.locked]:n})},u("div",{key:"title",class:a.title},u("div",{key:"title-content",class:a.titleContent},this._title,n&&!i?u("calcite-icon",{key:"icon",icon:"lock",scale:"s"}):null)),u("div",{key:"value",class:a.value},i?this._renderInput():u("span",{key:"formatted-value"},this._feedbackValue)))}get _initialValue(){const{field:t}=this;return null!=t.actual?t.toInputUnits(t.actual,this.context).value:null}get _feedbackValue(){const{context:t,field:e}=this,{actual:i,committed:n,format:o}=e;return null!=n?o(n,t):null!=i?o(i,t):""}get _displayValue(){const{inputValue:t,committed:e}=this.field;return t??this._toString(e?.value??this._initialValue)}get _suffix(){const{suffix:t}=this.field;return"string"==typeof t?t:t(this.context)}get _title(){const{title:t}=this.field;return"string"==typeof t?t:t(this.context)}_renderInput(){const{disabled:t,locked:e,readOnly:i}=this.field;return u("div",{key:"input-container",class:a.valueContent,onkeydown:this._onKeyDown},u("input",{afterCreate:this._afterInputCreate,class:this.classes({[a.input]:!0,[a.inputDisabled]:t,[a.inputReadOnly]:i}),disabled:t||i,onfocus:this._selectText,oninput:this._onInput,onkeydown:this._onInputKeyDown,readOnly:i,type:"text",value:this._displayValue}),u("div",{key:"suffix",class:a.inputSuffix},this._suffix),i?void 0:u("calcite-button",{appearance:"transparent",class:a.button,disabled:t,iconStart:e?"lock":"unlock",kind:"neutral",onclick:this._onLockClick,scale:"s",tabIndex:-1}))}_commit({type:t,allowLockingCurrentValue:e}){const{_input:i,field:n}=this;i&&(n.locked&&""===n.inputValue?n.unlock():(e||null!=n.inputValue)&&this._lock(),this.context.onCommit(i,t))}_discard(){this._input&&(this.field.inputValue=null,this.context.onDiscard(this._input))}_lock(){const{field:t}=this,e=this._parseNumber(t.inputValue),i=null!=e?t.createQuantity(e,this.context):null;t.lock(i)}_parseNumber(t){if(null==t)return null;const e=parseFloat(t);return isNaN(e)||!isFinite(e)?null:e}_toString(t){return null!=t?t.toFixed(3):"0"}};t([e()],c.prototype,"field",void 0),t([e()],c.prototype,"context",void 0),t([e()],c.prototype,"mode",void 0),t([e()],c.prototype,"_initialValue",null),t([e()],c.prototype,"_feedbackValue",null),t([e()],c.prototype,"_input",void 0),t([e()],c.prototype,"_displayValue",null),t([e()],c.prototype,"_suffix",null),t([e()],c.prototype,"_title",null),c=t([i("esri.views.interactive.tooltip.TooltipEditableField")],c);export{c as TooltipEditableField};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{tooltipKeys as n}from"../keybindings.js";import{base as o}from"./css.js";import s from"../../../widgets/Widget.js";import{loadCalciteComponents as l}from"../../../widgets/support/componentsUtils.js";import"../../../widgets/support/widgetUtils.js";import{tsx as u}from"../../../widgets/support/jsxFactory.js";const r=`${o}-editable-field`,a={base:r,inputMode:`${r}--input`,locked:`${r}--locked`,title:`${r}__title`,titleContent:`${r}__title__content`,value:`${r}__value`,valueContent:`${r}__value__content`,input:`${r}__input`,inputDisabled:`${r}__input--disabled`,inputReadOnly:`${r}__input--read-only`,inputSuffix:`${r}__input-suffix`,button:`${r}__button`};let c=class extends s{constructor(){super(...arguments),this._input=null,this._afterInputCreate=t=>{this._input=t},this._selectText=()=>{requestAnimationFrame((()=>{this._input?.select()}))},this._onKeyDown=t=>{t.key===n.discard&&this._discard()},this._onInputKeyDown=t=>{switch(t.key){case n.commit:return this._commit({type:"commit-and-exit",allowLockingCurrentValue:!0});case n.next:return t.stopPropagation(),this._commit({type:t.shiftKey?"commit-and-previous":"commit-and-next",allowLockingCurrentValue:!1})}},this._onInput=t=>{this.field.inputValue=t.target.value},this._onLockClick=()=>{const{field:t}=this;t.locked?t.unlock():this._lock()}}loadDependencies(){return l({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}render(){const{mode:t,field:e}=this,i="input"===t,{locked:n}=e;return u("div",{class:this.classes({[a.base]:!0,[a.inputMode]:"input"===t,[a.locked]:n})},u("div",{key:"title",class:a.title},u("div",{key:"title-content",class:a.titleContent},this._title,n&&!i?u("calcite-icon",{key:"icon",icon:"lock",scale:"s"}):null)),u("div",{key:"value",class:a.value},i?this._renderInput():u("span",{key:"formatted-value"},this._feedbackValue)))}get _initialValue(){const{field:t}=this;return null!=t.actual?t.toInputUnits(t.actual,this.context).value:null}get _feedbackValue(){const{context:t,field:e}=this,{actual:i,committed:n,format:o}=e;return null!=n?o(n,t):null!=i?o(i,t):""}get _displayValue(){const{field:t}=this,{inputValue:e,committed:i}=t;return null!=e?e:null!=i?this._toString(t.toInputUnits(i,this.context).value):this._toString(this._initialValue)}get _suffix(){const{suffix:t}=this.field;return"string"==typeof t?t:t(this.context)}get _title(){const{title:t}=this.field;return"string"==typeof t?t:t(this.context)}_renderInput(){const{disabled:t,locked:e,readOnly:i}=this.field;return u("div",{key:"input-container",class:a.valueContent,onkeydown:this._onKeyDown},u("input",{afterCreate:this._afterInputCreate,class:this.classes({[a.input]:!0,[a.inputDisabled]:t,[a.inputReadOnly]:i}),disabled:t||i,onfocus:this._selectText,oninput:this._onInput,onkeydown:this._onInputKeyDown,readOnly:i,type:"text",value:this._displayValue}),u("div",{key:"suffix",class:a.inputSuffix},this._suffix),i?void 0:u("calcite-button",{appearance:"transparent",class:a.button,disabled:t,iconStart:e?"lock":"unlock",kind:"neutral",onclick:this._onLockClick,scale:"s",tabIndex:-1}))}_commit({type:t,allowLockingCurrentValue:e}){const{_input:i,field:n}=this;i&&(n.locked&&""===n.inputValue?n.unlock():(e||null!=n.inputValue)&&this._lock(),this.context.onCommit(i,t))}_discard(){this._input&&(this.field.inputValue=null,this.context.onDiscard(this._input))}_lock(){const{field:t}=this,e=this._parseNumber(t.inputValue),i=null!=e?t.createQuantity(e,this.context):null;t.lock(i)}_parseNumber(t){if(null==t)return null;const e=parseFloat(t);return isNaN(e)||!isFinite(e)?null:e}_toString(t){return null!=t?t.toFixed(3):"0"}};t([e()],c.prototype,"field",void 0),t([e()],c.prototype,"context",void 0),t([e()],c.prototype,"mode",void 0),t([e()],c.prototype,"_initialValue",null),t([e()],c.prototype,"_feedbackValue",null),t([e()],c.prototype,"_input",void 0),t([e()],c.prototype,"_displayValue",null),t([e()],c.prototype,"_suffix",null),t([e()],c.prototype,"_title",null),c=t([i("esri.views.interactive.tooltip.TooltipEditableField")],c);export{c as TooltipEditableField};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{zeroMeters as e}from"../../../core/quantityUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as s}from"./SketchTooltipInfo.js";let r=class extends s{constructor(t){super(t),this.type="translate-graphic",this.distance=e}};t([o()],r.prototype,"type",void 0),t([o()],r.prototype,"distance",void 0),r=t([i("esri.views.interactive.tooltip.TranslateGraphicTooltipInfo")],r);let p=class extends s{constructor(t){super(t),this.type="translate-graphic-z",this.distance=e}};t([o()],p.prototype,"type",void 0),t([o()],p.prototype,"distance",void 0),p=t([i("esri.views.interactive.tooltip.TranslateGraphicZTooltipInfo")],p);let a=class extends s{constructor(t){super(t),this.type="translate-graphic-xy",this.distance=e}};t([o()],a.prototype,"type",void 0),t([o()],a.prototype,"distance",void 0),a=t([i("esri.views.interactive.tooltip.TranslateGraphicXYTooltipInfo")],a);let n=class extends s{constructor(t){super(t),this.type="translate-vertex",this.distance=e,this.elevation=null,this.area=null,this.totalLength=null}};t([o()],n.prototype,"type",void 0),t([o()],n.prototype,"distance",void 0),t([o()],n.prototype,"elevation",void 0),t([o()],n.prototype,"area",void 0),t([o()],n.prototype,"totalLength",void 0),n=t([i("esri.views.interactive.tooltip.TranslateVertexTooltipInfo")],n);let l=class extends s{constructor(t){super(t),this.type="translate-vertex-z",this.distance=e,this.elevation=null}};t([o()],l.prototype,"type",void 0),t([o()],l.prototype,"distance",void 0),t([o()],l.prototype,"elevation",void 0),l=t([i("esri.views.interactive.tooltip.TranslateVertexZTooltipInfo")],l);let c=class extends s{constructor(t){super(t),this.type="translate-vertex-xy",this.distance=e,this.elevation=null,this.area=null,this.totalLength=null}};t([o()],c.prototype,"type",void 0),t([o()],c.prototype,"distance",void 0),t([o()],c.prototype,"elevation",void 0),t([o()],c.prototype,"area",void 0),t([o()],c.prototype,"totalLength",void 0),c=t([i("esri.views.interactive.tooltip.TranslateVertexXYTooltipInfo")],c);export{r as TranslateGraphicTooltipInfo,a as TranslateGraphicXYTooltipInfo,p as TranslateGraphicZTooltipInfo,n as TranslateVertexTooltipInfo,c as TranslateVertexXYTooltipInfo,l as TranslateVertexZTooltipInfo};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{zeroMeters as e}from"../../../core/quantityUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as s}from"./SketchTooltipInfo.js";let r=class extends s{constructor(t){super(t),this.type="translate-graphic",this.distance=e}clear(){this.distance=e}};t([o()],r.prototype,"type",void 0),t([o()],r.prototype,"distance",void 0),r=t([i("esri.views.interactive.tooltip.TranslateGraphicTooltipInfo")],r);let a=class extends s{constructor(t){super(t),this.type="translate-graphic-z",this.distance=e}clear(){this.distance=e}};t([o()],a.prototype,"type",void 0),t([o()],a.prototype,"distance",void 0),a=t([i("esri.views.interactive.tooltip.TranslateGraphicZTooltipInfo")],a);let l=class extends s{constructor(t){super(t),this.type="translate-graphic-xy",this.distance=e}};t([o()],l.prototype,"type",void 0),t([o()],l.prototype,"distance",void 0),l=t([i("esri.views.interactive.tooltip.TranslateGraphicXYTooltipInfo")],l);let p=class extends s{constructor(t){super(t),this.type="translate-vertex",this.distance=e,this.elevation=null,this.area=null,this.totalLength=null}clear(){this.distance=e,this.elevation=null,this.area=null,this.totalLength=null}};t([o()],p.prototype,"type",void 0),t([o()],p.prototype,"distance",void 0),t([o()],p.prototype,"elevation",void 0),t([o()],p.prototype,"area",void 0),t([o()],p.prototype,"totalLength",void 0),p=t([i("esri.views.interactive.tooltip.TranslateVertexTooltipInfo")],p);let n=class extends s{constructor(t){super(t),this.type="translate-vertex-z",this.distance=e,this.elevation=null}clear(){this.distance=e,this.elevation=null}};t([o()],n.prototype,"type",void 0),t([o()],n.prototype,"distance",void 0),t([o()],n.prototype,"elevation",void 0),n=t([i("esri.views.interactive.tooltip.TranslateVertexZTooltipInfo")],n);let c=class extends s{constructor(t){super(t),this.type="translate-vertex-xy",this.distance=e,this.elevation=null,this.area=null,this.totalLength=null}clear(){this.distance=e,this.elevation=null,this.area=null,this.totalLength=null}};t([o()],c.prototype,"type",void 0),t([o()],c.prototype,"distance",void 0),t([o()],c.prototype,"elevation",void 0),t([o()],c.prototype,"area",void 0),t([o()],c.prototype,"totalLength",void 0),c=t([i("esri.views.interactive.tooltip.TranslateVertexXYTooltipInfo")],c);export{r as TranslateGraphicTooltipInfo,l as TranslateGraphicXYTooltipInfo,a as TranslateGraphicZTooltipInfo,p as TranslateVertexTooltipInfo,c as TranslateVertexXYTooltipInfo,n as TranslateVertexZTooltipInfo};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
+ */
5
+ import{TooltipEditableField as o}from"../TooltipEditableField.js";import{tsx as t,tsxFragment as e}from"../../../../widgets/support/jsxFactory.js";function i(i){return t(e,null,i.fields.map((e=>e&&!e.hidden?t(o,{context:i.context,field:e,mode:i.mode,key:e.id}):void 0)))}export{i as Fields};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{content as s}from"../css.js";import{TooltipContentWithHelpMessage as e}from"../TooltipContentWithHelpMessage.js";import{TooltipField as r}from"../TooltipField.js";import{TooltipContent as i}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${s}--draw-point`};let l=class extends i{render(){const{elevation:t,tooltipOptions:o}=this.info,{visibleElements:s}=o,i=this._messagesTooltip.sketch;return p(e,{className:a.base,helpMessage:this._getHelpMessage()},s.elevation&&p(r,{title:i.elevation,value:this._formatVerticalLength(t.actual)}))}};l=t([o("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],l);export{l as TooltipContentDrawPoint};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{content as t}from"../css.js";import{TooltipContentWithHelpMessage as e}from"../TooltipContentWithHelpMessage.js";import{Fields as r}from"./Fields.js";import{TooltipContent as i}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const n={base:`${t}--draw-point`};let a=class extends i{render(){const{fieldContext:o,info:s}=this,{mode:t,elevation:i,tooltipOptions:a}=s,{visibleElements:m}=a;return p(e,{className:n.base,helpMessage:this._getHelpMessage(),mode:t,onDiscard:this._onDiscard,onkeydown:this._handleTab},p(r,{context:o,mode:t,fields:[m.elevation?i:void 0]}))}};a=o([s("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],a);export{a as TooltipContentDrawPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{content as t}from"../css.js";import{TooltipContentWithHelpMessage as s}from"../TooltipContentWithHelpMessage.js";import{TooltipEditableField as i}from"../TooltipEditableField.js";import{TooltipContent as r}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as n}from"../../../../widgets/support/jsxFactory.js";const a={base:`${t} ${`${t}--draw-polygon`}`};let p=class extends r{render(){const{fieldContext:o,info:e}=this,{inputEnabled:t,visibleElements:r}=e.tooltipOptions;return n(s,{className:a.base,helpMessage:this._getHelpMessage(),mode:e.mode,onDiscard:this._onDiscard,onkeydown:this._handleTab},[t&&r.orientation?e.orientation:void 0,t&&r.distance?e.distance:void 0,r.elevation&&"2d"!==e.viewType?e.elevation:void 0,r.area?e.area:void 0].map((t=>t&&!t.hidden?n(i,{context:o,field:t,key:t.id,mode:e.mode}):void 0)))}};p=o([e("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],p);export{p as TooltipContentDrawPolygon};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{content as t}from"../css.js";import{TooltipContentWithHelpMessage as s}from"../TooltipContentWithHelpMessage.js";import{Fields as r}from"./Fields.js";import{TooltipContent as i}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as n}from"../../../../widgets/support/jsxFactory.js";const a={base:`${t} ${`${t}--draw-polygon`}`};let p=class extends i{render(){const{fieldContext:o,info:e}=this,{area:t,distance:i,elevation:p,mode:c,orientation:l,tooltipOptions:d,viewType:m}=e,{inputEnabled:j,visibleElements:g}=d;return n(s,{className:a.base,helpMessage:this._getHelpMessage(),mode:c,onDiscard:this._onDiscard,onkeydown:this._handleTab},n(r,{context:o,mode:c,fields:[j&&g.orientation?l:void 0,j&&g.distance?i:void 0,g.elevation&&"2d"!==m?p:void 0,g.area?t:void 0]}))}};p=o([e("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],p);export{p as TooltipContentDrawPolygon};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{content as t}from"../css.js";import{TooltipContentWithHelpMessage as s}from"../TooltipContentWithHelpMessage.js";import{TooltipEditableField as i}from"../TooltipEditableField.js";import{TooltipContent as r}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as n}from"../../../../widgets/support/jsxFactory.js";const p={base:`${t} ${`${t}--draw-polyline`}`};let a=class extends r{render(){const{info:o,fieldContext:e}=this,{inputEnabled:t,visibleElements:r}=o.tooltipOptions;return n(s,{className:p.base,helpMessage:this._getHelpMessage(),mode:o.mode,onDiscard:this._onDiscard,onkeydown:this._handleTab},[t&&r.orientation?o.orientation:void 0,t&&r.distance?o.distance:void 0,r.elevation&&"2d"!==o.viewType?o.elevation:void 0,r.totalLength?o.totalLength:void 0].map((t=>t&&!t.hidden?n(i,{context:e,field:t,key:t.id,mode:o.mode}):void 0)))}};a=o([e("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],a);export{a as TooltipContentDrawPolyline};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{content as e}from"../css.js";import{TooltipContentWithHelpMessage as s}from"../TooltipContentWithHelpMessage.js";import{Fields as i}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as n}from"../../../../widgets/support/jsxFactory.js";const p={base:`${e} ${`${e}--draw-polyline`}`};let a=class extends r{render(){const{fieldContext:o,info:t}=this,{distance:e,elevation:r,mode:a,orientation:l,tooltipOptions:c,totalLength:d,viewType:m}=t,{inputEnabled:j,visibleElements:g}=c;return n(s,{className:p.base,helpMessage:this._getHelpMessage(),mode:a,onDiscard:this._onDiscard,onkeydown:this._handleTab},n(i,{context:o,mode:a,fields:[j&&g.orientation?l:void 0,j&&g.distance?e:void 0,g.elevation&&"2d"!==m?r:void 0,g.totalLength?d:void 0]}))}};a=o([t("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],a);export{a as TooltipContentDrawPolyline};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import r from"../../core/Logger.js";import{watch as i,syncAndInitial as s,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as a}from"../../layers/support/commonProperties.js";import u from"../../layers/support/FeatureEffect.js";import p from"../../layers/support/FeatureFilter.js";import{fixFields as d,unpackFieldNames as f,collectLabelingFields as c,collectElevationFields as m,collectFilterFields as y,collectFeatureReductionFields as h,collectOrderByInfos as F,collectFields as g,collectField as w,featureHasFields as E}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as b}from"../../layers/support/floorFilterUtils.js";import x from"../../rest/support/Query.js";import{loadArcade as I}from"../../support/arcadeOnDemand.js";import{getFetchPopupTemplate as v,getRequiredFields as R}from"./support/popupUtils.js";const j="esri.views.layers.FeatureLayerView",q=r.getLogger(j),P=r=>{let P=class extends r{constructor(...e){super(...e),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!0,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([i((()=>{const e=this.layer;return[e?.elevationInfo?.featureExpressionInfo,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,this.filter,this.featureEffect,this.timeExtent]}),(()=>this._handleRequiredFieldsChange()),s),o((()=>this.view?.floors),"change",(()=>this._handleRequiredFieldsChange())),o((()=>{const e=this.layer;return e&&"sublayers"in e?e.sublayers:null}),"change",(()=>this._handleRequiredFieldsChange()))])}get availableFields(){const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?d(t,[...f(t,e.outFields),...r]):d(t,r)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){q.error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(e){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new x(e);if("feature"===this.layer.type){const e=b(this);null!=e&&(t.where=t.where?`(${t.where}) AND (${e})`:e)}return null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new x(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeatures(e,t){const r=this.validateFetchPopupFeatures(t);if(r)throw r;return this.fetchClientPopupFeatures(t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?I():Promise.resolve()}_handleRequiredFieldsChange(){const e=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",e),e.then((()=>{this._updatingRequiredFieldsPromise===e&&this._set("_updatingRequiredFieldsPromise",null)}))}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:t,layer:{fieldsIndex:r,objectIdField:i}}=this,s="renderer"in t&&t.renderer,o="orderBy"in t&&t.orderBy,n="featureReduction"in t?t.featureReduction:null,l=new Set,a=await Promise.allSettled([s?s.collectRequiredFields(l,r):null,c(l,t),e?m(l,t):null,null!=this.filter?y(l,t,this.filter):null,null!=this.featureEffect?y(l,t,this.featureEffect.filter):null,n?h(l,t,n):null,o?F(l,t,o):null]);if("timeInfo"in t&&t.timeInfo&&this.timeExtent&&g(l,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),"feature"===t.type&&(t.floorInfo&&g(l,t.fieldsIndex,[t.floorInfo.floorField]),e&&null!=t.infoFor3D&&(null==t.globalIdField&&q.error("globalIdField missing on 3DObjectFeatureLayer"),g(l,t.fieldsIndex,[t.globalIdField]))),"subtype-group"===t.type){w(l,r,t.subtypeField);const e=t.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(l,r),c(l,e)])));await Promise.allSettled(e)}for(const p of a)"rejected"===p.status&&q.error(p.reason);w(l,r,i),e&&"displayField"in t&&t.displayField&&w(l,r,t.displayField);const u=Array.from(l).sort();this._set("requiredFields",u)}validateFetchPopupFeatures(e){if(null==e)return null;for(const r of e.clientGraphics??[]){const i=r.layer;if("popupEnabled"in i&&!i.popupEnabled)return new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:i});if(r.isAggregate){const e="featureReduction"in i?i.featureReduction:null;if(!(e&&"popupTemplate"in e&&e.popupEnabled&&e.popupTemplate))return new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:i})}else if("popupTemplate"in i){if(!v(i,e))return new t("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:i})}}}async fetchClientPopupFeatures(e){const t=null!=e?e.clientGraphics:null;if(!t||0===t.length)return[];const r=new Array(t.length),i=new Map,s=await this.createPopupQuery(e);for(let o=0;o<t.length;o++){const n=t[o];if(n.isAggregate){r[o]=n;continue}const l=n.layer;if(!("popupEnabled"in l))continue;const a=f(this.layer.fieldsIndex,s.outFields),u=v(l,e);if(null==u)continue;const p=await this._loadArcadeModules(u);p&&p.arcadeUtils.hasGeometryOperations(u)||!E(a,n)?i.set(n.getObjectId(),{graphic:n,index:o}):r[o]=n}if("stream"===this.layer.type||0===i.size)return r.filter(Boolean);s.objectIds=Array.from(i.keys());try{const e=await this.layer.queryFeatures(s);for(const t of e.features){const{graphic:{geometry:e},index:s}=i.get(t.getObjectId());t.geometry||=e,r[s]=t}}catch{}return r.filter(Boolean)}async createPopupQuery(e){const t=this.layer.createQuery(),r=new Set;let i=!1;const s=null!=e&&e.clientGraphics?e.clientGraphics.map((e=>e.layer)):[this.layer];for(const o of s){if(!("popupEnabled"in o))continue;const t=v(o,e);if(null==t)continue;const s=await this._loadArcadeModules(t),n=s&&s.arcadeUtils.hasGeometryOperations(t);i=!("point"!==this.layer.geometryType&&!n);const l=await R(this.layer,t);for(const e of l)r.add(e)}if(t.returnGeometry=i,t.returnZ=i,t.returnM=i,t.outFields=Array.from(r),t.outSpatialReference=this.view.spatialReference,"feature"===this.layer.type){const e=b(this);null!=e&&(t.where=t.where?`(${t.where}) AND (${e})`:e)}return t}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}};return e([n()],P.prototype,"_updatingRequiredFieldsPromise",void 0),e([n({readOnly:!0})],P.prototype,"availableFields",null),e([n({readOnly:!0})],P.prototype,"dataUpdating",void 0),e([n({type:u})],P.prototype,"featureEffect",null),e([n({type:p})],P.prototype,"filter",void 0),e([n(a)],P.prototype,"timeExtent",void 0),e([n()],P.prototype,"layer",void 0),e([n({type:Number})],P.prototype,"maximumNumberOfFeatures",null),e([n({readOnly:!0,type:Boolean})],P.prototype,"maximumNumberOfFeaturesExceeded",null),e([n({readOnly:!0})],P.prototype,"requiredFields",void 0),e([n()],P.prototype,"suspended",void 0),e([n()],P.prototype,"view",void 0),P=e([l(j)],P),P};export{P as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import r from"../../core/Logger.js";import{watch as i,syncAndInitial as s,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as a}from"../../layers/support/commonProperties.js";import u from"../../layers/support/FeatureEffect.js";import p from"../../layers/support/FeatureFilter.js";import{fixFields as d,unpackFieldNames as f,collectLabelingFields as c,collectElevationFields as m,collectFilterFields as y,collectFeatureReductionFields as h,collectOrderByInfos as F,collectFields as g,collectField as w,featureHasFields as E}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as b}from"../../layers/support/floorFilterUtils.js";import x from"../../rest/support/Query.js";import{loadArcade as I}from"../../support/arcadeOnDemand.js";import{getFetchPopupTemplate as v,getRequiredFields as R}from"./support/popupUtils.js";const j="esri.views.layers.FeatureLayerView",q=r.getLogger(j),P=r=>{let P=class extends r{constructor(...e){super(...e),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([i((()=>{const e=this.layer;return[e?.elevationInfo?.featureExpressionInfo,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,this.filter,this.featureEffect,this.timeExtent]}),(()=>this._handleRequiredFieldsChange()),s),o((()=>this.view?.floors),"change",(()=>this._handleRequiredFieldsChange())),o((()=>{const e=this.layer;return e&&"sublayers"in e?e.sublayers:null}),"change",(()=>this._handleRequiredFieldsChange()))])}get availableFields(){const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?d(t,[...f(t,e.outFields),...r]):d(t,r)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){q.error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(e){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new x(e);if("feature"===this.layer.type){const e=b(this);null!=e&&(t.where=t.where?`(${t.where}) AND (${e})`:e)}return null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new x(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeatures(e,t){const r=this.validateFetchPopupFeatures(t);if(r)throw r;return this.fetchClientPopupFeatures(t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?I():Promise.resolve()}_handleRequiredFieldsChange(){const e=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",e),e.then((()=>{this._updatingRequiredFieldsPromise===e&&this._set("_updatingRequiredFieldsPromise",null)}))}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:t,layer:{fieldsIndex:r,objectIdField:i}}=this,s="renderer"in t&&t.renderer,o="orderBy"in t&&t.orderBy,n="featureReduction"in t?t.featureReduction:null,l=new Set,a=await Promise.allSettled([s?s.collectRequiredFields(l,r):null,c(l,t),e?m(l,t):null,null!=this.filter?y(l,t,this.filter):null,null!=this.featureEffect?y(l,t,this.featureEffect.filter):null,n?h(l,t,n):null,o?F(l,t,o):null]);if("timeInfo"in t&&t.timeInfo&&this.timeExtent&&g(l,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),"feature"===t.type&&(t.floorInfo&&g(l,t.fieldsIndex,[t.floorInfo.floorField]),e&&null!=t.infoFor3D&&(null==t.globalIdField&&q.error("globalIdField missing on 3DObjectFeatureLayer"),g(l,t.fieldsIndex,[t.globalIdField]))),"subtype-group"===t.type){w(l,r,t.subtypeField);const e=t.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(l,r),c(l,e)])));await Promise.allSettled(e)}for(const p of a)"rejected"===p.status&&q.error(p.reason);w(l,r,i),e&&"displayField"in t&&t.displayField&&w(l,r,t.displayField);const u=Array.from(l).sort();this._set("requiredFields",u)}validateFetchPopupFeatures(e){if(null==e)return null;for(const r of e.clientGraphics??[]){const i=r.layer;if("popupEnabled"in i&&!i.popupEnabled)return new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:i});if(r.isAggregate){const e="featureReduction"in i?i.featureReduction:null;if(!(e&&"popupTemplate"in e&&e.popupEnabled&&e.popupTemplate))return new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:i})}else if("popupTemplate"in i){if(!v(i,e))return new t("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:i})}}}async fetchClientPopupFeatures(e){const t=null!=e?e.clientGraphics:null;if(!t||0===t.length)return[];const r=new Array(t.length),i=new Map,s=await this.createPopupQuery(e);for(let o=0;o<t.length;o++){const n=t[o];if(n.isAggregate){r[o]=n;continue}const l=n.layer;if(!("popupEnabled"in l))continue;const a=f(this.layer.fieldsIndex,s.outFields),u=v(l,e);if(null==u)continue;const p=await this._loadArcadeModules(u);p&&p.arcadeUtils.hasGeometryOperations(u)||!E(a,n)?i.set(n.getObjectId(),{graphic:n,index:o}):r[o]=n}if("stream"===this.layer.type||0===i.size)return r.filter(Boolean);s.objectIds=Array.from(i.keys());try{const e=await this.layer.queryFeatures(s);for(const t of e.features){const{graphic:{geometry:e},index:s}=i.get(t.getObjectId());t.geometry||=e,r[s]=t}}catch{}return r.filter(Boolean)}async createPopupQuery(e){const t=this.layer.createQuery(),r=new Set;let i=!1;const s=null!=e&&e.clientGraphics?e.clientGraphics.map((e=>e.layer)):[this.layer];for(const o of s){if(!("popupEnabled"in o))continue;const t=v(o,e);if(null==t)continue;const s=await this._loadArcadeModules(t),n=s&&s.arcadeUtils.hasGeometryOperations(t);i=!("point"!==this.layer.geometryType&&!n);const l=await R(this.layer,t);for(const e of l)r.add(e)}if(t.returnGeometry=i,t.returnZ=i,t.returnM=i,t.outFields=Array.from(r),t.outSpatialReference=this.view.spatialReference,"feature"===this.layer.type){const e=b(this);null!=e&&(t.where=t.where?`(${t.where}) AND (${e})`:e)}return t}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}};return e([n()],P.prototype,"_updatingRequiredFieldsPromise",void 0),e([n({readOnly:!0})],P.prototype,"availableFields",null),e([n({readOnly:!0})],P.prototype,"dataUpdating",void 0),e([n({type:u})],P.prototype,"featureEffect",null),e([n({type:p})],P.prototype,"filter",void 0),e([n(a)],P.prototype,"timeExtent",void 0),e([n()],P.prototype,"layer",void 0),e([n({type:Number})],P.prototype,"maximumNumberOfFeatures",null),e([n({readOnly:!0,type:Boolean})],P.prototype,"maximumNumberOfFeaturesExceeded",null),e([n({readOnly:!0})],P.prototype,"requiredFields",void 0),e([n()],P.prototype,"suspended",void 0),e([n()],P.prototype,"view",void 0),P=e([l(j)],P),P};export{P 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.28/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import t from"../../core/Logger.js";import{disposeMaybe as e}from"../../core/maybe.js";import{BufferObject as i}from"./BufferObject.js";import{webglDebugEnabled as r}from"./checkWebGLError.js";import{ContextType as s}from"./contextUtils.js";import{ResourceType as h,ColorAttachment as n,PixelFormat as o,PixelType as c,DepthStencilAttachment as a,FramebufferTarget as u,TextureType as _,Usage as l,BufferType as f,RenderbufferFormat as T}from"./enums.js";import{GLObjectType as d}from"./GLObjectType.js";import{Renderbuffer as m}from"./Renderbuffer.js";import{Texture as p}from"./Texture.js";const x=t.getLogger("esri.views.webgl.FramebufferObject");class E{constructor(t,e,i=null){this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(h.FramebufferObject,this);const r=g(e)?e:new p(this._context,e);if(this._colorAttachments.set(n.COLOR_ATTACHMENT0,r),this._validateTextureDescriptor(r.descriptor),this._validateColorAttachmentPoint(n.COLOR_ATTACHMENT0),null!=i)if(b(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=g(i)?i:new p(this._context,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=A(i)?i:new m(this._context,i);this._depthStencilBuffer=t,this._validateRenderBufferDescriptor(t.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const t=this._context.getBoundFramebufferObject();if(this._colorAttachments.forEach(((t,e)=>this.detachColorTexture(e)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName){this._context.gl.deleteFramebuffer(this._glName),this._glName=null}this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(h.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(n.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(n.COLOR_ATTACHMENT0);return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(n.COLOR_ATTACHMENT0);return t?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((t,[e,i])=>t+i.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&g(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=n.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const i=t.descriptor;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=n.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(e)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)),this._colorAttachments.delete(t),e}setColorTextureTarget(t,e=n.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);i&&this._framebufferTexture2D(i.glName,e,t)}attachDepthStencil(t){if(t)switch(t.type){case d.Texture:return this._attachDepthStencilTexture(t);case d.RenderBuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const e=t.descriptor;e.pixelFormat!==o.DEPTH_STENCIL&&e.pixelFormat!==o.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==c.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,a)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,a)),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderBufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const i=this._context.gl,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(u.FRAMEBUFFER,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer?.dispose(),this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){this._context.bindFramebuffer(this);const e=this._context.gl,i=this._getGLAttachmentPoint(t.descriptor);e.framebufferRenderbuffer(u.FRAMEBUFFER,i,e.RENDERBUFFER,null)}return this._depthStencilBuffer=null,t}copyToTexture(t,e,i,r,s,h,n){(t<0||e<0||s<0||h<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const o=n.descriptor;n.descriptor.target!==_.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==o?.width||null==o?.height||t+i>this.width||e+r>this.height||s+i>o.width||h+r>o.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,a=c.bindTexture(n,p.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(p.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(_.TEXTURE_2D,0,s,h,t,e,i,r),c.bindTexture(a,p.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,s,h,n){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),n||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,s,h,n)}async readPixelsAsync(t,e,h,n,o,c,a){if(this._context.type!==s.WEBGL2)return r()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(t,e,h,n,o,c,a);const u=this._context.gl,_=i.createPixelPack(this._context,l.STREAM_READ,a.byteLength);this._context.bindBuffer(_),this._context.bindFramebuffer(this),u.readPixels(t,e,h,n,o,c,0),this._context.unbindBuffer(f.PIXEL_PACK_BUFFER),await _.getSubDataAsync(a),_.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};S(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((t=>t.resize(i.width,i.height))),this._depthStencilTexture?.resize(i.width,i.height),this._initialized&&(S(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=u.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const i=e.createFramebuffer();e.bindFramebuffer(t,i),this._colorAttachments.forEach(((e,i)=>this._framebufferTexture2D(e.glName,i,R(e),t)));const s=this._depthStencilBuffer;if(s){const i=this._getGLAttachmentPoint(s.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,s.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,R(this._depthStencilTexture),t);if(r()){e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=i,this._initialized=!0}_framebufferTexture2D(t,e=n.COLOR_ATTACHMENT0,i=_.TEXTURE_2D,r=u.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(r,e,i,t,s)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(u.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=e(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=e(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==_.TEXTURE_2D&&t.target!==_.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),S(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderBufferDescriptor(t){S(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case T.DEPTH_COMPONENT16:case T.DEPTH_COMPONENT24:case T.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case T.DEPTH24_STENCIL8:case T.DEPTH32F_STENCIL8:case T.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case T.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===E._MAX_COLOR_ATTACHMENTS){const t=this._context.capabilities.drawBuffers;if(t){const e=this._context.gl;E._MAX_COLOR_ATTACHMENTS=e.getParameter(t.MAX_COLOR_ATTACHMENTS)}else E._MAX_COLOR_ATTACHMENTS=1}const i=e-n.COLOR_ATTACHMENT0;i+1>E._MAX_COLOR_ATTACHMENTS&&t.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${i+1}. Implementation supports up to ${E._MAX_COLOR_ATTACHMENTS} color attachments`)}}function g(t){return null!=t&&"type"in t&&t.type===d.Texture}function A(t){return null!=t&&"type"in t&&t.type===d.RenderBuffer}function b(t){return g(t)||null!=t&&"pixelFormat"in t}function S(t,e){const i=Math.max(t.width,t.height);if(i>e){x.warn(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function R(t){return t.descriptor.target===_.TEXTURE_CUBE_MAP?_.TEXTURE_CUBE_MAP_POSITIVE_X:_.TEXTURE_2D}E._MAX_COLOR_ATTACHMENTS=-1;export{E as FramebufferObject,S as ensureAttachmentMaxSize};
5
+ import"../../core/has.js";import t from"../../core/Logger.js";import{disposeMaybe as e}from"../../core/maybe.js";import{BufferObject as i}from"./BufferObject.js";import{webglDebugEnabled as r}from"./checkWebGLError.js";import{ContextType as s}from"./contextUtils.js";import{ResourceType as h,ColorAttachment as n,PixelFormat as o,PixelType as c,DepthStencilAttachment as a,FramebufferTarget as u,TextureType as _,Usage as l,BufferType as f,RenderbufferFormat as T}from"./enums.js";import{GLObjectType as d}from"./GLObjectType.js";import{Renderbuffer as m}from"./Renderbuffer.js";import{Texture as p}from"./Texture.js";const x=t.getLogger("esri.views.webgl.FramebufferObject");class E{constructor(t,e,i=null){this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(h.FramebufferObject,this);const r=g(e)?e:new p(this._context,e);if(this._colorAttachments.set(n.COLOR_ATTACHMENT0,r),this._validateTextureDescriptor(r.descriptor),this._validateColorAttachmentPoint(n.COLOR_ATTACHMENT0),null!=i)if(b(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=g(i)?i:new p(this._context,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=A(i)?i:new m(this._context,i);this._depthStencilBuffer=t,this._validateRenderBufferDescriptor(t.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const t=this._context.getBoundFramebufferObject();if(this._colorAttachments.forEach(((t,e)=>this.detachColorTexture(e)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName){this._context.gl.deleteFramebuffer(this._glName),this._glName=null}this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(h.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(n.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(n.COLOR_ATTACHMENT0);return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(n.COLOR_ATTACHMENT0);return t?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((t,[e,i])=>t+i.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&g(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=n.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const i=t.descriptor;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=n.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(e)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)),this._colorAttachments.delete(t),e}setColorTextureTarget(t,e=n.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);i&&this._framebufferTexture2D(i.glName,e,t)}attachDepthStencil(t){if(t)switch(t.type){case d.Texture:return this._attachDepthStencilTexture(t);case d.RenderBuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const e=t.descriptor;e.pixelFormat!==o.DEPTH_STENCIL&&e.pixelFormat!==o.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==c.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,a)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,a)),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderBufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const i=this._context.gl,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(u.FRAMEBUFFER,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){this._context.bindFramebuffer(this);const e=this._context.gl,i=this._getGLAttachmentPoint(t.descriptor);e.framebufferRenderbuffer(u.FRAMEBUFFER,i,e.RENDERBUFFER,null)}return this._depthStencilBuffer=null,t}copyToTexture(t,e,i,r,s,h,n){(t<0||e<0||s<0||h<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const o=n.descriptor;n.descriptor.target!==_.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==o?.width||null==o?.height||t+i>this.width||e+r>this.height||s+i>o.width||h+r>o.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,a=c.bindTexture(n,p.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(p.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(_.TEXTURE_2D,0,s,h,t,e,i,r),c.bindTexture(a,p.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,s,h,n){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),n||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,s,h,n)}async readPixelsAsync(t,e,h,n,o,c,a){if(this._context.type!==s.WEBGL2)return r()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(t,e,h,n,o,c,a);const u=this._context.gl,_=i.createPixelPack(this._context,l.STREAM_READ,a.byteLength);this._context.bindBuffer(_),this._context.bindFramebuffer(this),u.readPixels(t,e,h,n,o,c,0),this._context.unbindBuffer(f.PIXEL_PACK_BUFFER),await _.getSubDataAsync(a),_.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};S(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((t=>t.resize(i.width,i.height))),this._depthStencilTexture?.resize(i.width,i.height),this._initialized&&(S(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=u.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const i=e.createFramebuffer();if(e.bindFramebuffer(t,i),this._colorAttachments.forEach(((e,i)=>this._framebufferTexture2D(e.glName,i,R(e),t))),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,R(this._depthStencilTexture),t);if(r()){e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=i,this._initialized=!0}_framebufferTexture2D(t,e=n.COLOR_ATTACHMENT0,i=_.TEXTURE_2D,r=u.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(r,e,i,t,s)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(u.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=e(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=e(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==_.TEXTURE_2D&&t.target!==_.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),S(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderBufferDescriptor(t){S(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case T.DEPTH_COMPONENT16:case T.DEPTH_COMPONENT24:case T.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case T.DEPTH24_STENCIL8:case T.DEPTH32F_STENCIL8:case T.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case T.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===E._MAX_COLOR_ATTACHMENTS){const t=this._context.capabilities.drawBuffers;if(t){const e=this._context.gl;E._MAX_COLOR_ATTACHMENTS=e.getParameter(t.MAX_COLOR_ATTACHMENTS)}else E._MAX_COLOR_ATTACHMENTS=1}const i=e-n.COLOR_ATTACHMENT0;i+1>E._MAX_COLOR_ATTACHMENTS&&t.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${i+1}. Implementation supports up to ${E._MAX_COLOR_ATTACHMENTS} color attachments`)}}function g(t){return null!=t&&"type"in t&&t.type===d.Texture}function A(t){return null!=t&&"type"in t&&t.type===d.RenderBuffer}function b(t){return g(t)||null!=t&&"pixelFormat"in t}function S(t,e){const i=Math.max(t.width,t.height);if(i>e){x.warn(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function R(t){return t.descriptor.target===_.TEXTURE_CUBE_MAP?_.TEXTURE_CUBE_MAP_POSITIVE_X:_.TEXTURE_2D}E._MAX_COLOR_ATTACHMENTS=-1;export{E as FramebufferObject,S as ensureAttachmentMaxSize};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
+ */
5
+ import o from"../config.js";import r from"../core/Error.js";import{supportsApiKey as p}from"../support/apiKeyUtils.js";function i(i){if(o.apiKey&&p(i.portal.url))throw new r("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${i.portal.url} when using an api key`)}export{i as validateSaveAPIKey};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../core/Error.js";import t from"../core/Logger.js";import{MultiOriginJSONSupport as r}from"../core/MultiOriginJSONSupport.js";import{whenOnce as o}from"../core/reactiveUtils.js";import{urlToObject as a,hasSameCanonicalArcGISOnlinePortal as i}from"../core/urlUtils.js";import{updateOrigins as n}from"../core/accessorSupport/originUtils.js";import s from"../geometry/SpatialReference.js";import{equals as l}from"../geometry/support/spatialReferenceUtils.js";import{webMercatorToGeographic as p}from"../geometry/support/webMercatorUtils.js";import{isServerOrServicesAGOLUrl as c}from"../layers/support/arcgisLayerUrl.js";import{isLayerWithFeatureLayerSource as u,isFeatureCollectionLayer as m}from"../layers/support/layerUtils.js";import d from"../portal/Portal.js";import f from"../portal/PortalItem.js";import{TypeKeyword as w,removeTypeKeyword as y,addTypeKeyword as g,hasTypeKeyword as h}from"../portal/support/portalItemUtils.js";import{project as b}from"../rest/geometryService/project.js";import v from"../rest/support/ProjectParameters.js";import{hasDeveloperBasemapLayer as _,findSpatialReference as R,isDeveloperBasemapLayer as P}from"../support/basemapUtils.js";import{saveResources as U}from"./support/saveUtils.js";const S=["NatGeo_World_Map","Ocean_Basemap","USA_Topo_Maps","World_Imagery","World_Street_Map","World_Terrain_Base","World_Topo_Map","World_Hillshade","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Reference/World_Boundaries_and_Places","Reference/World_Reference_Overlay","Reference/World_Transportation"].map((e=>e.toLowerCase()));async function W(e,t,r){r??={},I(e,t),await o((()=>!t.updatingFromView)),await t.load(),await M(t),await k(t),await O(e,t);const i=t.portalItem,n=a(i.itemUrl),s={origin:"web-map",messages:[],writtenProperties:[],url:n,portal:i.portal||d.getDefault(),portalItem:i,verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},l=t.write({},s);return await Promise.all(s.resources.pendingOperations),D(e,s,r),await L(t,i),await ue(e,t,i,l,s),await Promise.all([t.updateItemThumbnail(),U(t.resourceReferences,s,null)]),i}async function j(e,t,r,a){a??={};const i=T(e,r);await o((()=>!t.updatingFromView)),await t.load(),await M(t),await k(t),await O(e,t);const n={origin:"web-map",messages:[],writtenProperties:[],url:null,portal:i.portal,portalItem:i,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},s=t.write({},n);await Promise.all(n.resources.pendingOperations),D(e,n,a),await z(t,i);const l=t.getThumbnailState();return await me(e,t,i,s,n,a)&&(t.resourceReferences.portalItem=i),t.restoreThumbnailFromState(l),await Promise.all([t.updateItemThumbnail(),U(t.resourceReferences,n,null)]),i}function I(r,o){if(!o.portalItem)throw t.getLogger(o).error("save: requires the portalItem property to be set"),new e(`${r.name}:portal-item-not-set`,"Portal item to save to has not been set on the WebMap");A(r,o.portalItem)}function A(t,r){if(r.type!==t.itemType)throw new e(`${t.name}:portal-item-wrong-type`,`Portal item needs to have type "${t.itemType}"`)}async function O(t,r){if(!r.basemap?.baseLayers.length)throw new e(`${t.name}:save`,"Map does not have a valid basemap with a base layer.");let a=null;if(await o((()=>{const e=R(r.initialViewProperties,r.basemap);return a=e.spatialReference,!e.updating})),!l(a,r.initialViewProperties.spatialReference))throw new e(`${t.name}:save`,"The spatial reference of the basemap is not compatible with the one from the map.",{expected:r.initialViewProperties.spatialReference,actual:a})}function T(e,t){let r=f.from(t);return r.id&&(r=r.clone(),r.id=null),r.type||(r.type=e.itemType),r.portal||(r.portal=d.getDefault()),A(e,r),r}function M(e){const t=[];return e.basemap&&t.push(e.basemap.load()),e.ground&&t.push(e.ground.load()),Promise.allSettled(t).then((()=>{}))}async function k(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function D(t,r,o){let a=(r.messages??[]).filter((e=>"error"===e.type)).map((t=>new e(t.name,t.message,t.details)));if(r.blockedRelativeUrls&&(a=a.concat(r.blockedRelativeUrls.map((t=>new e("url:unsupported",`Relative url '${t}' is not supported in Web Map`))))),o.ignoreUnsupported&&(a=a.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name))),a.length>0)throw new e(`${t.name}:save`,"Failed to save webmap due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:a})}async function L(e,t){t.extent=await ne(e.portalItem,e.initialViewProperties.viewpoint.targetGeometry),await Q(e,t)}const E=w.JSAPI,C="CollectorDisabled",V="Collector",G="Data Editing",$="OfflineDisabled",B="Offline",K="Workforce Project",x="Workforce Worker",F="Workforce Dispatcher",N="Offline Map Areas",H="FieldMapsDisabled",J=w.DEVELOPER_BASEMAP,q="UtilityNetwork";async function z(e,t){y(t,C),y(t,H),y(t,w.METADATA),y(t,$),y(t,N),y(t,F),y(t,K),y(t,x),await L(e,t)}async function Q(e,t){g(t,E),await X(e),te(e,t),re(e,t),oe(e,t),ae(e,t),ie(e,t),t.typeKeywords&&(t.typeKeywords=t.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}function X(e){const t=Y(e).map((e=>e.load())).toArray();return Promise.allSettled(t).then((()=>{}))}function Y(e){return e.allLayers.concat(e.allTables)}function Z(e){return Y(e).some((e=>e.loaded&&u(e)&&e.capabilities.operations.supportsEditing&&e.editingEnabled&&("subtype-group"!==e.type||e.sublayers.some((e=>e.editingEnabled)))))}function ee(e){return Y(e).filter((e=>"group"!==e.type)).every((t=>t.loaded&&pe(e,t)))}function te(e,t){h(t,C)||h(t,K)||h(t,x)||h(t,F)||!Z(e)?y(t,V):g(t,V)}function re(e,t){Z(e)?g(t,G):y(t,G)}function oe(e,t){!h(t,$)&&ee(e)?g(t,B):y(t,B)}function ae(e,t){_(e.basemap)?g(t,J):y(t,J)}function ie(e,t){e.utilityNetworks?.length?g(t,q):y(t,q)}async function ne(e,t){const r=t.clone().normalize();let o;if(r.length>1)for(const a of r)o?a.width>o.width&&(o=a):o=a;else o=r[0];return se(e,o)}async function se(e,t){const r=t.spatialReference;if(r.isWGS84)return t.clone();if(r.isWebMercator)return p(t);const{getGeometryServiceURL:o}=await import("../portal/support/geometryServiceUtils.js"),a=await o(e),i=new v;i.geometries=[t],i.outSpatialReference=s.WGS84;return(await b(a,i))[0]}function le(e){return m(e)||"map-notes"===e.type||"route"===e.type}function pe(e,t){return u(t)&&t.capabilities.operations.supportsSync||le(t)&&!t.portalItem||("tile"===t.type||"vector-tile"===t.type)&&(t.capabilities.operations.supportsExportTiles||ce(t)||P(t))&&t.spatialReference.equals(e.initialViewProperties.spatialReference)}function ce(e){return"tile"===e.type&&(c(e.url)&&S.some((t=>e.url?.toLowerCase().includes("/"+t+"/"))))}async function ue(e,t,r,o,a){await r.update({data:o}),we(e,t,r,o,a)}async function me(t,r,o,a,i,n){const s=r.portalItem,l={item:s,authenticated:!(!s?.id||!s.portal.user)},p=o.portal;await p.signIn();const{copyAllowed:c,itemReloaded:u}=await de(l,p);if(l.authenticated||=u,!c)throw new e(`${t.name}:save-as-copy-not-allowed`,"Owner of this map does not allow others to save a copy");const m=await fe(o,l,a,n);return r.portalItem=o,we(t,r,o,a,i),m}async function de(e,t){const{item:r,authenticated:o}=e;return r?.id&&r.typeKeywords?.includes("useOnly")?r.portal.portalHostname!==t.portalHostname?{copyAllowed:!1,itemReloaded:!1}:(o||await r.reload(),{copyAllowed:"admin"===r.itemControl||"update"===r.itemControl,itemReloaded:!0}):{copyAllowed:!0,itemReloaded:!1}}async function fe(e,t,r,o){const a=e.portal,{item:n}=t,{folder:s,copyAllResources:l}=o;let p=!1;if(l&&n?.id&&i(n.portal.url,a.url)){const{total:e}=await n.fetchResources();p=!!e}if(p){const t=await n.copy({copyResources:"all",folder:s});e.id=t.id,e.portal=t.portal;const o=e.toJSON();await e.load(),e.read(o),await e.update({data:r})}else await(a.user?.addItem({item:e,folder:s,data:r}));return p}function we(e,t,o,i,s){r.prototype.read.call(t,{version:i.version,authoringApp:i.authoringApp,authoringAppVersion:i.authoringAppVersion},{origin:e.origin,ignoreDefaults:!0,url:o.itemUrl?a(o.itemUrl):void 0}),n(s),t.resourceInfo=i}export{W as save,j as saveAs};
5
+ import e from"../core/Error.js";import{MultiOriginJSONSupport as t}from"../core/MultiOriginJSONSupport.js";import{whenOnce as r}from"../core/reactiveUtils.js";import{urlToObject as o,hasSameCanonicalArcGISOnlinePortal as a}from"../core/urlUtils.js";import{updateOrigins as i}from"../core/accessorSupport/originUtils.js";import n from"../geometry/SpatialReference.js";import{equals as s}from"../geometry/support/spatialReferenceUtils.js";import{webMercatorToGeographic as l}from"../geometry/support/webMercatorUtils.js";import{isServerOrServicesAGOLUrl as p}from"../layers/support/arcgisLayerUrl.js";import{isLayerWithFeatureLayerSource as c,isFeatureCollectionLayer as u}from"../layers/support/layerUtils.js";import m from"../portal/Portal.js";import d from"../portal/PortalItem.js";import{TypeKeyword as f,removeTypeKeyword as w,addTypeKeyword as y,hasTypeKeyword as g}from"../portal/support/portalItemUtils.js";import{project as h}from"../rest/geometryService/project.js";import b from"../rest/support/ProjectParameters.js";import{hasDeveloperBasemapLayer as v,findSpatialReference as _,isDeveloperBasemapLayer as R}from"../support/basemapUtils.js";import{validateSaveAPIKey as P}from"./saveAPIKeyUtils.js";import{saveResources as U}from"./support/saveUtils.js";const S=["NatGeo_World_Map","Ocean_Basemap","USA_Topo_Maps","World_Imagery","World_Street_Map","World_Terrain_Base","World_Topo_Map","World_Hillshade","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Reference/World_Boundaries_and_Places","Reference/World_Reference_Overlay","Reference/World_Transportation"].map((e=>e.toLowerCase()));async function W(e,t,a){a??={},I(e,t),await r((()=>!t.updatingFromView)),await t.load(),await M(t),await k(t),await O(e,t);const i=t.portalItem,n=o(i.itemUrl),s={origin:"web-map",messages:[],writtenProperties:[],url:n,portal:i.portal||m.getDefault(),portalItem:i,verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},l=t.write({},s);return await Promise.all(s.resources.pendingOperations),D(e,s,a),await E(t,i),await ue(e,t,i,l,s),await Promise.all([t.updateItemThumbnail(),U(t.resourceReferences,s,null)]),i}async function j(e,t,o,a){a??={};const i=T(e,o);await r((()=>!t.updatingFromView)),await t.load(),await M(t),await k(t),await O(e,t);const n={origin:"web-map",messages:[],writtenProperties:[],url:null,portal:i.portal,portalItem:i,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},s=t.write({},n);await Promise.all(n.resources.pendingOperations),D(e,n,a),await z(t,i);const l=t.getThumbnailState();return await me(e,t,i,s,n,a)&&(t.resourceReferences.portalItem=i),t.restoreThumbnailFromState(l),await Promise.all([t.updateItemThumbnail(),U(t.resourceReferences,n,null)]),i}function I(t,r){if(!r.portalItem)throw new e(`${t.name}:portal-item-not-set`,"Portal item to save to has not been set on the WebMap");P(r.portalItem),A(t,r.portalItem)}function A(t,r){if(r.type!==t.itemType)throw new e(`${t.name}:portal-item-wrong-type`,`Portal item needs to have type "${t.itemType}"`)}async function O(t,o){if(!o.basemap?.baseLayers.length)throw new e(`${t.name}:save`,"Map does not have a valid basemap with a base layer.");let a=null;if(await r((()=>{const e=_(o.initialViewProperties,o.basemap);return a=e.spatialReference,!e.updating})),!s(a,o.initialViewProperties.spatialReference))throw new e(`${t.name}:save`,"The spatial reference of the basemap is not compatible with the one from the map.",{expected:o.initialViewProperties.spatialReference,actual:a})}function T(e,t){let r=d.from(t);return r.id&&(r=r.clone(),r.id=null),r.type||(r.type=e.itemType),r.portal||(r.portal=m.getDefault()),P(r),A(e,r),r}function M(e){const t=[];return e.basemap&&t.push(e.basemap.load()),e.ground&&t.push(e.ground.load()),Promise.allSettled(t).then((()=>{}))}async function k(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function D(t,r,o){let a=(r.messages??[]).filter((e=>"error"===e.type)).map((t=>new e(t.name,t.message,t.details)));if(r.blockedRelativeUrls&&(a=a.concat(r.blockedRelativeUrls.map((t=>new e("url:unsupported",`Relative url '${t}' is not supported in Web Map`))))),o.ignoreUnsupported&&(a=a.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name))),a.length>0)throw new e(`${t.name}:save`,"Failed to save webmap due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:a})}async function E(e,t){t.extent=await ne(e.portalItem,e.initialViewProperties.viewpoint.targetGeometry),await Q(e,t)}const C=f.JSAPI,L="CollectorDisabled",V="Collector",G="Data Editing",$="OfflineDisabled",B="Offline",K="Workforce Project",x="Workforce Worker",F="Workforce Dispatcher",N="Offline Map Areas",H="FieldMapsDisabled",J=f.DEVELOPER_BASEMAP,q="UtilityNetwork";async function z(e,t){w(t,L),w(t,H),w(t,f.METADATA),w(t,$),w(t,N),w(t,F),w(t,K),w(t,x),await E(e,t)}async function Q(e,t){y(t,C),await X(e),te(e,t),re(e,t),oe(e,t),ae(e,t),ie(e,t),t.typeKeywords&&(t.typeKeywords=t.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}function X(e){const t=Y(e).map((e=>e.load())).toArray();return Promise.allSettled(t).then((()=>{}))}function Y(e){return e.allLayers.concat(e.allTables)}function Z(e){return Y(e).some((e=>e.loaded&&c(e)&&e.capabilities.operations.supportsEditing&&e.editingEnabled&&("subtype-group"!==e.type||e.sublayers.some((e=>e.editingEnabled)))))}function ee(e){return Y(e).filter((e=>"group"!==e.type)).every((t=>t.loaded&&pe(e,t)))}function te(e,t){g(t,L)||g(t,K)||g(t,x)||g(t,F)||!Z(e)?w(t,V):y(t,V)}function re(e,t){Z(e)?y(t,G):w(t,G)}function oe(e,t){!g(t,$)&&ee(e)?y(t,B):w(t,B)}function ae(e,t){v(e.basemap)?y(t,J):w(t,J)}function ie(e,t){e.utilityNetworks?.length?y(t,q):w(t,q)}async function ne(e,t){const r=t.clone().normalize();let o;if(r.length>1)for(const a of r)o?a.width>o.width&&(o=a):o=a;else o=r[0];return se(e,o)}async function se(e,t){const r=t.spatialReference;if(r.isWGS84)return t.clone();if(r.isWebMercator)return l(t);const{getGeometryServiceURL:o}=await import("../portal/support/geometryServiceUtils.js"),a=await o(e),i=new b;i.geometries=[t],i.outSpatialReference=n.WGS84;return(await h(a,i))[0]}function le(e){return u(e)||"map-notes"===e.type||"route"===e.type}function pe(e,t){return c(t)&&t.capabilities.operations.supportsSync||le(t)&&!t.portalItem||("tile"===t.type||"vector-tile"===t.type)&&(t.capabilities.operations.supportsExportTiles||ce(t)||R(t))&&t.spatialReference.equals(e.initialViewProperties.spatialReference)}function ce(e){return"tile"===e.type&&(p(e.url)&&S.some((t=>e.url?.toLowerCase().includes("/"+t+"/"))))}async function ue(e,t,r,o,a){await r.update({data:o}),we(e,t,r,o,a)}async function me(t,r,o,a,i,n){const s=r.portalItem,l={item:s,authenticated:!(!s?.id||!s.portal.user)},p=o.portal;await p.signIn();const{copyAllowed:c,itemReloaded:u}=await de(l,p);if(l.authenticated||=u,!c)throw new e(`${t.name}:save-as-copy-not-allowed`,"Owner of this map does not allow others to save a copy");const m=await fe(o,l,a,n);return r.portalItem=o,we(t,r,o,a,i),m}async function de(e,t){const{item:r,authenticated:o}=e;return r?.id&&r.typeKeywords?.includes("useOnly")?r.portal.portalHostname!==t.portalHostname?{copyAllowed:!1,itemReloaded:!1}:(o||await r.reload(),{copyAllowed:"admin"===r.itemControl||"update"===r.itemControl,itemReloaded:!0}):{copyAllowed:!0,itemReloaded:!1}}async function fe(e,t,r,o){const i=e.portal,{item:n}=t,{folder:s,copyAllResources:l}=o;let p=!1;if(l&&n?.id&&a(n.portal.url,i.url)){const{total:e}=await n.fetchResources();p=!!e}if(p){const t=await n.copy({copyResources:"all",folder:s});e.id=t.id,e.portal=t.portal;const o=e.toJSON();await e.load(),e.read(o),await e.update({data:r})}else await(i.user?.addItem({item:e,folder:s,data:r}));return p}function we(e,r,a,n,s){t.prototype.read.call(r,{version:n.version,authoringApp:n.authoringApp,authoringAppVersion:n.authoringAppVersion},{origin:e.origin,ignoreDefaults:!0,url:a.itemUrl?o(a.itemUrl):void 0}),i(s),r.resourceInfo=n}export{W as save,j as saveAs};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import{when as s}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{getBasemapThumbnailUrl as o,isBasemap3D as r}from"../support/basemapUtils.js";import l from"./Widget.js";import n from"./BasemapGallery/BasemapGalleryViewModel.js";import{css as d}from"./BasemapGallery/css.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{Heading as m}from"./support/Heading.js";import{accessibleHandler as h}from"./support/decorators/accessibleHandler.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";import{onResize as v}from"./support/widgetUtils.js";const y={small:200,default:280,wide:420};let w=class extends l{constructor(e,t){super(e,t),this.disabled=!1,this.headingLevel=2,this.iconClass=d.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new n,this._focusBasemapItemEnabled=!1,this._container=null,this._width=0,this._onContainerCreated=e=>{this._container=e}}initialize(){this.addHandles([v((()=>this._container),(({contentRect:e})=>{this._width=e.width})),s((()=>this.source),(()=>this.viewModel.load()),{sync:!0,initial:!0,once:!0})])}loadDependencies(){return p({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip.js")})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get includeCurrentBasemap(){return this.viewModel.includeCurrentBasemap}set includeCurrentBasemap(e){this.viewModel.includeCurrentBasemap=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="loading"===this.source.state,t=this.disabled||"disabled"===this.viewModel.state,s=this.viewModel.items,a={[d.sourceLoading]:e,[c.disabled]:t},i=this._width;i<=y.small||i>=y.wide?a[d.layoutGrid]=!0:i<y.default&&(a[d.narrowItems]=!0);const o=e?g("div",{class:d.loader,key:"loader"}):null,r=e?null:s.length>0?g("ul",{bind:this,"aria-disabled":this.disabled,"aria-label":this.label,class:d.itemContainer,key:"item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},s.map(((e,t)=>this._renderBasemapGalleryItem(e,t))).toArray()):g("div",{class:c.empty,key:"empty-message"},g(m,{level:this.headingLevel},this.messages.noBasemaps));return g("div",{key:"container",class:this.classes(d.base,c.widget,c.panel,a),afterCreate:this._onContainerCreated},0===this._width?null:[o,r])}_getRoundRobinIndex(e,t){return(e+t)%t}_handleKeyDown(e){const{key:t}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t))return;e.preventDefault();const{items:s,activeBasemapIndex:a}=this.viewModel,i="ArrowUp"===t||"ArrowLeft"===t?this._getRoundRobinIndex(Math.max(a-1,-1),s.length):this._getRoundRobinIndex(a+1,s.length),o=s.at(i);"ready"===o?.state&&(this.viewModel.activeBasemap=o.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&0===e.tabIndex&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const t=e.currentTarget["data-item"];"ready"===t.state&&(this.viewModel.activeBasemap=t.basemap)}_renderBasemapGalleryItem(e,s){const a=o(e.basemap)||t("esri/themes/base/images/basemap-toggle-64.svg"),i=e.basemap.title,l=e.basemap.portalItem?.snippet,n=e.error?.message||l||i,{viewModel:{state:p,activeBasemapIndex:m}}=this,h=this.disabled||"disabled"===p,u=m===s,v=u||-1===m&&0===s?0:-1,y="loading"===p,w={[d.selectedItem]:u,[d.itemError]:"error"===e.state},b=`basemapgallery-item-${e.uid}`;return g("li",{"aria-checked":u.toString(),"aria-disabled":h.toString(),"aria-labelledby":b,bind:this,class:this.classes(d.item,w),"data-item":e,key:e.uid,role:"radio",tabIndex:v,title:n,afterUpdate:this._focusBasemapItem,onclick:this._handleClick,onkeydown:this._handleClick},g("img",{alt:"",class:d.itemThumbnail,src:a}),g("div",{key:"content",class:d.itemContent},g("div",{key:"title",class:d.itemTitle},g("span",{id:b},i)),r(e.basemap)?this._render3DTags():null),"loading"===e.state||u&&y?g("calcite-scrim",null,g("span",{key:"loader","aria-hidden":"true",role:"presentation",class:c.loaderAnimation})):null)}_render3DTags(){const{messages:e}=this;return g("div",{key:"tag",class:d.itemTagsContainer},g("calcite-chip",{key:"tag-3d",value:e.tag3D,scale:"s"},this.messages.tag3D),g("calcite-chip",{key:"tag-beta",value:e.tagBeta,scale:"s",appearance:"outline-fill"},this.messages.tagBeta))}};e([a()],w.prototype,"activeBasemap",null),e([a()],w.prototype,"disabled",void 0),e([a()],w.prototype,"headingLevel",void 0),e([a()],w.prototype,"iconClass",void 0),e([a()],w.prototype,"icon",void 0),e([a()],w.prototype,"label",null),e([a(),u("esri/widgets/BasemapGallery/t9n/BasemapGallery")],w.prototype,"messages",void 0),e([a()],w.prototype,"source",null),e([a()],w.prototype,"view",null),e([a()],w.prototype,"viewModel",void 0),e([a()],w.prototype,"_focusBasemapItemEnabled",void 0),e([a()],w.prototype,"_container",void 0),e([a()],w.prototype,"_width",void 0),e([h()],w.prototype,"_handleClick",null),w=e([i("esri.widgets.BasemapGallery")],w);const b=w;export{b as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import{when as s}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{getBasemapThumbnailUrl as o,isBasemap3D as r}from"../support/basemapUtils.js";import l from"./Widget.js";import n from"./BasemapGallery/BasemapGalleryViewModel.js";import{css as d}from"./BasemapGallery/css.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{Heading as m}from"./support/Heading.js";import{accessibleHandler as h}from"./support/decorators/accessibleHandler.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";import{onResize as v}from"./support/widgetUtils.js";const y={small:200,default:280,wide:420};let w=class extends l{constructor(e,t){super(e,t),this.disabled=!1,this.headingLevel=2,this.iconClass=d.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new n,this._focusBasemapItemEnabled=!1,this._container=null,this._width=0,this._onContainerCreated=e=>{this._container=e}}initialize(){this.addHandles([v((()=>this._container),(({contentRect:e})=>{this._width=e.width})),s((()=>this.source),(()=>this.viewModel.load()),{sync:!0,initial:!0,once:!0})])}loadDependencies(){return p({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip.js")})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get includeCurrentBasemap(){return this.viewModel.includeCurrentBasemap}set includeCurrentBasemap(e){this.viewModel.includeCurrentBasemap=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="loading"===this.source.state,t=this.disabled||"disabled"===this.viewModel.state,s=this.viewModel.items,a={[d.sourceLoading]:e,[c.disabled]:t},i=this._width;i<=y.small||i>=y.wide?a[d.layoutGrid]=!0:i<y.default&&(a[d.narrowItems]=!0);const o=e?g("div",{class:d.loader,key:"loader"}):null,r=e?null:s.length>0?g("ul",{bind:this,"aria-disabled":this.disabled,"aria-label":this.label,class:d.itemContainer,key:"item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},s.map(((e,t)=>this._renderBasemapGalleryItem(e,t))).toArray()):g("div",{class:c.empty,key:"empty-message"},g(m,{level:this.headingLevel},this.messages.noBasemaps));return g("div",{key:"container",class:this.classes(d.base,c.widget,c.panelHeightOnly,a),afterCreate:this._onContainerCreated},0===this._width?null:[o,r])}_getRoundRobinIndex(e,t){return(e+t)%t}_handleKeyDown(e){const{key:t}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t))return;e.preventDefault();const{items:s,activeBasemapIndex:a}=this.viewModel,i="ArrowUp"===t||"ArrowLeft"===t?this._getRoundRobinIndex(Math.max(a-1,-1),s.length):this._getRoundRobinIndex(a+1,s.length),o=s.at(i);"ready"===o?.state&&(this.viewModel.activeBasemap=o.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&0===e.tabIndex&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const t=e.currentTarget["data-item"];"ready"===t.state&&(this.viewModel.activeBasemap=t.basemap)}_renderBasemapGalleryItem(e,s){const a=o(e.basemap)||t("esri/themes/base/images/basemap-toggle-64.svg"),i=e.basemap.title,l=e.basemap.portalItem?.snippet,n=e.error?.message||l||i,{viewModel:{state:p,activeBasemapIndex:m}}=this,h=this.disabled||"disabled"===p,u=m===s,v=u||-1===m&&0===s?0:-1,y="loading"===p,w={[d.selectedItem]:u,[d.itemError]:"error"===e.state},b=`basemapgallery-item-${e.uid}`;return g("li",{"aria-checked":u.toString(),"aria-disabled":h.toString(),"aria-labelledby":b,bind:this,class:this.classes(d.item,w),"data-item":e,key:e.uid,role:"radio",tabIndex:v,title:n,afterUpdate:this._focusBasemapItem,onclick:this._handleClick,onkeydown:this._handleClick},g("img",{alt:"",class:d.itemThumbnail,src:a}),g("div",{key:"content",class:d.itemContent},g("div",{key:"title",class:d.itemTitle},g("span",{id:b},i)),r(e.basemap)?this._render3DTags():null),"loading"===e.state||u&&y?g("calcite-scrim",null,g("span",{key:"loader","aria-hidden":"true",role:"presentation",class:c.loaderAnimation})):null)}_render3DTags(){const{messages:e}=this;return g("div",{key:"tag",class:d.itemTagsContainer},g("calcite-chip",{key:"tag-3d",value:e.tag3D,scale:"s"},this.messages.tag3D),g("calcite-chip",{key:"tag-beta",value:e.tagBeta,scale:"s",appearance:"outline-fill"},this.messages.tagBeta))}};e([a()],w.prototype,"activeBasemap",null),e([a()],w.prototype,"disabled",void 0),e([a()],w.prototype,"headingLevel",void 0),e([a()],w.prototype,"iconClass",void 0),e([a()],w.prototype,"icon",void 0),e([a()],w.prototype,"label",null),e([a(),u("esri/widgets/BasemapGallery/t9n/BasemapGallery")],w.prototype,"messages",void 0),e([a()],w.prototype,"source",null),e([a()],w.prototype,"view",null),e([a()],w.prototype,"viewModel",void 0),e([a()],w.prototype,"_focusBasemapItemEnabled",void 0),e([a()],w.prototype,"_container",void 0),e([a()],w.prototype,"_width",void 0),e([h()],w.prototype,"_handleClick",null),w=e([i("esri.widgets.BasemapGallery")],w);const b=w;export{b as default};