@arcgis/core 5.0.0-next.54 → 5.0.0-next.56

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 (530) hide show
  1. package/Color.d.ts +12 -4
  2. package/Ground.d.ts +4 -6
  3. package/Ground.js +1 -1
  4. package/WebScene.js +1 -1
  5. package/applications/Components/SelectionOperation.d.ts +5 -0
  6. package/applications/Components/SketchTooltipControls.d.ts +5 -0
  7. package/applications/Components/actionUtils.d.ts +5 -0
  8. package/applications/Components/analysisUtils.d.ts +5 -0
  9. package/applications/Components/arcadeEditorUtils.d.ts +5 -0
  10. package/applications/Components/arcadeFeatureUtils.d.ts +5 -0
  11. package/applications/Components/basemapUtils.d.ts +5 -0
  12. package/applications/Components/drawUtils.d.ts +13 -1
  13. package/applications/Components/featureUtils.d.ts +5 -0
  14. package/applications/Components/fontUtils.d.ts +5 -0
  15. package/applications/Components/formatUtils.d.ts +5 -0
  16. package/applications/Components/getDefaultUnits.d.ts +5 -0
  17. package/applications/Components/gfxUtils.d.ts +5 -0
  18. package/applications/Components/imageryUtils.d.ts +5 -0
  19. package/applications/Components/layerOriginUtils.d.ts +5 -0
  20. package/applications/Components/layersEffectsJsonUtils.d.ts +5 -0
  21. package/applications/Components/previewSymbol2D.d.ts +5 -0
  22. package/applications/Components/reactiveUtils.d.ts +6 -0
  23. package/applications/Components/sanitizerUtils.d.ts +5 -0
  24. package/applications/Components/stringUtils.d.ts +6 -2
  25. package/applications/Components/styleUtils.d.ts +5 -0
  26. package/applications/Components/svgUtils.d.ts +5 -0
  27. package/applications/Components/testUtils.d.ts +5 -0
  28. package/applications/Components/viewUtils.d.ts +5 -0
  29. package/applications/Components/webStyleSymbolUtils.d.ts +5 -0
  30. package/applications/Excalibur/videoViewUtils.d.ts +5 -0
  31. package/applications/ExperienceBuilder/sketchUtils.d.ts +5 -0
  32. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +10 -0
  33. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +10 -0
  34. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +11 -1
  35. package/applications/KnowledgeStudio/reshape.d.ts +5 -0
  36. package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +5 -0
  37. package/applications/MapViewer/layerUtils.d.ts +5 -0
  38. package/applications/MapViewer/mediaUtils.d.ts +5 -0
  39. package/applications/MapViewer/templateUtils.d.ts +5 -0
  40. package/applications/PortalApp/layerUtils.d.ts +5 -0
  41. package/applications/SceneViewer/colorUtils.d.ts +5 -0
  42. package/applications/SceneViewer/devEnvironmentUtils.d.ts +5 -0
  43. package/applications/SceneViewer/layerUtils.d.ts +5 -0
  44. package/applications/SceneViewer/sceneViewerUtils.d.ts +6 -2
  45. package/applications/SceneViewer/symbolUtils.d.ts +5 -0
  46. package/applications/Urban/meshUtils.d.ts +5 -0
  47. package/applications/WebEditor/sketchUtils.d.ts +5 -0
  48. package/arcade.d.ts +22 -0
  49. package/assets/esri/core/workers/RemoteClient.js +1 -1
  50. package/assets/esri/core/workers/chunks/{308fb48d080e01499a26.js → 436f206898306df019ac.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{f2e8abb556a380cc2941.js → 492d575894c7905bb70c.js} +1 -1
  52. package/assets/esri/core/workers/chunks/5340887a4a48bde3407a.js +1 -0
  53. package/assets/esri/core/workers/chunks/5873c7b65d0fb04998fb.js +1 -0
  54. package/assets/esri/core/workers/chunks/82ced9254b27707522ef.js +1 -0
  55. package/assets/esri/core/workers/chunks/8628bf45a33af786cd49.js +1 -0
  56. package/assets/esri/core/workers/chunks/{d63cf90d1356d1f10138.js → 8f4c480c418eba299c2b.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{fa92a7c11befbad8739f.js → b4f944ef6c174b20b619.js} +1 -1
  58. package/assets/esri/core/workers/chunks/c531c0e3d420a1be0ad2.js +316 -0
  59. package/assets/esri/core/workers/chunks/d9736c783513e9c9b22f.js +1 -0
  60. package/assets/esri/core/workers/chunks/{18cc131fd63d8c15df54.js → da2c41ac0f82f32013c1.js} +8 -8
  61. package/assets/esri/core/workers/chunks/{cc67f066c3c0c2a1a37c.js → dd99b77a7c0a052507bb.js} +1 -1
  62. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  63. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  64. package/chunks/ChapmanAtmosphere.glsl.js +10 -9
  65. package/chunks/GlowComposition.glsl.js +1 -1
  66. package/chunks/HUDMaterial.glsl.js +1 -1
  67. package/chunks/Haze.glsl.js +4 -4
  68. package/chunks/LineCallout.glsl.js +2 -2
  69. package/chunks/Precipitation.glsl.js +1 -1
  70. package/chunks/RasterColorizer.glsl.js +10 -10
  71. package/chunks/Terrain.glsl.js +1 -1
  72. package/chunks/Viewshed.glsl.js +1 -1
  73. package/chunks/lyr3DMain.js +1 -1
  74. package/chunks/vec32.js +1 -1
  75. package/config.d.ts +19 -1
  76. package/config.js +1 -1
  77. package/core/Error.d.ts +3 -4
  78. package/core/Error.js +1 -1
  79. package/core/Warning.js +1 -1
  80. package/core/accessorSupport/decorators.d.ts +11 -0
  81. package/core/accessorSupport/types.d.ts +2 -0
  82. package/core/has.js +1 -1
  83. package/core/lang.d.ts +6 -0
  84. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  85. package/core/libs/gl-matrix-2/vec3.js +1 -1
  86. package/core/promiseUtils.d.ts +5 -0
  87. package/core/quantity.d.ts +5 -0
  88. package/core/reactiveUtils.d.ts +142 -0
  89. package/core/scheduling.d.ts +26 -5
  90. package/core/scheduling.js +1 -1
  91. package/core/sql/WhereClause.d.ts +2 -13
  92. package/core/sql/{WhereGrammar.d.ts → types.d.ts} +22 -1
  93. package/core/sql.d.ts +8 -0
  94. package/core/string.js +1 -1
  95. package/core/types.d.ts +30 -1
  96. package/core/units.d.ts +8 -0
  97. package/core/urlUtils.d.ts +7 -0
  98. package/core/workers/loaderConfig.js +1 -1
  99. package/core/workers/workerFactory.js +1 -1
  100. package/core/workers.d.ts +26 -0
  101. package/form/elements/inputs.d.ts +55 -0
  102. package/form/elements.d.ts +43 -0
  103. package/geometry/coordinateFormatter.d.ts +33 -0
  104. package/geometry/geometryEngine.d.ts +16 -0
  105. package/geometry/operators/affineTransformOperator.d.ts +5 -0
  106. package/geometry/operators/alphaShapeOperator.d.ts +9 -0
  107. package/geometry/operators/areaOperator.d.ts +7 -0
  108. package/geometry/operators/autoCompleteOperator.d.ts +5 -0
  109. package/geometry/operators/boundaryOperator.d.ts +5 -0
  110. package/geometry/operators/bufferOperator.d.ts +11 -0
  111. package/geometry/operators/centroidOperator.d.ts +14 -0
  112. package/geometry/operators/clipOperator.d.ts +7 -0
  113. package/geometry/operators/containsOperator.d.ts +9 -0
  114. package/geometry/operators/convexHullOperator.d.ts +9 -0
  115. package/geometry/operators/crossesOperator.d.ts +7 -0
  116. package/geometry/operators/cutOperator.d.ts +18 -0
  117. package/geometry/operators/densifyOperator.d.ts +21 -0
  118. package/geometry/operators/differenceOperator.d.ts +7 -0
  119. package/geometry/operators/disjointOperator.d.ts +8 -0
  120. package/geometry/operators/distanceOperator.d.ts +8 -0
  121. package/geometry/operators/equalsOperator.d.ts +5 -0
  122. package/geometry/operators/extendOperator.d.ts +8 -0
  123. package/geometry/operators/generalizeOperator.d.ts +7 -0
  124. package/geometry/operators/geodesicBufferOperator.d.ts +13 -0
  125. package/geometry/operators/geodesicProximityOperator.d.ts +13 -0
  126. package/geometry/operators/geodeticAreaOperator.d.ts +11 -0
  127. package/geometry/operators/geodeticDensifyOperator.d.ts +12 -0
  128. package/geometry/operators/geodeticDistanceOperator.d.ts +14 -0
  129. package/geometry/operators/geodeticLengthOperator.d.ts +11 -0
  130. package/geometry/operators/geodeticUtilsOperator.d.ts +11 -0
  131. package/geometry/operators/graphicBufferOperator.d.ts +7 -0
  132. package/geometry/operators/integrateOperator.d.ts +9 -0
  133. package/geometry/operators/intersectionOperator.d.ts +7 -0
  134. package/geometry/operators/intersectsOperator.d.ts +9 -0
  135. package/geometry/operators/isNearOperator.d.ts +7 -0
  136. package/geometry/operators/labelPointOperator.d.ts +14 -0
  137. package/geometry/operators/lengthOperator.d.ts +7 -0
  138. package/geometry/operators/linesToPolygonsOperator.d.ts +5 -0
  139. package/geometry/operators/locateBetweenOperator.d.ts +10 -0
  140. package/geometry/operators/minimumBoundingCircleOperator.d.ts +13 -0
  141. package/geometry/operators/multiPartToSinglePartOperator.d.ts +7 -0
  142. package/geometry/operators/offsetOperator.d.ts +44 -0
  143. package/geometry/operators/overlapsOperator.d.ts +7 -0
  144. package/geometry/operators/polygonOverlayOperator.d.ts +6 -0
  145. package/geometry/operators/polygonSlicerOperator.d.ts +5 -0
  146. package/geometry/operators/projectOperator.d.ts +41 -0
  147. package/geometry/operators/proximityOperator.d.ts +8 -0
  148. package/geometry/operators/relateOperator.d.ts +7 -0
  149. package/geometry/operators/reshapeOperator.d.ts +5 -0
  150. package/geometry/operators/shapePreservingProjectOperator.d.ts +27 -0
  151. package/geometry/operators/simplifyOGCOperator.d.ts +8 -0
  152. package/geometry/operators/simplifyOperator.d.ts +9 -0
  153. package/geometry/operators/support/geographicTransformationUtils.d.ts +11 -0
  154. package/geometry/operators/symmetricDifferenceOperator.d.ts +12 -0
  155. package/geometry/operators/touchesOperator.d.ts +7 -0
  156. package/geometry/operators/unionOperator.d.ts +7 -0
  157. package/geometry/operators/withinOperator.d.ts +9 -0
  158. package/geometry/projection/projectPointToVector.js +1 -1
  159. package/geometry/support/geodesicUtils.d.ts +8 -0
  160. package/geometry/support/jsonUtils.d.ts +7 -0
  161. package/geometry/support/meshUtils.d.ts +5 -0
  162. package/geometry/support/normalizeUtils.d.ts +7 -0
  163. package/geometry/support/webMercatorUtils.d.ts +12 -0
  164. package/geometry/types.d.ts +10 -1
  165. package/geometry.d.ts +38 -0
  166. package/interfaces.d.ts +52 -58
  167. package/intl.d.ts +111 -0
  168. package/kernel.d.ts +5 -0
  169. package/kernel.js +1 -1
  170. package/layers/BaseDynamicLayer.d.ts +1 -1
  171. package/layers/CSVLayer.d.ts +2 -2
  172. package/layers/CatalogLayer.d.ts +2 -2
  173. package/layers/FeatureLayer.d.ts +8 -4
  174. package/layers/GeoJSONLayer.d.ts +2 -1
  175. package/layers/ILyr3DWasmPerSceneView.js +1 -1
  176. package/layers/Layer.d.ts +1 -1
  177. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  178. package/layers/OGCFeatureLayer.d.ts +1 -1
  179. package/layers/ParquetLayer.d.ts +1 -1
  180. package/layers/RouteLayer.js +1 -1
  181. package/layers/SceneLayer.d.ts +2 -1
  182. package/layers/StreamLayer.d.ts +6 -5
  183. package/layers/SubtypeGroupLayer.d.ts +3 -4
  184. package/layers/VectorTileLayer.d.ts +1 -1
  185. package/layers/WFSLayer.d.ts +2 -1
  186. package/layers/WMSLayer.d.ts +2 -2
  187. package/layers/catalog/catalogUtils.d.ts +6 -0
  188. package/layers/ogc/wcsUtils.d.ts +6 -0
  189. package/layers/ogc/wfsUtils.d.ts +6 -0
  190. package/layers/orientedImagery/transformations/imageToWorld.d.ts +10 -0
  191. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  192. package/layers/orientedImagery/transformations/worldToImage.d.ts +10 -0
  193. package/layers/orientedImagery/types.d.ts +1 -1
  194. package/layers/support/SubtypeSublayer.d.ts +13 -0
  195. package/layers/support/arcadeUtils.d.ts +5 -0
  196. package/layers/support/csvUtils.d.ts +6 -0
  197. package/layers/support/fieldUtils.d.ts +9 -0
  198. package/layers/support/parquetUtils.d.ts +6 -0
  199. package/layers/support/rasterFunctionConstants.d.ts +9 -0
  200. package/layers/support/rasterFunctionUtils.d.ts +7 -0
  201. package/package.json +1 -1
  202. package/pointCloudRenderers.d.ts +44 -0
  203. package/popup/content.d.ts +48 -0
  204. package/rasterRenderers.d.ts +46 -0
  205. package/renderers/support/AuthoringInfo.d.ts +1 -1
  206. package/renderers/support/jsonUtils.d.ts +7 -0
  207. package/renderers/support/utils.d.ts +5 -0
  208. package/renderers/visualVariables/SizeVariable.d.ts +0 -3
  209. package/renderers/visualVariables/VisualVariable.d.ts +1 -1
  210. package/renderers/visualVariables/support/VisualVariableLegendOptions.d.ts +1 -1
  211. package/renderers.d.ts +46 -0
  212. package/request.d.ts +17 -0
  213. package/rest/closestFacility.d.ts +21 -0
  214. package/rest/featureService/utils.d.ts +5 -0
  215. package/rest/find.d.ts +21 -0
  216. package/rest/geometryService.d.ts +14 -0
  217. package/rest/geoprocessor.d.ts +16 -0
  218. package/rest/identify.d.ts +19 -0
  219. package/rest/imageService.d.ts +10 -0
  220. package/rest/knowledgeGraphService.d.ts +39 -0
  221. package/rest/lastMileDelivery.d.ts +12 -0
  222. package/rest/locator.d.ts +24 -0
  223. package/rest/networkService.d.ts +5 -0
  224. package/rest/networks/queryAssociations.d.ts +7 -0
  225. package/rest/networks/support/NetworkElement.d.ts +1 -1
  226. package/rest/networks/synthesizeAssociationGeometries.d.ts +7 -0
  227. package/rest/networks/trace.d.ts +6 -0
  228. package/rest/places.d.ts +34 -0
  229. package/rest/print.d.ts +74 -0
  230. package/rest/query.d.ts +33 -0
  231. package/rest/route.d.ts +18 -0
  232. package/rest/serviceArea.d.ts +18 -0
  233. package/rest/support/AreasAndLengthsParameters.d.ts +2 -2
  234. package/rest/support/AttachmentQuery.d.ts +0 -1
  235. package/rest/support/AttributeBinsQuery.d.ts +3 -3
  236. package/rest/support/AutoIntervalBinParameters.d.ts +4 -4
  237. package/rest/support/DateBinParameters.d.ts +2 -2
  238. package/rest/support/DateBinTimeInterval.d.ts +1 -1
  239. package/rest/support/DensifyParameters.d.ts +1 -1
  240. package/rest/support/DirectionsFeature.d.ts +1 -1
  241. package/rest/support/GPMessage.d.ts +1 -1
  242. package/rest/support/LastMileDeliveryParameters.d.ts +1 -1
  243. package/rest/support/QuantizationParameters.d.ts +3 -3
  244. package/rest/support/Query.d.ts +0 -1
  245. package/rest/support/QueryMixin.d.ts +1 -1
  246. package/rest/support/RelationshipQuery.d.ts +0 -1
  247. package/rest/support/interfaces.d.ts +1 -2
  248. package/rest/symbolService.d.ts +9 -0
  249. package/smartMapping/heuristics/binLevel.d.ts +12 -0
  250. package/smartMapping/heuristics/scaleRange.d.ts +15 -0
  251. package/smartMapping/heuristics/sizeRange.d.ts +12 -0
  252. package/smartMapping/labels/bins.d.ts +13 -0
  253. package/smartMapping/labels/clusters.d.ts +17 -1
  254. package/smartMapping/popup/clusters.d.ts +21 -0
  255. package/smartMapping/popup/templates.d.ts +18 -0
  256. package/smartMapping/raster/renderers/classBreaks.d.ts +7 -0
  257. package/smartMapping/raster/renderers/colormap.d.ts +7 -0
  258. package/smartMapping/raster/renderers/flow.d.ts +19 -0
  259. package/smartMapping/raster/renderers/rgb.d.ts +7 -0
  260. package/smartMapping/raster/renderers/shadedRelief.d.ts +7 -0
  261. package/smartMapping/raster/renderers/stretch.d.ts +7 -0
  262. package/smartMapping/raster/renderers/uniqueValue.d.ts +7 -0
  263. package/smartMapping/raster/renderers/vectorField.d.ts +20 -0
  264. package/smartMapping/raster/support/colorRamps.d.ts +7 -0
  265. package/smartMapping/raster/support/utils.d.ts +5 -0
  266. package/smartMapping/renderers/color.d.ts +17 -0
  267. package/smartMapping/renderers/dotDensity.d.ts +21 -0
  268. package/smartMapping/renderers/heatmap.d.ts +17 -0
  269. package/smartMapping/renderers/location.d.ts +10 -0
  270. package/smartMapping/renderers/opacity.d.ts +19 -0
  271. package/smartMapping/renderers/pieChart.d.ts +19 -0
  272. package/smartMapping/renderers/predominance.d.ts +27 -0
  273. package/smartMapping/renderers/relationship.d.ts +48 -0
  274. package/smartMapping/renderers/size.d.ts +18 -0
  275. package/smartMapping/renderers/support/rendererUtils.d.ts +8 -0
  276. package/smartMapping/renderers/support/spikeUtils.d.ts +6 -0
  277. package/smartMapping/renderers/type.d.ts +18 -0
  278. package/smartMapping/renderers/univariateColorSize.d.ts +29 -0
  279. package/smartMapping/statistics/classBreaks.d.ts +14 -0
  280. package/smartMapping/statistics/heatmapStatistics.d.ts +15 -0
  281. package/smartMapping/statistics/histogram.d.ts +17 -0
  282. package/smartMapping/statistics/predominantCategories.d.ts +6 -0
  283. package/smartMapping/statistics/summaryStatistics.d.ts +15 -0
  284. package/smartMapping/statistics/summaryStatisticsForAge.d.ts +8 -1
  285. package/smartMapping/statistics/support/ageUtils.d.ts +8 -0
  286. package/smartMapping/statistics/support/predominanceUtils.d.ts +8 -1
  287. package/smartMapping/statistics/types.d.ts +6 -1
  288. package/smartMapping/statistics/uniqueValues.d.ts +13 -0
  289. package/smartMapping/symbology/color.d.ts +8 -0
  290. package/smartMapping/symbology/dotDensity.d.ts +7 -0
  291. package/smartMapping/symbology/flow.d.ts +8 -0
  292. package/smartMapping/symbology/heatmap.d.ts +8 -0
  293. package/smartMapping/symbology/location.d.ts +8 -0
  294. package/smartMapping/symbology/pieChart.d.ts +7 -0
  295. package/smartMapping/symbology/predominance.d.ts +7 -0
  296. package/smartMapping/symbology/relationship.d.ts +7 -0
  297. package/smartMapping/symbology/size.d.ts +7 -0
  298. package/smartMapping/symbology/support/colorRamps.d.ts +7 -0
  299. package/smartMapping/symbology/type.d.ts +8 -0
  300. package/support/groundUtils.js +1 -1
  301. package/support/popupUtils.d.ts +5 -0
  302. package/support/revision.js +1 -1
  303. package/support/timeUtils.d.ts +9 -0
  304. package/symbols/CIMSymbol.d.ts +1 -1
  305. package/symbols/ExtrudeSymbol3DLayer.d.ts +2 -2
  306. package/symbols/FillSymbol3DLayer.d.ts +1 -1
  307. package/symbols/LineSymbol3DLayer.d.ts +2 -2
  308. package/symbols/ObjectSymbol3DLayer.d.ts +2 -2
  309. package/symbols/PathSymbol3DLayer.d.ts +2 -2
  310. package/symbols/TextSymbol.d.ts +2 -2
  311. package/symbols/support/Symbol3DFillMaterial.d.ts +1 -1
  312. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  313. package/symbols/support/Symbol3DHalo.d.ts +8 -4
  314. package/symbols/support/Symbol3DHalo.js +1 -1
  315. package/symbols/support/cimConversionUtils.d.ts +9 -0
  316. package/symbols/support/cimSymbolUtils.d.ts +10 -0
  317. package/symbols/support/jsonUtils.d.ts +7 -0
  318. package/symbols/support/symbolUtils.d.ts +5 -0
  319. package/symbols.d.ts +59 -0
  320. package/tables/elements.d.ts +41 -0
  321. package/time/TimeExtent.d.ts +1 -1
  322. package/time/TimeInterval.d.ts +1 -1
  323. package/unionTypes.d.ts +5 -0
  324. package/versionManagement/utils.d.ts +5 -0
  325. package/versionManagement/versionAdapters/utils.d.ts +5 -0
  326. package/views/2d/MapViewConstraints.d.ts +18 -10
  327. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  328. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  329. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  330. package/views/2d/layers/RouteLayerView2D.js +1 -1
  331. package/views/2d/layers/TileLayerView2D.js +1 -1
  332. package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
  333. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +5 -0
  334. package/views/2d/layers/types.d.ts +6 -0
  335. package/views/2d/types.d.ts +3 -1
  336. package/views/3d/analysis/DirectLineMeasurement/types.d.ts +5 -0
  337. package/views/3d/analysis/LineOfSight/types.d.ts +5 -0
  338. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -1
  339. package/views/3d/analysis/VolumeMeasurement/types.d.ts +5 -0
  340. package/views/3d/environment/ChapmanApproximation.glsl.js +9 -10
  341. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  342. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  343. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  344. package/views/3d/environment/CloudsParameters.js +1 -1
  345. package/views/3d/environment/EnvironmentManager.js +1 -1
  346. package/views/3d/environment/SceneViewEnvironment.d.ts +1 -1
  347. package/views/3d/environment/types.d.ts +13 -0
  348. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  349. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  350. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  351. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  352. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  353. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  354. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  355. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  356. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  357. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  358. package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
  359. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  360. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  361. package/views/3d/terrain/TerrainSurface.js +1 -1
  362. package/views/3d/webgl/ManagedFBO.d.ts +4 -5
  363. package/views/3d/webgl/RenderNode.d.ts +1 -1
  364. package/views/3d/{webgl-engine/lighting/SceneLighting.d.ts → webgl/types.d.ts} +4 -6
  365. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  366. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
  367. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +2 -2
  368. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  369. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
  370. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  371. package/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js +1 -1
  372. package/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js +1 -1
  373. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  374. package/views/3d/webgl-engine/effects/haze/Haze.glsl.js +1 -1
  375. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  376. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  377. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  378. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  379. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  380. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  381. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  382. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  383. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +8 -8
  384. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +5 -5
  385. package/views/3d/webgl.d.ts +6 -0
  386. package/views/BreakpointsOwner.d.ts +16 -16
  387. package/views/IBreakpointsOwner.d.ts +15 -15
  388. package/views/MapView.d.ts +1 -1
  389. package/views/PopupView.d.ts +2 -2
  390. package/views/SceneView.d.ts +14 -17
  391. package/views/SelectionManager.d.ts +1 -0
  392. package/views/SelectionManager.js +1 -1
  393. package/views/VideoView.d.ts +1 -2
  394. package/views/VideoView.js +1 -1
  395. package/views/View.d.ts +8 -11
  396. package/views/View2D.d.ts +1 -2
  397. package/views/analysis/AreaMeasurement/types.d.ts +6 -0
  398. package/views/analysis/DistanceMeasurement/types.d.ts +5 -0
  399. package/views/analysis/ElevationProfile/ElevationProfileError.d.ts +4 -4
  400. package/views/analysis/ElevationProfile/types.d.ts +6 -0
  401. package/views/analysis/types.d.ts +5 -0
  402. package/views/draw/DrawOperation.js +1 -1
  403. package/views/draw/PolygonDrawAction.d.ts +1 -1
  404. package/views/draw/PolygonDrawAction.js +1 -1
  405. package/views/draw/PolylineDrawAction.d.ts +1 -1
  406. package/views/draw/PolylineDrawAction.js +1 -1
  407. package/views/draw/support/GraphicMover.js +1 -1
  408. package/views/draw/types.d.ts +3 -1
  409. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  410. package/views/interactive/sketch/Units.d.ts +5 -1
  411. package/views/interactive/snapping/GridSnappingEngine.js +1 -1
  412. package/views/layers/BuildingSceneLayerView.d.ts +1 -1
  413. package/views/layers/ImageryLayerViewMixin.d.ts +2 -3
  414. package/views/layers/LayerView.d.ts +1 -1
  415. package/views/layers/support/highlightUtils.js +1 -1
  416. package/views/support/colorUtils.d.ts +5 -0
  417. package/views/support/selectionUtils.js +1 -1
  418. package/views/types.d.ts +69 -1
  419. package/views/ui/types.d.ts +12 -1
  420. package/webscene/Environment.d.ts +2 -2
  421. package/webscene/support/FeatureReference.d.ts +1 -1
  422. package/webscene/types.d.ts +10 -1
  423. package/widgets/BasemapGallery.d.ts +1 -1
  424. package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -1
  425. package/widgets/BasemapLayerList.d.ts +1 -1
  426. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +1 -1
  427. package/widgets/BatchAttributeForm.d.ts +1 -1
  428. package/widgets/Bookmarks.d.ts +1 -2
  429. package/widgets/BuildingExplorer.d.ts +1 -1
  430. package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +1 -1
  431. package/widgets/CatalogLayerList.d.ts +1 -1
  432. package/widgets/Compass.d.ts +1 -1
  433. package/widgets/CoordinateConversion.d.ts +1 -2
  434. package/widgets/Daylight.d.ts +1 -1
  435. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +1 -2
  436. package/widgets/DirectionalPad/{utils.d.ts → types.d.ts} +3 -1
  437. package/widgets/Directions.d.ts +1 -2
  438. package/widgets/Editor/EditorViewModel.d.ts +1 -2
  439. package/widgets/Editor/SplitFeatureWorkflow.d.ts +1 -2
  440. package/widgets/Editor/SplitFeatureWorkflowData.d.ts +1 -1
  441. package/widgets/Editor/types.d.ts +8 -1
  442. package/widgets/Editor/workflowUtils.js +1 -1
  443. package/widgets/Editor.d.ts +2 -3
  444. package/widgets/Feature/types.d.ts +5 -1
  445. package/widgets/Feature.d.ts +1 -1
  446. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +2 -2
  447. package/widgets/FeatureForm/FieldInput.d.ts +1 -1
  448. package/widgets/FeatureForm.d.ts +1 -1
  449. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  450. package/widgets/FeatureTemplates.d.ts +1 -1
  451. package/widgets/Features/FeaturesViewModel.d.ts +2 -2
  452. package/widgets/Features.d.ts +1 -2
  453. package/widgets/FloorFilter.d.ts +1 -1
  454. package/widgets/Home/HomeViewModel.d.ts +1 -1
  455. package/widgets/Home.d.ts +1 -1
  456. package/widgets/LayerList/ListItemPanel.d.ts +1 -1
  457. package/widgets/LayerList/types.d.ts +2 -2
  458. package/widgets/LayerList.d.ts +1 -1
  459. package/widgets/Legend.d.ts +1 -1
  460. package/widgets/Locate/LocateViewModel.d.ts +2 -2
  461. package/widgets/Locate.d.ts +1 -1
  462. package/widgets/Popup/types.d.ts +2 -0
  463. package/widgets/Popup.d.ts +1 -2
  464. package/widgets/Print.d.ts +1 -1
  465. package/widgets/Search/types.d.ts +5 -0
  466. package/widgets/Search.d.ts +1 -1
  467. package/widgets/ShadowCast/DurationOptions.d.ts +1 -1
  468. package/widgets/ShadowCast/ShadowCastViewModel.d.ts +1 -1
  469. package/widgets/ShadowCast/{ShadowVisualizationType.d.ts → types.d.ts} +4 -1
  470. package/widgets/ShadowCast.d.ts +1 -1
  471. package/widgets/Sketch/types.d.ts +1 -1
  472. package/widgets/Slice.d.ts +1 -1
  473. package/widgets/TableList.d.ts +1 -1
  474. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +1 -1
  475. package/widgets/Track.d.ts +1 -1
  476. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +1 -1
  477. package/widgets/UtilityNetworkTrace/{support/ResultAreaHandler.d.ts → types.d.ts} +2 -2
  478. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  479. package/widgets/Weather/WeatherViewModel.d.ts +2 -2
  480. package/widgets/Weather.d.ts +1 -1
  481. package/widgets/smartMapping/support/utils.d.ts +6 -0
  482. package/widgets/support/GoTo.d.ts +1 -1
  483. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  484. package/widgets/support/SelectionList/LayerItem.js +1 -1
  485. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  486. package/widgets/support/SelectionList.js +1 -1
  487. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  488. package/widgets/support/forms/types.d.ts +2 -0
  489. package/widgets/support/symbolPreviewUtils.js +1 -1
  490. package/widgets/support/{goToUtils.d.ts → types.d.ts} +8 -1
  491. package/widgets/support/widget.d.ts +11 -0
  492. package/assets/esri/core/workers/chunks/0d1e8d5d9abee38e275e.js +0 -316
  493. package/assets/esri/core/workers/chunks/316f3e93aa0db48ef129.js +0 -1
  494. package/assets/esri/core/workers/chunks/73c3ee2697265b0f7208.js +0 -1
  495. package/assets/esri/core/workers/chunks/cd2ea924cb91cdb6dde9.js +0 -1
  496. package/assets/esri/core/workers/chunks/d57577c02fb2932e8305.js +0 -1
  497. package/assets/esri/core/workers/chunks/ec7e6427d99cf3148a61.js +0 -1
  498. package/colorUtils.d.ts +0 -13
  499. package/core/Logger.d.ts +0 -29
  500. package/core/Message.d.ts +0 -2
  501. package/core/Message.js +0 -5
  502. package/core/accessorSupport/PropertyOrigin.d.ts +0 -2
  503. package/core/sql/sql92grammar.d.ts +0 -12
  504. package/core/string.d.ts +0 -3
  505. package/core/time.d.ts +0 -2
  506. package/core/timeUtils.d.ts +0 -2
  507. package/views/2d/ViewStateManager.d.ts +0 -2
  508. package/views/2d/layers/support/clusterUtils.d.ts +0 -6
  509. package/views/3d/environment/lightingUtils.d.ts +0 -4
  510. package/views/3d/environment/weather.d.ts +0 -9
  511. package/views/3d/glTF/internal/resourceUtils.d.ts +0 -10
  512. package/views/3d/interactive/visualElements/DrapedVisualElementResources.d.ts +0 -2
  513. package/views/3d/support/QualityProfile.d.ts +0 -2
  514. package/views/SceneViewHitTestResult.d.ts +0 -64
  515. package/views/ViewingMode.d.ts +0 -2
  516. package/views/draw/DrawingMode.d.ts +0 -2
  517. package/views/draw/support/drawUtils.d.ts +0 -7
  518. package/views/ui/Padding.d.ts +0 -11
  519. package/views/viewType.d.ts +0 -2
  520. package/views/webgl/enums.d.ts +0 -38
  521. package/webscene/support/featureReferenceUtils.d.ts +0 -4
  522. package/widgets/DirectionalPad/constants.d.ts +0 -2
  523. package/widgets/Editor/support/splitFeatureUtils.d.ts +0 -7
  524. package/widgets/Feature/support/arcadeFeatureUtils.d.ts +0 -4
  525. package/widgets/Popup/actions.d.ts +0 -4
  526. package/widgets/ShadowCast/DurationMode.d.ts +0 -3
  527. package/widgets/support/Heading.d.ts +0 -7
  528. package/widgets/support/forms/formUtils.d.ts +0 -2
  529. /package/views/animation/{easing.d.ts → types.d.ts} +0 -0
  530. /package/views/draw/{DrawingMode.js → drawingModes.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import t from"../../Graphic.js";import{isSome as r,equals as n,addMany as o}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import"../../core/has.js";import i from"../../core/Error.js";import{handlesGroup as s,makeHandle as l,abortHandle as c}from"../../core/handleUtils.js";import{clone as u}from"../../core/lang.js";import d from"../../core/Logger.js";import{getOrCreateMapValue as p}from"../../core/MapUtils.js";import{debounce as f,isPromiseLike as y,throwIfAborted as m,whenOrAbort as h}from"../../core/promiseUtils.js";import{watch as b,on as g,whenOnce as w}from"../../core/reactiveUtils.js";import{px2pt as I}from"../../core/screenUtils.js";import{addMany as v}from"../../core/SetUtils.js";import{diff as T}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as S,isSharedGroupTemplate as F,isSharedTemplate as j,isSharedPresetTemplate as k,isStandardFeatureTemplate as A,isSharedFeatureTemplate as L}from"../../editing/templateUtils.js";import{getSharedTemplateProvider as U}from"../../editing/sharedTemplates/SharedTemplateProvider.js";import V from"../../layers/GraphicsLayer.js";import{featureHasFields as M,fixFields as O,getDisplayFieldName as x}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as q,isGraphicsLayer as z}from"../../layers/support/layerUtils.js";import{calculateTolerance as E}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as P}from"../../renderers/support/lengthUtils.js";import{isRenderer as C}from"../../renderers/support/typeUtils.js";import{getTransformationType as D}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{isGraphic as R}from"../../support/guards.js";import G from"../../symbols/SimpleFillSymbol.js";import B from"../../symbols/SimpleLineSymbol.js";import N from"../../symbols/SimpleMarkerSymbol.js";import{to3D as Z}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as Q}from"../../symbols/support/symbolUtils.js";import{getServices as W}from"../../undoredo/support/Services.js";import{GraphicState as $}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as J}from"../../views/draw/DrawingMode.js";import{createQueryGeometry as H}from"../../views/support/drapedUtils.js";import{filterGraphicHits as K,hitTestSelectSimilarDistance as X}from"../../views/support/hitTestSelectUtils.js";import{dependencySort as Y}from"./support/dependencySort.js";import{isDrawGraphicTool as _}from"../Sketch/support/sketchUtils.js";const ee=()=>d.getLogger("esri.widgets.Editor.workflowUtils");function te(e){return se(e)||ae(e)}function re(e){return!!e&&"features"in e}function ne(e){return null!=e&&"create-features"===e.type}function oe(e){return!!e&&"feature"in e}function ae(e){return null!=e&&"update-features"===e.type}function ie(e){return null!=e&&"update-feature"===e.type}function se(e){return null!=e&&e.type.includes("update-")&&"fullFeature"in e}function le(e){return null!=e&&"update"===e.type}function ce(e){return null!=e&&"merge-features"===e.type}function ue(e){return null!=e&&"split-feature"===e.type}function de(e){const t=e?.type;return"update-feature"===t||"update-table-record"===t||"update-features"===t||"split-feature"===t}function pe(e){return"merge"===e?.type}function fe(e){return"split"===e?.type}function ye(e){return ce(e)||ue(e)}function me(e){return"update-multiple"===e?.type}function he(e){const t=e&&"renderer"in e?e.renderer:null;if(!Se(t))return{rotation:null,size:null};const r=t.getVisualVariablesForType("rotation").filter(e=>(!e.axis||"heading"===e.axis)&&e.field&&!e.valueExpression),n=t.getVisualVariablesForType("size").filter(e=>e.field&&!e.useSymbolValue&&!e.valueExpression&&"real-world-size"===D(e));return{rotation:1===r.length?r[0]:null,size:1===n.length?n[0]:null}}function be(e){const t=e.sourceLayer;if(!(t&&"renderer"in t&&Se(t.renderer)))return{rotation:null,size:null};const{rotation:r,size:n}=he(t);let o=null,a=null;if(r){const e=t.fields?.filter(e=>e.name===r.field),n=1===e?.length?e[0]:null;o=ge(r,n)}if(n){const e=t.fields?.filter(e=>e.name===n.field),r=1===e?.length?e[0]:null;a=ve(n,r)}return{rotation:o,size:a}}function ge(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,n=t?.type??"double",o={initial:0,current:0};return{field:e.field,fieldType:n,getDefaultValue:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,Te((o.current+360)%360,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function we(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function Ie(e,t,r){if(null==t)return 0;const{symbol:n}=Z(t);if(null==n||"web-style"===n.type||"cim"===n.type)return 0;const o=n.symbolLayers.at(0);if(!o)return 0;switch(o.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return Math.min(ut.icon,(await e(o,ut.icon))[0])||ut.icon}case"text":return ut.text;case"line":return ut.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return we(await t(o,e.scale/ut.viewScaleSizeFactor),r)}case"path":case"extrude":return e.scale/ut.viewScaleSizeFactor;default:return 0}}function ve(e,t){const r=e.axis,n=t?.type??"double",o={initial:0,current:0},a=P[e.valueUnit]??1;let i;return i="area"===e.valueRepresentation?e=>(e*a/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*a/2:e=>e*a,{field:e.field,fieldType:n,getDefaultValue:async(e,t)=>Te(i(await Ie(t,e,r)),n),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,Te(o.current,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:ft(e.valueUnit),axis:e.axis}}function Te(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function Se(e){if(!C(e))return!1;switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function Fe(e,t,r){const n=await Q(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=T(e.symbol,n)&&(e.symbol=n)}function je(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};const r=new Map;r.set("circle",{mode:"freehand"}),r.set("rectangle",{mode:"freehand"});const n={mode:J,optionsPerTool:r};if(S(t)){const o=t.defaultTool,a=F(t)?t.definition?.inputGeometryType??e:e;switch(o){case"freehand":case"stream-line":return{tool:"polyline"===a?"freehandPolyline":"freehandPolygon",createOptions:n};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:n};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===a?"polygon":"polyline",createOptions:n};case"circle":return r.get("circle").preserveAspectRatio=!0,{tool:"circle",createOptions:n};case"ellipse":return r.get("circle").preserveAspectRatio=!1,{tool:"circle",createOptions:n};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:n};case"line":case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:n};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:n};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:n}}}else{const o=t.drawingTool;if("circle"===o||"ellipse"===o)return r.get("circle").preserveAspectRatio="circle"===o,{tool:"circle",createOptions:n};if("rectangle"===o)return{tool:"rectangle",createOptions:n};if("freehand"===o)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:n}}return{tool:e,createOptions:n}}async function ke(e,t,r,n){const{creationInfo:o,fullTemplate:a}=r;if(!o)throw new i("featureworkflow","No creation info provided.");const s=o.layer,l=Ze(a,o.attributeOverrides),{view:c}=e,u="2d"===c?.type;F(a)||k(a)||await Qe(e,s,l,n,u?c.scale:null);const{capabilities:d}=s;t.elevationInfo=s.elevationInfo;const p=je(s.geometryType,a);e.defaultCreateOptions={graphicProperties:{attributes:l,sourceLayer:s},mode:p.createOptions.mode,optionsPerTool:p.createOptions.optionsPerTool,preserveAspectRatio:p.createOptions.preserveAspectRatio,hasZ:d.data.supportsZ,defaultZ:(u?d.editing.zDefault:null)??e.defaultCreateOptions.defaultZ},null==o.geometryToPlace?await e.create(p.tool):await e.place(o.geometryToPlace,{graphicProperties:{attributes:l,sourceLayer:s}})}async function Ae(e){return s([Le(e),Ue(e)])}function Le({creationAttributes:e,data:t,sketchViewModel:r,view:n,webStyleCache:o}){const{creationInfo:a}=t,{fullTemplate:i}=t;if(!a||"2d"!==n?.type||F(i)||k(i))return null;const s=f(t=>Qe(r,a.layer,e,o,t));return b(()=>n.scale,e=>s(e))}function Ue({data:t,sketchViewModel:r,view:n}){const{templateExecutorInfo:o}=t;if(!o)return null;const a=r.activeComponent;if(!n||!_(a))return ee().error(new i("featureworkflow","Failed to set up template feedback.")),null;const c=new V({effect:"saturate(0.6) opacity(0.8)",listMode:"hide",title:"Shared Template Feedback Graphics"});n.map?.add(c);const{executor:u,serviceLayersById:d}=o,p=n.theme?.accentColor??new e([255,165,0,1]);return s([g(()=>a,["cursor-update","vertex-add"],()=>{c.removeAll();const e=a.graphic?.geometry;if(!e||!Ve(e))return;const t=u(e,"digitizing");if(!y(t))for(const r of t.edits){const e=d.get(r.id);if(e&&r.addFeatures&&0!==r.addFeatures.length)for(const t of e)if(!t.isTable)for(const e of r.addFeatures){const t=Me(e,p);t&&c.add(t)}}}),l(()=>{n.map.remove(c),c.destroy()})])}function Ve(e){switch(e.type){case"point":case"multipoint":return!0;case"polyline":return e.paths[0].length>1;case"polygon":{const t=e.rings[0];return n(t.at(0),t.at(-1))?t.length>2:t.length>1}default:return!1}}function Me(e,r){let n=null;switch(e.geometry?.type){case"point":case"multipoint":n=new N({angle:0,color:r,outline:new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:1}),path:"undefined",size:8,style:"circle",xoffset:0,yoffset:0});break;case"polygon":n=new G({color:r,outline:new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:3}),style:"none"});break;case"polyline":n=new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:2});break;default:return null}return new t({geometry:e.geometry,symbol:n,attributes:{...e.attributes}})}function Oe(e,t){const r=W(t),n=q(e)?e.parent:e;return r.tablesAndLayersLookup.get(n)}function xe(e,t){const r=Oe(e,t);if(!r)return new Map;const n=new Map;for(const o of r.layersAndTables)p(n,o.layerId,()=>[]).push(o);return n}function qe(e){const t=e.objectIdField,r=e.globalIdField??"";return{id:e.layerId,identifierFields:{objectIdField:t,globalIdField:r},addFeatures:[],deleteAttachments:[],addAttachments:[],deleteFeatures:[],updateFeatures:[]}}function ze(e){const{edits:t,serviceInfo:n,view:o,findOriginalFeature:a}=e,i=Ee(n.layersAndTables),s=n.layersAndTables.toArray(),{allEditData:l,editDataByLayerIdMap:c,editDataByIdMap:u}=Ce(t,i,a),d=De(l,Pe(s,c),c);if(o&&Be(l,d,o),0===d.length)return t;const p=Y(d,{continueOnCircularDependency:!0}).map(e=>u.get(e)).filter(r),f=new Map;for(const r of p)f.set(r.uniqueId,r);const y=[];for(const r of l)f.has(r.uniqueId)||y.push(r);const m=[];let h=null;for(const r of p){const{layer:e}=r;switch(null==h?h=qe(e):h.id!==e.layerId&&(m.push(h),h=qe(e)),r.operationType){case"add":case"modify":h.addFeatures.push(r.after);break;case"delete":h.deleteFeatures.push(r.before)}}null!==h&&m.push(h);for(const r of y){const e=r.layer.layerId,t=m.find(t=>t.id===e)??qe(r.layer);switch(m.includes(t)||m.push(t),r.operationType){case"add":t.addFeatures.push(r.after);break;case"modify":t.updateFeatures.push(r.after);break;case"delete":t.deleteFeatures.push(r.before);break;case"deleteAttachment":t.deleteAttachments.push(r.attachmentId);break;case"addAttachment":t.addAttachments.push(r.attachment)}}for(const r of m)void 0!==r.deleteAttachments&&0===r.deleteAttachments.length&&delete r.deleteAttachments,void 0!==r.addAttachments&&0===r.addAttachments.length&&delete r.addAttachments;return m}function Ee(e){const t=new Map;for(const r of e)t.set(r.layerId,r);return t}function Pe(e,t){const r=new Map;for(const n of e)for(const e of n.relationships??[])if(r.set(Re(n,e),""),t.has(e.relatedTableId)){const o=t.get(e.relatedTableId);if(o.length>0)for(const t of o[0].layer.relationships??[])if(t.id===e.id){r.set(Re(n,e),t.keyField);break}}return r}function Ce(e,t,r){const n=new Map,o=[],a=new Map;let s=1;for(const l of e){const e=[],c=t.get(l.id);if(!c)throw new i("featureworkflow",`Failed to prepare applyEdits payload. Layer with id ${l.id} not found.`);for(const t of l.addFeatures??[])e.push({uniqueId:"T"+s++,operationType:"add",layer:c,after:t});for(const t of l.deleteFeatures??[])e.push({uniqueId:"T"+s++,operationType:"delete",before:t,layer:c});for(const t of l.deleteAttachments??[])e.push({uniqueId:"T"+s++,operationType:"deleteAttachment",attachmentId:t,layer:c});for(const t of l.addAttachments??[])e.push({uniqueId:"T"+s++,operationType:"addAttachment",attachment:t,layer:c});for(const t of l.updateFeatures??[])e.push({uniqueId:"T"+s++,operationType:"modify",before:r(t),after:t,layer:c});n.set(c.layerId,e);for(const t of e)o.push(t),a.set(t.uniqueId,t)}return{allEditData:o,editDataByIdMap:a,editDataByLayerIdMap:n}}function De(e,t,r){const n=[];for(const o of e){const e=o.layer.relationships??[],{uniqueId:a}=o;for(const i of e){const e=i.keyField;if("origin"===i.role){const s=r.get(i.relatedTableId);if(!s||0===s.length)continue;const l=Re(o.layer,i),c=t.get(l);if(void 0===c||""===c)continue;switch(o.operationType){case"add":for(const t of s)t!==o&&("add"!==t.operationType&&"modify"!==t.operationType||t.after.attributes[c]===o.after.attributes[e]&&n.push([a,t.uniqueId]));break;case"modify":if(o.before.attributes[e]!==o.after.attributes[e])for(const t of s){const r=t.uniqueId;t!==o&&("delete"===t.operationType?t.before.attributes[c]===o.before.attributes[e]?n.push([r,a]):t.before.attributes[c]===o.after.attributes[e]&&n.push([a,r]):"add"===t.operationType?t.after.attributes[c]===o.after.attributes[e]?n.push([a,r]):t.after.attributes[c]===o.before.attributes[e]&&n.push([r,a]):"modify"===t.operationType&&(t.before.attributes[c]!==t.after.attributes[c]?t.after.attributes[c]===o.after.attributes[e]?n.push([a,r]):n.push([r,a]):n.push([a,r])))}break;case"delete":for(const t of s)t!==o&&("delete"!==t.operationType&&"modify"!==t.operationType||t.before.attributes[c]===o.before.attributes[e]&&n.push([t.uniqueId,a]))}}}}return n}function Re(e,t){return`${e.layerId}:${t.id}`}function Ge(e,t){return!!(t?.map&&"utilityNetworks"in t.map&&t.map.utilityNetworks?.length&&t.map.utilityNetworks.some(t=>!(!t.loaded||!e.url?.startsWith(t.featureServiceUrl)||e.layerId!==t.networkSystemLayers.associationsTableId)))}function Be(e,t,r){const n=[];for(const a of e)Ge(a.layer,r)&&n.push(a);if(0===n.length)return;let o=[];for(const a of n){const r=a.layer;switch(a.operationType){case"delete":o=[...Ne(a.before.attributes[r.fieldsIndex.get("fromglobalid").name],e),...Ne(a.before.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([a.uniqueId,e.uniqueId]);break;case"add":o=[...Ne(a.after.attributes[r.fieldsIndex.get("fromglobalid").name],e),...Ne(a.after.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([e.uniqueId,a.uniqueId])}}}function Ne(e,t){const r=[],n=t.filter(({layer:e})=>""!==e.globalIdField&&null!=e.globalIdField);for(const o of n){const t=o.layer.globalIdField;("before"in o&&o.before?.attributes[t]===e||"after"in o&&o.after?.attributes[t]===e)&&r.push(o)}return r}function Ze(e,t={}){return F(e)||k(e)?{}:A(e)?{...e.prototype.attributes,...t}:L(e)?{...e.definition?.defaultValues,...t}:{...t}}async function Qe(e,r,n,o,a){const i=new t({sourceLayer:r,attributes:n}),{rotation:s,size:l}=be(i);let c=await Q(i,{useSourceLayer:!0,webStyleCache:o,scale:a}),u=!1;for(const t of[l,s]){if(null==t)continue;null==n[t.field]&&(n[t.field]=await t.getDefaultValue(c,e.view),u=!0)}switch(u&&(c=await Q(i,{useSourceLayer:!0,webStyleCache:o,scale:a})),c?.type){case"simple-fill":case"polygon-3d":e.polygonSymbol=c;break;case"simple-line":case"line-3d":e.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":e.pointSymbol=c;break;case"mesh-3d":e.meshSymbol=c}We(e.tooltipOptions,l,s)}function We(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function $e(e,t){return e.find(e=>e.layer===t)}function Je(e,t){const r=$e(e,t);if(null==r)throw new i("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified layer");return r}function He(e,t){return e?.find(e=>e.layer===t)}async function Ke(e,t,r,n){switch(t.type){case"3d":return Xe(e,t,r,n);case"2d":return Ye(e,t,r,n)}}async function Xe(e,t,r,n){if(0===e.length)return[];const{updatable:a,graphicsByLayer:i}=await r.defer(async()=>{const{results:o}=await h(X(t,r),n),a=new Map,i=e=>{const t=e.layer,r=a.get(t);if(!r){const e=new Array;return a.set(t,e),e}return r};K(o).forEach(({graphic:e})=>i(e).push(e));const s=e.filter(({capabilities:e,layer:t})=>e.update.enabled&&a.has(t));return 0!==s.length&&r.stopPropagation(),{updatable:s,graphicsByLayer:a}});return h(Promise.allSettled(a.map(async({layer:e})=>{const t=i.get(e),r=_e(e);if(t.every(e=>M(e,r)))return t;const a=[];for(const n of t){a.push(n.getObjectId());const e=Object.keys(n.attributes);o(r,e)}const s=e.createQuery();return s.returnGeometry=!1,s.objectIds=a,s.outFields=O(e.fieldsIndex,r),e.queryFeatures(s,{signal:n}).then(({features:e})=>e)})),n)}async function Ye(e,t,r,n){if(0===e.length)return[];const{mapPoint:o}=r;if(null==o)return[];let a=null;const i=await r.defer(async()=>{const{results:o}=await h(t.hitTest(r),n);if(0===o.length)return[];const i=new Set;a=K(o),a.forEach(({graphic:e})=>e&&i.add(e.layer));const s=e.filter(e=>i.has(e.layer)&&e.supportsUpdateWorkflow);return s.length>0&&r.stopPropagation(),s});return h(Promise.allSettled(i.map(async({layer:e})=>{const i=e.createQuery();i.returnGeometry=!0,i.outFields=_e(e);const s="renderer"in e?E({renderer:e.renderer,pointerType:r.pointerType}):0;i.geometry=H(o,s,t),i.outSpatialReference=t.spatialReference;const{features:l}=await e.queryFeatures(i,{signal:n});return a?.forEach(({graphic:t})=>{t.layer!==e||l.some(e=>e.getObjectId()===t.getObjectId())||l.push(t)}),l})),n)}function _e(e){return O(e.fieldsIndex,[e.objectIdField,x({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function et(e,t,n,o){return tt(e.map(e=>e.getObjectId()??e.attributes[t.objectIdField]).filter(r),t,n,o)}async function tt(e,t,r,n){const o=t.createQuery();o.objectIds=e,o.outFields=["*"],o.returnM=t.capabilities.data.supportsM,o.returnZ=t.capabilities.data.supportsZ,o.returnGeometry=!0,"scene"===t.type&&null!=t.infoFor3D||(o.outSpatialReference=r);const a=await t.queryFeatures(o,{signal:n});return m(n),a.features}async function rt(e){const{graphic:t,sketchViewModel:r,sourceLayer:n,visualVariables:o}=e;await nt(e);const a={multipleSelectionEnabled:!1};return"point"===n.geometryType&&(a.enableRotation=null!=o.rotation,a.enableScaling=null!=o.size),r.update(t,a)}async function nt(e){const{graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:o,visualVariables:a,webStyleCache:i}=e;let s=!1;const{rotation:l,size:c}=a;for(const u of[l,c]){if(null==u)continue;const e=t.getAttribute(u.field);if(null!=e)u.setInitialValue(e);else{const e=await u.getDefaultValue(t.symbol,n.view);u.setInitialValue(e),t.setAttribute(u.field,e),s=!0}}if(s){const e="2d"===n.view?.type?n.view.scale:null;await Fe(t,i,e)}We(n.tooltipOptions,c,l),r.elevationInfo=o.elevationInfo}function ot(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function at(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}function it(e,t,r,n){if(null==t.geometry||"point"!==t.geometry?.type)return!1;const o=t.attributes;let a=!1;const i=n.rotation,s=ot(r.toolEventInfo);if(null!=i&&null!=s){const{field:r,getValue:n}=i;if("rotate-stop"===s.type)i.isUpdatingInteractively=!1,i.setInitialValue(t.getAttribute(r));else{i.isUpdatingInteractively=!0;const l=n(s.angle,e);l!==o[r]&&t.setAttribute(r,l),a=!0}}const l=n.size,c=at(r.toolEventInfo);if(null!=l&&null!=c){const{field:r,getValue:n}=l;if("scale-stop"===c.type)l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r));else{l.isUpdatingInteractively=!0;const i=n(c.xScale,e);i!==o[r]&&t.setAttribute(r,i),a=!0}}return a}async function st({feature:e,featureClone:t,visualVariableAttributes:r,sketchLayer:n,sketchViewModel:o,view:a,onUpdate:i,webStyleCache:u,addUpdatingPromise:d,addHandle:p}){await Fe(t,u,"2d"===a.type?a.scale:null);let y=null;if("2d"===o?.view?.type){const e=f(e=>Fe(t,u,e));y=b(()=>o?.view?.scale,t=>e(t))}const m=t.sourceLayer,h=ht(a,m);await rt({graphic:t,sketchLayer:n,sketchViewModel:o,sourceLayer:m,visualVariables:r,webStyleCache:u});let g=null;h.then(e=>g=e).catch(()=>{});const I=r.size,v=r.rotation,T=b(()=>e.attributes,async e=>{let r=!1;for(const n in e){const o=e[n];o!==t.getAttribute(n)&&(t.setAttribute(n,o),null==I||I.isUpdatingInteractively||I.field!==n||I.setInitialValue(o),null==v||v.isUpdatingInteractively||v.field!==n||v.setInitialValue(o),(null==g||g.requiredFields.includes(n))&&(r=!0))}r&&await Fe(t,u,"2d"===a.type?a.scale:null)}),S=o.on("update",async e=>{const t=e.graphics[0],s={graphic:t,sketchLayer:n,sketchViewModel:o,sourceLayer:m,visualVariables:r,webStyleCache:u};if("complete"===e.state){if(null===a.activeTool)return rt(s);const e=new AbortController,t=c(e);return p(t),d(w(()=>null===a.activeTool,e.signal).then(async()=>{if(!e.signal.aborted)return e.abort(),rt(s)}))}it(a,t,e,r)&&await Fe(t,u,"2d"===a.type?a.scale:null),i(gt(t),e)}),F=o.on(["undo","redo"],e=>{i(gt(e.graphics[0]),e)});return s([F,S,l(()=>o.cancel()),T,y])}async function lt(e,t,r,n){e.add(n);const o=r.sourceLayer,i=r.layer??o,c=r.getAttribute(o.objectIdField);let u=null;function d(e){u?.abort(),z(i)?r.visible=e:u=a(async r=>{const n=await ht(t,i);m(r),n.setVisibility?.(c,e)})}return await ct(t,n),d(!1),s([l(async()=>{d(!0);try{if(!t.destroyed){const e=await ht(t,i).catch(()=>{});e&&!e.destroyed&&await w(()=>!e.updating)}}finally{e.remove(n)}})])}async function ct(e,t){if("3d"===e.type){const r=new $({graphic:t}),n=e.trackGraphicState(r);await w(()=>r.displaying||r.error),n.remove()}else await w(()=>t.visible)}const ut={icon:I(24),text:I(12),line:I(1),viewScaleSizeFactor:100};function dt(e,t,r){let n=!1;return e.filter(e=>!!n||(n=e===t,n)).map(e=>r[e]())}function pt(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const n=r.layer,o=e.viewModel.getTemplatesForLayer(n);1===o.length&&"scene"!==n.type&&(r.template=o[0],t.shift())}return t}function ft(e){return"unknown"===e?null:e}function yt(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const mt=e=>e.includes("-stop")||e.includes("vertex-"),ht=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function bt(e){return"createInteractiveEditSession"in e}function gt(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=u(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function wt(e){return e.acquireCursor("progress")}async function It(e,t){const{template:r}=e;if(null==r)return null;if(j(r))return r.load();if(S(r)){const e=(await import("../../editing/sharedTemplates/SharedTemplate.js")).default,n=U(t,{makeSharedTemplateFromJSON:t=>e.fromJSON(t)}),o=await n.getTemplates({templateIds:[r.templateId],featureService:r.featureService});if(0===o.length)throw new i("editor:failed-to-load-template","Unable to load the provided template");return o[0].load()}return r}function vt(e){for(const t of e){const{destinationGraphic:e,destinationField:r,sourceGraphic:n,sourceField:o}=t;e.setAttribute(r,n.getAttribute(o))}}function Tt(e){const t=e.templateExecutorInfo?.completionResults;return t?.length?(t.forEach(e=>vt(e.relationships)),t.flatMap(e=>e.edits)):null}function St(e){const t=le(e)?e.activeWorkflow:e;if(null==t)return[];if(ae(t))return t.data.layers;const r=t.layer;return r?[r]:[]}function Ft({attributes:e},t){const r=new Set;r.add(t.objectIdField),"uniqueIdFields"in t&&t.uniqueIdFields&&t.uniqueIdFields.length>0&&v(r,t.uniqueIdFields);const n={};for(const o of r)null!=e[o]&&(n[o]=e[o]);if("scene"===t.type&&null!=t.infoFor3D){const r=t.associatedLayer?.globalIdField;null!=r&&(e[r]=e[r])}return n}function jt(e){if(!kt(e))return e;const t=new Map;for(const r of e){const e=r.getObjectId();if(null!=e){const n=r.sourceLayer??r.layer;p(t,n,()=>[]).push(e)}}return Array.from(t.entries()).map(([e,t])=>({layer:e,objectIds:t}))}function kt(e){return 0===e.length||R(e[0])}export{Be as appendAllUtilityNetworkAssociationRelationships,pt as avoidFeatureTemplateSelectionWithOnlyOneItem,bt as canCreateInteractiveEditSession,gt as cloneGraphicExceptMesh,Ee as createLayerIdMap,Pe as createRelationshipKeyMap,je as createToolFromGeometryType,dt as createWorkflowSteps,Ke as fetchCandidates,et as fetchFullFeatures,tt as fetchFullFeaturesByObjectId,De as findAllDependencies,Ne as findChangesByGlobalId,$e as findEditorItemForLayer,Je as findEditorItemForLayerOrThrow,He as findLayerInfo,Re as generateHashForRelationship,Ze as getCreationAttributes,It as getFullTemplateForCreationInfo,St as getLayersFromWorkflow,ge as getRotationVariableAttribute,Tt as getServiceEditsFromWorkflowData,Oe as getServiceInfoForLayer,xe as getServiceLayersById,ve as getSizeVariableAttribute,be as getVisualVariableAttributes,he as getVisualVariablesForLayer,te as isAnyUpdateLeafWorkflow,re as isBatchAttributeFormViewModel,ne as isCreateFeaturesWorkflow,oe as isFeatureFormViewModel,kt as isGraphicsArray,ce as isMergeFeaturesWorkflow,pe as isMergeWorkflowOptions,de as isParentWorkflow,ue as isSplitFeatureWorkflow,fe as isSplitWorkflowOptions,mt as isTerminalUpdateEventType,ie as isUpdateFeatureWorkflow,ae as isUpdateFeaturesWorkflow,me as isUpdateFeaturesWorkflowOptions,se as isUpdateRecordWorkflow,le as isUpdateWorkflow,Ge as isUtilityNetworkAssociationsTable,Ft as makeMinimalAttributes,ze as orderEditsByRelationshipDependencies,yt as prepareAttachmentsForCreateFeaturesWorkflow,vt as setRelationshipFields,st as setUpGeometryUpdate,Ae as setUpSketchCreateWatchers,nt as setVisualVariablesAndElevationInfoForUpdate,wt as showProgressCursor,ut as sizeDefaults,ft as sizeVariableUnitToLengthUnit,ke as startCreatingNewFeature,rt as startUpdatingFeatureGeometry,lt as swapForEditingSession,jt as toFeatureInfos,Fe as updateGraphicSymbolWhenRequired,it as visualVariableInteractiveUpdate,ht as whenEditorLayerView,ct as whenGraphicDisplayed,ye as workflowInfluencesOutcomeOfParent};
5
+ import e from"../../Color.js";import t from"../../Graphic.js";import{isSome as r,equals as n,addMany as o}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import"../../core/has.js";import i from"../../core/Error.js";import{handlesGroup as s,makeHandle as l,abortHandle as c}from"../../core/handleUtils.js";import{clone as u}from"../../core/lang.js";import d from"../../core/Logger.js";import{getOrCreateMapValue as p}from"../../core/MapUtils.js";import{debounce as f,isPromiseLike as y,throwIfAborted as m,whenOrAbort as h}from"../../core/promiseUtils.js";import{watch as b,on as g,whenOnce as w}from"../../core/reactiveUtils.js";import{px2pt as I}from"../../core/screenUtils.js";import{addMany as v}from"../../core/SetUtils.js";import{diff as T}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as S,isSharedGroupTemplate as F,isSharedTemplate as j,isSharedPresetTemplate as k,isStandardFeatureTemplate as A,isSharedFeatureTemplate as L}from"../../editing/templateUtils.js";import{getSharedTemplateProvider as U}from"../../editing/sharedTemplates/SharedTemplateProvider.js";import V from"../../layers/GraphicsLayer.js";import{featureHasFields as M,fixFields as O,getDisplayFieldName as x}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as q,isGraphicsLayer as z,isSceneLayer as E}from"../../layers/support/layerUtils.js";import{calculateTolerance as P}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as C}from"../../renderers/support/lengthUtils.js";import{isRenderer as R}from"../../renderers/support/typeUtils.js";import{getTransformationType as D}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{isGraphic as G}from"../../support/guards.js";import B from"../../symbols/SimpleFillSymbol.js";import N from"../../symbols/SimpleLineSymbol.js";import Z from"../../symbols/SimpleMarkerSymbol.js";import{to3D as Q}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as W}from"../../symbols/support/symbolUtils.js";import{getServices as $}from"../../undoredo/support/Services.js";import{GraphicState as J}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as H}from"../../views/draw/drawingModes.js";import{createQueryGeometry as K}from"../../views/support/drapedUtils.js";import{filterGraphicHits as X,hitTestSelectSimilarDistance as Y}from"../../views/support/hitTestSelectUtils.js";import{dependencySort as _}from"./support/dependencySort.js";import{isDrawGraphicTool as ee}from"../Sketch/support/sketchUtils.js";const te=()=>d.getLogger("esri.widgets.Editor.workflowUtils");function re(e){return le(e)||ie(e)}function ne(e){return!!e&&"features"in e}function oe(e){return null!=e&&"create-features"===e.type}function ae(e){return!!e&&"feature"in e}function ie(e){return null!=e&&"update-features"===e.type}function se(e){return null!=e&&"update-feature"===e.type}function le(e){return null!=e&&e.type.includes("update-")&&"fullFeature"in e}function ce(e){return null!=e&&"update"===e.type}function ue(e){return null!=e&&"merge-features"===e.type}function de(e){return null!=e&&"split-feature"===e.type}function pe(e){const t=e?.type;return"update-feature"===t||"update-table-record"===t||"update-features"===t||"split-feature"===t}function fe(e){return"merge"===e?.type}function ye(e){return"split"===e?.type}function me(e){return ue(e)||de(e)}function he(e){return"update-multiple"===e?.type}function be(e){const t=e&&"renderer"in e?e.renderer:null;if(!Fe(t))return{rotation:null,size:null};const r=t.getVisualVariablesForType("rotation").filter(e=>(!e.axis||"heading"===e.axis)&&e.field&&!e.valueExpression),n=t.getVisualVariablesForType("size").filter(e=>e.field&&!e.useSymbolValue&&!e.valueExpression&&"real-world-size"===D(e));return{rotation:1===r.length?r[0]:null,size:1===n.length?n[0]:null}}function ge(e){const t=e.sourceLayer;if(!(t&&"renderer"in t&&Fe(t.renderer)))return{rotation:null,size:null};const{rotation:r,size:n}=be(t);let o=null,a=null;if(r){const e=t.fields?.filter(e=>e.name===r.field),n=1===e?.length?e[0]:null;o=we(r,n)}if(n){const e=t.fields?.filter(e=>e.name===n.field),r=1===e?.length?e[0]:null;a=Te(n,r)}return{rotation:o,size:a}}function we(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,n=t?.type??"double",o={initial:0,current:0};return{field:e.field,fieldType:n,getDefaultValue:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,Se((o.current+360)%360,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function Ie(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function ve(e,t,r){if(null==t)return 0;const{symbol:n}=Q(t);if(null==n||"web-style"===n.type||"cim"===n.type)return 0;const o=n.symbolLayers.at(0);if(!o)return 0;switch(o.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return Math.min(dt.icon,(await e(o,dt.icon))[0])||dt.icon}case"text":return dt.text;case"line":return dt.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return Ie(await t(o,e.scale/dt.viewScaleSizeFactor),r)}case"path":case"extrude":return e.scale/dt.viewScaleSizeFactor;default:return 0}}function Te(e,t){const r=e.axis,n=t?.type??"double",o={initial:0,current:0},a=C[e.valueUnit]??1;let i;return i="area"===e.valueRepresentation?e=>(e*a/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*a/2:e=>e*a,{field:e.field,fieldType:n,getDefaultValue:async(e,t)=>Se(i(await ve(t,e,r)),n),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,Se(o.current,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:yt(e.valueUnit),axis:e.axis}}function Se(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function Fe(e){if(!R(e))return!1;switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function je(e,t,r){const n=await W(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=T(e.symbol,n)&&(e.symbol=n)}function ke(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};const r=new Map;r.set("circle",{mode:"freehand"}),r.set("rectangle",{mode:"freehand"});const n={mode:H,optionsPerTool:r};if(S(t)){const o=t.defaultTool,a=F(t)?t.definition?.inputGeometryType??e:e;switch(o){case"freehand":case"stream-line":return{tool:"polyline"===a?"freehandPolyline":"freehandPolygon",createOptions:n};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:n};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===a?"polygon":"polyline",createOptions:n};case"circle":return r.get("circle").preserveAspectRatio=!0,{tool:"circle",createOptions:n};case"ellipse":return r.get("circle").preserveAspectRatio=!1,{tool:"circle",createOptions:n};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:n};case"line":case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:n};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:n};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:n}}}else{const o=t.drawingTool;if("circle"===o||"ellipse"===o)return r.get("circle").preserveAspectRatio="circle"===o,{tool:"circle",createOptions:n};if("rectangle"===o)return{tool:"rectangle",createOptions:n};if("freehand"===o)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:n}}return{tool:e,createOptions:n}}async function Ae(e,t,r,n){const{creationInfo:o,fullTemplate:a}=r;if(!o)throw new i("featureworkflow","No creation info provided.");const s=o.layer,l=Qe(a,o.attributeOverrides),{view:c}=e,u="2d"===c?.type;F(a)||k(a)||await We(e,s,l,n,u?c.scale:null);const{capabilities:d}=s;t.elevationInfo=s.elevationInfo;const p=ke(s.geometryType,a);e.defaultCreateOptions={graphicProperties:{attributes:l,sourceLayer:s},mode:p.createOptions.mode,optionsPerTool:p.createOptions.optionsPerTool,preserveAspectRatio:p.createOptions.preserveAspectRatio,hasZ:d.data.supportsZ,defaultZ:(u?d.editing.zDefault:null)??e.defaultCreateOptions.defaultZ},null==o.geometryToPlace?await e.create(p.tool):await e.place(o.geometryToPlace,{graphicProperties:{attributes:l,sourceLayer:s}})}async function Le(e){return s([Ue(e),Ve(e)])}function Ue({creationAttributes:e,data:t,sketchViewModel:r,view:n,webStyleCache:o}){const{creationInfo:a}=t,{fullTemplate:i}=t;if(!a||"2d"!==n?.type||F(i)||k(i))return null;const s=f(t=>We(r,a.layer,e,o,t));return b(()=>n.scale,e=>s(e))}function Ve({data:t,sketchViewModel:r,view:n}){const{templateExecutorInfo:o}=t;if(!o)return null;const a=r.activeComponent;if(!n||!ee(a))return te().error(new i("featureworkflow","Failed to set up template feedback.")),null;const c=new V({effect:"saturate(0.6) opacity(0.8)",listMode:"hide",title:"Shared Template Feedback Graphics"});n.map?.add(c);const{executor:u,serviceLayersById:d}=o,p=n.theme?.accentColor??new e([255,165,0,1]);return s([g(()=>a,["cursor-update","vertex-add"],()=>{c.removeAll();const e=a.graphic?.geometry;if(!e||!Me(e))return;const t=u(e,"digitizing");if(!y(t))for(const r of t.edits){const e=d.get(r.id);if(e&&r.addFeatures&&0!==r.addFeatures.length)for(const t of e)if(!t.isTable)for(const e of r.addFeatures){const t=Oe(e,p);t&&c.add(t)}}}),l(()=>{n.map.remove(c),c.destroy()})])}function Me(e){switch(e.type){case"point":case"multipoint":return!0;case"polyline":return e.paths[0].length>1;case"polygon":{const t=e.rings[0];return n(t.at(0),t.at(-1))?t.length>2:t.length>1}default:return!1}}function Oe(e,r){let n=null;switch(e.geometry?.type){case"point":case"multipoint":n=new Z({angle:0,color:r,outline:new N({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:1}),path:"undefined",size:8,style:"circle",xoffset:0,yoffset:0});break;case"polygon":n=new B({color:r,outline:new N({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:3}),style:"none"});break;case"polyline":n=new N({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:2});break;default:return null}return new t({geometry:e.geometry,symbol:n,attributes:{...e.attributes}})}function xe(e,t){const r=$(t),n=q(e)?e.parent:e;return r.tablesAndLayersLookup.get(n)}function qe(e,t){const r=xe(e,t);if(!r)return new Map;const n=new Map;for(const o of r.layersAndTables)p(n,o.layerId,()=>[]).push(o);return n}function ze(e){const t=e.objectIdField,r=e.globalIdField??"";return{id:e.layerId,identifierFields:{objectIdField:t,globalIdField:r},addFeatures:[],deleteAttachments:[],addAttachments:[],deleteFeatures:[],updateFeatures:[]}}function Ee(e){const{edits:t,serviceInfo:n,view:o,findOriginalFeature:a}=e,i=Pe(n.layersAndTables),s=n.layersAndTables.toArray(),{allEditData:l,editDataByLayerIdMap:c,editDataByIdMap:u}=Re(t,i,a),d=De(l,Ce(s,c),c);if(o&&Ne(l,d,o),0===d.length)return t;const p=_(d,{continueOnCircularDependency:!0}).map(e=>u.get(e)).filter(r),f=new Map;for(const r of p)f.set(r.uniqueId,r);const y=[];for(const r of l)f.has(r.uniqueId)||y.push(r);const m=[];let h=null;for(const r of p){const{layer:e}=r;switch(null==h?h=ze(e):h.id!==e.layerId&&(m.push(h),h=ze(e)),r.operationType){case"add":case"modify":h.addFeatures.push(r.after);break;case"delete":h.deleteFeatures.push(r.before)}}null!==h&&m.push(h);for(const r of y){const e=r.layer.layerId,t=m.find(t=>t.id===e)??ze(r.layer);switch(m.includes(t)||m.push(t),r.operationType){case"add":t.addFeatures.push(r.after);break;case"modify":t.updateFeatures.push(r.after);break;case"delete":t.deleteFeatures.push(r.before);break;case"deleteAttachment":t.deleteAttachments.push(r.attachmentId);break;case"addAttachment":t.addAttachments.push(r.attachment)}}for(const r of m)void 0!==r.deleteAttachments&&0===r.deleteAttachments.length&&delete r.deleteAttachments,void 0!==r.addAttachments&&0===r.addAttachments.length&&delete r.addAttachments;return m}function Pe(e){const t=new Map;for(const r of e)t.set(r.layerId,r);return t}function Ce(e,t){const r=new Map;for(const n of e)for(const e of n.relationships??[])if(r.set(Ge(n,e),""),t.has(e.relatedTableId)){const o=t.get(e.relatedTableId);if(o.length>0)for(const t of o[0].layer.relationships??[])if(t.id===e.id){r.set(Ge(n,e),t.keyField);break}}return r}function Re(e,t,r){const n=new Map,o=[],a=new Map;let s=1;for(const l of e){const e=[],c=t.get(l.id);if(!c)throw new i("featureworkflow",`Failed to prepare applyEdits payload. Layer with id ${l.id} not found.`);for(const t of l.addFeatures??[])e.push({uniqueId:"T"+s++,operationType:"add",layer:c,after:t});for(const t of l.deleteFeatures??[])e.push({uniqueId:"T"+s++,operationType:"delete",before:t,layer:c});for(const t of l.deleteAttachments??[])e.push({uniqueId:"T"+s++,operationType:"deleteAttachment",attachmentId:t,layer:c});for(const t of l.addAttachments??[])e.push({uniqueId:"T"+s++,operationType:"addAttachment",attachment:t,layer:c});for(const t of l.updateFeatures??[])e.push({uniqueId:"T"+s++,operationType:"modify",before:r(t),after:t,layer:c});n.set(c.layerId,e);for(const t of e)o.push(t),a.set(t.uniqueId,t)}return{allEditData:o,editDataByIdMap:a,editDataByLayerIdMap:n}}function De(e,t,r){const n=[];for(const o of e){const e=o.layer.relationships??[],{uniqueId:a}=o;for(const i of e){const e=i.keyField;if("origin"===i.role){const s=r.get(i.relatedTableId);if(!s||0===s.length)continue;const l=Ge(o.layer,i),c=t.get(l);if(void 0===c||""===c)continue;switch(o.operationType){case"add":for(const t of s)t!==o&&("add"!==t.operationType&&"modify"!==t.operationType||t.after.attributes[c]===o.after.attributes[e]&&n.push([a,t.uniqueId]));break;case"modify":if(o.before.attributes[e]!==o.after.attributes[e])for(const t of s){const r=t.uniqueId;t!==o&&("delete"===t.operationType?t.before.attributes[c]===o.before.attributes[e]?n.push([r,a]):t.before.attributes[c]===o.after.attributes[e]&&n.push([a,r]):"add"===t.operationType?t.after.attributes[c]===o.after.attributes[e]?n.push([a,r]):t.after.attributes[c]===o.before.attributes[e]&&n.push([r,a]):"modify"===t.operationType&&(t.before.attributes[c]!==t.after.attributes[c]?t.after.attributes[c]===o.after.attributes[e]?n.push([a,r]):n.push([r,a]):n.push([a,r])))}break;case"delete":for(const t of s)t!==o&&("delete"!==t.operationType&&"modify"!==t.operationType||t.before.attributes[c]===o.before.attributes[e]&&n.push([t.uniqueId,a]))}}}}return n}function Ge(e,t){return`${e.layerId}:${t.id}`}function Be(e,t){return!!(t?.map&&"utilityNetworks"in t.map&&t.map.utilityNetworks?.length&&t.map.utilityNetworks.some(t=>!(!t.loaded||!e.url?.startsWith(t.featureServiceUrl)||e.layerId!==t.networkSystemLayers.associationsTableId)))}function Ne(e,t,r){const n=[];for(const a of e)Be(a.layer,r)&&n.push(a);if(0===n.length)return;let o=[];for(const a of n){const r=a.layer;switch(a.operationType){case"delete":o=[...Ze(a.before.attributes[r.fieldsIndex.get("fromglobalid").name],e),...Ze(a.before.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([a.uniqueId,e.uniqueId]);break;case"add":o=[...Ze(a.after.attributes[r.fieldsIndex.get("fromglobalid").name],e),...Ze(a.after.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([e.uniqueId,a.uniqueId])}}}function Ze(e,t){const r=[],n=t.filter(({layer:e})=>""!==e.globalIdField&&null!=e.globalIdField);for(const o of n){const t=o.layer.globalIdField;("before"in o&&o.before?.attributes[t]===e||"after"in o&&o.after?.attributes[t]===e)&&r.push(o)}return r}function Qe(e,t={}){return F(e)||k(e)?{}:A(e)?{...e.prototype.attributes,...t}:L(e)?{...e.definition?.defaultValues,...t}:{...t}}async function We(e,r,n,o,a){const i=new t({sourceLayer:r,attributes:n}),{rotation:s,size:l}=ge(i);let c=await W(i,{useSourceLayer:!0,webStyleCache:o,scale:a}),u=!1;for(const t of[l,s]){if(null==t)continue;null==n[t.field]&&(n[t.field]=await t.getDefaultValue(c,e.view),u=!0)}switch(u&&(c=await W(i,{useSourceLayer:!0,webStyleCache:o,scale:a})),c?.type){case"simple-fill":case"polygon-3d":e.polygonSymbol=c;break;case"simple-line":case"line-3d":e.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":e.pointSymbol=c;break;case"mesh-3d":e.meshSymbol=c}$e(e.tooltipOptions,l,s)}function $e(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function Je(e,t){return e.find(e=>e.layer===t)}function He(e,t){const r=Je(e,t);if(null==r)throw new i("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified layer");return r}function Ke(e,t){return e?.find(e=>e.layer===t)}async function Xe(e,t,r,n){switch(t.type){case"3d":return Ye(e,t,r,n);case"2d":return _e(e,t,r,n)}}async function Ye(e,t,r,n){if(0===e.length)return[];const{updatable:a,graphicsByLayer:i}=await r.defer(async()=>{const{results:o}=await h(Y(t,r),n),a=new Map,i=e=>{const t=e.layer,r=a.get(t);if(!r){const e=new Array;return a.set(t,e),e}return r};X(o).forEach(({graphic:e})=>i(e).push(e));const s=e.filter(({capabilities:e,layer:t})=>e.update.enabled&&a.has(t));return 0!==s.length&&r.stopPropagation(),{updatable:s,graphicsByLayer:a}});return h(Promise.allSettled(a.map(async({layer:e})=>{const t=i.get(e),r=et(e);if(t.every(e=>M(e,r)))return t;const a=[];for(const n of t){a.push(n.getObjectId());const e=Object.keys(n.attributes);o(r,e)}const s=e.createQuery();return s.returnGeometry=!1,s.objectIds=a,s.outFields=O(e.fieldsIndex,r),e.queryFeatures(s,{signal:n}).then(({features:e})=>e)})),n)}async function _e(e,t,r,n){if(0===e.length)return[];const{mapPoint:o}=r;if(null==o)return[];let a=null;const i=await r.defer(async()=>{const{results:o}=await h(t.hitTest(r),n);if(0===o.length)return[];const i=new Set;a=X(o),a.forEach(({graphic:e})=>e&&i.add(e.layer));const s=e.filter(e=>i.has(e.layer)&&e.supportsUpdateWorkflow);return s.length>0&&r.stopPropagation(),s});return h(Promise.allSettled(i.map(async({layer:e})=>{const i=e.createQuery();i.returnGeometry=!0,i.outFields=et(e);const s="renderer"in e?P({renderer:e.renderer,pointerType:r.pointerType}):0;i.geometry=K(o,s,t),i.outSpatialReference=t.spatialReference;const{features:l}=await e.queryFeatures(i,{signal:n});return a?.forEach(({graphic:t})=>{t.layer!==e||l.some(e=>e.getObjectId()===t.getObjectId())||l.push(t)}),l})),n)}function et(e){return O(e.fieldsIndex,[e.objectIdField,x({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function tt(e,t,n,o){return rt(e.map(e=>e.getObjectId()??e.attributes[t.objectIdField]).filter(r),t,n,o)}async function rt(e,t,r,n){const o=t.createQuery();o.objectIds=e,o.outFields=["*"],o.returnM=t.capabilities.data.supportsM,o.returnZ=t.capabilities.data.supportsZ,o.returnGeometry=!0,E(t)&&null!=t.infoFor3D||(o.outSpatialReference=r),!E(t)&&t.capabilities?.data.supportsTrueCurve&&(o.returnTrueCurves=!0);const a=await t.queryFeatures(o,{signal:n});return m(n),a.features}async function nt(e){const{graphic:t,sketchViewModel:r,sourceLayer:n,visualVariables:o}=e;await ot(e);const a={multipleSelectionEnabled:!1};return"point"===n.geometryType&&(a.enableRotation=null!=o.rotation,a.enableScaling=null!=o.size),r.update(t,a)}async function ot(e){const{graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:o,visualVariables:a,webStyleCache:i}=e;let s=!1;const{rotation:l,size:c}=a;for(const u of[l,c]){if(null==u)continue;const e=t.getAttribute(u.field);if(null!=e)u.setInitialValue(e);else{const e=await u.getDefaultValue(t.symbol,n.view);u.setInitialValue(e),t.setAttribute(u.field,e),s=!0}}if(s){const e="2d"===n.view?.type?n.view.scale:null;await je(t,i,e)}$e(n.tooltipOptions,c,l),r.elevationInfo=o.elevationInfo}function at(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function it(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}function st(e,t,r,n){if(null==t.geometry||"point"!==t.geometry?.type)return!1;const o=t.attributes;let a=!1;const i=n.rotation,s=at(r.toolEventInfo);if(null!=i&&null!=s){const{field:r,getValue:n}=i;if("rotate-stop"===s.type)i.isUpdatingInteractively=!1,i.setInitialValue(t.getAttribute(r));else{i.isUpdatingInteractively=!0;const l=n(s.angle,e);l!==o[r]&&t.setAttribute(r,l),a=!0}}const l=n.size,c=it(r.toolEventInfo);if(null!=l&&null!=c){const{field:r,getValue:n}=l;if("scale-stop"===c.type)l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r));else{l.isUpdatingInteractively=!0;const i=n(c.xScale,e);i!==o[r]&&t.setAttribute(r,i),a=!0}}return a}async function lt({feature:e,featureClone:t,visualVariableAttributes:r,sketchLayer:n,sketchViewModel:o,view:a,onUpdate:i,webStyleCache:u,addUpdatingPromise:d,addHandle:p}){await je(t,u,"2d"===a.type?a.scale:null);let y=null;if("2d"===o?.view?.type){const e=f(e=>je(t,u,e));y=b(()=>o?.view?.scale,t=>e(t))}const m=t.sourceLayer,h=bt(a,m);await nt({graphic:t,sketchLayer:n,sketchViewModel:o,sourceLayer:m,visualVariables:r,webStyleCache:u});let g=null;h.then(e=>g=e).catch(()=>{});const I=r.size,v=r.rotation,T=b(()=>e.attributes,async e=>{let r=!1;for(const n in e){const o=e[n];o!==t.getAttribute(n)&&(t.setAttribute(n,o),null==I||I.isUpdatingInteractively||I.field!==n||I.setInitialValue(o),null==v||v.isUpdatingInteractively||v.field!==n||v.setInitialValue(o),(null==g||g.requiredFields.includes(n))&&(r=!0))}r&&await je(t,u,"2d"===a.type?a.scale:null)}),S=o.on("update",async e=>{const t=e.graphics[0],s={graphic:t,sketchLayer:n,sketchViewModel:o,sourceLayer:m,visualVariables:r,webStyleCache:u};if("complete"===e.state){if(null===a.activeTool)return nt(s);const e=new AbortController,t=c(e);return p(t),d(w(()=>null===a.activeTool,e.signal).then(async()=>{if(!e.signal.aborted)return e.abort(),nt(s)}))}st(a,t,e,r)&&await je(t,u,"2d"===a.type?a.scale:null),i(wt(t),e)}),F=o.on(["undo","redo"],e=>{i(wt(e.graphics[0]),e)});return s([F,S,l(()=>o.cancel()),T,y])}async function ct(e,t,r,n){e.add(n);const o=r.sourceLayer,i=r.layer??o,c=r.getAttribute(o.objectIdField);let u=null;function d(e){u?.abort(),z(i)?r.visible=e:u=a(async r=>{const n=await bt(t,i);m(r),n.setVisibility?.(c,e)})}return await ut(t,n),d(!1),s([l(async()=>{d(!0);try{if(!t.destroyed){const e=await bt(t,i).catch(()=>{});e&&!e.destroyed&&await w(()=>!e.updating)}}finally{e.remove(n)}})])}async function ut(e,t){if("3d"===e.type){const r=new J({graphic:t}),n=e.trackGraphicState(r);await w(()=>r.displaying||r.error),n.remove()}else await w(()=>t.visible)}const dt={icon:I(24),text:I(12),line:I(1),viewScaleSizeFactor:100};function pt(e,t,r){let n=!1;return e.filter(e=>!!n||(n=e===t,n)).map(e=>r[e]())}function ft(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const n=r.layer,o=e.viewModel.getTemplatesForLayer(n);1===o.length&&"scene"!==n.type&&(r.template=o[0],t.shift())}return t}function yt(e){return"unknown"===e?null:e}function mt(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const ht=e=>e.includes("-stop")||e.includes("vertex-"),bt=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function gt(e){return"createInteractiveEditSession"in e}function wt(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=u(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function It(e){return e.acquireCursor("progress")}async function vt(e,t){const{template:r}=e;if(null==r)return null;if(j(r))return r.load();if(S(r)){const e=(await import("../../editing/sharedTemplates/SharedTemplate.js")).default,n=U(t,{makeSharedTemplateFromJSON:t=>e.fromJSON(t)}),o=await n.getTemplates({templateIds:[r.templateId],featureService:r.featureService});if(0===o.length)throw new i("editor:failed-to-load-template","Unable to load the provided template");return o[0].load()}return r}function Tt(e){for(const t of e){const{destinationGraphic:e,destinationField:r,sourceGraphic:n,sourceField:o}=t;e.setAttribute(r,n.getAttribute(o))}}function St(e){const t=e.templateExecutorInfo?.completionResults;return t?.length?(t.forEach(e=>Tt(e.relationships)),t.flatMap(e=>e.edits)):null}function Ft(e){const t=ce(e)?e.activeWorkflow:e;if(null==t)return[];if(ie(t))return t.data.layers;const r=t.layer;return r?[r]:[]}function jt({attributes:e},t){const r=new Set;r.add(t.objectIdField),"uniqueIdFields"in t&&t.uniqueIdFields&&t.uniqueIdFields.length>0&&v(r,t.uniqueIdFields);const n={};for(const o of r)null!=e[o]&&(n[o]=e[o]);if("scene"===t.type&&null!=t.infoFor3D){const r=t.associatedLayer?.globalIdField;null!=r&&(e[r]=e[r])}return n}function kt(e){if(!At(e))return e;const t=new Map;for(const r of e){const e=r.getObjectId();if(null!=e){const n=r.sourceLayer??r.layer;p(t,n,()=>[]).push(e)}}return Array.from(t.entries()).map(([e,t])=>({layer:e,objectIds:t}))}function At(e){return 0===e.length||G(e[0])}export{Ne as appendAllUtilityNetworkAssociationRelationships,ft as avoidFeatureTemplateSelectionWithOnlyOneItem,gt as canCreateInteractiveEditSession,wt as cloneGraphicExceptMesh,Pe as createLayerIdMap,Ce as createRelationshipKeyMap,ke as createToolFromGeometryType,pt as createWorkflowSteps,Xe as fetchCandidates,tt as fetchFullFeatures,rt as fetchFullFeaturesByObjectId,De as findAllDependencies,Ze as findChangesByGlobalId,Je as findEditorItemForLayer,He as findEditorItemForLayerOrThrow,Ke as findLayerInfo,Ge as generateHashForRelationship,Qe as getCreationAttributes,vt as getFullTemplateForCreationInfo,Ft as getLayersFromWorkflow,we as getRotationVariableAttribute,St as getServiceEditsFromWorkflowData,xe as getServiceInfoForLayer,qe as getServiceLayersById,Te as getSizeVariableAttribute,ge as getVisualVariableAttributes,be as getVisualVariablesForLayer,re as isAnyUpdateLeafWorkflow,ne as isBatchAttributeFormViewModel,oe as isCreateFeaturesWorkflow,ae as isFeatureFormViewModel,At as isGraphicsArray,ue as isMergeFeaturesWorkflow,fe as isMergeWorkflowOptions,pe as isParentWorkflow,de as isSplitFeatureWorkflow,ye as isSplitWorkflowOptions,ht as isTerminalUpdateEventType,se as isUpdateFeatureWorkflow,ie as isUpdateFeaturesWorkflow,he as isUpdateFeaturesWorkflowOptions,le as isUpdateRecordWorkflow,ce as isUpdateWorkflow,Be as isUtilityNetworkAssociationsTable,jt as makeMinimalAttributes,Ee as orderEditsByRelationshipDependencies,mt as prepareAttachmentsForCreateFeaturesWorkflow,Tt as setRelationshipFields,lt as setUpGeometryUpdate,Le as setUpSketchCreateWatchers,ot as setVisualVariablesAndElevationInfoForUpdate,It as showProgressCursor,dt as sizeDefaults,yt as sizeVariableUnitToLengthUnit,Ae as startCreatingNewFeature,nt as startUpdatingFeatureGeometry,ct as swapForEditingSession,kt as toFeatureInfos,je as updateGraphicSymbolWhenRequired,st as visualVariableInteractiveUpdate,bt as whenEditorLayerView,ut as whenGraphicDisplayed,me as workflowInfluencesOutcomeOfParent};
@@ -10,9 +10,8 @@ import type { Icon } from "@esri/calcite-components/components/calcite-icon";
10
10
  import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
11
11
  import type { WidgetProperties } from "./Widget.js";
12
12
  import type { EditorViewModelEvents, EditorViewModelProperties } from "./Editor/EditorViewModel.js";
13
- import type { CreationInfo, FeatureInfo, LayerInfo, SplitFeatureWorkflowStep, SupportingWidgetDefaults } from "./Editor/types.js";
14
- import type { SplitterGeometry, SplitterGeometryType } from "./Editor/support/splitFeatureUtils.js";
15
- import type { HeadingLevel } from "./support/Heading.js";
13
+ import type { CreationInfo, FeatureInfo, LayerInfo, SplitFeatureWorkflowStep, SupportingWidgetDefaults, SplitterGeometryType, SplitterGeometry } from "./Editor/types.js";
14
+ import type { HeadingLevel } from "./support/types.js";
16
15
  import type { SketchLabelOptionsProperties } from "../views/interactive/sketch/SketchLabelOptions.js";
17
16
  import type { SnappingOptionsProperties } from "../views/interactive/snapping/SnappingOptions.js";
18
17
  import type { SketchTooltipOptionsProperties } from "../views/interactive/sketch/SketchTooltipOptions.js";
@@ -112,4 +112,8 @@ export interface Abilities {
112
112
  * @default true
113
113
  */
114
114
  utilityNetworkAssociationsContent?: boolean;
115
- }
115
+ }
116
+
117
+ export interface CompiledExpressionInfos {}
118
+
119
+ export interface CompiledExpressionInfo {}
@@ -11,7 +11,7 @@ import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
11
11
  import type { WidgetProperties } from "./Widget.js";
12
12
  import type { FeatureViewModelProperties } from "./Feature/FeatureViewModel.js";
13
13
  import type { FeatureContentMixin, FeatureContentMixinProperties } from "./Feature/support/FeatureContentMixin.js";
14
- import type { HeadingLevel } from "./support/Heading.js";
14
+ import type { HeadingLevel } from "./support/types.js";
15
15
  import type { GraphicProperties } from "../Graphic.js";
16
16
  import type { PointProperties } from "../geometry/Point.js";
17
17
 
@@ -46,8 +46,8 @@ export interface FeatureFormViewModelEvents {
46
46
  * Call [FeatureLayer#applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) method
47
47
  * to update a feature's attributes.
48
48
  *
49
- * @see [FeatureForm#submit()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#submit)
50
- * @see [FeatureForm#getValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#getValues)
49
+ * @see [submit()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#submit)
50
+ * @see [getValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#getValues)
51
51
  * @example
52
52
  * // Listen to the feature form's submit event.
53
53
  * featureForm.on("submit", function(){
@@ -6,7 +6,7 @@ import type { InputType } from "../../form/elements/inputs/Input.js";
6
6
  import type { Domain } from "../../layers/support/domains.js";
7
7
  import type { FieldValue } from "../../layers/support/fieldUtils.js";
8
8
  import type { EditableInputProperties } from "./EditableInput.js";
9
- import type { FieldInputDataTypes } from "../support/forms/formUtils.js";
9
+ import type { FieldInputDataTypes } from "../support/forms/types.js";
10
10
 
11
11
  export interface FieldInputProperties extends EditableInputProperties, Partial<Pick<FieldInput, "value">> {
12
12
  /** Indicates whether the field is required. If the field is not editable, this property returns `false`. */
@@ -8,7 +8,7 @@ import type { Icon } from "@esri/calcite-components/components/calcite-icon";
8
8
  import type { FormTemplateProperties } from "../form/FormTemplate.js";
9
9
  import type { TimeZone } from "../time/types.js";
10
10
  import type { FeatureFormViewModelEvents, FeatureFormViewModelProperties } from "./FeatureForm/FeatureFormViewModel.js";
11
- import type { HeadingLevel } from "./support/Heading.js";
11
+ import type { HeadingLevel } from "./support/types.js";
12
12
  import type { VisibleElementsProperties } from "./FeatureForm/VisibleElements.js";
13
13
  import type { WidgetProperties } from "./Widget.js";
14
14
 
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../intl.js";import{isSome as l}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import{referenceSetter as r}from"../../core/collectionUtils.js";import{deprecatedFunction as n}from"../../core/deprecate.js";import a from"../../core/Error.js";import h from"../../core/Handles.js";import d from"../../core/Logger.js";import{abortMaybe as m}from"../../core/maybe.js";import{debounce as c,ignoreAbortErrors as p,after as u,throwIfAborted as g,createResolver as b}from"../../core/promiseUtils.js";import{watch as f,on as y,initial as T}from"../../core/reactiveUtils.js";import{throttle as w}from"../../core/throttle.js";import{property as _,subclass as C}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as I}from"../../editing/fieldUtils.js";import{geometryTypes as v}from"../../geometry/support/typeUtils.js";import{getLowerCaseDefaultHiddenFields as E}from"../../layers/support/fieldUtils.js";import{getSubtypesFromLayer as A,isSubtypeGroupLayer as F}from"../../layers/support/layerUtils.js";import{createFieldInfos as S}from"../../support/popupUtils.js";import j from"../../tables/AttributeTableTemplate.js";import R from"../../tables/support/FieldOrder.js";import x from"../../time/TimeExtent.js";import{defaultHighlightName as U,temporaryHighlightName as O}from"../../views/support/HighlightDefaults.js";import{highlightsSupported as V}from"../../views/support/layerViewUtils.js";import{isISelectableLayerWithObjectIds as z}from"../../views/support/selectionUtils.js";import W from"./ActionColumn.js";import P from"./AttachmentsColumn.js";import H from"./FieldColumn.js";import L from"./RelationshipColumn.js";import B from"./Grid/Column.js";import G from"./Grid/Grid.js";import k from"./Grid/GridViewModel.js";import N from"./Grid/GroupColumn.js";import D from"./support/AttachmentsColumnTemplate.js";import M from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as $,isFieldColumn as Z,isRelationshipColumn as q}from"./support/columnUtils.js";import{downloadAttachmentInfo as Q,exportToCSV as K}from"./support/exportUtils.js";import J from"./support/FeatureStore.js";import X from"./support/FieldColumnTemplate.js";import Y from"./support/RelationshipColumnTemplate.js";import ee from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as te,isIFeatureTableSupportedLayerWithRelationships as ie,findRelatedLayerInSources as se,findRelationship as le,uniqueColumnNames as oe,hasColumnForField as re,findField as ne,isIFeatureTableSupportedLayerWithAttachments as ae,getTableHighlightKey as he,getRelationshipIdsToShow as de}from"./support/tableUtils.js";import{createAttributeTableElements as me}from"./support/templateUtils.js";import{goTo as ce}from"../support/goToUtils.js";import{messageBundle as pe}from"../support/widget.js";const ue="80px";let ge=class extends k{constructor(e){super(e),this._currentTemporaryHighlight=null,this._highlights=new h,this._refreshDebounced=c(()=>this._refresh()),this._syncTemplateThrottled=w(()=>this._syncAttributeTableTemplate()),this._temporaryHighlightAbortController=null,this.attachmentsViewOptions=new M,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new o,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:l}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===l.length&&-1===l.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const o=this.paginationEnabled?this.pageIndex:e.page,r=await s.fetchItems({...e,page:o});t&&t(r)},this.grid=null,this.highlightEnabled=!0,this.layers=null,this.maxSize=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new o,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set("store",new J),this._set("grid",new G({viewModel:this}))}initialize(){const e=async()=>{this.messages=await s("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await s("esri/t9n/common"),this.messagesUnits=await s("esri/core/t9n/Units"),this.messagesURIUtils=await s("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([t(()=>{e(),this._generateColumns()}),f(()=>[this.messages,this.messagesCommon,this.messagesURIUtils],()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach(t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils}),this.refreshCellContent()},T),y(()=>this.highlightIds,"change",e=>this._onHighlightIdsChange(e),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),f(()=>this.grid?.temporaryHighlightId,e=>{this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController,p(this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal))}),f(()=>this.attachmentsEnabled,()=>this.layer?.loaded&&this._generateColumns()),f(()=>this._viewSelection,()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}),f(()=>[this._tableHighlightsReady,this._viewSelectionReady],()=>this._syncSelection()),f(()=>this.layer,async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch(()=>{})),t&&null!=this.attachmentsViewOptions.objectId&&(this.attachmentsViewOptions.objectId=null)}),f(()=>this.layer?.loaded,e=>e&&this._onLayerLoad()),f(()=>this.store.state,e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())}),f(()=>this._effectiveTableTemplate,()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()}),f(()=>this.editingEnabled,()=>this.refreshCellContent()),f(()=>this.timeZone??this.view?.timeZone,()=>this.refreshCellContent()),f(()=>this.store.effectiveWhere,()=>"loaded"===this.store.state&&this.reset()),f(()=>this.layer?.timeExtent,(e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset()),y(()=>this.layer,"refresh",e=>this._onLayerRefresh(e)),y(()=>this.grid,["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder"],({index:e,item:t,native:i,path:s,type:l})=>{const o=t?.feature,r=o?.getObjectId(),n="cell-keydown"===l&&i&&i instanceof KeyboardEvent&&"Enter"===i.key;this.emit(l,{feature:o,index:e,native:i,type:l,fieldName:s??void 0,objectId:r}),(n||"cell-click"===l)&&this._onCellInteraction(r)}),f(()=>this.actionColumnConfig,e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())}),f(()=>this.relatedRecordsEnabled,()=>this.layer?.loaded&&this._generateColumns()),y(()=>this.objectIds,"change",()=>this._onObjectIdsChange(),{onListenerAdd:()=>this._onObjectIdsChange()}),f(()=>[this.paginationEnabled,this.pageIndex],()=>this.refreshPageCache()),f(()=>this.activeSortOrders,e=>{this.store.sortOrders=e,this._syncTemplateThrottled()}),f(()=>this.allVisibleColumns,()=>this._syncTemplateThrottled()),f(()=>this.pageCount,()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}),f(()=>this.state,e=>{"disabled"===e&&this.relatedTables.length&&this.drainRelatedTables()}),y(()=>this.tableParent?.highlightIds,"change",({added:e})=>{const{relationshipConfig:t}=this,i=e[0];if(null==i||!t)return;const{relatedLayer:s,relationshipId:l}=t;this.relationshipConfig={objectId:i,relatedLayer:s,relationshipId:l}}),y(()=>this.tableParent,"cell-click",e=>{const{tableParent:t}=this,{objectId:i}=e;t&&null!=i&&t.highlightIds.add(i)}),f(()=>this.attachmentsViewOptions.objectId,(e,t)=>{null!=e?null==t&&this.showAttachmentsView({objectId:e}):this.hideAttachmentsView()}),f(()=>this.layerFieldConfigurations,()=>this.refreshCellContent())])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this._currentTemporaryHighlight?.handle.remove(),this._temporaryHighlightAbortController=m(this._temporaryHighlightAbortController),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return E(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _highlightableLayerView(){const e=this.layerView;return V(e)?e:null}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;return z(e)&&this._selectionManager?.sources?.includes(e)?e:null}get _subtypes(){return A(this.layer)}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get actionColumn(){return super.actionColumn}get activeFilters(){const{filterGeometry:e,objectIds:t,filterBySelectionEnabled:i,highlightIds:s}=this,l=new o;return e&&l.push({type:"geometry",geometry:e}),i?l.push({type:"selection",objectIds:s.toArray()}):t.length&&l.push({type:"objectId",objectIds:t.toArray()}),l}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map(({path:e,direction:t})=>({fieldName:e,direction:t})).filter(e=>e.fieldName&&e.direction):[]}get allColumns(){return super.allColumns}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get allVisibleColumns(){return super.allVisibleColumns}get attachmentsColumns(){return this.allColumns.filter(e=>$(e))}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get editingEnabled(){return super.editingEnabled}set editingEnabled(e){super.editingEnabled=e}get effectiveSize(){return super.effectiveSize}get fieldColumns(){return this.allColumns.filter(e=>Z(e))}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get groupColumns(){return super.groupColumns}get hiddenFields(){return this._get("hiddenFields")??new o}set hiddenFields(e){this._set("hiddenFields",r(e,this._get("hiddenFields"),o))}get highlightIds(){return super.highlightIds}set highlightIds(e){super.highlightIds=e}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isEditing(){return super.isEditing}get isQuerying(){return super.isQuerying}get isSyncing(){return super.isSyncing}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some(e=>!!e.isQueryingOrSyncing)}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some(e=>!!e.isSyncingAttachments)}get layer(){return this._get("layer")}set layer(e){this._highlights.removeAll(),this.drainRelatedTables(),this._set("layer",e)}get layerFieldConfigurations(){const e=this.layer;return te(e)?e.fieldConfigurations:void 0}get layerView(){return this.store.layerView}get objectIds(){return super.objectIds}set objectIds(e){super.objectIds=e}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get pageCount(){return super.pageCount}get pageIndex(){return super.pageIndex}set pageIndex(e){super.pageIndex=e}get pageSize(){return super.pageSize}set pageSize(e){super.pageSize=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find(({id:t})=>t===e)}get relationshipColumns(){return this.allColumns.filter(e=>q(e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){const{layer:e,layers:t,relationships:i,tableController:s}=this,l=this.store.relationshipInfos;if(l.length||!ie(e)||!i?.length)return l;const o=[],r=s?.layers||t||[];return i.forEach(t=>{const i=se(e,r,t);i&&(i.load(),o.push({layer:e,relatedLayer:i,relationshipId:t.id}))}),o}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get rowHighlightIds(){return super.rowHighlightIds}set rowHighlightIds(e){super.rowHighlightIds=e}get showAllRelatedTables(){return this._get("showAllRelatedTables")}set showAllRelatedTables(e){const{relatedTable:t}=this;this._set("showAllRelatedTables",e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get size(){return super.size}get state(){return super.state}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){const{store:{supportsAddAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){return this.supportsUpdateAttachments}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){const{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this.store.timeZone}set timeZone(e){this.store.timeZone=e}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach(t=>t.view=e),this.refreshCellContent()}get visibleColumns(){return super.visibleColumns}async addAttachment(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.addAttachment(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteAttachments(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.deleteAttachments(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}collapseRelatedTable(e,t){const{relatedLayer:i,objectId:s,relationshipId:l}=t,{objectIdField:r}=i,n=le(i,l),a=i.displayField||n?.keyField||r;e.set({highlightIds:new o([s]),multipleSelectionEnabled:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,a,l)});const h=e.hiddenFields;h.includes(oe.action)||h.add(oe.action),h.includes(oe.attachments)||h.add(oe.attachments),e.scrollLeft()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter(e=>!e.error).map(e=>e.objectId);i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async downloadAttachmentById(e,t){const i=(await this.store.getAttachmentsByObjectId(e,!0)).find(e=>e.id===t);await Q(i)}drainRelatedTables(){this.relatedTables.drain(e=>e.destroy()),this.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([oe.action,oe.attachments])}drainRelatedTablesAboveIndex(e){const{relatedTables:t}=this,i=t.slice(e+1);t.removeMany(i).forEach(e=>e.destroy());const s=t.at(-1);s&&(s.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(s):this._hideAllRelatedTables(s))}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await K({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(n(d.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabled:!0,tableTemplateOverride:null}),this.hiddenFields.remove(oe.action)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){await Promise.all([...this.relatedTables.map(e=>e.refresh()),p(this._refreshDebounced())])}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){const{attachmentId:e,form:t,objectId:i}=this.attachmentsViewOptions;null!=i&&t&&(null!=e?await this.updateAttachment(i,e,t):await this.addAttachment(i,t))}async showAttachmentsView({objectId:e}){const{attachmentsViewOptions:t,hiddenFields:i,layer:s}=this;if(!this.attachmentsEnabled||!s)return void this._logWarning("The 'attachmentsEnabled' property is currently false.");await s.load();const l=this._getDefaultLayerDisplayField(s),r=await this.store.getAttachmentsByObjectId(e,!0),n=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:r,mode:r.length?"list":"file",objectId:e}),this.set({highlightIds:new o([e]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(l)}),i.includes(oe.action)||i.add(oe.action),null!=n&&this.scrollToIndex(n)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}clearSelectionFilter(){n(d.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async updateAttachment(e,t,i){const{attachmentsViewOptions:s,store:l}=this,o=s.objectId===e;await l.updateAttachment(e,t,i).catch(e=>{o&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),s.error=e.error)}),o&&!s.error&&(s.onEditComplete(),s.attachmentInfos=await l.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const l=await e.queryFeatures(s);try{await ce(t,l.features)}catch(o){"AbortError"!==o.name&&console.error(o)}}_syncAttributeTableTemplate(e=!1){const{_effectiveAttributeTableTemplate:t,layer:i,tableTemplateOverride:s,syncTemplateOnChangesEnabled:l}=this;if(!i||!t||!l&&!e||s||this.tableParent||this.relatedTable||null!==this.attachmentsViewOptions.objectId)return;const{activeSortOrders:o,allColumns:r,columns:n}=this,a=[],h=me(n.toArray());o.forEach(({fieldName:e,direction:t})=>{e&&t&&a.push(new R({field:e,order:t}))}),r.forEach(({fieldName:e,direction:t})=>{t&&!a.some(t=>t.field===e)&&a.push(new R({field:e,order:t}))}),t.elements=h,t.orderByFields=a}async _refresh(){await this.store.refresh();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach((t,i)=>{t||this.highlightIds.remove(e[i])})}this.refreshPageCache();const t=this.attachmentsViewOptions;null!=t?.objectId&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;e.parent&&F(e.parent)&&await e.parent.loadAll();const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,l=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=l),this.grid?.set("pageSize",l),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t}=this,i=e?.columnTemplates,s=this._generateColumnsFromColumnTemplates(i)??this._generateColumnsFromAttributeTableTemplate(t)??this._generateDefaultFieldColumns();s.length&&(this.attachmentsEnabled&&!s.some(e=>$(e))&&s.push(this._generateDefaultAttachmentsColumn()),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!s.some(e=>q(e))&&s.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&s.push(this._generateActionColumn()),s.sort((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0),this.columns.addMany(s))}_generateColumnsFromAttributeTableTemplate(e){const{layer:t}=this;if(!e||!t)return null;const{elements:i,orderByFields:s}=e,o=S(t),r=[];r.push(...this._generateColumnsFromAttributeTableElements(i,s));const n=o.map(e=>{if(!e.fieldName||re(e.fieldName,r))return null;const{fieldName:i}=e,l=ne(t,i);return l?this._generateDefaultFieldColumn(l,{hidden:!0,orderByFields:s}):(this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null)}).filter(l);return r.push(...n),this.attachmentsEnabled&&ae(t)&&!r.some(e=>$(e))&&r.push(this._generateDefaultAttachmentsColumn({hidden:!0})),this.relatedRecordsEnabled&&ie(t)&&t.relationships?.forEach(({id:e},t)=>{const i=this.relationshipInfos.find(t=>t.relationshipId===e);i&&!r.some(t=>q(t)&&t.relationshipId===e)&&r.push(this._generateDefaultRelationshipColumn({hidden:!0,info:i,index:t}))}),r.length?r:null}_generateColumnsFromAttributeTableElements(e,t){const{layer:i}=this;return i?e?.map((e,i)=>{switch(e.type){case"field":return this._createFieldColumnFromElement({element:e,orderByFields:t});case"group":return this._createGroupColumnFromElement({element:e,orderByFields:t});case"attachment":return this._createAttachmentColumnFromElement({element:e,index:i});case"relationship":return this._createRelationshipColumnFromElement({element:e,index:i})}}).filter(e=>!!e)??[]:[]}_createFieldColumnFromElement(e){const{layer:t}=this;if(!t)return null;const{element:i,orderByFields:s}=e,{fieldName:l}=i;if(null==l)return this._logTemplateWarning("A valid 'fieldName' must be provided."),null;const o=ne(t,l);if(!o)return this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null;const{description:r,label:n}=i,a=s?.findIndex(({field:e})=>e&&e===l)??-1,h=a>-1?s?.at(a)?.order:void 0,d=a>-1?a:void 0,{grid:m,messages:c,messagesCommon:p,messagesURIUtils:u,store:g,view:b}=this;return new H({description:r,direction:h,field:o,fieldName:l,grid:m,initialSortPriority:d,label:n,layer:t,messages:c,messagesCommon:p,messagesURIUtils:u,store:g,view:b,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){const{element:t,orderByFields:i}=e,{description:s,label:l}=t;if(!l)return this._logTemplateWarning("Group columns require a label."),null;if(!t.elements.length)return this._logTemplateWarning("Group columns require child columns."),null;const{grid:o,messages:r,messagesCommon:n,messagesURIUtils:a,store:h}=this;return new N({columns:this._generateColumnsFromAttributeTableElements(t.elements,i),description:s,grid:o,label:l,messages:r,messagesCommon:n,messagesURIUtils:a,store:h})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled)return void this._logTemplateWarning("The 'attachmentsEnabled' property is currently false.");const{element:t,index:i}=e,{description:s,label:l}=t,{grid:o,layer:r,messages:n,messagesCommon:a,messagesURIUtils:h,store:d}=this;return new P({description:s,fieldName:`${oe.attachments}-${i}`,grid:o,label:l,layer:r,messages:n,messagesCommon:a,messagesURIUtils:h,store:d,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{element:t,index:i}=e,{description:s,label:l,relationshipId:o}=t,r=this.relationshipInfos.find(e=>e.relationshipId===o);if(!r)return this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id."),null;const{grid:n,messages:a,messagesCommon:h,messagesURIUtils:d,store:m}=this;return new L({description:s,fieldName:`${oe.relationship}-${o}-${i}`,grid:n,label:l,messages:a,messagesCommon:h,messagesURIUtils:d,relationshipId:o,store:m,layer:r.relatedLayer,relatedLayer:r.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r,view:n}=this;if(!e?.length||!i)return null;const a=[];return e.forEach((e,h)=>{const{autoWidth:d,description:m,direction:c,flexGrow:p,fieldName:u,formatFunction:g,frozen:b,frozenToEnd:f,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,menuConfig:v,resizable:E,sortable:A,textAlign:F,textWrap:S,timeZone:j,type:R,width:x}=e;if(!R)return void this._logTemplateWarning("Property 'type' is missing from the provided template.");if(b&&f)return void this._logTemplateWarning("Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.");const U=!1===e.visible;if("group"===R){if(!e.columnTemplates?.length)return void this._logTemplateWarning("Group columns must contain column templates.");if(!e.label)return void this._logTemplateWarning("Group columns require a label.");const i=this._generateColumnsFromColumnTemplates(e.columnTemplates),r=U||this._isFieldHidden(e.label);a.push(new N({autoWidth:d,columns:i,description:m,flexGrow:p,frozen:b,frozenToEnd:f,grid:t,hidden:r,icon:y,iconText:T,invalid:_,label:C,labelTooltipText:I,menuConfig:v,messages:s,messagesCommon:l,messagesURIUtils:o,resizable:E,textAlign:F,textWrap:S,timeZone:j,width:x}))}else if("attachment"===R){if(!this.attachmentsEnabled)return void this._logTemplateWarning("Attachment columns require attachments to be enabled on the table.");a.push(this._generateAttachmentsColumnFromTemplate(e,h))}else if("relationship"===R){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{relationshipId:t}=e;if(null==t)return void this._logTemplateWarning("Property 'relationshipId' is missing from the provided template.");const i=this.relationshipInfos.find(e=>e.relationshipId===t);if(!i)return void this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id.");a.push(this._generateRelationshipColumnFromTemplate(i,e,h))}else if(!u)return void this._logTemplateWarning("Value for 'fieldName' property was missing from the provided template.");const O=U||this._isFieldHidden(u);if("column"===R)a.push(new B({autoWidth:d,description:m,direction:c,fieldName:u,flexGrow:p,formatFunction:g,frozen:b,frozenToEnd:f,grid:t,hidden:O,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,menuConfig:v,messages:s,messagesCommon:l,messagesURIUtils:o,resizable:E,sortable:A,textAlign:F,textWrap:S,timeZone:j,width:x}));else if("field"===R){const h=ne(i,e.fieldName);if(!h)return void this._logTemplateWarning("A valid 'field' could not be found for the provided template.");const{editable:u,required:R}=e;a.push(new H({autoWidth:d,description:m,direction:c,editable:u,field:h,fieldName:h.name,flexGrow:p,formatFunction:g,frozen:b,frozenToEnd:f,grid:t,hidden:O,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,menuConfig:v,required:R,resizable:E,sortable:A,store:r,template:e,textAlign:F,textWrap:S,timeZone:j,width:x,view:n,onShowPromptCallback:this._onShowPromptCallback}))}}),a.length?a:null}_generateDefaultFieldColumns(){return this.layer?.fields?.map(e=>this._generateDefaultFieldColumn(e)).filter(l)??[]}_generateDefaultFieldColumn(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n,view:a}=this,h=t?.orderByFields;if(!e.visible||"geometry"===e.type)return null;const d=e.name,m=h?.findIndex(({field:e})=>e&&e===d)??-1,c=m>-1?h?.at(m)?.order:void 0,p=m>-1?m:void 0;return new H({direction:c,field:e,fieldName:d,grid:i,hidden:t?.hidden||this._isFieldHidden(d),initialSortPriority:p,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n,view:a,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n}=this,{attachmentsViewEnabled:a,autoWidth:h,description:d,flexGrow:m,fieldName:c,formatFunction:p,frozen:u,frozenToEnd:g,icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,resizable:C,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:S,timeZone:j,width:R}=e;return new P({attachmentsViewEnabled:a,autoWidth:h,description:d,fieldName:`${oe.attachments}-${t}`,flexGrow:m,formatFunction:p,frozen:u,frozenToEnd:g,grid:i,hidden:!1===e.visible||this._isFieldHidden(T)||this._isFieldHidden(c),icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,layer:s,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:r,resizable:C,store:n,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:S,timeZone:j,width:R,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r}=this,n=oe.attachments;return new P({fieldName:n,grid:t,hidden:e?.hidden||this._isFieldHidden(n),layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,i){const{grid:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n}=this,{autoWidth:a,collapsed:h,description:d,flexGrow:m,fieldName:c,formatFunction:p,frozen:u,frozenToEnd:g,icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,relationshipId:C,resizable:I,textAlign:v,textWrap:E,timeZone:A,width:F}=t;return new L({autoWidth:a,collapsed:h,description:d,fieldName:`${oe.relationship}-${C}-${i}`,flexGrow:m,formatFunction:p,frozen:u,frozenToEnd:g,grid:s,hidden:!1===t.visible||this._isFieldHidden(T)||this._isFieldHidden(c),icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:r,relationshipId:C,resizable:I,store:n,textAlign:v,textWrap:E,timeZone:A,width:F,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){const{relationshipInfos:e,relationshipColumnConfigs:t}=this,i=[];return e?.length?(t?t.forEach((t,s)=>{const{relationshipId:l}=t,o=e.find(e=>e.relationshipId===l);o&&i.push(this._generateDefaultRelationshipColumn({config:t,index:s,info:o}))}):e.forEach((e,t)=>i.push(this._generateDefaultRelationshipColumn({index:t,info:e}))),i):i}_generateDefaultRelationshipColumn(e){const{config:t,hidden:i,index:s,info:l}=e,{grid:o,messages:r,messagesCommon:n,messagesURIUtils:a}=this,{relationshipId:h}=l;return new L({...t,fieldName:`${oe.relationship}-${h}-${s}`,grid:o,hidden:i,messages:r,messagesCommon:n,messagesURIUtils:a,layer:l.relatedLayer,relatedLayer:l.layer,relationshipId:h,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){return new W({hidden:this._isFieldHidden(oe.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some(e=>e.toLowerCase()===t)}_addTableHighlight(e){if(!this.highlightEnabled)return;const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),l=s?.feature??e;this._highlights.add(t.highlight(l,{name:U}),he(i,e))}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(he(t,e))}async _syncTemporaryHighlight(e,t){if(!this.highlightEnabled)return this._currentTemporaryHighlight?.handle.remove(),void(this._currentTemporaryHighlight=null);if(await u(25),g(t),!this._currentTemporaryHighlight&&!e)return;const{id:i}=this._currentTemporaryHighlight??{};if(i===e)return;this._currentTemporaryHighlight?.handle?.remove(),this._currentTemporaryHighlight=null;const{_highlightableLayerView:s,layer:l,highlightEnabled:o}=this;e&&s&&l&&o&&(this._currentTemporaryHighlight={id:e,handle:s.highlight(e,{name:O})})}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach(e=>this._addTableHighlight(e)):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.appendToSelection(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.removeFromSelection(t,e)}async _onHighlightIdsChange(e){const{added:t,removed:i}=e,{attachmentsViewOptions:s}=this;if(this._tableHighlightsReady?(i.forEach(e=>this._removeTableHighlight(e)),t.forEach(e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),null!=s.objectId){const e=this.highlightIds.at(0);if(null!=e){const t=await this.store.getAttachmentsByObjectId(e,!0);s.set({attachmentInfos:t,objectId:e,mode:t.length?"list":"file"})}}}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}_showAllRelatedTables(e){const t=e.layer;if(!t)return;const i=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,i)});const s=e.hiddenFields;s.includes(oe.action)||s.add(oe.action),s.includes(oe.attachments)||s.add(oe.attachments)}_hideAllRelatedTables(e){const{layer:t,relationship:i}=e;if(t&&null!=i?.id)if(null!=e.attachmentsViewOptions.objectId){const i=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabled:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)})}else e.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:de(t,i.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([oe.action,oe.attachments])}_getTableTemplateForRelatedTableView(e,t,i){return new ee({columnTemplates:[new X({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([s,l])=>({selected:s===t,label:l||s,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,s,i)}}))},resizable:!1}),new Y({autoWidth:!1,collapsed:!0,flexGrow:0,label:"",resizable:!1,relationshipId:i,width:ue})]})}_getTableTemplateForShowAllTablesView(e,t){const i=[new X({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([i,s])=>({selected:i===t,label:s||i,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,i)}}))},resizable:!1})];return null!=e.attachmentsViewOptions.objectId&&i.push(new D({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:ue})),new ee({columnTemplates:i})}async _onShowPromptCallback(e){const{column:t,objectId:i,oldValue:s,value:l}=e,{_subtypes:o,layer:r}=this;if(!r||!o.length)return void t.cancel();const n=o.find(e=>e.code===l);if(!n)return void t.cancel();const a=b(),h=this._createSubtypeEditPrompt(s,n,a),d=!!r.parent;try{this.showPrompt(h);const e=await a.promise,s=[{fieldName:t.fieldName,value:l}];switch(e){case"update-fields":for(const[e,t]of Object.entries(n.defaultValues))null!=t&&s.push({fieldName:e,value:t});await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"keep-existing":await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"undo":t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,s){const{_subtypes:l,messages:o,messagesCommon:r}=this,n=l.find(t=>t.code===e)?.name??`${e}`;let a="update-fields";const h=[{label:o.subtypes.useDefaultValuesOption,value:"update-fields"},{label:o.subtypes.keepCurrentValuesOption,value:"keep-existing"}];return{context:"info",title:o.subtypes.changeWarningTitle,message:i(o.subtypes.changeWarning,{originalType:n,newType:t.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>{a=e},actions:{primary:{label:r.apply,action:()=>s.resolve(a),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>s.resolve("undo")}},cancel:()=>s.reject()}}_onShowAttachments({objectId:e}){this.attachmentsViewOptions.objectId=e}_getTableTemplateForAttachmentsView(e){return new ee({columnTemplates:[new X({fieldName:e,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(this).map(([t,i])=>({selected:t===e,label:i||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}}))},resizable:!1}),new D({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:ue})]})}_extractFieldColumnInfosFromTableTemplate(e){const t=e??this,{layer:i,tableTemplate:s}=t;return s?s.columnTemplates.filter(({type:e})=>"field"===e||"column"===e).map(({fieldName:e,label:t})=>{if(null!=t&&""!==t)return[e,t];const s=i?.fieldsIndex.get(e);return[e,s&&I(s,i)]}):i?.fields.map(e=>[e.name,I(e,i)])??[]}_getDefaultLayerDisplayField(e){const{displayField:t,objectIdField:i}=e;return t&&""!==t.trim()?t:i||(e.fields.length?e.fields[0].name:"")}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex(e=>e.frozenToEnd);return e>-1?e:void 0}_logWarning(e,t){t?d.getLogger(this).warnOnce(e):d.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){null!=e&&null!=this.attachmentsViewOptions.objectId&&this.highlightIds.add(e)}};e([_()],ge.prototype,"_defaultHiddenFields",null),e([_()],ge.prototype,"_effectiveTableTemplate",null),e([_()],ge.prototype,"_effectiveAttributeTableTemplate",null),e([_()],ge.prototype,"_highlights",void 0),e([_()],ge.prototype,"_highlightableLayerView",null),e([_()],ge.prototype,"_selectionManager",null),e([_()],ge.prototype,"_selectableLayer",null),e([_()],ge.prototype,"_subtypes",null),e([_()],ge.prototype,"_tableHighlightsReady",null),e([_()],ge.prototype,"_viewSelection",null),e([_()],ge.prototype,"_viewSelectionReady",null),e([_()],ge.prototype,"activeFilters",null),e([_({readOnly:!0})],ge.prototype,"activeSortOrders",null),e([_()],ge.prototype,"allRelatedTablesVisible",null),e([_()],ge.prototype,"attachmentsColumns",null),e([_()],ge.prototype,"attachmentsEnabled",null),e([_()],ge.prototype,"attachmentsViewOptions",void 0),e([_({type:j})],ge.prototype,"attributeTableTemplate",void 0),e([_()],ge.prototype,"autoRefreshEnabled",void 0),e([_()],ge.prototype,"clearPrompt",null),e([_({readOnly:!0})],ge.prototype,"columns",void 0),e([_()],ge.prototype,"dataProvider",void 0),e([_()],ge.prototype,"definitionExpression",null),e([_()],ge.prototype,"fieldColumns",null),e([_({types:v})],ge.prototype,"filterGeometry",null),e([_()],ge.prototype,"filterBySelectionEnabled",null),e([_({readOnly:!0})],ge.prototype,"grid",void 0),e([_()],ge.prototype,"hiddenFields",null),e([_()],ge.prototype,"highlightEnabled",void 0),e([_()],ge.prototype,"initialSize",null),e([_()],ge.prototype,"isQueryingOrSyncing",null),e([_()],ge.prototype,"isSyncingAttachments",null),e([_()],ge.prototype,"layer",null),e([_()],ge.prototype,"layers",void 0),e([_()],ge.prototype,"layerFieldConfigurations",null),e([_()],ge.prototype,"layerView",null),e([_()],ge.prototype,"menuConfig",void 0),e([_()],ge.prototype,"messages",void 0),e([_(),pe("esri/t9n/common")],ge.prototype,"messagesCommon",void 0),e([_(),pe("esri/core/t9n/Units")],ge.prototype,"messagesUnits",void 0),e([_(),pe("esri/widgets/support/t9n/uriUtils")],ge.prototype,"messagesURIUtils",void 0),e([_()],ge.prototype,"outFields",null),e([_()],ge.prototype,"prompt",void 0),e([_()],ge.prototype,"relatedRecordsEnabled",null),e([_()],ge.prototype,"relatedTable",null),e([_()],ge.prototype,"relatedTables",void 0),e([_()],ge.prototype,"relationship",null),e([_()],ge.prototype,"relationshipColumnConfigs",void 0),e([_()],ge.prototype,"relationshipColumns",null),e([_()],ge.prototype,"relationshipConfig",null),e([_()],ge.prototype,"relationshipInfos",null),e([_()],ge.prototype,"relationships",null),e([_()],ge.prototype,"returnGeometryEnabled",null),e([_()],ge.prototype,"returnMEnabled",null),e([_()],ge.prototype,"returnZEnabled",null),e([_()],ge.prototype,"selectionSource",void 0),e([_()],ge.prototype,"showAllRelatedTables",null),e([_()],ge.prototype,"showPrompt",null),e([_()],ge.prototype,"showRelatedTableCallback",void 0),e([_({readOnly:!0,type:J})],ge.prototype,"store",void 0),e([_()],ge.prototype,"supportsAttachments",null),e([_()],ge.prototype,"supportsAddAttachments",null),e([_()],ge.prototype,"supportsDeleteAttachments",null),e([_()],ge.prototype,"supportsResizeAttachments",null),e([_()],ge.prototype,"supportsUpdateAttachments",null),e([_()],ge.prototype,"syncTemplateOnChangesEnabled",void 0),e([_()],ge.prototype,"tableController",void 0),e([_()],ge.prototype,"tableParent",void 0),e([_({type:ee})],ge.prototype,"tableTemplate",void 0),e([_()],ge.prototype,"tableTemplateOverride",void 0),e([_({type:x})],ge.prototype,"timeExtent",null),e([_()],ge.prototype,"timeZone",null),e([_()],ge.prototype,"view",null),ge=e([C("esri.widgets.FeatureTable.FeatureTableViewModel")],ge);const be=ge;export{be as default};
5
+ import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../intl.js";import{isSome as l}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import{referenceSetter as r}from"../../core/collectionUtils.js";import{deprecatedFunction as n}from"../../core/deprecate.js";import a from"../../core/Error.js";import h from"../../core/Handles.js";import d from"../../core/Logger.js";import{abortMaybe as m}from"../../core/maybe.js";import{debounce as c,ignoreAbortErrors as p,after as u,throwIfAborted as g,createResolver as b}from"../../core/promiseUtils.js";import{watch as f,on as y,initial as T}from"../../core/reactiveUtils.js";import{throttle as w}from"../../core/throttle.js";import{property as _,subclass as C}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as I}from"../../editing/fieldUtils.js";import{geometryTypes as v}from"../../geometry/support/typeUtils.js";import{getLowerCaseDefaultHiddenFields as E}from"../../layers/support/fieldUtils.js";import{getSubtypesFromLayer as A,isSubtypeGroupLayer as F}from"../../layers/support/layerUtils.js";import{createFieldInfos as S}from"../../support/popupUtils.js";import j from"../../tables/AttributeTableTemplate.js";import R from"../../tables/support/FieldOrder.js";import x from"../../time/TimeExtent.js";import{defaultHighlightName as U,temporaryHighlightName as O}from"../../views/support/HighlightDefaults.js";import{highlightsSupported as V}from"../../views/support/layerViewUtils.js";import{isISelectableLayerWithObjectIds as z}from"../../views/support/selectionUtils.js";import W from"./ActionColumn.js";import P from"./AttachmentsColumn.js";import H from"./FieldColumn.js";import L from"./RelationshipColumn.js";import B from"./Grid/Column.js";import G from"./Grid/Grid.js";import k from"./Grid/GridViewModel.js";import N from"./Grid/GroupColumn.js";import D from"./support/AttachmentsColumnTemplate.js";import M from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as $,isFieldColumn as Z,isRelationshipColumn as q}from"./support/columnUtils.js";import{downloadAttachmentInfo as Q,exportToCSV as K}from"./support/exportUtils.js";import J from"./support/FeatureStore.js";import X from"./support/FieldColumnTemplate.js";import Y from"./support/RelationshipColumnTemplate.js";import ee from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as te,isIFeatureTableSupportedLayerWithRelationships as ie,findRelatedLayerInSources as se,findRelationship as le,uniqueColumnNames as oe,hasColumnForField as re,findField as ne,isIFeatureTableSupportedLayerWithAttachments as ae,getTableHighlightKey as he,getRelationshipIdsToShow as de}from"./support/tableUtils.js";import{createAttributeTableElements as me}from"./support/templateUtils.js";import{goTo as ce}from"../support/goToUtils.js";import{messageBundle as pe}from"../support/widget.js";const ue="80px";let ge=class extends k{constructor(e){super(e),this._currentTemporaryHighlight=null,this._highlights=new h,this._refreshDebounced=c(()=>this._refresh()),this._syncTemplateThrottled=w(()=>this._syncAttributeTableTemplate()),this._temporaryHighlightAbortController=null,this.attachmentsViewOptions=new M,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new o,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:l}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===l.length&&-1===l.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const o=this.paginationEnabled?this.pageIndex:e.page,r=await s.fetchItems({...e,page:o});t&&t(r)},this.grid=null,this.highlightEnabled=!0,this.layers=null,this.maxSize=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new o,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set("store",new J),this._set("grid",new G({viewModel:this}))}initialize(){const e=async()=>{this.messages=await s("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await s("esri/t9n/common"),this.messagesUnits=await s("esri/core/t9n/Units"),this.messagesURIUtils=await s("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([t(()=>{e(),this._generateColumns()}),f(()=>[this.messages,this.messagesCommon,this.messagesURIUtils],()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach(t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils}),this.refreshCellContent()},T),y(()=>this.highlightIds,"change",e=>this._onHighlightIdsChange(e),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),f(()=>this.grid?.temporaryHighlightId,e=>{this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController,p(this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal))}),f(()=>this.attachmentsEnabled,()=>this.layer?.loaded&&this._generateColumns()),f(()=>this._viewSelection,()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}),f(()=>[this._tableHighlightsReady,this._viewSelectionReady],()=>this._syncSelection()),f(()=>this.layer,async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch(()=>{})),t&&null!=this.attachmentsViewOptions.objectId&&(this.attachmentsViewOptions.objectId=null)}),f(()=>this.layer?.loaded,e=>e&&this._onLayerLoad()),f(()=>this.store.state,e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())}),f(()=>this._effectiveTableTemplate,()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()}),f(()=>this.editingEnabled,()=>this.refreshCellContent()),f(()=>this.timeZone??this.view?.timeZone,()=>this.refreshCellContent()),f(()=>this.store.effectiveWhere,()=>"loaded"===this.store.state&&this.reset()),f(()=>this.layer?.timeExtent,(e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset()),y(()=>this.layer,"refresh",e=>this._onLayerRefresh(e)),y(()=>this.grid,["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder"],({index:e,item:t,native:i,path:s,type:l})=>{const o=t?.feature,r=o?.getObjectId(),n="cell-keydown"===l&&i&&i instanceof KeyboardEvent&&"Enter"===i.key;this.emit(l,{feature:o,index:e,native:i,type:l,fieldName:s??void 0,objectId:r}),(n||"cell-click"===l)&&this._onCellInteraction(r)}),f(()=>this.actionColumnConfig,e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())}),f(()=>this.relatedRecordsEnabled,()=>this.layer?.loaded&&this._generateColumns()),y(()=>this.objectIds,"change",()=>this._onObjectIdsChange(),{onListenerAdd:()=>this._onObjectIdsChange()}),f(()=>[this.paginationEnabled,this.pageIndex],()=>this.refreshPageCache()),f(()=>this.activeSortOrders,e=>{this.store.sortOrders=e,this._syncTemplateThrottled()}),f(()=>this.allVisibleColumns,()=>this._syncTemplateThrottled()),f(()=>this.pageCount,()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}),f(()=>this.state,e=>{"disabled"===e&&this.relatedTables.length&&this.drainRelatedTables()}),y(()=>this.tableParent?.highlightIds,"change",({added:e})=>{const{relationshipConfig:t}=this,i=e[0];if(null==i||!t)return;const{relatedLayer:s,relationshipId:l}=t;this.relationshipConfig={objectId:i,relatedLayer:s,relationshipId:l}}),y(()=>this.tableParent,"cell-click",e=>{const{tableParent:t}=this,{objectId:i}=e;t&&null!=i&&t.highlightIds.add(i)}),f(()=>this.attachmentsViewOptions.objectId,(e,t)=>{null!=e?null==t&&this.showAttachmentsView({objectId:e}):this.hideAttachmentsView()}),f(()=>this.layerFieldConfigurations,()=>this.refreshCellContent())])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this._currentTemporaryHighlight?.handle.remove(),this._temporaryHighlightAbortController=m(this._temporaryHighlightAbortController),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return E(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _highlightableLayerView(){const e=this.layerView;return V(e)?e:null}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;return z(e)&&this._selectionManager?.sources?.includes(e)?e:null}get _subtypes(){return A(this.layer)}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get actionColumn(){return super.actionColumn}get activeFilters(){const{filterGeometry:e,objectIds:t,filterBySelectionEnabled:i,highlightIds:s}=this,l=new o;return e&&l.push({type:"geometry",geometry:e}),i?l.push({type:"selection",objectIds:s.toArray()}):t.length&&l.push({type:"objectId",objectIds:t.toArray()}),l}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map(({path:e,direction:t})=>({fieldName:e,direction:t})).filter(e=>e.fieldName&&e.direction):[]}get allColumns(){return super.allColumns}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get allVisibleColumns(){return super.allVisibleColumns}get attachmentsColumns(){return this.allColumns.filter(e=>$(e))}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get editingEnabled(){return super.editingEnabled}set editingEnabled(e){super.editingEnabled=e}get effectiveSize(){return super.effectiveSize}get fieldColumns(){return this.allColumns.filter(e=>Z(e))}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get groupColumns(){return super.groupColumns}get hiddenFields(){return this._get("hiddenFields")??new o}set hiddenFields(e){this._set("hiddenFields",r(e,this._get("hiddenFields"),o))}get highlightIds(){return super.highlightIds}set highlightIds(e){super.highlightIds=e}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isEditing(){return super.isEditing}get isQuerying(){return super.isQuerying}get isSyncing(){return super.isSyncing}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some(e=>!!e.isQueryingOrSyncing)}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some(e=>!!e.isSyncingAttachments)}get layer(){return this._get("layer")}set layer(e){this._highlights.removeAll(),this.drainRelatedTables(),this._set("layer",e)}get layerFieldConfigurations(){const e=this.layer;return te(e)?e.fieldConfigurations:void 0}get layerView(){return this.store.layerView}get objectIds(){return super.objectIds}set objectIds(e){super.objectIds=e}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get pageCount(){return super.pageCount}get pageIndex(){return super.pageIndex}set pageIndex(e){super.pageIndex=e}get pageSize(){return super.pageSize}set pageSize(e){super.pageSize=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find(({id:t})=>t===e)}get relationshipColumns(){return this.allColumns.filter(e=>q(e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){const{layer:e,layers:t,relationships:i,tableController:s}=this,l=this.store.relationshipInfos;if(l.length||!ie(e)||!i?.length)return l;const o=[],r=s?.layers||t||[];return i.forEach(t=>{const i=se(e,r,t);i&&(i.load(),o.push({layer:e,relatedLayer:i,relationshipId:t.id}))}),o}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get rowHighlightIds(){return super.rowHighlightIds}set rowHighlightIds(e){super.rowHighlightIds=e}get showAllRelatedTables(){return this._get("showAllRelatedTables")}set showAllRelatedTables(e){const{relatedTable:t}=this;this._set("showAllRelatedTables",e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get size(){return super.size}get state(){return super.state}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){const{store:{supportsAddAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){return this.supportsUpdateAttachments}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){const{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this.store.timeZone}set timeZone(e){this.store.timeZone=e}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach(t=>t.view=e),this.refreshCellContent()}get visibleColumns(){return super.visibleColumns}async addAttachment(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.addAttachment(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteAttachments(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.deleteAttachments(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}collapseRelatedTable(e,t){const{relatedLayer:i,objectId:s,relationshipId:l}=t,{objectIdField:r}=i,n=le(i,l),a=i.displayField||n?.keyField||r;e.set({highlightIds:new o([s]),multipleSelectionEnabled:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,a,l)});const h=e.hiddenFields;h.includes(oe.action)||h.add(oe.action),h.includes(oe.attachments)||h.add(oe.attachments),e.scrollLeft()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter(e=>!e.error).map(e=>e.objectId);i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async downloadAttachmentById(e,t){const i=(await this.store.getAttachmentsByObjectId(e,!0)).find(e=>e.id===t);await Q(i)}drainRelatedTables(){this.relatedTables.drain(e=>e.destroy()),this.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([oe.action,oe.attachments])}drainRelatedTablesAboveIndex(e){const{relatedTables:t}=this,i=t.slice(e+1);t.removeMany(i).forEach(e=>e.destroy());const s=t.at(-1);s&&(s.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(s):this._hideAllRelatedTables(s))}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await K({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(n(d.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabled:!0,tableTemplateOverride:null}),this.hiddenFields.remove(oe.action)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){await Promise.all([...this.relatedTables.map(e=>e.refresh()),p(this._refreshDebounced())])}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){const{attachmentId:e,form:t,objectId:i}=this.attachmentsViewOptions;null!=i&&t&&(null!=e?await this.updateAttachment(i,e,t):await this.addAttachment(i,t))}async showAttachmentsView({objectId:e}){const{attachmentsViewOptions:t,hiddenFields:i,layer:s}=this;if(!this.attachmentsEnabled||!s)return void this._logWarning("The 'attachmentsEnabled' property is currently false.");await s.load();const l=this._getDefaultLayerDisplayField(s),r=await this.store.getAttachmentsByObjectId(e,!0),n=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:r,mode:r.length?"list":"file",objectId:e}),this.set({highlightIds:new o([e]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(l)}),i.includes(oe.action)||i.add(oe.action),null!=n&&this.scrollToIndex(n)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}clearSelectionFilter(){n(d.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async updateAttachment(e,t,i){const{attachmentsViewOptions:s,store:l}=this,o=s.objectId===e;await l.updateAttachment(e,t,i).catch(e=>{o&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),s.error=e.error)}),o&&!s.error&&(s.onEditComplete(),s.attachmentInfos=await l.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const l=await e.queryFeatures(s);try{await ce(t,l.features)}catch(o){"AbortError"!==o.name&&console.error(o)}}_syncAttributeTableTemplate(e=!1){const{_effectiveAttributeTableTemplate:t,layer:i,tableTemplateOverride:s,syncTemplateOnChangesEnabled:l}=this;if(!i||!t||!l&&!e||s||this.tableParent||this.relatedTable||null!==this.attachmentsViewOptions.objectId)return;const{activeSortOrders:o,allColumns:r,columns:n}=this,a=[],h=me(n.toArray());o.forEach(({fieldName:e,direction:t})=>{e&&t&&a.push(new R({field:e,order:t}))}),r.forEach(({fieldName:e,direction:t})=>{t&&!a.some(t=>t.field===e)&&a.push(new R({field:e,order:t}))}),t.elements=h,t.orderByFields=a}async _refresh(){await this.store.refresh();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach((t,i)=>{t||this.highlightIds.remove(e[i])})}this.refreshPageCache();const t=this.attachmentsViewOptions;null!=t?.objectId&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;e.parent&&F(e.parent)&&await e.parent.loadAll();const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,l=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=l),this.grid?.set("pageSize",l),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t}=this,i=e?.columnTemplates,s=this._generateColumnsFromColumnTemplates(i)??this._generateColumnsFromAttributeTableTemplate(t)??this._generateDefaultFieldColumns();s.length&&(this.attachmentsEnabled&&!s.some(e=>$(e))&&s.push(this._generateDefaultAttachmentsColumn()),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!s.some(e=>q(e))&&s.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&s.push(this._generateActionColumn()),s.sort((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0),this.columns.addMany(s))}_generateColumnsFromAttributeTableTemplate(e){const{layer:t}=this;if(!e||!t)return null;const{elements:i,orderByFields:s}=e,o=S(t),r=[];r.push(...this._generateColumnsFromAttributeTableElements(i,s));const n=o.map(e=>{if(!e.fieldName||re(e.fieldName,r))return null;const{fieldName:i}=e,l=ne(t,i);return l?this._generateDefaultFieldColumn(l,{hidden:!0,orderByFields:s}):(this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null)}).filter(l);return r.push(...n),this.attachmentsEnabled&&ae(t)&&!r.some(e=>$(e))&&r.push(this._generateDefaultAttachmentsColumn({hidden:!0})),this.relatedRecordsEnabled&&ie(t)&&t.relationships?.forEach(({id:e},t)=>{const i=this.relationshipInfos.find(t=>t.relationshipId===e);i&&!r.some(t=>q(t)&&t.relationshipId===e)&&r.push(this._generateDefaultRelationshipColumn({hidden:!0,info:i,index:t}))}),r.length?r:null}_generateColumnsFromAttributeTableElements(e,t){const{layer:i}=this;return i?e?.map((e,i)=>{switch(e.type){case"field":return this._createFieldColumnFromElement({element:e,orderByFields:t});case"group":return this._createGroupColumnFromElement({element:e,orderByFields:t});case"attachment":return this._createAttachmentColumnFromElement({element:e,index:i});case"relationship":return this._createRelationshipColumnFromElement({element:e,index:i})}}).filter(e=>!!e)??[]:[]}_createFieldColumnFromElement(e){const{layer:t}=this;if(!t)return null;const{element:i,orderByFields:s}=e,{fieldName:l}=i;if(null==l)return this._logTemplateWarning("A valid 'fieldName' must be provided."),null;const o=ne(t,l);if(!o)return this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null;const{description:r,label:n}=i,a=s?.findIndex(({field:e})=>e&&e===l)??-1,h=a>-1?s?.at(a)?.order:void 0,d=a>-1?a:void 0,{grid:m,messages:c,messagesCommon:p,messagesURIUtils:u,store:g,view:b}=this;return new H({description:r,direction:h,field:o,fieldName:l,grid:m,initialSortPriority:d,label:n,layer:t,messages:c,messagesCommon:p,messagesURIUtils:u,store:g,view:b,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){const{element:t,orderByFields:i}=e,{description:s,label:l}=t;if(!l)return this._logTemplateWarning("Group columns require a label."),null;if(!t.elements.length)return this._logTemplateWarning("Group columns require child columns."),null;const{grid:o,messages:r,messagesCommon:n,messagesURIUtils:a,store:h}=this;return new N({columns:this._generateColumnsFromAttributeTableElements(t.elements,i),description:s,grid:o,label:l,messages:r,messagesCommon:n,messagesURIUtils:a,store:h})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled)return void this._logTemplateWarning("The 'attachmentsEnabled' property is currently false.");const{element:t,index:i}=e,{description:s,label:l}=t,{grid:o,layer:r,messages:n,messagesCommon:a,messagesURIUtils:h,store:d}=this;return new P({description:s,fieldName:`${oe.attachments}-${i}`,grid:o,label:l,layer:r,messages:n,messagesCommon:a,messagesURIUtils:h,store:d,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{element:t,index:i}=e,{description:s,label:l,relationshipId:o}=t,r=this.relationshipInfos.find(e=>e.relationshipId===o);if(!r)return this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id."),null;const{grid:n,messages:a,messagesCommon:h,messagesURIUtils:d,store:m}=this;return new L({description:s,fieldName:`${oe.relationship}-${o}-${i}`,grid:n,label:l,messages:a,messagesCommon:h,messagesURIUtils:d,relationshipId:o,store:m,layer:r.relatedLayer,relatedLayer:r.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r,view:n}=this;if(!e?.length||!i)return null;const a=[];return e.forEach((e,h)=>{const{autoWidth:d,description:m,direction:c,flexGrow:p,fieldName:u,formatFunction:g,frozen:b,frozenToEnd:f,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,menuConfig:v,resizable:E,sortable:A,textAlign:F,textWrap:S,timeZone:j,type:R,width:x}=e;if(!R)return void this._logTemplateWarning("Property 'type' is missing from the provided template.");if(b&&f)return void this._logTemplateWarning("Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.");const U=!1===e.visible;if("group"===R){if(!e.columnTemplates?.length)return void this._logTemplateWarning("Group columns must contain column templates.");if(!e.label)return void this._logTemplateWarning("Group columns require a label.");const i=this._generateColumnsFromColumnTemplates(e.columnTemplates),r=U||this._isFieldHidden(e.label);a.push(new N({autoWidth:d,columns:i,description:m,flexGrow:p,frozen:b,frozenToEnd:f,grid:t,hidden:r,icon:y,iconText:T,invalid:_,label:C,labelTooltipText:I,menuConfig:v,messages:s,messagesCommon:l,messagesURIUtils:o,resizable:E,textAlign:F,textWrap:S,timeZone:j,width:x}))}else if("attachment"===R){if(!this.attachmentsEnabled)return void this._logTemplateWarning("Attachment columns require attachments to be enabled on the table.");a.push(this._generateAttachmentsColumnFromTemplate(e,h))}else if("relationship"===R){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{relationshipId:t}=e;if(null==t)return void this._logTemplateWarning("Property 'relationshipId' is missing from the provided template.");const i=this.relationshipInfos.find(e=>e.relationshipId===t);if(!i)return void this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id.");a.push(this._generateRelationshipColumnFromTemplate(i,e,h))}else if(!u)return void this._logTemplateWarning("Value for 'fieldName' property was missing from the provided template.");const O=U||this._isFieldHidden(u);if("column"===R)a.push(new B({autoWidth:d,description:m,direction:c,fieldName:u,flexGrow:p,formatFunction:g,frozen:b,frozenToEnd:f,grid:t,hidden:O,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,menuConfig:v,messages:s,messagesCommon:l,messagesURIUtils:o,resizable:E,sortable:A,textAlign:F,textWrap:S,timeZone:j,width:x}));else if("field"===R){const h=ne(i,e.fieldName);if(!h)return void this._logTemplateWarning("A valid 'field' could not be found for the provided template.");const{editable:u,required:R}=e;a.push(new H({autoWidth:d,description:m,direction:c,editable:u,field:h,fieldName:h.name,flexGrow:p,formatFunction:g,frozen:b,frozenToEnd:f,grid:t,hidden:O,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,menuConfig:v,required:R,resizable:E,sortable:A,store:r,template:e,textAlign:F,textWrap:S,timeZone:j,width:x,view:n,onShowPromptCallback:this._onShowPromptCallback}))}}),a.length?a:null}_generateDefaultFieldColumns(){return this.layer?.fields?.map(e=>this._generateDefaultFieldColumn(e)).filter(l)??[]}_generateDefaultFieldColumn(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n,view:a}=this,h=t?.orderByFields;if(!e.visible||"geometry"===e.type)return null;const d=e.name,m=h?.findIndex(({field:e})=>e&&e===d)??-1,c=m>-1?h?.at(m)?.order:void 0,p=m>-1?m:void 0;return new H({direction:c,field:e,fieldName:d,grid:i,hidden:t?.hidden||this._isFieldHidden(d),initialSortPriority:p,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n,view:a,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n}=this,{attachmentsViewEnabled:a,autoWidth:h,description:d,flexGrow:m,fieldName:c,formatFunction:p,frozen:u,frozenToEnd:g,icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,resizable:C,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:S,timeZone:j,width:R}=e;return new P({attachmentsViewEnabled:a,autoWidth:h,description:d,fieldName:`${oe.attachments}-${t}`,flexGrow:m,formatFunction:p,frozen:u,frozenToEnd:g,grid:i,hidden:!1===e.visible||this._isFieldHidden(T)||this._isFieldHidden(c),icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,layer:s,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:r,resizable:C,store:n,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:S,timeZone:j,width:R,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r}=this,n=oe.attachments;return new P({fieldName:n,grid:t,hidden:e?.hidden||this._isFieldHidden(n),layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,i){const{grid:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n}=this,{autoWidth:a,collapsed:h,description:d,flexGrow:m,fieldName:c,formatFunction:p,frozen:u,frozenToEnd:g,icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,relationshipId:C,resizable:I,textAlign:v,textWrap:E,timeZone:A,width:F}=t;return new L({autoWidth:a,collapsed:h,description:d,fieldName:`${oe.relationship}-${C}-${i}`,flexGrow:m,formatFunction:p,frozen:u,frozenToEnd:g,grid:s,hidden:!1===t.visible||this._isFieldHidden(T)||this._isFieldHidden(c),icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:r,relationshipId:C,resizable:I,store:n,textAlign:v,textWrap:E,timeZone:A,width:F,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){const{relationshipInfos:e,relationshipColumnConfigs:t}=this,i=[];return e?.length?(t?t.forEach((t,s)=>{const{relationshipId:l}=t,o=e.find(e=>e.relationshipId===l);o&&i.push(this._generateDefaultRelationshipColumn({config:t,index:s,info:o}))}):e.forEach((e,t)=>i.push(this._generateDefaultRelationshipColumn({index:t,info:e}))),i):i}_generateDefaultRelationshipColumn(e){const{config:t,hidden:i,index:s,info:l}=e,{grid:o,messages:r,messagesCommon:n,messagesURIUtils:a}=this,{relationshipId:h}=l;return new L({...t,fieldName:`${oe.relationship}-${h}-${s}`,grid:o,hidden:i,messages:r,messagesCommon:n,messagesURIUtils:a,layer:l.relatedLayer,relatedLayer:l.layer,relationshipId:h,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){return new W({hidden:this._isFieldHidden(oe.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some(e=>e.toLowerCase()===t)}_addTableHighlight(e){if(!this.highlightEnabled)return;const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),l=s?.feature??e;this._highlights.add(t.highlight(l,{name:U}),he(i,e))}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(he(t,e))}async _syncTemporaryHighlight(e,t){if(!this.highlightEnabled)return this._currentTemporaryHighlight?.handle.remove(),void(this._currentTemporaryHighlight=null);if(await u(25),g(t),!this._currentTemporaryHighlight&&!e)return;const{id:i}=this._currentTemporaryHighlight??{};if(i===e)return;this._currentTemporaryHighlight?.handle?.remove(),this._currentTemporaryHighlight=null;const{_highlightableLayerView:s,layer:l,highlightEnabled:o}=this;e&&s&&l&&o&&(this._currentTemporaryHighlight={id:e,handle:s.highlight(e,{name:O})})}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach(e=>this._addTableHighlight(e)):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.add(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.remove(t,e)}async _onHighlightIdsChange(e){const{added:t,removed:i}=e,{attachmentsViewOptions:s}=this;if(this._tableHighlightsReady?(i.forEach(e=>this._removeTableHighlight(e)),t.forEach(e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),null!=s.objectId){const e=this.highlightIds.at(0);if(null!=e){const t=await this.store.getAttachmentsByObjectId(e,!0);s.set({attachmentInfos:t,objectId:e,mode:t.length?"list":"file"})}}}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}_showAllRelatedTables(e){const t=e.layer;if(!t)return;const i=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,i)});const s=e.hiddenFields;s.includes(oe.action)||s.add(oe.action),s.includes(oe.attachments)||s.add(oe.attachments)}_hideAllRelatedTables(e){const{layer:t,relationship:i}=e;if(t&&null!=i?.id)if(null!=e.attachmentsViewOptions.objectId){const i=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabled:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)})}else e.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:de(t,i.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([oe.action,oe.attachments])}_getTableTemplateForRelatedTableView(e,t,i){return new ee({columnTemplates:[new X({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([s,l])=>({selected:s===t,label:l||s,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,s,i)}}))},resizable:!1}),new Y({autoWidth:!1,collapsed:!0,flexGrow:0,label:"",resizable:!1,relationshipId:i,width:ue})]})}_getTableTemplateForShowAllTablesView(e,t){const i=[new X({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([i,s])=>({selected:i===t,label:s||i,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,i)}}))},resizable:!1})];return null!=e.attachmentsViewOptions.objectId&&i.push(new D({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:ue})),new ee({columnTemplates:i})}async _onShowPromptCallback(e){const{column:t,objectId:i,oldValue:s,value:l}=e,{_subtypes:o,layer:r}=this;if(!r||!o.length)return void t.cancel();const n=o.find(e=>e.code===l);if(!n)return void t.cancel();const a=b(),h=this._createSubtypeEditPrompt(s,n,a),d=!!r.parent;try{this.showPrompt(h);const e=await a.promise,s=[{fieldName:t.fieldName,value:l}];switch(e){case"update-fields":for(const[e,t]of Object.entries(n.defaultValues))null!=t&&s.push({fieldName:e,value:t});await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"keep-existing":await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"undo":t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,s){const{_subtypes:l,messages:o,messagesCommon:r}=this,n=l.find(t=>t.code===e)?.name??`${e}`;let a="update-fields";const h=[{label:o.subtypes.useDefaultValuesOption,value:"update-fields"},{label:o.subtypes.keepCurrentValuesOption,value:"keep-existing"}];return{context:"info",title:o.subtypes.changeWarningTitle,message:i(o.subtypes.changeWarning,{originalType:n,newType:t.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>{a=e},actions:{primary:{label:r.apply,action:()=>s.resolve(a),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>s.resolve("undo")}},cancel:()=>s.reject()}}_onShowAttachments({objectId:e}){this.attachmentsViewOptions.objectId=e}_getTableTemplateForAttachmentsView(e){return new ee({columnTemplates:[new X({fieldName:e,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(this).map(([t,i])=>({selected:t===e,label:i||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}}))},resizable:!1}),new D({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:ue})]})}_extractFieldColumnInfosFromTableTemplate(e){const t=e??this,{layer:i,tableTemplate:s}=t;return s?s.columnTemplates.filter(({type:e})=>"field"===e||"column"===e).map(({fieldName:e,label:t})=>{if(null!=t&&""!==t)return[e,t];const s=i?.fieldsIndex.get(e);return[e,s&&I(s,i)]}):i?.fields.map(e=>[e.name,I(e,i)])??[]}_getDefaultLayerDisplayField(e){const{displayField:t,objectIdField:i}=e;return t&&""!==t.trim()?t:i||(e.fields.length?e.fields[0].name:"")}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex(e=>e.frozenToEnd);return e>-1?e:void 0}_logWarning(e,t){t?d.getLogger(this).warnOnce(e):d.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){null!=e&&null!=this.attachmentsViewOptions.objectId&&this.highlightIds.add(e)}};e([_()],ge.prototype,"_defaultHiddenFields",null),e([_()],ge.prototype,"_effectiveTableTemplate",null),e([_()],ge.prototype,"_effectiveAttributeTableTemplate",null),e([_()],ge.prototype,"_highlights",void 0),e([_()],ge.prototype,"_highlightableLayerView",null),e([_()],ge.prototype,"_selectionManager",null),e([_()],ge.prototype,"_selectableLayer",null),e([_()],ge.prototype,"_subtypes",null),e([_()],ge.prototype,"_tableHighlightsReady",null),e([_()],ge.prototype,"_viewSelection",null),e([_()],ge.prototype,"_viewSelectionReady",null),e([_()],ge.prototype,"activeFilters",null),e([_({readOnly:!0})],ge.prototype,"activeSortOrders",null),e([_()],ge.prototype,"allRelatedTablesVisible",null),e([_()],ge.prototype,"attachmentsColumns",null),e([_()],ge.prototype,"attachmentsEnabled",null),e([_()],ge.prototype,"attachmentsViewOptions",void 0),e([_({type:j})],ge.prototype,"attributeTableTemplate",void 0),e([_()],ge.prototype,"autoRefreshEnabled",void 0),e([_()],ge.prototype,"clearPrompt",null),e([_({readOnly:!0})],ge.prototype,"columns",void 0),e([_()],ge.prototype,"dataProvider",void 0),e([_()],ge.prototype,"definitionExpression",null),e([_()],ge.prototype,"fieldColumns",null),e([_({types:v})],ge.prototype,"filterGeometry",null),e([_()],ge.prototype,"filterBySelectionEnabled",null),e([_({readOnly:!0})],ge.prototype,"grid",void 0),e([_()],ge.prototype,"hiddenFields",null),e([_()],ge.prototype,"highlightEnabled",void 0),e([_()],ge.prototype,"initialSize",null),e([_()],ge.prototype,"isQueryingOrSyncing",null),e([_()],ge.prototype,"isSyncingAttachments",null),e([_()],ge.prototype,"layer",null),e([_()],ge.prototype,"layers",void 0),e([_()],ge.prototype,"layerFieldConfigurations",null),e([_()],ge.prototype,"layerView",null),e([_()],ge.prototype,"menuConfig",void 0),e([_()],ge.prototype,"messages",void 0),e([_(),pe("esri/t9n/common")],ge.prototype,"messagesCommon",void 0),e([_(),pe("esri/core/t9n/Units")],ge.prototype,"messagesUnits",void 0),e([_(),pe("esri/widgets/support/t9n/uriUtils")],ge.prototype,"messagesURIUtils",void 0),e([_()],ge.prototype,"outFields",null),e([_()],ge.prototype,"prompt",void 0),e([_()],ge.prototype,"relatedRecordsEnabled",null),e([_()],ge.prototype,"relatedTable",null),e([_()],ge.prototype,"relatedTables",void 0),e([_()],ge.prototype,"relationship",null),e([_()],ge.prototype,"relationshipColumnConfigs",void 0),e([_()],ge.prototype,"relationshipColumns",null),e([_()],ge.prototype,"relationshipConfig",null),e([_()],ge.prototype,"relationshipInfos",null),e([_()],ge.prototype,"relationships",null),e([_()],ge.prototype,"returnGeometryEnabled",null),e([_()],ge.prototype,"returnMEnabled",null),e([_()],ge.prototype,"returnZEnabled",null),e([_()],ge.prototype,"selectionSource",void 0),e([_()],ge.prototype,"showAllRelatedTables",null),e([_()],ge.prototype,"showPrompt",null),e([_()],ge.prototype,"showRelatedTableCallback",void 0),e([_({readOnly:!0,type:J})],ge.prototype,"store",void 0),e([_()],ge.prototype,"supportsAttachments",null),e([_()],ge.prototype,"supportsAddAttachments",null),e([_()],ge.prototype,"supportsDeleteAttachments",null),e([_()],ge.prototype,"supportsResizeAttachments",null),e([_()],ge.prototype,"supportsUpdateAttachments",null),e([_()],ge.prototype,"syncTemplateOnChangesEnabled",void 0),e([_()],ge.prototype,"tableController",void 0),e([_()],ge.prototype,"tableParent",void 0),e([_({type:ee})],ge.prototype,"tableTemplate",void 0),e([_()],ge.prototype,"tableTemplateOverride",void 0),e([_({type:x})],ge.prototype,"timeExtent",null),e([_()],ge.prototype,"timeZone",null),e([_()],ge.prototype,"view",null),ge=e([C("esri.widgets.FeatureTable.FeatureTableViewModel")],ge);const be=ge;export{be as default};
@@ -5,7 +5,7 @@ import type VisibleElements from "./FeatureTemplates/VisibleElements.js";
5
5
  import type { Icon } from "@esri/calcite-components/components/calcite-icon";
6
6
  import type { FeatureTemplatesViewModelEvents, FeatureTemplatesViewModelProperties } from "./FeatureTemplates/FeatureTemplatesViewModel.js";
7
7
  import type { Filter, GroupByType } from "./FeatureTemplates/types.js";
8
- import type { HeadingLevel } from "./support/Heading.js";
8
+ import type { HeadingLevel } from "./support/types.js";
9
9
  import type { VisibleElementsProperties } from "./FeatureTemplates/VisibleElements.js";
10
10
  import type { WidgetProperties } from "./Widget.js";
11
11
 
@@ -14,7 +14,7 @@ import type { FetchPopupFeaturesResult } from "../../views/types.js";
14
14
  import type { Abilities as FeatureViewModelAbilities } from "../Feature/types.js";
15
15
  import type { PopupOpenOptions, State, FetchFeaturesOptions, InitialDisplayOptions, ActionEvent, PopupAction } from "../Popup/types.js";
16
16
  import type { GoTo, GoToProperties } from "../support/GoTo.js";
17
- import type { GoToParameters } from "../support/goToUtils.js";
17
+ import type { GoToParameters } from "../support/types.js";
18
18
  import type { ActionToggleProperties } from "../../support/actions/ActionToggle.js";
19
19
  import type { ActionButtonProperties } from "../../support/actions/ActionButton.js";
20
20
  import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
@@ -111,7 +111,7 @@ export interface FeaturesViewModelEvents {
111
111
  *
112
112
  * @see [Popup#actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions)
113
113
  * @see [PopupTemplate#actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions)
114
- * @see [Features#open()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Features.html#open)
114
+ * @see [open()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Features.html#open)
115
115
  * @example
116
116
  * featuresWidget.open({
117
117
  * location: event.mapPoint,
@@ -16,8 +16,7 @@ import type { WidgetProperties } from "./Widget.js";
16
16
  import type { FeatureContentMixin, FeatureContentMixinProperties } from "./Feature/support/FeatureContentMixin.js";
17
17
  import type { FeaturesViewModelEvents, FeaturesViewModelProperties } from "./Features/FeaturesViewModel.js";
18
18
  import type { PopupOpenOptions, FetchFeaturesOptions, InitialDisplayOptions } from "./Popup/types.js";
19
- import type { GoToOverride } from "./support/goToUtils.js";
20
- import type { HeadingLevel } from "./support/Heading.js";
19
+ import type { HeadingLevel, GoToOverride } from "./support/types.js";
21
20
  import type { ActionBaseProperties } from "../support/actions/ActionBase.js";
22
21
  import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
23
22
  import type { FeaturesVisibleElementsProperties } from "./Features/FeaturesVisibleElements.js";
@@ -4,7 +4,7 @@ import type Widget from "./Widget.js";
4
4
  import type FloorFilterViewModel from "./FloorFilter/FloorFilterViewModel.js";
5
5
  import type { Icon } from "@esri/calcite-components/components/calcite-icon";
6
6
  import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
7
- import type { HeadingLevel } from "./support/Heading.js";
7
+ import type { HeadingLevel } from "./support/types.js";
8
8
  import type { FloorFilterViewModelProperties } from "./FloorFilter/FloorFilterViewModel.js";
9
9
  import type { WidgetProperties } from "./Widget.js";
10
10
 
@@ -32,7 +32,7 @@ export interface HomeViewModelEvents {
32
32
  /**
33
33
  * Fires when the [Home#go()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#go) method is called.
34
34
  *
35
- * @see [Home#go()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#go)
35
+ * @see [go()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#go)
36
36
  * @example
37
37
  * homeWidget.on("go", function(event){
38
38
  * console.log("updating viewpoint");
package/widgets/Home.d.ts CHANGED
@@ -5,7 +5,7 @@ import type { Icon } from "@esri/calcite-components/components/calcite-icon";
5
5
  import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
6
6
  import type { WidgetProperties } from "./Widget.js";
7
7
  import type { HomeViewModelEvents, HomeViewModelProperties } from "./Home/HomeViewModel.js";
8
- import type { GoToOverride } from "./support/goToUtils.js";
8
+ import type { GoToOverride } from "./support/types.js";
9
9
  import type { ViewpointProperties } from "../Viewpoint.js";
10
10
  type HomeMessages = Record<string, unknown>;
11
11
 
@@ -168,7 +168,7 @@ export default abstract class ListItemPanel extends ListItemPanelSuperclass {
168
168
  accessor open: boolean;
169
169
  /**
170
170
  * The title of the panel. By default, this title matches the
171
- * {@link widgets/ListItem#title ListItem's title}. Changing this
171
+ * [ListItem#title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#title). Changing this
172
172
  * value will not change the title of the ListItem in the LayerList.
173
173
  */
174
174
  accessor title: string;
@@ -13,8 +13,8 @@ export type VisibilityAppearance = "default" | "checkbox";
13
13
  export type FilterPredicate = (item: ListItem) => boolean;
14
14
 
15
15
  /**
16
- * Function definition for the [LayerList#listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction), {@link widgets/LayerList/interfaces#baseListItemCreatedFunction},
17
- * and {@link widgets/LayerList/interfaces#referenceListItemCreatedFunction} properties.
16
+ * Function definition for the [LayerList#listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction), [BasemapLayerList#baseListItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapLayerList.html#baseListItemCreatedFunction),
17
+ * and [BasemapLayerList#referenceListItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapLayerList.html#referenceListItemCreatedFunction) properties.
18
18
  * See the example snippets in the documentations for those properties for more details.
19
19
  *
20
20
  * @param event - An object containing a list item created by the LayerList.
@@ -17,7 +17,7 @@ import type { TableListProperties } from "./TableList.js";
17
17
  import type { WidgetProperties } from "./Widget.js";
18
18
  import type { LayerListViewModelEvents, LayerListViewModelProperties } from "./LayerList/LayerListViewModel.js";
19
19
  import type { Action, FilterPredicate, ListItemModifier, VisibilityAppearance } from "./LayerList/types.js";
20
- import type { HeadingLevel } from "./support/Heading.js";
20
+ import type { HeadingLevel } from "./support/types.js";
21
21
  import type { LayerListVisibleElementsProperties } from "./LayerList/LayerListVisibleElements.js";
22
22
 
23
23
  export interface LayerListProperties extends WidgetProperties, IdentifiableMixinProperties, Partial<Pick<LayerList, "catalogOptions" | "collapsed" | "dragEnabled" | "filterPlaceholder" | "filterPredicate" | "filterText" | "headingLevel" | "knowledgeGraphOptions" | "listItemCreatedFunction" | "minDragEnabledItems" | "minFilterItems" | "operationalItems" | "selectedItems" | "selectionMode" | "view" | "visibilityAppearance">> {
@@ -11,7 +11,7 @@ import type { LayerInfo } from "./types.js";
11
11
  import type { WidgetProperties } from "./Widget.js";
12
12
  import type { CardViewProperties } from "./Legend/styles/card/CardView.js";
13
13
  import type { ClassicViewProperties } from "./Legend/styles/classic/ClassicView.js";
14
- import type { HeadingLevel } from "./support/Heading.js";
14
+ import type { HeadingLevel } from "./support/types.js";
15
15
  import type { ActiveLayerInfoProperties } from "./Legend/support/ActiveLayerInfo.js";
16
16
  import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
17
17
  import type { LegendViewModelProperties } from "./Legend/LegendViewModel.js";
@@ -9,7 +9,7 @@ export interface LocateViewModelEvents {
9
9
  /**
10
10
  * Fires after the `locate()` method is called and succeeds.
11
11
  *
12
- * @see [locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate)
12
+ * @see [LocateViewModel#locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate)
13
13
  * @example
14
14
  * locateBtn.on("locate", ({ position }) => {
15
15
  * const { longitude, latitude } = position.coords;
@@ -20,7 +20,7 @@ export interface LocateViewModelEvents {
20
20
  /**
21
21
  * Fires after the [Locate#locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#locate) method is called and fails.
22
22
  *
23
- * @see [locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate)
23
+ * @see [LocateViewModel#locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate)
24
24
  */
25
25
  "locate-error": LocateViewModelLocateErrorEvent;
26
26
  }